/dpt/ - Daily Programming Thread

What are you working on, Jow Forums?

Previous thread:

Attached: 1486500723332.jpg (1280x720, 128K)

Other urls found in this thread:

a.uguu.se/jV0sFwl41PLn_ohmaigah.webm
proton-native.js.org/
pastebin.com/F5k9KXkv
ia800807.us.archive.org/30/items/CProgrammingLanguage2ndEditionByBrianW.KernighanDennisM.Ritchie/C Programming Language, 2nd Edition by Brian W. Kernighan, Dennis M. Ritchie.pdf
gnu.org/software/libc/manual/html_node/Low_002dLevel-Terminal-Interface.html
fuwafuwa.moe/nr/freeme/
twitter.com/NSFWRedditVideo

Reminder that std::shared_ptr is not a zero cost abstraction.

ayayaya?

a.uguu.se/jV0sFwl41PLn_ohmaigah.webm

What programming language should I use/learn for the front-end/back-end of a GUI program for a company, and what language/knowledge do I need to write the back-end that manages the data on a server? Like SAP or Oracle. It would have a username and password, and it would all be on the local network.

I can't have it be web based.

I am thinking of C++ on the front end, but I really wish I had more material for learning about this type of programming. I don't even know what it would be called.

It's probably windows so I'd use visual basic unironically. Otherwise Qt.

C++ beginner here. Why not?

when will I be the person writing responses on stack overflow for people to copy instead of copying shit from stack overflow

when you stop using stack overflow

t. eternal 0.1xer

javascript
proton-native.js.org/

Reminder that you're probably using std::shared_ptr wrong anyway.

Rate my fizzbuzz dpt.
pastebin.com/F5k9KXkv

seems a bit long.
more complicated that needs to be.
-1000 points for bumping the wrong /dpt/

java if you want to kill yourself after finishing a project

>wrong /dpt/
the op of the other /dpt/ didn't doubly link his list.

