/dpt/ - Daily Programming Thread

Old thread: What are you working on, Jow Forums?

Attached: 1542756450052.jpg (600x812, 349K)

Other urls found in this thread:

math.ias.edu/~vladimir/Site3/Univalent_Foundations_files/2014_IAS.pdf
tutorialspoint.com/java/java_constructors.htm
regex101.com/
crummy.com/software/BeautifulSoup/
twitter.com/SFWRedditImages

Lisp is the most powerful programming language.

Separation types will save linear programming

>not using liquid types

>using types

[extremely concise terminology] will save [extremely obscure techniques]
Am I an intellectual yet?

>Thinking you can tell other people what to post

Trying to learn prolog

Attached: 1539216033775.jpg (736x650, 164K)

In my opinion the whole point of this website is precisely to prove that you can't tell other people what to post

>Trying to learn prolog
why?

don't get too deep into it. Learn the atoms and write decently complex queries and leave it at that.
Then realize that you already know SQL and it's exactly the same.
Learning more pure forms of other programming paradigms is strictly useful.

He finished learning conlog.

There is no try, only do

>ptr[k] is equivalent to *(ptr + k)
Not so fast:
#include

int main()
{
char a[][13] = {"array", "of", "strings", "(print_this)"};
printf("%s\n", a[3]);
char *decay = (void *) a;
printf("%s\n", &decay[3]);
printf("%s\n", decay+(13*3));
}

$ ./a.out
(print_this)
ay
(print_this)
C literally lies to you, a is treated specially despite actually being a normal pointer containing one large 2d 4x13 char string.

I think we both know that example is disingenuous at best and only illustrates that you need to take multidimensionality into account in both cases for there to be a proper comparison.

Well I was reading about the language mercury, and it seems that prolog was a logical first step.
Writing some programs in it feels more annoying to do than in imperative languages, but for some problems (suduko, n queen problem, etc) it's way better.

Attached: 1542679697015.gif (351x498, 1.43M)

>C literally lies to you
It expects you to be self-reliant.

This does not prove anything about how the [] operator works. Go look at the standard if you want to see it actually proven.
All it's showing is that you can use a char * to access the underlying bytes of an array or structure.

math.ias.edu/~vladimir/Site3/Univalent_Foundations_files/2014_IAS.pdf

Homotopy type theory save programming

>Homo
gay

What's the most comfy language?

Attached: comfy.jpg (601x601, 100K)

emacs lisp

Go

italian and c

>italian
Fuck that, American English all the way.

t. mondo grosso

Attached: 1444321756578.webm (1280x720, 1.6M)

Ruby, Scheme, Standard ML.

I can't wait for this year's advent of code, the last one was a blast.

Does anyone have that calendar image from last year?

Y'all here done tell dem freedum-haters, ya hear?

Give me the projects and no one gets hurt, please.

Attached: 1447021850758.jpg (638x680, 143K)

You fuck off too. Having a southern drawl is one thing, that hayseed shit is another.

I can't give you an interesting personality even if you put me at gunpoint, user.

write a webserver library in your favorite language

Try me, bitch.

Attached: 1542437541806.png (425x374, 198K)

Instagram like webpage but for memes

Looks like we got ourselves a Mexican standoff

Attached: DELET.png (662x540, 240K)

the state of you're reading comprehension

Are you making ingots with that irony?

Yuno is the cutest.
Normally some automation stuff is a good project to work on.

Attached: 1495501187959.png (2024x395, 271K)

anyone here with experience in scala?
is it comfy?

She is. Maybe I should make something involving Yuno.

Attached: 96ab6fcf7b2a6211f8ec6d0e280c7bb8.jpg (800x562, 52K)

If you watch a lot of talks about functional programming, the talks which talk negatively about functional programming are usually in the context of Scala and how terrible the Scala implementation is due to its dogged compatibility compliance with Java.

Alright boys I got a stupid question. I am trying to program a Stack RPN Calculator in Java. Heres the problem:

I have my Methods in my ArrayStack.java file
and I want my main method in my TestArrayStack.java file

How tf do I do that? Inside the main method of TAS I put ArrayStack();
Just gives me this error - > The method ArrayStack() is undefined for the type TestArrayStack

Java is NOT my main language and right now I have a serious brain fart and cant word this question correctly to put it into google. Please help a Jow Forumsuy out.

public class TestArrayStack {
public static void main(String[] args) {
ArrayStack as = new ArrayStack();
// your tests here
}
}

Create object ArrayStack and call method.

I just want to write server side applications. And c++ is not an option. Would consider any new language, as long as it is fast and good for coding.

>Would consider any new language, as long as it is fast and good for coding.
>And c++ is not an option.
???

Ily Boys for responding and helping, new prob tho

ArrayStack as = new ArrayStack();

Multiple markers at this line
- The constructor ArrayStack() is undefined
- The method ArrayStack() is undefined for the type
TestArrayStack

tutorialspoint.com/java/java_constructors.htm

Your ArrayStack class needs a constructor, which is basically a function that runs when an object is created from your class. Constructors generally initialize all your variables.

All I wanted was to contribute to a compiler. Is there a compiler project out there with source code that does not look like the 666th circle of hell?

Also, the GHC looks like necro-pedo-zoophilia with hardcore BDSM. Their source code made me think twice before making any big project with Haskell. I think I won't ever do one.

Attached: dep5.png (1053x1019, 194K)

Yall the greatest, hope u dont mind if I keep asking questions as I do this project. but yall helped me sm with that.

Also, dark red is one dependency, dark green is 11 or more.

Now this is what I call proper documentation

Attached: 345534.png (1458x58, 7K)

what I mean is a clean and modern language, not c++.

