/dpt/ - Daily Programming Thread

What Webassembly project/emulator are you working on Jow Forums?

Previous

Attached: 1538941916005.jpg (2048x1536, 413K)

Other urls found in this thread:

programiz.com/c-programming/library-function/ctype.h
programiz.com/c-programming/library-function/ctype.h/isalpha
appimage.github.io/apps/
github.com/AppImage/AppImageKit/wiki/AppImages
bintray.com/probono/AppImages
reddit.com/r/linux/comments/5jqnca/are_new_technologies_like_appimage_and_flatpak/dbiohzt/
twitter.com/SFWRedditVideos

Why aren't you using monadic error handling in C++, user?

friendly reminder

Attached: 1517214134674.jpg (600x450, 40K)

I miss the zig poster

ugly gook

help niggas

because Haskell does it better

3dpd

>Working on team project in Uni
>Essentially the only one doing work or making an effort

Fuck it, I'm just going to build the back end and they can fuck off and figure out the rest on their own.

Attached: kill me.png (1070x601, 507K)

>winshit

disgusting

Do it in two steps

based

because I don't use C++

Neural network game. The network will be mapped into wasm at the start, then get fed input to do calculations faster. The rest is programmed in js

Why are you complaining, you don't have to explain to stubborn brainlets why what they're doing is wrong, you don't have to deal with their shitty spaghetti code, you don't have to listen to some know-it-all

I keep getting errors about how the argument of a a void function cannot convert a bool to bool[][20] even though I made clear everywhere the bool variable is an array.

WHy is this happening?

