[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: 323
Thread images: 23

File: dpt_flat.png (102KB, 1000x1071px) Image search: [Google]
dpt_flat.png
102KB, 1000x1071px
Old thread: >>58049620

What are you working on /g/?
>>
first for scheme
>>
ocaml really is the best lang ever.
>>
File: karen haskell.png (818KB, 1280x719px) Image search: [Google]
karen haskell.png
818KB, 1280x719px
>>
Anyone else from the west coast here? Oregon to be more specific. Gonna start d*p***ing you know who pretty soon with a few anons from /107/. You are welcome to join in on the fun
>>
File: chess.png (109KB, 1920x751px) Image search: [Google]
chess.png
109KB, 1920x751px
>>58057800
Trying to make a 2-player chess program (no AI planned yet) in C++.
I didn't realize how many rules chess has until I started programming it.
>>
File: 1425482982393ll.jpg (38KB, 413x395px) Image search: [Google]
1425482982393ll.jpg
38KB, 413x395px
>>58058021
Jesus fucking christ
>>
File: Tanaka-kun-02-44-1280x720.jpg (102KB, 1280x720px) Image search: [Google]
Tanaka-kun-02-44-1280x720.jpg
102KB, 1280x720px
Opinions on lazy evaluation?
>>
>>58058032
50/50
>>
>>58058032
Easy to use, hard to master.
>>
I'm thinking of a simple project to dive into Django. Any ideas?
>>
>>58058241
Haskell compiler
>>
>>58058249
I don't think you know what Django is.
>>
Should I learn a little bit of Haskell? Is it fun?
All I've done at this point is C and a some assembly.
>>
>>58058254
A movie, if I'm not mistaken.
>>
>>58058273
That's Django Unchained. Django is a web backend framework in python.
>>
>>58058284
>meme is a meme meme meme in meme
Ok, sure.
>>
>>58058255
Yes and yes
>>
>>58058021
AI for chess is quite simple. You just assign values to moves (e.g. a move where you loose a pawn is less then a move, where you take one) and use an algorithm called min-max.
>>
considering writing an mpd client for fun

>>58058292
thank you for your contribution to the thread

>>58058255
functional programming is taking off lately but you might want to consider erlang over haskell for career purposes.
>>
>>58058295
This is a good resource to start with, right?
http://learnyouahaskell.com/
>>58058333
For now I'm doing it just out of interest.
>>
>>58058340
It's ok, if a bit out of date, I'd recommend wikibooks
https://en.wikibooks.org/wiki/Haskell
You could use LYAH though

post here if you need help
>>
File: 1482058065255.jpg (49KB, 803x868px) Image search: [Google]
1482058065255.jpg
49KB, 803x868px
>>58058333
>functional programming is taking off lately
lolno
>>
>>58058357
Sure, thanks mate.
>>
>>58058325
Yeah I was thinking along those aspects, but I'm focusing on making the 2-player mode work completely, and then if I want to take it further AI would be a good project. I'll look up more about Min-Max algorithms.
Once the functionality of finding the value of a move is made, stringing together multiple moves wouldn't be too hard after getting over the hurdle of predicting the player's move.
>>
Are there some nice sources to learn Qt5 with c++
>>
File: 1479326496287.jpg (36KB, 480x462px) Image search: [Google]
1479326496287.jpg
36KB, 480x462px
is there some way of hiding commits on github?
dont want potential employers to see my contributions to CoC-like porn games
>>
>>58058423
use different account?
>>
>>58058423
why not?
>>
>>58058436
but i want to show off my other open surce contributions

>>58058437
recruiters would be too busy jacking it
>>
>>58058423
>CoC-like porn games
what
>>
>>58058458
use two different accounts numbnuts
>>
File: H_E_L_L_O_W_O_R_L_D.png (22KB, 564x482px) Image search: [Google]
H_E_L_L_O_W_O_R_L_D.png
22KB, 564x482px
What design diagrams/tools do you anons use when you program something more complex than FizzBuzz?
>>
>>58058770
MS Paint
>>
>>58058325
I suggest using one of the improved versions of minimax, such as negamax or mtd-f, otherwise your bot will take forever to search at any depth where it would be a decent opponent.
>>
>>58058770
Kate.
>>
>>58058366
erlang is pretty popular with the MUH CONCURRENCY crowd these days, although honestly you'd be better off learning golang or node.js if you're looking for those jobs.
>>
lads, should I go to grad school?

Right now my GPA is tanking due to non-CS related shit classes but honestly I just want to graduate, dunno if I should risk dying for As if post grad on CS isn't worth it over just a regular degree
>>
>>58058963
>due to non-CS related shit
Let me guess, you just play games all day and never actually go to your classes?
I've known far too many people like this.
Fucking go to lectures and shit.
>>
>>58058963
just get a regular degree

i'm not sure how hard it is to get As in burgerland (seems relatively easy tho) but you probably don't need straight As especially in non-CS classes to land a job
>>
>>58058423
>CoC-like porn games
?
>>
How do I remove the action bar on an app in Android?
I've tried:
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
right before loading the activity.


And also:
        <item name="android:windowActionBar">false</item>
<item name="android:windowNoTitle">true</item>
in styles.xml.


Action Bar is still showing up.
>>
>>58059383
nevermind, just needed to use
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
>>
if you have two non-dependent reads from the same texture in a fragment shader, is it better to use the same sampler/texture unit, or is it better to use two separate texture units? like how does it work on the hardware level, would the same texture unit have to read the texture twice sequentially whereas two texture units could read the texture in parallel?
>>
>>58059383
>>58059494
not programming
>>
>>58059902
Probably it's like you say, but the performance hit would only be noticeable with many reads (like if you do a 9x9 gaussian blur or something like that). It's best to make a test case and measure fps, not guess though (of course the results will be bound to your hardware and can be different for different hardware).
>>
hi dpt.

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

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

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

Should I be generating primes on my own? Or is it just a waste of time to rewrite AKS in python for my specific learning purposes?
>>
>>58060125
I think Project Euler is much more about Math than programming.
>Should I be generating primes on my own?
Yes. It's easy as fuck.
>>
>get assignment about xml parsing (in java)
>professor throws us a bone and gives us barebones code to work with
>it's utter shit that iterates over every fucking child node directly instead of using the functions made for that exact purpose
>literally doesn't even work
What the fuck?
>>
>>58060200
>going to college
found your problem
>>
>>58060200
DOM?
>>
>>58060223
He even told us that since this was so difficult we were allowed to make the code as dirty as we wanted. Probably more to cover his ass than ours.

>>58060237
Yup.
>>
>>58060184
k
>>
>>58058021
you know there are unicode characters for chess pieces right?
>>
>>58060184
Cool. What do you recommend for programming challenges for practice?
>>
>>58060200
>xml
>java
>shitty code

Sounds like your prof was a shitty programmer in the late 90's and so he decided to become a teacher because he certainly couldn't do the work.
>>
>>58060287
i wouldn't recommend project euler because like anon said it's very focused on math but it wouldn't hurt to do the first 20 or so if you're a complete beginner to help you think in terms of algorithms and to implement some things yourself like a prime sieve
>>
>>58060265
I had it as well, but after DOM we saw SAX which isn't that much of a hassle
>>
>>58058770
A whiteboard, markers and a camera.
>>
>>58060291
Sounds likely enough.

>>58060305
It's a java class, not an XML class.
>>
>>58060300
Anything similar for more 'programmy' related stuff?
>>
>>58060338
you could look at advent of code, there's a series of challenges from 2015 and an ongoing one for this year too

i haven't done it myself so i'm not sure what the difficulty level is like
>>
Working on a script to attack bcrypt with wordlists but it seems too complex, am I right in thinking it should hash a word from the wordlist compare that hash to the target hash if they match print the plaintext word if the don't check the next word and so on
>>
So I made the below relation in prolog. It finds every unique path a knight can take on a chess board without landing on the same square twice. knightsMove(Lst, Nxt) takes a square Lst and makes Nxt any possible square, provided the squares are on the parameters of the board.

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


 knightsPath([_]).

knightsPath(Path) :- knightsPath(TempPath),
last(TempPath, Lst),
knightsMove(Lst, Nxt),
not(memberchk(Nxt, TempPath)),
add(Nxt, TempPath, Path).
>>
>>58059926
application development
>>
>>58060528
Yeah, not programming.
Putting a few Winforms together doesn't make you a programmer.
>>
Learning design patterns in JavaScript desu.

Is this what the observer pattern is?

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

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

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

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

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

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

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

return {
on: on,
emit: emit
}
}

