/dpt/ - Daily Programming Thread:

I already know what you're working on, Jow Forums.

Previous thread:

Attached: obama.jpg (694x1024, 267K)

Other urls found in this thread:

youtube.com/watch?v=FeEsyDZugPc
adafruit.com/product/2348
github.com/syl20bnr/spacemacs/tree/master/layers/+lang/scheme
albahari.com/threading/
shop.oreilly.com/product/0636920083634.do
pastebin.com/2ve46e2Z
youtube.com/watch?v=HP2InVqgBFM
twitter.com/NSFWRedditImage

Building a shell program in C
when it runs the following prompt appears and executes basic Unix commands
shell$

braps aing fay

I'm re-stating my question for when the old thread gets archived.
"I want to start web development, can this happen?
youtube.com/watch?v=FeEsyDZugPc
Please redpilll me, ty anons

Why am I getting an error while trying to fill a two dimensional array? I get a message that I should change the version to 1.5 or greater, the thing is I am using java 10, the newest one. Even worse when I do accept the error's suggestion it screws up the code and makes and just deletes the library completely.

Attached: java.jpg (366x186, 18K)

java

Then I'll re-answer.
No and it shouldn't happen. Working as a developer when you can barely code is a great way to set yourself up for disaster.

Use a better IDE.

Unrelated but does anyone have that picture without obongo in it

bought a hat for my raspberry pi

Attached: motorhat.webm (1280x720, 2.08M)

GIMP'd for you

Attached: 1524077148219.jpg (694x1024, 905K)

whats this for?

Thanks breh, have a nice thread

i dont know yet.
The hat is for controlling DC or stepper motors.
adafruit.com/product/2348

pretty good phone background t b h

>I get a message that I should change the version to 1.5 or greater
serious answer: it's right there in the error message
Your IDE has a "minimum JRE" setting, or something similar. Currently it's set to something below 1.5. Thus the .jar that gets compiled can work on machines with older JREs.
Just google how to adjust this setting for your IDE of choice.
Report back if it doesn't work.

Am doing this, only that in Rust, and I'm stuck at interpreting escape signals like ^C...

#include
#include

main() {
char command[80];
for(;;) {
printf("shell$");
fgets(command);
system(command);
printf('\n');
}
}

ebin :DD

i think it drives straight now.

Attached: justworks.webm (1280x720, 609K)

Then can I get a realistic estimation on how long it'll take?

Trying to build a gui component for my music player.

Anyone got any good learning sources for gtkmm? Their official book is so scattered

looking for good tutorial/guide on android's SQLite databases. haven't ever worked with any database or SQL at all, and i'm already writing a small project for android.
any good recommendations?

Just install this: github.com/syl20bnr/spacemacs/tree/master/layers/+lang/scheme
Then space m s s to choose your scheme dialect and then run-racket to open racket inside spacemacs and then space m e b to evaluate the buffer (you can also load your code directly in the scheme interpreter).

What is your favorite font for programming?

IBM Plex

Comic sans

where can I learn about threading with modern C#?
I'm having a hard time dealing with Tasks and error handling of async tasks

bump, android official documentation seems to be quite poor.

I have never used C# but I will assume "Tasks" is some tasksystem built into the language, on top of some concurrency fundamentals.
I would recommend you start out learning about threads and atomic operations and other synchronization, before trying to use stuff like that.l

typedef struct{
int *v;
int b;
}a

if i have the struct above and i want to send a.v[] to a function, can i just send it like "function(a.v)" or do i need to send the whole struct?
(on C)

Hi dpt,
How are my job prospects at places like Google as a non minority compared to those of, say, a black in the Jim Crow South period?

albahari.com/threading/
Same autor
shop.oreilly.com/product/0636920083634.do

No. 'a' is not an instance of the struct. It's a typedef alias for the struct. You need an instance of the struct to access members.

function [z] = covar(f, x, y)
n = length(x);
z = zeros(n);
for i = 1:n
for j = 1:n
z(i,j) = f(x(i,:), y(j,:));
end
end
end


Suggestions for vectorizing this shite? x and y are n by m matrices. f takes two 1 by m arrays and returns a scalar.

Pic is from
>> [x y] = meshgrid(0:0.1:1, 0:0.1:1)
>> xy = [reshape(x, [121 1]) reshape(y, [121 1])];
>> S = covar(@(x, y) exp (-0.5*norm (x - y)^2), xy, xy);
>> imagesc(S)

