/dpt/ - Daily Programming Thread

Haskell sucks edition

old thread: What are you working on, Cred Forums?

Other urls found in this thread:

strawpoll.me/11276389
wiki.haskell.org/Monomorphism_restriction
youtube.com/watch?v=jVV34E061A4
youtube.com/watch?v=1PhArSujR_A
cboard.cprogramming.com/c-programming/157181-prime-numbers-arrays.html
react-toolbox.com/#/components/table
gnu.org/software/make/
news.ycombinator.com/item?id=12551760
youtube.com/watch?v=QNznD9hMEh0
en.m.wikipedia.org/wiki/Renaissance_Technologies
youtube.com/watch?v=rX0ItVEVjHc
bitbucket.org/
gitla.in/
gitgud.io/
code.facebook.com/posts/745068642270222/fighting-spam-with-haskell/
tsurucapital.com/en/
alphaheavy.com/
pastebin.com/rVNxr3aB
pastebin.com/mn8ks8J3
twitter.com/AnonBabble

First for the greatest language

im not gay
t. Ruby developer

Are you back from your b&, senpai?
Also, I'm finished doing "work" on my hobbie project. Gonna watch animemes.

first for /java/

just because your IQ is below 8 sexvigintillion doesn't mean everyone's is, baka

>What are you working on, Cred Forums?
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

Working on code tags for akari-bbs!

Trying to build a computer dedicated to Cred Forums 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 Cred Forums screw around with it.

:3

ganbatte senpai

ruby-senpai, i need your assistance on the schemescheme interpreter

>Haskell sucks
THIS

So Cred Forums, 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 Cred Forums 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?

useless

Shit

electives poll strawpoll.me/11276389

>useless
Why?

awful

>mfw it's a list of memes
CS meme confirmed

>all those choices
I hate you

>OOP is lumped in with GUI
That's actually a great idea.

i worry about questions like this. beyond a minimal interest in the material to me the most important thing is the instructor

this desu senpai

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.

what do you do a at work

loser
get a life

sounds like databases : ^)

Web dev, but now they got me doing devops stuff since everyone on my team is an idiot.

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?

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.

3dpd

disgusting

maybe he is

It's never too late to join the mechanical engineering master race. :^)

I get to do ME, EE, CS, and IE stuff

Also AE

this

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

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.

indeed

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

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

C# will be forgotten in 10 years

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

Are you CS or CE?

Why don't you marry programming if you love it so much?

You vastly overestimate the rate of change in the world of programming.

Yeah I'm just old and tired. Although I did write Ruby Fizzbuzz that used metaprogramming. Spent like an hour on it at work.

10 years ago Pascal was a big deal

I have been working for four years to find the ultimate programming language

...

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

Nah. Microsoft is expanding C#, and the core .NET shops aren't really going away.

it begins with H and ends with askell

it's javascript right

Extensions are not recommended for houses built on sand

It's this AKA the perfect blend of imperative, functional, and OO programming

no it turned out to be forth

>the perfect blend of oxygen, hydrogen and a lighter

Algorithms by Sedgewick or Intro to Algorithms by CLRS?

Anyone got any ideas?

>dynamically typed

>untyped

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.

>more solid than Java

>being a haskell autist
It's like you want code that breaks itself for no reason wiki.haskell.org/Monomorphism_restriction

Who said I was a Haskell autist?

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?

The ultimate language in what aspect?

because it's shit

Close your parentheses niggerlover.

For some reason everyone thinks only Haskellfags criticize other languages in this general

It has no real uniqueness or significance

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

To be fair, Haskell is a PLT gateway drug.

Maybe when I find sobriety again.

Did you link the wrong page?

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.

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?

i've been using kleinberg-tardos for refreshing recently. it seems pretty good

>Each language has its own strength and weaknesses
Not this trite again

What do you mean by "significance" in this context?

Every language has weakness. Not sure if that holds for strength.

There's nothing that would give C# traction in the long term, except maybe Microsoft's big money

youtube.com/watch?v=jVV34E061A4

Xamarin, perhaps?

I don't get it, but I feel connected to it.

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

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.

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

You're bruteforcing to see if a number can be divided by another number, or d mod p == 0

also please format your code next time

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.

I won't rest until I can listen to this unironically

Yes, I actually just copy/pasted this code from a book. I didn't think it would look this bad lol.

%1 and %p never happen. your outer for loop is 2

>enterprise land
key phrase

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?

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)

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.

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.

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, Cred Forums?

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