var obj = createObject();

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

obj.kek();
>>
>>58060561
>design patterns
why
>>
Whats your internet speed, /g/? I got 30 down 3 up

I want to get some numbers for data spreading models in BasicTV and a rough network throughput.
>>
>>58060338
iirc mit posts assignments with solutions on their opencourseware thing.
>>
>>58060589
What's wrong with learning design patterns?
>>
>>58060601
like 300 kb/s down, 15 kb/s up. shitty rural internet. at my uni i get 50mb/s down.
>>
>>58060623
design patterns are bad practice
>>
>>58060623
Because design patterns are only there so you can write shit code instead of learning how to solve problems.
>>
>>58060623
Design patterns are there so you can masturbate about problems and elegant code instead of actually having to write any.
>>
>>58060601
like 16 down (actual out of like 24), 1 up
>>
>>58060623
there's nothing bad about design patterns, they can be handy sometimes. just don't try to use them everytime you decide to program something
>>
>>58060688
scratch that i measured 14 down, .87 up so like """"up to"""" 16 down, 1 up i think
>>
>>58060683
>>58060668
>>58060656

Has /dpt/ ever agreed this much before?
>>
>>58060656
>>58060668
>>58060683
this but they can help describe things when dealing with code monkeys
>>
>>58060656
>>58060668
>>58060683
Wew, didn't know /dpt/ was this retarded.

