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

/dpt/ - Daily Programming Thread

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 320
Thread images: 21

File: d died.png (662KB, 940x590px) Image search: [Google]
d died.png
662KB, 940x590px
What are you working on, /g/?


Previous Thread: >>60310140
>>
Why aren't you using Scheme for web development?
https://phoronix.com/scan.php?page=news_item&px=GNU-Artanis-0.2
http://web-artanis.com/
>>
>>60317561
because I'm not a web dev
>>
>>60317495
what can i work on?
>>
>>60317495
Why is /prog/ not it's own image board yet?

Better yet why hasn't Hiro brought back the text boards?
>>
File: 1452808391036.jpg (19KB, 550x343px) Image search: [Google]
1452808391036.jpg
19KB, 550x343px
>>60317561
>web development
>>
>>60317686
Low demand I guess.
Gotta make more duplicates of the high traffic boards.
>>
>>60317686
http://goatfinger.ga/
https://www.freesoftwarefoundation.org/
>>
>>60317723
Trying to split them up 2ch style I guess
>>
>>60317686
>multiple threads reposting the same trivial homework questions 24/7
There's barely any reason to keep these /dpt/ around, much less an entire dedicated board
>>
>>60317752
>Implying sleep sort wasn't the greatest achievement
>>
>>60317561
Because ASP.NET exists.
>>
What do compilers usually spend most of their time doing?
>>
>>60317809
compiling
>>
>>60317787
Aspie here I miss java
>>
>>60317812
No
>>
>>60317809
Drinking and shooting shit with interpreter
>>
File: 1474363708922.jpg (108KB, 600x849px) Image search: [Google]
1474363708922.jpg
108KB, 600x849px
Since literally nobody uses the zlib format for anything is there any point in implementing adler-32?
>>
>>60317686
>the text boards
Fuck I forgot those things even existed
>>
>>60317809
depends on the language/compiler. for most languages, it should be between optimization. type checking for languages with type inference. linking can also take quite some time.
>>
>>60317809

If they're good compilers, optimizing.
>>
>>60317912
That was VIP Quality
>>
>>60318030
thank you, i'm very vip
>>
Why the fuck does python use colons when you indent anyway???
>>
>>60318060
Because that would take the world's worst language with the world's worst syntax and somehow make it even worse.
>>
>>60318060
Easier for text editors to auto-indent, maybe.
>>
>>60318060
you dont need to newline:
if True: print "Hello"
>>
>>60317495
why haven't you learned Go yet?
https://tour.golang.org
https://www.golang-book.com/
>>
I'm so glad Go programmers exist. I'm a pretty average programmer, but I look like a genius next to one of them.
>>
>>60318211
Because it's trash, obviously.
>>
>>60318211
I have, it's shit.
>>
>>60318223
I was about to rage until I read your second sentence.
>>
How do wildcards like '_' usually get handled? Replaced with a unique name at parse time?
>>
>>60318271
why not just leave it be
>>
>>60318271
depends on the language and the context
>>
>>60318295
Any language which uses it to indicate that you don't want to bind something to a name.
>>
>>60318223
>>60318226
>>60318230
cool story, bro

now, can you tell me a compiled language that
- will run as fast as C/C++,
- is as simple as C,
- doesn't have insecure by default functions
- has LOTS and LOTS of good libraries
- can run on ARM/MIPS/x86/ppc
- can run on many OSes: linux, windows, osx, android, solaris, plan9, open/free/netbsd, ...
- compiles fast and is really easy to compile
- has grown fast over a few years
- is not object-oriented
- is not retardedly complex
- ...
?
can you? protip: you can't. faggots.
>>
>>60318324
it depends on the language and the context
>>
>>60318211
>>60318223
>>60318226
>>60318230
Why do people shit on Go so much, aside from it being a meme language?

I've worked with it a fair bit and it's nothing particularly special but there's also nothing glaringly wrong with it, aside from if err != nil
>>
>>60318332
C? Scheme? Rust?
>>
>>60318332
C
>>
>>60318336
Generics, and look at how you're supposed to handle pulling in third-party dependencies.
>>
>>60318336
>meme
>>>/v/
>>
>>60318336
>and it's nothing particularly special
Exactly, it has no reason to exist.
>>
>>60318332
>can you tell me a compiled language that
Nope. Even by this alone the language you're describing can't exist.
>>
>>60318332
- produces massive binaries by default
- is garbage collected
- forced white space
- loops requires brackets even if they're one liners
>>
>>60318332

C is probably the only language matching that description, considering most languages are more complex than C.
>>
>>60318366
It's basically C with a /really/ good garbage collector, and it handles concurrency super well. That alone is a pretty good niche for it to live in.

>>60318354
import (
"fmt"
"log"
)

What's wrong with that?
Also Generics are always nice but C doesn't have them either and people jerk themselves off over that. Go isn't an OOP language anyways, and it in no way tries to be.
>>
>>60318332
with the exception of the compilation part, luajit
maybe SBCL?
>>
>>60318429
I'm not talking about that and you know it.

C doesn't have generics because it was designed in the early 70s. Go has no excuse.
>>
>>60318405

- that's what c is for
- go use java and jeet in street
- [bitches about syntax]
- [more bitching about syntax]
>>
>>60318429
> /really/ good garbage collector
not really
>>
>>60318449
What language do you suggest?
>>
>>60318347
Scheme is well supported and fast?
Rust is not complex for no reason whatsoever?

>>60318350
>I have never written more than a few lines of C code
nice try

>>60318379
https://en.wikipedia.org/wiki/Compiled_language

>>60318405
>- produces massive binaries by default
as big as any other statically linked program. that's no problem in my MIPS router, not sure why you are crying...

>- is garbage collected
>- forced white space
>- loops requires brackets even if they're one liners
wow, how terrible...
I get it, you care a lot about unimportant shit, perhaps at the cost of your productivity
>>
>>60318470
C++, Java, Rust, CL, Haskell, OCaml, ...

