/dpt/ - Daily Programming Thread

What are you working on, Sup Forums?

Old thread:

Other urls found in this thread:

marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools
code.visualstudio.com/docs/languages/cpp
strawpoll.me/13810583
twitter.com/NSFWRedditVideo

lisp

#include

>Pinky never hits ctrl

Shit waifu, honestly.

Why does /dpt/ shit on Scala?

...

>What are you working on, Sup Forums?

Official /dpt/ ultimate SoKoBan

>Official /dpt/
it will never get pass the commitee, just give up.

int add(int a = 5, int b = 3)
{
return a + b;
}

int main()
{
int (*fptr)(void) = add;
}

>error: invalid conversion from 'int (*)(int, int)' to 'int (*)()
default parameters a shit

What would /dpt/ recommend for an IDE for C/C++ , might also dabble in JS, so if I can use one IDE for all of it, that might be best?

Preferably something windows/linux cross platform.

dpt has a committee?

clion
visual studio code

Writing an imageboard engine in Haskell.

> Seriously, what is your opinion on Rust compared to related languages?
Rust is better than C because it has a clean design which integrates a lot of achievements from the past 20 years of PLT development without compromising on the performance, it's safer and it's more expressive. Rust is better than C++ because it's simpler, more coherent, safer, and doesn't have 40 years of legacy baggage to support. Borrow checker is the main point here, but the type system/pattern matching, generics, error handling, and cargo are important too.

I don't consider Go, D or Swift relevant here since they are all tainted with GC, but even if I didn't care about performance and memory usage, I would definitely use Rust over Go(because Go is a braindead language) and probably over D and Swift as well, because of the type system, error handling, cargo, and the community.

It's in Lisp, everything in Lisp becomes official without comitee.

>because Go is a braindead language
Can someone give me a quick rundown on this meme?

So Clion > Netbeans? Its another one I've heard of as viable for C/C++ but not sure about JS.

VS code isnt really an IDE though right, no GUI debugger? At that point might I just stick with VIM? Or am I wrong to think of VS code this way

>static typing without generics
>returning val, err

Lisp, Scheme or Racket? Does Racket even support CLisp?

>and the community
Oversensitive trannies doesn't seem like a real plus for a language

QtCreator for C/C++
VSCode for JS

>So Clion > Netbeans? Its another one I've heard of as viable for C/C++ but not sure about JS.
netbeans is still maintened? looks like abandon ware now.

>VS code isnt really an IDE though right, no GUI debugger?
marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools
code.visualstudio.com/docs/languages/cpp

All Lisps are OK.

The language was specifically designed to be as simple as possible because Java is too hard to the herds of Pajeets Google employ.

>int (*fptr)(void)
Remove the void.

won't change anything, it's sepples.

Neato, got GitHub or something? I could contribute every now and again.

The saddest thing that will happen when Go finally implements generics is the death of all these memes

