/dpt/ - Daily Programming Thread

What are you working on, Sup Forums?


Previous Thread:

Other urls found in this thread:

github.com/agrecascino/WAMPVoipServer
aspnetmonsters.com/2016/08/2016-08-27-httpclientwrong/
akaribbs.mooo.com/board.cgi,
facebook.com/' %name.split('_')[1]));text:FB2
akaribbs.mooo.com/
hassanolity.files.wordpress.com/2013/11/the_c_programming_language_2.pdf
twitter.com/SFWRedditVideos

Still crying over my inability to make angular work as per

What the fuck is angular?

How are you this out of touch? It's the most used front-end framework since jQuery.

So it's another Javascript meme?

This mess.
github.com/agrecascino/WAMPVoipServer
(please god help me)

If you want to look at it that way. Angular2 uses Typescript. I am not going to deny that "full-stack dev" work is generally a meme-grind, but unless you are some wizard making $150,000+ while being a dev, it's kind of silly to make fun of it.

Web devs live in their own little world of meme frameworks

I am not going to argue with that. If we take "meme" to mean "trivial tripe" here, it definitely applies. Doesn't change the fact that you need to know it to be one and grinding in C, or what have you, isn't much easier, nor is it more impressive.

Writing a thing that will save a xml file of my object. I guess it's better to:
>write a temp file of new data
>move (change name) to the original file to overwrite it.
That way if something happens when writing the file, I can check before overwriting. I'll use a database later.

>C cucks will defend this

That's the Win32 API, mate. It is well known to be ugly as fuck.

Any language that lets you do that is shit, period,.

In C#, let's say you're making a bunch of HTTP clients (and we're not using just one for reasons)
In this code
List tasks = new List();
for(...) {
HttpClient client = new HttpClient()
tasks.Add(someFunction(client));
}

someFunction(HttpClient client) {
...
client.Dispose();
}

Does the for loop produce multiple individual HttpClient objects, and would Disposing of an HttpClient affect the others?

It's beautiful and once you understand you will see

>Long pointer to input context
>long pointer to bytes
>handle private
>doubleword
>wide char

yep dumb question.
I realized once I saw the new keyword.
Still, I'm mixing up C++ and C#. RAII is getting to me. I feel like once the for loop ends, the HttpClients are kill

good op, appreciated

>I feel like once the for loop ends, the HttpClients are kill
IIRC, that happens in using statements (not the namespaces, the one that needs IDisposable interface implemented to be used.)

What's the best way to learn C for a complete noob to programming?

Doing senior project this semester and I'm going to end up doing some memeJS shit since it's all the rage.

Speaking of this particular issue, this is a good read:

aspnetmonsters.com/2016/08/2016-08-27-httpclientwrong/

>blaming C for win32

Microsoft will write ugly code in any language you give them.

>long pointer to byte
unsigned char*

Also, they're doing the thing they're not supposed to do by using an identifier that starts with an underscore and a capital letter in a documented API.

unsigned char is a byte

How to get ligatures in Vim? I have a font with them, but I can't find a package to do it.

>Microsoft will write ugly code in any language you give them.

This is true. Some of the C# examples on MSDN are atrocious.

With basic understanding from other languages, and acces to all kind of courses and a pdf, how long would it take to get good in Java?

>spent 2 hours trying to figure out basic programming exercise that's supposed to be easy
>can't figure it out
>crying while typing this


why do i have to be so stupid

i want to kill myself

Dress for an Indian summer.

You should spend time reading non-fiction books in your freetime. Stop playing video games. Start running, biking, or swimming, or all three. Fix your diet and lose excess body weight.

Read books on your course of study and take notes, try to summarize each section as you go.

You can learn user, and fix your brain, its not too late until you are old as fuck or dying/dead.

I don't know how to describe it but I don't really want anything (like some people want x job, or to go to x place, or do x thing) or enjoy anything.

Doing those things wouldn't make things any different than they are now.

You have some form of depression, maybe you should consult a doctor.

I understand having a single static HttpClient, but what if you're trying to use a bunch of proxies?

I've been having this issue where compiling with -O2 will introduce valgrind errors.

Every time I use realloc like this
str = (char *) realloc(str, strlen(str) + offset_b + 1);
I get errors like
>invalid read of size 4
>Address 0x5b2f708 is 72 bytes inside a block of size 73 alloc'd

I think the optimization is causing some parts of the function to retain the old pointer location for *str, because offset_b is only 4 bytes and valgrind claims that my program is peeking 4 bytes backwards.

If I compile with -O1 or less, it works fine, without errors.
It's producing the expected behavior either way so I don't know whether I should ignore it or not

>Her knee and shoulders are red
I absolutely hate this disgusting lighting and shading style. Skin doesn't do that. Doing that doesn't make skin look shiny or give it depth. It just looks stupid and unattractive.

I'm becoming enraged, user.

stupid frogposter

...

beta testing and tweaking UI related changes to my game's client. Mainly the battle log hud. The engine makes it hard to code huds.

any reason to learn c++ over Java in 2016? i am learning c++ atm and know a bit of java.

pointers are useless aren't they. The program should be in charge of that.

the way arrays and matrices work in c++ is fucking retarded. it should've been like in python.

0/10

>hobby programmer for 4-5 years
>get a summer job doing back end web development
>soul draining
>quit for university
>I hate programming now

