/dpt/ - Daily Programming Thread

Old thread: What are you working on, Sup Forums?

first for python is a good beginner language

First for D

any matlab aficionados here? i'm trying to combinatorially multiply the elements of two arrays and i'm wondering if there's a nice syntax shortcut that'll do it without needing repmat bullshit.

a = [1 2 3];
b = [1 2 3 4 5]';

a = repmat(a,5,1);
b = repmat(b,1,3);

c = a .* b;

second for free monad

int main( ) {

caut > StD::EnDL;

return maybe;

}

why it no compule?!!!

Kindly do the needful and request question answer on Stack Overflow

Regards

>(![]+[])[+[]+![]+!+[]+!+[]+!+[]];
>'s'

why is javascript so retarded?

are you really asking why it's retarded, or are you asking why people tolerate its retardation?

>he hasn't seen Haskell's nuke operator
([[]]++[])!!0++[]

Which language gives me the biggest sugar high from its high amounts of syntactic sugar?

GHC/Haskell with ALL language extensions

What's the worst pajeet code you've come across, /dpt/?

public class XXXXX
{
// Some stuff from other people

public void tryThis( String s )
{
for ( int i = 0; i < numOfLetters; i++ ) // A loop to get the letters
{
if( s.equals( letters[i] )//Our letter must be equal to one of the letters
{
// I dont need to check if there are 2 of the same letter
// Because there simply arent

secretWord.length() = n;
int[] quantity = new int[n];

int a = 0;
if( a < n )// Using a loop and an array to count and store how many times a letter is used
{
quantity[a] = s;
a++;
}

updateKnownSoFar( s );

if( updateKnownSoFar(s) != true )
numOfIncorrectTries++;
}
}
}
}

Oz

>// Because there simply arent

is the IRC still active?

>camel casing

>What are you working on, Sup Forums?

Absolutely nothing.

Why are you so non-productive?
Don't you want to contribute to society?

dumb normie

t. chorecuck
enjoy your $5 monthly allowance :^)

CamelCasingIsBestCasing
as_opposed_to_this_unreadable_garbage

>Anti Pascal subhumans are so dumb that the only issue they had with that code was the CamelCase, not the unmatched braces.

do i really have to give into the java/javascript/C# meme

Do you guys ever think about the fact that programming is much more of a trade than it is a science? It has a lot more in common with, say, smithing and carpentry than it does chemistry research.

I think Computer Science majors are glorified trade apprentices.

explane

CuteSharp is not a meme tho.

but it is

it's another member of the byte-code virtual machine no-simd garbage collected bullshit

what part

Theoretical Computer Science is science / math.
Computer Science is closer to Engineering or Architecture.
Then there are various programming and web dev courses you can take at community college that are more of a trade than a science.

The entire field of computing is incredibly broad, there is certainly some "real" science in there, as well as some pajeet tier code carpentry.

At what point can i start working on GUIs in C/C++? I've been working on all the basics in both languages, with pointer logic, functions, classes, structs, unions, linked lists, binary trees, arrays, variables and data types, file manipulation, etc.

I've basically been working on binary tree problems for the past little bit and I'm a little sick of them so I started looking at the windows.h thing and messing around with that. How long do you think before I can dive into bigger / better gui tools or even opengl/gl.h and graphics programming

And why is that a bad thing?

you should start off using a framework or library before you go into windows.h

try GLFW or SFML
both of them you can use with OpenGL

That's not camelCase

You can start now or even a while ago. Keep in mind that using the winapi for GUI is incredibly tedious. You should use a GUI framework instead. The same goes for graphics programming. Unless you really want to work with the bare bones for some reason.

slow and unoptimal for anything more serious than "hello world"

every program has to have a dedicated "garbage collection" thread cleaning up a pre-allocated pool of memory rather than organizing itself and another just for the JIT compiler to switch from interpreting to running native code that only optimizes by the functions it runs the most

Seems like its a language that people use when they want to sandbox the user's environment(unity, ps vita, xna, etc)

seems like every response to managed performance fallouts is "dont worry about it" and these very same people are making "apps"

Sup lads. First GUI application. In .00001 version right now Criticize.