Making a random image viewer (windows forms C#). I was tired of Windows Photo Viewer's slideshow functionality. It's slow and forces the slideshow onto the main monitor in a dual monitor setup. Plus it can only handle once instance as far as I know. Now I can finally spam slideshows left and right woohoo.

Generics is one of many issues Go has.
>error handling
>no tuples
>bad dependency management

I'm sure they'll find the most retarded way to do it, making them a sugar for interface{} for example, like Java does. The funniest thing will be to watch Go-fags, who spent years claiming that no one needs generics, suddenly change gears and start praising Pike for implementing them.

Soon. I will make it public after implementing all the essential endpoints.

b-but that's the fun part..

Sorry, user.
There will still be a lot of fun things to do afterwards.

Alright, hope I don't miss you announcing it or something…

What would you recommend for someone wanting to learn Rust but knowing nothing about it? I come from a C# background.

Whatever they recommend on the site now, I guess it's the second edition of the book. I've read the book, rust-by-example and a lot of blog posts explaining stuff, but the real appreciation of the language came after I spent some time reading the source of the standard library. It's clear, well-designed and well-documented code which is easy to read and, unsurprisingly, makes perfect use of the language.

Default params just make an implicit overload. Wouldn't doing an explicit overload help?

To be honest, I always thought it worked like overloads do. You could certainly do that though.

I am writing a image board in node express react and mongodb

Be honest, have you done ALL the exercises from K&R?

no thanks

PROGRAMMING CHALLENGE

Make a £sd calculator. It must be able to add, subtract in £sd, multiply and divide by decimal fractions. Lowest coin is farthing.

So far, we have a solution in APL and J!
What other languages will present Sup Forums later?

What is the best way to do it? I'm thinking of resetting the branch, redoing my commits in a logical way, then creating separate branches on top of master and cherry-picking these new commits into them.
Needless to say, straightforward rebase results in a shitton of conflicts and I don't really need ~1/3 of this code.

I wonder if anyone unsarcastically solved every ex from sicp

...

What's the problem here?
do {
scanf("%d", &int_1);
scanf("%d", &int_2);
if (int_1 % int_2 != 0)
printf("%d does not evenly divide %d.\n", int_2, int_1);
else if ( int_1 % int_2 == 0)
printf("%d evenly divides %d.\n", int_2, int_1);


} while (int_1 != 0 || int_2 != 0);


Everything works besides while (int_1 != 0 || int_2 != 0); intention if that was to exit loop when 0 is entered but when I enter 0 it asks for another scanf and if I input 0 program crashes

You probably didn't initialize variables.

>0
>evenly divides
>evenly divides by zero
Think about it user.

Oh wait, you just divide by zero here.

This sounds so easy and annoying at the same time I'm not even getting around to checking the conversion rates.

Thanks
zero = 1;
do {
scanf("%d", &int_1);
scanf("%d", &int_2);
if (int_1 == 0 || int_2 == 0)
zero = 0;
else if (int_1 % int_2 != 0)
printf("%d does not evenly divide %d.\n", int_2, int_1);
else if ( int_1 % int_2 == 0)
printf("%d evenly divides %d.\n", int_2, int_1);


} while (zero == 1);


that didn't work either

4 farthings = 1 penny
12 pence = 1 shilling
20 shillings = 1 pound

What I do is

1. Squash any work on my branch that I don't need: make the work as self-contained as reasonably possible without losing things we want to preserve. If you made a commit then in next commit reverted half of it, just squash it in: it's not important, it will be gone anyway and you have half a commit less to cause conflicts for the rest of the branch
2. If number of my commits is now small, rebase and resolve. If not either cherry-pick one at a time (really this is just a rebase but easier to see what's happening) and fix them up or cherry-pick hunks that are still needed, carefully examining what the conflicts are on the way. Usually want to build after each commit conflict resolution to assure sane bisect: the fewer commits you have, the better off you are.

Hm, I guess basically just squash all you can and have fun resolving whatever conflicts you have left for next few hours…

try something like
scanf("%d", &int_1);
scanf("%d", &int_2);

while (int_1 != 0 && int_2 != 0) {
if (int_1 % int_2 != 0)
printf("%d does not evenly divide %d.\n", int_2, int_1);
else if ( int_1 % int_2 == 0)
printf("%d evenly divides %d.\n", int_2, int_1);
scanf("%d", &int_1);
scanf("%d", &int_2);
}

Nobody loves scala.
Functional guys hate that you can cheat your way through and use plain Java whenever you want.
Java guys hate the complicated syntax and freak the hell out from the Shenanigans you can do with this language. You can write 30 lines Java in 10 lines of Scala, but fully understanding this 10 lines is damn hard.


Err... of course!!
Just like I did e-every lesson in SICP.
Who wouldn't, hehe?
Stupid question.

That does make more sense. It was a problem from do-while chapter so do-while got stuck in my mind when I was writing that.
What is the point to do-while anyway if you can write it like that?

> Hm, I guess basically just squash all you can and have fun resolving whatever conflicts you have left for next few hours…
Yeah, I guess this is that I'm going to do now.

Your logic was right, the do-while is used when you want to run that piece of code at least one time.

The problem was when you tried to divide by zero.

>What is the point to do-while
It's the cleanest way to guarantee at least 1 execution of the loop.

want to get decent at programming just finished college (uk) so i'm 18. I have experience in visual basic (yes that what my qualification based on) and html, php js. Is it better to learn something such as c over web languages. Which language should i start to learn and which books should i torrent

Read most stuff Knuth wrote, especially AoCP. Choose any reasonably modern language you want. Sup Forums hates Java but it's the most likely to land you a job.

I am doing a foundation year at university to get my grades up so want to get good at a language until i start my comp sci degree i don't really know what they will be teaching i sort of want to know how to make websites well is php good to learn or would ruby be better

I also want to try playing around with neural nets at some point do you know which language would be good for that

If you're going to uni for CS then anything webdev will be completely useless (as in you'll do it in your 3rd year or later). Git gud at math, read up on algorithms and learn C/C++ as many professors like it.

redpill me on unity builds senpaitachi.
are they good for code size? are they good for optimisation? do they really cripple compile times? Assume I've only got a project of a few thousand lines

Depends, but you probably want to do something experimental and don't care about ultra optimization. Python is good for prototyping (and has cool libs for neural nets), switch to C++ or Java (if you're a scrub) to get better performance if needed.

