[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: 336
Thread images: 29

File: 1416928491388.gif (731KB, 200x202px) Image search: [Google]
1416928491388.gif
731KB, 200x202px
Haskell sucks edition

old thread: >>56718622

What are you working on, /g/?
>>
File: hask.png (294KB, 960x800px) Image search: [Google]
hask.png
294KB, 960x800px
First for the greatest language
>>
im not gay
t. Ruby developer
>>
>>56722561
Are you back from your b&, senpai?
Also, I'm finished doing "work" on my hobbie project. Gonna watch animemes.
>>
first for /java/
>>
>>56722577
just because your IQ is below 8 sexvigintillion doesn't mean everyone's is, baka
>>
>>56722561
>What are you working on, /g/?
Unfucking my cinnamon menus. Before that, rewriting a calendar application so that notifications to my phone work properly.
>>
is swift worth learning
i have a shitton of app ideas
>>
File: akari eats chippus.png (131KB, 256x256px) Image search: [Google]
akari eats chippus.png
131KB, 256x256px
Working on code tags for akari-bbs!
>>
File: afaggotthatloves4chan.png (80KB, 276x303px) Image search: [Google]
afaggotthatloves4chan.png
80KB, 276x303px
Trying to build a computer dedicated to 4chan by bringing a CRT tv back to life. While hooking it up to a C.H.I.P computer. Once that's done, I going to do a live stream of the computer and let /b/ screw around with it.
>>
File: image.jpg (38KB, 300x300px) Image search: [Google]
image.jpg
38KB, 300x300px
>>56722597
:3
>>
>>56722630
ganbatte senpai
>>
ruby-senpai, i need your assistance on the schemescheme interpreter
>>
>>56722561
>Haskell sucks
THIS
>>
So /g/, I have to come up with some kind of computer vision system that can detect and avoid obstacles with a camera. The best part is that it has to run on fairly shitty embedded hardware. How would /g/ do this?

I was thinking of training some neural network in tensorflow then disabling learning and running it in a simplified feed-forward-only mode somehow (is that even possible?). The vehicle it's controlling doesn't go too fast, so I could probably turn the frame rate down to 2-4 FPS. A few arm cores could do that, right?
>>
What do you think of Scala?
>>
>>56722683
useless
>>
>>56722683
Shit
>>
electives poll http://www.strawpoll.me/11276389
>>
>>56722698
>useless
Why?
>>
>>56722683
awful
>>
>>56722702
>mfw it's a list of memes
CS meme confirmed
>>
File: Lanka 19.png (94KB, 289x331px) Image search: [Google]
Lanka 19.png
94KB, 289x331px
>>56722702
>all those choices
I hate you
>>
>>56722702
>OOP is lumped in with GUI
That's actually a great idea.
>>
>>56722702
i worry about questions like this. beyond a minimal interest in the material to me the most important thing is the instructor
>>
>>56722736
this desu senpai
>>
>>56722561
Conway's game of life in C. Debating on drawing to the terminal or a GTK window.
>>
I'm not working on anything because I have a job "programming" and I like to spend my free time doing something else.
>>
>>56722786
what do you do a at work
>>
>>56722786
loser
get a life
>>
>>56722786
sounds like databases : ^)
>>
>>56722794
Web dev, but now they got me doing devops stuff since everyone on my team is an idiot.
>>
>>56722786

And that includes coming onto DPT to tell us about how valuable your free time is? Tell me, why aren't you having sex with a woman right now?
>>
>>56722843
Because she's sleeping. My free time isnt more valuable than anyone else. You are just projecting. I'm more burnt out that anything.
>>
Programming in general was such a fucking mistake. If only I had a time machine.
>>
>>56722843
3dpd
>>
>>56722683
disgusting
>>
>>56722843
maybe he is
>>
>>56722864
It's never too late to join the mechanical engineering master race. :^)

I get to do ME, EE, CS, and IE stuff
>>
>>56722895
Also AE
>>
>>56722713
this

>muh big data
>muh machine learning
>muh cybersecurity
>muh web apps
>muh dater strugers
>>
>>56722895

It's far too late for me, I'm already a senior.
>>
If data structures and algorithms are so cool then why don't you marry htem?
>>
Where do I find job listings for programmers?
My craigslist is full of trashy listings that don't even list the company's name.
>>
>>56722985
indeed
>>
>>56722863
>I'm more burnt out that anything.
That would explain it. Still, you wouldn't be the first person to come here talking about how you don't program because your free time is valuable. I've also seen people come here to just announce how much they dislike programming. It makes me wonder why such people come here at all.

>>56722864
Mate, you know C#, you've got a couple of interesting projects under your belt... you're good. Just get a cushy .NET job, marry a black girl, and settle down. You don't have to program outside of work if it exhausts you like this other Anon.
>>
>>56723006
C# will be forgotten in 10 years
>>
>>56723006
>Just get a cushy .NET job, marry a black girl, and settle down.

I love programming, I just odnt know if I'm IN love with it. Am I just faking it? Am I retsarded?

I just don't know anymore.
>>
>>56723023
Are you CS or CE?
>>
>>56723023
Why don't you marry programming if you love it so much?
>>
>>56723016
You vastly overestimate the rate of change in the world of programming.
>>
>>56723006
Yeah I'm just old and tired. Although I did write Ruby Fizzbuzz that used metaprogramming. Spent like an hour on it at work.
>>
>>56723040
10 years ago Pascal was a big deal
>>
I have been working for four years to find the ultimate programming language
>>
File: Margaret_Hamilton_1989.jpg (61KB, 527x694px) Image search: [Google]
Margaret_Hamilton_1989.jpg
61KB, 527x694px
>>
>>56723023

You don't need to be in love with it. You just need to enjoy it.

>>56723016

Nah. Microsoft is expanding C#, and the core .NET shops aren't really going away.
>>
>>56723057
it begins with H and ends with askell
>>
>>56723057
it's javascript right
>>
>>56723065
Extensions are not recommended for houses built on sand
>>
>>56723057
It's this >>56723077

AKA the perfect blend of imperative, functional, and OO programming
>>
>>56723077
no it turned out to be forth
>>
>>56723093
>the perfect blend of oxygen, hydrogen and a lighter
>>
Algorithms by Sedgewick or Intro to Algorithms by CLRS?
>>
>>56722675
Anyone got any ideas?
>>
>>56723093
>dynamically typed

>>56723105
>untyped
>>
>>56723083