All of them are far superior to Go.
>>
>>60318405
>is garbage collected
http://benchmarksgame.alioth.debian.org/u64q/compare.php?lang=go&lang2=gcc
It's memory usage is comparable, and in some cases even lower, than C.

>forced white space
w h a t

>loops requires brackets even if they're one liners
That's just nitpicking.

>>60318449
>I'm not talking about that and you know it.
Are you talking about how you usually pull 3rd party libraries through github?

>Go has no excuse.
Computational expense is a pretty good excuse.

>>60318452
see the link above. It's an exceptionally good garbage collector.
>>
>>60318496
>Scheme is well supported and fast?
Yes

>https://en.wikipedia.org/wiki/Compiled_language
Every language can be compiled.
>>
>>60318429
>Generics
>POO
Are you genuinely retarded?
>>
>>60318496
>Scheme is well supported and fast?
Yes.
>>
>>60318504
>C++, Java, Rust
These languages have shitty "generics". Please avoid them.

>CL, Haskell, OCaml
These however have good ones.
>>
>>60318505
ok so im not an expert but i remember some paper written by the go guys saying they had basically solved every gc problem that people had been working on for decades

i find that highly fucking unlikely but you know i guess its possible
>>
>>60318496
>wikipedia
I hope this was a joke. Nothing you can possibly link to can disprove the fact that there can't exist a language which can only be compiled.
>>
>>60318519
Generics are most widely used in OOP designs. Proper functional designs should almost never need a generic. If you're using them in say, haskell, you probably need to take a long hard look at what you're doing
>>
>>60318505
Ok, I wasn't gonna use the debian benchmarks as arguments agains Go, but since you did
>>60318332
>- will run as fast as C/C++
>>
Go:

>Vendoring, import rewrites, and the GOPATH

>There is currently no agreed upon package manager for Go. Recently the Go team kicked up a great thread asking the community for their thoughts on a package management system. There are a few high level concepts that are helpful to understand.

>Vendoring

>At Google, the source code for a dependency is copied into the source tree, and checked into source control. This provides repeatability. There is never a question on where the source is downloaded from, because it is always available in the source tree. Copying the source from a dependency into your own source is referred to as “vendoring”.
Import rewriting

>After you copy the code into your source tree, you need to change your import path to not point at the original source, but rather to point at a path in your tree. This is called “Import rewriting”.

http://jbeckwith.com/2015/05/29/dependency-management-go/

>the source code for a dependency is copied into the source tree, and checked into source control.

>the source code for a dependency is copied into the source tree, and checked into source control.

Great fucking language, guys!
>>
>>60318505
I was talking about this: >>60318569
>>
>>60318555
Sorry, I think I misunderstood that retarded word. Does it not mean "polymorphism" or something similar? If so, there is simply no way it's exclusive to OOP since some systems have had it before OOP was even a thing.
>Proper functional designs
FP is a subset of both procedural programming and POO. So just saying "FP" isn't enough to indicate that you mean procedural FP.
>>
>>60318561
I'm not that guy, I know it's not as fast as C/C++. It comes very close in a lot of instances but it's not on average as fast. It still offers a ton of speed, however.

>>60318569
>>60318583
Fair enough, that is pretty fucktarded. Didn't know it handled it that way.
>>
>>60318513
>>60318524
>>Scheme is well supported and fast?
OK, you found a good competitor. cool! now... I'm still wondering about the support. who uses it? what arches/OSes does it support? are there

>Every language can be compiled.
can != is

>>60318569
>There is currently no agreed upon package manager for Go
>Great fucking language, guys!
but that's not part of a language...
also, I heard that patches are welcome (or, in this case, you can make your own package manager... I bet you, the elite of the elite of programmers, can solve this problem..)

>>60318561
but it *is* as fast as C/C++... some libs are slow because they call C code, and that transition is slow
>>
>>60318605
He is using javaspeech. Any sane person would understand it the same way as you did.
>>
>>60318532
>These however have good ones.
Just barely.
>>
>>60318622
>but it *is* as fast as C/C++... some libs are slow because they call C code, and that transition is slow
got any actual proof of that?
>>
File: C9Kso0SWAAAsmb0.jpg:large.jpg (133KB, 1394x884px) Image search: [Google]
C9Kso0SWAAAsmb0.jpg:large.jpg
133KB, 1394x884px
>>60318611
>>60318505
>>60318496
>>60318429
>>60318336
>>
>>60318622
>can != is
Most languages are.
And what is your point? This is a property of the implementation, not of the language.

>what arches/OSes does it support?
Every arch/os for whose an implementation exists?

>who uses it?
Many people? Not hipsters so that exincludes the majority of the go users.
>>
>>60318555
>Proper functional designs should almost never need a generic
You're talking absolute rubbish, m8

Function composition, a key part of functional programming, has a generic type:

forall a b c. (b -> c) -> (a -> b) -> (a -> c)
>>
>>60318622
>also, I heard that patches are welcome
Just like patches are welcome for TCO and HKTs in Rust.

Why not just not design a bad language and ecosystem in the first place?
>>
>>60318647
By that logic only good programmers use Haskell.
>>
>>60318689
>HKTs
A language with any amount of FP influence without dependent types in 2017 should simply be laughed at.
>>
>>60318710
Don't be ridiculous. Good programmers use Idris.
>>
>>60318634
you can do the tests/read the source code by yourself.

>>60318647
I think he's talking about the brilliance of Go...

>>60318661
>This is a property of the implementation
that's my point. all langs could be compiled, some are, some aren't.

