/dpt/ - Daily Programming Thread

What have you been working on, Sup Forums?

Previous thread: →

Other urls found in this thread:

automatetheboringstuff.com
youtube.com/playlist?list=PL8dPuuaLjXtNlUrzyH5r6jN9ulIgZBpdo
gnu.org/software/make/manual/html_node/index.html
interviewing.io/
lmgtfy.com/?q=gcc whole program optimization
stackoverflow.com/questions/19793789/is-c-whole-program-optimization-done-in-gcc-if-i-set-optimization-o3
twitter.com/NSFWRedditGif

post your github traffic, user

Linear types will save systems programming

>tfw no good languages have linear types

Why are programmers so behind academics?

Be the change you want to see user

So how do i into complicated Makefiles?
Im trying to dynamically link all dlang source files in a folder into a ../Main.d file, and so far in previous projects ive only copypasted basic makefiles from the internet.
Any good tutorial on Makefiles or should i just write a fucking bashscript?

>Be the change you want to see user
this sucks
you are likely to never see the change so it doesn't benefit you at all
it only benefits those who come after you and they will take it for granted, not paying an iota of respect for your hard work/sacrifices.

How do I learn to write functional code?

Academics are behind reality.

get a lobatomy

How do this in windows 10?
pic related

wear the legwear in picrel

>>>/sqt/

typescript will save systems programming

Beginner here. In pic related they mention building a portfolio from those challenges. Is it a good advice ? The challenges are good training. But putting shitty games like battleships on github for employers sounds stupid to me. Especially considering they probably won't look at the source code.
People also mention keeping a blog on projects and technical difficulties/solutions. Is it worth the time, considering once again, very few people will read it ?

How, where you read about that?

>Beginner here
so is everyone else here.
this is a bad place to try to get useful info.

Programming challenge: write this function.

the only feature i miss from os x :(

c++ is the greatest language of all time

got a problem statement?
don't feel like thinking too much right now

Most people don't like dealing with academic gobbledygook technical jargon that in fact means something really simple and trivial.

If it was actually a worthwhile thing to study and not just something that C"""S""" professors used to scam grant committees into funding their super important """research""" they would actually make an effort to communicate the ideas themselves.

i'm fresh out of high-school and wanting to major in compsci because i've always thought it to be a cool subject.

never had the time to learn how to code though due to a lack of access to the net, i'm wondering what should language should i focus on? i want to be somewhat proficient in one ( or a few if that's possible ) before reaching junior level courses. my goal is to make websites and work on mobile apps, but being a jack of trades when it comes to programming is ideal.

i'll have a ton of time to practice this semester as i'm taking easy classes.

>inb4 folks bitching at me about compsci not being a viable career path.
i don't care, i want to do it.

>never had the time to learn how to code though due to a lack of access to the net, i'm wondering what should language should i focus on? i want to be somewhat proficient in one ( or a few if that's possible ) before reaching junior level courses.
python is best bang for buck for beginners
e.g. automatetheboringstuff.com
> my goal is to make websites
javascript/typescript
note that frontend is a wild west full of people despised by the rest of the community, but also the hype-est and quite large market
> and work on mobile apps,
android-flavor java (kotlin for smugwanking), or whatever fad Apple is up to
not as much of a clusterfuck as web dev, but ehh

my shitty opinion: consider backend, non-web/mobile - as in, ask people with knowledge of the industry sectors and collect opinions
>but being a jack of trades when it comes to programming is ideal.
as a long-term goal, aim for being a (somewhat cliche) t-shaped developer (jewgle it)

i wouldn't spend a lot of time thinking about this. once you know one thing well, everything else gets easier

Circuits and digital logic. You absolutely need to learn how things work at the lower levels before you work your way up.

name of that feature?

absolute lie.
the boy's talking about the fricking websites and apps, that's a few dozen of abstractions layers above a place where circuit knowledge would be useful

>Out[3]= {1/1, 2/2, 2/2, 3/3, 3/3, 3/3}
>Out[3]= {[1/1], [2/2, 2/2], [3/3, 3/3, 3/3]}

>Out[4]= {1.2/2, 1.2/2, 0.9/2, 0.9/2, 6.0/2, 6.0/2}
>Out[4]= {[1.2/2, 1.2/2], [0.9/2, 0.9/2], [6.0/2, 6.0/2]}
>divides by two, repeats the operation twice

>Out[5]= {10/5, 10/5, 10/5, 10/5, 10/5}
>divides by 5, repeats the operation 5 times

is that what your function does?

