[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
/DPT/ - Daily Programming Thread
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 255
Thread images: 48
File: nagisa.png (1 MB, 1439x1193) Image search: [Google]
nagisa.png
1 MB, 1439x1193
The other two faggots made the DPT before the bump limit, so this is the new DPT.

What are you working on /g/?

Old thread >>53569788
>>
If you're not using a language with a type system at least as powerful as Haskell's, then you're not programming.
>>
An autoreporter that reports duplicate /dpt/s
>>
>>53575670
OCaml has a pretty good type-system honestly.
OCaml is the natural evolution to (S)ML.
>>
I updated my friends bot using old discord.py
to new discord.py

>inb4 called a pythonfag
>inb4 told to kill myself
>>
>>53575640
I'm working on designing a rateyourmusic clone, but I'm not sure which language to choose. I'm considering Perl 6 using CGI and Elixir especially.
>>
File: erlang-fault_tolerance.png (27 KB, 784x393) Image search: [Google]
erlang-fault_tolerance.png
27 KB, 784x393
>>53575728
What's the point of using Elixir instead of erlang excluding the ruby-like syntax.
>>
What do you guys usually unit test on Android?
>>
>>53575728
Haskell

>>53575703
I agree. It makes different tradeoffs than Haskell though, and I don't think the payoff is worth the downsides of them.

>>53575712
We're trying to help. Honestly. Even if you go back to Python after trying something else recommended to you, you'll be a better Python programmer than you used to be.
>>
>>53575013
>>53575013
>>53575013
>>
>>53575787
Made prematurely (291 posts).
>>
Why do we have 4 dpts and why is it all the same girl?
>>
>>53575784
>We're trying to help.
Uh I think you got the wrong guy because I haven't been getting any recommendations, but I do wanna try something else, something like C/C++ or Go

not quite sure what to select tho
>>
Is it just me or is /dpt/ getting boring?
>>
>>53575784
I can't understand the syntax of Haskell, and the fact that it's not Lisp annoys me.
>>
File: ss (2016-02-20 at 02.45.09).png (12 KB, 498x355) Image search: [Google]
ss (2016-02-20 at 02.45.09).png
12 KB, 498x355
Haskell mustard race reporting in.
>>
>>53575815
1 is the old, over the bump limit thread, it will die soon.
2 and 3 are some autistic faggot niggers that made their own prematurely (before the bump limit)
4 is this

>>53575831
It's just you.
>>
>>53575799
okay autist
>>
NON-FAG THREAD >>53569788

>>53575831
it's not just you, /dpt/ is fucking shit, and it has gotten worse lately with all the spergs and traps
>>
>>53575836
Since I do not know Haskell, do I understand this correctly?
mkFizz is a function that returns an Int and uses currying to take a String, a Int and a writer as arguments, right?
And the line bellow that is patter matching?
Is where a guard?
>>
>>53575819
I'd say avoid go.

C would be good for teaching yourself pointers and getting a better idea of how things function at a lower level. I'd also recommend a functional language, maybe ML or Haskell, for a more principled and rigorous introduction to maps, filters, folds, and recursion, and the underlying theory behind them than Python can realistically provide. Scheme is a good choice for getting into metaprogramming. Clojure's concurrency model (channels) might also be useful.
>>
>>53575856
it has hit the bump limit

Go hee:
>>53575013
>>53575013
>>53575013
>>
>>53575815
because /g/ barely has a janitor
>>
File: serveimage.jpe.jpg (105 KB, 500x623) Image search: [Google]
serveimage.jpe.jpg
105 KB, 500x623
thoughts on this book? id like to get ahead in class and learn c++
>>
>>53575899
yeah i had the wrong link sorry

>>53575013 is the real thread
>>
>>53575854
Yes, I have made my own Lisp dialect. It is in fact a library to make your own lisp dialects. Sadly it doesn't use JIT or anything fancy like that yet.
I think lisp is a great choice because it is simple and gives you a huge amount of flexibility.
>>
Anyone ever wrote their own scripting language?

I'm in statistics research, and I've built up my own small library of functions to deal with things I encounter on a daily basis, like parsing through different program's output files to grab specific results, fourier transforming things etc...

However, whenever I want to start a new project, I start a new c++ source and link in my library, and just plob in the functions I need in the right order. I was thinking of trying to make this process into my own scripting language so I don't even need to worry about compiling new code when I want to do something slightly different the data.
>>
>>53575924
Moomin edition is best edition
>>
I'm trying to write a theorem proving program in python that recursively tries rules against each other and adds new rules until it either runs out of combinations or finds a contradiction

I've hit a wall though, it just sticks the same two rules together every time until it hits recursion limit and crashes
how would dpt keep track of something like this?
I was thinking a 2d array of boolean values to keep track of what I have and haven't tried and updating that every time, but it seems like it would take up a lot of memory to possibly have a 20x20 array for each function call
>>
>>53575936
See >>53575935
Parsing sexpr is literally having a while loop and a switch statement inside it.

>>53575945
This thread has a moomin, look at the image >>53575640
>>
>>53575873
mkFizz
– takes an Int, String and another Int, and
– returns a Writer, which accumulates its state in a tuple of type (Any, String) and returns Int as the result

There is no pattern matching in mkFizz, the where clause is just local binding, it's equivalent to
let divides = ...
in writer (n, ...)


There's a pattern match in final, tho:
where (n, ...) = runWriter w

matches the return value of runWriter to the tuple
>>
>>53575976
Thanks anon. I would like to start learning Haskell in the near future but I had no time yet.
>>
File: scr.webm (2 MB, 1120x682) Image search: [Google]
scr.webm
2 MB, 1120x682
Ask your much beloved programming literate anything (IAMA).

>>53575640
>What are you working on /g/?
/r/dailyprogrammer 258 intermediate (webm)

>>53575769
It's obligatory when doing TDD.

https://en.wikipedia.org/wiki/Test-driven_development#Benefits

>>53575703
still waiting for parallel threads.
>>
>>53575919
This was my textbook for my introductory programming class. I liked it. It felt comfy.
>>
Help with LinkedLists please
Why would I use them over ArrayLists?
>>
>>53576047
Constant time and space prepend. Constant space append.
>>
>>53576002
Nice to hear that. Good luck and I hope you'll have fun learning.
>>
>>53575836
Why do you need Any?
>>
>>53576047
LinkedLists have shit cache performance and benchmarks show that they usually aren't worth it unless you have >1000 elements.
>>
>>53576012
https://news.ycombinator.com/item?id=9582980
Yet another instance where GIL ruins languages. It seems a bit weird because OCaml is an almost pure functional language.
>>
we /bump limit/ now
>>
>>53576061
What?

I understand how arraylists work, but what is this stuff about head and nodes?
>>
>>53576093
GIL would have been fine before multicore processors were the norm. Green threads can take you a long way.
>>
>>53576093
>It seems a bit weird because OCaml is an almost pure functional language.
The author of ocaml hates multi threading.
>>
Based mods saved the day.
>>
>>53575936
I did it several times. The easiest way it to use PEG grammar parser generator.
>>
Object-Oriented Programming is Bad
https://www.youtube.com/watch?v=QM1iUe6IofM
>>
>>53576047
linked lists are almost never useful

but they can let you move/insert/remove items without having to move "adjacent" items
>>
>>53576047
resizing linked lists is an O(1) operation.
>>
File: you-dont-say.jpg (19 KB, 500x280) Image search: [Google]
you-dont-say.jpg
19 KB, 500x280
>>53576085
>>
>>53576121
>Green threads
Useful only if you do not know how to design a proper state machine.
Or if you are using wheel-chair systems like HURD. (adds one extra thread per processthat waits on recv so it can catch POSIX signals)
>>
>>53576134
>Brian Will
Literally who?
>>
I got offered a placement /g/! What do I do to celebrate?
>>
>>53576159
bullshit
>>
>>53576178
Placement where? At uni?

>>53576159
You can't resize linked lists, only add items to them.
And it is a O(n) operator if you do not have a pointer to the last item.
>>
>>53575954
Use hash table or a set, modify it on each iteration.
>>
also /dpt/ you will be my hero if you can give exercises that will help a newbie learn Threads in C# especially garbage collection.

Are threads so my program can be working on things simultaneously rather than top to bottom?
>>
>>53576078
Because you want to print out the message whenever at least one of the things matches.
>>
>>53576116
A linked list is a sequence of nodes. Each node contains an element of the list, and points to the next node in the list. The last node of the list points to null instead. The first node is the head of the list.

In contrast, an array list contains a single array, which contains all the elements of the list. This makes random access much faster than for a linked list. However, there are drawbacks: if appending an array to the list would go past the end of the array, a new, larger, array must be allocated and every element copied to it. This array is now used to hold the elements of the list. A new array must always be allocated to prepend an element to the list, and a copy performed. Thus prepending always takes linear time.

In contrast, prepending to a linked list simply requires creation of a new node, which is made to point to the current head of the list. This new node then becomes the head. However, appending to a linked list always requires you to traverse to the very end of the list, in order to set the pointer of the current last node to the new last node. Thus appending always takes linear time.
>>
>>53576047
If you enjoy cache misses.
>>
>>53576179
>add item to front or end
O(1)
>remove item from front or end
O(1)
>>
>>53576209
Csharts can't into multithreading
>>
>>53575640
not feminine enough feet
>>
>>53576160
Lots of intro algorithms courses present linked lists as a serious algorithm when it should be mentioned along with bogosort
>>
>>53576225
nagisa is a boy
>>
>>53576202
yeah, I was thinking that the only way was to keep track of the combinations I've used
was hoping to get something that wouldn't take up a load of memory when it gets deep into the recursion, but I guess it can't be helped in this situation
>>
>>53576221
>add one item to front or end
>remove one item from front or end
that is one narrow definition of "resize"

RETARD
>>
>>53576134
No shit. Especially when it isn't really object oriented as there is no message passing
>>
File: tumblr_nk2w9eWPEa1sirrpwo1_500.gif (2 MB, 500x281) Image search: [Google]
tumblr_nk2w9eWPEa1sirrpwo1_500.gif
2 MB, 500x281
Thank you Mister Janitor.
>>
>>53575954
Look up Entscheidungsproblem.
>>
>>53576134
what is not "bad"?
>>
>>53576241
i know?
>>
>>53576209
Threads lets you execute code in parallel.
Something you might like: https://www.youtube.com/watch?v=cN_DpYBzKso
>>
>>53576214
I have been trying to understand this from watching videos and looking at sample code.

So if I want to add something to a certain position of the list, I have to compare values between nodes until I get the result that I want?
>>
File: 50946491_p0_master1200.jpg (472 KB, 1000x625) Image search: [Google]
50946491_p0_master1200.jpg
472 KB, 1000x625
>>53576225
How about this?
>>
What is the correct way to exit a Qt program?
I want the UI to be optional, but without it, the program never exits as there is no window to close.
>>
>>53576320
Does QT auto-catch SIGINT/SIGQUIT/etc?
>>
>>53576291
Yes, if you want a sorted list.
>>
>>53576320
http://doc.qt.io/qt-5/qcoreapplication.html#quit
>>
>>53576299
>shiota

they're not even trying to be subtle
>>
Is it true that most modern 64bit game engines handle multithreading automatically?
>>
>>53576385
>>>/v/
>>
>>53576291
You'll need to keep a counter, and traverse the list, updating the counter each time until you get to the index you want, then insert the element as a new node pointing to the next node to be traversed and update the previous node.
>>
File: 1458319903336.jpg (38 KB, 768x384) Image search: [Google]
1458319903336.jpg
38 KB, 768x384
>>
>>53576385
Considering most game performance scales notoriously awfully with number of threads, no.
>>
>>53576012
>It's obligatory when doing TDD.
I was asking because I am having a very hard time differentiating unit testing and integration testing.
>>
>>53576259
I understand that it's impossible for it to be a general theorem proving program, but this one just proves the pigeon-hole principle for small values of n by using the resolution algorithm
which I have done by hand, so it is definitely possible for a program to do it
>>
>>53576123
Why?
>>
>>53576385
no

game engines are mostly overrated junk, there's nothing magical about them
>>
>>53576510
Look up DPLL.
>>
>>53576524
http://mirror.ocamlcore.org/caml.inria.fr/pub/ml-archives/caml-list/2002/11/64c14acb90cb14bedb2cacb73338fb15.en.html
>>
File: umaruchristmas.jpg (216 KB, 850x1232) Image search: [Google]
umaruchristmas.jpg
216 KB, 850x1232
>>53576093
4.03 will not support multicore

>>53576385
not entirely but today game engines are multi threading rendering by default.
>>
File: LOL.png (7 KB, 525x137) Image search: [Google]
LOL.png
7 KB, 525x137
>>
>>53577023
but seriously how the fuck do i do something as trivial as rotating a fucking vector without having to explicitly specify a rotation matrix
>>
what does moomin have got to do with programming threads?
>>
>>53577101
at least they're finnish

traps have fucking nothing to do with programming
>>
File: Capture.png (44 KB, 323x157) Image search: [Google]
Capture.png
44 KB, 323x157
>>53577101
Nothing. The people who have races about threads so they can post any image that isn't related to programming is a shitposter.

>>53577121
Say what you will but the trap threads usually edit the images to include programming things. Can you say the same about the other garbage?
>>
File: kpK3aoi.jpg (51 KB, 552x496) Image search: [Google]
kpK3aoi.jpg
51 KB, 552x496
>>53577121
pic

>>53577139
Nagisa is not a trap.
>>
File: trap programmer.png (1 MB, 1702x2471) Image search: [Google]
trap programmer.png
1 MB, 1702x2471
>>53577121
what
>>
>>53577139
the trap fag is the real shitposter, he's the only reason i post threads before the bump limit (i can't speak for the moomin poster)
>>
>>53576539
This. Everyone thinks he has to reinvent the wheel and ends up just downloading more RAM.
>>
>>53577173
This is the car shitposter. Worse than traps.
>>
>>53577173
No, the real shitposter is the one that posts the subreddit garbage and random images that have nothing to do with programming. You probably don't even attempt to post Yuki or one of the older /dpt/ images.
>>
Anyone got a link to that SICP doujin? The one with the snake.
>>
>>53577207
i used to post yuki just so we could all unite against the trap fag but people complained about the anime and the yuki image is shit anyway, it's some crappy fan drawing
>>
File: daily_programming_thread.png (2 MB, 800x1097) Image search: [Google]
daily_programming_thread.png
2 MB, 800x1097
From the times when dpt still was tolerable.
>>
add-type -assembly System.Windows.Forms