C#'s foundation is more solid than Java's, to be honest. It avoided the whole 'design by committee' meme and ended up incorporating the necessary features early on enough so that they weren't half baked (Java's generics, streams, optional.
>>
File: 1473067380645.jpg (122KB, 845x740px) Image search: [Google]
1473067380645.jpg
122KB, 845x740px
>>56723118
>more solid than Java
>>
>>56723117
>being a haskell autist
It's like you want code that breaks itself for no reason https://wiki.haskell.org/Monomorphism_restriction
>>
>>56723129
Who said I was a Haskell autist?
>>
>>56723051
Pascal died because the ecosystem fucked it all up, Borland crashed and burned (Microsoft poached almost all the good Borland people), all the other branches were restrictively licensed in an era where most programming languages were free to use, and GNU was too slow to get to parity. All this is despite the legitimate good qualities of it and Delphi. C# and its ecosystem aren't going anywhere though, unless Microsoft takes some kind of tremendous nosedive. .NET is huge, C# is the standard .NET language, and in my opinion they're developing the language at quite a good rate (as opposed to Java, for example).
These are my opinions, now I want to hear yours. Why do you think C# will be forgotten in a decade?
>>
>>56723057

The ultimate language in what aspect?
>>
>>56723143
because it's shit
>>
>>56723118
Close your parentheses niggerlover.
>>
>>56723140
For some reason everyone thinks only Haskellfags criticize other languages in this general
>>
>>56723143
It has no real uniqueness or significance
>>
File: 1473426050598.jpg (11KB, 453x272px) Image search: [Google]
1473426050598.jpg
11KB, 453x272px
Do you have any experience with software MIDI synthetizers?
I want to throw some data to one and listen what happens.
I'm programming this in C++.
>>
>>56723161
To be fair, Haskell is a PLT gateway drug.
>>
>>56723155

Maybe when I find sobriety again.
>>
>>56723129
Did you link the wrong page?
>>
>>56723057
You'll never find it. Each language has its own strength and weaknesses. Honestly, language preference normally stems from fanboyism. It's best to just learn as many languages as possible. Then use the best one for the task at hand.
>>
>>56723154
Many shit languages have survived for a long time though, wouldn't you agree?
Would you also agree that language quality has only a small correlation with its longevity in the professional programming space?
>>
>>56723113
i've been using kleinberg-tardos for refreshing recently. it seems pretty good
>>
>>56723182
>Each language has its own strength and weaknesses
Not this trite again
>>
>>56723166
What do you mean by "significance" in this context?
>>
>>56723182
Every language has weakness. Not sure if that holds for strength.
>>
>>56723199
There's nothing that would give C# traction in the long term, except maybe Microsoft's big money
>>
>>56723023
https://www.youtube.com/watch?v=jVV34E061A4
>>
>>56723214

Xamarin, perhaps?
>>
>>56723222

I don't get it, but I feel connected to it.
>>
>>56723222
what the fuck
>>
There is something really bugging me about this. It is something retarded, but I have a question. Look at this code on how to generate prime numbers:
int main (void)
{
int p, d;

_Bool isPrime;

for ( p = 2; p <= 50; ++p ) {

isPrime = 1;

for ( d = 2; d < p; ++d )

if ( p % d == 0 )

isPrime = 0;

if ( isPrime != 0 )

printf ("%i ", p);

}

printf ("\n");

return 0;

}
Program Output

2 3 5 7 11 13 17 19 23 29 31 37 41 43 47

So my question is, why doesn't "C" consider every number a prime number on this program, because, lets say,[ 2%2 == 0]. Whenever a number gets divided by itself, it will be equals to 0. And the program states that if p%d == 0, it is considered a prime number. Is "C" smart enough to know that a prime number can only be divided by 1 and itself? I ask this question because I don't see anywhere in this code where it states this important law for prime numbers. I know its a REALLY retarded question, but it just bugged me a lot.
>>
>>56723313

1 isn't even in the range p and d is checked in and that means this "law", which is more of a property, is implicitly implied.
>>
>>56723313
>for (p = 2) ...
>for (d ..., d < p)

In the code, d is NEVER equal to p, so the case "p%p" never occurs.
Both d and p are begun at 2, so %1 never occurs either.
>>
>>56723313
You're bruteforcing to see if a number can be divided by another number, or d mod p == 0
>>
>>56723313
also please format your code next time
>>
>>56723214
In my time in Enterprise Land, I've not seen a single project move away from C#, I've seen several move to C# though. This is why I think it's going to stay for a long time.
>>
>>56723222
I won't rest until I can listen to this unironically
>>
>>56723407
Yes, I actually just copy/pasted this code from a book. I didn't think it would look this bad lol.
>>
>>56723313
%1 and %p never happen. your outer for loop is 2 <= p <= 50 and your inner forloop is 2 <= d < p. C isn't 'smart enough' you're just blind.

Also this is a horrible way to generate primes, you shouldn't generate primes using primality test, instead you should use number theory https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes
>>
>>56723419
>enterprise land
key phrase
>>
>>56723367
So let me see if I understand. So, in this code, 2%2 never happens, that is the reason why it isn't considered prime. Meaning, P can only be divided by numbers(d) smaller than itself. Am I correct?
>>
>>56723456
It checks P with all the numbers in the range [2, P) - that is, including 2 but not including P

in the case where P is 2, then the inner loop never runs because D (which begins at 2) is immediately not smaller than P (i.e., the 2) bit is taking priority over the [2 bit)
>>
>>56723456
but it is considered prime, the output of your program says so. What happens is there are 0 iterations of the inner loop for p = 2 because it starts at 2 and ends at d< 2, and isPrime is set to 1 before the loop.
>>
>>56723432
Oh yes, I know this is a terrible way to generate prime numbers. I just selected an easy example to be able to formulate my question.
>>
>>56723489
My bad, I meant to say that it is CONSIDERED prime, because 2%2 never happens.
>>
import Data.List (nubBy)
primes = nubBy (\x y -> gcd x y > 1) [2..]
>>
>What are you working on, /g/?

My homework. I'm just now learning recursion.
>>
i thought you guys were just joking about "social justice" in tech but i've been going to talks and whenever i check out the speaker's twitter it's full of retweets of black comedians telling me i can never understand what's happening in charlotte
this is alarming
>>
>>56723620
import Data.List (nubBy)
primes = nubBy (\x y -> y `mod` x == 0) [2..]
>>
File: charlotte.gif (4MB, 500x278px) Image search: [Google]
charlotte.gif
4MB, 500x278px
>>56723642
Nobody can understand what's happening in charlotte, not even black people.

That anime was fucking retarded.
>>
>>56723642
you'll never understand it because you're white

so instead just do what's normal and buy a lot of guns to defend your home and your family when the cops shoot an unarmed black boy who didn't do nothing in your neighbourhood
>>
>>56723167

