/dpt/ - Daily Programming Thread

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

Other urls found in this thread:

code.dlang.org/
github.com/bkaradzic/bgfx
gcc.godbolt.org/
jonathanfischer.net/modern-common-lisp-on-linux/
mitpress.mit.edu/sicp/
twitter.com/NSFWRedditGif

First for D

Website in Python/Django

A tourist hub for 3rd world countries

I've had DMD installed for forever. I should probably start Ding it up.

How non free is the backend for DMD?

Writing literally the same function twice doesn't seem very dry to me, but maybe I'm just too used to dynamically typed languages.

Should I receive like this?
for (int i = 0; len != 0; ++i)
{
if (i == 511)
buf = malloc(sizeof(buf) + 512);

len = recv(sfd, buf + i, 1, 0);
printf("%c", buf[i - len - 1]);
}


Or should I receive in larger chunks?
What is the standard receive loop dogma?
It's for an irc bot.

a music tracker for avr microconrollers
and NO im not using arduino

Don't forget your dubs
code.dlang.org/
I have no idea desu

All recv variants have a peek mode which returns the exact buffer size that would be needed to store the next packet.

Low-level network programming is best programming

If I wanted to make graphical applications for both pc and mobile with my favorite obscure language than compiles C how should I do it?
github.com/bkaradzic/bgfx
My idea is to use bgfx which is cross platform renderer that has C api and I would init the application with bgfx and implement the rest with the other language.
Use build tools provided by bgfx to compile to every platform.

got any better idea?

sdl

SDL. It compiles to pretty much anything. Seriously, its headers are branches of macros asking about your instruction set, OS, etc

Your favorite obscure language that compiles to C generates totally portable code? Then it will work. There's a chance your favorite obscure language is platform specific though. I know mine uses some platform specific machine code and libraries. What language?

Yay, I finally ordered my file server (pic related).
In order to access my files remotely, I want to build a web based file manager. Kinda like ownCloud, but without the bloat. No JS and ideally no CSS. It should be doable in a short period of time, but I'm lazy as fuck.

You keep receiving until you have found \r\n, if you received a bit more, you chop it off and leave the extra stuff in a leftover buffer for the next packet.

>github.com/bkaradzic/bgfx
Looks like a ghetto SDL. Use SDL. It's most likely better supported than some god-forsaken github page. Also obviously you'd write your code in OpenGL.

What's the best c++ compiler, guys?

msvc

clang for error messages
gcc for optimization

>being too much of a bitch to read gcc error messages
>violating your freedom
>allowing apple to do its eee shit

Clang has a better performance, a world-class optimizer, the best error messages, and a very active community involving developpers and researchers.
GCC has old unix neckbeards that will yell at you if you report a bug.

that's pretty cool, senpai. good luck

its a not-so-secret industry secret that the intel compiler is one of the fastest in the world right. A lot of games and performance-critical software uses it.

You can see it in action here
gcc.godbolt.org/

/fpg/: functional programming general

>gcc.godbolt.org/
Thanks! I plan on learning Assembly and this is gonna be useful as fuck

What Sup Forums books are you reading?

...

which one should i use to print strings with a \n

code A:
printf("this is just a test!\n");


code B:
puts("this is just a test!");


Also, which one is faster?

>No CSS
That's just going to be gross if you do that. You can have CSS without the bloat. Just don't use a framework.

It's good for intel CPUs because it probably has optimized codepaths for intel-specific machine code.

You can use C as a backend if you're really into speed and minimalism

They're both as fast, the difference is negligible.
You should use printf just for consistency. puts is fine too, but it will give people a pause for a second.

directory listing + upload links. Wew lad.

...

gtfo pajeet, no one likes your kind

a few years ago i built a primitive python bot that uses the shodan api to find ip cams with default/weak passwords. recently revisited the project and managed to collect thousands of unprotected camera ips and credentials. today i was going through some of them and found this. someone added their credentials to some (a hundred at least) ip cameras.
for those who don't know, "fsociety" is an Anonymous like hacker group in the tv show Mr. Robot.
nothing to share about the code itself, it's pretty straightforward honestly. but i found this mildly cringy and thought i would share.

Thanks senpai. I'll post a vid once I get the basics working.
I initially wanted to use bootstrap because muh ease of use, until I followed the tutorial. Yeah, I should at least make up the HTML table.
Go is fast enough and has HTTP2 support.
Kinda like that. My goal is to implement the following:
- Listing
- Uploading by URL
- Uploading as multipart
- Removing
- Moving
- Managing torrent feeds

Go is a meme language though

Calm down, Sup Forums, you're getting all euphoric again.

Go is far from perfect, but it's the language I'm most comfortable in a project like this.

What is the purpose of using a sentinal node with doubly linked lists? versus having front and tail?

I haven't seen even one, but tell me more how people who pray to toilets have tech jobs in your country. have many designated streets have you crossed today?

*how

I live in rural UK. The devs here are 99% white

are front and tail enums? strings? objects??

front and tail nodes (recursive data with nodes: previous, next)

>rural UK.

You have a shotgun certificate, m8?

As a meta question, what's up with Sup Forums and cross dressing? Why there are so many traps on this board especially?

Anyone help?

>shotgun certificate
>UK
he probably needs a spoon permit

I don't even have a tv license m8, I'm an outcast here

Sup Forums is full of literal faggots and pedos.

All you are doing is asking them to post the its fun to program cross dressing shit.

Its a forced meme.

You better get a few shotguns. After all, the muzzies are coming to wreck your country.