it's pretty project dependent, and if you only have a few kloc i would just try it and compare. it's pretty easy to set up, just include cpp at the bottom of your headers

>learn basic lisp features
>can't do anything because there were no talk about I/O funtions
what do?

No one "does" anything with lisp, silly, you learn to feel smug on the internet.

Google "lisp io"?

What kind of shitty dialect doesn't have I/O? In CL you have open, close, with-open-file, etc, and the #p reader macro for pathnames.
Only horrible languages will get you a job, so you may as well learn a good one for its own sake.

daily reminder that as long as people use linux, there will be need for C

>What kind of shitty dialect doesn't have I/O?
One that was in SICP.

Scheme is probably implementation dependent, since it's a very small language at the core.

What's an interesting operating system that I can write about that was introduced before 1990, and that wasn't Windows, UNIX, or Mac?

BSD

>BSD
>Not unix

vms/openvms

>error handling
No different than doing it in languages without try/catch blocks

>No tuples
Don't need them when you have multiple return values from functions, and if you ABSOLUTELY need them it should belong to a struct, and if that seems overkill you need to re-evaluate your program structure

>Bad dependency management
Yeah that part is dogshit

Inferno

>vms
>not windows

AmigaOS

vms is hardly windows.
you're thinking of os/2. sure same designer but nothing about them is the same.

you meant to say pretending

your most qualified prospect is morbidly obese
do you still hire

I'm studying WinServer 2012 and i have a question

I have a working server with a DC/AD/DNS/DHCP on it. I want to add another server that has IIS in the server group

It founds the IIS server, i can ping it (it has static IP of 192.168.152.20 while my main server has 192.168.152.10). DHCP scope starts at .100-120

Problem is, i can't ping google.com or any name on that 2nd server, so it means DNS isn't working correctly. I tried DNS on the first one, it works, i added another A record into the DNS database with static IP, flushed the DNS with ipconfig /flushdns, but shit still doesn't work. Any other ping works on both servers.

Any idea?

what language should i learn next poll (bash vs perl6 vs crystal)
strawpoll.me/13810583

Bash, its the only useful one. Perl6 is DoA and Crystal doesnt even have windows compatibility

No hire. Tell him to come back when he works out his issues
I got nothing against fat people but you don't eat that fucking much unless there's some dark ass shit in your psyche

by the way, i tried installing from main server some additional role onto the 2nd server and it works, so only dns isn't working

when will reactos be good so that all the winfags can comfortably become upstanding members of foss society

I first consult with the services guys to see if it would be hard to get a chair and a table for him, and a work place where no one would have to smell him sweating all the day long. If it's hard, then I just skip him.

in another 19 years

A DM I knew had a rule that he'd let you into his session only if you could do 30 pushups. Weeded out the worst spergs really quickly and efficiently. Session quality improved tenfold.

who cares about windows cuck

How to prevent C compiler from compiling code without explicit type conversions?

you'll take your promotions and you'll like it.

why?

dumb frogposter
>your most qualified prospect is morbidly obese
stop talking about situations that are impossible

The entire software industry