$bytes = [Convert]::FromBase64String("dXIgYSBmYWdldA==")
$utf8 = [Text.Encoding]::UTF8
$msg = $utf8.GetString($bytes)

$form = new-object Windows.Forms.Form
$form.set_Width(300)
$form.set_Height(180)

$p1 = new-object Drawing.Point (120, 50)
$p2 = new-object Drawing.Point (110, 90)

$label = new-Object Windows.Forms.Label
$label.set_Text($msg)
$label.set_Location($p1)
$label.set_parent($form)

$btn = new-object Windows.Forms.Button
$btn.set_Text("Okay")
$btn.set_Location($p2)
$btn.set_Parent($form)

$form.ShowDialog()
>>
File: sicp-trap.jpg (474 KB, 1015x1505) Image search: [Google]
sicp-trap.jpg
474 KB, 1015x1505
>>53577207
>subreddit garbage
The umaru poster.
The worst shitposters are the ones that post before the limit. (that includes >>53577173)

I wish people would post new thread only after the old one is kill.

>>53577240
Every SICP doujin has a snake.
>>
>>53577269
There's more than one?

It was an edit of something like 'The Usual Game'. I need a good kek tonight.
>>
>>53577269
the trap fag is the one who's been posting before the bump limit and it's mostly only in response to him that we've posted before the bump limit FUCKING RETARD