Does anyone do anything useful with switch statements?
char unit = 'a';
cin >> unit;
switch (unit)
{
case 'F':
cout

>muh bytecode performance
not everyone is writing vidya faggot

>how to upset an "app" programmer

no, switch statements are almost always data as code (insteaf of data as values)

>not denying being v cancer

switch (direction) {
case Up: return v2(0, 1);
case Right: return v2(1, 0);
case Down: return v2(0, -1);
case Left: return v2(-1, 0);
}

>Criticize
we can't really say much if you don't post the code

Perfect is the enemy of good.
Yeah maybe your CRUD webapp is going to generate responses in 0.002 seconds instead of 0.00002 seconds because you made it in node.js instead of assembly. Who cares?

What's the most complex program you have ever written and why would it have been too slow if it was written in C#?

Yes, it is a tradeoff. You trade a miniscule amount of performance for other benefits. Why do you have such a tough time accepting that?

Code is too large to post and not cleaned up. Have to move a lot of code to other methods.

I mean in terms of form. Pretend you are using it.

How does it feel knowing that this trainwreck will get hired over your self taught ass just because he will have a degree and you don't?

I already have a job though

but I have a degree, and I definitely didn't waste it on a throwaway major like CS

He's in his first semester and by the time he finishes school he will most likely have put in more hours programming than the average self taught programmer in these threads. The fact that he wasn't even able to locate the /dpt/ is worrying though.

I knew most of my C++ module for my first year in the first week of my first semester

>tfw you live in a poor european country
>tfw jobs here pay really, really low
>tfw jobs in USA pay more than 100K a year in your field

life is suffering

He is going for logistics

How long did it take for programming to "click" for you guys?

like a month of working on something every day

is that the entire code?
or u haven't finished
anyways
what is this monad about
im new to haskell btw

I could have passed my final year exams while I was still in high school. But so what, graduating only means you met the bare minimum requirements.

And you'll probably had much more expenses in the US. if you really want to be surrounded by amerifats, why don't you save money and buy a ticket?

it's like a restricted form of State that provides a stack

kek what you nerd

The state monad allows you to encapsulate stateful computations.
A stack can only be modified by popping or pushing.

push x is modify (x:)
> (modify tail)

he'd better hurry, the wall is coming this november

all code is data

europe isn't in south america

public class JavaIsBetterThanC++
{
public static void main(String[] args)
{
String beautiful = "java";
String wellDefened = "is";
String structured = "great";
}

}

i was referring to the wall of superheated dust slowly encompassing the globe after trump sets off the entire US nuclear stockpile under yellowstone

C is for fags.

#include
#include

typedef enum {
UsdToEur
, EurToUsd
} ConversionFactor;

int main(int argc, char** argv)
{
ConversionFactor eOpt;
float fFactor;
std::string sFrom, sTo;

std::cout fFactor;

std::cout

>public class JavaIsBetterThanC++

I don't believe this is valid

It is in Java everything is legal in Java as long it's all objects

public void main(string[] args)
{
string fuck = "D";
string your = "is";
string face = "better";
}

""

Use tags nerd

MicrosoftCasing

javaCasing

fag_casing

__ONLY_FOR_THE_ELITE__

If I have a let's say spinner in an Android activity, how do I tell a child fragment to do something when I change the currently selected item in the spinner? Sorry for asking probably a stupid and simple question, but I'm an idiot.

Any good resource that explains paging really well?

asm/c/c++ programmer here

idk what to make in C#

that's what all the jobs are like now right?

C#.
fucking C# right?

what meme do i have to give into

...

I read it as
>Any good resource that explains pegging really well?

What should I start learning if my goal for programming is to write various scrappers and bots? Python I guess, any guides on bot writing with python?

Looks interesting, I'll give it a gander
Thanks user

python is probably easiest for a beginner

though my preference would probably be Go or scala to make use of their asynchronous libraries, probably the latter in terms of working with scraping sets of data and doing transformations over it
last I checked though typesafe had memed out with sbt and it looks like you need to read a book just to get up and running with scala in the first place

Tanenbaum is the MANenbaum, even though he's a (((jew))).

I've got this one laying around somewhere.

Dont know if this is the right place to post this, but
>>>>>>>>>+[-]+]
It's a binary counter, if you watch the bits they act like a number being incremented by 1, but I had to use a bit on the far right end to be always 1, has anyone done this without using a "edge bit"?

Practically everything you said would be completely meaningless to a beginners.

Python is a horrible language if you actually want to get into programming.
If all you're going to do is simple shit like scrapers, knock yourself out.

I want to build business applications that make money. What programming language should I learn?

I'm fine with reading a few book, my end goal is to create bots for instagram, facebook and the likes.

Will scala work well for this?

Haskell

you're right on the meaningless bit

I'm a scala fanboy so yes but on second thought desu I wouldn't recommend scala as a first language to anyone

just use python or java

java

Okay which business applications in Java are most likely to make money?

>(((jew)))
Back to you dirty racemixer.
Although I don't think anyone there likes you either.

C# or Java if you want to work in an office environment and build desktop applications. Otherwise nodejs or something to make hipster webapps.

Python should be fine for that.

web business applications

It's bants, m8. I actually don't have a problem with jewish people.

I'm fine with reading a few book, my end goal is to create bots for instagram, facebook and the likes.

Will scala work well for this?

yea

What's the JS equivalent of Python's dictionaries?

Objects. Kind of.

I would like to hear a few examples of the most likely web business apps that would make money

Any business app programmers here with good business insight? Lets discuss business web apps

Arrays have (I think) roughly the same syntax as python dicts.
a = [];
a["hello"] = 5;
a["world"] = 10;

Anything that has a 3 letter acronym like CRM or CMS. It's generally boring CRUD programs to track projects, clients, billing cycles, whatever.

Those are so boring to program! No one wants to do them

I've noticed my lack of concentration has been getting worse after trying to solve code exercises.

Usually when I'm trying to solve the exercises I get so distracted because I don't quite understand it actually I should be trying to solve the exercise right know but I'm writing this.

I'll develop mental issues if I don't force myself to stay focus on this like seriously in the morning I couldn't remember if I already had used shampoo in the shower.