/dpt/ - Daily Programming Thread

Previous Thread: What are you working on, Sup Forums?

Other urls found in this thread:

microsoft.com/net/core#ubuntu
ideone.com/tMC6Dv
askubuntu.com/questions/792214/how-to-stop-net-core-from-collecting-data-to-protect-privacy
news.ycombinator.com/item?id=11988120
github.com/pauldendulk/Mapsui
testufo.com/#test=framerates
forum.dlang.org/post/[email protected]
pastebin.com/mpXh17dr
apress.com/9781484200087
twitter.com/NSFWRedditVideo

First for Java

first for endofunctors

Thank you for using a (non-trap) anime image.

A monad is just a monoid in the category of endofunctors.

>endofunctors
Well, the Monads most people talk about are specifically categorized over endofunctors on Hask.

lets say im a complete beginner learning C#, how long would it take me to learn to code something like a media player/library similar to itunes but exclusively for store/playing audio files? how much longer would it take to give it a 'polished' look like say itunes or however i imagine it to be?

...

ILLARY CLINTON FOR HOSPITAL 2016

>literally using a 30 lbs lighter body double

You could do it in a few hours. If you do it correctly with appropriate OOP meme-patterns, it will take a bit longer.

whoa i was expecting something like months but thats good to know, thanks

any standard @media max/min width for screen resolutions?

nah he's delusional maybe if you already knew C# you could get a working prototype in a few hours but not a real professional 'polished' finished product

not the same user, but.. what about a map (web/desktop/... multiplatform) app?

nth for coq

Throw some libraries at the problem and everything can be done in a few hours.

I gave ur mum the coq last nite

Currently trying to plot out a new layout for my application's options menu. Kind of tempted to steal the Visual Studio style of treeview on the left, content on the right with a search bar.

Current setup works, but it doesn't manage resizing very well so I've been getting complaints from people trying to run it on a toaster that it's too big for them to do stuff.

>but not a real professional 'polished' finished product

Did I imply that? If you want a truly polished product, it'll probably take a few months work.

A basic media player can be done within a week if you're learning to CShart in mart.

>Kind of tempted to steal the Visual Studio style of treeview on the left, content on the right with a search bar.

I always contemplate doing that, but I can never figure out a good method for actually showing the panels on the right.

ok i read his post sloppily, the polished part was a separate question, you answered the first part

My current thought is to make a series of user controls. Use the tag for each panel as the value for the selected treenode, load and dispose as necessary. It's a bit less manageable than the current form since I can't just ctrl-f whatever in a single document, but it does become easier to do the other stuff.

>I can't just ctrl-f whatever in a single document

You could have all the panels define in one document. Would sort of break the one-class-per-file """rule""", but since they're all intimately related, there's no reason not to.

Daily reminder that clay > knives
>be clay user
>try out knife
>drive knife into my chest at full speed
>it kills me
How the fuck can anyone use this unsafe piece of shit? clay doesn't have this problem.

The clay compiler is written in knife, kiddo.

Clay, if driven into the Solar Plexus at full speed, could probably kill someone as well.

enjoy your clay collector stopping you everytime you have clay you aren't using

If I like html, am I an homosexual?

yes

html is literally

That wasn't what I asked.

You know what, I was just going to let your little shit comment go, but you need to be taught a lesson boy. When I ask you a question, you better fucking answer it and you better answer it right code

I can't get my stupid code to work. I know im retarded but can't figure out what im doing wrong ffs

Maybe programming isn't for you.

INDENTATION
ASSIGNMENT OPERATOR AND EQUALITY OPERATOR ARE TWO DIFFERENT THINGS
YOU HAVE AN IF STATEMENT THAT DOES NOTHING

how does this work exactly
Prelude> [1, 10..100]
[1,10,19,28,37,46,55,64,73,82,91,100]

I know it just +10 then -1, but how does it read
enumFromThenTo 1 10 100

from 1 then 10 to 100?

>python
learn glorious java, the IDE will point out problems with sane error messages

I'm planning on writing a java program that downloads a media (jpg png webm etc) off Sup Forums with the json api.