the umaru poster almost never posts any more
>>
File: SICPed.png (1 MB, 1000x1280) Image search: [Google]
SICPed.png
1 MB, 1000x1280
>>53577297
What else did it have?
>>
umaru+subredditshit doesn't even bother me any more because the hime poster managed to find something even more cancerous
>>
>>53577312
>in response to him
The car poster does not get to talk. Kill yourself.
You don't make new threads before the bump limit "in response" unless you are a fucking nigger.
>>
>>53577321
I don't really remember. Think it was about a brother and sister and the sister started masturbating in front of the brother then they fucked.
>>
>>53577269
>>53577321
Which LISP interpreter should I get? I'm on windows but I suppose I could use my virtual machine if I have to.
>>
i miss the hime poster
>>
>>53577334
Scheme
>>
>>53577332
no YOU KILL YOURSELF fucking trap FAG
>>
>>53577345
I can't read SICP and not write in LISP.
>>
>>53577334
For CL use SBCL (Steel Bank Common Lisp).
For Scheme I use guile 2 but I hear that it's slow.
I guess you could use Racket.

>>53577345
It's not an interpreter.

>>53577351
Yep, the car poster. You were proven as a newfag quite some time ago, you don't get to talk.
I always post my threads after the bump limit.
>>
>>53575640
i made hangman 2dai in java for shits and giggles
>>
File: 暗殺教室 7巻082.jpg (161 KB, 829x1395) Image search: [Google]
暗殺教室 7巻082.jpg
161 KB, 829x1395
P-Please help me decide, DPT! >>53575728

