/dpt/ - Daily Programming Thread

Old thread: What are you working on Sup Forums?

Other urls found in this thread:

reddit.com/r/programming/comments/69necf/the_grass_is_always_greener_my_struggles_with_rust/
twitter.com/AnonBabble

r8 my game

First for Rust!

>2.5fps

Have you done your SICP today?

keep dreaming

no

Ok

What's a good IDE for python on linux?

>TWO POINT FIVE FPS

make it for ps4,you will get millions

>gcc7 is out
Why aren't you using C++17, user?

public static void procesoJuego(int matriz[][], char matrizI[][]){

String cadena = "-";
int contador = 0;
for (int x = 0; x < matriz.length; x++) {
for (int y = 0; y < matriz[0].length; y++){
int aux = (int) (Math.random() * 2);
if (aux == 1) {
if (contador >= 10){
aux = 0;
}
contador++;

}
int cordx = matriz[x].length;
int cordy = matriz[y].length;
matriz[x][y] = aux;

int aciertos = 0;



if(aciertos

Because ive moved on to better things like rust.

>Pls Sup Forums do my homework

JAVA SPICS OUUUUUUUUUUT

nevermind on the parse thing, I'm a fucking idiot

I still need to

- assign temp variables to matriz[x] and matriz[y]
- print a "decoy" matrix with all values hidden and replaced by a "-" (said matrix was declared in a previous method)
- scan the "real" matrix according to the coordinates input by the user and check if he either found a 1 or a 0 in the matrix

not actual homework, I bet a classmate I could run a functional battleships program before he could, a beer is at stake here

I don't know, even reddit posters seem to be more mature. What we have here is the sudden insurge of underage Sup Forums and Sup Forums refugee spilling all over Sup Forums. Consider this example:
Reddit:
>You're comparing a systems language to a scripting language. Things are harder in systems programming because you have more control over, in this case, the memory representation of data. This means there is more friction because you have to specify that information.

>In addition, the tasks your doing are not really comparable.

>In the Python case you:

-Open a file
-Read bytes from the file
-Parse the contents of that file (syntax errors are auto handled)
-Get a hashmap with the values in that file; type errors are NOT handled. Missing values are NOT handled. It's very memory inefficient.
-End up with a map string -> string irrespective of how you want to semantically use those values

>In the Rust case you:

-Open a file
-Read bytes from the file
-Parse the contents of that file (syntax errors are autohandled)
-Populate a packed, efficient structure in memory (type errors are autohandled; missing value errors are auto-handled, flexibly because of Option).
-You end up with a very memory-efficient, time-efficient (no hashing to get values), type-safe representation of config data.

>It takes more code in Rust because it does more, and does it more safely and faster.
>And Rust gives you a standalone executable that can be run on systems without Rust.


And here is how a Sup Forums toddler speaks:
>code is a complete joke
>b... but it's a systems programming language
>Fuck you. I know it's Leddit, but Rust hate is always appreciated.
>reddit.com/r/programming/comments/69necf/the_grass_is_always_greener_my_struggles_with_rust/

It should give you an idea how cringe inducing this place has become thanks to Sup Forums, Sup Forums and Sup Forums

SPICS OUT AND STAY OUT REEEEEEEEEEEE'

You'll have to lie better than that spic pajeet

You are wrong, that cancer came straight from plebbit. Basically that faggot is asking for some upvotes for his thread
>WAAAAAH Sup Forums upvote my reddit thread WAAAAH

It was on simulator on Intel graphics, it normally runs at 30fps but when I took the screenshot it went down to 2.5 for a moment.

On a real devices it runs at a solid 60fps all the time.

You just gave me nightmares from my compilers' class. thanks

at least help me declare the temp variables, everything else is running

;-;

T W O C L O C K S
W
O

C
L
O
C
K
S

Return to reddit if you love it so much then

>It should give you an idea how cringe inducing this place has become thanks to Sup Forums, Sup Forums

seriously though take it as a blessing, since you now know that anyone who brings up sjwfox in reference to mozilla/firefox/rust is a complete degenerate whose only interests are shilling and spreading disinformation and not having engaging discussions on topics they're passionate about

Oh the edge. How is your middle school?

>seriously though take it as a blessing,
Wrong approach

>downloaded some pluralsight course
>disabled
Well lad

c++ is nice

>Still looping
#include

int main()
{
int result[5];
for (int number_current_matches = 0, i = 1; number_current_matches < 5;
i++)
{
//printf("Matching %d\n", i);
int sum_multipliers = 0;
for (int j = 1; j

How is your down syndrome? Retard.

dumb akariposter

It's just fucking slow. But at 33e6 it will stop. Just be patient user.

What's wrong?

Kill yourself, you dumb fucking shit smear.

i love you akari poster, never stop posting.

dumb akariposter

What's an akari? Is it like an Atari?

I'm only seeing a blank image

Learning about web stuff.

>inb4 not real programming

We have a web front end system at work for carrying out tests, which is absolutely shite. So I thought I'd get some learning done on Javascript, but never done web stuff before.

But I'm confused about all the different things, HTML, CSS, Javascript, Angular?

>HTML
Yes.
>CSS
Useless for coders. Only used by designers.
>Javascript
Yes.
>Angular?
Only code monkeys who can't grasp the power of javascript praise javascript frameworks.

As i understand it:
>HTML is the container page for everything
>CSS/JS/Angular can run inside that page
>CSS does the pretty menus and shit
>Javascript is doing stuff (syntax is very C like)
>Angular is an alternative to JS?

>(syntax is very C like)
well they both are shit

angular is a js framework

No.
HTML is a language to describe simple gui/form.
CSS is something to customize the design of an html page (only used by designers).
JS is a very powerful language that can do any thing. It can manipulate the HTML, the CSS, etc.
Angular is a JS framework made by code monkeys for code monkeys, because grasping the power of javascript is to complex.

JS==javascript (i'm not sure you get that)

understand that JS is Javascript, thanks.

Could you define the term "framework" for me? It sounds like you're describing an API. So rather than have to write code that does some functionality, they can just call something in Angular framework that does that job?

>Angular is a JS framework made by code monkeys for code monkeys, because grasping the power of javascript is to complex.
t. never used a framework for its intended use
you can do without one if you use something like php (serverside rendering) but without it, managing complex state becomes a pain in the ass quickly

There is a special thread for you retards. Fuck off.

This thread is shit, right from the OP

Typical code monkey.
>managing complex state
It's fucking JS. Do you know FP?

>Could you define the term "framework" for me?
A lot of functions. Of course a framework has an API and you use it by its API.

So a math book is a "framework"?

>So a math book is a "framework"?
Technically proof = function. So yes.

>too smart for web dev
*tips fedora*

This is incredibly incorrect.

DOM is generated from HTML markup.
CSS is applied to DOM, CSS is for styling.
JavaScript is a client side scripting language used to manipulate DOM (and much more).
JavaScript is NOT C like.
Angular is a JavaScript framework. A lot of Angular applications are still built in Angular 1.x (outdated) while newer Angular applications are in Angular 2x/4.x. Angular is on it's way out and is used less and less.

We use JavaScript frameworks because manipulating DOM is slow, expensive, and unperformant in large-scale applications. Implementing a virtual DOM helps with this tremendously.

But what's playing the role of the API then?

With a library you typically build an application and call functions from the library. With a framework you put your code inside the framework, the framework calls you.

API is just the type of the functions. The theorems, without proofs.

newbie question:
i have a sorted arraylist of integers.

I want to find the mode and its frequency WITHOUT using a nested loop structure or any external data structure.

how the fuck do I do that? language is java btw.

So it's a wrapper that you put your code inside. OK.

When I said C like, I meant that loops, conditional statements, etc were written using a similar syntax

So .net ain't a Framework?

>language is java btw.
Stopped reading right there.

guys
i just changed my speciality in UNI from networking to distributed/mobile apps programming.

is this where the money at ?

Not programming related.

>going to college for a tech degree
>not just getting certs at a trade school
Yeah, the money is being the IT guy at your local McDonalds.

Count repeats, if the repeating stops then compare to the last number of repeats and take the max tard

i'm french, we don't pay for education here nigga what ? i'm studying kernel and POSIX programming too in this speciality.

Pycharm is lovely. Otherwise, vim.

>i'm french
Yes, I can tell that you're subhuman.
>we "don't pay" for education here
Obviously. That's the only way your kind could possibly study anywhere.

Threadly reminder that dlang-chan is not dead, and she's super duper cute and fast! Say something nice about her, /dpt/!

STOP

>Yes, I can tell that you're subhuman.
why did you ask me about the money then faggot
>That's the only way your kind could possibly study anywhere.

>>be american
>>go to college
>>go bankrupt

>So it's a wrapper that you put your code inside. OK.

Pretty much, say you were writing the back end for a http server using a framework, they'd have a file for you to declare all the directories of the website (Sup Forums, Sup Forums, Sup Forums, etc) and then it might automatically link this to the corresponding html files that are stored in another area designated by the framework and automatically serve these to the user when the http request comes in. Then the framework would have functions already set up to handle cookies and sessions etc.

This would be an example of a pretty heavyweight framework, but I guess a good rule of thumb is that if you aren't writing your 'main()' function or you don't know exactly where your code starts executing you're probably using a framework.

Never used .net so I wouldn't know

I am beginning to believe you are actually false-flagging

I've only ever programmed in Assembly, trying to make a simple program but having trouble finding the easiest language to use. I need to:

Display an Array\dataset as a table.
Search a specified webpage for matching text
locally append a document based on user input

I thought Javascript would be sufficient but it doesn't like reading\writing locally. It can work with the addition of JSON+Ajax but I'm trying to make the final result as universal as possible and don't want the end user to have to install anything.

Is this possible with any of the basic things people are likely to have, or is c# the only way to do this cleanly? Thanks.

inb4 i didn't read the full reply.

i can see you taking your hands away from your burger to sperg on me.

Literally any language take your pick

>why did you ask me about the money then faggot
Is the concept of anonymous imageboards new to you? Or is this just your French retardation showing?
>be american
I'm not American.
>go bankrupt
A much better alternative to c*mmunism. People who make stupid choices should go bankrupt.

There's absolutely nothing dumb about posting akarin

you seem so butthurt, please go sodomize yourself, it might ease the pain.

A fucking EMV Parser. God I hate it so much. It's a clusterfuck of design-by-committee. I don't want to continue doing it, so I procrastinate by increasing complexity of my python scripts.

I'm bored and I feel like nothing can really excite me.

Someone please suggest something interesting to build. Something that makes me go "damn that'd be cool".

a cure for hairloss.

...

Nah I created directories in the same directory using the same GetCurrentDirectory() method and it created directories fine.

I have a bunch of urls in a file I'm cUrling, is there a good way to speed it up?

make sed feed you one line at a time from your url list and then run wget and detach with the url directly instead of passing wget a file

I was using curl with -K option and create-dirs/output so it would make make file structure, wget can't do that but I could work around it I suppose. Will this actually be faster?
Perfect thing would be curl that could have a thread limit and parallel download from file.

I'm not British either. I hope being retarded works out for you, user.

This is actually really hot. Reminds me of that one h-manga where the guy cums in the zombie-girl's eye socket.

even in death, D is for language fetishists

I think I got something.
This will run your entire list at once.
Most sites will try to throttle you if they think you're being an asshole.
for i in `seq 1 $(cat url.txt | wc -l)`; do wget $(sed -n "${i}p" url.txt) &; done;

import std.stdio;

void main()
{
find_mean(2, 9.1).writeln();
}

T find_mean(T)(T x, T y)
{
return (x + y) / 2.0;
}

Works. But
import std.stdio;

void main()
{
find_mean(2, 9).writeln();
}

T find_mean(T)(T x, T y)
{
return (x + y) / 2.0;
}Doesn't.

How do I return a type that is not dependent on what the arguments were?

Bash

Sup Forums is broken, isn't it

Writing msdos programs in C++17.

E find_mean(T, E)(T x, T y)

Read Andrei's book when you get the chance

Thanks

template mode.find_mean cannot deduce function from argument types !()(
int, int), candidates are:
mode.d(8): mode.find_mean(T, E)(T x, T y)