/dpt/ - Daily Programming Thread

What are you working on, Sup Forums?

Previous thread:

Other urls found in this thread:

youtube.com/watch?v=BV86r2k6QI8
twitter.com/AnonBabble

Writing fizzbuzzes that trigger brainlets.

strict evaluation > lazy evaluation

java is good

give me telegram bot ideas you fucking niggers

youtube.com/watch?v=BV86r2k6QI8

Writing brainlet AI that generates fizzbuzzes.

Forgot to quote

>AssemblyInfo

So you can write assembly in C# or what?

>PYTHONIC
print('\n'.join((["","","Fizz"]*34)[n]+(["","","","","Buzz"]*20)[n] or str(1+n) for n in range(100)))

Also, linear time complexity

#include
main()??

>not writing superlinear time complexity fizzbuzz
it's like you're not even WEBSCALE

...
beautiful

what language doesn't suck?

inb4 use Python and stop giving a fuck about performance

>obsfucated c is still more readable than sepples/rust
lol

Java

>Write once, run anywhere

What a bunch of bullshit.

>what language doesn't suck?
They all suck. What do you want to accomplish?

but it's true

>use Python and stop giving a fuck about performance
there you go
but srsly,

more like
>write once, run away
hurr durr
or
>write once, debug everywhere

do you even know what youre talking about?

>do you even know what youre talking about?
do you even know where you are?

>Attempt once, complain everywhere

did you have a bad experience?

you offerin?

>Write once, java.lang.OutOfMemoryError everywhere

whats the K&R of c++

*list of ten books*

eat once, poo in everyloo

...

What said. There's no good central resource. Stroustrup's books are decent as references but shit for learning.

Why not just write functions around malloc and arrays to make them safer in C instead of inventing a new language?

interface Invokable {
void invoke();
}

class Lol {
Invokable[] arr;

public Lol(Invokable trueCase, Invokable falseCase) {
arr = new Invokable[]{trueCase, falseCase};
}

public void invoke(int b) {
arr[b].invoke();
}
}

public class Demo {
public static void main(String[] args) {
new Lol(
()-> System.out.println("Hello World"),
()-> System.out.println("Goodbye world")).invoke(0);
}
}

Dynamic checks are like body armour, they weigh you down and don't stop anyone from actually shooting at you, they just make it less painful to get shot.

Because C lacks too many good things to warrant using it in the current year.

use Runnable

Quit copying my code!!

>no license when you posted

the code is mine now

>What are you working on, Sup Forums?
making a stupid wrapper in perl for ffmpeg with defaults I copy/pasted from the internetz cause I'm too fucking stupid to understand anything about video-conversion and codecs and shit.

>wrapper in perl for ffmpeg with defaults
why not just a shell script?
or if it's a tad more complicated, python?
give us a peek luv