I don't want to use PHP, because that's relatively boring. Same goes for Python, which I've made many applications with.

I was considering Perl and CGI because I haven't used CGI in a long time, and I like the fun of using "legacy" stuff like that. Also, Perl would be a new language to learn.

But I also had Elixir in mind, also being a new language for me. But I don't know anything about the ecosystem relating to web development.

I would have used CL if the ecosystem were better.

I can't understand Haskell's syntax, and it doesn't look very nice to me. I have a hard time understanding the concepts like monads. I wish it had macros similar to Lisp, but sadly it doesn't.

Any language or library suggestions are welcome, so please suggest.

I'm not averse to using a framework, but I don't like ones with too much magic like RoR on Django.
>>
>>53577376
delusional retard
>>
File: 49302020_p0.jpg (431 KB, 768x768) Image search: [Google]
49302020_p0.jpg
431 KB, 768x768
>>53577380
Use Perl 6 Ira.
Perl 6
>>
>>53577376
you're probably the trap fag himself and lying because you're incredibly biased toward him and defend him when he's the main /dpt/ OP shitposter
>>
>>53577380
msf
>you said framework, ¯\_(ツ)_/¯
>>
>>53577415
>¯\_(ツ)_/¯
why isn't this filtered like le lenny face
>>
>>53577389
>>53577407
Nice samefagging.
I haven't posted any Hime thread.
>>
>>53577407
The main shitposters are the ones who complain about anime.
>>
>>53576362
sorry if it is just my comprehension that is wrong, but how exactly am I supposed to call this?

I have a signal I emit when I want to close the application.

I think it should be something like this
class quitter : public QCoreApplication {
Q_OBJECT
public:
quitter();
public slots:
void quit_app(int exit){
QCoreApplication::quit();
}
};


but should I enherit from something else or should it be part of some other class?
If it should be part of some other class, or what?
The tutorials all show that my structure should be something like
int main(int argc, char *argv[]){
QCoreApplication app(argc, argv);
QObect::connect(....);
return app.exec();
}

But should my app receive the signal directly or should I put it inside the class so it can close?
>>
>>53577433
that hasn't been the case since probably 1+ year ago

>>53577431
you still defend it like a proper faggot
>>
>>53577433
1: The ones that complain about anime
2: The ones that complain about the lack of it
3: The ones that post prematurely
4: The ones that post FUCKING CARS
>>
>>53577445
Was the one with Dr Octagon acceptable?
>>
File: 01-apollo-arrow-geneva-1.jpg (633 KB, 1920x1280) Image search: [Google]
01-apollo-arrow-geneva-1.jpg
633 KB, 1920x1280
>>53577445
i posted a car fucking ONE TIME

you've got a car phobia or something, faggot?