I'm doing it in two steps on my other machines. Except this one has a bunch of weird adapters that I can't (or don't know) to identify and remove.

Attached: Untitled.png (901x277, 28K)

Because when it does come down to figuring shit out they sit around twiddling their thumbs and I have to be the one to take the lead. They also don't seem to know how to code either but that can't be possible because the pre-rec to this course is a Data Structures and Algorithms course.

post code

Are you passing a specific index of an array instead of the actual array perhaps? Post code

I still don’t know how to check if the user inputted a character instead of an integer. I’ll post my dick if someone writes me a usable function that checks for min and max integer values and checks for character input

what lang

C

Sounds like you're solving a problem which doesn't necessarily need solving. Rethink/redesign your application

Also, I’d like for it to have the simplest functions and statements. I’ve seen a lot of cout, cytpe.h, isalpha, atoi, etc. I don’t want any of that. Fgets and sscanf are ok

programiz.com/c-programming/library-function/ctype.h

If I enter a letter instead of an int my program loops infinitely

it even has the example you want

programiz.com/c-programming/library-function/ctype.h/isalpha

#include
#include
int main()
{
char c;

printf("Enter a character: ");
scanf("%c", &c);

if (isalpha(c) == 0)
printf("%c is not an alphabet.", c);
else
printf("%c is an alphabet.", c);

return 0;
}

Today I did the Boxes through a Tunnel question on Hackerrank.
My code was

struct box
{
int length, width, height;
};

typedef struct box box;

int get_volume(box b) {
return b.length * b.height * b.width;
}

int is_lower_than_max_height(box b) {
if(b.height < MAX_HEIGHT){
return 1;
}
else{
return 0;
}
}

Attached: Yuki-Using-Computer-GIF-yuki-nagato-38663943-311-360.gif (311x360, 136K)

>typedef struct
It's shit.

No it’s got to be like;

Enter integer n
scan n
(Test if n is non-integer)
If so, print invalid input, loop back

Also a min and max value for integer input. My program is due in 6 hours and idk what to do

It's what they want.
They asked for this.
Go look at the question specification.

Attached: Mystérique_Sign.png (1920x1080, 1.45M)

You can just do your struct like this:
typedef struct
{
int length, width, height;
} box;

no it's not lol

no you can't you fucking retard.
It's
typedef struct {
int length;
int width;
int height;
} box;

take the code at but replace isaplha() with isdigit()

Not him, but in C, if scanf returns a negative number, then what you scanned was not an integer

If it returned a positive integer, but it's not the same as the string length, that means some of the string was not part of an integer, so you could do some conditionals based on that

The only thing better than doing it all yourself is having team members better than you. They're extremely rare and you get in their way.
So you shouldn't complain when you have the luxury of being able to do everything by yourself.

How do I make this into a function so it can be used multiple times in my program?

are you willing to pay? no one here will provide you with a solution for free.

Could you post the full problem? There's some weird inconsistencies in your questions, you mention character and integer, which to me suggests we're comparing 1 character and we could then do something simple with that, but you also mention min and max and now I'm wondering if maybe it's more than 1 character. Also if it's the whole string terminated by newline that's supposed to be checked, part of it, or just 1 character

By reading "The C Programming Language" and not asking Jow Forums for help with your high school assignments.

Attached: C.png (619x903, 156K)

Is getting freelance work even remotely possible if you're not a Pajeet?

>"The C Programming Language"
>le obsolete c manual

Attached: 1479208724334.jpg (750x738, 266K)

possibly not tbhh

I have to write a program that gives the user some options. If the user chooses the last option, the program “exits.” If the user chooses any of the other options, he will then be prompted to enter an integer within a certain range, which will then be manipulated by a function I have created. So i have a switch case based on which option (1,2,3,4,etc.) The user selects, and in each case, a printf, scanf, function call, printf final answer/calculation. I have a do-while so that the menu repeats after the answer is returned, until the last option is selected. But I need to validate the input so that only integers 1-50 can be entered. Because right now if I enter a letter the program loops infinitely

Anyway to set group policy through C#?

Documenting my own software, fucking documentation is very lazzy but always needed. Now I'm rewriting in Docbook something that is in LibreOffice, it really help me the only useful two lines that was there.

Nope. I make barely over six figures and when I needed money, I couldn't get jobs for $20/hr on freelancing sites. Freelancing is a meme. It's full of cheap assholes who want excellent work done for little to no cost. The profiles you see of people making a ton of money on them are fake.

Either works fine. No need to get aggressively autistic about it.

The compiler keeps returning and error telling me that it cannot convert 'int' to 'int[][20]' in the first argument of a void function I called.

I checked whenever I declared this function I did set the first argument as an int matrix of [][20]

So there is no conversion intended there.

How do I fix this shit?

Well you mentioned you could use sscanf, which returns how many variables filled. What solutions have you tried around that?

add a default to the switch if the problem is with the selection

I have, but that only seems to work for integers that aren’t one of the options. A letter messes it up.
I have pic related, but don’t know how/where to implement it, how to make it a function, what declarations are missing. I don’t know what buffer, stdin, cptr* all mean, and honestly I don’t really know about fgets and sscanf because I’ve never used them, but our professor doesn’t seem to care.

Attached: CAA318EC-FC9E-4C2E-90A5-A0C3FEB8B03B.jpg (3015x2811, 844K)

>[][20]
hhhuuuhhh??

AppImages make easy to install programs

Do you want to install programs but dont want to solve dependencies?
Are you using a source based distro but you are in a rush and need a program ASAP?
Are you a programmer and want to serve your program to all distros but dont like the hassle?
Do you want a program but you will use it once and remove it immediately afterwards?
No dependencies unlike flatpak or snappy!

Use AppImages!

Find your favorite program around:
appimage.github.io/apps/
github.com/AppImage/AppImageKit/wiki/AppImages
bintray.com/probono/AppImages

Are a developer? Did you made an AppImage yet?

Attached: appImage.png (720x340, 290K)

Post code you stupid faggot

What the fuck is this niggershit

>making packaging more easy
>"but is niggershit"
No, YOU are the nigger.

I’ll post my dick and never post here again

Why is C's garbage collector such shit?

I ask myself that every day.

Attached: unknown.png (640x760, 384K)

never used it but i know it has been endorsed by loonis torvaldson himself

Attached: linusappimage.png (509x430, 37K)

We already have static linking.

>tfw mom told me to apply for a Golang job but I'm busy doing Zygohistomorphic prepromorphisms on Haskell

Would be easier if you posted all your code

JavaScript rocks!

Attached: js-rocks.png (1000x494, 369K)

Unironically this

This. JavaScript is the best programming language.

Attached: javascript_supremacy.png (948x911, 189K)

>static linking
Isn't that conflicting with system libraries? I thought AppImages solve problems like conflicting libraries and dependencies on old libraries.

No. Static linking includes the needed parts directly into the binary. The only dependencies are on ABI, ELF format, and ISA. So a program built for x86_64 linux will always work, provided it's built for generic architecture (e.g. no subarch stuff) and you have a 64-bit CPU.

i finished the first chapter of k&r and implemented bubble sort. what do i do now Jow Forums

Unironically learning webapis to further augment my webassembly emulator

Do I need to learn linux? What distro to start with? Debian looks cool (name and logo h-hehe)

I’m afraid to have my code public. I don’t know if my professor browses here. He’ll know me by my code.

what the fuck

also yes, ubuntu is an easy first choice

Not freelancing per se. Consulting & contracting, yes, but you want to somehow distinguish yourself from the hordes.

Are you an expert in automating some particular kind of business process? Maybe have some technical experience in e.g. engineering or chemistry which can help you design custom software for business? And on top of that, have a solid network in that industry? Then you can make pretty good money.

ubuntu sounds gay

say that shit again, nigga and I'll straight up suck your dick no homo

AppImages include more than just the binaries, it includes all sort of files inside. Think of them like an entire iso in itself.

If we have an instance of A in class, and functions in this class are returning A, is it viable to return decltype(a) instead? I want the user to change the type if he wishes so.

Attached: OP_Sucking_Dick.jpg (685x474, 104K)

*decltype(instance)
soz

reddit.com/r/linux/comments/5jqnca/are_new_technologies_like_appimage_and_flatpak/dbiohzt/

just saying

Attached: AppImages rock.jpg (868x6656, 682K)

I'd use AppImages, but I have 0 need to use it

I can see why somebody wouldn't use it when it comes for small applications, but once you do big projects with thousands of files is more than worth it. Is even more worth it when it comes to proprietary software where companies want to ship with their own specific libraries and assets.

But yeah, the link says it all.

How is it obsolete.
Unless you're using the first edition it should be fine.

I feel you, I meant use it as in use images from it, but I do see it's use as distributing software. Would have been useful for distributing some multi-platform games when I used to play em

What exactly is the advantage of all these memes over static linking?

Or putting binaries and shared libraries together in their own directories in /opt as opposed to spreading them across /bin and /lib?

your male privilege is showing

What do you mean, "change the type"? Would generics do what you want?

I think games are one good example of what good use they have as a distribution platform. Of course for core applications you want up to date binaries, but if you just want applications that can fun anywhere with little hassle this it the thing for you.

See the link, it bundles more than binaries and you can have as many of these in your computer as you want. No more depending on how the distribution as implemented their filesystem or which libraries it choose, but also you can put any file in it meaning there are no more problems of to have whatever configuration you want with specific config files Just look at the link, there are more implications.

It really gives more choices, is like having all sorts of new libraries for each appimage without needing to conflict with whatever already is in the PATH.

Never used them, but I assume you can package data that your app depends on besides just object files and libraries.

Very much this.
On another note, I started learning Python as a 2nd lang after JS about 3 weeks ago n im starting to forget or mix up some small lang specific details.
What do dpt? Is this just part of the ride? Just now I realized you can't do array[-1] in JS like in Python, before this I would have known immediately that doesn't work.

/opt accomplishes this.

Obviously the package management aspect is good but it's not like there aren't package managers for other platforms that don't rely on /bin, /lib, ~/.config, etc. without needing all this extra stuff.

Bool isntnotafemale

bool isMale() {
if (isNotAFemale != false) {
return true;
} else {
return false;
}
}

I had no idea you could do that in JS, and been using it professionally for ages

Not them, but even if /opt accomplishes something similar, you would have to create something to remove the relevant /opt files. I'm guessing since AppImages is self-contained, you can just remove the iso-like file and that's it. Download and remove just as easy.
Also you talk about other package managers, this doesn't seem like a package manager, as it doesn't manage packages in any way

Holy fuck