/dpt/ - Daily Programming Thread

Old thread: What are you working on Sup Forums?

Other urls found in this thread:

learnyouahaskell.com/
en.wikibooks.org/wiki/Haskell
twitter.com/NSFWRedditGif

first for scheme

ocaml really is the best lang ever.

...

Anyone else from the west coast here? Oregon to be more specific. Gonna start d*p***ing you know who pretty soon with a few anons from /107/. You are welcome to join in on the fun

Trying to make a 2-player chess program (no AI planned yet) in C++.
I didn't realize how many rules chess has until I started programming it.

Jesus fucking christ

Opinions on lazy evaluation?

50/50

Easy to use, hard to master.

I'm thinking of a simple project to dive into Django. Any ideas?

Haskell compiler

I don't think you know what Django is.

Should I learn a little bit of Haskell? Is it fun?
All I've done at this point is C and a some assembly.

A movie, if I'm not mistaken.

That's Django Unchained. Django is a web backend framework in python.

>meme is a meme meme meme in meme
Ok, sure.

Yes and yes

AI for chess is quite simple. You just assign values to moves (e.g. a move where you loose a pawn is less then a move, where you take one) and use an algorithm called min-max.

considering writing an mpd client for fun

thank you for your contribution to the thread

functional programming is taking off lately but you might want to consider erlang over haskell for career purposes.

This is a good resource to start with, right?
learnyouahaskell.com/
For now I'm doing it just out of interest.

It's ok, if a bit out of date, I'd recommend wikibooks
en.wikibooks.org/wiki/Haskell
You could use LYAH though

post here if you need help

>functional programming is taking off lately
lolno

Sure, thanks mate.

Yeah I was thinking along those aspects, but I'm focusing on making the 2-player mode work completely, and then if I want to take it further AI would be a good project. I'll look up more about Min-Max algorithms.
Once the functionality of finding the value of a move is made, stringing together multiple moves wouldn't be too hard after getting over the hurdle of predicting the player's move.

Are there some nice sources to learn Qt5 with c++

is there some way of hiding commits on github?
dont want potential employers to see my contributions to CoC-like porn games

use different account?

why not?

but i want to show off my other open surce contributions

recruiters would be too busy jacking it

>CoC-like porn games
what

use two different accounts numbnuts

What design diagrams/tools do you anons use when you program something more complex than FizzBuzz?

MS Paint

I suggest using one of the improved versions of minimax, such as negamax or mtd-f, otherwise your bot will take forever to search at any depth where it would be a decent opponent.

Kate.

erlang is pretty popular with the MUH CONCURRENCY crowd these days, although honestly you'd be better off learning golang or node.js if you're looking for those jobs.

lads, should I go to grad school?

Right now my GPA is tanking due to non-CS related shit classes but honestly I just want to graduate, dunno if I should risk dying for As if post grad on CS isn't worth it over just a regular degree

>due to non-CS related shit
Let me guess, you just play games all day and never actually go to your classes?
I've known far too many people like this.
Fucking go to lectures and shit.

just get a regular degree

i'm not sure how hard it is to get As in burgerland (seems relatively easy tho) but you probably don't need straight As especially in non-CS classes to land a job

>CoC-like porn games
?

How do I remove the action bar on an app in Android?
I've tried:
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
right before loading the activity.


And also:
false
true
in styles.xml.

Action Bar is still showing up.

nevermind, just needed to use

if you have two non-dependent reads from the same texture in a fragment shader, is it better to use the same sampler/texture unit, or is it better to use two separate texture units? like how does it work on the hardware level, would the same texture unit have to read the texture twice sequentially whereas two texture units could read the texture in parallel?

not programming

Probably it's like you say, but the performance hit would only be noticeable with many reads (like if you do a 9x9 gaussian blur or something like that). It's best to make a test case and measure fps, not guess though (of course the results will be bound to your hardware and can be different for different hardware).

hi dpt.

I'm trying to learn python - I'm a complete noob.

Doing "Project Euler" challenges to get myself up to speed on file I/O, algorithms etc.

A lot of the challenges require the use of prime numbers. I generally cop out and use an ASCII text file full of primes as a database of numbers.

Should I be generating primes on my own? Or is it just a waste of time to rewrite AKS in python for my specific learning purposes?

I think Project Euler is much more about Math than programming.
>Should I be generating primes on my own?
Yes. It's easy as fuck.

>get assignment about xml parsing (in java)
>professor throws us a bone and gives us barebones code to work with
>it's utter shit that iterates over every fucking child node directly instead of using the functions made for that exact purpose
>literally doesn't even work
What the fuck?

>going to college
found your problem