Shan't be posting here anymore.
>>
>>58060757
Good bye.
>>
>>58060757
/dpt/ is in fact retarded and i've done some of my best productive work when i've been away from /dpt/, i suggest you leave while you can and only come here for questions that you don't want to bother taking to stackoverflow, this entire day has been mostly procrastination for me all because i opened up some 4chan tabs when i had my morning coffee
>>
>>58060757
see you tomorrow.
>>
>>58060793
>i've done some of my best productive work
such as?
>>
>>58060535
You're implying that programming isn't done within android applications?
lol
>>
>>58060886
When I clicked on your post number to give you a (You), it ran some code

I sure did some fine programming right then
>>
>>58060886
setting layouts in markup languages isn't programming tho
>>
How do i make items in LINQ to show in every row, instead of right next to each other

var Nigger = from item in items
select new {item1, item2, item3}
>>
>>58060998
welfare the variable
>>
>>58061037
I knew i shouldn't have put Nigger
>>
File: file.png (24KB, 576x252px) Image search: [Google]
file.png
24KB, 576x252px
what exactly is that line of code doing there? c is a fucking mess. is that recursion?
>>
>>58058013
>d*p***ing
Is that some kind of slang sexual deviants use?
>>
>>58061138
Eat a bunch of dicks, that's C++.
>>
>>58061161
yeah whatever
>>
>>58060998
Is it even possible to do this?
>>
>>58061138
What code is this from?
>>
>>58058013
???
>>
>>58061138
Runs static method DoQuery of class TIQuery with some template arguments.
>>
>>58061138
>is that recursion?
looks like it

recursion in general is a mess so i wouldn't blame C++ too much in this case
>>
>>58061193
Whatever?
WHATEVER?
YOU EVEN DARE TO SAY WHATEVER?
You dare to feel no difference between glorious American C and some Norwegian C++?
No wonder your an idiot.
>>
What are C++ templates used for?

Do they give any performance?

Is it a better way of doing things?

can someone give a tl;dr?
>>
>>58061233
>>58061236
>>58061257

https://www.geometrictools.com/GTEngine/Include/Mathematics/GteIntrSegment3AlignedBox3.h

but it does nothing except checking some if argument. I cant see what recursion would achieve.

>>58061262
it's almost unreadable. literally autism in code form
>>
>>58061266
they're mostly useless and they tend to slow down compilation times a lot but for example in >>58061138 you can use it with any Real so if you want like floats or doubles you can use the same code
>>
>>58061257
That;s not recursion per se, since the method is calling another method (with the same name but of another class).
>>58061266
They're used for metaprogramming. They can give better performance than alternatives, yes.
>>
>>58061273
it sets result.intersect = false

result is a reference so the caller of the function can read back the result
>>
>>58061138
I think I found the solution. it goes here

https://www.geometrictools.com/GTEngine/Include/Mathematics/GteIntrLine3AlignedBox3.h
>>
>>58061333
>>58061273
is this the code you don't even bother contributing to?

like its a fucking mess and you need expert knowledge to contribute..
>>
Use C if you want performance.

Use Haskell if you want correctness.

Use Java if you want a job.
>>
What does /dpt/ think of MIPS assembly?
>>
>>58057800
Writing program that takes news articles about Trump parses them, lemmatizes, removes stop words and counts shit so i can make complex shit network to visualize this shit and do something interesting i hope.

God i hate python so much i should have started doing this in something nice
>>
File: haskelel2.jpg (745KB, 1920x1080px) Image search: [Google]
haskelel2.jpg
745KB, 1920x1080px
>>58061368
>Use Haskell if you want correctness.
>>
>>58061376
You post this every 4 threads
>>
>>58061388
>muh haskell
you post this in every thread
>>
>>58061370

Studied it for a module last year, it's pretty fun.
>>
>>58061370
Seems pretty nice, minimalist.
>>
>>58061398
No, I don't
>>
>>58061367
contribute? kek
>>
>>58061441
what's so funny?
>>
>>58061375
>God i hate python so much i should have started doing this in something nice
If you hate Python, it's probably because you don't know how to properly leverage its features.
>>
>>58061474
>if you hate Python, it's probably because
it's shit


there, fixed that post for you
>>
>>58061376
he's right though
>>
>>58061474
I started using it for libs and brevity but god damn lack of obvious types... fucking heterogenous lists man... im used to it now and i do type checks but i spent so god damn long on shit that should have been obvious
>>
>>58061474
What "features"? The GIL? The stupid scoping? The Python 2 vs Python 3 fiasco? The crippled lambdas? The terrible performance?
>>
>>58061514
What's wrong with heterogeneous lists?
>>
>>58061480
Python became popular because people enjoy developing in it. The fact that you dislike it places you in a small minority. You can choose to believe that everyone else is wrong and that you alone can see Python's flaws, or you can be open-minded to the possibility that Python's a kick-ass language and that you simply don't know how to use it.