How would I go about this? I tried using the URL class and GSON for parsing and all that, but it is much too difficult for me to get working. At times when getting the json or whatever html code of a webpage, it would not connect. Only google works and the Sup Forums json api of a thread. If I were to use an URL like youtube.com, bato.to, or even Sup Forums.org, I would be getting an error.

What language is this

looks like cancerous python 3

I agree with you dude. The problem is the ambiguity of the definition of `programming paradigm'.

To me, I just think about it as how the program is written, and not how it is run.
In this way, almost all programming is still procedural. But things like Prolog are borderline.

it says
>returns an array of members of an enumeration starting with the first argument and finishing with the third one in distances determined by the second one, it is equivalent to syntax.

so why does 1 change things? [0, 10..100] produces 0, 10, 20, ...

Wait, what?
I thought any sequence like that [x,y>x,..z] is always non-decreasing?
Why does it make an exception to reach 100 in this case?
[1,9,..100] doesn't do that, and it goes up to only 97.

Is Java good? I seem to always see people shitting on it when I come here but it seems like lots of people use it. A

>got my hot steamy debian setup just how I like
>libraries working well no issues with repositories
>got codeblocks working right because I can't live without it


Recommend me an author on C/C++ or Fortran

it's literally one of the best languages alongside C++, people only hate it because of memes and butthurt

ok pajeet

It's pretty bad, but it only gets bad when you get really good. Same with Python I think. Some languages are bad from the getgo. Some languages are okay and always remain ok, while others start off ok and after a very, very long time, become horrible.

Some languages are great and stay great for a long while. You won't be able to recognize those languages until you've learned and gotten fairly good at one of the languages that gets bad.

So learn Java, sure.

read a book, then start editing beginning from your while loop.

The algorithm at glance:

>Create a infinite loop where you read the input.
>If the input is equal to zero, break it.
>In every iteration sum up the read number, and increment the totals of inputs by 1.
>After the loop, calculate the average dividing the total sum by the number of total inputs.
>Show the result to the user.

now I somewhat get it I think
Prelude> [3, 9..100]
[3,9,15,21,27,33,39,45,51,57,63,69,75,81,87,93,99]
Prelude> [3, 6..100]
[3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57,60,63,66,69,72,75,78,81,84,87,90,93,96,99]


it looks like it just adds 3 in the second line, but actually it just adds 6 and takes 3 each time

>From my other thred

So someone just offered me a spot in his startup for a percentage of ownership. I'm a CS & Math student in college and I'm asking for advice. It would involve a streaming video component on a website as well as normal streaming. I would also need to learn HTML or CSS ASAP before he gets someone else. How feasible is this? Also the kid is trying to move pretty quickly with this but I don't think he knows how long it will realistically take. Any help appreciated.

What makes it bad though?

what is most of it? like could u give me a quick rundown of something

>follow this guide: microsoft.com/net/core#ubuntu to install the packages
>you get "This software may collect information about you and your use of the software, and send that to Microsoft." from apt-get
I just fell for the C#meme and my system joined the botnet...

Hey friends I just dropped in to tell you I am going to learn cobol starting tomorrow!

ignore this post, I misread

[x, y..z] = let diff = y - x in [x, y, y+diff, y+2*diff, y+3*diff..]

he sounds inexperienced, if he doesn't have any credentials worth mentioning just do your own startup, and HTML and CSS are easy as shit, if he can't do that himself it's a red flag

>young person
>startup
>technology
>using all of someone elses work

trash it

A confusing aspect in C.

Why can sizeof determine accurately the size of (and consequently the length of) and array of integers when the array is declared with bracket notation, but it can't do the same with a pointer declared array?

Isn't a bracket declared array essentially a pointer anyway?

Why am I obsessed with fortran and how do I convert this into employability

It hides things but lets those things affect the real program
ideone.com/tMC6Dv

Any "justification" of this is just an explanation on why it's broken.

tell him to fuck off

No. Arrays are special until you pass them as pointers to a function.
sizeof will give you the length of an array if it's an array. When you pass an array name to a function, it decays to a pointer.

Yeah honestly I could just zuckerberg him anyway. His idea has some obvious flaws and I can improve them and make a better site. I had already been thinking about a similar idea anyway. Thanks

Why use shitty languages like Java when you can use bash?
curl -s "a.4cdn.org/$1/thread/$2.json" | jq -r ".posts[] | select(.tim) | \"-O i.4cdn.org/$1/\" + (.tim | tostring) + .ext" | xargs curl

>google IDE fortran
>500$

wew, where's the free IDEs for linux with fortran parsing? is there only codeblocks?

if anyone is interested:
askubuntu.com/questions/792214/how-to-stop-net-core-from-collecting-data-to-protect-privacy

also
news.ycombinator.com/item?id=11988120

the sad part is, I still don't know how tf to use this C# library with dotnet/mono: github.com/pauldendulk/Mapsui (I'm ). could someone tell me? can I simply import then from the current directory? do I have to drop the dir somewhere?

>hurr i should have the source code to everything because i'm a greedy fuck
>durr i'm not going to give anonymous usage statistics to help improve software

ubuntu is itself a botnet

fuck you

shut the fuck up you fucking retard, stop vomiting memes and sucking corporate dick. or just kys already.

you're the memeing fuck i bet you unironically look up to rms fucking underage communist faggot

Kent Dybvig

how do I make three 33% width divs in a row that will show one after another on mobile mode with css

Thanks for your help earlier. I got my game of life to work.

flexbox?

working on a mobile that acts as a gps system using google maps api with geofencing.
though i'm lacking a few more features before i can believe it's done.
Any ideas?

just steal features from other map apps and gps devices?

here, I just finished being able to connect to the json page and create an object with it with GSON.

Now, about the API rules... what does making 1 request per second mean?

I wanna practice

On 64 bits machine:
sizeof(void *) == 8;

int a[1];
sizeof(a) == 4;

int *p = a;
sizeof(p) == 8;

void *mem = malloc(rand() % 0xFF);
sizeof(mem) == 8;

C does not and should not track allocations' size, it's your work to do that.

>wrapping around
thats cheating.

So I'm doing a little experimenting. If you go to:

testufo.com/#test=framerates

The top alien scrolls smoothly, but then at about every 1/4 screen it suffered a little kick - does any one else get this? It's like a little flicker, like the sprite stopped moving for a few frames then resumed.

Trying to solve this programmatically has lead me down an incredibly deep rabbit hole of different theory. So far the only application I've found that can consistently move something across the screen without a kick is blender with auto framerate dropping.

How should I handle edges then?

what's a good coding language for a girl to learn?
I've heard good things about Haskell

You just posted a dick

Thanks my boss saw me looking at this and gave me a promotion.

Ruby, for the simple minds. Enjoy b&

>implying you're a girl

This is pretty nifty
forum.dlang.org/post/[email protected]

I dunno why, but this:

delete [] array;
array = nullptr;

gives me a exception error, but:
array = nullptr;
delete [] array;

is fine

Arnt you supposed to delete the object then reassign the pointer to a null address?

LAC?

You aren't supposed to use new/delete at all.

So I got distracted by other things, but my VM is coming along nicely, though it's not a huge issue translating code over. Halting works, I'll get to IO tomorrow.

pastebin.com/mpXh17dr

>then reassign the pointer to a null address?
Only turds do that.

Forgot pic, though it's nothing super special

im just going by the book

Which book and for with C++ revision?

Remember, anything about Sepples without Stroustrup or Sutter on its cover is shit.

>Remember, anything about Sepples without Stroustrup or Sutter on its cover is shit.

fugg :DDDDDD
whats a sepple?

apress.com/9781484200087

should I just dump this then?

Hey Sup Forums. I started programming seriously back in May. Before that I know just a little theory and GML. I started with C# and quickly moved on to Python. Until a week ago, I had a sprawling repo of my solved challenges on Github. Now I haven't solved a challenge for nearly two weeks. I dunno why. Can somebody tell me how can I get my spark back? I kinda got bored since I didn't do anything real I guess.

Is getopt the best tool to get cli options in c++?