DOM?

He even told us that since this was so difficult we were allowed to make the code as dirty as we wanted. Probably more to cover his ass than ours.

Yup.

k

you know there are unicode characters for chess pieces right?

Cool. What do you recommend for programming challenges for practice?

>xml
>java
>shitty code

Sounds like your prof was a shitty programmer in the late 90's and so he decided to become a teacher because he certainly couldn't do the work.

i wouldn't recommend project euler because like user said it's very focused on math but it wouldn't hurt to do the first 20 or so if you're a complete beginner to help you think in terms of algorithms and to implement some things yourself like a prime sieve

I had it as well, but after DOM we saw SAX which isn't that much of a hassle

A whiteboard, markers and a camera.

Sounds likely enough.

It's a java class, not an XML class.

Anything similar for more 'programmy' related stuff?

you could look at advent of code, there's a series of challenges from 2015 and an ongoing one for this year too

i haven't done it myself so i'm not sure what the difficulty level is like

Working on a script to attack bcrypt with wordlists but it seems too complex, am I right in thinking it should hash a word from the wordlist compare that hash to the target hash if they match print the plaintext word if the don't check the next word and so on

So I made the below relation in prolog. It finds every unique path a knight can take on a chess board without landing on the same square twice. knightsMove(Lst, Nxt) takes a square Lst and makes Nxt any possible square, provided the squares are on the parameters of the board.

While the function works, when it's output all possible paths it doesnt halt; instead just freezes. Any advice on how to make it stop freezing?


knightsPath([_]).

knightsPath(Path) :- knightsPath(TempPath),
last(TempPath, Lst),
knightsMove(Lst, Nxt),
not(memberchk(Nxt, TempPath)),
add(Nxt, TempPath, Path).

application development

Yeah, not programming.
Putting a few Winforms together doesn't make you a programmer.

Learning design patterns in JavaScript desu.

Is this what the observer pattern is?

function createObject() {
var events = ["kek", "change", "click", "x"];
var observer = createObserver(events);

function kek() {
observer.emit("kek");
}

return {
on: observer.on,
kek: kek
}
}

function createObserver(arr) {
var events = {};

function on(event, func) {
if(events[event]) {
events[event].push(func);
}
}

function emit(event) {
if(events[event]) {
events[event].forEach(function(func) {
func();
});
}
}

arr.forEach(function(event) {
events[event] = [];
});

return {
on: on,
emit: emit
}
}

var obj = createObject();

obj.on("kek", function() {
console.log("KEK event was triggered");
});

obj.kek();

>design patterns
why

Whats your internet speed, Sup Forums? I got 30 down 3 up

I want to get some numbers for data spreading models in BasicTV and a rough network throughput.

iirc mit posts assignments with solutions on their opencourseware thing.

What's wrong with learning design patterns?

like 300 kb/s down, 15 kb/s up. shitty rural internet. at my uni i get 50mb/s down.

design patterns are bad practice

Because design patterns are only there so you can write shit code instead of learning how to solve problems.

Design patterns are there so you can masturbate about problems and elegant code instead of actually having to write any.

like 16 down (actual out of like 24), 1 up

there's nothing bad about design patterns, they can be handy sometimes. just don't try to use them everytime you decide to program something

scratch that i measured 14 down, .87 up so like """"up to"""" 16 down, 1 up i think

Has /dpt/ ever agreed this much before?

this but they can help describe things when dealing with code monkeys

Wew, didn't know /dpt/ was this retarded.

Shan't be posting here anymore.

Good bye.

/dpt/ is in fact retarded and i've done some of my best productive work when i've been away from /dpt/, i suggest you leave while you can and only come here for questions that you don't want to bother taking to stackoverflow, this entire day has been mostly procrastination for me all because i opened up some Sup Forums tabs when i had my morning coffee

see you tomorrow.

>i've done some of my best productive work
such as?

You're implying that programming isn't done within android applications?
lol

When I clicked on your post number to give you a (You), it ran some code

I sure did some fine programming right then

setting layouts in markup languages isn't programming tho

How do i make items in LINQ to show in every row, instead of right next to each other

var Nigger = from item in items
select new {item1, item2, item3}

welfare the variable

I knew i shouldn't have put Nigger

what exactly is that line of code doing there? c is a fucking mess. is that recursion?

>d*p***ing
Is that some kind of slang sexual deviants use?

Eat a bunch of dicks, that's C++.

yeah whatever

Is it even possible to do this?

What code is this from?

???

Runs static method DoQuery of class TIQuery with some template arguments.

>is that recursion?
looks like it

recursion in general is a mess so i wouldn't blame C++ too much in this case