print (html)
#check title to determine if gone to captcha, if so wait for input
if re.match(r"

java

That line is way too long, fix it.

is that even a valid regex

heres a good site for debugging regexes: regex101.com/

But doing web programming in C++ is clean & simple

Attached: Screen Shot 2018-11-24 at 10.13.48 PM.png (1474x1578, 373K)

Regex can't parse HTML.
You need build own HTML checker.
crummy.com/software/BeautifulSoup/

I'm trying to learn OpenAL. Or I guess, more specifically, trying to decipher the OpenAL wrapper bullshit in SlickUtil so I can do sound without necessarily having to admit I'm using SlickUtil in my inane game dev bullshit.

Attached: 59367177.jpg (400x400, 49K)

re.match() checks at the beginning of input, is that what you intend?

it's just this
html = driver.page_source

>it's the "regex can't parse HTML" nonsequitur again
HTML is a string, regex can parse it just fine if you want to find a specific substring like it looks user is doing.

Trying to go beyond simple examples is a real brain twister that teaches you a lot, both about the power and the limits of the approach to logical programming of prolog. If you stay with pure predicates and don't bother with optimization, you learn about thinking of programs that can work in several "directions", eg. member(X, L) can either select a member of a list or test if an element is in a list. If you try to optimize or use impure predicates, well, you start seeing the limits of prolog's design because you just end up programming a backtracking loop rather than doing actual logic programming, but it's still interesting to think of a same piece of code from two radically different points of view.

My question from the last thread:
And I just discovered something and I don't know if it's important, but apparently both attributes are referred to as "data fields". One of them is the "data field to display" and the other one is the "data field for the value". I don't know if these are proper names or Microsoft is just being lazy with the terminology. How do I do it?

Searching in the string 'html' rather than the variable html. Remove quotations.

Trying to implement in go something similar to trio's nurseries — a construct in an asynchronous framework for python that makes easier to manage cancellation groups.

If you don't know C, you're basically not a programmer.

My last job was probably 85% Scala or so. I wouldn't call it comfy but it is much easier to write safe, correct code than it is in Java. It has pretty powerful functional idioms but almost all Scala developers basically just write Java except when there is some FPish way to improve type safety.

I learned C and then C++ years ago and I'm happy to have given those fuckers up.

Life's too short to deal with pointer reference errors and header files.

header files are easier to understand than the importation system on modern stuff.

>Life's too short to deal with pointer reference errors and header files.
Child's play. What lang do you use now?

Rust has a great module system

Rust is the only moral choice anyway.

>header files are easier to understand than the importation system on modern stuff.
yeah just typing Import whatever is so confusing compared to having an entirely different class of file

Strongly disagree. Headers are an unnecessary overhead (pun unintended) in a modern era of programming.

Imports may not always be straightforward to remember but that's less a flaw of importation and more a flaw of people being utter fucknuts with their package nomenclature.

Besides... programmers worth their salt both know the classes they use and employ an IDE that can auto-import with disambiguation as needed. So it's moot regardless.

Everything I work on personally or for job purposes is done in C#/.NET or Java 8/9.

I'm all for adding an extra layer for portability purposes and anybody who claims "hurr durr lang is slow because CIL/bytecode" is an ignoramus.

Amen, though I wouldn't call it confusing. It's just redundant to need to declare all your method signatures in a separate file. Why do I need to hold the compiler's hand?

spoken like someone who has never shipped an application a day in their lives. headers can be clunky but at least I know what is going on.

no one gives a shit if some trivial toy program you wrote on your dev box manages to run. so can a thousand other languages.

Attached: 0_7ezJOtYUkI5zyqWU[1].png (492x487, 109K)

Why is Rust only used by hobbyist for hobby projects? It's been almost 10 years, and most activity is weekend projects on GitHub, abandoned crates, shitty HN posts, poorly maintained libraries, documentation rewrites, "coming soon" fixed for the borrow checker, and most industrial adoption can be summarised with... mozilla and that's about it

You can't post XKCD here. It's a Яeddit comic.

>pointer reference errors
What? You're saying your pointers don't point where they're supposed to suddenly?
How do you unknowingly write to pointers all the time? Dangling pointer errors is one thing but they should be rare.

> but at least I know what is going on.

Same with Python. Don't use dumb software like anaconda, don't use sudo, clarify explicitly python3 or python2 (e.g. python3 -m pip install), use --user, use virtual env appropriately, etc

Obviously if you're retarded you'll fuck up anything

You know how it is, you know, you forget to deference a pointer, and you're wondering how the hell you got a SIGSEV error.

IS CODING GAY?

*SIGSEGV

fuck, how do I implement reverse for a doubly linked list?
here's what i'm working with
; a doubly linked list
(defstruct (doubly (:conc-name doubly)) < * >)
(defun extend (x doubly &key (where #'doubly>))
; basically cons but we can cons in the front or back of the doubly linked list, and in doing so we setf the corresponding < and > fields to point to each other
; if doubly in args list in not a doubly, then what is returned is (make-doubly :* x) )

(defun doubly-reverse (doubly &key (where #'doubly>))
)

for non doubly, return nil, but when its a doubly, return the reverse
how to do this, we must keep in mind the way in which we traverse the doubly

NO

>don't use sudo
but "sudo pip" just sounds so cute

What language is this?

*Picks nose*
Yeah, sometimes!

>spoken like someone who has never shipped an application a day in their lives. headers can be clunky but at least I know what is going on.
I've shipped plenty of programs
How the fuck is an import hierarchy hard to understand
do you have brain damage

C stands for Crutch

What kind of project would you like to see?

for extend, what I meant is we can cons in the back or front of the doubly (which is itself a node of the doubly linked list)

So you're using a pointer to an index or something like that? It's certainly something you do but that's like in one place in your tagged indirection implementation.
Odd case to pick. Trying hard to think where in my code I'd get an access violation from not dereferencing a pointer. Usually that's just a type error. Or at least a warning as error-error for implicit conversion.

common lisp fammm

>< * >
wtf i love haskell now

use defclass.

because it has goatse?