also, watch this, nice way to get a foundation built for CS
youtube.com/playlist?list=PL8dPuuaLjXtNlUrzyH5r6jN9ulIgZBpdo
Crash Course Computer Science (PBS)

osx just calls it column view

Yes good job. Now write it if you please.

>>> ldup = lambda a,b: sum(map(lambda t: t[1]*[t[0]/t[1]],zip(a,b)),[])
>>> ldup([1,2,3],[1,2,3])
[1.0, 1.0, 1.0, 1.0, 1.0, 1.0]
>>> ldup([1.2,0.9,6.0],[2,2,2])
[0.6, 0.6, 0.45, 0.45, 3.0, 3.0]
>>> ldup([10],[5])
[2.0, 2.0, 2.0, 2.0, 2.0]

I'm proud of you.

thanks

double *ldup(double *x, signed int *y, size_t elements)
{
size_t index = 0;
double *array = malloc(elements * sizeof(double));

for(; elements--; ++x, ++y) {
size_t counter = 0;
while(counter++ < *y)
array[index++] = *x / *y;
}
return array;
}

no way to determine the number of elements in y, had to add an extra argument, so not what you are looking for i guess.
and no, i didn't test it.

sizeof(y) / sizeof(int)

2?

> Help me to learn hadoop, Sup Forums. Where to start, where to go?

it is a pointer, the mathematical way to determine the output of *array is to sum all the elements of y, but that can't be done inside a function unless you tell the function how big the output will be.
oh well, guess that malloc isn't supposed to be used in functions, ever.

the length of y is not necessarily the same as the length of the result

would this even work if you didn't specify
*(double) before malloc?

this would only work if the argument was an array reference, not a pointer

Hi Sup Forums,

I want to become a better programmer. What is the best path to take? Do I just need practising and learning new things? How will I know when I'm there?

Read clean code

what in the world would the real-world use of such logic be?
thanks for the code. One possible Scala translation:
def ldup(a: Seq[Double], b: Seq[Double]) =
(a zip b)
.map{ case (a,b) => Seq.fill(b.toInt){a/b} }
.flatten

noob here

how can you know from the screenshot what the function does?

nvm fixed

As a person learnign to program(any language) for the first time(I choose c#), whats the better book to learn from, C# in a nutshell or the yellow book?

Also open to alternatives.

lol

i program in Java because i can't see sharp (C#)

If these are the quality of jokes I can expect, I am staying a gas fitter lol

C# isn't that great, just learn C until you're proficient and then C++ for objects and then C# or Java afterwards, it'll make you a better programmer if you don't take for granted all the things a higher language just gives you

I thought Id learn C# since alot of jobs in my area are asking for C#, .net and MySQL experience.

Basically what I want to work on right now is an application that will allow me to make and recieve calls and texts from my computer while connected to my phone via bluetooth or wifi. Not sure if Im shotting for something way above my head or not.

What makes C# not great?

I'd say learn a "grr real men" language (C) and a "get shit done without wasting too much time" language (C#/Python) concurrently
- minimize chance of giving up due to C being borderline turing tar-pit
- avoid becoming yet another pajeet who "bigO? who cares about dat"

most importantly, take Sup Forums autists' opinions with a huge chunk of salt, and mine included
the ol saying
>opinions are like assholes
rings very true here

Ill never be a pajeet thanks to ancestory lmao.

Thanks for the advice though. Is python more important to learn tahn C# right now if I learn C at the same time because its a scripting language?

Is there any way to view the disassembly of some JIT compile javascript?

C# is fine if that's what you're trying to get a job for, I just personally don't find it enjoyable to program in.

And yes C is dogshit to program in but if you can program in C you most likely aren't going to have a problem in any other language (sans a few) as long as you can wrap you head around objects (which isn't hard)

it's not about ancestry really

>Is python more important to learn tahn C# right now if I learn C at the same time because its a scripting language?
both bring something to the table
but I'd say try python first, gets "babby's first program" shite done much faster than c#
however, c# has its advantages (type system, quality of life improvements ain't as slow to arrive as in java), so it'd be useful too at a later stage

>Ill never be a pajeet thanks to ancestory lmao.
what said
"it's not how pajeet your genes are, it's how pajeet your mind is"

I can't interview at all. I always fuck something up I always say something in a way that sounds bad.

green text incoming?

Use wildcard, it makes for shitty build system by just globbing a directory but that's how you would go about that.

I don't know how you build in D but I'm assuming it uses .o objects. So the way you set up your makefile is to just specify .o files as a dependency to your binary and let make do the rest.

objects := src/foo.o src/bar.o

Main: Main.o $(objects)