the main shitposter is the trap fag that keeps forcing his fag shit and stirring up thread wars. unlike you newfags i've been around during peacetime and it was fucking good
>>
>>53577444
Mad, considering how you need multiple posts to express your rage in a thread that wasn't made prematurely or had a trap image.
>>
>>53577380
Use Lua.
>>
File: 1457921384557.jpg (134 KB, 930x539) Image search: [Google]
1457921384557.jpg
134 KB, 930x539
i know this is arousing to you closeted car fetishists
>>
>>53577469
There is no war you fucking faggot. We are in a thread that wasn't posted prematurely and had a nice programming discussion BEFORE YOU FUCKING NEWFAG showed and started samefagging.
>>
>>53577490
News: Shitposting faggot tries to ruin the thread after he got his premature thread deleted.
>>
File: 09-apollo-arrow-geneva-1.jpg (428 KB, 1920x1280) Image search: [Google]
09-apollo-arrow-geneva-1.jpg
428 KB, 1920x1280
>>53577494
lol ok fag keep believing that
>>
File: 13-apollo-arrow-geneva-1.jpg (505 KB, 1920x1280) Image search: [Google]
13-apollo-arrow-geneva-1.jpg
505 KB, 1920x1280
>>53577509
i didn't post any thread, FAG
>>
I'm doing Project Euler but keeping it all within one solution because fuck having a million individual files spread across everywhere for that.

Is there a way to programmatically build a switch in? So instead of having to write in a new switch entry for every single problem I complete to run it, it'll just read every class and create a switch option based on it?
They're all just Problem_01 Problem_02 etc
>>
>>53577512
>that wasn't posted prematurely
It was exactly 310 posts

>and had a nice programming discussion
See the posts before >>53577101

>BEFORE YOU FUCKING NEWFAG
Your shitposting is everywhere

>and started samefagging
See >>53577431

Everything I said is a fact.
I will stop replying to you as to avoid shitting up the thread more. I hope everyone else does the same.
>>
File: 10-apollo-arrow-geneva-1.jpg (426 KB, 1920x1280) Image search: [Google]
10-apollo-arrow-geneva-1.jpg
426 KB, 1920x1280
>>53577566
OK YOU STOP REPLYING

FAG
>>
>>53577557
>what is a file folder
>>
File: Screenshot_20160320_082306.png (39 KB, 478x510) Image search: [Google]
Screenshot_20160320_082306.png
39 KB, 478x510
want to learn assembly of some kind

is MIPS easy? Anyone know any good resources?
>>
>>53577494
>There is no war
anon...
>>
>>53575640
How the fuck do i hold the console until a key is pressed on c++?
>>
File: 暗殺教室 7巻135.jpg (221 KB, 825x1395) Image search: [Google]
暗殺教室 7巻135.jpg
221 KB, 825x1395
>>53577415
This isn't the kind of framework I was talking about.
>>
spergs are the worst

they're like the homo sapiens equivalent of C#

they're shit like normies

they're shit like autists

they excel at nothing
>>
>>53577608
yes...they're all in a file folder
Now what would I use to programmatically create a switch so I can selectively run any given problem
>>
>>53577661
_getch() deprecated
system pause meme
i'm on visual if it matters
>>
>>53577661
You spawn it from an already open terminal emulator so the shell will keep running after you quit your program.
>>
File: Fun.jpg (31 KB, 225x272) Image search: [Google]
Fun.jpg
31 KB, 225x272
I'm looking for a type of software that I'm not sure exists, but I'd like to write. Just wondering if you guys had heard of anything similar.

I want a workflow monitoring tool. The usecase is that I'm at a large organization and every team has their own processes that we have to manage and make sure functions as expected. Every server would have a heartbeat for statuses and hooks in specific processes to know that it was kicked off or that it has finished. Ideally it'd be decentralized so every node could have the same configs that propagate as nodes are added/removed. Ex: Let's say we have two pipelines, one for ops and one for devs

OPS: build server -> configure server -> start services
DEV: source control -> build -> deploy -> start services

The tool could handle both by checking that the executables are either running/completed/not started yet, whether that's bash/ruby/python/etc.

This is not meant to be cluster management or orchestration, just lightweight monitoring. Also I just want the senpais at Hashicorp to notice me.
>>
DPT should make a MUD.
>>
>>53577722
Include all the files then something like this?

#define SWITCH(a) \
a("euler8", euler8() )\
a("euler9", euler9() )

#define a(name, func) if (name == "eulerYouWant") { func; } else
INSTRUCTIONS(a) { printf("default action\n"); }
#undef a
>>
>>53577770
L O G O
O
G
O
>>
>>53577441
just connect quitter's quit_app with app's quit()
>>
Forstår dere Haskell? Kan dere skrive det?
>>
In Visual c++ is it possible to choose what type of vector you want to create? Is not possible is it because it needs the type at the time of compiling
>>
haskell SUGER ÅSNEBALLE
>>
Haskell er fantastisk.
>>
haskell is fucking shit there is no compelling reason to use it other than if you're a sub-105 IQ trap faggot who uses it to delude himself into thinking he's smart
>>
>>53577807
>name == "eulerYouWant"
>Equality with a string literal
C doesn't guarantee that identical string literals will point to the same place.
>>
>>53578033
>sub-105 IQ trap faggot who uses it to delude himself into thinking he's smart
Nice meme