Yes sir please do the needful kindly
1. Open Visual Studio 2015 Enterprise
2. Create new console app
3. Go to: design
4. Put button on form
5. Double click
6. Copy this into keyboard
7. Pls subscribe and like the video
>>
Is recursion a parlor trick?
>>
>>56723789
recursion is trash
>>
>>56723789
Recursion is how iteration is implemented
>>
is it better practise/efficiency to store a reference to a static object and use its methods from that, or simply call its methods like thing.namespace.dostuff()
>>
>>56723832
I don't think there's a difference
>>
>>56723023
I've had the same thoughts, but I can't think of anything I'd rather be doing so I just stuck with it
>>
>>56723883
how's your meme lang
>>
adder :: IO ()
adder = do putStr "How many numbers? "
num <- getLine
x <- sequence [getLine | _ <- [1..(read num)::Int]]
putStr "The total is "
putStrLn $ (show . sum . map (\n -> (read n)::Int)) x

Am I cool yet?
>>
>>56723006
>black girl
is this a .net thing or ... ?
>>
>>56723802
"no"
>>
>>56723639

Oh hey, that's another way Mr. "I have 4 years of experience" could have passed Falcon's retard test.

function countdown(low, high, count) {
if (high >= low) {
console.log(high);
countdown(low, high - count, count);
}
}

countdown(200, 700, 13)


Jesus fuck, how do people not learn basic iteration and recursion, and then go into the workplace and expect payment for knowing literally nothing?

>>56723816

Conditional jumps are how iteration and tail recursion are implemented.
>>
>>56723980
>muh boolean logic
>>
>>56723986
Goto recurs.
>>
>>56724005
*in some circumstances including for loops and while loops
>>
File: 01apain545.jpg (77KB, 798x449px) Image search: [Google]
01apain545.jpg
77KB, 798x449px
>>56723931
public int add(int num1,int num2)
{
if(num2==0) return num1;

int sum= num1^num2;
int carry = (num1&num2) << 1;

return add(sum,carry);
}
>>
>>56723986
i would reject a smug tard who would use recursion without being told to use recursion
>>
why do black people riot

whats a good gun for a programmer
>>
>>56723931

readLine = read <$> getLine

main = do
putStr "How many numbers? "
num <- readLine
numbers <- replicateM num readLine
putStr "The total is: "
print $ sum (numbers :: [Int])
>>
dickgirls with shitting dick-nipples or stallman?
>>
>>56724040
stallman with birthing dick-nipples that give birth to dickgirls with shitting dick-nipples
>>
>>56724034
uses NoMonomorphismRestriction, ScopedTypeVariables and Control.Monad (replicateM)
>>
when did the devops meme start
>>
>>56724066
its important for javascript code artisans to look like they're doing something a 13 year-old autist could not do
>>
>>56724028
>a good gun for a programmer
A Colt Python, of course.
>>
>>56724005

Yes, but strictly speaking, recursion is a high level concept generally associated with functions, but at the lower level, tail recursion need only be associated with a jump instruction, rather than a jump and link as is traditional for a function call. It is a misnomer to say that tail recursion or regular old loops boil down to recursion in the end, when most of the assembly language generated does not represent a model that could be typically associated with recursion.

>>56724026

Better a smug asshole that can at least do recursion than a complete retard that can't even do a for loop correctly, or who somehow thinks that the task involves multiplication.

>>56724028

>why do black people riot
A multitude of factors. Some may be quick to attribute it entirely to genetics, but quite honestly, I think a large part of it can be attributed to the general degradation of moral and ethical values in society. We see riots first among those who are on average less educated, and given a trigger point with little background information (i.e. "a cop shot one of us"). Later, however, we may see riots becoming more frequent among people of other backgrounds who have gripes with society, and who have not had a proper upbringing in what is right and what is wrong, or who have been conditioned through media and poor schooling to see what is wrong as what is right. That is to say, expect riots from even some white millenials to come as well, should our next president inevitably fuck everything up (and they will, regardless of who wins).

>whats a good gun for a programmer
Ask /k/.
>>
>>56724144
blacks have always rioted tho
>>
>>56724144
> gun
I think he meant in a metaphorical way.

The best weapons are infinite loops and recursion.
>>
>>56724186
>referring to "infinite loops and recursion" as weapons
I hate your kind
>>
>>56724186
You're even worse than the "tool" people
>>
>>56724198
I didn't asked for it. He did.
>>
Trying to get the Android SDK working right now. Not sure what I'll do with it once I have it set up. Thinking of some kind of morse code thing just to test myself on it.
>>
is Ruby a cross dressing qt?
>>
>>56724215
1/2
>>
The OpenGL tutorial I'm following usually set up a handful of vertices and assign them to a buffer. It's understandable, since he's just "drawing" the same cube as many times as he wants with simply transforming their position, but they are essentially the same.

However I have to ask: do I have to force every form into the same buffer, or am I supposed to set up one buffer for each distinct form I have? So one buffer for the cubes, one for the cylinders etc.?
>>
>>56722675
>>56723116
Has nobody here worked with computer vision?
>>
>>56723684
what do you mean nobody understands Charlotte? It makes perfect sense to me
>>
>>56722675
IR
>>
>>56724403
It operates outdoors in blaring sunlight. Wouldn't an IR kinect-style system get drowned out?

It's literally in the desert.
>>
how long until the next spergout of terry on twitter?
>>
>>56723922
haven't been working on it much lately, although I did start on the standard library
>>
>>56724415
how would a camera work there then
>>
>>56724389
you can put different meshes in the same VBO, and then to draw a mesh you specify the relevant offset and length. you can also have different base offsets on your vertex attrib pointers (useful for indexed rendering with different shader programs, so that the vertex index at 0 even though you're at an offset into the buffer)
>>
File: IMG_20160922_010111329.jpg (2MB, 4160x2340px) Image search: [Google]
IMG_20160922_010111329.jpg
2MB, 4160x2340px
It is time
>>
File: 1466351792334.png (705KB, 706x765px) Image search: [Google]
1466351792334.png
705KB, 706x765px
>>56724493
step into the light anon
>>
>>56724461
and you can have different buffers as well with VAOs
>>
reminder that never has someone made a lot of money from haskell
>>
>>56724454
By not recording in IR and for sure not trying to project an IR grid onto the subject
>>
>>56724525
reminder that never has someone had fun in Java
>>
>>56724525
the book writers and lecturers probably did
>>
>>56724541
I have fun in java every single day
>>
>>56724552
I disagree
>>
File: 1465740370726.png (39KB, 620x456px) Image search: [Google]
1465740370726.png
39KB, 620x456px
>>56724552
>>
>>56724562
you cant
>>
>>56724568
Stop me
>>
>>56724552
guaranteed (You)s
>>
I want to practice some D. Any good sites I can fuck around on? All I've found is hackerrank
>>
File: rxfo.jpg (389KB, 800x1383px) Image search: [Google]
rxfo.jpg
389KB, 800x1383px
>>56722630
i like you and i like your project
>>
File: D.jpg (42KB, 512x512px) Image search: [Google]
D.jpg
42KB, 512x512px
>>56724593
it's a meme language though

>>56724599
this
>>
File: 1469367116087.jpg (75KB, 630x551px) Image search: [Google]
1469367116087.jpg
75KB, 630x551px
>>56724582
Moms.getMomForFaggot(Faggots.you).insertDickInAss(Dicks.mine);
>>
Having never used or tried it, what exactly is the appeal in Haskell? It just seems like going through extra hoops just to do something that could be accomplished much easier with another, more used language.
>>
>>56724611
>getMomForFaggot
Are you adopting him anon?
>>
>>56724618
what hoops?

haskell is thoroughly more enjoyable to write code in than something like C++
>>
>>56724630
Why not use something like C, C#, Rust, Go, etc? It seems like they would be a lot easier to learn
>>
>>56724620
this might actually solve some problems

>adopt a neet
>>
>>56724618
Most programming languages have features designed to make programming easier and more productive.

Haskell has features designed to please its user's autism.
>>
>>56724645
>a lot easier to learn
only because they're all alike

Why would I use any of those languages?
None of those are remotely as powerful as Haskell, and they're all either messy or absent.
>>
>>56724663
and to answer my own question, the only real reasons I see for using any of them are

1) being told to
B) performance
>>
reply if you are a qt
>>
>>56724461
>>56724510
Thanks for the answers!
So both ways are possible if I understand you correctly. May I ask what's the difference? Which is more hard on the GPU, which is more resource friendly?
>>
File: 1473646940765.jpg (88KB, 600x900px) Image search: [Google]
1473646940765.jpg
88KB, 600x900px
>>56724672
qt googlett here :3
>>
>>56724658
But I don't have autism. Does this mean I'll never git gud at haskell?