For you objects would be $(patsubst ... $(wildcard ...)). I don't think you have built in rules for D so you're going to have to make a pattern rule for it(%.o: %.d), to tell make how to build .d files.

gnu.org/software/make/manual/html_node/index.html

practice
out loud
with friends
with books
with professionals
I think the interviewing.io/ cunts had some not completely useless shit posted in their blag
also they take your money and may or may not claim to help with the foot in mouth shit

at least they don't take your money directly
at a lower level there's pramp

>pramp
neat, didn't know about that one

What should I know about "whole program optimizations"? How do I use it? gcc and linux

care to elaborate?

spoonfeeding you a start:

lmgtfy.com/?q=gcc whole program optimization
---------->
stackoverflow.com/questions/19793789/is-c-whole-program-optimization-done-in-gcc-if-i-set-optimization-o3

forced to use Java for a data structures and algorithms class
what IDE would you guys suggest? I use linux btw

Visual Studio. Remove linux.

Intellij, you're a student, you can get a free license.

intellij
check out the learning project if you've never used it, its a nice intro to the refactoring/doc/code nav workflow

i've been using xa65 to compile my 6502 assembly code to patch my nes romhacks, and recently i ran into an out of memory error because of xa65's limitations.
so I edited the xa65 source code by increasing the buffer memory by a value of 10x

>#define TMPMEM 2000000L /* Zwischenspeicher von Pass1 nach Pass 2 */

it seems to work because now i don't have "out of memory" error, but whats the chance this could cause problems?

(⊢/÷)

If it's only a single internal buffer probably none. I'm assuming it is just based on the name.

Run a grep for TMPMEM over the source and see how it's used.

so, which one is it?
also, what's the name of the algo / a real life use for it?

do I get to keep it forever?
also, is there any good free alternatives? how's KDevelop?

>do I get to keep it forever?
No, student license lasts for one year, however you can renew it for as long as you have a valid uni. email.

Is true you're a CIA nigger if you can't code your own compiler?

Yes, if you don't design your own CPU architecture, create it from silicon, create your own assembly and then compiler you are in fact, a CIA nigger

intellij has a community edition that's got all the basics
ultimate edition had better integration with some enterprise shite IIRC
in short, just grab the free version right now, see how it fits ya

i am assuming you are talking about what happens in main(), i fixed the function, here is the sample:
int main(void)
{
double a[3] = {1.2, 0.9, 6.0};
signed int b[3] = {2, 2, 2};
double *c = ldup(a, b, 6);

for(size_t index = 0; index < 6; ++index)
printf("%.2f ", c[index]);
free(c);
exit(EXIT_SUCCESS);
}

fuck
#include
#include

double *ldup(double *x, signed int *y, size_t elements)
{
unsigned int index;
double *array = malloc(elements * sizeof(double));

for(index = 0; elements; ++x, ++y) {
unsigned int counter = 0;
while(counter++ < *y && elements--)
array[index++] = *x / *y;
}
return array;
}

int main(void)
{
double a[3] = {1.2, 0.9, 6.0};
signed int b[3] = {2, 2, 2};
double *c = ldup(a, b, 6);

for(size_t index = 0; index < 6; ++index)
printf("%.2f ", c[index]);
free(c);
exit(EXIT_SUCCESS);
}

How are you supposed to execute this? 1 2 3 (⊢/÷) 1 2 3 just returns 1.

(define (ldup a b) (apply append (map (lambda (e) (list e e)) (map / a b))))

Sup /dpt/,

Suppose I interviewing you for a job and asked the simple question "Are you good at software development?"
How would you respond?

Yeah I'm pretty good.

But who would ever say no?

say no but im a minority and theyll hire you guaranteed

Everyone did great but behold my solution and bask in its glory. There's even some expository code in there so you may attempt to comprehend its sublime magnificence.

Where do I find a guy to hire that knows Java,SQL, HTML 5, CSS, and Javascript for 160 hours of work?

I have an idea (basic sprints laid out and a fully navigable mockup) but I need a programmer to make it happen

Drive down to the local Best Buy and pick up some of the Indian illegals that hang out in the parking lot. You can pay them in crypto.

Thanks but I already tried freelancer

I live in an Indian-free area though

TIS-100 is fun!

>proprietary programming language

>using soyboy programming languages
either poorfag or a soyboy

Python is shit just like all dynamically typed language. If you are writing anything more than a short script in a scripting language, you are living your life incorrectly.

Should I continue using VB.net?

It's one of the only languages I knew out of college and I've been using it at my current job to use with SQL server.
I know C# is probably a better option but is there anything wrong with VB.net?