Btw I'm a reverse trap
>>
>>53578049
btw i'm a heterosexual male and you should kill yourself
>>
>>53578047
Use strcmp then. I'm not going to hold someone's hand if they're writing in C.
>>
>>53578049
I fucking HATE reverse traps
>be me
>gay
>find a guy I really like
>it's actually a girl
Fucking scum, you ruined my love life.
>>
>>53578086
I'd have pegged you, m8.

But desu, if the only guy you found that you like was really a girl, are you sure you're not actually straight?
>>
File: 256.jpg (29 KB, 367x451) Image search: [Google]
256.jpg
29 KB, 367x451
>>53578086
>>
>>53578086
>be me
>gay
>find a crossdressing guy i really like
>it's actually a girl
REEEEEEEEEEE
>>
>>53577334
If Common Lisp, get SBCL
If Scheme, get Racket.
>>
Haskell is the world’s finest imperative programming language.
>>
fags are FAGS
>>
>>53578153
Jeg liker deg
>>
File: gay_I_tell_you.jpg (54 KB, 640x591) Image search: [Google]
gay_I_tell_you.jpg
54 KB, 640x591
>>53578199
>>
>>53575640
>tfw overthinking everything
> feel worthless
>can only program when you're drunk now
Smfh senpai, I am a joke.
>>
>>53575640
Ethereum bot
>>
File: 1440824172492.jpg (28 KB, 400x346) Image search: [Google]
1440824172492.jpg
28 KB, 400x346
For a program I have an array of integers (Java)
If I want to input in an empty slot, and since i can't store a "null" into that spot, how do I keep of "empty" slots?
>>
>>53578559
whut

Not sure what you're asking
>>
>>53578559
ints can only have values from Integer.MIN_VALUE through Integer.MAX_VALUE

you could use Integers since empty slots would be null, but you probably don't need it, this sounds like an XY problem
>>
>>53578559
Keep an array Optional<Integer>
>>
>>53575784
>I agree. It makes different tradeoffs than Haskell though, and I don't think the payoff is worth the downsides of them.
I almost feel this way, but 9 times out of 10 I find myself working in OCaml over Haskell because it just feels so much more comfy to me. There are some features that I always miss when moving to Haskell. I do hate not having type classes, but I can live with that using modules. In Haskell, the lack of first-class modules is really annoying to me.
Also, I still haven't found what it is, but there's something that makes Haskell feel uncomfy to me compared to OCaml that really stops me from using it a lot of the time. I feel like a lot of other OCaml users have this problem too, because if you take a look at most of the big OCaml user's github profiles you'll notice that a lot of them have a handful of Haskell projects on there. I think it has to do with the libraries, honestly. Trying to learn an OCaml library is generally a whole lot easier for me... thinks like named arguments are great and it's often a lot harder for me to find good documentation for even some of the more popular Haskell libraries. For example, a few weeks ago I tried to start a project with Snap cause i heard a ton about it on Hackernews. It looked great, but looking through the documentation for it on Hackage it felt like I was getting an overview of how it's implemented rather than what everything does. Yesod documentation was a lot better, but it still feels weird that some random OCaml library with 10 users often has better documentation/example code than a popular Haskell framework. Anyone else have thoughts about this? Maybe I'm just picking a lot of shitty libraries, but I've had that experience with Haskell a lot and that really pushed me away from it.
>>
Writing documentation for my LDAP admin panel
>>
>>53578559

You can store null still. It's an array of integers but it isn't "filled" until you put something in there. You can set slots to null when you're done with it too, but it still takes up place in memory. Not sure what you're trying to achieve.
>>
>>53575936
Maybe you can make small programs and use bash scripting
>>
>>53577979
>is it possible to choose what type of vector you want to create
Yes, it is. While the vector type needs to be known at compile time, it will be one type out of known types, so there is no reason why you cannot generate vectors of different types at runtime, e.g.


std::vector<int> generateIntVect();
std::vector<double> generateDoubleVect();
.
.
.
etc.


You can also make it more general by creating a base class that has some accessor code, and use inheritance to define collections for some of the other types you want.

You can also do something icky, like write a magic Value class that would allow for (seemingly) heterogeneous vectors, e.g.
vector<MagicValue> test;

test.pushback(14);
test.pushback("A string");
test.pushback( some_other_object );
// the above can be done if the MagicValue class has appropriate conversion constructors and/or overloaded cast operators

// that is, in each case, the vector is taking an instance of MagicValue because the following is legal
MagicValue foo = 14;
MagicValue bar = "Test";
.
.
.
// etc