>>56724663
>>56724671
A lot of support, a large number of available libraries, familiarity, etc.
>>
So, I have to make a bf interpreter in c (sadly without recursion). It's almost done, but embeded loops don't work. How would one go about implementing them?
>>
>>56724707
>A lot of support, a large number of available libraries, familiarity, etc.
There already are a lot of libraries for Haskell, and really the main libraries you will really need are wrappers to FFI.
>>
What does "test driven development" mean?

Sometimes I write a separate source file that runs through some functions with dummy data to test for edge cases, but that's only when i'm still working out the kinks.

Is that all it is?
>>
>>56724618
Actually useful compiler.

Best type system ever.

Super easy to refactor.

Less bugs.

Shits fast.
>>
>>56724724
>>56724737
Are there any major, especially professional projects using Haskell?
>>
https://www.youtube.com/watch?v=1PhArSujR_A

Reminder that even John Carmack liked Haskell
You are fighting a losing battle, datafag
>>
>>56724755
But unless I'm mistaken, most of what he does is in C/C++
>>
>>56724736
It means write the smallest possible test that will fail. Then write the smallest possible code that will make the test pass. Repeat until you start hating dynamically typed languages.
>>
How do the idiots that can't do fizzbuzz get interviews for cs jobs if they didn't know to program? Are they just super good at shitting out resumes?
>>
>>56724777
Probably. They're likely just good at selling themselves, but that doesn't mean they'll last long if they get hired.
>>
>>56724593
Not many places online to practice it I'm afraid, you can always try the roll chart.
>>
>>56723986
I can't tell what's wrong with this at a glance
>>
>>56724777
What, I don't get, is how can someone finish a cs bsc without learning at least that minimal amount of programming. I'm only on my 3rd week, and fizbuzz was one of the examlples of the if else structure. I still have 7 semesters to finish bsc. Are us unis this shit?
>>
>>56724852

It produces the expected output. There is nothing wrong with it... at least as an example of using recursion to solve a trivial iteration task.
>>
>>56724872
I imagine partly it's just not knowing you can check for divisibility with _ % _ == 0
>>
Well, I understood functors, but the author completely lost me on applicatives and monads
I'll try again tomorrow
>>
>>56724885
Functors are very easy