>>60318689
>Why not just not design a bad language and ecosystem in the first place?
I dunno, ask the C++/C#/java/ruby/python/... designers
>>
>>60318713
I'm beginning to think that Rust's original stated intention of being OCaml without a GC might have been a lie.
>>
File: 1484960230319.jpg (89KB, 1280x720px) Image search: [Google]
1484960230319.jpg
89KB, 1280x720px
>>60318716
Why would a good programmer use an inconsistent language?
>>
>>60318738
Why would a good programmer use /dpt/?
>>
>>60318725
No, he's talking about Go being dumbed down so that people who can't figure out Java or C++ can use it.
>>
>>60318738
what is wrong with idris?
>>
>>60318725
w-what's wrong with ruby :(
>>
>>60318738
As a challenge.
>>
>>60318753
no, pike loves simplicity, and having a simple language do as much as, if not more than, languages that are much more complex, is brilliant.
>>
>>60318769
>dynamically typed
>>
>>60318738
F*?
>>
>>60318773
>having a simple language do as much as, if not more than, languages that are much more complex, is brilliant
Yes, but we're talking about Go, not Lisp.
>>
>>60318738
Because I don't think you can compile Agda to JavaScript yet.
>>
>>60318765
It has unsafe and impossible type signatures in the language and you don't even have to import anything to use it.
>>60318770
What challenge?
>>60318779
Anon, what?
>>60318811
>JavaScript
Exactly. Only a bad programmer would need this.
>>
>>60318725
>you can do the tests/read the source code by yourself.
so, no, you don't
>>
>>60318815
F*, what about F*?
>>
>>60318815
You need to compile to JS if you want users to be able to use your app in the browser.
>>
File: 1382963549627.png (100KB, 450x426px) Image search: [Google]
1382963549627.png
100KB, 450x426px
>>60318211
I have but haven't found a use for it.
It's cute though
>>
>>60318811
Agda is just a proof checker, not a programming lang.
>>
>>60318647
you could try watching the presentation from where that quote came from...
https://www.youtube.com/watch?v=rFejpH_tAHM
he keeps saying other langs keep copying previous langs, and in the end, become more or less the same thing, or at least make us think the same way...
>>
>>60318840
webasm
>>
>>60318834
I don't know.
>>60318840
>app
>JS
All signs of a bad programmer. Please stop.
>>60318847
Any programming language with a type checker is also a proof checker.
>>
>>60318866
You can't make normal programs with it.
>>
>>60318884
What is a "normal program"? And why can you make them with other proof checkers, but not with this one?
>>
>>60318888
https://stackoverflow.com/a/12945679
>20MB
>FFI with haskell types
>>
>>60318920
How does this answer my question?
>>
>>60318930
Easily
>>
>>60318862
>wake up sheeple! all your languages are the same! use go and free your mind!
Yeah, Rob Pike isn't worth listening to. He's still bitter that Plan 9 lost.
>>
>>60318866
>resident "expert" doesn't even know what F* is
>>
>>60318970
>F*
Pajeet language tbqh
>>
>>60318866
>>app
>>JS
>All signs of a bad programmer. Please stop.
Would you rather I wrote in pure JS instead of compiling to it from a better language? Making web apps pays the bills these days.

>>60318864
I need to eat today, I can't wait 5 years.
>>
>>60318970
I didn't say I don't know what F* is. I said I don't know the answer to "What about F*?". Learn to read, retard.

>>60319000
>Would you rather I wrote in pure JS
I would prefer if you didn't use JS in any form whatsoever.
>>
>>60319059
>I would prefer if you didn't use JS in any form whatsoever.
I need my code to run in common web browsers, so I must use JS.
>>
>>60319085
>code
Please don't insult yourself like that.
>>
File: spelled.gif (361KB, 400x270px) Image search: [Google]
spelled.gif
361KB, 400x270px
>>60319059
kek, full damage control just because you didn't know an obsecure language

I never said that you said you didn't know. I just said you didn't know :^)
>>
>>60319107
What should I call it, then?
>>
>>60319111
pajeet pls go
>>
>>60318866

>Any programming language with a type checker is also a proof checker.
But the reverse is not necessarily true. A proof checker is not necessarily a programming language.

>>60318888

>And why can you make them with other proof checkers, but not with this one?
Libraries and decent language features.
>>
File: 1484359768816.png (41KB, 140x208px) Image search: [Google]
1484359768816.png
41KB, 140x208px
>>60319111
Do you need a glass of water or something?
>>60319114
"Program" should be fine.
>>
new considered harmful
>>
>>60319129
>A proof checker is not necessarily a programming language.
Yes, a type checker isn't usually a programming language.
>>
>>60319131
It's parts of various programs, though. None of what I've written is a complete program, though, since I work in a team.
>>
>>60317495
What's the right way to implement a linked list in C (or any data structure with an unknown number of elements) without using malloc every time I want to add elements (and not using malloc at all if possible)?

I am thinking in porting something from C++ to C.
>>
>>60319371
>and not using malloc at all if possible
Dynamic data structure basically HAVE to use malloc, by definition. There are tricks you can use to lower the overall number of allocations though. C99 flexible array members is a good one.
>>
while the non-programmers on /g/ did programming larp for the past 10 days /a/ rebuilt nyaa from the ground up in go.

how does this make you feel?
>>
managed to fix the bug from before. however, full type inference for that code (1 expr) is taking upwards of an hour. I suspect more bugs are at play. also my sorting hack may cause issues depending on the order messages are sent in, I really need Haskell here in order to get this right
>>
>>60319371

>What's the right way to implement a linked list in C
>or any data structure with an unknown number of elements
Different data structures require different implementations. What works for linked lists does not necessarily work for vectors does not necessarily work for double ended queues.

>without using malloc every time I want to add elements (and not using malloc at all if possible)?
If you don't want to use malloc, you'll have to use your own memory allocator. Keep in mind the requirements of a linked list: so long as you have a pointer to a particular node, you should be able to insert a new node or delete a node in O(1) time. You can't necessarily do this with contiguous memory, but you can try to keep things as contiguous as possible from the start. You can write your own allocator to create nodes from a pool of memory (and if you plan on doing this, I would look into region based memory management, as this is particularly useful for linked data structures).

>I am thinking in porting something from C++ to C.
Aside from the higher level abstractions, this should be trivial.
>>
>>60319446
What are you writing it in?
>>
>>60319426