I don't recommend the last one, because it allows for some sloppiness when it comes to type safety. It also means you need to write your own way of querying the MagicValue to see what type it is, and you have to keep track of that carefully.
>>
I want to practice my optimisation skills. What's a good problem that is simple to implement but hard to make fast and efficient?
>>
>>53575670
So I'm a senior CS student right now. I've done projects in Haskell before, but I still am sitting here wondering why anyone would use a functional programming language for a project when there are other options available. It lends itself well to small math applications I guess, but it seems more intuitive to program in something like C, and the readability of programs made with functional languages are shitty as best.
I really cannot wrap my head around the idea that people do things like write client/server applications in haskell. These people must hate themselves.
>>
>>53579092
For mathies and hipsters
>>
Can anybody recommend a decent online note taking service for programming? I tried and used Evernote for a while but it's complete utter shit for this.
I want to insert code snippets, preferably with syntax highlighting.
Some kind of easy formatting would be great too, like Markdown or BBcode, or some custom shit, I don't care.
It would be great if it would be available for Android too, but it's not a necessity. Online is enough.

Pls help
>>
>>53579092
It is much, much easier to write a comprehensive test suite for Haskell code than C++/Java/C# code.

I understand your current view of things, though. My CS degree taught me virtually nothing about writing software in the real world.

These days, immutability and purity are a godsend to me.
>>
>>53579092
Be quiet, Will
>>
You guys are all good programmers keep up the good work programming guys!
>>
>>53579279
Bullshit.

But thx bby
>>
>>53579287
It's true a lot of you guys are better at programming than most of the programming students I seen in applied programming courses and computer science degrees. You guys are also better than most of the professors I have had for computer science. Don't give up guys!
>>
>>53579232
Try one of those online org-mode services
>>53579092
using Haskell and OCaml often lets you write code about the length of Python (or shorter!) but statically typed, for one thing. it's also a matter of functional programming being more fun for me. I find it a lot easier to express my ideas in terms of functional code and it makes it a lot easier to refactor for me in the long run, so it's much less stressful/boring than writing imperative code.
>>
fuck yeah i'm good af
>>
>>53579092
people are stupid
>>
>>53579057
Template matching smaller image in another image. Slide the smaller window over the larger, compute mean square error, find the location were it is lowest.
>>
>>53575691
You have solve a captcha to report.
>>
>>53579339
I have to use Scala at work.

I get the best success rate when I ignore my coworkers' preferences and write as close to Haskell as I can in it.