Could anyone link me to where I can pirate a copy of `Scheme 9 from Empty Space A Guide to Implementing Scheme in C'
All my google fu and duckduckgo chops couldn't help me.

ʸᵃʸ

Attached: nomnom.webm (1024x768, 425K)

Are you showing off your anorexia?

>literally a s oyb oy

>ʸᵃʸ
fat goiter cubicle women (or nutless numales) will lvoe this, esp with the artsie cats

>Set servings to 0 to remove
Shit design. Just add a little X

Nah setting to 0 is better

No, clicking the down arrow a billion times to remove is shit design. Fuck off.
Your program is shit and useless anyway so who cares.

nah

help
should I learn python and practice a lot with it
or
jump into SICP and do python later

that's only a problem if you eat a million eggo waffles in a day.

>clicking the down arrow a billion times
Type in 0 and press enter you dumb fuck holy shit what a retard

You're gay and your opinions are bad

oookay

Attached: 1522682619098.jpg (676x676, 37K)

would you ever hire someone that has a massive gap in their resume and explains it as "soul searching" time?

we're hiring 3 "entry-level" (aka we plan on teaching them) fullstack devs and 1 of them has a 2 year gap between his last job and now. he just said he was "backpacking in europe" which is really setting off red flags for me.

i dont have any part of the hiring process at my work but i totally want to investigate his past references to make sure they're legit.

dumb frogposter

Maybe he was depressed, shit posting on Jow Forums. Give the man a chance. No 2 year passive behaviour allowed? He clearly wasn't backpacking, but he needs to integrate back into society after these two years. And if you don't give him a chance, who will?

I vote yes for an Jow Forums incel.

>he just said he was "backpacking in europe" which is really setting off red flags for me.
Why? How fucking autistic are you that the idea of people spending some time enjoying their life instead of constantly slaving away is such a foreign concept to you?

I have found both of them to be important, SICP teaches you how to think about and approach problems, a skill that doesn't get outdated, python is sweet for quick jobs and for prototyping, many a time the prototype turned out so great I didn't need to write a single line of C.
So back to what you should do, learn SICP while making (little,mini,micro...) side projects using python, don't forget to enjoy yourself and above all else make stuff, tweak existing projects and generally just get your hands dirty.

He isn't even part of the hiring process, he's just bothered by someone else not living his life according to his set of rules that he wants to trip him up. What the fuck man

"backpacking in europe" sounds like an excuse to hide a bad job. like if he got horribly fired he could just hide the entire experience by saying he never had a job. they can't call references if you dont put the job on your resume obviously. when i graduated from college i took a 12 week internship and i didnt put it on my resume because i felt confident that if a future employer called, they wouldn't hear good things.

namespace FBc
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Enter your 'Fizz' Number:");
string fizzy = Console.ReadLine();
int f = int.Parse(fizzy);
Console.WriteLine("Your 'Fizz' number is " + f + "!");

Console.WriteLine("Enter your 'Buzz' Number:");
string buzzy = Console.ReadLine();
int b = int.Parse(buzzy);
Console.WriteLine("Your 'Buzz' number is " + b + "!");

int fb = f * b;
Console.WriteLine("Your 'FizzBuzz' number is " + fb + "!");

Console.WriteLine("What number should we count to?");
string limit = Console.ReadLine();
int l = int.Parse(limit);
Console.WriteLine("Your 'Limit' number is " + l + "!");


Console.WriteLine("What is your 'Fizz' phrase?");
string fizzName = Console.ReadLine();
Console.WriteLine("Your 'Fizz' phrase is " + fizzName + "!");

Console.WriteLine("What is your 'Buzz' phrase?");
string buzzName = Console.ReadLine();
Console.WriteLine("Your 'Buzz' phrase is " + buzzName + "!");


string fizzbuzzName = fizzName + "-" + buzzName;
Console.WriteLine("Your 'FizzBuzz' phrase is " + fizzbuzzName + "!");

for (int i = 0; i

Rewriting the C standard library in public domain, aiming for less assembly instructions and no clutter

Attached: 1345778447063.png (424x600, 167K)

fewer

Is this the way to go if I want to learn C?

Attached: c.jpg (379x499, 33K)

How would I program an arduino to sequentially cycle through 5 different LEDs individually when a button is pressed?
Also, how would you have a buzzer make a sound on the 5th button push.

>pic is board layout.

> I found the following code for something similar:

Demonstrates the use of an array to hold pin numbers.
Each time the push button is pressed, next LED in the
sequence will be turned on while the rest of LEDs are off.
*/
const int buttonPin = 2; // the pin number of the pushbutton input pin
int ledPins[] = {3, 4, 5, 6, 7};
// variables will change:
int buttonState = 0; // variable for reading the pushbutton status
int buttonPressCount = 0;
int numberOfLED = 5;
void setup() {
// initialize the LED pin as an output:
for (int i = 0; i < numberOfLED; i++) {
pinMode(ledPins[i], OUTPUT);
}
pinMode(buttonPin, INPUT);
}
void loop() {
// read the state of the pushbutton value:
buttonState = digitalRead(buttonPin);
// check if the pushbutton is pressed.
// if it is, the buttonState is HIGH:
if (buttonState == HIGH) {
for (int i = 0; i < numberOfLED; i++) {
if (buttonPressCount % numberOfLED == i) {
// turn LED on:
digitalWrite(ledPins[i], HIGH);
} else {
// turn LED off:
digitalWrite(ledPins[i], LOW);
}
}
buttonPressCount++;
delay(400);
}
}

Attached: Board_Layout_BP.jpg (617x517, 58K)

Does Console.WriteLine support format specifiers?

Console.WriteLine("Your 'Limit' number is {0}", l);

way nicer. and more efficient.

how do I into the C++ STL?
from what I hear people have written xboxhuge books on the thing.

>~shared_ptr() does not have access to compiletime information which allows it to determine whether it was originally constructed with make_shared or shared_ptr(T*)
yes it does, because make_shared does not simply call shared_ptr(T*). it calls allocate_shared, which calls a constructor of a shared_ptr instantiation parameterized by an allocator which allocates/deallocates the control block and managed object together in a single allocation/deallocation, and constructs the object in-place with perfectly forwarded arguments
>~shared_ptr() must store an additional flag determining whether it has allocated one heap chunk or two
this information is contained in the allocator which, due to the empty base optimization, occupies zero space for stateless allocators (in that case their behavior can be stored in the type system alone), which is indeed the case with the allocator provided by allocate_shared

in fact, a shared_ptr created with make_shared can *only* destroy its control block and managed object together / at the same time (to a fault, even); the managed object will only be destroyed once the reference count is zero, meaning it can be kept alive by a weak_ptr. this is only the case with shared_ptrs created with make_shared; this is probably not ideal, but it goes to show that such shared_ptrs indeed do not branch on some runtime flag for deallocation. the information is embedded in the type system

>arduino
might be better to take it up with desu

What's the best way of detecting arrow key presses in a C Linux program for a text editor? Without ncurses

Attached: download.jpg (201x251, 8K)

>he doesn't start every day with at least a dozen poptarts and a score of waffles
weak desu

>Without ncurses
What's the best way to stay underwater for at least a minute? Without holding your breath

yes good book. next question

Water contains oxygen

have this
ia800807.us.archive.org/30/items/CProgrammingLanguage2ndEditionByBrianW.KernighanDennisM.Ritchie/C Programming Language, 2nd Edition by Brian W. Kernighan, Dennis M. Ritchie.pdf

>just grow gills bro lol

idk, haven't got that far.

they were saying it's bad cuz all my code is in one block (well the if else is a block within that).

not sure what to do.

if i move all the variables to the top, away from the console stuff, the app don't work.

guess i'm looking for "best practices" advice (in lay terms)

not really, you want 'modern c'

variable declaration looks fine to me.

In C it's more typical to declare all variables at the top.

hey guys Im new to linux and c++
what text editor or IDE do you recommend?

If you have the time and patience to learn it, vim. Otherwise, maybe Atom?

you can use literally any IDE that you would use on windows.....there's no special one....I hope you didn't install a linux os just for programming purposes....

Universally praised
>Oracle
>Vim
>Emacs
>atom

Linux only
>notepadqq

Just learn to use notepadqq or vim

Attached: worry.jpg (193x243, 7K)

qt creator

It's meant for qt applications, but it's a full featured C++ ide with VS keyboard-shortcuts and cmake support and whatnot
looks nice too

>development on windows
disgusting

gnu.org/software/libc/manual/html_node/Low_002dLevel-Terminal-Interface.html

Try the example program and then reference the chapter. Too lazy to try it.

UGLY AND PATHETIC
GIT GUD

Agreed

however, I'm assuming he's coming directly over from windows, so he should start with an IDE that he developed on while using windows.

Attached: maxbarf.gif (160x138, 291K)

can you elaborate?

> it's formatted in an ugly way
> you made a piss poor effort which can be equated to your effort being pathetic
> You need to do better

that's not elaborating, that is restating in different words

what about it makes it ugly?
what would make it less ugly?

the code works, did the best i could with noob knowledge

i know, asking what would make it better?
or what is the objective definition of 'better' in this scenario?

this

it's lightweight for an IDE but has everything you need (and you can disable everything you don't to make it run leaner), and it has great first-class cmake support. never used it for qt applications myself, but it's been great for glfw/opengl applications (it even has an optional glsl editor with highlighting and completion)

Yes. Some of the examples are hard to understand but overall it's a great book. C is a simple but powerful language and doesn't need a tomb to understand it.

that's very interesting.

Is a generic/portable C standard library even possible? Some of the stuff in there like numeric limits seems like they could only reasonably be implemented as macros over compiler intrinsics.

You mean tome?

What happened to this general?
6 years ago it used to be a nice place where you can post progress and discuss programming. Now it's filled with whippersnappers throwing shit at each other. What the actual fuck

my lang > your lang

what's your data source?

Bring him in for interview and casually have a chat about it, see if it adds up once you've actually spoken to him about it.

There's nothing wrong with wanting to know more and with a bit of tact and diplomacy (probably a stretch for this board) you should be able to have him explain the ins and outs without anyone getting upset.

Learn Lisp

>tfw never had a job
I guess I should just kms as far as society is concerned

post actual schematics not this shitty breadboard pic that makes me have to pick through rows, and correctly format your code blocks.

Also join #arduino on freenode

How long do I need to read Htdp for until I'm able to get to the level of being able to do projects like all the wizards I see, in my CS program? I'm also going through K&R.

that's some cool shit, user!

>23 and never had a job
>still a uni student and will graduate at 25, after spending 4 and a half years at CC dicking around until finally getting shit together
hahahahAHAHAHAHAHAHAHAHAHAHA
it's over boys

well at least you have something to be proud of.
Checked.

check'd

>dumb NEET gets sexts
epic

checked, dammit!

proof the universe favors the would-be losers.

like the retard that always wins at the bingo hall.

the 6 figure income manager who can't tie his shoes, let alone code a fizzbuzz

Only sexts he'll ever get amirite? Sexts of septs.

based
NEET uprising when

...

We're almost there, boys!

Attached: Screen Shot 2018-05-02 at 11.56.40 PM.png (670x70, 26K)

this unironically gives me hope

You sound like me but im 23, is there hope?

if you have no job experience at 23, no matter how many projects or how good your gpa is, if you're applying to where I work at, which takes fresh grads, your resume is instantly getting binned

being in undergrad past 21 is already a pretty big red flag

fuck i'm at the 25 year mark with that degree coming within the month and my gap between employment was when i graduated high school.
might as well fuck off now

A dumb ass uni student like yourself was charged with CP for running a file host.
fuwafuwa.moe/nr/freeme/

Attached: 1458505288538-b.png (480x451, 283K)

contribute to some open source shit.
then you can honestly say:
"i helped with the latest release of firefox"
"i made part of the gui for gentoo"
"my friends and i made a mod for minecraft"

genuine question here: What went wrong that made you end up in this shitty place? I've had the fortune of being raised upper middle class and since my parents immigrated here they always drilled into me how important it was to study and excel at school to make a life for myself.
I understand that not everyone has that kind of bringing up, but I'm curious to know just how much school/college was emphasized in your families. Would you say that the way you were raised was inadequate or was it your own immaturity?

working class parents that couldn't help pay for school and the public school education that didn't prepare me adequately. along with a lack of discipline i guess.
lost 2 years doing shit-all until i was able to get more dosh to pay for school.

laziness
i was a pseudo-NEET during CC and would take 4 or 5 unit semesters at times, which resulted in those 4 and a half years.
I also didn't have a license until last year and after getting rejected at a couple places (Taco Bell, McDonalds) I just gave up because I couldn't be fucked to fill out applications

I'm learning Moonscript. It's pretty kawaii.

one of you fags make that thing from The Matrix
so i can just download all the programming knowledge into my brain.

i'll pay handsomely
hurry up! let's go!