[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: 326
Thread images: 39

File: change.webm (3MB, 1280x720px) Image search: [Google]
change.webm
3MB, 1280x720px
old thread: >>56003443

This is a japanese programmer.
Also, what are you working on, /g/?
>>
File: happy family.png (4MB, 3900x2600px) Image search: [Google]
happy family.png
4MB, 3900x2600px
Implementing lambda calculus

http://www.strawpoll.me/10939705
>>
File: 1468397365465.jpg (119KB, 839x835px) Image search: [Google]
1468397365465.jpg
119KB, 839x835px
>>56007502
>pedoNEET pandering is still allowed
>>
>>56007520
she's an adult
>>
File: 1467554456827.png (544KB, 952x677px) Image search: [Google]
1467554456827.png
544KB, 952x677px
>>56007525
Right, of course.
>>
File: 1449383569255.jpg (67KB, 680x632px) Image search: [Google]
1449383569255.jpg
67KB, 680x632px
>>56007502
>be grad student
>thesis supervisor writes in Fortran
>mfw reading one of his code snippets
>>
>>56007520
>>56007540
Your images betray whatever point you were trying to make, you loli-loving autist.
>>
File: 1470735920142.jpg (70KB, 1280x720px) Image search: [Google]
1470735920142.jpg
70KB, 1280x720px
>>56007546
>>
>>56007546
What if his point was that he was a loli loving autist?
>>
File: 1467810289099.png (20KB, 1292x789px) Image search: [Google]
1467810289099.png
20KB, 1292x789px
>This is a japanese programmer.
She's a 3D artist and probably doesn't even know what a fragment shader is.


Why is Go's math/rand so bad at being random?
>>
She's not a programmer REEEEEE
She's a character designer.
>>
>>56007559
Now do a 3D plot of every three numbers.
>>
>>56007559
Explain.
>>
>>56007502
I know not how to program nor do I know where I am but you should use this next time.
>>
File: required reading for (You).png (381KB, 528x528px) Image search: [Google]
required reading for (You).png
381KB, 528x528px
>>56007591
>>
>>56007591
But then he won't be able to draw thirsty virgins into the thread.
>>
>>56007559

>Why is Go's math/rand so bad at being random?
https://github.com/abustany/go/blob/master/src/pkg/math/rand/rand.go#L53

Looks about as primitive as C's rand... except it's got mutexes in there, so it's thread safe. You're going to want to use a random library that's better than your standard library if you can get it.
>>
File: le no smh faic.jpg (37KB, 407x405px) Image search: [Google]
le no smh faic.jpg
37KB, 407x405px
>>56007635
>go refers to exceptions as "panic"
>>
>>56007635
There's a crypto/rand lib but it's not as convenient to use.

>>56007590
I increment the value of a random index by one a million times, repeat a few times and then then display which indexes were incremented the most (where there's an x).

>>56007582
I need to read the GNUplot documentation.
>>
>>56007502
How is this related to programming? It's a child getting changed.
Wtf, are we in /g/, or /b/?
>>
>>56007502
top CG
>>
>>56007731

Welcome to DPT. The OP image is almost never related to programming. If it's not an anime girl, it's an anime boy that looks like a girl.
>>
>>56007731
Retard.
>>
>>56007596
Any guides on how to gimp sicp onto book covers?
>>
In software development, test automation is the use of special software (separate from the software being tested) to control the execution of tests and the comparison of actual outcomes to predicted outcomes. Test automation can automate previous repetitive but necessary testing in a formalized testing process already in place, or add additional testing that would be difficult to perform manually. In other words, if an application has a robust automated test suite it is no longer necessary to actually run the application and test each new feature by clicking on links and buttons, creating or updating information, or uploading or manipulating assets.

Some software testing tasks, such as extensive low-level interface regression testing, can be laborious and time consuming to do manually. In addition, a manual approach might not always be effective in finding certain classes of defects. Test automation offers a possibility to perform these types of testing effectively. Once tests have been automated, they can be run quickly and repeatedly. Many times, this can be a cost effective method for regression testing of software products that have a long maintenance life. Even minor patches over the lifetime of the application can cause features to break which were working at an earlier point in time.

YUno test automation, /g/?
>>
>>56007559
>She's a 3D artist and probably doesn't even know what a fragment shader is.

>tfw you will never teach a cute 3D artist about fragment shaders

>Why is Go's math/rand so bad at being random?

math/rand's dirty secret is that it's just a wrapper around the Plan 9 PRNG, which is an 'additive feedback'-type PRNG (same formulation as the glibc PRNG, but with different numbers). Same caveats apply (I think the period is only 230 * (2607 – 1) if the man page I found is correct).
>>
>>56007793
>be pajeet
>test expects a certain output
>hardcode in the expected output
>ALL TESTS PASSED :^)
>>
>>56007776
That's pretty gross, last 3 threads didn't have this.
>>
File: cs major codemonkey.png (125KB, 813x600px) Image search: [Google]
cs major codemonkey.png
125KB, 813x600px
Why is it acceptable for CS graduates to be incapable of implementing anything that wasn't explicitly taught to them?

It's like being unable to do math problems if they're not written exactly like in their textbooks.
>>
>>56007857
i did this for my dad when i was 10. it was a basic average calculator for diving points, or something? i forgot. i didn't really know much about c++ back then, so i just hardcoded the output
it was the easiest $350 of my life
>>
File: stallman caught.jpg (77KB, 857x774px) Image search: [Google]
stallman caught.jpg
77KB, 857x774px
Could you use Parsec parsers to pretty print?

>>56007884
you got unlucky
>>
>>56007887
Lack of curiosity i say, they dont program or learn in their free time.
>>
>>56007884
>last 3 threads
Maybe you should lurk more.
>>
Currently trying to figure out a way to strip pdf-books from a free online book site from ads.

I actually appreciate that those are Job offers for programmers and engineers, but they have no archive value whatsoever, distract from reading and bloat the files.

Looks like pdf is a clusterfuck of formatting, large chunks of binary mixed with plain text, plain xml and image files. Haven't found a good overview for that yet. Any recommendations?

I'd rather really just delete the undesired information instead of saving everything I can identify as non-ad into a blank file. Generally this creates a shitton of errors.
>>
>>56007776
i'll have you know that hime is always related to programming
>>
>>56007998
Absolutely not.
>>
>>56007887

A PhD will make someone an expert in a particular subject, which more often than not, is not pedagogy. Most professors may know their particular subject well, but skill at actually teaching comes with age. I'd say for the first decade or so of their career, they pretty much wing it. Given that it is incredibly difficult to teach people how to think critically and problem solve, we can reasonably expect that numerous college students will come out knowing how to solve whatever textbook problems they solved in college, and nothing more. Beyond this, a number of students may end up just outright cheating, and depriving themselves of an ability to actually learn in the first place.
>>
File: Capture.png (42KB, 682x726px) Image search: [Google]
Capture.png
42KB, 682x726px
Guys, you know what I have to do in order to make these files run?
>>
>>56008038
>a number of students may end up just outright cheating, and depriving themselves of an ability to actually learn in the first place.
Unfortunately, depending on where you study, having to cut edges is often necessary. This isn't pleasant.
>>
>>56008051
Watch more anime your autistic retard
>>
>>56007559
Wait, fuck, I'm retarded and my reasoning was flawed so I know why I'm getting this result now.
>>
>>56008051
That's some horrible code you got there senpai.
>>
I need some project ideas, im currently working on game engine in c++ and lua but i need a break from it. Id like to make some handy utilities, already wrote random wallpaper downloader + setter in Go and C for my dwm, but cant figure out what else, any ideas?
>>
>>56008124
don't care. want it to run.
>>56008084
fuck off.
>>
>>56008051
>C:\Users\Serdar
>Serdar

Go back to India, Serdar. And poo in the loo.
>>
>>56008163
http://lmgtfy.com/?q=how+to+compile+and+run+java+files
>>
>>56007694
That caught be off-guard when I was contributing to IPFS's codebase.
>>
>>56007502
>Studios: Doga Kobo
Oh shit, picked up.
>>
>>56008163
>using an IDE
>being unable to use it properly
>and then some are going to argue that ides are better.

I'd say line 18 should have a semicolon, and optionnally be properly formatted, but maybe that's just your skills at screenshotting. Also your screenshot says 'Compilation completed successfully', what the fuck is your problem exactly?
>>
>>56008051

javac *.java
java Buzz


>>56008075

I could reasonably understand such a situation, but I have met a few people who have just asked me to do their work for them in exchange for something, who probably could have done the work themselves if they weren't lazy shits. I turned them down of course, but I can imagine the problem may be rampant if we're seeing tons of CS majors who can't even do fucking FizzBuzz.
>>
>>56007949
Lots of apps now has a PDF reflow feature, including MS Word. Try opening the documents in that.

I personally use InDesign (if it's graphic-heavy) or LaTeX (if it's formal) to make PDFs, but I really prefer ePUB for reading (although there's no universally accepted standard despite Calibre being a thing).

>>56008208
It may look good but it's even shittier contentwise (barely any /g/ or even /3/ in there) than their last show which is an achievement.
>>
>>56008051
I really hope you realized your main method is missing a curly.

I never really got into how to program properly in java. So okay I got them funcitoning .class files but you don't see java programs coming in those. they're usually .tar or an .exe. Dunno how to use wrap them, though.
>>
>>56008276
I believe his DIE is codefolding main
>>
>>56008252
>Lots of apps now has a PDF reflow feature, including MS Word. Try opening the documents in that.
I just tried everything I had here. Need to check MS Word when I'm at work later. I usually print to pdf If I ever need one.

>prefer ePUB for reading
I would prefer plain TeX files., but 99% of the time you don't really have a choice.

>>56008276
>Dunno how to use wrap
forget tackle, learn wrap. It's super effective.
>>
Anime website.
>>
>>56007793
Because dependent types are a thing. Get with the times, grandpa.
>>
programming is kinda boring
>>
>>56008349
Only if you are boring.
>>
>>56008349
Watch anime instead
>>
>>56008373
Recommendations?
>>
>>56008343
this

why do a hundred specific tests that might accidentally succeed when you can just do

sortArray : forall a. array a -> array a { sorted }
>>
>>56008381
Love live
>>
>>56008405
Sounds gay as fuck. I liked One Punch Man and Full Metal Alchemist
>>
>>56008349
Programming is all about inventing problems where there wasn't any. It takes a mischievous mind (aka "curious mind" in politically correct circles) to involve your life in such activities.
>>
>>56008217
normally i am shown what has been done.
in this case. I am not even able to run the files...
I always had problems with that :/
And the code is good, the only thing I want to try is make it run.
Normally this IDE is compiling and running them automatically, but even that it does not.
>>
What's a good language to implement an interpreter for a niche markup language? Something like Haskell maybe? I've heard it is best in class for stuff that relies heavily on ASTs like parsers and compilers
>>
>>56007502

Robot computer vision.

https://www.youtube.com/watch?v=x6Dsqha9JPM&index=1&list=PL2dAOzo3a1SqxkO_c7mVzUcQh5leLHjsX
>>
>>56008188
Looked it up, it's apparently a Turkish/Persian name.
>>
>>56008440
forget it, I am retyping it into a new project and it works apparently.
HopefullyI will encounter less of that problem until I finish that book and my project
>>
>>56008460
Perl
>>
>>56008483
REEEEEEE

turkroach RAUS

or muslim pls go
>>
>>56008537
no :^)
>>
>>56007694
point of panic is to not allow you to "throw" it
>>
any image processing books that spoon feed idiots like me? (e.g. pseudo code)
>>
>>56008460
algebraic data types make it great for parsers, it's like Backus Naur form, but it's code
>>
>>56008252
What was their last show?
>>
File: free monad.png (39KB, 670x549px) Image search: [Google]
free monad.png
39KB, 670x549px
>>56008460
>>56008630
Haskell
Use ADTs for your syntax and then Parsec for your parser

You can use the free monad to do pic related too
>>
File: free monad interpreter 2.png (52KB, 457x755px) Image search: [Google]
free monad interpreter 2.png
52KB, 457x755px
>>56008679
>>
>>56008537
SOON
>>
Which is worse, syntactically significant indentation or syntactically significant capitalization?
>>
>>56008747
Capitals as whitespace
>>
>>56008051
what a shitty overrated IDE, the error markers aren't very clear, if it's even an error or the main method is just minimized, but the highlighted opening curly brace indicates an error i guess?
>>
>>56007502
No this is a japanese programmer
>tfw no okinawa gold programmer gf that likes guns
>>
>>56008747
significant capitalisation is great
>>
File: 1454056796407.png (13KB, 557x606px) Image search: [Google]
1454056796407.png
13KB, 557x606px
I have two separate java programs, one outputs data to the console via standard output I want to read this data in with my other program and do stuff with it.

Is there an relatively easy or simple way to do this?
>>
>>56008460
Ocaml
>>56008679
haskell doesn't have polymorphic variants which make it worse for these kinds of use cases
>>
>>56008807
Pipe it to the other program and read it with stdin
>>
>>56008807
have one java program that outputs to stdout
then have the other read stdin

open cmd, then pipe the programs together
>>
>prelude has semigroups now
When did that happen?

>>56008924
Normally you don't need polymorphic variants for this
>>
>>56008952
>>56008958

Just found out what the pipe operator is, I need to learn more basic commands.

Thanks /dpt/
>>
File: wtf.png (22KB, 922x288px)
wtf.png
22KB, 922x288px
please help a shitter
>>
File: temp.png (6KB, 465x152px) Image search: [Google]
temp.png
6KB, 465x152px
>>56009041
use based eclipse and it will literally fix it for you, don't know what the fuck is going on in your pic
>>
>>56009041
it's your imports

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
>>
Implementing all the memes, so far my simply typed lambda terms implement functor, foldable, traversable, show, semigroup, Num => Monoid, Applicative, Monad

What's left?
>>
>>56009041
import java.awt.event.ActionEvent;

not
import javafx.event.ActionEvent;
>>
File: 1466836018259.png (136KB, 435x430px) Image search: [Google]
1466836018259.png
136KB, 435x430px
>>56009238
>>56009263
thank you
>>
>>56007887
Looking at schools in my area:
CS Major consists of one C++ class and one "Generic databases class" with the rest of the classes being related to shit.

I've come to the realization that all the "Shit" classes take up all their time so they can't really learn programming.
>>
>>56009242
and before anyone asks, I will eventually add eq and read => read but one needs normalisation and the other parsing

looking at maybe Alternative
>>
>>56007887
W-what's wrong with it?
>>
>>56009242
>>56009383
Also kind of a cheat, the monoid isn't actually associative
>>
>>56008758
Fucking Fortran.
>>
>>56009398
The code? The problem is that the anon in that pic tried to use operator[] to access and modify elements in an ArrayList because Java didn't have operator overloading like in C++. Rookie mistake.
>>
testing pls ingore
/
>>
>>56009539
What if I don't ignore it?
What will you do?
>>
>>56009556
I need a ask question. Wait.
>>
File: 1458546951680.jpg (47KB, 474x479px)
1458546951680.jpg
47KB, 474x479px
>>56009539
Did it work?
>>
File: 1468013405521.jpg (48KB, 477x465px) Image search: [Google]
1468013405521.jpg
48KB, 477x465px
>>56009574
We can only hope
The consequences if it failed are too dire to imagine
>>
>>56009378
elaborate on said 'shit' wwhat is it exactly
>>
>>56007887
it's not acceptable, only delusional lazy normies think it is, in the real world they have a hard time finding a good job related to their field
>>
>>56007857
Once in a programming competition we had a solution but it didn't work for even inputs under 50 or something strange like that. We were running out of time, so we hand-coded the answers to those into our submission and it passed.
>>
File: frchn.png (3MB, 2477x1620px) Image search: [Google]
frchn.png
3MB, 2477x1620px
coming along
>>
>>56008747
I used to think significant capitalisation was stupid but I came to realise it was handy in one case: if you have something of type "Thing", it's handy to call instances of that type, "thing".
>>
>>56009695
noice
>>
>>56008747
indentation
>>
>>56008747
both are irrelevant
>>
what is the difference between this:

https://en.wikipedia.org/wiki/Sorting_algorithm

and just using this???

 
Arrays.sort(array_name_here);
/
>>
>>56009811
What do you think happens when you call Arrays.sort?
>>
>>56009811
the bottom is faster
>>
>>56009811
One is a type of function.
The other is an implementation of one of those functions.

That is a really stupid question.
>>
>>56009811
I don't think the Wikipedia article will compile.
>>
>>56009821
>>56009823

so i don't need to learn selection or bubble sort ya?
>>
>>56009840
yes you do not need to fail to not learn it
>>
>>56009840
They're so fucking easy you might as well. But yes Arrays.sort will likely be faster than those in all cases.
>>
>>56009840
Sometimes it can be useful to do some manual sorting, for example when sorting multiple arrays at once or when needing some special conditions in the sorting process.

Just look it up when you need it.
>>
>>56009840
Insertion and bubble sort are good examples of O(n^2) functions for algorithm analysis.
They are very easy to implement and good for a learning tool, but you would never use them in practice.
>>
>>56009811

In most cases it does not make sense to roll your own sorting function. In some edge cases, it may be advantageous to use a particular sorting algorithm, which may not be the one used by your standard library.

>>56009840

The crappier sorting algorithms like bubble sort really ought not to be used in any real scenario. Their purpose is to be used as teaching instruments for things like complexity theory.
>>
>>56008636
Sansha Sanyou
>>
>>56009862
you use insertion sort for inputs under 40 elements, base cases

you use insertion sort for almost sorted inputs

its the kinds of optimizations those implemented .sort() functions have
>>
>>56009840
If you don't use the right kind of sort then the sort order might be wrong. You can get fired for that.
>>
Is it okay you use s instead or self in Python?

How do I enable the syntax highlighting for s instead of self in MagicPython in Atom?
>>
>>56009496
I don't know Java but I feel like I'm being trolled.
>>
>>56010069
You literally cannot do
ArrayList[x] = n
in Java
>>
sooo...this is my code:

public class N_20Lbs_OfPussAndAss {

public static void recBottle(int n){

if (n==0 || n<0){
System.out.println("No 20 LBS of pussy and ass on the wall,");
System.out.println("No 20 LBS of pussy and ass,");
System.out.println("Ya' can't take one down, ya can't pass it around.");
System.out.println("'Cause there are no more 20 LBS of pussy and ass on the wall");
System.out.println("> tfw not even good enough for campus jobs yet :(");


}else{
System.out.println(n + " of 20 LBS of pussy and ass on the wall,");
System.out.println(n + " of 20 LBS of pussy and ass.");
System.out.println("ya' take one down, ya pass it around,");
recBottle(n-1);
System.out.println(n + " of 20 LBS of pussy and ass on the wall.");

}
}
public static void main(String[] args) {
//Scanner sc = new Scanner(System.in);
int amounts = 3 ;//sc.nextInt();
recBottle(amounts);
}
}



and that is my output:
3 of 20 LBS of pussy and ass on the wall,
3 of 20 LBS of pussy and ass.
ya' take one down, ya pass it around,
2 of 20 LBS of pussy and ass on the wall,
2 of 20 LBS of pussy and ass.
ya' take one down, ya pass it around,
1 of 20 LBS of pussy and ass on the wall,
1 of 20 LBS of pussy and ass.
ya' take one down, ya pass it around,
No 20 LBS of pussy and ass on the wall,
No 20 LBS of pussy and ass,
Ya' can't take one down, ya can't pass it around.
'Cause there are no more 20 LBS of pussy and ass on the wall
> tfw not even good enough for campus jobs yet :(
1 of 20 LBS of pussy and ass on the wall.
2 of 20 LBS of pussy and ass on the wall.
3 of 20 LBS of pussy and ass on the wall.

Process finished with exit code 0

Why are the last three lines printed senpai?
>>
>>56010126
How would the code in that picture be written better than?
>>
>>56010204
oops, found the error already, but enjoy the lyrics none the less :^)
>>
>>56010217
something like
Integer temp = a.get(i);
a.set(i, j);
a.set(j, temp);
>>
>>56007694
>muh java silently ignored exceptions
fuck off
>>
>>56010277
Shouldn't it be
a.set(i, a.get(j));
?

>languages without operator overloading

not even once
>>
>>56010321
yes
>>
Is c++ good for embedded/robotics? Or C
>>
>>56010339
both
>>
>>56010345
any particular reason why one would be used over the other within the field?
>>
>>56010355
If there is a compiler for it for the target platform there are very few reasons not to use C++
>>
>>56010390
>there are very few reasons not to use C++
Extremely bloated language.
Unstable ABI.
Glacial compile times.
Encourages shitty code.
Supports OOP.
>>
>>56010408
>Supports OOP.
all languages do
>>
>>56010408
So that's one real reason and 4 basement dweller memes.
>>
>>56007544
what are you studying squid?
>>
>>56010421
>all languages do
No they don't.
The ability to have a record/struct type != OOP.
>>
>>56010421
Only if you think 'all languages' is C++, Java, C#, and Python.
>>
>>56010459
tell me a language that you cant do OOP in

fucking retard you can do OOP in any language
>>
>>56010484
First define OOP precisely.
>>
>>56010496
object oriented programming
object - fields and functions
oriented - you know
programming - yes
>>
>>56010484
Malbolge
>>
>>56010510
What is a field?

Do you mean functions, or methods?
>>
>>56010510
That isn't the core of pOOP at all.
It's about the segregation of state into objects (at a fine-grained level), and those objects passing messages to each other to alter each other's state.
The whole point of OOP is encapsulation of state.
It is fundamentally flawed though, and it's a good thing if a language doesn't support it directly.
>>
Nearly finished tweaking dwm, wrote autostart patch in C, finished working on random wallpaper downloader and/or setter in Go (had one in C but was it was glitchy and a pain to add features). Now i need some home keeping utilities...
>>
>>56010538
Is that state mutable?
>>
>>56010538
>doesn't support it directly.
>directly

okay should have said that in the beginning instead of being a huge huge red tomato faggot about it
>>56010532
>What is a field?
fuck off et fucked
>>
>>56010549
Typically, yes.
>>
>>56010454
>No they don't.
Yes they do.
>The ability to have a record/struct type != OOP.
I made no such claim, you might be retarded.
>>
>>56010484
golang
you can't inheritance
>>
>>56010561
no hes just VERY insecure and wants to claim you cant implement objects in C to make himself feel better or soething

its because hes such an obvious shit human being i cant even its absurd
>>
Are there any "IDEs" for HTML/CSS? If so what's the best one?
>>
>>56010567
>you can't inheritance
It doesn't have reassignable function references or pointers?
>>
>>56008924
>haskell doesn't have polymorphic variants which make it worse for these kinds of use cases
Please stop. You shit up the thread with this inane bullshit every time somebody brings this topic up.
>>
File: webstorm_logo.gif (6KB, 720x162px) Image search: [Google]
webstorm_logo.gif
6KB, 720x162px
>>56010572
>>
>>56010552
I don't know what a field is though, anon, and I can't argue whether one can do OOP in all languages if you don't define it for me.

>>56010554
In that case, it would seem that one cannot do OOP in any immutable language.
>>
>>56010578
shit up the thread is posting one fact?
>>
>>56010570
You can implement objects in C, you just have to go quite far out of your way to do so.
It's not something the language encourages.

That's what people typically mean when they say "OOP language": a language that supports and encourages (or even forces) OOP.
>>
File: 1466559848718.png (85KB, 469x428px)
1466559848718.png
85KB, 469x428px
Whats the object-oriented way to become wealthy?
>>
>>56010567
>you can't inheritance
OOP is not about inheritance. Why do you speak about concepts you don't understand?
>>
>>56010595
Learning Java
>>
>>56010591
>You can implement objects in C
gg
>>
[ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo *Click*
>>
>>56010591
>You can implement objects in C
You can implement them in any language.
>It's not something the language encourages.
It doesn't need to "encourage" it any more than it needs to encourage binary search trees and heaps: they're just tools that solve problems.
>people typically mean
Retards? Of course, most of the time they don't know what the fuck they're talking about.
>>
HOLY SHIT!!! WHO IS THIS HOT PURPLE HAIRED GIRL!!! I HAVE TO KNOW AND MAKE HER MY GF!!
>>
Is prolog good for AI or is it just an ancient meme?
>>
Been working on a facial recognition app here:
https://www.raskie.com#mememe

Bug reports and suggestions welcome here:
https://www.raskie.com#on-notice
>>
>>56010581
It's not free? IntelliJ is free yet this isn't? What's the deal?
>>
>>56010643
cringe
>>56010657
yes
>>
>>56010634
:^)

>>56010643
She'd reject you
>>
Are "x language is better than y" discussions ever going to be useful?
They always end in an useless flamewars.
>>
>>56010637
If that is your shitty definition, why even have the term "OOP languages"?
In encompasses practically everything.
>>
File: lolfgt.jpg (103KB, 907x718px) Image search: [Google]
lolfgt.jpg
103KB, 907x718px
>not posting mari chan
An exokernel for ARM64
>>
>>56010662
https://www.jetbrains.com/webstorm/

just click download
>>
>>56010674
It's because he's a Pajeet who only understands OOP.
>>
>>56010661
why don't you post this on /r/programming ?
>>
>>56010674
you are really bad at this

OOP language != can do OOP why does this go so deeply anal with you
>>
Why are Python users so mentally crippled?
>>
>>56010657
ancient meme

most libraries are now in Python since that's what most people use
>>
>>56010657

The backtracking constructs are apparently quite unique. From what I understand, you can, in some way, automate tree traversal work with it.
>>
>>56010697
excessive use of Python leads you to believe that you can always import libraries in critical thinking tasks and dynamic typing means the missing library errors go silent
>>
>>56010664
>yes
Let me rephrase it: would knowing prolog make me employable in the current AI field, or would other languages be better?
>>
>>56010696
Immutable languages cannot do OOP. Now go back to shitting in the street, Pajeet.
>>
File: 1457274399165.jpg (44KB, 544x529px) Image search: [Google]
1457274399165.jpg
44KB, 544x529px
>>56010714
>Immutable languages cannot do OOP
>>
>>56010708
>yes

that was a joke. in prolog you work with "yes" and "no"
>>
Can someone tell me, why

package Exercises;

import java.util.Scanner;

public class N_20Lbs_OfPussAndAss {

public static void recBottle(int n){

if (n>0){
System.out.println(n+" before the recursion");
recBottle(n-1);
System.out.println(n+ " After the recursion");
}else{
System.out.println(n+" When the ondition is not met anmyore");

}
}
public static void main(String[] args) {
//Scanner sc = new Scanner(System.in);
int amounts = 3 ;//sc.nextInt();
recBottle(amounts);
}
}

prints this?:
3 before the recursion
2 before the recursion
1 before the recursion
0 When the ondition is not met anmyore
1 After the recursion
2 After the recursion
3 After the recursion

Especially the last three lines...
>>
>>56010708
No. You would do better studying math and reading the Russell and Norvig book.
>>
>>56010714
>Immutable languages
languages w/o assignment you mean, C isn't one of them

immutable languages can simulate state using other things though, but ok
>>
>>56010678
Says its a 30 day trial.
>>
>>56010722
Since OOP necessitates mutable state, they cannot. Off you trot.
>>
>>56010727
lol

do you even understand what recursion is?

the
 System.out.println(n+  "  After the recursion"); 
block is executed after you call the recBottle function recursively
>>
>>56010729
I mean what I say and I say what I mean, you'd better hope that that street is clean.
>>
File: 1466329334062.jpg (24KB, 258x263px)
1466329334062.jpg
24KB, 258x263px
>>56010737
>OOP necessitates mutable state
>Immutable languages cannot do mutable state
>>
>>56010722
That was VIP quality!
>>
>>56010408
>Extremely bloated language.
>Glacial compile times.
>Encourages shitty code.
only if you use tememeplate memetaprogramemeing
>>
>>56010779
>If I subset the language, maybe it'll become good!
Typical sepplesfags logic. Enjoy your countless subsets that you call "C++".
>>
>>56010787
C is an even smaller subset you smug fag
>>
>>56010754
You can simulate it but that is all, you've squatted too low and got shit on your ball.
>>
>>56010793
C is in no way a subset of C++.
That was only true in the 70s.
>>
if python was as fast as C++ why would anyone ever use a language other than python?
>>
>>56010797
>You can simulate it but that is all, you've squatted too low and got shit on your ball.

>only asm has mutable state
>>
>>56010793
Wrong, you dunderhead. C is not a subset of C++. Don't ever write code again, for the sake of humanity, you twit.
>>
>>56010801
>>56010811
it basically is, name one real useful feature besides inline function definitions that C has that gnu C++ doesn't
>>
>>56010707
>you can always import libraries in critical thinking tasks
that's true tho
>>
>>56010805
yes because python is dynamic and VM

maybe if it was lisp-type
>>
>>56010805
Because Python is shit in more ways than just its performance.

God, it's such a crap language, but its users defend it because they can't understand anything else.

Just stop programming, please.
>>
>>56010819
>gnu C++
We're not talking about GNU C++, we're talking about ISO C++.
>>
>>56010836
autism
>>
>>56010752
>I'm retarded and proud
anon
>>
>>56010824
looks like you tried to import basic human intellect, failed and forgot to catch the exception
>>
newb here

is there a better way to write this in python?

[script] if (i % 3 == 0) or (i % 5 == 0): [/script]
>>
>>56010749
No, not really.
So far as I have understood, you need a base case.
A condition that is met, and a method that calls itself as long as the condition is met.

Please elaborate what I miss.
>>
>>56010819
Stop moving the goalposts and learn to use google, you ninny.

>basically is
Ah, so it isn't.
>>
>>56010835
argumentation
>>
>>56010835
>Because Python is shit in more ways than just its performance.
such as?
>God, it's such a crap language, but its users defend it because they can't understand anything else.
lol
>Just stop programming, please.
*sigh*
>>
>>56010839
>it's autism if you refer to C++ when you say C++
webshit logic
>>
>>56010840
Pajeet
>>
>>56010850
>>56010857
any real programmer uses gcc and other compilers have similar extensions
>>
>>56010842
>import basic human intellect
syntax error tho
>>
>>56010856
Don't listen to him.
JUST DO IT!
>>
>>56010873
>syntax error
In Python that's a runtime error :^)
>>
>>56010869
I use MSVC, where is your god now?
>>
>>56010869
>I got rekt but I'll try to damage control anyway
>>
>>56010881
>>56010886
name one real useful feature that is in C but not in C++ with gcc/msvc/clang/llvm extensions
>>
>>56010856
Leaving aside dynamic vs static typing, it has stupid scoping, its lambdas are a joke, explicit 'this' argument is annoying.
>>
>>56010896
automatic array duration
>>
>>56010896
We're talking about C++, not C++ with extensions. But please continue to shit yourself.
>>
>>56010879
>syntax errors are runtime errors
get a load of this webcuck
>>
best php framework anons?
>>
>>56010908
VLAs? they're stupid and not fully supported in C11

>>56010912
straight up autism
>>
and C++/C with extensions is not as portable
>>
>>56010927
Yes, but at least he checks his privilege.
>>
>>56010896
>how about this damage control tho
fuck off
>>
>>56010940
C++ can be converted directly to C

>>56010927
>>56010945
Did either you even read the post or were to too busy showing everyone how funny you weren't?
>>
>>56010949
>muh black and white thinking
all i'm saying is that C is practically (not EXACTLY) a subset of real-world C++
>>
>>56010937
>not fully supported in C11
you're retarded and don't know what the fuck you're talking about
>>
>>56010962
implementations aren't required to support them, so they're not """"portable""""
>>
>>56010961
>C is practically
wrong
>>
>>56010961
So C is not a subset of C++. Got it.
>>
File: 1455217692734.jpg (121KB, 2032x820px) Image search: [Google]
1455217692734.jpg
121KB, 2032x820px
>>56010985
>>
File: CLwKE.jpg (23KB, 753x268px) Image search: [Google]
CLwKE.jpg
23KB, 753x268px
>>56010849
because after the recursion you're going backwards.

the last step was recBottle(1) right? so you're going up in the recursion tree calling recBottle(1), recBottle(2), recBottle(3)

see pic related
>>
>>56010961
java is also a subset of C++
>>
asm is a subset of C++
>>
>>56011007
>>56011015
i'm a subset of your mom
>>
>>56010995
Your said it yourself in as many words, C is almost but not quite a subset of C++.

If you're representative of the next generation of programmers then we're fucked.
>>
>>56011043
ISO C++ without template metaprogramming is still better and more useful than C
>>
#include <stdio.h>
#include <stdbool.h>
#include <stdlib.h>

#define STACK_SIZE 100

/* external variables */
char contents[STACK_SIZE];
int top = 0;

void make_empty(void);
bool is_empty(void);
bool is_full(void);
void push(char c);
int pop(void);

int main(void){
char ch;
int op1, op2;

while((ch = getchar()) != '\n'){
switch(ch){
case '0': push(0); break;
case '1': push(1); break;
case '2': push(2); break;
case '3': push(3); break;
case '4': push(4); break;
case '5': push(5); break;
case '6': push(6); break;
case '7': push(7); break;
case '8': push(8); break;
case '9': push(9); break;

case '+':
push(pop() + pop());
break;
case '-':
op2 = pop();
op1 = pop();
push(op1 - op2);
break;
case '*':
push(pop() * pop());
break;
case '/':
op2 = pop();
op1 = pop();
push(op1 / op2);
break;
case '=':
printf("Value = %d\n", pop());
break;
case ' ': break;

default: exit(1);
}

}

return 0;
}

/* empties stack by setting top value to 0 */
void make_empty(void){
top = 0;
}

/* returns true if stack is empty */
bool is_empty(void){
return top == 0;
}

/* returns true if stack is full */
bool is_full(void){
return top == STACK_SIZE;
}

/* pushes item to next position in stack */
void push(char c){
if (is_full())
/*stack_overflow();*/
printf("Stack overflow");
else
contents[top++] = c;
}

/* returns top item from stack (?) */
int pop(void){
if(is_empty())
/*stack_underflow();*/
printf("Stack underflow");
else
return contents[--top];
}


Very simplistic RPN calculator I made for a project in a C book. What should I change/add?
>>
>>56010957
Ass sore from being pounded last night with your dragon dildo, pycuck?
>>
>>56011070
Yes, but we're not arguing that.

There are valid C programs that are not valid C++ programs.
>>
>>56010957
Big deal, any program in a Turing complete language can be translated into a program with the same behavior in any other Turing complete language.
>>
>>56011113
By directly I meant directly

>>56011079
I don't use Python
If you had half a braincell you'd realise that
>>
>>56010982
>>56010937
They only removed the requirement for VLAs (and also complex numbers) because embedded vendors didn't want to implement a bunch of shit that they aren't going to use.
It's still standard C.
>>
>>56011135
Only the true pycuck denies his own language choice.
>>
>>56011077
>#include <stdbool.h>
for what?
>>
>>56011155
if compiler extensions aren't portable by your definition of portable then VLAs and complex numbers aren't portable either
>>
>>56011174
For boolean values? It's used in a few functions.
>>
>>56011004
Okay, in other words, I need a many, MANY recursion practice
>>
>>56011193
You need SICP
>>
File: 1467385174642.png (1MB, 1280x720px)
1467385174642.png
1MB, 1280x720px
>>56007884
>>56007897
got your back men
>>
>>56011188
nigga, in C 1 == true and 0 == false, so you don't need stdbool for anything
>>
File: ferrari-488-gtb-1-1500x1000.jpg (387KB, 1500x1000px) Image search: [Google]
ferrari-488-gtb-1-1500x1000.jpg
387KB, 1500x1000px
>>56007998
kill yourself

>>56011215
kill yourself
>>
>>56011183
They are portable, just not totally portable, although a totally portable program can use them if they're guarded by the appropriate preprocessor statements.

There is a difference between optional features and compiler extensions.
Optional features are a standard API for implementations to implement some common feature they may want, but aren't forced to if it doesn't make sense for their platform.
Compiler extensions are completely non-portable and usually locks you to some specific compiler.
>>
>>56011248
>he thinks his car fetish is any less degenerate
>>
>>56011242
>in C 1 == true
That's wrong though.
>so you don't need stdbool for anything
Sure, you don't NEED it, but it's nice. The "bool" type has different semantics than other types, and using "_Bool" in your code is pretty ugly.
Also, it's more self-documenting.
>>
>>56011265
>he still gets triggered this hard by car pics
>>
>>56011077
>case '0': push(0); break;
> case '1': push(1); break;
> case '2': push(2); break;
> case '3': push(3); break;
> case '4': push(4); break;
> case '5': push(5); break;
> case '6': push(6); break;
> case '7': push(7); break;
> case '8': push(8); break;
> case '9': push(9); break;
dude...
>>
>>56011183
>if
why do retards keep trying their hand at logic? it's obvious to anyone you're still retarded
>>
>>56011305
How would you do it differently?

I'm a complete noob, idk how to make it more efficient.
>>
>>56011299
I'm simply disgusted by people who get off by sticking their dicks in tailpipes.
>>
>>56011314
k tard
>>
>>56011295
>That's wrong though.
No it's not. go back to CS101
>Sure, you don't NEED it, but it's nice.
sure. let's import libraries we don't need. perfect.
>>
>>56011316
Outside the switch:
if (isdigit(ch)) {
push(ch - '0');
continue;
}
>>
>>56011299
Not that guy, but for some reason the only people I see who are into cars are all mouth-breathing idiots.
>>
>>56011295
>That's wrong though.
nope, "true" is defined as 1
>The "bool" type has different semantics than other types
yeah, retarded semantics
>>
>>56011316
if(i >= '0' && i <= '9') push(i - '0');
else switch(i)


or

you could do this

case '0':
case '1':
case '2':
case '3':
case '4':

push(i - '0');
break;
>>
>>56011334
>No it's not
In C, any non-zero value evaluates to true. Unless you're talking about the 'true' macro itself, which is indeed 1.
>let's import libraries
You clearly don't know how header files work.
>>
>>56011350
>you could do this
yeah i could. but i didn't. so deal with it.
>>
>>56011352
>Unless back pedaling
good cuck
>>
>>56011343
Car owners are usually country bumpkins.
>>
>>56011343
stay sour grapes and have fun hanging out with idiots
>>
>>56011364
Your original statement didn't make it clear if that was supposed to be literal C code or not.
>>
>>56011295
>The "bool" type has different semantics than other types
Bad semantics because it can incur inefficient instruction sequences. Unless you absolutely need only 0 or 1 you should not use bool because you save on useless instructions forcing all non-zero values to 1.
>>
>>56011376
>sour grapes
Oh yes, I'm sure he's bitter that he doesn't have a photograph of a Ferrari.
>>
>>56011384
we were talking about bools, idiot
>>
>>56011402
kek
>>
>>56011384
>1 == true
>0 == false
>didn't make it clear
yeah, because people say "1 == true" instead of "true is one and false is zero" when they talk casually
>>
>>56011415
ahahah
>>
New thread: >>56011432
>>
>>56011433
>>56011433
>>56011433
Report this thread.
Do not post in this thread.
>>
>>56011433
do that one we have 310 replies
>>
>>56011456
as if you've never posted a fag thread early lmfao kill yourself
>>
>>56011466
I don't post fag threads.
Keeping to bump limits is very important fuckface. If that shit is allowed, we get a retarded race of stupid memers (such as yourself), who will race to create the next thread, and it will get earlier and earlier.
>>
>>56011480
>Keeping to bump limits is very important fuckface.
for you
>>
>>56011207
not yet.
There is a coding assignment, a project, I NEED to finish.
Like in september.
And I never coded before.
After that, I will spend more time with it in my free time.

> tfw you also need to learn other shit
>>
File: pepe_sad.jpg (23KB, 385x385px) Image search: [Google]
pepe_sad.jpg
23KB, 385x385px
Not working on anything because I feel tired everyday.
>>
>>56011547
stay hydrated fgt
>>
new trap thread when? make it quick!
>>
>>56011566
>>56011432
>>
File: dpt.jpg (65KB, 934x1000px) Image search: [Google]
dpt.jpg
65KB, 934x1000px
>>
>>56011512
what is the assignment? could be super easy or super hard
>>
>>56011580
>Fighting cancer threads with cancer threads
>>
>>56011595
program a game in JavaFx with the MVC pattern.
>>
>>56011613
a basic 2d game is probably all you need, there should be plenty of tutorials online, but you need to get started, but you don't need recursion for it unless the assignment explicitly says you need it
>>
>>56011643
no, not really, but I also have not much knowledge about programming in general, so I am just plowing through Think Java and then work on javafx and translating The idea behind the game.
He just added a lot of Work on the thing and I'd rather learn to work on it systematically, rather than despair on the lack of experience and basics of the knowledge.
>>
>>56010805
Because dynamic typing is error-prone garbage.
>>
>>56010835
this

at least with "design by committee" langs there is quality control
>>
I'm trying javaFX with intelliJ IDEA but i'm not sure what version of scene builder it has included

I thought i had to download it on my own according to this http://stackoverflow.com/a/28881132

So should i download the 64 bit installer?
http://gluonhq.com/labs/scene-builder/
>>
>>56012653
never mind found the version at
IntelliJ IDEA Community Edition 2016.2\plugins\javaFX\lib
>>
>>56007502
>Also, what are you working on, /g/?
Trying to make Visual Studio Code...
>>
File: VisualStudio.gif (63KB, 859x691px) Image search: [Google]
VisualStudio.gif
63KB, 859x691px
>>56013660
...look more like this.

Yeah, I posted the same question yesterday. But I didn't read it, because I'm a huge fag tat got tired. I'm not going to read the answers within at least half an hour, because I'm such a fag that I need to eat and watch a porno scene on DVD, haha!

Also, the quest for a good COBOL IDE that is not GnuCOBOL goes on and I'm grateful for any help, kthxbai!
>>
>>56013705
I'm going to buy 4chan and implement a vote-based cyanide delivery system to literally remove people like you from this planet.
>>
>>56013789
>baaswssswwwwwh
>he didn't laik mah see sharpp
Sue me!
>>
>>56013848
C# is my primary language.

Kill yourself, and consider using MonoDevelop if you want a Visual Studio-like IDE on Linux.
>>
File: normies.jpg (452KB, 2048x1536px)
normies.jpg
452KB, 2048x1536px
>>56013869
>C# is my primary language.
You do know that there's an 18 year limit on 4gag?

Or does the home for mentally challenged permavirgins allow computers? How progressive!
>>
>>56013969
>C# is for kids

wowee! you sure shit on his life!
Thread posts: 326
Thread images: 39


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