I spent the past 10 days working on a neural network assignment using tensorflow, planning a presentation that I gave today on decision trees, and pouring through google scholar and ebsco for various journal articles to cite in the related works section of my research paper. Good for /a/. I'm glad they managed to make something nice.
>>
implementing unsandboxing for linux kernels
>>
>>60319426
>/a/ rebuilt nyaa
No, someone from /g/ rebuilt nyaa.
/a/ and /g/ have quite a large overlap.
>>
>>60319426
>achieving anything productive in go
that's impressive
>>
File: dlang_chan.jpg (139KB, 470x545px) Image search: [Google]
dlang_chan.jpg
139KB, 470x545px
Threadly reminder that dlang-chan is not dead; she's going to have her GC tumor removed (eventually); she's not for bullying; and she's super duper cute and easy to prototype in! Say something nice about her, /dpt/!
>>
>>60319678
>she
>>
>>60319465
>You can write your own allocator to create nodes from a pool of memory (and if you plan on doing this, I would look into region based memory management, as this is particularly useful for linked data structures).
That's what I needed. I'll look up it. Thanks.
>>
>>60319502
>"researching" something
vs
>doing something concrete
wait until you are out of school..
>>
What's 4chan's tripcode algorithm?
>>
>>60319474
currently doing a proof of concept in Prolog. making progress very, very slowly though. I guess this is the cost of inventing your own algorithm :/
>>
File: Swing.png (10KB, 409x446px) Image search: [Google]
Swing.png
10KB, 409x446px
How would I create a separate button at the side of the gridlayout that runs a method in swing(Java)?

Pic related.
>>
Does anyone have an algorithm to convert any recursive function to tail recursion?
>>
>>60319846
>Java
>>>/g/wdg/
>>
>>60319857
No, recursion isn't Turing complete.
>>
every time I fix a bug I bump into five more. at this point however, most things seem to be working fine except for one crucial detail: the order in which you declare branches to send/receive determines whether your program type checks. if it is not in alphabetical order, type checking will fail.
>>
>>60319884
But some anon was claiming ocaml was able to do it the other day
>>
>>60319846
Create a separate button object and put it in the layout next to the grid.
That's literally it.
>>
>>60319908
Kek
>>
>>60319935
Recursion isn't Turing complete. It's impossible even in theory.
>>
>>60319935
>But some anon was claiming
Anon, I...
>>
>>60319698

Mate... I'm pursuing a PhD after this. And my research still had me writing a thousand lines of C for a decoy DNP3 device. Now I'm just writing the paper.
>>
>>60319993
Where do you live? Do you even sleep? You always seem to be spending your time shitposting on /dpt/ threads
>>
>>60319993
>I'm pursuing a PhD after this.
cool, but you still will end up writing web backends anyway.
so, again, wait until you are out of school.
>>
in java with regex how do you select the first word surrounded by special characters?
for example i have
(text) ignore this

and i want to select text

i can select the first word and delete the () but i want to do it all in a single expression
>>
>>60320063
"(\(.*\))"
>>
>>60319857

Without some sort of explicit stack data structure, it impossible to transform recursive backtracking into tail recursion.

>>60319884
>>60319961

I don't think turing completeness has anything to do with it. It's a matter of transforming one abstract syntax tree into another. The problem is that non-tail recursion relies upon a call stack. If your compiler is allowed to use a stack of some sort, non-tail recursion can be converted into tail-recursion or a combination of jumps.

>>60320006

Washington state
Yes, around 6 hours a day
I drop in and out in between working

>>60320015

You don't need to censor the word "cringed"

>>60320023

I intend to become a professor, precisely so I have freedom over my research. I won't be writing web backends with a PhD.
>>
>>60320083
wait, fuck, sorry, that includes the ()
>>
>>60320063
\((\w+)\)

