/dpt/ - Daily Programming Thread

What are you working on, Sup Forums?

Old thread:

Why is she wearing the the hat on her knee?

Functional programming thread:

because she's a .NEET

pls respond

Getting a sound stream to work in my decentralized streaming platform.

I'm going to run out to microcenter to pick up a cheap amp for some speakers, so I can plug a Raspberry Pi in and get a rag-tag surround sound system built from BasicTV.

Pic related are the speakers i'm going to use (big ones probably need a more powerful amp, three small ones are a good start). The small ones were $2 a pop and the pair of black ones ran me $5

I'm working on Opus compression. I'm also going to make a macro system for different surround sound systems, so individual streams can be associated with different speakers (front left, front right, rear left, rear right, subwoofer, etc).

So how is your Christmas going Sup Forums?

>2 days old

Just let it die, lad. We don't need two separate programming threads.

Cool. Who else /wasteTheirTime/ here? Who else /PissAwayThePreciousGiftOfLife/ here?

Not me.

Actually it's quite a nice thread

Ruby, I've found you a friend

I've already got an entire thread full of horsefucker tripfags on another *chan to socialize with.

Trying to create a simple .exe in C++ so I don't need to use .bat files and can use it in windows PATH.


Here's the code I'm using:

#include
#include


int main ()
{
system("start \"C:\\streamlink\" \"C:\\streamlink\\python\\python.exe\" \"C:\\streamlink\\streamlink\\Streamlink.py\" --config=\"C:\\streamlink\\streamlinkrc\" %* best");
return 0;

}

the thing is that %* works in .bat files to pass along the arguments to streamlink.py but it doesn't in C++, how do I do this properly then?

if I am dealing with float colors ( 0.0 - 1.0 float for each RGB channel) how would I properly "snap" the variable to simulate say 3-bits per channel?

round(Red * 8.0) / 8.0f?

this seems to get a just one more brighter color for some reason.

Have you learned FP yet?

isnt the %* a shell feature instead of being part of the command? Perhaps try passing this into a shell interpreter

I think it's a cmd.exe feature but my understanding was that "system()" basically called cmd so it would work, I know fuck all about c++

I just finished a beginner's C++ course. For a reference of where we ended the professor on the last day just briefly went over what objects/classes were.

Anyone have any recommendation for where to enhance my knowledge?

Can you guys recommend some well-written Python programs to check out? Preferably an everyday ones.

Perhaps she's wondering why someone would shoot a woman before throwing her out of a plane.

Why would anyone shoot a woman at all?

>Preferably an everyday ones.
What would that be?

If you want to learn python Pypy would probably be the best option.

well, you could put all of that stuff in your .bat file and then use .exe to execute your bat file.

It would be extremely painful

Books.

...

No one cared who she was until she put on the hat.

PyPy seems too big, I've meant something like youtube-dl, ranger.

(You)
(You)
(You)
(You)

Start by implementing only a subset of the language.

Write a program to print Merry Christmas in your favorite language

Which books

main = print "Merry Christmas!\nHappy birthday Jesus!"

It seems you learned a lot of C. Maybe you should learn some C++ now.

10 PRINT "MERRY CHRISTMAS!"
20 RUN

whoops, putStrLn would be better than print

main = mapM_ putStrLn ["Merry Christmas!", "Happy birthday Jesus!"]

#include

int main()
{
::puts( "Merry Christmas!" );
return 0;
}

Maybe not.

btw, you are not a girl and will never be

It is well known that he is a hairy man and he has never stated otherwise

Stop talking in third person.

But good, good. Let's try to forget your degenerate past.

she*

considering using powershell. it fixes lots of problems with batch. for example i was just trying to run a batch script someone else wrote from my batch script, and it would never fucking work no matter what I did. i just put script.bat in my powershell file and for some reason it worked. i don't fucking understand why batch is the way it is but PS has saved a lot of headache

Not him desu
He posted a pic of himself before (or some user did) and he had long gray beard and an ugly shirt

I want it to be a .exe file so I can just add the damn folder to PATH and do "streamlink THING" from WinKey + R

Batch scripts are okay for one line scripts. Powershell for anything complicated though.

I'm pretty sure you can run a batch script from win+r.

I suppose it's not possible to create some OS for smartphones that wouldn't be slow?
What would be your ideal smartphone OS, though?

tis-100

her*

...

I was in the same boat. Basically you know some C and zero C++.

Check out templates and inheritance, that's where real C++ starts. Although you don't have to use inheritance in your programs.

Making a smartphone OS that performs well is not really going to be much more difficult than making a desktop OS that performs well.

Problem is application programmers use better specs as an excuse to make shittier applications.

Are the pieces too bright?

Maybe the background is too black?
jk, it looks okay. And I like darker bg since cobwebs.

If I get an IBM Model M keyboard will I become a better programmer?

Just write quality C code. C++ is a meme.

No. Get knee socks.

I know that it's a meme, I just want to be able to feed myself later in life too so I'll play along.

Can't really imagine being a 55 year old web dev. But in C++ coding that's like average senior professional age.

Worse?

Inheritance is not really important¸ but useful from time to time for virtual method dispatch.

Templates are very useful, and very powerful, but most people won't end up abusing the fuck out of it. Standard template library covers a lot of use cases.

RAII is where C++ shines: automatic and deterministic resource management. Objects are self-contained state machines. When an object is created, its resources are allocated. When an object is destroyed, its resources are freed.

No. It will have no effect whatsoever.

This will also have no effect.

(displayln "merry christmas")

(format t "merry christmas~%")

." merry christmas" cr