Humanity has always been pedophile. Too bad Christianity banned it and took all the pretty boys away.

took all the pretty boys for themselves*

Gonna need to put some better bait on that Super Rod.

yeah I bet you like bringing up my Super Rod

reposting because no replies

i want to learn common lisp, but the tool the book im following recommends, lisp in a box, is apparently a dead project. is there anything else like it still being maintained?

pls respond

jonathanfischer.net/modern-common-lisp-on-linux/
lrn2ggl fgt

But do you use formal methods?

LLVM.

You understand that you can use themes for onwcloud, don't you?

Too bad the only thing you're catching with it is crabs.

mitpress.mit.edu/sicp/

GPCYP

I do, but it's not only about the looks. It's riddled with functionality I'll never use, so I'd rather tailor make something for my need. [spoiler]It's just a project to kill time.[/spoiler]

Yeah, I get it. Whatever makes you happy.

I wish I had the time to do stuff. Godspeed, user.

I just got this in the mail today and have started going through it. It's actually pretty nice.

Where can I find a good selection of programming e-books that isn't the virus infested gentoomen torrent? Decided to finally get myself a kobo and whack a load of them on it.

they're shit as shit you have to google them just to find out what they could possibly mean

gcc

maybe for intel cpus but can it even compile arm at all

Why do people claim that Go has all the drawbacks of C with none of the benefits?

I'm currently studying Oracle PL/SQL but honestly it doesn't make that musch sense yet. Has anyone here ever worked with it and do you have advice on getting in to it?

Hey mind sharing for the bot?
I want to learn python and that seem a nice "read".

go has all the drawbacks of autism with none of the benefits

Because they need OOP to hold their hands.

but is there nothing along the lines of lisp in a box? this still looks like it requires configuring and im very much a beginner when it comes to lisp and emacs

>scheme
pls no

whats it like senpai? ive got an ass old book at uni im gonna borrow at some point but if i can get something more modern that would be great

It's a howto, just follow the directions, line-by-line.

So my spouse was working on a paper about Australia's Labour party and we were looking at their website.

They really want to encourage more women into programming and coding because muh "not enough women in STEM."

What is the end game of shoving a bunch of clueless women who don't WANT to be in STEM? What benefit does "balancing the gender" in these fields gives us?

I don't really see this even possible. Can't force people to be actually interested in a subject, let alone women with programming and coding.

Okay so
int len = recv(sfd, buf, 1, 0);

for (int i = len + 1; len != 0; ++i)
{
if (buf[i - len - 1] == '\r' && buf[i - len] == '\n')
{
buf[i - len + 1] = '\0';

printf("\nNEWLINE\n");
printf("Buffer contents: %s\n", buf);
}

recv(sfd, buf + i, 1, 0);
printf("%c", buf[i - len - 1]);
}


This detects newlines correctly, since it does print "NEWLINE" every time one is encountered, however, the "buffer contents" at that point are just a single colon character, when it should be the entire previous line up to the null-terminator.
What is going on?
This is so frustrating.

It's really slow going and easy to take in. It's got a novice programmer in mind and you only need basic arithmetic skills.
Lisp is high level and is a good starting point. I'm a novice and I decided on it at the recommendation of a few Lain anons.

I agree with what you're saying, How ever I am in college studying Software Engineering, Less than 10% maybe even 5% is female in my year... feels bad man...

The thing is, there are some sperglords who discriminate against women and there are some oily greasy marketing subhumans harassing the secretery because they're just that clueless, and the reverse doesn't happen quite as much.

Now the problem is it's blown way out of proportion and hundreds of proffesional victims have jumped in to cash in on that STEM money. So now everything is awful.

It means I can stare at breasts at work more often, and that's good enough for me

I am making a GUI in Python

Is Tkinter good enough or should I use wx?

>The Australian Labor Party is a democratic socialist party

That's why. It's the party of mental illness.

>What is the end game of shoving a bunch of clueless women who don't WANT to be in STEM?
a small number of reasonably good female programmers who might not have bothered pursuing it otherwise, and an ocean of shit ones. 98% of whom will probably do nothing with the degree when they realise they both hate the work and suck at it, and 2% who will be industry deadweight.

yo I'm trying to setup an ocaml environment so I created ~/.ocamlinit and stuck these lines in it :
#use "topfind"
#thread
#require "ppx_jane,core.top"
#require "async"
#require "core_extended"
open Core.Std
but when I start utop it keeps telling me that core is an unbound module, any idea what I should do ?

>lisp in a box
What about LispBox? Looks like there's a github project for that.

Qt5

ill try

thats it i think, but the projects completely dead, last commit was almost 6 years ago

im looking to learn lisp out of frustration with python, and i hear lisp is pretty much the perfect language if you use it right and dont fall into bad design and programming habits

Seconding this.

Yes. I'd start with it.

There are people who only have a job to do by finding a problem user.

Also saturation of labor in the field keeps pay lower.

How is this anime called?

It's called "Google Reverse Image Search", you might have heard of it.

>last commit was almost 6 years ago
Ah, I see. If you're not that into Emacs, there's lisp stuff you can get for Vim that I hear is really good. There's tutorials for installing the swank server and all that jazz so I don't think it'd be *too* hard to do it yourself if you can't find an immediate replacement for lisp in a box.

There's no saturating the programing labour market. There's always high demand for *good* programmers, and companies have always complained that they can't find enough of them as long as the industry existed. Maybe it can be saturated for enterprise tier projects, but if you're otherwise half decent you'll find work pretty easy.