Or if you just want to grab everything no matter what inside the parenthesis
\((.*?)\)
>>
https://www.youtube.com/watch?v=uNjxe8ShM-8
oh shit. is discussion of powerpoint in /dpt/ allowed now?
>>
>>60317495
Help me out, /dpt/. I need to write a program in C/C++ that can navigate a FAT12 image file on Linix. My shitty professor taught us literally nothing about this so I've had to research it myself because it's not in the textbook either. All of my research is basically just people saying "utilize this Windows system call and it handles it for you!" which obviously isn't helpful.
I've figured out enough to use
[code[fd = open(path, O_RDONLY)
read(fd, buf, nbytes) [/code]
But I'm kind of stuck there, because gcc throws out errors when I try doing read(fd, buf, nbytes, offset) despite that being one of the listed functions in man 3.
Even if that worked, though, I'm not really sure where I would go after that. Can anyone help me out?
>>
>>60320063
Holy fuck I hate Java regex
Thanks for ruining my night you fuck
>>
hash-based linked lists?
>>
hello g/ what can i do to this code so it multiplies the numbers in printf

i can't find any source about multiplying there is only summing and taking average.
>>
>>60320149
You got to be shitting me
>>
File: asfafafas.png (38KB, 695x656px) Image search: [Google]
asfafafas.png
38KB, 695x656px
>>60320149
here is the code
>>
>>60320145
isn't that how some hashmap implementations do with collisions?
>>
@60320097


Nice


Post.
>>
>>60320161
No one is doing your high school homework senpai
>>
>>60320097
Hey, are you studying and working at the same time? What do you for a living?
>>
nth for learning scala
>>
>>60320180
What do you do*
>>
>>60320132
>
fd = open(path, O_RDONLY)
>read(fd, buf, nbytes)

What it was supposed to be. I guess proper code tags aren't really necessary here, though.
>>
>>60320109
thank you that first one works
>>
>>60319945
Do you have sample code or know a place that can guide me senpai?
>>
>>60320179
>senpai
+18 please.
>>
>>60320245
https://docs.oracle.com/javase/tutorial/uiswing/layout/using.html

Stick everything inside a container. This is literally CS101 level stuff so just fuck with it until you figure it out.
>>
>>60320269
There's a word filter. He was trying to talk like a nigger, not a weeb.
>>
New to programming, where is the best resource i cAn go to learn web development?already have visual studio and other tools installed just need a starting point.
>>
>>60320269
Hownew.ru

baka desu senpai
>>
>>60320161
auto mul(auto... n) { return (... * n); }
>>
>>60320180

My work consists of my schoolwork. I am receiving a grant for my research.
>>
>>60320293
>Web development
Goes in /wdg/ not /dpt/
>>
>>60317495
Writting my own implementation of BWT.
>>
>>60320312
Oh, that's nice. How old are you, btw?
>>
>>60320097
> Implying being a professor is the only way to do research
>>
Should I learn Dart?
>>
>>60317561
i'm going to be the web master for my uni's ACM chapter this coming year, which involves building a site since the last one's fucked. should i use this?
>>
>>60320352
25

>>60320354
It's not the only way to do research. But it does give me more independence.
>>
?- G = [ get_time : mono(unit -> time)
, unit : mono(unit)
, diff_time : mono(time -> time -> time)
, string_of_time : mono(time -> string)
, print : mono(string -> unit)
],
Prog =
let(client, lam(s,
let(time, app(var(get_time), var(unit)),
sendMsg(var(s), ping, var(unit), [
recvMsg(var(s), pong, t, [
let(ping, app(app(var(diff_time), var(t)), var(time)),
app(var(print), app(var(string_of_time), var(ping))))])]))),
var(client)),
type(G, Prog, T).

why won't my damn query work :^(
>>
>>60318332
Nim
>>
>>60320411
FUCK YES BOYS IT'S WORKING
PROOF OF CONCEPT COMPLETE!
MY TYPE SYSTEM MAKES SOME SORT OF SENSE!
>>
>>60320686
>MY TYPE SYSTEM MAKES SOME SORT OF SENSE!
Not without a proof of everything in your Prolog file being decidable.
>>
>>60320161
fuck you guys all you have to do was telling me top=1 change it to 1 all you had to do was that i'm trying to figure out this for hours
>>
>>60320142
this. what the fsck is this cr*p?
>>
>>60320797
wow, looks like I just discovered some retarded bug in cloudflare or something... lemme see:


System.out.println(res.length);
for(String s: res) {
System.out.println(s);
}

this won't work, and I still don't know wtf is wrong here...
>>
>>60320789
Reddit spacing is a 2016 meme that needs to die off.

Of course you would recognize something as reddit spacing.

You are from there.

Does this trigger you?

I hope it does. Smh desu senpai
>>
>>60320821
String[] res = "(test) asd as ".split("\\(([^\\)]*)\\)");
>>
>>60320370

Highly debatable. Working at Google Labs/MSR gives a large amount of independence with industry level pay which is always dope
>>
>>60320821
the bug should happen when I post this:
U3RyaW5nW10gcmVzID0gIih0ZXN0KSBhc2QgYXMgIi5zcGxpdCgiXCgoW15cKV0qKVwpIik7IFN5c3RlbS5vdXQucHJpbnRsbihyZXMubGVuZ3RoKTsKZm9yKFN0cmluZyBzOiByZXMpIHsKICBTeXN0ZW0ub3V0LnByaW50bG4ocyk7Cn0K

(base64 decode the encoded shit)
for some reason, cloudflare returns 403... or was there a problem with cloudflare in general?
>>
>>60320898
String[] res = "(test) asd as ".split("\\(([^\\)]*)\\)");
System
>>
File: 1492901915278.jpg (70KB, 587x581px) Image search: [Google]
1492901915278.jpg
70KB, 587x581px
I'm making an HTML parser in modern C. Pretty excited about it.
>>
>>60320898
String[] res = "(test) asd as ".split
System.out.println(res.length);
for(String s: res) {
System.out.println(s);
}
>>
>>60320941
I'm sorry
>>
>>60320898
decode this... can anyone post it?
KCkuYXNkKCJcKChbXlwpXSopXCkiKTsKKAo=
>>
>>60320712
any GHC extension that extends the type system is undecidable
im not striving for correctness just yet, this is currently proof of concept
anyways, i've just realized an issue: the app() rule from Hindley-Milner must be extended to account for "subtypes" (not really subtypes, but rather "interchangeable" types(?)).
>>
File: 1494431665715.jpg (241KB, 1069x1196px) Image search: [Google]
1494431665715.jpg
241KB, 1069x1196px
I'm at a point in my career where I could go back to school for my MSc and focus in one of the emergent fields of computer science. Is it worth doing an MSc with concentration in computer vision?

>got my BSc in 2014, 3.61GPA. Major compsci, minor chemistry
>my biggest interest in my degree wasn't computer vision but a related field: computer graphics
>work at Apotex (pharma company) as molecular modeler, also maintenance of legacy software (mostly Ada although I do a lot of C++ too)
>make $54,000/year, this increases about $2,000/year

My university has offered to pay me $17,000/year + free tuition + at least another $3,000-4,000 in grants (which go to me in the form of cash, I don't know the figure yet). I cannot do it alongside work.

I got my current job as a fluke as they seldom hire at this low of a GPA. I had a great portfolio and a friend (with a 4.0GPA who graduated before me) got me a foot in the door. This can't be offered a second time.

tl;dr: do I quit a pretty good paying and easy job to go for my MSc? Computer vision interests me now: in my spare time I've been working on pattern/feature recognition of signatures without neural networks. This could potentially turn into my thesis.
>>
>>60321006
a"\\()"
(
>>
>>60320893

Yes, I am aware there is more independence available in the research arms of larger companies, and I will not discount them as possible career paths. I would note, however, that the kinds of things that interest me for possible research topics are not necessarily the kinds of topics that would be worth money, hence why I am looking more towards academia in general than the industry.
>>
>>60321006
a"\\(\)"
\


>>60321051
there is a lot of research in infosec... just saying :)
>>
>>60321063
().asd("\(([^\)]*)\)");
(
>>
>>60321037
Depends. Do you need the money? Do you like your job?
>>
Alright guys, I need some help. I'm making a program to simulate dice rolling for a dice pool for World of Darkness/Vampire the Masquerade cause Anydice doesn't do this well.
So I'm going through and calculating every possible combination of dice for the dicepool size and I need to make this program work with varying sizes of dicepool. The algorithm works by using a series of nested For loops and the counters for said For loops.

Problem is I don't know how to make a dynamic number of For Loops and access the counter variable for data processing.
Any idea how to do this?
>>
>>60321238
Language?
>>
File: 1486932499206.jpg (33KB, 460x423px) Image search: [Google]
1486932499206.jpg
33KB, 460x423px
Hey guys, I'm looking to get into decision trees and expert systems. I'm lurking into the gentoomen torrent library and just found a book (Data Analysis and Decision Making 4th Edition by Albright, Winston and Zappe), but I like to have at least five books about the topics I learn about. Do you have any recommendation, decision trees are a part of data structures, I'm not sure about expert systems (Software engineering?).

Thanks in advance.
>>
>>60321254
Namely C# is the final point, but I'm doing the algorithm in C in Matlab currently.
>>
>>60321002
Why, shitposter-kun? Modern C is fun, fun, fun! I've also learned the glory of error handling with GOTO statements that will clean up functions.
>>
>>60321266
Why not just make the entire thing in C#?
You can even use POO in this case for dice and then dicepool
>>
>>60317561
Do I take this to mean that Scheme is the de-facto LISP?
>>
>>60318332
>- will run as fast as C/C++,
Not Go
>>
>>60320132
Been sitting here for two hours now, no closer than when I started. I realized that I'm retarded and that pread is what I wanted, not read. It doesn't help, though. I have this entire fat12 image file sitting in a massive char array, but I still have no goddamn clue where to go.
>>
>Internet goes down
>Go programs no longer compile
Always online compiler is truly the future.
>>
>>60321284
So fun story. I got an internship as a nuclear engineer at Westinghouse, you know the company that makes nuclear reactors. Anyway, I got assigned to code shit in FORTRAN, in Linux (never had used Linux at this point), in Aramaic and only one of those three were a joke.

Anyways, I was using an ancient ass version of Linux which lacked a working file exploring, was coding in FORTRAN with no IDE; I was using a text editor, and then sending it off to some compiler which would take about 30 minutes to compile the code and spit out some data. I was remote patched into this server that was doing all of this too.
Anyways, you might be wondering why this shit matters, well the Nuclear Regulatory Commission has shit where you need to test your code and if you change the operating system you code it on, you have to resubmit your entire system for testing again instead of the new code. So the code was fucking ancient shit from the 70's.

So one day I got bored and decided to search through some files I was working on, and I open one of them and travel down about 30 lines and see a Go To statement and I thought it was a joke. But it was never the less real and there in all caps like FORTRAN requires for some reason. So I hit the search function and search for Go To statements.

678 Go To statements.
Six
Hundred
Seventy-Eight
For the software in a brand new reactor design. I sat there in fucking awe as my mind went back to my programming professors and the shit they told me about using Go To lines and how they'd hunt me down to castrate me if I did ever use it.

Thankfully Westinghouse is going bankrupt.
>>
>get a phd in some cs field
>become a professor at a university
why do they do it?
>>
>>60321284
C is not designed for this sort of thing
>>
>>60321284
you don't need to use goto statements to clean up functions, and they're bad form. stop it.
>>
>>60321421
???
>>
>>60321395
This problem has been solved in the Java ecosystem for over a decade. It's called maven.
>>
>>60321323
>Why not just make the entire thing in C#?
Matlab is just easier to see the data for me and I can do a lot of cool things graphically for it. The goal is to make a C# UWP app so I can give it to my friends to use.
>You can even use POO in this case for dice and then dicepool
If by POO, you mean OOP then I have no idea how that would work.
If you mean something else then I am at a loss as to what you mean.

Please enlighten me friend.
>>
>>60321433
Sure, if you don't mind endless nested if-statements.

Get a grip. Use goto.
>>
>>60321257

I had to do a talk about decision trees today. I used this book for most of my research:

http://cns-classes.bu.edu/cn550/Readings/duda-etal-00.pdf

Dunno about expert systems.
>>
>>60321448
Name even a single situation that you would use goto that couldn't be done more easily without it.
>>
Im trying to make an arraylist of arraylists. But i dont know how many arraylists are going to be in my outter arraylist. There has to be an easier way right?
>>
>>60321433
I don't know: Modern C makes a good case for them, and it flows better than the IF statements I had before.
>>
>>60321459
Error handling and cleanup.

Using if-statements is not easier than using gotos.
>>
>>60321443
Make a dice object that takes has X amount of sides.
Make a dice pool object that takes Y amount of dices.
>>
>>60321467
He's either trolling or an idiot. Ignore him.
>>
>>60321476
>Object
How to detect a shit language with a shit type system
>>
>>60321433

>you don't need to use goto
You don't need a lot of shit in C. Doesn't mean it's not a useful abstraction

>they're bad form
Where used in certain cases, gotos are not considered bad form. I used to be like you, thinking gotos are universally bad. Then I took an operating systems class where I had to use some guy's toy language to write a kernel that ran in an emulator. The language did not support goto, nor did it have RAII. I realized very quickly when I was writing the same modified cleanup code three times in my functions when error handling, that the one thing that would make all of this a lot cleaner would be a goto. Or RAII with early returns, but C doesn't have RAII, so a goto works in a pinch.
>>
>>60321494
I don't like POO as well but I don't see why you can't use POO to make a simple app that does dice rolls.
>>
>>60321476
Failing to see how that would iterate through and get all the possible combinations with that method.
>>
>>60321450

thanks bro
>>
>>60321513
Each dice is it own object and does it own thing. Dice pool is where you get all the results and do whatever you need to do with the results. Is that not your end goal?
>>
>>60321498
>I realized very quickly when I was writing the same modified cleanup code three times in my functions when error handling, that the one thing that would make all of this a lot cleaner would be a goto.
This. Glad you escaped the brainwashing.
>>
>>60321501
A decent you're system is all you need for that. No oop.
>>
>>60321549
He wants to use C# and make a windows UWP.
>>
>>60321498
Can someone make C with smart pointers, a proper module system, and RAII, please?
>>
File: 1485473684854.png (408KB, 824x792px) Image search: [Google]
1485473684854.png
408KB, 824x792px
>Submitted 1600 SLOC pull request to open source project
>It got accepted
It's such a satisfying feeling.
>>
>>60321467
"Although we are not dogmatic about the matter, it does seem that goto statements should be used rarely, if at all." - The C Programming Language
>>
>>60321581
No. C doesn't need that garbage.
>>
>>60321595
Goto statements can be useful in some situations, i.e. it becomes really trivial to simulate a turing machine.
>>
>>60321595
Catch up with the times, grandpa; this is Modern C. Also taking such things as an absolute is a stupid idea.

>>60321600
Why?
>>
>>60321544
>>60321544
Kinda but each die needs to output a result with the rest of the dice to get a combination.

Here's my shitty matlab code for a 3 dicepool system. Gives 10^3 combinations.

https://pastebin.com/PgS1rdC2
>>
What level of mathematics do they usually require up to in a computer science education?
>>
>>60321637
>matlab
>code
pick one
>>
Someone mentioned dice?

def roll ndice, sides
ndice.times.reduce(0) { |sum, _| sum + rand(1..sides) }
end


>>60321548

There is some wisdom in not using too many gotos in one's programs, but it does make sense in the right areas, namely in error handling and exiting out of a nested loop. I have not found any merit, however, in arguments suggesting that continue, break, or an early return could in any way be bad. I will use those keywords as often as they seem reasonable.
>>
>>60321642
only had to go up to calc2
>>
>>60321637
This is horrible.
Stop
>>
>>60321642
postgrad

basically if you've done cambridge part iii (or an equivalent) you have a chance, otherwise not

https://www.maths.cam.ac.uk/sites/www.maths.cam.ac.uk/files/partiii_guide2016.pdf
>>
File: 1439648511159.jpg (116KB, 469x469px) Image search: [Google]
1439648511159.jpg
116KB, 469x469px
>>60321591
SUGOI
>>
>>60321581

So... C++ when it gets modules, and Rust? Also, if you have RAII, you have smart pointers.

>>60321642

Linear algebra, differential and integral calculus, and probability theory. The rest of the mathematics you'll be dealing with will be considered part of the computer science program. You should know some basics of proof writing.
>>
>>60321646
>I have not found any merit, however, in arguments suggesting that continue, break, or an early return could in any way be bad
Yes, that is an especially retarded sentiment. It leads to stupid, heavily nested code.
>>
>>60321646
Not using Monte Carlo to do it. Takes too long to get accurate numbers for high dicepools.

Using nested loops to get each combination.
>>
>>60321687
>Also, if you have RAII, you have smart pointers.
Are you sure about that? RAII was being preached for C++ before C++11 and without using boost.
>>
What's the test where only one item may be true.
>>
>>60321720
XOR
>>
>>60321720
xor

pajeet
>>
>>60321720
You when you take the gay test
>>
>>60321642
i had to take:
>calc 1, 2, 3
>ordinary diff eq
>discrete math
>combinatorics
>statistics
>real analysis
>intro topology
>>
>>60321742
>can't even into discrete math
I'm pathetic
>>
>>60321715

Smart pointers were a part of boost before C++11. If you have RAII, you can implement smart pointers trivially. It's just a matter of making it a part of the standard library.
>>
File: 1390404444101.gif (1MB, 480x480px) Image search: [Google]
1390404444101.gif
1MB, 480x480px
>>60321676
>Yuno is my github avatar
D-do you know.
>>
>>60321807
>Smart pointers were a part of boost before C++11
I know, which is why I said "without using boost."
Regardless, your previous statement
>Also, if you have RAII, you have smart pointers.
is wrong then. C++ didn't implement smart pointers, triviality of the implementation aside, despite supporting RAII. Thus your implication is false.
>>
>>60320132
P-please respond. Someone.
>>
>Convert the binary-coded octal number 110 010 101 BCO to decimal.
i don't see how this is any different than converting just plain binary to decimal.. can someone explain? read the text and i can't see what's special about bco vs just binary
>>
>>60321827
Because Yuno is the eternal best girl, and I assumed you were an anon of good taste considering your extensive pull request was approved.
>>
>>60321886
The intention of my original statement was this: asking for a language with RAII and smart pointers is rather redundant. Those that have RAII tend to have smart pointers, as RAII is the only thing that is needed to implement them... at least in the current year of 2017.

>>60321934
Start from here:

http://wiki.osdev.org/FAT
>>
>>60321959
You're right. It's literally exactly the same thing.
In fact, if I were going to convert from octal or hexadecimal to decimal by hand, I would probably go through binary first, because it's easier.
>>
>>60321978
>The intention of my original statement was this: asking for a language with RAII and smart pointers is rather redundant. Those that have RAII tend to have smart pointers, as RAII is the only thing that is needed to implement them... at least in the current year of 2017.
Ah, well thank you for the clarification. I felt the need to explicitly ask for RAII and smart pointers because, again, C++ had those two separated for a long time. I didn't want to suggest I wanted that same situation for a hypothetical new language or hypothetical new C standard.
>>
>>60321959
>binary-coded octal
I think whoever wrote that might just be an idiot. That'd be like saying "this hexadecimal-coded decimal number" then giving you a hexadecimal number.
It's just a number in binary.
>>
>>60317495
the same thing i always do, i try to finish the tutorial on free code camp....
>>
Hello /dpt/

I have no coding experience and am, in general, not a /g/entleman

how hard would it be to make a code that does the following:

1. prints an image, zoomed out, resolution 4400x2000 (width x height) (0,0 is bottom left, like in the cartesian coordinate system, in my mind but this is not important whatsoever)

2. defines irregular regions on said image, some overlapping

3. if mouse is inside the bounds of a defined region, a textbox (or just text) is printed into a defined region

?

i feel like if i had code that displayed the image, defined one region, and displayed one textbox i could copy-and-paste the rest through but, again, i have no coding experience and it's very likely i'm heavily underestimating the amount of work required to do this

sorry if this thread is inundated with these types of requests

thank you for your time
>>
>>60322093
>3. if mouse is inside the bounds of a defined region, a textbox (or just text) is printed into a defined region

the first defined region is the type mentioned in part 2, while the second is just another location where text is printed to
>>
>>60321988
that's what i thought, thanks lad xx
>>60322018
fuck OFF
>>
>>60322015

Ah. Well I suppose you could also have RAII without a vector class just the same, but that would be silly, no? I figure if you were to make a new programming language in 2017 that had RAII, it would logically also have smart pointers, vectors, smart file handles, and other types typically associated with RAII.
>>
>>60322108
>agrees with one anon
>aggressively shits on another who is saying the same thing
I will never understand newfags.
>>
>>60322093
You need to figure what language you are going to use, how to read the image file, what method to define irregular regions. Could be simple to a regular programmer but someone with no experience, it will take a month or 2. Depending on language used and available tools even longer.
>>
>>60322186
it's a >>>/int/brit/ gimmick (meme)

the poster is actually a yank though
>>
>>60321395
>>60321437
same shit happens in java, C, C#, ...
you have to get your libraries from somewhere. and the Go compiler won't download them for you... you still have to get them by hand

just keep repeating memes, you "elite" programmers who can't bother learning a programming language that would take them a day... elite for sure
>>
>>60321238
>Problem is I don't know how to make a dynamic number of For Loops and access the counter variable for data processing.
Any idea how to do this?
for(int i=0; i < dynamic_number_of_loops; i++){
for(int j=0; j < number_of_iters; j++){
do_stuff(i,j,data[i][j])
int iters_completed=i*number_of_iteratons+j+1;
}
}
>>
Any of you guys use Clojure?

I'm currently a C# developer brought on to help a clojure team work on shit they don't want to work on (I.E. projects not done in clojure)

From what I learned about the language, it seems pretty fucking baller.
Not heard of or seen anyone use it outside of this team though.
>>
File: gyzurnn52qwy[1].png (504KB, 989x707px) Image search: [Google]
gyzurnn52qwy[1].png
504KB, 989x707px
>>60322247
>>
>>60322252
I'm impressed by your anti-intellectualism.
>>
>>60322315
nor sure if irony... in any case: quite the contrary, you don't see any intellectualism here, or in 4chan in general
>>
>>60322247
>it's an /int/ meme
People browse /int/? I knew on an intellectual level that some people did because of how large it is, but I had never seen them "in the wild," as it were.
>>
>>60322252
https://github.com/ksimka/go-is-not-good
>>
the amount of work ahead of me is discouraging. maybe i should quit while im ahead.
>>
>>60322252
>same shit happens in C
Is gcc even capable of pulling libraries from the internet?
>>
>>60322288
int iters_completed=i*number_of_iters+j+1
fixed
>>
File: test (6).jpg (212KB, 645x960px) Image search: [Google]
test (6).jpg
212KB, 645x960px
>>60321642
Literally nothing.
>>
>>60322288
Nice idea but I don't think that work since the data needs to be in the form of [i1,i2,i3,i4...,i#]
>>
>>60322327
/int/ is /pol/-lite where everyone pretends not to be racist by sticking to their own country thread. It is the /vg/ to /v/
>>
>>60322327
it's the 5th biggest board I believe. Most of us stick to generals, though. The biggest general is /brit/ followed by /cum/ (canada united states mexico) and then the euro generals follow after that.
>>
I have rsyslog pushing to a redis queue and i need a way to have that 'stream' back to the browser.

How can I do this?
>>
>>60321742
>only know calculus 2 and statistics

G-guess I'll have to hit the books
>>
>>60321642
My uni is the best in Australia (University of Melbourne fuck off ANU cucks) but I only had to take two maths courses during undergrad to get into my masters degree (M.E Software)

Calc 1
Linear Algebra

I am fucking horseshit when it comes to maths. Absolutely FUCKING horrible. I DID have to learn multi-variable calculus myself and if i wanted to take hardcore CS subjects I would have needed to take Eng. Maths (Vector Calc, etc..)
>>
>>60322352
apt-get install lib... or apt-get build-dep, etc
and if you say this isn't the same... well, this is not how Go, the language or the tool, do things...

>>60322348
>Seems like complaining about go's flaws is becoming a trend. Any newbie must have a chance to read all the go-is-bad arguments before they go too far. So here it is.
/dpt/ quality
also, as usual... patches are welcome. for example, there were some patches that improved the GC, the way channels worked, etc., etc., and the Go devs were happy to merge them :^)
>>
>>60322495
>...
>...
>...
>etc., etc.,
Where the fuck do these people come from?
>>
>>60322522
Reddit.
>>
is node.js a meme?

I've been using it for nearly 2 years for small projects and love it. I've heard awful stories about using it in production though.
>>
File: rust-utf8.png (276KB, 485x723px) Image search: [Google]
rust-utf8.png
276KB, 485x723px
>>
>>60322584
>meme
>>>/v/
>>
>>60322327
I went there to study Australians.
>>
>>60322620
You're fucking retarded.
>>
File: Ulam_1.png (3KB, 400x400px) Image search: [Google]
Ulam_1.png
3KB, 400x400px
Use repeating patterns to determine the nth prime number given any integer n between 1 and positive infinity
>>
>>60322730
You mad?
>>
>>60322857
Why would that make me mad? I'm just stating a very obvious fact.
>>
>>60322857
Yeah because you're a fucking idiot

I'm not even him
>>
>>60322871
You seem mad

>>60322912
I'm not either, weird
>>
New thread:

>>60323024
>>60323024
>>60323024
>>
Can you guys give me an honest critique of my web design?

https://twoxy.gpunk.net/ (actually posting tweets is disabled, soz. We use this service for IRC)

I'm overall not really happy with how it looks right now.
>>
>>60323065
>I'm overall not really happy with how it looks right now.
same
>>
>>60321284
>C
>Modern
Is this the latest meme?
>>
>>60323882
It was modern sometime around MASH debuted
Thread posts: 320
Thread images: 21


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

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
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.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.