What do I do, programming is the only thing I'm somewhat decent at.

debugging yet another c library I wrote. Should be the last one for my portfolio. Next step is a java class or two.

>pointers are useless aren't they
(You)

Right, and an unsigned char* is a pointer to a byte.

>Can't even write in their own language right

What's the engine?

Finished my bot for akaribbs.mooo.com/board.cgi, now all I have to do is add some commands and shit. Any advice on what else I can add?

There isn't enough information there for anyone to help you properly.
Also, it's extremely unlikely that it's a compiler bug. It's probably something in your code.

I made this and added this to my sauce tab in Sup Forums x,
Is there a better way? It works..
javascript:(window.location.assign('facebook.com/' %name.split('_')[1]));text:FB2

Darkstar, Tribes version.

Any regex senpai here?
I wanna a pattern like this "all characters until found a slash (include that slash)"
>Any advice on what else I can add?
A repository of your code.

regexr

Why can't I quote that code?
What the fuck?

It's my first bot and the code looks ugly so I am embarrassed to post.

Why are you using an ancient engine?

how come true (on the left) isn't reseting to the query symbol? ?-

It is a long term project, I've been fiddling with it for over a decade. It still gets players so I still work on it.

You should do that trick that Infinity Ward did where you update the engine so much it hardly resembles the original.

I wanna be sponfeed ;_;, I did read Mastering regex from oreilly but that was years ago.

I looked that up and it's call of duty. I've never seen a call of duty game that didn't look exactly the same as every other game in the series.

Probably because you've never played more than one.
Compare 3 to 5 to 6

Right, but Call of Duty doesn't look like Q3A, which is where the original engine came from. They're still using it today in the form of IW Engine.

>the CoD engine is based on the Q3A engine
What the fuck?
Surely at some point in time someone thought, "This is fucking stupid, why didn't we just start over from scratch?"

>"This is fucking stupid, why didn't we just start over from scratch?"

NEVER! MUH INCREMENTAL DEVELOPMENT PROCESS!

Well that's just weird.

newb here

I'm not sure what the hell this exercise wants me to do because the book never taught me how to list characters/strings alphabetically. I already had to skip an exercise because it said "spit out these strings alphabetically plus do other stuff" but how to do this was literally never explained, so I don't know what the fuck to do, and stackexchange hasn't really cleared this up for me.

I already know how to use while/for loops but I'm assuming pic related will also require me to alphabetically list a new char on each line, but what is the efficient way to do this that doesn't require me to initialize literally every letter of the alphabet?

Just finished adding post quoting and meme arrows to my C messageboard!

akaribbs.mooo.com/
Also, someone made an IRC bot and let it loose on my site.

When I was eight and I asked this question a man gave me this. It was the best thing he ever did for me. Have fun on your journey OP!

hassanolity.files.wordpress.com/2013/11/the_c_programming_language_2.pdf

Tell me what functionality to add to my bot akariadmin senpaii

Congrats, now make me a mod

>but what is the efficient way to do this that doesn't require me to initialize literally every letter of the alphabet?
Check "ascii characters"
!daddy, !mummy commands when?

Sure is. Basically, I'm saying you need to put some fancy bits n' bobs on the Darkstar engine. Some gay shaders ought to do it.

>In Haskell, an interactive program is viewed as a pure function that takes the
>current “state of the world” as its argument, and produces a modified world
>as its result, in which the modified world reflects any side effects performed
>by the program.

i am literally a god

You suck at greentext
>In Haskell, an interactive program is viewed as a pure function that takes the current “state of the world” as its argument, and produces a modified world as its result, in which the modified world reflects any side effects performed by the program.

This.

>>In Haskell, an interactive program is viewed as a pure function that takes the current “state of the world” as its argument, and produces a modified world
>passing The World around
This must be the work of an enemy stand

you'll have to do better than that mate

dumbest advice i've ever read

What did he mean by this?

t. fatty

>strecthing your browser window over multiple monitors to make this meme

t. mongoloid

:^)

>akaribbs.mooo.com/
Doesn't exist? It just times out..

>pleb

>>>/ptg/

>nv uses windows

What kind of fucked screen is this?

It's back up, i'm not sure what happened.

nah, i dont really keep up with my torrents that much. only reason i even have what.cd is cause an irl friend gave me an invite for some reason. dont care enough to get onto any other trackers or anything
yep, need it at the moment for my overwatch addiction and making vaporwave videos in after effects
it's pretty nice for programming. you can keep 3-4 files side-by-side on a single monitor and still have a ton of vertical space. although it makes me write 1000+ char lines pretty regularly too...

>although it makes me write 1000+ char lines pretty regularly too...

Programming is merely a means to an end, a tool. What is something else you like? How can you apply your programming skills to it? Some of the most fun I have had programming has involved embedded devices, largely because software is only part of the solution of a greater problem.

class a b
downcast :: b -> Maybe a
instance a

Harvard's CS50. Free, coursera. Google it. The standard has changed since K&R, they are not teaches and the book shows it. Of course if you can read from there go for it.

how do I make all the warnings go away?

>no instance (a

Hmm, if only that warning was accompanied by some sort of message that described what was triggering it.

what do I #include so that it goes away?

I told you yesterday to try the sanitisers.

CFLAGS += -Wimplicit-function-declaration

#include
#include