What do you dislike about Python? And don't say dynamic typing.
>>
>>58061539
>And don't say dynamic typing

Every part of Python except for dynamic typing.

I hate that too but apparently it's not a real problem.
>>
>>58061459
that's not really a project one can contribute to, but one of the few repositories of the current standard for intersections, collision volumes and shieet.
contributing would probably mean writing academic papers.
>>
>>58061558
sorry, didn't know that
>>
>>58061554
OMG would you just shut up about dynamic typing you fucking Haskell weenie? Static typing is shit, just look at Java.

And anyway Python's getting optional/gradual typing soon anyway so your complaint has no merit. It means there's LITERALLY no need for static typing.
>>
>>58061577
I'd blow the fuck out of your bullshit right now but it'd be like beating up a child. Gotta wait for you to graduate from primary school first.
>>
>>58061577
>Static typing is shit, just look at Java.
8/8 nice meme made me reply
>>
>>58061514
>im used to it now and i do type checks but i spent so god damn long on shit that should have been obvious

You shouldn't be doing type checks in Python. Dynamic typing has its weaknesses, but one of its strengths is that functions are essentially templates by default.

>>58061515
>What "features"?
Rich standard and third party libraries, the fact that Python code is brief and readable, more so than any other language, and that it is very easy for code you write to hook with the standard library features.

I'm partial to the complaint that Python is slow, but if you need performance then Python is probably not the right choice for you unless you use Cython or Numba or something. And lambda's are just fine.
>>
>>58061554
>Every part of Python
You hate decorators? List comprehensions? The standard library?
>>
>>58061577
>And anyway Python's getting optional/gradual typing soon anyway so your complaint has no merit.
It doesn't have it today, so the complaint has perfect merit. They'll probably break backwards compatibility again, like with python 3. lel.
>>
>>58061600
I do have to do type checks though if i want to appy specific function on fucking heterogenous list, since im using other libraries i cant avoid heterogenous lists...
>>
>>58061610
Python comprehensions look retarded
Python's standard library is almost certainly retarded
I don't know what decorators are, but in a second I'm about to find out they're retarded
>>
>>58061600
>but one of its strengths is that functions are essentially templates by default.
What did he mean by this?
>>
>>58061600
>Dynamic typing has its weaknesses, but one of its strengths is that functions are essentially templates by default
So far off the mark it's hilarious, wtf is this nonsense?

>Rich standard and third party libraries
Java has that

>Python code is brief and readable
So is Scheme code and Haskell code

>very easy for code you write to hook with the standard library features
That's true of most programming languages, it doesn't make Python special
>>
>>58061515
>The GIL?
What scripting language has true multi-threading?
>The stupid scoping?
The what?
>The Python 2 vs Python 3 fiasco?
Use 3, problem solved.
>The crippled lambdas?
99% of time you don't need statements in lambdas, for the 1% use a normal function (you can put functions in functions).
>The terrible performance?
https://www.youtube.com/watch?v=7eeEf_rAJds
>>
>>58061610
>>58061632
>decorators is just higher order functions
HOLY SHIT BOY
WOW
WOW
WOW
>>
>>58061600
>one of its strengths is that functions are essentially templates by default
you almost never have a use for templates in non-trivial applications
>>
>>58061647
>What scripting language has true multi-threading?
F#
>>
>>58061647
>What scripting language has true multi-threading?
Haskell
>>
>>58061659
>>58061667
Not a scripting language.
>>
>>58061667
savage
>>
>>58061674
Yes it is.
>>
>>58061674
Yes it is.
https://en.wikipedia.org/wiki/F_Sharp_(programming_language)#Scripting
>>
>>58061626
If the libraries are using heterogeneous lists, that's a problem with the library because that's not idiomatic Python. Though I guess it isn't unfair to blame Python because it allows heterogenous containers.

Regardless, you still shouldn't do type checking. If types don't match the function will fail at runtime, and hence your unit tests will catch it anyway.

>>58061633
Let's suppose the sum function didn't exist in Python and you wanted to implement it yourself. Here's how you would do it:
def sum(container):
sum = 0
for elem in container:
sum += elem
return sum


What's nice about this function is that it automatically works for any container that implements either the __getitem__ method (ie square brackets []) or the __contains__ method can be used with sum.
>>
>>58061727
sum = foldl (+) 0

Haskell.

>statically typed
>pure
>easily optimised
>lazy
>>
>>58061657
Not true at all.
>>
>>58061727
The word you're looking for is polymorphism.
>>58061745
Python has built in sum.
>>
>>58061600
static typing does not imply nominal typing
structurally typed languages allow you to achieve exactly the same advantages while still being checked at compile time.
>>
>>58061748
normally you operate on a specific type, not just any random type
>>
What should a method that returns all strings that start with a given prefix be called?