bool is_prime(int p)
{
if (p

int main(int n)
{
is_prime(n)
}
dunno what to do with this shit

What is everyone's favourite programming language?

>Python!
>C++!
>Java!

Ok, now that the kids have answered, what about the adults?

Idris, desu.

Why should I use Ruby?

lol

weak b8

Your algorithm is pretty bad, but I'm gonna let you think about that. Your main could look something like
int main()
{
int in;
in

What's bad about it?

Suppose I factor a composite number. What's its largest prime factor? What's it's largest minimum prime factor? How many even prime factors are there?

help a retard implement floating point arithmetic (specifically subtraction) in VHDL

>A + (-B)

>2nd compliment -B

>A + B'

>the normalization part now becomes the check for the sign of the result

seems about right?

i meant to 2nd compliment the mantissa, the exponent part is the same as in addition.

I don't understand how these questions are relevant to the question at hand..I am familiar with primes and composites...

It's O(n)

If you can answer those questions you should be able to optimize your algorithm a million-fold and more for certain inputs.

wtf does this mean

cause I wanted to do something in perl.
I think it's fun, and probably very powerful if I ever "master" it.

>give us a peek luv
it's just 2 functions so I can pass start and end time (instead of having to compute the length myself) and then calling ffmpeg with `system`.
nothing fancy

It means that in the worst case, to check if n is prime, it takes approximately n steps

So, I just started using Visual Studio Code to learn C, after many years since I last tried. One of the things VSCode suggests is to download Flexelint, but that thing is proprietary and costs a thousands bucks.

Should I bother with it? Is there a free, pirated version of it anywhere?

This is comedy gold. Genius!

I already know C and Java, im basically looking for C style syntax that is actually used

>something something memes something something

No

ugliest curly braces I've ever seen, frankly

Is there a good alternative to the K&R book? It's old and obtuse, is it really the best there is?

quick

C++

arrays

how

The compiler is right.

gravy train over boys. 10 years ago basically all you needed to land a decent job was a degree and basic programming skills
now you need crazy soft skills, 2-3 internships, >3.0 GPA, large and novel impressive side projects, connections, and be able to solve hard dynamic programming problems on the spot in order to make 45k a year

The code style might be outdated but everything else is tight. What problems are you having?

shit
I'm retarded
nevermind

went in balls deep into vectors that I forgot that arrays are just arrays

Threadly reminder that leaking memory and crashing is a valid side-effect, because there is no result. rustc will NOT compile programs that have unintended output, unlike C++.

>this is what NEETs actually tell themselves to quiet their own conscience

int main(void)
{
for(int i = 0; i

>This programming language castrates the developer, and that's a good thing!

Is this better? I have trouble with thin characters and Windows font rendering blows ass

How is avoiding making mistakes that have time and time again been made akin to castration?

why would anyone use lua when godlike javascript exists

>Windows font rendering blows ass
yup
>Windows
>terminal
I'm so sorry

name something you can program in C++ that you can't in Rust

>castrates
It's literally impossible to write software with incorrect output in Rust. Why do you want bugs in your software?

Modern C duh

>name something you can program in C++ that you can't in Rust
Programs with incorrect output.

object oriented

Absolutely not, lol

Instead of trying to improve on skills, you blame the system. The system is horribly broken, sure. But blaming the system on your inability to get a job is a self-fulfilling prophecy. It's like hating women because you can't get a girlfriend. Same thing.

why is java bad again?

Something that can earn money.

>this implication that rust programs that compile are free of bugs

gvim renders it slightly better

you shouldn't

working with some third party software, integrating it into an existing system.
this third world third party garbage is provided as a collection of dll files, which is already pretty unfortunate as the entire rest of the system is geared towards unix. it's implemented in some ridiculous BASIC variant so you have to cooperate with their runtime to make it work.
also the third party components are plain broken. had to break out a debugger and NOP out a bunch of stuff just to get things running.
bleh.

Not bad at all, it's C and C++ fags butthurt echo from the 90s

It's literally true. Rust doesn't compile programs with invalid results. (No, fucking C++ monkey, leaking memory and crashing is not a result, it's a valid side-effect)

You're a fucking idiot, memory errors are not the only class of bugs.

netbeans or intellij idea (community edition) for java development on Linux?
forced to use java for a data stuctures class

I've been programming every single day (hours a day) for months now. Sending out hundreds of resumes. I've taken a dozen online courses in various tools and frameworks that are in demand. I've reached out to recruiters. I wrote my own resume in LaTeX and have had it vetted from industry professionals who say it's good. I'm graduating in May with a bachelors in CS. I still haven't heard a goddamn thing from any of these companies. Not even a rejection.
Meanwhile the dipshit who struggled with foreach loops in his senior year, but knew a guy, got a job right away and didn't even have to send out a single resume.

You fucking retard, don't you understand what invalid results are?

There's a difference between not knowing what the fuck you're supposed to be programming and side effects

how do you not know anyone? just go hang out in some irc channels or slack groups. honestly you don't need to be extrovert extraordinaire to make contacts. where are you located?