Applicatives are a bit unintuitive
Monads seem, ironically, perhaps a bit simpler than applicatives
>>
The more I learn about OpenGL the worse it gets.
>>
>>56724968
What's wrong with it?
>>
>>56724885
How does the author try to explain them?
>>
>>56722611
Poo in .jar Pajeet
>>
>>56724618
don't focus on the IO monad when starting Haskell. it seems like a hoop at first, it apart from that most everything is easier/requires less hoops. eventually you realize that the IO monad is there to make your life even easier
>>
>>56724999
Looking at some examples of what a monad is, it's all Greek to me because I'm completely unfamiliar with the syntax.
>>
>>56724999
GHC should have
{-# LANGUAGE Safe #-}
as default
>>
>>56724973

Terrible naming convention, awful error handling, strange limitations, etc.
>>
>>56725010
it's not just the syntax that makes monads hard to grasp. the idea of monads is kind of abstract and it takes a while to get good at reading super abstract types. but at the same time, you can start out writing code without monads in Haskell and see how you would "discover" monads yourself eventually as a better abstraction
anyways, the first step to understanding monads is understanding functors (which is anything with a map function... think of lists or arrays). from there, look at the Haskell definition of what a functor is and you'll sort of start to see how you could read the monad typeclass
>>
>>56725053
I've never really worked with it, but it does look somewhat daunting.

>>56725059
Alright. If John Carmack likes it, then I'll take his word for it at least.
Not to say that I don't value yours, I appreciate your input
>>
I am learning from Programming in C by Stephen Kochan. Program 7.4 Revising the Program to Generate Prime Numbers, Version 2:
#include <stdio.h>
#include <stdbool.h>

// Modified program to generate prime numbers
int main (void)
{
int p, i, primes[50], primeIndex = 2;
bool isPrime;
primes[0] = 2;
primes[1] = 3;

for ( p = 5; p <= 50; p = p + 2 ) {
isPrime = true;

for ( i = 1; isPrime && p / primes[i] >= primes[i]; ++i )
if ( p % primes[i] == 0 )
isPrime = false;
if ( isPrime == true ) {
primes[primeIndex] = p;
++primeIndex;
}
}
for ( i = 0; i < primeIndex; ++i )
printf ("%i ", primes[i]);

printf ("\n");
return 0;
}


The problem is I failed to understand how its works.

The expression:
    p / primes[i] >= primes[i]

Is used in the innermost for loop as a test to ensure that the value of p does not exceed the square root of primes[i] .This test comes directly from the discussions in the previous paragraph. (You might want to think about the math a bit.)

After that book show me that another line:

If it is, then isPrime is set false. The for loop continues execution so long as the value of isPrime is true and the value of primes[i] does not exceed the square root of p.

Can someone please explain it to me? I don't know if its the book mistake, or is it that they both mean the same.
>>
busy creating a Java Scanner like library for D

progress is slow
>>
File: 7g4HC58.jpg (386KB, 2560x1600px) Image search: [Google]
7g4HC58.jpg
386KB, 2560x1600px
Tell me how smart iamz.

Public Class Q2
Const LABOR_COST As Double = 35
Const SALES_TAX As Double = 0.05
Dim fmtStr As String = "{0,-11} {1,8:c2}"
Private Sub Q2_Load(sender As Object, e As EventArgs) Handles MyBase.Load

End Sub

Private Sub btnDisplayBill_Click(sender As Object, e As EventArgs) Handles btnDisplayBill.Click
Dim customerName As String = txtBoxCustomerName.Text
Dim laborHours As Double = CDbl(txtBoxLabor.Text)
Dim costs As Double = CDbl(txtBoxCost.Text)
Dim laborCostVar, total As Double
laborCostVar = laborHours * LABOR_COST
costs = (costs * SALES_TAX) + costs
total = laborCostVar + costs
lstBoxDisplay.Items.Add(String.Format(fmtStr, "Customer", customerName))
lstBoxDisplay.Items.Add(String.Format(fmtStr, "Labor Cost:", laborCostVar))
lstBoxDisplay.Items.Add(String.Format(fmtStr, "Parts Cost:", costs))
lstBoxDisplay.Items.Add(String.Format(fmtStr, "Total Cost:", total))
End Sub
End Class
>>
>>56725173
>Visual Babby Basic
not very
>>
>>56725153
Good luck lad, have you shown the forums?
>>
>>56725186
I kno rite D:

I have to learn VB for a class so not really my fault famalam.
>>
>>56725197
I take it back then, that's acceptable.
>>
>>56725205
I still don't know when to use single vs int vs double and all the other formats, my professor never went into detail.

This class is legit shit though. We have to print off 300 pages of paper throughout the course, because he only accepts homework on paper. So 300 x 60 students = 18,000 pieces of paper wasted.

All that on top of learning VB for no good reason except that he's old as fuck and high enough up in the uni that he doesn't lose his job.
>>
>>56725138
Please respond ;_;
I am legit confused, and my autism doesn't let me keep going into the book until I figure it out.
>>
>>56725226
I found this thread where someone has same question.

http://cboard.cprogramming.com/c-programming/157181-prime-numbers-arrays.html
>>
>>56725225
I'm not very familiar with VB, but if it's like other languages, a generic int type just depends on your CPU architecture, and a single/double type is used if you want to be very specific and you know exactly how big the number can be. I'm working on a Chip-8 emulator in C that will eventually be able to run on (hopefully) any system that can have binaries/ROMs written in C and has a decent graphics library, and just to be safe, rather than using int to rely on its architecture, I'm using unsigned char.
Not exactly relevant, but it might help as an example.
>We have to print off 300 pages of paper throughout the course, because he only accepts homework on paper. So 300 x 60 students = 18,000 pieces of paper wasted.
What the fuck? I took a Linux class which was taught by a guy in his late 50s/early 60s and he had us turn in shell scripts online.
>>
>>56724988
import std.array, std.algorithm, std.conv, std.string, std.stdio;


void main() {
writeln("Specify depth:");
int n = to!int(strip(stdin.readln()));
int[] lastLine = [1];
int[] nextLine;
foreach (_; 0 .. n) {
nextLine ~= 1;
foreach (index; 0 .. lastLine.length - 1) {
nextLine ~= lastLine[index] + lastLine[index+1];
}
nextLine ~= 1;
prettyPrint(lastLine, n * 3);
lastLine = nextLine;
nextLine = [];
}
prettyPrint(lastLine, n * 3);
}


void prettyPrint(int[] nums, int width) {
string line = join(map!(to!string)(nums), " ");
writeln(center(line, width));
}


$ gdc pascal.d&& ./a.out                                                                                                                                                                                               [03:30:17] 
Specify depth:
8
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
1 5 10 10 5 1
1 6 15 20 15 6 1
1 7 21 35 35 21 7 1
1 8 28 56 70 56 28 8 1
>>
>>56725243
Oh, I already found that thread, it made me understand what was the purpose of
 p / primes[i] >= primes[i] 

inside the nested for loop.
My confusion lies into these two sentences:

 p/prime[i] >=primes[i] 

Is used in the innermost for loop as a test to ensure that the value of p does not exceed the square root of primes[i] .This test comes directly from the discussions in the previous paragraph. (You might want to think about the math a bit.)

And then later, after explaining the code, it says this:
If it is, then isPrime is set false. The for loop continues execution so long as the value of isPrime is true and the value of primes[i] does not exceed the square root of p.

Which one is it? Or do they mean the same? Those 2 sentences confused the fuck outta me.
>>
>>56725243
Thanks for the reply btw. I truly appreciate it.
>>
>>56725187
not until there's something more tangible, the Scanner library that Java has is huge though, I'm only going to cover the most used functions first and then will add onto that slowly but surely the lesser used functions

needs a lot of unit testing though
>>
>>56725248
I'm not kidding man, every other class I have like my HTML/CSS/JavaScript/ASP.NET/etc class we turn shit in online.

The dude has a PhD from Berkeley, so I'm not sure why he's like this.

But the class blows, workload is at least 5x more than any other class I have. Literally have homework due each class that takes me at least an hour and a half. Luckily, I have some programming experience, albeit in Python and Javascript. The people I talk to who have no experience regularly spend three to four hours doing his homework, and this is on like four problems.

On top of this, we have three group projects. Luckily for me, I'm the only one with programming experience in my group, so while the other two are just designing the forms, I actually have to tie all the forms together into a working program. This is due in a week. We just started.

On top of this I have an exam tomorrow and another essay to write tonight that I haven't studied for or written, so I'll be up till like 5AM tonight.

I hate life.
>>
>>56725347
On top of this, it's just fucking stupid to learn VB I can't get over it. Any help I need, half the shit is a thread that was asked in fucking 2007. Like oh thanks for teaching us a relevant language you ass.
>>
>>56725347
Well it is a Visual Basic based class...
Good luck man. Is this a quarter or a trimester class?
>>
>>56725295
They mean the same thing. The author is reiterating that the loop terminates when isPrime is set to false, and that isPrime is set to false whenever the value of p exceeds the square root of primes[i].
>>
>>56725363
Semester, so I've got like three more months of this bs. Luckily, the groups change after each project, so hopefully next time I get at least one person with programming experience.
>>
>>56725361
Every time I see the `Dim` keyword, I am reminded of how stupid that shit is.
>>
>>56725410
Shit, that blows. And this class is absolutely mandatory for your major, with no alternatives that satisfy the same requirement?
>>
>>56725421
Of course, this semester they changed it so that you can take CS 135 in which you learn C instead of this class. However, last semester when I picked my classes for this semester, it wasn't like that. If it was, I'd have gladly taken the 135 class. Sad thing is this class is a 300 level class I'm in now. But yes, this class is a requirement for my major, and only one professor teaches the class.
>>
>>56725509
Well that's shitty. If you think it would be beneficial, can you take CS 135 next semester?
>>
>>56725517
Yeah, I'm actually six credits like ahead of schedule, so my last semester I'll be six credits short of 15 which I need for grants and loans and shit. So last semester I'll probably take CS 135. Funny thing is I'll be a graduating senior in a class with tons of first year CS students. Or I guess I could take it next semester and push one of my MGT classes back a semester, that way I'm not taking three MGT classes next semester.
>>
Does it take longer to dereference a pointer or extract one bit from a long via masking?
>>
>>56725053
deal w it or fuck off
>>
>>56725534
You may want to talk to your counselor about it to make sure it doesn't fuck up your financial aid stuff.
>>
>>56723313
>Is "C" smart enough to know that a prime number can only be divided by 1 and itself?
You can't make this shit up.
>>
Is there any good alternatives to github that offer free private repositories?
>>
>>56725053
The results of years of legacy code and committees.
>>
>>56725541
about the same as long as you don't get a cache miss in which case dereferencing a pointer is slower

some cpu archs can only shift one bit at a time so extracting a bit could be slow too
>>
>>56725705
I think gitlab and maybe bitbucket.

Best option is to roll your own server & stick redmine on it(+ redmine-git-hosting). Best project management imo. Beats the shit out of github at least.
>>
What's up with this class declaration from a JSX example?
http://react-toolbox.com/#/components/table

class TableTest extends React.Component {
state = { selected: [], source: users };

handleSelect = (selected) => {
this.setState({selected});
};

render () {
...
);
}
}
>>
>>56725748
It doesn't transpile for me until I change it to legal javascript like below:
class TableTest extends React.Component {
constructor() {
super();
this.state = { selected: [], source: users };

this.handleSelect = (selected) => {
this.setState({selected});
};
}


But literally all their stuff is in that form so it must be legal somehow, what flavour of JS is it actually?
>>
>>56725391
>They mean the same thing
I don't know man, I don't think this:
"The value of p does not exceed the square root of primes[i]"
Is the same as this:
" the value of primes[i] does not exceed the square root of p"

Either I am retarded, or those are 2 completely different sentences. They are in the same book btw, like literally in the same chapter. Confused the fuck outta me.
>>
Data-driven design is correct but also makes me want to fucking kill myself. Dozens upon dozens of linked lists containing interdependent events which need to be resolvable in any arbitrary order. I can't even malloc/dealloc things because I need to do this like a million times per a second so ahoy funky memory pools.
>>
New to developing on Linux, how do I deal with gcc/g++ commands with a billion arguments?
Right now I'm just saving the command in a text file in case it leaves my history.
>>
>>56725842
Memory pools are love.
Memory pools are life.
>>
>>56725842
>Data-driven
i hope you mean data-oriented

>linked lists
wtf are you doing nigger
>>
>>56725847
Use make.
https://www.gnu.org/software/make/
>>
>>56724063
>having to use extensions for such a simple program
fucking hascucks, I swear
num = input('How many numbers? ')
print 'The total is:', sum(input() for i in xrange(num))
>>
haskell is even more disgusting than python
>>
>>56725911
Fuck off. He should learn cmake.
>>
>>56725748
>>56725754
It's Stage2 Babel, just need the right preset to transpile it.
>>
why does 4chan in general has such crappy community?
I got links from this thread:
https://news.ycombinator.com/item?id=12551760
to this video:
https://www.youtube.com/watch?v=QNznD9hMEh0
and this article:
https://en.m.wikipedia.org/wiki/Renaissance_Technologies

you fags never, ever talk any interesting shit. all the good threads die quickly, and the only obvious marketing/support/children's first OS/programming language threads survive...

fuck 4chan, this website is filled with children and retarded "adults" that don't seem to have any interests whatsoever in doing/learning anything good
>>
File: Stormtards.jpg (97KB, 960x800px) Image search: [Google]
Stormtards.jpg
97KB, 960x800px
>>56725931
> cuck
LOL, nice argument you got there poltard. Go crow "cuck cuck cuck" in your containment board.
>>
>>56725984
>numberphile
yeah fuck off to hackernews and reddit
>>
File: 1473716092913.png (47KB, 200x300px) Image search: [Google]
1473716092913.png
47KB, 200x300px
>having to write recursion in java for university assignment
taking donations for quality nail and rope
>>
File: 1472039879613.jpg (150KB, 1000x889px) Image search: [Google]
1472039879613.jpg
150KB, 1000x889px
>>56725991
>>
>>56725991
thank you for correcting the record
>>
>>56726012
he looks like he's like 25% black tho
>>
I deleted the form file for my java GUI project in NetBeans, so now I can't find the Design-tab to edit the window. How do I get it back?
>That's right, I fucked up, now get it out of your system

Any help would be greatly appreciated.
>>
>>56725931
lol wat?
main = do
num <- fmap read getLine
putStrLn $ "The total is: " ++ show (sum [0 .. num])
>>
>>56726025
The poopy color is a dominant gene, so no it's not his turd.
>>
>>56726029
>sum [0 .. num]
>>
>>56725984
popsci is fun guys!!
>>
>>56725851
Not when they're funky! I need to cache some "deleted" data at the memory pool level along with who used it.

>>56725867
>i hope you mean data-oriented
This is how much of a scrub I am.

>wtf are you doing nigger
Disclaimer: I don't know what the fuck I'm doing.

I'm writing an AI that goes over lots and lots of possible outcomes to figure out some things. During the simulation of a possible outcome various events can happen. There are 12 types of events. When an event happens I need to check whether any of the 0-10 entities present have a flag which means that another event with certain parameters is pushed into the queue. There are 42 flags. Going over every flag every simulation is really inefficient, especially since most entities won't have most flags. If I give each entity a pointer for each type of event and make that pointer point to a list of flag structures when they're turned on and null otherwise this saves me a lot of time. It also future-proofs the program to a degree since it allows me to add new flags without modifying the code. Constantly allocating/deallocating the structs would slow me way down so when the simulation clears a flag due to an event I still "cache" it so I can link it back when the AI backtracks a few nodes. In short everything is a clusterfuck and I'm a hack.

Yes, I do need it to run in a certain timeframe.
>>
>>56726029
That doesn't do what >>56725931 and >>56724034 do.
>>
>>56726042
>linked list
>data oriented
wtf are you doing
>>
>>56726053
this
>>
I'm a new lead developer and over half the developers on my team are borderline code monkeys who don't care about quality and constantly write spaghetti code.

I've tried to do code reviews and offer suggestions to improve their skills, but it seems to mostly fall on deaf ears. I can't constantly have them rewrite code if they never try any harder, we do have deadlines we have to meet after all...

Any tips to help motivate these people or advice on leading a dev team?
>>
>>56726053
>>56726080
Killing myself in slow motion.
>>
>>56726090
>Don't learn from feedback
Who hired these monkeys?
>>
>>56726101
pls watch
https://www.youtube.com/watch?v=rX0ItVEVjHc
>>
>>56726090
expose the management's incompetence, become the ceo, profit
>>
>>56726090
Call in to a meeting.
Show them their worst code gore. Named.
Say "This is how it's gonna be the next months. I will find your spaghetti code, and put your name on it for everyone to see."
That'll teach them.
>>
>>56726090
Call them retards repeatedly so they either leave or try to improve.
>>
>>56726150
You could also have a "Gore of the week" poster and hang it in a room everyone uses (lunchroom/cafeteria, etc).
>>
>>56726116
My boss and his boss, unfortunately.
they're so abstracted away from what we do, I don't think they've written a line of code in years... If ever.

Our last project was looking to take longer than expected since our specs kept changing. Originally, they tried to go for a waterfall pattern but revisions happened so often we moved to an agile pattern... but the thing about agile is it isn't as straight-forward as waterfall in terms of task delegation so my boss panicked and hired a 3rd party contractor from a company known as Tech-M.

It's an India based company who gave us a developer with 6+ years experience (supposedly). I pleaded to let me see his code before my boss hired him onto my team, but he told me that the contractor had already been hired.

So, I spent a solid month and a half with a pajeet that didn't understand anything about programming. Even the simplest shit went way over his head. I did not have time to baby sit him so I ended up giving him a piece of the project to work on for the month and a half he was with us just to quarantine him. What took him the entire month and a half to do I scrapped and rewrote it in half a week.

My job is suffering.
>>
>>56726160
Following up on this..

The hiring managers at my job don't do technical interviews. They only do behavioral. So anyone who can bluff their way through an HR interview and has a degree can get a job here. I'm not even an amazing developer. Simply not being a dumbass is enough to get a lead developer/management role.
>>
>>56726150

Write "clean code" template on your documentation environment. Tell people to follow it and reject their commits until they're clean
>>
>>56725226
Ok, so the first for loop is just generating odd numbers, right? The second for loop is testing each generated number to see if it's prime, by dividing it by every number up until its square root and checking the remainder != 1. So what it's saying is that the inside for loop runs until it hits the number being tested's square root. Then the outside for loop advances +2 aka to the next odd number. Does this make sense, anon?
>>
>>56722561
making a fcking site with laravel, i really like laravel but man ... this shit is killing me, too much work
>>
File: ayy lmeow.webm (1MB, 640x640px) Image search: [Google]
ayy lmeow.webm
1MB, 640x640px
/dpt/-chan, daisuki~

Ask your much beloved programming literate anything (IAMA).

>>56726090
XP, Agile, TDD, ... read uncle bob.

>>56726009
Java has no problem with recursion.

>>56725984
You are free to leave.

>>56725705
https://bitbucket.org/
https://gitla.in/
https://gitgud.io/

>>56725541
Anything related to the (heap) memory is subject to hazard.

>>56724618
Finer control on side effects.

>>56724525
https://code.facebook.com/posts/745068642270222/fighting-spam-with-haskell/
http://www.tsurucapital.com/en/
http://www.alphaheavy.com/

>>56723113
Intro to Algorithms

>>56723057
It's lisp, a programmable programming language.

>>56722624
If you plan to develop for apple stuffs then, yes. Otherwise, no.
>>
>>56726204
>PHP
>>
>>56726160
Bring it up with you're boss. Tell him how terrible this guy is. That he is a liability. Surely he can be fired for incompetence, you want have any trouble finding evidence for that. Ask your boss for permission to be allowed to hire someone new yourself to replace him. Do this for every peice of shit on the team. If you really get to talk directly to the boss, the boss only cares about making money so if you can convince him you can make the company more money than it makes today he generally will let you do what you want, unless he's a massive retard.

Pajeet probably won't even care that much, I'm sure he'll weasel his way into some other shit tier company with his 6 years """experience""".
>>
>>56726205
neck yourself namefag
>>
>>56726176
oh man, the same with me, i have to do all the work cuz the other people in my team dont know what to do, i mean, they know the basics but it is not enough so they can do shit, even if i try to teach them
>>
>>56726208
fck yea php
>>
>>56726150
>>56726157
>>56726156
>>56726185
They won't respond to it. Almost every developer here is complacent in their garbage code.

>>56726147
Actually, I'm playing the incompetence to move up.
I've been enforcing design patterns and I've convinced the manager to let me open source some pieces of our in house applications.
Most of the developers here are the kinds of people who would put all of their code into a single file if they could. Modular code, hell even making internal libraries is fucking mind blowing to them. I'm pretty middle of the road, by my managers think I'm a wiz.

>>56726210
His contract has already expired, and I voiced those concerns to my manager. I honestly don't think he learned from it though. I'm probably going to have to go to his boss to actually get my voice heard. Money gets his attention, so just saying it was a financial waste should be good enough. At the same time though, I don't know if I want to shoot myself in the foot by getting on my boss' bad side. With any luck, I'll be replacing him soon.
>>
>>56726205
are you secretly fiora aeterna
>>
>>56726237
>I don't know if I want to shoot myself in the foot by getting on my boss' bad side.
This is a dangerous game. Ultimately got fired from my last job by dealing with shitty politics like this. Thread carefully.
>>
new thread when ? :3
>>
Anyone got some challenges to complete in C to prove I know the language and practice what I have learnt?
>>
>>56726258
Do my job for me.
>>
File: hx.webm (3MB, 640x360px) Image search: [Google]
hx.webm
3MB, 640x360px
>>56726213
Please, don't bully.

>>56726258
The best proof is to implement the said language. There also IOCCC.
>>
Patrician tier: C, C++

Normie tier: Java, C#, Python

Pleb tier: Everything else


Prove me wrong pro-tip you can't.
>>
>>56726237

What language are you using?

Also, bosses won't give 2 shits about how the job is done, as long as it is done in time and delivered to customer.
Your only solution is to rollback pajeet's code until he does it the clean way. And if by the end of sprint you have unfinished tasks, then pajeets will be responsible.
>>
File: 1474463964829.jpg (80KB, 549x1190px) Image search: [Google]
1474463964829.jpg
80KB, 549x1190px
>>56726310
>anime
>>
>>56726333
>>>/reddit/
>>
>>56726331
>What language are you using?
Right now, AngularJs with an ASP.NET backend on IIS since the shop floor wanted this as a web application for portability.

The language varies since it depends on the project. We're an in-house development department for a large aviation company, so usually what happens is upper management will tell us "we want a program that does X" and we choose the language to make it in.

You're right in the sense they really don't care what we do as long as it gets out the door. Unfortunately, that makes devops a nightmare.
>>
>>56726312
Unproductive autist tier: C, C++

Get-shit-done tier: Java, C#, Python

Pleb tier: Everything else


Prove me wrong pro-tip you can't.
>>
import requests
import threading
import time
head={}
head['Accept-Encoding']='identity'
head['User-Agent']='Mozilla/5.0 (Android 4.4; Tablet; rv:41.0) Gecko/41.0 Firefox/41.0'

def check(q,proxy):
prox = {}
prox["http"]="http://{0}".format(proxy)
prox["https"]="https://{0}".format(proxy)
try:
Page = requests.get("https://api.ipify.org",
proxies=prox,
headers=head, timeout=10000)
except:# OSError as e:
return
if proxy in Page.text:
print(proxy)
with open("proxy_list.txt") as List:
for proxy in List:
proxy = str(proxy).replace("\n", "")
t = threading.Thread(target=check, args = ("lol",proxy))
t.daemon = True
t.start()

Am I retarded? What am I doing wrong? It never returns a proxy...
>>
>>56726397
As a c++ dev I can get behind this.
>>
Can I create objects outside of the main function in C++?
>>
>>56726428
Objects that I indeed intend to use inside the main fuction, I mean.
>>
>>56722561
>What are you working on, /g/?

Busy shitposting in /b/ on the question "do certain races get more dubs"?

http://pastebin.com/rVNxr3aB
>>
>>56726397
>Unproductive autist tier: C, C++
How else would I do low level stuff?

Go? Forth? Rust? D? Please, spare me the hipsterism.
>>
File: dumbell_curls.png (852KB, 657x1220px) Image search: [Google]
dumbell_curls.png
852KB, 657x1220px
>>56726439
Answers here:

http://pastebin.com/mn8ks8J3
>>
>>56726439
Country != Race.
>>
>>56726451

Well I did say I was shitposting.

But yes, it's actually testing "country of origin, unless they are using VPNs".
>>
>>56726407
I think there's something wrong with your GET request. I tried to run your request through hurl.it and I'm getting internal server errors.
>>
>>56726428
You can create objects wherever to fuck you want and pass a pointer to wherever you want to use it.
>>
>>56726446
Those are fine for low level stuff, but low level stuff if unproductive by nature.
>>
File: bison_colgate.jpg (91KB, 428x450px) Image search: [Google]
bison_colgate.jpg
91KB, 428x450px
I'm stuck with a problem, could someone help me out? I'm trying to get java to accept 5 user input words, then print them out in a single line (with commas in between each word). But I end up getting each word printed in seperate lines. I know I've fucked up somewhere, but I can't tell where. Obviously the println is repeating itself 5 times, but I only want it to print once, but with all the different variables, and a comma between each variable.