find? match? search? query?
>>
>>58061763
>Python has built in sum.
Haskell has it in Prelude as well
>>
>>58061727
>What's nice about this function is that it automatically works for any container that implements either the __getitem__ method (ie square brackets []) or the __contains__ method can be used with sum.
The fuck has that got to do with dynamic typing? Static typing would actually be very useful here to ensure the object being passed really does have the __getitem__ or __contains__ method at compile time instead of run time.

Every time I talk to a dynamic typing proponent, it takes seconds for them to start demonstrating that they have no idea what they are talking about.
>>
>>58061796
>Every time I talk to a dynamic typing proponent, it takes seconds for them to start demonstrating that they have no idea what they are talking about.
if they knew what they were talking about they wouldn't be dynamic typing proponents :^)
>>
https://www.youtube.com/watch?v=jbER7AobYh8

>Japanese programmers spend their time mathematically/algorithmically modelling chibimorphisms and their inverses
>>
>>58061821
Just goes to show how the entire world is based on 2d
>>
>>58061821
my sides
>>
>>58061796
With static typing it takes extra scaffolding to make a function generic. C++ is an excellent example of this: all templates need to be declared in header files and recompiled once for each template instantiation. The strength of dynamic typing is that you effectively get templates without any extra work.

Incidentally, I'm no proponent dynamic typing. I prefer static typing in most cases. But dynamic typing is useful in scripting languages where brevity and development time count.
>>
>>58061869
dynamic typing was invented by people who think C++ has a real type system and not an overhyped macro system
>>
dynamic typing yields the same advantages as static, structural typing, while gaining a lot of disadvantages in return.
that being said, there is certainly a lack of structurally typed languages. the only two with decent structural typing i can think of are ocaml and go.
ocaml is functional, so it probably doesn't appeal to people that like imperative scripting languages.
go is pretty low level and explicit, so it doesn't fit the same target group as python for instance either.
>>
>>58061879
Dynamic typing predates C++.
>>
>>58061904
static typing predates programming
>>
What is the best C++ GUI framework and why?
>>
>>58061869
Your function isn't even generic you giant retard. It's a function that accepts a collection of numeric types, and nothing else.

Do you know what generic means?

in F# this would be
let sum(container : float list)
let sum = ref 0
for elem in container:
sum := !sum + elem
return !sum

except that F# doesn't support numeric types (i think), so I'm just using float here.
>>
>>58061898
ocaml is imperative too though
>>
File: wampvoipssi.png (14KB, 738x502px) Image search: [Google]
wampvoipssi.png
14KB, 738x502px
It's pretty, isn't it.
>>
>>58061966
sort of, but i doubt it appeals to the people that use scripting languages that aren't lisp.
>>
if I want to rotate something around the origin along a plane in 3d

how do I do it
>>
>>58061997
What is it?
>>
>>58062001
You can write pretty much anything you can do in python pretty damn close in ocaml.
>>
>>58061952
>Your function isn't even generic you giant retard.
Yes, it is. It doesn't place a constraint on the type of container, only on the type of elements it contains.

Your function isn't equivalent to mine because yours works exclusively on lists. I can apply my sum function to lists, tuples, sets, dictionaries, deques, numpy arrays, etc.
>>
>>58062005
Apply linear algebra.
>>
>>58062008
just a simple program that prints stuff
>>
>>58062008
It's a client for my protocol WAMPVOIP.
>>
>>58062013
-> >>58061745
>>
>>58062021

don't be a nigger
>>
>>58061940
QT.
>>
>>58062013
>Your function isn't equivalent to mine because yours works exclusively on lists.
fixed. Now it works on any kind of container.
let sum(container : float seq)
let sum = ref 0
for elem in container:
sum := !sum + elem
return !sum


> I can apply my sum function to lists, tuples, sets, dictionaries, deques, numpy arrays, etc.
Just like I can in F#, but with static typing.
>>
>>58060432
anyone? also am I right in thinking 3 bcrypt rounds are just
plaintext>bcrypt>bcrypt>bcrypt
>>
>>58062038
whoops, should be foldr, then you get short circuiting

>>58062005
What do you mean?
Do you mean use the normal to the plane as an axis of rotation?
>>
>>58062046
A set is not a sequence.
>>
>>58062013
And the Haskell version that was posted works for values of any type f a such that f has a Foldable instance and a has a Num instance.

