/dpt/ - Daily Programming Thread

What are you working on, Jow Forums?

Previous thread:

Attached: bots.jpg (960x845, 90K)

Other urls found in this thread:

pastebin.com/yTub7kX9.
twitter.com/AnonBabble

Learning python to do some scripting in Microsoft Excel

finance goblin be gone

Is there interest in a codejam? I think it's cool but I don't want to push shit if nobody's into it.

RFC

That's not a thing

Employed Haskell programmer reporting in

Attached: 1421164417027.png (714x738, 342K)

don't feel too bad, not everyone can work with idris at their job

nice

People say, "Write a web server; it'll be educational."
Well, if I look up how to write fucking webservers in 2018, then I'm just being spoonfed. Is that the educational aspect?

well you could try writing one using only manpages and RFCs for reference

Ignore the tutorials, take the RFCs and implement them.

Write a gopher server instead, it's simpler than HTTP, but you won't find a "spoonfeeding" tutorial.

You should learn to properly use tutorials. It's simple. You don't copy/paste exactly what they do. In fact, you don't even write exactly what they do. You change things, and make it your own, so it's as if you're writing something on your own, your own take on it. You try to anticipate what will occur next in the tutorial. You also write features and other code which expands on what they are doing. You try and integrate it into other code you've written.
By taking this active role, even if the tutorial is spoonfeeding, you are not letting it spoonfeed you.

Be honest with me: How many ways can I "make it my own" when it's according to a spec, like with HTTP? Seems like a pretty cut and dry thing.

Another question: Is async i/o really fucking new, or am I really fucking retarded? It seems like I've never been exposed to it. Is it really that complex, comparatively?

>tfw full-stacker
>tfw too much of a brainlet for /dpt/
>tfw too smart for /wdg/

Attached: feel.gif (500x275, 365K)

What the hell, being spoonfed is wonderful. That's the quickest way to learn. Don't get autistic about reinventing the wheel every step of the way.

Design it to be idiomatic within the language you're working with

>How many ways can I "make it my own" when it's according to a spec
Use a different language than the tutorial, do something funky with logging, I don't know man, look there are multiple web servers in existence and they are not identical. Use your noodle! It sounds like you're flailing around pulling up any excuse you can for I don't know what reason. You want us to say it's impossible?

A Python weather script. I pass it a location and it fetches the forecast from an API.

how do I code the inverse trigonometry functions withou using any library?

wrote a C# program that puts TeX into a string buffer, exports the buffer to a .tex file, then runs XeLaTeX to generate a pdf from cmd.

show your portfolio

Attached: rere.png (300x250, 38K)

Taylor expansion I guess

>tfw got my shitlib pushed to Maven Central

Now I can finally join the big boys with Github repos in their CVs.

Attached: dab frog.png (554x400, 66K)

I'm reading book about threads and it makes it sound like you can create 1000 threads if you wanted. Or did I get that wrong? I'm wondering because for example Ryzen 5 has 6 cores and 12 threads per core so 72 threads yet if I open my task manager it says 2460 threads are running. Are we taking about different threads here?

If you could only create as many threads/processes as you have cores, you couldn't get much done on any computer. One of the kernel's primary jobs is allocating CPU time to stuff that needs it

That sounds like communism. We need capitalistic kernal scheduling that allocates CPU time to process that actually turns a profit.

>you can create 1000 threads if you wanted
Yes, but it's generally not a good idea to. It's very wasteful.
>yet if I open my task manager it says 2460 threads are running. Are we taking about different threads here?
Your OS will shedule which threads get to run on the CPU at any given moment, so you can have a lot more threads/processes running than you do CPU cores.
It's more than likely that a huge number of those threads are currently blocked, waiting on something, and wouldn't take any CPU time (until something happens) anyway.

>too much of a brainlet for /dpt/
what

nervous?

>advocating Big Kernel

Am I a brainlet and have always done this wrong, but I thought it was 12 threads total? Always thought it was 2 threads per core.

A friend of mine programs in general, phone programs, websites, has to use photoshop, what kind of Keyboard do you guys think it would be useful to him?

What keyboards do you guys have that help you?

Old, dirty ones with food and cum stains.

jesus christ, why is math so fucking boring.

What is the point of an Arduino when a raspberry Pi is just as cheap?

NSLog(@"Does LosAngeles exist ? %d",[@"Newyork:Seatle:LosAngeles:WashingtonDC:" rangeOfString:@"LosAngeles"].location != NSNotFound);

Because you are retarded.

Because you're a brainlet philistine

Might be so. Have no idea either, I assumed it was per core

Webserver has an RFC?
Or are you referring to RFC 1180(TCP/IP)

No, not an array. No pointers.
I explained it. The structure is
1 bit - continue (1) / new (0)
if new, the next 7 bits are the low 7 bits of the first character [1st char = 1st byte]
if continue, the next 7 bits are an unsigned 7-bit integer, indicating the length of the common prefix [len = 1st byte - 0x80, copy len bytes of previous codepoint name]
?? bytes - text (null terminated ASCII)
1 byte - null terminator

Psuedocode, if you're still confused, is in here: pastebin.com/yTub7kX9.

The only metadata is the null terminators. Nothing more. It gets all the compression stuff while not causing any trouble. Decompress into memory, like in psuedocode

Math is not hard for me, is just fucking and utterly boring, like why do I give a fuck about it?

and I am talking about fucking trigonometry.

lol

brainlet doesn't mean you can't understand something--nothing is hard for humans to do, lol
brainlet means you don't know how to use your fucking brain

interest and attention are skills you build, not things that the world gives you

trigonometry should not be considered maths anymore if you are >25 yo.
You should be doing topology, graphs, advance calculus,quaternions at this age.