 public class Chara {

public static void main(String[] args) {
String [] rekke = new String[5];
for (int i=0;i<5;i++) {
rekke[i] = Konsoll.readLine("Type in word "+i);
}
for (int i=0;i<5;i++) {
System.out.println("You have typed: " + rekke[i]);
}

}


}

>>
whats the big difference between java and c++?
they are both languages with similar grammar and paradigma
>>
>>56726492
Println prints a whole line, including a new line and return carriage.

You want to print the "you have typed" and then print the words in the for loop.
>>
>>56726494
There's lots of differences, but the biggest one is the absence of a garbage collector in C++. So, you have to manage your own memory.
>>
>>56726467
Ah, thanks.
It was the header.
Works fine now.
>>
>>56726467

Why not use Postman plugin for Chrome? No captcha anything, plus remembers your requests and settings
>>
>>56726558
I usually use the Postman desktop application, but I didn't have it installed on this laptop. Hurl.it was quick and dirty.
>>
>>56726585
Cute.
>>
>>56726585
lol, but, useless Thread import tho :(
>>
>>56726614
I made another version that uses threading.
I must have accidentally put it there when I started.
>>
>>56726310
Looks interesting, sauce on webm
>>
File: 6dCgyuo.gif (198KB, 952x416px) Image search: [Google]
6dCgyuo.gif
198KB, 952x416px
>>56726502
Ok, I got it to print it in a single line, but it keeps repeating "You have typed: " instead of just printing it once. Do I need to put the loop another place?

public class Chara {

public static void main(String[] args) {
String [] rekke = new String[5];
for (int i=0;i<5;i++) {
rekke[i] = Konsoll.readLine("Type in word "+i);
}
for (int i=0;i<5;i++) {
System.out.print("You have typed: " + rekke[i] + ", ");
}

}

}
>>
>>56726701
Higurashi
>>
>>56726715
Your loop includes the print statement "you have typed"

If you don't want that repeated, take that and print that outside the loop.
>>
>>56726715
Well you're printing it in your loop, why wouldn't it show that text 5 times...
>>
File: 3N0WPfx.gif (172KB, 800x336px) Image search: [Google]
3N0WPfx.gif
172KB, 800x336px
>>56726736
>>56726741
Jesus christ I'm retarded. Alright, got it, thanks.

ublic class Chara {

public static void main(String[] args) {
String [] rekke = new String[5];
for (int i=0;i<5;i++) {
rekke[i] = Konsoll.readLine("Type in word "+i);
}
{
System.out.print("You have typed: ");
}
for (int i=0;i<5;i++) {
System.out.print(rekke[i] + ", ");
}

}

}
>>
>>56726772
Well I didn't want to say it, but yeah, was thinking how retarded you must be to not get it.

At least you're learning!
>>
new thread

>>56726802
>>56726802 >>56726802
>>56726802 >>56726802
>>56726802
>>
>>56726176
>I'm not even an amazing developer. Simply not being a dumbass is enough to get a lead developer/management role.
If you have some seniority then start using it. Introduce some deadlines and metrics, warn people that don't meet them and eventually fire one. Well, recommend firing to someone with the power.

You need your boss on board with these processes though, you need them to agree that you should shape them into a modern, competent development team.

And you need to persuade HR to let you do technical interviews before they hire anyone for your team, it shouldn't be too difficult. It's a pretty standard practice and you can use that fact to embarrass them into agreeing with you.

It will take time but eventually you can shape your team into something that you can work with.
>>
>>56726237
>I honestly don't think he learned from it though
Probably not but put it in the form of a cost-saving proposal. About improving efficiency by reducing warranty time.

>I'm probably going to have to go to his boss to actually get my voice heard
Do it but not directly, get your boss to set up a meeting with the three of you.

>I don't know if I want to shoot myself in the foot by getting on my boss' bad side.
Definitely not, get your boss to champion your efforts to improve efficiency and introduce modern practices.


>With any luck, I'll be replacing him soon
That will help of course but do it by being better than him, don't directly undermine him.

It's also easier to replace a person that you got promoted into something else.
>>
>>56726397
Are you calling R pleb tier?
What else would you do non-linear regression in for server-side processing on a web app?
Thread posts: 336
Thread images: 29


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