What's more, if you try to use it with something that doesn't satisfy those requirements then your code will *fail to compile*. Not blow up at runtime like in Python (and that's what you should hope happens - it continuing on without raising an error would be even worse.)
>>
Well done people, you've set >>58062076 off
>>
>>58062076
>sets
then why does it support __item__/__contains__? Seems kinda stupid to me.
>>
>>58061821
https://www.youtube.com/watch?v=017Fa8Gs4bI
>>
>>58062056

Yes I can provide a normal to the plane.

everything I do only seems to work for 180 degrees
>>
>>58062107
Python sets don't support __getitem__, but they support __contains__.
>>
1. Be mediocre OOP or webshit programmer
2. Decide to try functional language X
3. Try to use it like the language you normally use
4. Get frustrated because it doesn't work
5. Don't put in the effort to actually learn to use X
6. Write angry blog post about how "X is useless!!!!"
7. Hope that nobody else starts using it because then you might have to actually learn it
>>
>>58062124
kore wa lolimorphism
>>
>>58062169
Does your sum not work with sets?
>>
>>58062169
Well in F# a sequence is just anything that can be iterated over. It's basically a name that maps to IEnumerable.
>>
>>58062203
Poor man's Foldable/Traversable
>>
>>58061940
>framework

Just code it yourself. It's not that hard.
>>
>>58062169
how does sum iterate over the set if it only implements __contains__? How does it get the sequence of items?
>>
>>58062211
How are those any better?
>>
>>58062211
Prelude is shit and you know it

>not enough monomorphic classes
>too much built into the language
>no constrained classes
>>
>>58062191
It does.

>>58062203
Ah I see. I don't know F# but Google search seemed to indicate that sequences and sets were incompatible, but I'll take your word for it.
>>
as far as syncing projects that aren't ready for release what do you lads do? I've got a private repo called sync
>>
>>58062252
You can convert a Set to a sequence easily. The point is a Set is not meant to be used as an enumerable list in the first place. But if you really want to do that you just do:
Set.toSeq muhList
>>
>the vast majority of programmers think that just because a program works it's good enough

people who don't rigorously prove the correctness of their programs are honestly disgusting
>>
>>58062350
Prove the correctness of your life or kill yourself.
>>
>>58062366
typical retarded programmlet reply

don't quote my posts again, programmlet
>>
>>58062350
Show us a non-trivial program you wrote and your proof for its correctness.
>>
>>58062419
I use a dsl written in common lisp to write my programs and I use a latin-english creole language to write my proofs about the programs written in said dsl

you are too much of a programmlet to comprehend either of these languages, so what's the point?
>>
>>58062350

If you use purely functional languages, you don't have to prove correctness, because the program itself IS the proof.
>>
>>58062457
>functional programming
>still buying into the "programming paradigm" meme

cute, for a programmlet
>>
>>58062524
This. How can a programming paradigms be real if your eyes aren't real?
>>
>>58057800
What's the difference between Java and Java EE? I already know Java.

How do i learn modern web development?
>>
You have a set of N random strings.

You need to find the string with the smallest Levenshtein to the query string, faster than O(N).

Possible?
>>
File: 1481981766137.jpg (203KB, 1694x715px) Image search: [Google]
1481981766137.jpg
203KB, 1694x715px
>>58062577
Does the EE stand for Enterprise Edition?
I'll be really disappointed if it doesn't.

Don't disappoint me anon
>>
>>58062599
http://julesjacobs.github.io/2015/06/17/disqus-levenshtein-simple-and-fast.html
>>
>>58062604
yes.
>>
File: 1481176268073.png (609KB, 1000x1000px) Image search: [Google]
1481176268073.png
609KB, 1000x1000px
>>58062625
>it does
>>
>>58062604
are you a trap or just a faggot? stop posting these gay images
>>
>>58062662
>said in anime thread
>on the anime board
8/8, made me reply.
>>
>>58062662
... what?
>>
Is Rust good for gamedev?

I've tried C and it's okay, very tedious though.
>>
I'm working on (yet another) imageboard:
- everything is a node, so posts can have multiple parents and show up in multiple threads
- references to non-existent nodes will create it which allow a natural tagging system
- blablabla webrtc video streaming

Thoughts?
>>
>>58062599

Considering that you have random, unsorted input, the answer is almost definitely no. The complexity of Levenshtein itself is already greater than O(n).
>>
>>58062697
Do you have any plans to show a graph of a post, all its parents, and all its children?

The linear view of a thread is sometimes frustrating.
>>
>>58062702
What the fuck are you talking about?

The complexity of Levenshtein has nothing to do with the number of strings in the list.
>>
>>58062727

Go back to rebbit
>>
>>58062742
>Go forth to rebbit
FTFY
>>
>>58062741

You have to compute Levenshtein distance on every item in the list. It's going to be O(N).
>>
>>58062742
>says the tripfag who loiters on /pol/, the closest board to reddit
>>
>>58062767

Are you having a laff? They don't allow rude hate speech like that on reddit.
>>
File: vp8.webm (865KB, 1920x1080px) Image search: [Google]
vp8.webm
865KB, 1920x1080px
>>58062032
For proof that it actually does something, look at this. Also, fuck VP8.
>>
>>58062742
shart in marters out
>>
>>58062762
Yes but

>The complexity of Levenshtein itself is already greater than O(n)

is a non-sequitur. It doesn't matter what the complexity of Levenshtein is.
>>
>>58062785
>
being edgy is for redditors, and they did up until a year or two ago, at which point mysteriously /pol/ got a wealth of newcomers
wonder where they came from
>>
File: g_58057800.png (3MB, 8255x4016px) Image search: [Google]
g_58057800.png
3MB, 8255x4016px
>>58062727
Yes but not by default. I don't want opinions to be biased by any kind of sorting.
>>
>>58062800
Yuropoors out
>>
>>58062785
reddit user here, they fucking do on certain subreddits
>>
>>58062819
>Yuropoors
why do people say this?

my country is richer than yours
>>
>>58062793
hey man are you on fedora? if so how do I get it nice and dark? also how to screen record?
>>
>>58062835
Americans don't count debt, they don't understand negative numbers
>>
Can anyone explain why this won't work?
I'm trying to install wxWidgets on Windows using MinGW32:

A:\CodeBlocks\MinGW\bin\mingw32-make.exe -f makefile.gcc MONOLITHIC=1 SHARED=1 UNICODE=1 BU
ILD=release
gcc -c -o gcc_mswudll\wxregex_regcomp.o -O2 -mthreads -DHAVE_W32API_H -DNDEBUG -I..\..\include -I..\..\lib\gcc_dll\mswu -D__WXMSW__ -D_UNICODE -MTgcc_mswudll\wxregex_regcomp.o -MFgcc_mswudll\wxregex_regcomp.o.d -MD -MP ../../src/regex/regcomp.c
gcc: error: CreateProcess: No such file or directory
mingw32-make: *** [gcc_mswudll\wxregex_regcomp.o] Error 1


I have got no fucking clue how to proceed...
building clean works, but then the actually build just fucks up.

It's for Code::Blocks, btw.
>>
>>58062801

It was a bit of a side-bar, because I wasn't sure whether he meant that levenshtein needed to be faster than O(n) or that the operation on the list of random strings needed to be faster than O(n).

Neither can be.
>>
>>58062697
>references to non-existent nodes will create it which allow a natural tagging system
i dun undestand
>>
>>58062812
>wonder where they came from

Stormfront.
>>
>>58062853
>codeblocks
>windows
>wxWidgets

:_:7
>>
>>58062876
AKA Reddit
>>
>>58062878
What's wrong with any of those things? :(
>>
>>58062853
>A:\
the what?
>>
>>58062680
>>58062688
I don't care about anime pictures, these pics are pics females only should post. we all know there's no pussy in here, except this faggot
>>
>>58062904
i just don't like windows, codeblocks

what are you even doing with that?
>>
>>58062878
>>codeblocks
It's not bad... except when I have to run the compile from the CLI, because
>>windows
sucks shit, and I want BSD when I get a new computer, but
>>wxWidgets
is something I plan to use for customization, and I'd like to get practice now.

>>58062909
I wasn't gonna waste the partition, just b/c Windows likes to save it for Floppies.
My Programs partition is on A:\ and my Media partition is on B:\
>>
>>58062870
Imagine if on 4chan you could link your post as in

>>anime
>>watamote
>>OC

It's like gelbooru/twitter tags.
>>
>>58062924
Trying to program
>>
>>58062697
looks like some gay shit anon, why are there so much fags here. >>>/y/
>>
>>58062913
are you underage or do you just have autism?
is english a second language?
>>
>>58062948
no
no
no
>>
>>58062727
WHAT.
The linear view of a thread is SO much better than any tree view I've ever used.
>>
>>58062931
You'll never be this pure
>>
>>58062842
Fedora 25, dark theme was default for me, i used simplescreenrecorder to record it.
>>
>>58062929
it's like hashtags BLEGH
>>
I'm doing this puzzle site and it can be injected with sql but it filters 'select', ';' and whitespaces.

So i just do >'seselectlect*from[users]--

But it doesn't go through, it works on my sql server but not here, why?
>>
>>58063054
No its a frogposter repellent
>>
>>58063059
How did you get to the conclusion that sql injections are possible?
>>
everything your meme language claims to do, java does it better.
>>
>>58063098
Java can't fuck up your system
>>
>>58063087
I did 'or1=1 and it showed me the whole book table.
>>
>>58063098
3/8
>>
>>58063098
No.

https://attractivechaos.github.io/plb/
>>
>>58063112
it's right up there with c and sepples. not bad for java
>>
>>58063143
What are sepples again?
>>
>>58063159
>C ++
>C plus plus
>See ples ples
>Se ples ples
>>
>>58063112
>all the effort that has gone into making Python fast and it still can't compete
>>
>>58063181
They should have put that effort into Haskell
>>
>>58063108
have you considered terminating the previous statement?
>>
>>58063191
With Haskell they might have stood a chance of success.
>>
>>58063181
PyPy is pretty fast though for some reason
>>
I have a job interview as a Java developer for car manufacturers.

Are there any car-specific platforms or frameworks I could mention? For example, BMW has the brand Connected Drive for mobile car apps.
>>
>>58063192
Yeah ';' is filtered.

Anyway heres the site if someone wants to try and do them.
http://canyouhack.us
>>
File: blind.png (676KB, 1269x721px) Image search: [Google]
blind.png
676KB, 1269x721px
>light IDE themes
>>
How is Pascal dead?
>>
>>58063453
>black "hacker" IDE themes
>>
>>58063453
>using a theme
>>
>>58063453
thank you for this image, i have saved it and it is secured on my hard drive
>>
>>58063453

Light themes a best.
>>
>>58063486
delete it right now!
>>
Hey, I am having some trouble with a program in c. The program compiles without any errors, and can run on a mac, however when I try to run it using a windows pc the program crashes. I think it might have something to do with the use of calloc. Sadly I can't post the code due to plagiarism concerns, so I hope some of you at some point have ran into any similar problems. Any help is much appreciated.
>>
>>58057912
yes I'm starting to feel this way
>>58060601
same as you sadly
>>58062013
Haskell lets you do this with type classes
>>58062689
would be wayyy too tedious, try C++ and just use modern shit
>>
File: 1481979493422.png (248KB, 576x500px) Image search: [Google]
1481979493422.png
248KB, 576x500px
>>58063509
I refuse
>>
>>58060272
They're multi-character constants,

So, more hassle to store.
>>
>>58063520
install gcc on windows and run the program with it.
>>
>>58063576
I am already using gcc on the windows pc. The compiler I am using on mac is clang.
>>
>>58063596
then run the program with flags to see if somethings missing
-Wall -pedantic -Wextra ...
>>
I am using Linux and have a program running with debug symbols that is leaking memory.

What are some programs that can help me identify the allocations?
>>
This thread and all of you are pathetic.
>>
>>58063682
I will give wall and wextra a shot, but I got no errors using pedantic.
>>
>>58063695
cool my man
>>
>>58063688
Valgrind and gdb
>>
>>58063695
So you are :^)
>>
>>58063688
*GNU/Linux