import Data.List (nubBy)
primes = nubBy (\x y -> y `mod` x == 0) [2..]

Nobody can understand what's happening in charlotte, not even black people.

That anime was fucking retarded.

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

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?

recursion is trash

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()

I don't think there's a difference

I've had the same thoughts, but I can't think of anything I'd rather be doing so I just stuck with it

how's your meme lang

adder :: IO ()
adder = do putStr "How many numbers? "
num

>black girl
is this a .net thing or ... ?

"no"

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?

Conditional jumps are how iteration and tail recursion are implemented.

>muh boolean logic

Goto recurs.

*in some circumstances including for loops and while loops

public int add(int num1,int num2)
{
if(num2==0) return num1;

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

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

readLine = read getLine

main = do
putStr "How many numbers? "
num

dickgirls with shitting dick-nipples or stallman?

stallman with birthing dick-nipples that give birth to dickgirls with shitting dick-nipples

uses NoMonomorphismRestriction, ScopedTypeVariables and Control.Monad (replicateM)

when did the devops meme start

its important for javascript code artisans to look like they're doing something a 13 year-old autist could not do

>a good gun for a programmer
A Colt Python, of course.

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.

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.

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

blacks have always rioted tho

> gun
I think he meant in a metaphorical way.

The best weapons are infinite loops and recursion.

>referring to "infinite loops and recursion" as weapons
I hate your kind

You're even worse than the "tool" people

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?

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

Has nobody here worked with computer vision?

what do you mean nobody understands Charlotte? It makes perfect sense to me

IR

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?

haven't been working on it much lately, although I did start on the standard library

how would a camera work there then

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)

It is time

step into the light user

and you can have different buffers as well with VAOs

reminder that never has someone made a lot of money from haskell

By not recording in IR and for sure not trying to project an IR grid onto the subject

reminder that never has someone had fun in Java

the book writers and lecturers probably did

I have fun in java every single day

I disagree

...

you cant

Stop me

guaranteed (You)s

I want to practice some D. Any good sites I can fuck around on? All I've found is hackerrank

i like you and i like your project

it's a meme language though

this

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.

>getMomForFaggot
Are you adopting him user?

what hoops?

haskell is thoroughly more enjoyable to write code in than something like C++

Why not use something like C, C#, Rust, Go, etc? It seems like they would be a lot easier to learn

this might actually solve some problems

>adopt a neet

Most programming languages have features designed to make programming easier and more productive.

Haskell has features designed to please its user's autism.

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

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

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?

qt googlett here :3

But I don't have autism. Does this mean I'll never git gud at haskell?

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?

>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?

Actually useful compiler.

Best type system ever.

Super easy to refactor.

Less bugs.

Shits fast.

Are there any major, especially professional projects using Haskell?

youtube.com/watch?v=1PhArSujR_A

Reminder that even John Carmack liked Haskell
You are fighting a losing battle, datafag

But unless I'm mistaken, most of what he does is in C/C++

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?

Probably. They're likely just good at selling themselves, but that doesn't mean they'll last long if they get hired.

Not many places online to practice it I'm afraid, you can always try the roll chart.

I can't tell what's wrong with this at a glance

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?

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.

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

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.

What's wrong with it?

How does the author try to explain them?

rollin

Poo in .jar Pajeet

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

Looking at some examples of what a monad is, it's all Greek to me because I'm completely unfamiliar with the syntax.

GHC should have {-# LANGUAGE Safe #-} as default

Terrible naming convention, awful error handling, strange limitations, etc.

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

I've never really worked with it, but it does look somewhat daunting.

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
#include

// 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 = 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

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

>Visual Babby Basic
not very

Good luck lad, have you shown the forums?

I kno rite D:

I have to learn VB for a class so not really my fault famalam.

I take it back then, that's acceptable.

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.

Please respond ;_;
I am legit confused, and my autism doesn't let me keep going into the book until I figure it out.

I found this thread where someone has same question.

cboard.cprogramming.com/c-programming/157181-prime-numbers-arrays.html

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.

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

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.

Thanks for the reply btw. I truly appreciate it.

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

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.

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.

Well it is a Visual Basic based class...
Good luck man. Is this a quarter or a trimester class?

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

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.

Every time I see the `Dim` keyword, I am reminded of how stupid that shit is.

Shit, that blows. And this class is absolutely mandatory for your major, with no alternatives that satisfy the same requirement?

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.

Well that's shitty. If you think it would be beneficial, can you take CS 135 next semester?

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?

deal w it or fuck off

You may want to talk to your counselor about it to make sure it doesn't fuck up your financial aid stuff.

>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?

The results of years of legacy code and committees.

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

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?
react-toolbox.com/#/components/table

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

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

render () {
...
);
}
}

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?

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