int main () {
std::cout

>No. It will have no effect whatsoever

Do you tripfag just so people will know that you're wrong literally all the time?

>Standard template library
That too is part of the ever expanding "C++ package" and learning that alone is probably harder than learning two simpler languages.

>Do you tripfag just so people will know that you're wrong literally all the time?

No one cared who she was until she put on the trip.

> nl2br() in global namespace

I hate php so much :(

nl2br is the bread and butter of web dev

This makes me want to die

Most of the time spent programming is not spent typing up code. A keyboard that might marginally improve typing speed isn't going to improve your ability to write code that is performant and maintainable.

STL is mostly straightforward, user, and if you're going to use C++, you might as well use it. Because really, do you want to roll your own vectors? Do you want to use something like Klib that is really only somewhat decent and not maintained at all?

He, user. Say "He".

>Most of the time spent programming is not spent typing up code. A keyboard that might marginally improve typing speed isn't going to improve your ability to write code that is performant and maintainable.
>most of the time spent on a mars expedition is travelling to mars
>it doesn't matter how fast you're able to decelerate upon reentry

the end goal and output of web dev is generating html

so there's really nothing wrong with nl2br in global namespace, it's just convenient af

Just got this one. Good choice? What's the best IDE to go for?

nl2br is the paratha and chutney of web dev

Slightly off topic, but to me it seems like Rust's standard library is also incredibly dense and complicated, and is hugely vital to being able to write effective software in Rust.
Any language requires knowledge of the standard library, so what's really important is the available documentation.

That's a pretty bad argument, user. And raw key press/release speed is not as important as
- ability to quickly come up with code to write
- ability to quickly find troublesome parts of code
- ability to refactor and rewrite code, or write code that doesn't need to be constantly refactored (thus saving time)

Have fun with your XSS vulnerabilities bub

I start to cringe just by seeing that identifier.

I know that STL is necessary... but it's very far from being consistent or complete (just compare string to mature libs in other languages) and yet the sheer size of it is massive somehow.

>Slightly off topic, but to me it seems like Rust's standard library is also incredibly dense and complicated, and is hugely vital to being able to write effective software in Rust.
The main competitors are Java and C#. Rust will not enter the picture for years if ever.

That's a bad analogy. Think about it like this: what is more important, spending more time designing a ship that can decelerate fast enough when you finally get there, or spending less time in transit to Mars? Typing up code is like the trip to Mars. It gets you to the destination, but it's not where the real work is done.

Plenty of languages have super huge standard libraries, not just C++. The STL is actually pretty small relative to say, the standard libraries in Java or .NET languages.

>what's really important is the available documentation
Yep!

How come i can't call the method setText before i assign the TextView object to a variable?

>Java or .NET
>defends the third world language in existence by saying it's no worse than the second and the first.

reported for violation of rule number 6

third worst*

Try wrapping that line in parentheses, like

((TextView)findViewById(R.id.myText)).setText();

Just about everything you need to get started on game development is on MikeGeigTV. Assuming you already know a little C++

Which languages do you have in mind?

BTW, Java and .NET libs are more usable.

Thanks a lot kind user.

Using the report queue to try and get people banned for having unpopular opinions is actually a violation of global rule #7.

It is the nature of templates. They generate an entirely new class and a set of associated methods for each template instantiation. There is a potential for things to get huge.

Hey guys, I posted last night but got no responses. My flight was cancelled so I'm all alone this Christmas. I've got >5 years ecommerce experience, primarily a C++ dev.

Anyone want to throw some ideas as to what I should do for the next 1-2 days?

Also, if you have questions about C++, I'd be happy to help.

#include "stdafx.h"
#include
#include
#include
#include

//given the sorted vector of ints "ivec", use std::find_if
//std::accumulate and a lambda to sum all the like numbers
//output should read 5, 10, 15, 20
int main()
{
std::vector ivec{ 1,1,1,1,1,2,2,2,2,2,3,3,3,3,3, 4,4,4,4,4 };

return 0;
}


Pop quiz, /dpt/.

>C++
>1-2 days
is that like 1-2 hours in other languages?

>ideas
Write a non-trivial program that will take a day to run.

Since you are talking about C++, Java and .NET, I suppose you want a code monkey job.
Then go with clojure and scala, good languages that run on the jvm and can use java libraries.

>Also, if you have questions about C++, I'd be happy to help.
Why the developer make it so shit? It actually had potential.

I'm pretty fast at working with C++. With my own small git repo, I'm typically able to work as fast as my coworkers do in python. But I appreciate the joke nonetheless. =)

I do that at work, there's nothing fancy about that. =(

I like it. Different strokes for different folks.

What is not code monkey then? All the more efficient "intellectual", innovative or sciency software is being written in those three basically.

>stdafx.h

Microsoft is the best...Problem?

>What is not code monkey then?
Clojure, Scala, C, Ruby, Python
Plenty of science and production code been written in those.

But for real, choosing a good language will only make you job easier. If you are good mathematician or engineer companies will find a way to integrate your code in other languages or will give you training.

(I will not say haskell and other lisp dialects because I don't want to get memed)

And with all due respect for its efficiency, pure C with it's tiny set of capabilities and tricks will not stimulate your intellect after a while, like at all.

Me, ctd, didn't see #include
#include
#include
#include

void do_thing(const std::vector& v) {
auto trailing_ptr = v.begin();
while (trailing_ptr != v.end()) {
const auto leading_ptr = std::find_if(
trailing_ptr, v.end(), [&](const int i) { return i != *trailing_ptr; });
std::cout

> not code monkey
>Ruby, Python
kek

What's the point in having that if you're not going to include all the STL headers in there?