GNU debugger. You could have found out by yourself.
>>
>>58063716
Reported for offensive language.
>>
>>58063715
can Valgrind attach to a running process or will I have to restart it and wait until it leaks?

>>58063718
>implying GNU/Linux

>>58063715

>>58063718
how would I go about using gdb to find what's leaking?
is there a magic show-leaking-memory command for it?
>>
File: mamory.png (358B, 112x15px) Image search: [Google]
mamory.png
358B, 112x15px
WE'RE RUNNING OUT OF TIME THERE'S ONLY 14GB LEFT
>>
>>58062689
If you're okay with starting from scratch full Handmade Hero style.
>>
>>58063746
https://lmgtfy.com/?q=gdb+memory+leak
>>
>>58063682
Neither wall or wextra, gave any useful information.
>>
>>58063779
What program?
>>
>>58063847
htop's virt and res
>>
>>58058366
Banks worldwide are starting to use Clojure
>>
>>58058471
>>58059191
Corruption of Champions. It's a popular flash porn game with lots of submissive furries and stuff.

He doesn't want his employer to see that he works on porn games, because it doesn't look professional.
>>
>>58063746
I don't know if valgrind can attach. Since it's an emulator, probably not. Anyway, it shows leaks directly.
>>
Why would I need C? I can just learn C++ and code in C style when I need to.
>>
Embedding and reading XMP metadata in PNG, JPEG, GIF, and SVG. Interestingly (at least to me), it was easier to do this with GIF than JPEG. For those who don't know, JPEG is a giant fucky mess and can burn in a fucking fire.
>>
When will they invent the mememory?
>>
New thread:

>>58063917
>>58063917
>>58063917
>>
>>58063912
that's exactly correct
go use it now
>>
>>58063912
OK
>>
>>58060200
Are you writing a parser, or are you just parsing out XML?

In Java:
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
Document doc = builder.parse(<uri_as_string>);
XPathFactory xPathfactory = XPathFactory.newInstance();
XPath xpath = xPathfactory.newXPath();
XPathExpression expr = xpath.compile(<xpath_expression>);


This is annoying as fuck to have to type out, but you now have XPath available. Enjoy.
>>
>>58060493
Use the trace/notrace predicates where you think it's freezing, so you can single step and look where it's freezing.

Prolog has some pretty neat debugging built in that I advise you look into.
>>
>>58063821
Use -Weverything in Clang
>>
I am currentry developing chat program similar to skype where every message will be encrypted with new key (asymetrical encription). Once finished the program will be 100% open source. Are there anons that are interested in using such a program?
>>
>>58063986
Well that gave a lot of errors, I will try solving them.
>>
>>58064050
/g/ already made a program called Tox or Cox
>>
>>58063453
why do you care, they hurt my eyes so I use dark themes but if someone else prefers light themes why should I give a shit
Thread posts: 323
Thread images: 23


[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.