Attached: Screenshot from 2018-04-18 18-36-35.png (734x625, 36K)

sorry, fucked up there
i meant if i created a variable named a of the struct type

Then yes. If your function declaration looks something like
void fun(int* arg); or
void fun(int arg[]);
you can call it like this
fun(a.v);

Protip: this is the kind of question that's usually easier to test yourself than to ask the internet.

No idea what hell that is but if you want to fix the image just mirror every sqaure

what did they mean by this?

Attached: file.png (831x713, 65K)

D E P R E C A T E D

>Disable Java

Attached: images.jpg (231x218, 12K)

Fira Code

visual studio's default font

>albahari.com/threading/
>Last updated: 2011-4-27

>game design class
>have to make our games in phaser
>phaser is a javascript framework
What did it mean by this?
Kill me now, I would literally rather write my game in assembly by communicating directly with device files.

>push eax
>xor eax, eax
>testl eax, eax
>nop
>mov eax, jabascribt
>¿¿??
>pop eax

What should I use instead of OOP in c++? Pseudo objects by passing structs like in C? Modular? Pure procedural in namespaces?

Attached: 1512995759703.png (463x492, 205K)

Just use C?

why would you do that

HOLY SHIT
VS Code is the glitchiest shit I ever saw. How come people shill this so hard?

Eh? Compared to atom thoguh? Use gnu emacs

FP

glitchy? haven't noticed that, might be extensions you're using?

This is a fun project. Did this a couple times. Easy to do when your code and your BNF look alike. I had a function for each of my Left-hand symbols, and it worked like a breeze.

Better yet, use Flex and Bison.

>VS Code is the glitchiest shit
in what way? I've maybe had three random window crashes in the year ive used it, other than that that it's great.

Attached: unit testing.png (600x447, 213K)

I've got a simple neuron predictor, with one neuron, three inputs, and one output, using a sigmoid as the activation function. The prediction lags behind the actual value, which is expected, but i'm not sure why it's expected. Any smart lads know why?

Attached: graph.png (800x600, 15K)

that's an user problem. works fine on my machine

I don't need them, I have types

Attached: 24231.jpg (500x500, 54K)

hey senpai,

in c++, how would I get a piece of data from a specific line or column from a .txt file using infile>> ?

Attached: 1520985192594.png (1771x2508, 1.51M)

If you don't know why it's expected, how do you know it's expected?

god I wish I were her

why not use a state space observer?

>wanting to be a womanlet

Attached: 1462665702458.jpg (390x390, 36K)

Cause i'm doing some shit coursework and that's what it says in the spec. The lecturer is shite and the description is shite so I have no idea wtf i'm doing.

I'm trying to seperate Lookup-Tables into extra processes because they're becoming too big for windows to handle.

It sucks having to make a multithreading change that doesn't accelerate the fucking program.

Hi guys, I'm writing a circular doubly linked list implementation. For my is_empty function, is it as simple as iterating through my list and checking if each info field != null? The implementation wouldn't really change from a singly linked list to a doubly?

user, if your list is empty, it won't have any nodes.

What do you mean?

Attached: circular doubly linked list.png (1520x546, 17K)

whoops should say 2 on the right there
in the middle one with 0 elements, the X is supposed to be NULL (so start is a nullptr)

I feel silly. Thanks guys, just waking up and I'm struggling with my data structures and algorithms course.

I think it's a combination of me overcomplicating things in my brain coupled with the fact that I don't practice enough and get overwhelmed thinking about it so I put off starting.

>What should I use instead of OOP in c++?
Be a grown up and write it all in assembly

the smaller the body, the bigger the penises are to me

Just started using angular 5 at work.

I make a component, and use an id in their html, for CSS to refer to.

I then display 2 of this component on the screen. Shouldn't the dom error, because of a double id? Is this good practice? Should I just use classes for everything???

Visualising data structures can help

Make the world a better place

Yeah that diagram worked a treat. Thanks for posting it.

My implementation I've been given has a tail node, but no head node (but you can find head by tail->next), which makes sense, is this just to give you a start point when you do want to traverse the list? Is this standard?

When using duplicate id you will get the first element that appears on the dom soup when you getElementById.
No.
Most of the times.

You would have a representation for non empty circular doubly linked lists, and then a pointer to that is a representation for a possibly empty one

I'm seriously busting my brain, DLLists make sense to me conceptually, I know I have to re-point nodes to the next and previous when deleting etc. However I'm trying to write my destructor:

Find head by returning tail->next
Point tail->next to the head->next and head->next->prev to head->prev.
Delete head
Repeat until is_empty.

I can't make this work in code.

Hi guys, brainlet tier question. I am learning how to reverse a linked list recursively, and I understand the logic, but I only know how to do it when "head" is a global variable. How do I reverse a linked list recursively, when "head" is a local variable, aka, an argument to a function[Node* Reverse(Node* head)]. In other words, how do i return "head" to a variable. This is what I got so far.
Node* Reverse(Node* head)
{
Node* p = head;
if(p->next == NULL)
{
head = p;
return;
}
Reverse(p->next);
Node* q = p->next;
q->next = p;
p->next = NULL;
}

Thank in advance.

pastebin.com/2ve46e2Z
Am I stepping through it correctly in pseudocode? I know I'm definitely not in actual code. Any help much appreciated.

anons I need help. I've been stuck here forever.
No matter what I do it always returns false.

public boolean isHitNSink(Location guess) {
boolean hit = false;
for(int i=0; i

I find your lack of proofs disturbing.

I'm split between learning Java and C; not sure which is better for a beginner, already have some Java under my belt and I feel comfortable learning with Cave of Programming, but the course my friend recommends to me, the CS50 on EDX, utilizes C. Since I'm still very very shit, would it be best to focus on only one? And which one?

>which is better for a beginner
I will always recommend C for beginners. Not because it's going to give you a job, but because it's going to give you perspective. C is an incredibly simple stupid language that you can learn all of the syntactic/grammar rules you'll need fairly quickly (you'll still end up googling function pointer syntax every time you need to use it though). Beyond being simple, it's also so minimalist that you'll have to implement a lot of shit by yourself. This is terrible for most real world programming, but great if you have no programming experience at all. It's also low level enough that you're not going to have as much of a problem with leaky abstractions later on in your programming career.

I won't discourage you from learning Java, particularly if you feel you want to pursue a career with it (although I will caution you that programming in Java will make you extremely unhappy). You should, however, definitely learn C for its benefits to your education.

Thanks; I'll focus on the CS50 course for now. And I do want a future in programming, but I'm not sure with what language and/or focus area, so I'll look around and what is best for what as well.

>Ruby

Holy shit you're back? Been a while since I seen you tripfaggots.

Yeah, I've been rather busy. I'll still drop in from time to time though.

Yeah I haven't posted here in ages. Fuck, I remember some other guys from literally years ago. Some marisa avatarfaggot who was making an OS, another dude named johnson. They all had some IRC channel

Whatever happened to those guys?

A lot of the tripfags have fucked off to Discord. A number of other people have probably just got a life, jobs, etc... /dpt/ tends to be full of mostly beginner programmers, and a few people who stick around because they like either arguing or passing on their wisdom.

lmao watch this, you have no idea
youtube.com/watch?v=HP2InVqgBFM

Yeah I joined some web dev type discord at some point but I just couldn't focus on the subject matter. It was pretty alive, though. I guess all those guys moved there, like you said.

I pass on my wisdom when I can but nobody asks good questions around here, so I just end up provoking arguments for fun and because if it turns out I'm wrong I'll actually learn something.

Where did all the dpt tards go? Weren't they up to 90?

On the other hand, when you actually do ask a question trying to get advice from experienced developers about design and architecture strategies for a particular language, you'll just get a link to the language's webpage describing some basic tutorial shit that probably isn't in any way representative of a production codebase

Every time I come here it's always the same language recommendation horseshit. Do you have a question?

been playing around with python and i'm trying to make a window with some dialog and a button or two, the tutorials i've looked at will create a class

is there a way to do it without a class? i haven't done anything that involves classes so i don't really understand them

Of course. Just use the windowing API directly without wrapping them in a class. Which toolkit are you using?

Just learn classes.
They're a foundational idea in Python.

>guys im a newb i dont even know classes i am following tutorials for button or two
>lol here just let me throw words like windowing and API and toolkit.
The dude eats major ass burgers.

I want to see how someone would architect the various flavors of a web server (API, reverse proxy, static content routing) in Golang, and whether interchanging commonly used microservices with Golang equivalents has any quantifiable impact on performance, time to first minimum viable product, or any other metrics worth mentioning.

Essentially, how the hell would someone use Golang to develop a production web service, and how much of that web service should actually be handwritten Golang