I get the worst when I have to use it like a 'better Java'.
>>
>>53579619
Just automate captcha solving
>>
>>53579696
You'll be rich if you can do that.
>>
>>53579618
That's great, I think it's a bit above my level (i've never worked with images before) but I've noted it for later.
>>
>>53579696
I don't have a botnet. But it seems to me that a distributed neural net would be ideal for it.

The best part? The users of the botnet computers could classify the training corpus
>>
>>53579708
Nothing is impossible, Anon (^:
https://youtu.be/vB0exvqclaI?t=179
>>
>>53579708
It's so easy to solve and replicate this all you have to do is implement the Lexiburg algorithm and then based off the captcha data reverse engineer it using calculus equations and finally redirect output from the servers internal information
>>
>not paying 5 dollars for a million captchas
a captcha solver would probably use more electricity
>>
I'm trying to initialize a 2d 3x3 vector with every element set to "*". Does anybody know why this keeps giving me an error?

vector< vector<char> > board(3, vector<char>(3, "*"));


Error output:

 error: invalid conversion from ‘const char*’ to ‘std::vector<char>::value_type {aka char}’ [-fpermissive]
vector< vector<char> > board(3, vector<char>(3, "*"));
>>
>>53580032
You're passing a string, not a char. You want:

vector< vector<char> > board(3, vector<char>(3, '*'));
>>
File: vomit.jpg (90 KB, 650x650) Image search: [Google]
vomit.jpg
90 KB, 650x650
>>53580032
>vector< vector<char> > board(3, vector<char>(3, "*"));
Holy fuck, what the hell is wrong with Sepplesfags
char board[3][3];
or
char board[9];
>>
Learning haskell, does anybody have a suggestion for a really light ide?

basically all I need is syntax highlighting and the ability to run the script with a single keypress
>>
File: Screenshot_20160320_105834.png (13 KB, 351x619) Image search: [Google]
Screenshot_20160320_105834.png
13 KB, 351x619
>>53575640
wrote a VM (and an assembler) to learn about computer architectures and shit
made it write the registers to stdout every time it executes an instruction

I think it kind of works
there are 17 instructions, divided into operations (which take registers for two operands and another for the result), jumps (which take two registers, and if their comparison is true, jumps to the location in the third argument - seems to be a bit broken) and memory / register shuffling ones, which are all pretty arbitrary

r8
>>
>>53580142
Vim
Emacs
Leksah
>>
>>53580065
Nice, it worked!
>>
>>53580170
>Vim
>Emacs

I don't need an ide that has a learning curve


>Leksah

looks simple, will try
>>
File: some.jpg (27 KB, 639x127) Image search: [Google]
some.jpg
27 KB, 639x127
>>53580251
>internal ide error
>exception
>SomeException

Nice exception name, bro, I totally know what went wrong from that.
>>
File: 1443317393088.jpg (601 KB, 2048x1363) Image search: [Google]
1443317393088.jpg
601 KB, 2048x1363
kikes have gone too far

https://www.youtube.com/watch?v=w3ugHP-yZXw

fuck kikes
>>
>>53580317
>Windows
Therein lies the problem.
>>
File: wired.webm (3 MB, 502x352) Image search: [Google]
wired.webm
3 MB, 502x352
Wrote a kinda video-to-ascii thing in processing (python mode). How does it look?
>>
>>53580403
no linux distro I've tried has worked on my laptop, all I get is blackscreens and errors.

so I've given up on that.
>>
>>53580317
>GHC.Exception.SomeException
haskelelfags everyone

even "java pajeets" don't suck this hard
>>
>>53580538
How bad is your laptop? Linux runs on just about anything.
>>
>>53580251

> learning Haskell
> can't be arsed to learn VIM
>>
>>53580438
The parts where it wasnt just showing blue where pretty neat.
10/10 anime taste, but you need a better test video.
>>
>>53580403
>haskell
>linux
memes upon memes
>>
>>53580403
>programming in the terminal

I've never understood, how do you go up to previous lines if you made a mistake and need to correct it?

Do you rewrite the entire program every time you realize you've made a mistake?

Is there some sort of command to do it? If so, I assume it uses line numbers, doesn't having to type out line numbers every time you want to edit a line get tiring?

Isn't this why we made mice? Why take a step back?
>>
>>53580571
I think you mean Emacs.
>>
>>53580590
because autism
>>
>>53580590
That's just a screenshot of the GHC interactive mode. I use Vim, which has support for mouse mode.

Literally just do
set mouse=a

in a ~/.vimrc to get mouse support. How new are you?
>>
>>53580571
>needing to learn a glorified text editor

>>53580567
lenovo y510p, I bought it like three years ago when I was still into gaymin. Between the nvidia graphics cards and secure boot, it's fucking impossible to get any distro to work.

I've tried everything from ubuntu to fedora to mint to arch to fucking memeto and nothing works.
>>
Threadly reminder that you should not refer to the act of programming as coding, it is improper.
>>
>>53580653
shut the fuck up
>>
File: 264[1].jpg (37 KB, 496x410) Image search: [Google]
264[1].jpg
37 KB, 496x410
>>53580653
>>
>>53577770
I already made one. Runs on IRC.
>>
Hey guys, I know nothing about programming but I'd like to learn. Anyone recommend a book for a person with 0 base knowledge about the subject?
>>
File: meme.jpg (29 KB, 743x376) Image search: [Google]
meme.jpg
29 KB, 743x376
>>53580628
>>53580571

0mg guiz n0w 1m a 1337 h4ck3r 2!!!one!
>>
>>53580727
haskellbook.com
>>
>>53580771
He said he wants to learn about programming.
>>
>>53580771
does haskell have something like idle?
>>
>>53580787
Like what?
>>
>>53580727
Learn python. Definitely the best for an introduction to programming, but it might set some bad habits for learning other languages.
>>
File: weeeeee.png (401 KB, 648x514) Image search: [Google]
weeeeee.png
401 KB, 648x514
I made a spinny thingie. Am I a hacka yet, /g/ ?
>>
>>53580787
Yes, you can run a Haskell shell called by the command ghci.
>>
Using Java to make a program which calculates the area of shapes but having some trouble at the moment.

First I had input/output for diameter, length, width, base, height, areaC, areaR, areaT all in the main and then three separate methods for calculating the area (of the three shapes) and returning the values.

Then I split the main into three separate methods, all the circleStuff, rectangleStuff and triangleStuff (handles input and output for relevant shape), which worked fine.

But now I want to split the input and output up (so I have separate methods for each of them): inputInteger, inputReal, outputAll. However, when I do this it fucks everything up because the output depends on variables initialized in the input.

Is there anyway I can pass variables between methods so I can use the values I get for the diameter, length, areaC, areaR, etc? Or how do I just make a method which outputs, "The area of the SHAPE (with DIMENSION = X) is AREAm^2, AREAcm^2, AREAmm^2." ?
>>
File: sandbox.png (16 KB, 648x514) Image search: [Google]
sandbox.png
16 KB, 648x514
>>53580820
Also I made a little sandbox.
>>
>>53580855
Reminds me of the flash game Sugar.
>>
File: shit.jpg (29 KB, 534x147) Image search: [Google]
shit.jpg
29 KB, 534x147
>>53580823
I made a mistake, I want a to equal 2, how can I go up to the previous line and change it?
>>
>>53580884
let a = 2

ghci is a sandbox REPL loop. if you want to write and run programs, write them in your favorite text editor and then compile with ghc.
>>
>>53580884
just do
let a = 1
again iirc
>>
>>53580909
got any recommendations for an extremely simple text editor that will let me run the script with a keypress?

literally all I need is syntax highlighting and that
>>
>>53580853
Declare them as public or just initialize them outside the methods...
>>
>>53580884
>>53580909
>>53580915
Just pressing the up key should access the history.

>>53580946
Notepad++ if you're too pleb for Emacs.
>>
>>53580855
>>53580866

was thinking the same thing anon
>>
>>53580807
kill yourself. python is ok for getting disinterested students through a course but it sure as hell isn't good for actually teaching programming

>>53580771
kill yourself

>>53580727
https://docs.oracle.com/javase/tutorial/
Thread replies: 255
Thread images: 48

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.