Memory pools are love.
Memory pools are life.

>Data-driven
i hope you mean data-oriented

>linked lists
wtf are you doing nigger

Use make.
gnu.org/software/make/

>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

Fuck off. He should learn cmake.

It's Stage2 Babel, just need the right preset to transpile it.

why does Cred Forums in general has such crappy community?
I got links from this thread:
news.ycombinator.com/item?id=12551760
to this video:
youtube.com/watch?v=QNznD9hMEh0
and this article:
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 Cred Forums, this website is filled with children and retarded "adults" that don't seem to have any interests whatsoever in doing/learning anything good

> cuck
LOL, nice argument you got there poltard. Go crow "cuck cuck cuck" in your containment board.

>numberphile
yeah fuck off to hackernews and reddit

>having to write recursion in java for university assignment
taking donations for quality nail and rope

...

thank you for correcting the record

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.

lol wat?
main = do
num

The poopy color is a dominant gene, so no it's not his turd.

>sum [0 .. num]

popsci is fun guys!!

Not when they're funky! I need to cache some "deleted" data at the memory pool level along with who used it.

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

That doesn't do what and do.

>linked list
>data oriented
wtf are you doing

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?

Killing myself in slow motion.

>Don't learn from feedback
Who hired these monkeys?

pls watch
youtube.com/watch?v=rX0ItVEVjHc

expose the management's incompetence, become the ceo, profit

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.

Call them retards repeatedly so they either leave or try to improve.

You could also have a "Gore of the week" poster and hang it in a room everyone uses (lunchroom/cafeteria, etc).

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.

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.

Write "clean code" template on your documentation environment. Tell people to follow it and reject their commits until they're clean

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, user?

making a fcking site with laravel, i really like laravel but man ... this shit is killing me, too much work

/dpt/-chan, daisuki~

Ask your much beloved programming literate anything (IAMA).

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

Java has no problem with recursion.

You are free to leave.

bitbucket.org/
gitla.in/
gitgud.io/

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

Finer control on side effects.

code.facebook.com/posts/745068642270222/fighting-spam-with-haskell/
tsurucapital.com/en/
alphaheavy.com/

Intro to Algorithms

It's lisp, a programmable programming language.

If you plan to develop for apple stuffs then, yes. Otherwise, no.

>PHP

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

neck yourself namefag

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

fck yea php

They won't respond to it. Almost every developer here is complacent in their garbage code.

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.

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.

are you secretly fiora aeterna

>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?

Do my job for me.

Please, don't bully.

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.

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.

>anime

>>>/reddit/

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

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"]="{0}".format(proxy)
prox["https"]="{0}".format(proxy)
try:
Page = requests.get("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...

As a c++ dev I can get behind this.

Can I create objects outside of the main function in C++?

Objects that I indeed intend to use inside the main fuction, I mean.

>What are you working on, Cred Forums?

Busy shitposting in Cred Forums on the question "do certain races get more dubs"?

pastebin.com/rVNxr3aB

>Unproductive autist tier: C, C++
How else would I do low level stuff?

Go? Forth? Rust? D? Please, spare me the hipsterism.

Answers here:

pastebin.com/mn8ks8J3

Country != Race.

Well I did say I was shitposting.

But yes, it's actually testing "country of origin, unless they are using VPNs".

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.

You can create objects wherever to fuck you want and pass a pointer to wherever you want to use it.

Those are fine for low level stuff, but low level stuff if unproductive by nature.

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

whats the big difference between java and c++?
they are both languages with similar grammar and paradigma

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.

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.

Ah, thanks.
It was the header.
Works fine now.

Why not use Postman plugin for Chrome? No captcha anything, plus remembers your requests and settings

I usually use the Postman desktop application, but I didn't have it installed on this laptop. Hurl.it was quick and dirty.

Cute.

lol, but, useless Thread import tho :(

I made another version that uses threading.
I must have accidentally put it there when I started.

Looks interesting, sauce on webm

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

Higurashi

Your loop includes the print statement "you have typed"

If you don't want that repeated, take that and print that outside the loop.

Well you're printing it in your loop, why wouldn't it show that text 5 times...

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

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

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

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

Are you calling R pleb tier?
What else would you do non-linear regression in for server-side processing on a web app?