I want to learn enough math to make games, but is fucking boring and useless.

most math videos are fucking autistic garbage that they don't even care if you like the topic.

you THINKING that it is boring and useless is the only thing that leads you to conclude that it's boring and useless

use your motherfucking emotional control developed through deliberate practice to give yourself interest--you already desire it, so you're clearly interested, but you keep lying to yourself like some fucking retard

Start with vectors.
Quaternions.
Analytical Geometry.

Above three are enough for games that you want to sell to bunch of onions boys.

I dunno, I'm watching kant academia and is like watching paint dry.

not sure if the topic is boring or the guy is just as exciting as an accountant.

again, excitement is an internal function
demand change from yourself, not from your world

I just watched an unit circle of trigonometry to radian functions, and that is cool I guess but It's like wow, a circle with the conversion table between radians and degrees, how cool and exciting (not really, just a dumb circle with some numbers) and the guy spent like 15 minutes talking about it and I just don't give a fuck and I just forget all what he said like a minute later I finished that video.

It's like wow, a full circle is 2 radians and 180° are 1 radian and 90° is like 0.5 radian.

wow, so cool.

pearls for swines

Don't. Don't watch a math video.
You will kill 10 years easily without even making a tetris.
Practice-Theory-Practice is your friend.
Gamedev is tough, very tough.
Don't watch. Implement.

You sound like a retard, better give up now and save some time.

you're not grasping the point
perhaps you really are a brainlet

see ya faggot

I guess I'll read some pdf, because fuck watching 10 hours of math.

my IQ is 130.

*snap*

he sounds like he is junkie.

lol, troll confirmed
read my posts, retard--didn't say anything about iq

Objective-C
C#
Java
C++
Which is best?
Persons not having worked in all three language must not reply.

which one of those isn't a lang(uage)?

*four

No he's talking about the (many) RFCs dealing with HTTP

Because what you're referring to math is probably some pre-calc topic.

what a minute... did this brainlet really skip/flunk pre-calc. omg..!

>I am talking about fucking trigonometry.
You say this like it's some "Whoa shit th-that's advanced!!" thing.

>my IQ is 130.
Hahahahaha *snap*

>can't even read the part where I said is not hard, just extremelly boring

make a post on reddit about it

If you cant count should you really be worrying about such a thing?

Attached: image.jpg (252x198, 39K)

/dpt/ is already a subreddit.

>my IQ is 130
>math is boring
Yeah, sure

Well then jump your 130 IQ into Fourier analysis. It's similar to Taylor expansion but you decompose functions into an infinite sum of sines.
Only boring people get bored.

my IQ is a dolphin

I didn't want to include Objective-C

I want to make a DOOM clone and some mode 07 stuff, not learn college math.

>3D engine
>no maths
Lol good luck. There is a reason why gamemaker and unity games (99%) are shit.

Wow you really do sound like a genius snowflake
What a shame that those phonies are forcing you to learn math
Maybe you should drop out, you're obviously on a totally different level from them

I'm not even in college faggot.

I just said math is boring, which 99% of people say it does.

Oh Jesus he's an 18 year old who just graduated high school and has a master plan that's 100% totally gonna work to allow him to be independent while making a lot of money.

Now if he could just figure out a way to do it that doesn't involve any math...

Trig is considered highschool level by most.
>99% of people say it does
Spoken like a true follower. No wonder you have such problems challenging yourself or using the material in interesting ways.

>open C++ source file
>globals everywhere
using namespace std;
oh joy

What the fuck is Myrddin?

Uni taught me c++ using namespace what's the issue? Seriously I might be writing pajeet code and not know it

using namespace is fine outside of header files.

it gets rid of the point of namespaces in the first place. Just have a using declaration for each symbol you import, it's much easier to refactor and you also get unused import warnings.

Reading SICP on my time off.
It's a really interesting read if you had little contact with CS because your background is numerical physics. The first 120 were a breeze but some of the exercises around p180 onwards actually require me thinking.

Attached: 1530484472529.jpg (699x699, 300K)

It's fine in header files, too, as long as you don't use it in the global scope. It essentially dumps all symbols from that namespace into the current scope. If you do this in the global scope in a header file, everything that includes that file will also have all those symbols in the global namespace.

The point of namespaces is so that you can write a library without having to worry about name collisions. As someone using libraries, you can skip the namespaces without issues if you know none of the names overlap.

It's much easier to avoid collisions when you have a list of all the names you're using at the top of each source file. It's also easier when each of those imported names can be renamed with the same declaration.

You are using two libraries called Foo and Bar:

using namespace foo;
using namespace bar;

Everything works fine, you can call Blah() from Foo and Quux() from Bar without problems. But one day you upgrade to a new version of Foo 2.0, which now offers a function called Quux(). Now you've got a conflict: Both Foo 2.0 and Bar import Quux() into your global namespace. This is going to take some effort to fix, especially if the function parameters happen to match.

If you had used foo::Blah() and bar::Quux(), then the introduction of foo::Quux() would have been a non-event.

Or you could just using foo::Blah; and using bar::Quux; and have the best of both worlds.

Gitlab or Bitbucket for free private repos?

fuck namespaces

I am doing real shit organizing my growing python application. I hate what I have made and it's only 228 lines. Fucking shouldn't have tried OOP because I'm terrible at it and Python makes it worse

Also getting a strong feeling I can't fucking apply the Single Responsibility Principle

updating to iOs 11 on the new iPhone purchased via Swappa

int i = 42, *p = &i;
decltype(*p) c;//error: c is int& instead of int and must be initialized

Fuck this language

Attached: 719067254826249.jpg (1129x1200, 118K)

there's nothing wrong with goto