[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

/dpt/ - Daily Programming Thread

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 325
Thread images: 39

File: 1482013529967.jpg (1MB, 3537x3335px)
1482013529967.jpg
1MB, 3537x3335px
Old thread: >>58108860

What are you working on /g/?
>>
File: andrei.jpg (18KB, 200x256px) Image search: [Google]
andrei.jpg
18KB, 200x256px
>>58113953
First for D
>>
/Java/
>>
4th for making every class a singleton
>>
What you listening to /dpt/?

https://www.youtube.com/watch?v=QIIje6g8M50
>>
>>58113998
and everything static
>>
File: at&t.png (7KB, 470x247px) Image search: [Google]
at&t.png
7KB, 470x247px
Why did somebody create an alternative syntax for x86 assembly that makes it look like m68k assembly?
>>
>>58114023
Who did?
>>
I need a new text editor. Looking at vim, neovim, and atom. Any recommendations for those or something else?
>>
Why would you make a singleton if you can only have one of something rather than just writing the equivalent inline?
>>
>>58114023
Deviating from the manufacturer specifications is stupid. Whoever would do something like that should feel stupid.
>>
I'm learning go for backend development, and I was wondering if there was an easy way to split a string in a template? If this sounds retarded please let me know.
>>
>>58114042
AT&T
>>
>>58114052
you dont use singleton. it's bad practice.
>>
>>58114095
I just want to know how anybody can possibly justify it to themselves.
>>
>>58114110
They want global variables but they want to pretend that they don't.
>>
File: jh.jpg (73KB, 775x719px) Image search: [Google]
jh.jpg
73KB, 775x719px
ELI5: What is the decorator pattern?
>>
>>58114126
>Posts frog
>ELI5
>>>/reddit/
>>
>>58114052
>inline

That's not even a certified pattern, you pleb. Come back when you're at 3 patterns per 500 LOC minimum.
>>
>>58114126
A buzzword for composition and implementing the interface of whatever you're composing with.
>>
>>58114133
who certifies patters?
>>
>>58113953
>>58114126

what does programming have to do with anime?
>>
>>58114143
They need to be published in a meme book.
Really, don't fall for the """Design pattern""" or OOP shit.
It's a terrible way to design programs.

>>58114149
(You)
>>
>>58114156
Doesn't the GoF book even say that the patterns are more for reading and communicating about code and not tools for writing it?
>>
>>58114156
so what are you proposing instead of oop? you cant make everything functional. what a clusterfuck
>>
>OOP shit
what a retard
>>
File: dff.jpg (35KB, 837x736px) Image search: [Google]
dff.jpg
35KB, 837x736px
>>58114134
Sorry, I don't know what an interface is. I only program in JavaScript.
>>
>>58114172
Procedural programming, taking opportunities to write pure functions when you can.

>>58114171
"""Design patterns""" are really just a way to get over the shortcoming in Java.
They're stupidly overcomplicated and overengineered for what they try to solve.
>>
>>58114172
Basically, like >>58114197 says. Functional is a refinement/spin on procedural so you can "mix" them as much as you want really.
>>
>>58114197
>"""Design patterns""" are really just a way to get over the shortcoming in programmers.
fixed that for you
>>
Javafag is here.
>>
>>58114049
Eclipse you gaylord
>>
File: 1461737108240.png (860KB, 841x720px) Image search: [Google]
1461737108240.png
860KB, 841x720px
>>58114230
>Eclipse
Jesus christ, get a load of this faggot.
>>
>>58114230
He wants a text editor, not a garbage IDE
>>
>>58113953
learning C
the first exercise where you're not given an example code and you have to write it all yourself
immediately forgot everything i've tried to memorize up to this point

"write a program that uses one printf() call to print your first name and last name on one line, uses a second printf() call to print your first and last names on two separate lines, and uses a pair of printf() calls to print your first and last names on one line. the output should look like this (but using your name):


firstname lastname

firstname

lastname

firstname lastname"

I can of course repeat the same thing that's been in every example practice up to this point, but I just feel stupid that I can't plug it into this new example like I really learned it. am I on the right path? This is my first time using [code /code] so i hope I don't mess it up

#include stdio<h>

int main(void)

{

char firstname[20];
char lastname[20];

printf("%firstname, %lastname\n" firstname, lastname);

printf("%firstname\n" firstname);
printf("%lastname\n" lastname);

}
>>
>>58114197
>>58114210
>Procedural programming
isn't that obvious? everyone should see that when he thinks for 5 minutes about his code
>>
>start learning
>starting to understand things
>stop trying because i dont know what to do with my understanding of the language

i literally need homework and project based shit to teach me. I have no imagination and everyone just says "build something."

nigga if i could just "build something" id build a tree so i can hang myself from this shit
>>
>>58114049
emacs
>>58114230
eclipse isn't a fucking text editor
>>
File: anyproblems.png (102KB, 1035x1226px) Image search: [Google]
anyproblems.png
102KB, 1035x1226px
I have to re-instantiate this class every 30 seconds or so.

I have decided to move a lot of the instantiation in pic related to another class, and have that class only be called when the program is started.

Does anyone see a problem in this?
I am new to Java, and don't know if I am overlooking anything.
>>
Imagine being so much of hipster that you think using tried and tested design patterns to organise your code is a bad thing.
>>
>>58114190
An interface is basically just a type, tbqhwyl. Though interfaces (again, types) in OOP languages typically can't include fields due to dynamic dispatch.
>>
>>58114268
>tried and tested
Nice meme. Is there any concrete evidence that they work or just empty promises and following the leader?
>>
>>58114255
>#include stdio<h>
#include <stdio.h>
>char firstname[20];
>char lastname[20];
You want to initialise them with something.
char firstname[20] = "Christopher";
char lastname[20] = "Poole";


In terms of the printf calls, you're on the right track.
>>
More of a /sqt/ but how do I make a JavaFX that copies text from one field to another?
>>
>>58114049
VS Code
>>
>>58114259
So you need project ideas?
Make a game. Pong. Text adventure. Whatever.
>>
>>58114297
(You)
>>
File: 1458001190381.png (100KB, 250x241px) Image search: [Google]
1458001190381.png
100KB, 250x241px
>#include stdio<h>
>>
>>58114049
Emacs.
Neovim is OK if you are comfortable with using that control scheme
Vim is pretty old and doesn't have the modularity of addons that Neovim does (although Emacs completely destroys here)
Atom has the plugin architecture like Emacs, but it is pretty bloated (can't run through SSH is a deal breaker for me).
>>
File: 1480978097736.jpg (96KB, 500x473px) Image search: [Google]
1480978097736.jpg
96KB, 500x473px
>>58114266
>something with game
>called every 30 seconds
>a whole tsunamis of new
friendo...
>>
>>58114268
>tried and tested
"""Design patterns""" and OOPs are literally the definition of cargo cult programming.
>>
>>58114080
You mean split a string inside your template markup?
>>
>>58114309
It's called per new level of my game, but the first few levels are only a few seconds long. So the 1 second of loading is too much.

I will post the class it once it is fixed
>>
>>58114266
Why are Javatards so shit at programming?
>>
>>58114301
>he doesn't use VSC instead of shitty gentoo editors
>>
>>58114334
re-use your shit. only ever call new if there is no way around it.
>>
best language for a beginner?

tried Python 2.7 and 3. People tell me not to use either of them. Hate installing shit too.
>>
>>58114259
Try implementing Conway's Game of Life in more than three dimensions (changing the rules to account for added space) and make a detector for new shapes. Compile these shapes, study them a bit, and post about it on here.

It is a project I always wanted to do, but I'm preoccupied with other projects at the moment. If you make a git repo, I would totally help with some of the work.
>>
>>58114338
they are the only one actually doing something beyond fizzbuzzing
>>
>>58114338
Because I'm new and self taught ):

Learning on a need to know basis. Currently I have lag, so I am fixing it, and then in the future I won't make the same mistake.

>>58114356
Will do senpai
>>
>gentoo editors
what did he mean by this
>>
>>58114363
I hope you are using libgdx
>>
>>58114367
what did you mean by this
>>
>>58114357
C
>>
>>58114357
x86 assembly
get the basics down first then move onto C or lisp
>>
>>58114372
its best practice to use libgdx if you want to make games for android?
>>
>>58114367
Who are you quoting?
>>
>>58114372
>I hope you are using libgdx
i am indeed

wewlad
>>
>>58114409
you are from norway, aren't you?
>>
What's the easiest way to forward ports through UPnP?
>>
@58114406
see
@58114339
>>
>>58114392
what else do you want to use? java needs some serious work done to make it useful for real time applications. *cough garbage collector cough*

>>58114409
https://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/utils/Pools.html
>>
File: isthisokay.png (12KB, 816x188px) Image search: [Google]
isthisokay.png
12KB, 816x188px
So I'm moving all of my instantiation to another class which will only be called once.

I am adding a bunch of this.thing = inst.thing;
Is this okay? I will have a list of maybe 20 items long

>>58114423
England
>>
>>58114390
is this a troll
>>
>>58114357
Racket
>>
>>58114428
With the router interface?

Somebody has to have their ports forwarded, whether it's a master server for hole-punching or at least one client in the network.
>>
>>58114557
Should i explore the deepest corners of Racket?
>>
File: ex1.png (9KB, 668x331px) Image search: [Google]
ex1.png
9KB, 668x331px
>>58114294
thanks, it turns out I was making it more complicated than it had to be. I didn't have to write something to call a char and insert it, I just had to have it printf names the way it wanted using \n
I mean I still didn't get it to work right with the "char name = name" things, but hopefully once I learn more I can rewrite it like that and have it work
>>
>failed math in highschool
where do i start if im bad at math

i always wanted to create software. yes videogames played a huge roll in it but i never went around telling people i want to make videogames.

hell making videogames would just be a bonus.
>>
>>58114597
from the beginning
>>
>>58114563
Through a program's interface (C++). What packets need to be sent to add a forwarding rule?
>>
>>58114610
You can't, unless the machine's (the one the program is running on) router has an API or something.
>>
>>58114597
You should have a solid understanding of algebra and discrete mathematics.
If you want to get into graphics (needed for games), you need to know linear algebra.
Calculus can be useful sometimes, but is not needed in general.

There are other branches of mathematics needed for niche areas of programming, but don't worry about it, unless you are looking to get into those niche areas.
>>
Is there some way to interact with javascript on a webpage without actually rendering a browser or anything?

I'm trying to build a web scraping tool but the bits I want to scrape are now behind a javascript click action. If I can somehow interact with the page to activate that, then scrap the resulting html, I'd be set.
>>
Can a const qualified variable in C be changed at all after it has its initial value?
Like can hardware change the value it already has?.
>>
>>58114710
No, most compilers change const to a constant at runtime and optimize the variable away (like a macro but with type checking)
>>
>>58114582
Just a word of advice: C is not a language that should be learned in an ide. Install MinGW/GCC and use the text editor of your choosing (Notepad++ is good) to write your code.


Working with a compiler will help you greatly.
>>
whelp, currently I have 0 experience in programming, and am currently deciding if I want to read Kochan's Programming in C (third edition) or Kernighan and Ritchie's The C Programming Language (ANSI C) (Second Edition)

which would you go with, /g/?
>>
>>58114750
The C Programming Language (ANSI). The best way to learn a language is by learning from the people that created it.
>>
>>58114750
You can learn C online in two weeks without either of those books. C++ is what you really need some resources for (at least if you want to learn it all).
>>
>>58114597
read this
http://www.r-5.org/files/books/computers/algo-list/game-development/James_Van_Verth_Lars_Bishop-Essential_Mathematics-EN.pdf

afterwards work through cormen and you are good to go
>>
>>58114710
>Can a const qualified variable in C be changed at all after it has its initial value?
It depends.
You can have a pointer to a const object that COULD change.
int my_fn(const int *a, int *b)
{
*b = 10;
return *a == 10;
}

and is called with
int a = 0;
my_fn(&a, &a);

But if you just have some non-pointer variable you made const, no.

>Like can hardware change the value it already has?
What you're describing is a 'volatile' variable. Yes, a 'volatile const' variable can change.
volatile const int *some_address = (int *)0xDEADBEEF;
>>
>>58114762
This mentality is what creates bad programmers. Learning the syntax is VERY different from learning the language.
>>
>>58114747
really? the couple books I've been reading suggested an ide. I've got dev-c++ but I will go install those and try them out.
already have notepad++ but haven't actually used it yet
thanks again
>>
slime like repl with scala in emacs possible? Yes/No?
>>
>>58114764
it doesn't sound like he's going to take to clrs
>>
>>58114760
>>58114750
K&R is not a book catered towards beginners.
It glosses over programming fundamentals very quickly.
>>
>>58114778

IDEs often hide the compilation process from you, and as a result, any time you need to do anything remotely interesting, you're going to become incredibly confused. Same if you have to switch into a different IDE.
>>
"Optimize" is a buzzword, if we don't use as much resources as we can there will never be hardware progress!
>>
>>58114817
>IDEs are good for beginners
IDEs are terrible for beginners.
They train people to become reliant on a single set of tools.
>>
>>58114825
based web developer
>>
>>58114829
https://www.youtube.com/watch?v=GIl_BNIJcFg
>>
>>58114817
>>58114829
Started a couple days ago with C and that's all I know, besides a tiny bit of html from Neopets days over a decade ago
people learned this shit 40 years ago without them, I should be able to also. if an IDE is the easy way then I'll do it the harder way
>>
>>58114861
>controlled opposition
>>
>>58114865
Calling a compiler directly is not hard, and is something that every programmer needs to know how to do.
>>
>>58114778

Like >>58114829 said. IDEs should never be used for compiled languages imo. They hide too much from the user, and C is very intimate with the inner workings of your computer.
>>
>>58114875
>he didnt use filters and supermale vitality and is now controlled by the jews
Im sorry for you
>>
>>58114865
Once you get MinGW installed, it’s a piece of cake. Just use cd to navigate into your directory and use
 gcc myprogram.c 
to compile.
>>
>>58114825

>there will never be hardware progress
CPU makers will continue to advance whether or not we make decently optimized software. There will always be a need for faster hardware in certain research areas, where the problem is NP complete anyways.

But if we don't pay the fuck attention to optimization, new gains in CPU speed will basically be useless.
>>
Does this data format look familiar to anyone? I rolled my own parser but occasionally run into unusual cases that do weird things, and I'm not sure what they're supposed to mean. Wondering if there's an implementation already I can use, or at least a spec somewhere.

[type=EVT, evt=[COMPOUND:targetOid=16916, sourceOid=-1, [ELADD:targetOid=16916, sourceOid=-1, name=occupantLocs, entry=[bodyOid=85765, loc=[x=1602, y=1202, orient=N]]], [ELADD:targetOid=16916, sourceOid=-1, name=occupantInfo, entry=[charPrint=(16974853, 51642883, 224, 65, 72, 196995, 33816728, 95, 91, 219414733, 67371221, 0, 0), activity=-1, role=0, flags=20, curses=0, species=0, bodyOid=85765, username=Anci, status=0]

[type=EVT, evt=[MSG:targetOid=85064, sourceOid=-1, name=crowd.chat, args=(data.SystemMessage[attentionLevel=0, message=m.high_payoff|%roister.tourney:m.list_name\!~Anemoi|%client.rating:m.drink|~11,111|~48|~0|~, bundle=roister.tourney, localtype=null, timestamp=0])]]

[type=EVT, evt=[MSG:targetOid=16916, sourceOid=-1, name=crowd.chat, args=(data.UserMessage[speaker=Meeseeks, mode=0, message=buying senpaitachi, pets and sloops, bundle=null, localtype=null, timestamp=0])]]
>>
>>58114825
t. pajeet
>>
>>58114825
t. PHP Pajeet
>>
>>58114333
Yeah, I'm passing an array of os.fileinfo structs to my template and I wanted to print out the filenames in my markup without the file extensions, but it doesn't seem like there's an easy way in the template markup stuff. I was hoping that go's printf was as flexible as C's but that doesn't seem to be the case. I saw this:
http://stackoverflow.com/questions/19771787/golang-how-to-split-string-in-template
but that seems pretty unwieldy
I've decided just to create an array of strings manipulated the way I want from the array of fileinfo structs instead and pass that through to my template
>>
>>58114937
>>58114961
t. Rajesh Kumar
>>
how do i do the needful

pls
>>
Currently know C and Java, want to learn something new/unique or at least fun to make projects with. Thinking about Python since there's so many libraries and API's. Thoughts?
>>
>>58114695
Have you considered interpreting the JS yourself? If it's something simple (e.g. I've done this to deal with a site that used a math expression to decode content urls), you can write a short evaluation function -- just enough to produce the url yourself.

The other two idea I can think of are using a JS library to run the script for you, or using a browser test framework to automate this. The best approach depends on the details of what you're doing, really.
>>
>>58114824
>his IDE doesn't support the importation of project files from other common IDEs
>>
>>58114979
If I wanted my own comeback I would have licked it out of your mum.
>>
>>58114993
Tools for the job, not job for the tools. Come up with a project idea before you decide what to learn. Of course, if looking at the tools gives you an idea, go for it.
>>
>>58114988
you can do this easy in python. just
import needful

Or if you have C++ and Boost
#include "boost/needful"
>>
>>58114993
Honestly, if you already know C/Java, the only reason to learn python is for the libraries and iot shit. Other than that, it’s just a step backwards.
>>
File: ss-2016-12-22-031006.png (36KB, 489x503px) Image search: [Google]
ss-2016-12-22-031006.png
36KB, 489x503px
Writing a small library that reads from config files but I'm unsure what's the best way of handling default values (can't trust that the user's file has correct types for values).

Which of these two methods would you choose, or would you do it differently?
>>
>>58113953
>Eva
Shit taste desu
>>
>>58115035
This is silly. If you just want to write a quick and simple script you'd be an idiot to use C over Python.
>>
>>58114969
To be honest the STL templating is quite limited and far from fast, due to reflection. I'd recommend https://github.com/valyala/quicktemplate , which is much more functional and faster. You could then embed arbitrary Go code inside the template as simply as
{%s stripsExtension(file) %}
>>
>>58114993
CuteSharp.
>>
What's a good/the best IDE and compiler for C/C++ in Linux?
>>
>>58115088
vim and clang
>>
>>58115088
I used Codeblocks but it felt pretty janky so I switched to QtCreator. As for the compiler, just use GCC.
>>
>>58115088
>best IDE
None. Use the terminal
>>58115088
>compiler for C/C++
gcc / g++ / clang
>>
File: CppLogo.png (33KB, 600x400px) Image search: [Google]
CppLogo.png
33KB, 600x400px
Just screwing around with some C++, and it occurs to me that C++ template syntax is really clumsy and ugly. For example, I was writing a ring buffer:

template <typename T>
class RingBuffer
{
public:
RingBuffer(size_t size) : _buffer(size), _size(size) {};

bool IsEmpty() const;
bool IsFull() const;

void Write(const T& value);
T Read();

size_t Size() const;
size_t Count() const;

protected:
std::vector<T> _buffer;
size_t _head = 0, _count = 0, _size = 0;
};

template<typename T>
bool RingBuffer<T>::IsEmpty() const
{
return (_count == 0);
}

template<typename T>
bool RingBuffer<T>::IsFull() const
{
return (_count == _size);
}

template<typename T>
void RingBuffer<T>::Write(const T& value)
{
_buffer[(_head + _count) % _size] = value;

if (IsFull())
{
_head += 1;
}
else
{
_count += 1;
}
}

template<typename T>
T RingBuffer<T>::Read()
{
if (IsEmpty())
return T();

size_t old_head = _head;
_head = (_head + 1) % _size;
_count -= 1;

return _buffer[old_head];
}


(to be continued)
>>
>>58115088
QtCreator for IDE even if you're not using Qt framework, gcc or whatever for compiler.
>>
>>58115120
>Just screwing around with some C++, and it occurs to me that C++ template syntax is really clumsy and ugly.
Compared to what language? Other than D, no language offers what C++'s templates do.
>>
How do I git gud at the linear algebra behind 3D graphics?

I'm semi-competent at linear algebra (took it in university, but we weren't taught when to use methods we learned) but like, are there some tools I can use to make designing transformation matrices easier?

It takes way too long to figure out exactly how a projection matrix will behave, better visualisation would help.
>>
File: CppLogo2.png (19KB, 299x264px) Image search: [Google]
CppLogo2.png
19KB, 299x264px
>>58115120

(continuing)

All that "template<typename T>" is really annoying and distracting. Why isn't there some sort of "template block" syntax like this?

template<typename T>
{
bool RingBuffer<T>::IsEmpty() const
{
return (_count == 0);
}

bool RingBuffer<T>::IsFull() const
{
return (_count == _size);
}

void RingBuffer<T>::Write(const T& value)
{
_buffer[(_head + _count) % _size] = value;

if (IsFull())
{
_head += 1;
}
else
{
_count += 1;
}
}

T RingBuffer<T>::Read()
{
if (IsEmpty())
return T();

size_t old_head = _head;
_head = (_head + 1) % _size;
_count -= 1;

return _buffer[old_head];
}
};
>>
>>58115078
I know, that’s what I meant by the libraries. It’s hard to write a script for something without effective libraries to do so.
>>
>>58115150
I agree that the template <typename T> stuff can be irritating, but you can always define your member functions immediately rather than define them separately.
>>
>>58115088
Pelles C through wine
>>
>>58115052
I would prefer to know explicitly if the requested value was not found with the right type.
>>
>>58115166

I like to keep my class declaration separate from my definition, but then again, AFAIK it's still the case that if you're doing template metaprogramming you basically have to put it all in the header file anyway...

I dunn, it just seems so obvious, I can't imagine why it's not part of the language. I think it would reduce a lot of visual clutter.
>>
>>58114000
Hey this was pretty interesting. Is the uploader the artist?
>>
>>58115176
That's literally the stupidest answer to any question that I have ever heard.
>>
>>58115088
IDE: don’t use one

Compiler: GCC

Text Editor: VIM/Sublime/Gedit
>>
>>58115150
i separate the template declaration into an .hpp file, the definitions into an .ipp file which is included by the .hpp file.
and then use a macro for the ugly repetitive template stuff in the .ipp file.

modules cant come soon enough
>>
@58115188
thanks for the (You)

I wont spend it all in one place
>>
>>58114172
I recently got certified in Java (OCA and OCP), it made me go from hating java and thinking OOP is bad, to despising java with all of my being, and realising that OOP is never a good idea under any circumstance. Its solutions to problems are either better solved in other ways, or completely misguided and only serve to make things worse. It's not a case of the right tool for the right job, there is no right job for OOP.

Inheritance sucks, use composition instead. Look up the "decorator design pattern" if you don't know how to do that for data. It should be obvious how to compose methods/functions. You don't need inheritance for polymorphism either, you can do it with things similar to interfaces.

What problem does coupling methods with data solve?

What problem does encapsulation solve? It's superficial, you haven't gotten rid of state, you still have getters and setters. How do you deal with cross cutting concerns that don't fall into an inheritance structure (which is most things you end up dealing with)?

Even Oracle realise OOP is shit, all their new APIs have immutable classes to represent data, and separate classes with static methods to operate on that data. Look at NIO.2, the newish IO API. Look at what's new in Java 8: Streams, Lambdas, Method References... that's functional programming through and through.

The JVM itself is pretty cool though.
>>
>>58115088
If you are committed to using an IDE, I recommend CLion. But you will maximise your productivity if you use the terminal. Linux's greatest strength is the suite of command-line tools you can use to assist your development. Having a terminal-based workflow makes it painless to switch from text editor to gdb to you build directory to perf to valgrind to ... etc.
>>
>>58115221

On second thought, given that C++ parsing is kind of a clusterfuck anyway, I don't know why we even need the "template" keyword anyway.

bool MyClass::SomeFunc<typename T>(int whatever) { /* ... */ }
>>
>>58113953
I made a webscrapper in python on freelance and earned my first 100 dollars! :3

I'm not a job virgin anymore!
>>
>>58115232
>What problem does coupling methods with data solve?
Maintaining invariants. Though this is solved a hell of a lot better with more powerful types (dependent, substructural, etc.)
>>
File: 1468093100169.png (491KB, 565x481px) Image search: [Google]
1468093100169.png
491KB, 565x481px
>Ubuntu has encountered an error, 0 disk space remaining.
What the fuck node.js!?
btw I'm using virtualbox
>>
>>58115080
thanks anon, I'll look into it
>>
>>58113953
So i have to use a library for some reasons, the doc tells me to include the .h and link the .c when i compile. But nothing stops me from including the .c too.

What's the difference ? What's the downside of including a library like any of my other source files ?
>>
>>58115232
but you cant build nice vertical structures without inheritance. decorators have their place but I can think of various usecases where they would actually turn everything into clusterfuck. like when you actually want and need a clear hierarchy.
>>
>>58115221
oh and i also stick all the helper functions/classes/enums/whatever,
tests that are header friendly, and whatever else the user doesnt need to see
into the ipp file as well.
>>
>>58115315
Nice one senpai
>>
>>58115245
How would you go about setting up the compiler to use in the terminal?
>>
File: mingw and notepadplusplus.png (15KB, 668x331px) Image search: [Google]
mingw and notepadplusplus.png
15KB, 668x331px
>>58114920
Getting it set up was more complicated than writing the code, but I finally got it working, thanks. I don't mind doing extra steps, I want to learn about computers and heard C was the way to go
>>
>>58115351
Just type in the command. Google it.
>>
>>58115323
left-pad syndrome. Most web devs would rather import 3 libraries than write 10 lines of code. They don't want to program. They want to put together lego. The same applies to the dependencies they import recursively.
>>
>>58115315
>I made a webscrapper in python

to do what?
>>
>>58115342
>like when you actually want and need a clear hierarchy.
Which is when exactly?
>>
>>58115180
That does make sense. The override function in method 1 could also return an int pointing to the first invalid line, but getting more than one would be a pain.

The only problem with method 2 is that he default values would have to be in the code, which makes changing them later on harder
>>
File: 1482355624716.jpg (19KB, 362x259px) Image search: [Google]
1482355624716.jpg
19KB, 362x259px
>>58115367
>that fucking screenshot
are you 6 years old?
>>
>>58115385
Is ruby on rails worse than this? Last time I used rails it was on my mac and I never encountered disk space issues. Realizing how node and specifically express has a 4d multidimensional maze of modules is a real turn off.
>>
>>58115443
>which makes changing them later on harder
That's a problem for the user, not the library. And it's solved by not having magic numbers.
>>
>>58115447
why, you interested?
>>
how do i grab some images from a different network drive? i'm using IIS. the tut i followed showed me how to change the drive completely. I just want access to another one.
>>
>>58115322
I suppose you can do that, but it's only really a problem when you've got so much mutable state everywhere. I suppose there aren't many other ways of saying this data can ONLY be manipulated by these methods. Can you come up with an example to illustrate where you might want to do this? I think you can do what you're describing by not exporting type constructors on a package level, and only exporting the type itself and the functions you want to be able to operate on it.

>>58115342
Interfaces? A proper type system? There's no reason you can't have a vertical hierarchy of types.
Can you give an example?
>>
>>58115448
Less so, but basically web scripting languages and their platforms are all a pile of dung. The ones somewhat decent are Go and C# + TypeScript for client code.
>>
>>58115447
>that shitpost

Are you mentally retarded?
>>
File: albalick.gif (2MB, 451x244px) Image search: [Google]
albalick.gif
2MB, 451x244px
If I have a DLL that I want to decompile, how do I figure out what language it is in?
>>
>>58115367
Great, you're on the right path!

As a shortcut, you can use ./a after compiling to run the executable.
>>
>>58115426
you have a class with functions A, B and C. B doesnt work without A, C not without B.

put everything in one class? giant ass clusterfuck and mixed up functionality.

use decorators or interfaces or whatever? no clear hierarchy is given. might work but it doesnt reflect the vertical nature of the whole thing. furthermore with inheritance the hierarchy is immutable and no decorators can be removed or added and fuck everything up by some pajeet.

>>58115485
I only hear clusterfuck and spaghetti code .
>>
I want to install software on windows, but i'm afraid it will mess with other files.

can i install this in a separate environment / sandbox?
>>
>>58115549
>clusterfuck and spaghetti code
OOP in a nutshell
>>
>>58115604
>tfw OOP backwards
>>
>>58115408
Scraping phone numbers for someone that most likely want to advertise the shit out of their brain
>>
>>58115623
is webscrapping in python difficult?

how long have you been programming to do that kind of freelance work?
>>
File: 1476554983259.jpg (22KB, 440x460px) Image search: [Google]
1476554983259.jpg
22KB, 440x460px
>>58115604
>be shitty programmer
>create oop spaghetti code and clusterfucks
>haha that must be the problem of oop
>>
>>58115539
If the symbols are a clusterfuck of nonsense, it's probably C++.
If the symbols are "normal", it's probably C.
>>
>>58115643
It's dick easy. Install requests and beautifulsoup and you're practically good to go.
>>
>>58115385

If it was only 10 lines of code, I would not use a library. I'd either write the function myself (if it was trivial), or copy paste it from the library and add a comment to denote where it was from. Managing dependencies is annoying.

>>58115448

While I know nothing of Rails, Ruby on its own is pretty powerful before pulling in a bunch of gems. I don't know of any gems that only export one or two functions, as there is in Node.

>>58115539

Unless it was compiled with debugging information, you can't really tell what language it is written in. Although you can tell if it was targeted towards native code or CIL.
>>
>>58115645
Are you implying stupid people can code?
>>
>>58115650

Rust uses the same name mangling as C++, IIRC.
>>
>>58115685
yes i'm talking about you.
>>
>>58115685
look for people who use patterns
>>
>>58113953
why is shinji dressed like that?
>>
>>58115691
Note how I said "probably". Unmangled symbols could come from Fortran or handwritten assembly, for all I know.
>>
>>58115685
Are you implying they can't?
>>
>tfw made a pull request to a dead repo (hasn't been update in 2 years, its just a script) and it still not merged
>>
>>58115656
>>58115643
Can confirm, it's actually retarded and now I feel less worthy than a pajeet :(

But got enough money to buy a nintendo 2DS! Sweet!
>>
>>58115735
>try to contribute to a major project
>it's like talking to a wall
>no one cares or even answers a fucking question
why bother?
>>
>>58115549
SHIT:
public class A {
public void a() {
System.out.println("JAVA");
}
}
public class B extends A {
public void b() {
this.a();
System.out.println("IS");
}
}
public class C extends B {
public void c() {
this.b();
System.out.println("SHIT");
}
}
Slightly better:

public class A {
public void a() {
System.out.println("JAVA");
}
}
public class B {
private A aObj = new A();
public void b() {
aObj.a();
System.out.println("IS");
}
}
public class C {
private B bObj = new B();
public void c() {
bObj.b();
System.out.println("SHIT");
}
}


If your code heavily relies on designing things this way you should kill yourself though.
>>
>>58115602
VM
>>
>>58115773
only works on windows, though
>>
>>58115794
Then make a windows VM.
>>
>>58115746
can you post the code?

i wanna learn too :(
>>
>>58115770
>Slightly better:
this gave me aids if that is your idea of better.
>>
>>58115814
Just install the libraries and try them out yourself. Good + the official docs are your friends. There's a web-scraping with Python book that I used to help me with a project, you could look into getting that.
>>
File: httpservletrequest.png (183KB, 566x323px) Image search: [Google]
httpservletrequest.png
183KB, 566x323px
>>58115645
The Java API itself is a shitty clusterfuck. Are you saying Java's designers can't even get OOP right?
>>
>>58115878
>Good +
Mean to say Google
>>
>>58115887
no one uses google+ m8
>>
>>58115825
It gave you aids because it's in Java. A language that actively fights you if you try and do things the better way, and makes it easy to do things the wrong way, and find out a few months down the line you're going to need to refactor it, or just deal with the pain. There's a reason Java devs love refactoring tools and need IDEs.
>>
>>58115645
>use OOP language
>create nice code
>turns out you're not actually really using OOP, just a coincidence right?
>>
>>58115906
>Be Java language designer
>Want to replace the shitty IO library with something better
>Create something half decent with immutable objects and a library of static methods, making liberal use of lambdas and purity where possible
>OOP is great!
>>
>>58115880
I agree and you will never see me defending the standard api. using it gives me cancer. anyhow, I only use libgdx and that's java done right in my eyes, even if there are some strange design choices and the ignorant breaking of the functional paradigm all over the place really rustle my jimmies.

>>58115906
I maybe used "real" oop in my first 3 months of coding. I always go for as functional as possible. so I wouldnt know.

>>58115904
I think your judgement is clouded by the hate for java, which is understandable if you only ever used the standard api and various cancerous spawns of it like swt, swing and what not.
>>
>>58115814
Here is it
https://gist.github.com/anonymous/55762d5c0b261c1044ecfffbc42a7ac7

It's also a reusable generic scrapper
>>
File: 2837iewyd.jpg (1MB, 3765x2281px) Image search: [Google]
2837iewyd.jpg
1MB, 3765x2281px
>>58115999
thanks!
>>
File: 1427663159699.gif (264KB, 148x111px) Image search: [Google]
1427663159699.gif
264KB, 148x111px
>mfw UTF-16
>>
>>58114129
why so anti-frog bro, nothing wrong with a fitting pepe
>>
>>58115980
The second implementation gives you greater control. You can choose to expose only certain functions, you can delegate to multiple different objects, and build up a more complex structure from individual pieces. In reality you might have lots of functionality in A, B, and C, and not want to explicitly rexpose it all if it's the same thing so you could just have a getA() method inside B, etc. It's obviously not the way Java was intended to be used, so sure, it looks weird and there's nothing in Java to help you do it that way. I used Java full time at work for the best part of a year, and now I'm using Javascript inside some framework that makes everything OOP, and it's just as awful. I don't use OOP languages outside of work, and I never find myself wishing I had inheritance. Most problems don't map onto the contrived cat extends mammal extends animal model, and those that could are usually solved simpler and neater using things other than inheritance.
>>
how do I know if I know a language and can put it on my resume
>>
>>58116090
UTF-16 was a mistake.
I can't take anything that uses it seriously.

>>58116096
Frogposters are the most cancerous posters on here.
Everything they say is fucking retarded, and there is a 100% chance that they wandered here from reddit or facebook.
>>
>>58116118
when you can fizzbuzz
>>
File: 1438705884864.jpg (861KB, 2448x2448px) Image search: [Google]
1438705884864.jpg
861KB, 2448x2448px
>>58116096
die
>>
>>58116118
if it starts with a vogal, don't put it
>>
>>58116126
but i can fizzbuzz in any language
>>
File: glenda_space_medium.jpg (13KB, 239x276px) Image search: [Google]
glenda_space_medium.jpg
13KB, 239x276px
bunnies not frogs
>>
>>58116090
>>58116119
Where is UTF-16 even used and what's the point of it anyway?
>>
>>58116166
Java and Windows use it.
>what's the point of it anyway
It's a flawed text encoding.
All of the disadvantages of UTF-8 and UTF-32 bundled together.
>>
>>58116144
well, the case is clear

>>58116105
>Most problems don't map onto the contrived cat extends mammal extends animal model, and those that could are usually solved simpler and neater using things other than inheritance.
and I didnt claim that. I just said there are some use cases when a vertical hierarchy is the way to go. I use it in my project exactly once for a render graph in which a hierarchy is mandatory.
>>
File: perfect_day.png (60KB, 700x700px) Image search: [Google]
perfect_day.png
60KB, 700x700px
>>58116118
Let's say you get the job, and they ask you to write or maintain something in that language. Are you going to say "OK boss I'm on it" or "haha j/k"?
>>
>>58116166
Windows and some languages, like Java, C#, and Python.

It's literally a mistake. Originally there was UCS-2, which was a 2-byte fixed length encoding. It was easier to handle than UTF-8. Then people realized you couldn't fit nearly enough into it, and turned it into UTF-16 by making it a variable-length encoding instead of simply going with UTF-8, which already scaled that much.
>>
File: 1459706218241.jpg (59KB, 655x527px) Image search: [Google]
1459706218241.jpg
59KB, 655x527px
>>58116188
will they let me use the internet for help
>>
>>58113953
>What are you working on /g/?
>>
>>58116260
That was quick, nice.
>>
RISC-V emulator in C
>>
>>58113953
I'm researching on public key encryption schemes that are quantum computing proof, so I can implement them and forever be ahead of the security curve (assuming perfect implementation).
>>
File: 1340933860628.jpg (201KB, 625x1044px) Image search: [Google]
1340933860628.jpg
201KB, 625x1044px
>>58116188
>>58116203
That's the shitty part. You're not allowed a computer, especially the internet, at work. At most you have a standard desk telephone and some 3 ring binders that do this
>>
>>58116203
Of course, this isn't a test, they just want you to get the work done in a reasonable time frame. It's OK be a little slow at first as you learn how things work there, like the specific libraries they use, but after 2 months or so you better be as fast as your coworkers, at least the ones getting paid the same wage as you.
>>
>>58116296
By quantum computing-proof you really just mean hard as fuck to solve by any means
>>
>>58116322
>>58116296
Not inherently, but just something that doesn't turn from NP to P because of it (RSA)
>>
File: girls_laughing.jpg (44KB, 446x400px) Image search: [Google]
girls_laughing.jpg
44KB, 446x400px
>>58116294
>not actual RISC-V in VHDL
>>
>>58116335
Still an emulator you dip
>>
>>58116280
No quite done yet, scrape function is not implemented, need to display user GP count and image limit, tag display needs to be prettified and it needs a proper meme name, and probably some more.
>>
File: 11456430697.png (7KB, 237x212px) Image search: [Google]
11456430697.png
7KB, 237x212px
>>58116309
th-thx anon. im just nervous about looking for my first job because i dont want to be useless
>>
>>58116335
>reinventing the wheel
lmao @ ur life
>>
>>58116364
>frogtard

You're already useless. Kill yourself.
>>
File: 11456430697.png (17KB, 237x212px) Image search: [Google]
11456430697.png
17KB, 237x212px
>>58116384
>>
>>58116384
top kek
>>
>>58116384
how does it feel a frogtard has more chances of getting a job and succeeding in life than you?
>>
>>58116260
Nice stuff. Is it FOSS?
>>
best php book and IDE?x
>>
>>58116464
>php
>IDE
>>
>>58116490
>meme arrows
>>
>>58116442
If I ever release it, yes.
>>
>>58116547
What library did you use for the GUI?
>>
>>58116608
Qt
>>
Haskell is just like all the more popular languages, it just makes the patterns you normally use easier to do.
>>
>>58116657
at the same performance costs as java kek
>>
>>58116804
t. butthurt vidya fag
"w-what i cant make 60 fps CoD????? worthless"
>>
>>58114049
Neovim is nice, but also buggy.
>>
Where do you lot go for programming news these days?
>>
>>58116897
>having emotional meltdowns over your language criticized
kek
>>
>>58114797
What *is* a good book for programming fundamentals?
>>
>>58116804
Heavier performance costs, actually.
However, the tradeoff is that Haskell provides significant guarantees about the correctness and reliability of your code. Java, even today, is still a language that provides very little in the way of static analysis and guarantees.
>>
>>58116970
So you ARE a vidya fag
What are you doing in /g/?
>>
File: mfw.png (54KB, 500x534px) Image search: [Google]
mfw.png
54KB, 500x534px
>>58116897
>>
>>58116974
It's cliche, but SICP really is a good one.
How to Design Programs is also quite good.
The problem is programming fundamentals is the intermix of having to learn the fundamentals of whatever language it's in as well
So it makes sense to provide the most basic language as the learning medium, which is why Scheme is a great choice.
Sometimes I dream of an alternative timeline where Forth is still appreciated and taught, instead it has been relegated to the category of intellectual curios.
>>
>>58116974
None, just go and learn a language from multiple sources yourself that isn't functional and doesn't force OOP
>>
>>58114255

Use %s to print a string
Code:

char firstname[20];
char lastname[20];
strcpy(firstname, "Milton");
strcpy(lastname, "Friedman");

printf("%s %s", firstname, lastname);
printf("%s\n%s", firstname, lastname);
printf("%s ", firstname);
printf("%s", lastname);
>>
>>58116974
Haskell from First Principles
>>
Does anyone here program in D?
Is it worth learning and/or is it ever used?
>>
>>58117021
It's much better than C++
>>
>>58117021
I haven't heard of D before /g/ started shilling it after the inventor slammed some SJW faggot
>>
>>58116966
/dpt/
>>
>>58117004
Does that cover how code interacts with hardware and low level stuff? Ie covering floating point implementation, stack structures for methods calling, basic data structures, etc?
>>
>>58117021
It's a very good language but it's very, very rarely used

>>58117029
D has been popular since Andrei started doing talks on it
>>
>>58117041
Not really. Struggling to remember any books that cover things at that level targeted at beginners.
>>
>>58113953
CLANG HAS C LAMDAS IT'S FUCKING OGRE
>>
>>58117089
If I recall correctly, there's full-on closures too.
>>
>>58117089
I literally just found this out after years
>>
>>58117021
It's great.
Has plenty of Vim support.
Will make you never want to go back to sepples.
The only downside is a lot of abandoned libraries.
So you'll be forking or doing a lot yourself.
>>
>>58117089
>they kept C's syntax for function pointers
jesus christ

what's so hard to understand about (int -> int)
>>
>>58116986
trolling insecure try hards, wbu?
>>
File: didimakeitbetter.png (292KB, 1902x1278px) Image search: [Google]
didimakeitbetter.png
292KB, 1902x1278px
>>HOW DID I DO?

I created a class called Instantiate to instantiate all classes that I don't need to remake for every level.

Is this correct? I'm just making it up as I go along.

The PlayScreen class is created and disposed every 30 seconds.
>>
File: Office-Space-Animated-Gif.gif (3MB, 320x240px) Image search: [Google]
Office-Space-Animated-Gif.gif
3MB, 320x240px
>be me, get drafted in to take over a website
>oh great, it's MEAN stack. More like GHEY stack

I've been through development hell trying to fix the shit code the guy wrote but this is something else.

I have just finished up a section (admin backend, add new product thingummy).
Now, if I run the server on ANY PORT BUT 80 (yes, even 81) it works perfectly. However, as soon as I run it on port 80, whenever you click on anything in the admin tab after logging in it just takes you to the home page.

WHWWHWHWHWHHYYYYYYYYYYYYYYYFUCKFUCKFUCKFUCKWHYYYYYYYYYY

I've spent four hours trying to figure out why it does this. I've tried every workaround hack I can think of. I've tried using a god damn fresh database. NOTHING CUNTING WORKS.

Why, WHY? I tried running the node app on a different port and using iptables to throw port 80 over to it. SAME BEHAVIOUR. I tried using nginx as a proxy to send it to the app on a different port. SAME BEHAVIOUR. I've googled and been trying random shit for 5 MOTHERFUCKING HOURS NOW\|!

WHHHHY!

It's the exact same fucking code. The only thing that gets changed is the port from 81 to 80. WHY THE FUCK DOES THIS STOP THE ADMIN LINKS WORKING? WTF?!?! GAAAAAAAAAAAAAAAAAAAAAAAH

Of course I'm remaining calm about the whole thing. Anyone else ever run into this behaviour before? Did you find a fix?
>>
>>58117131
>The PlayScreen class is created and disposed every 30 seconds.
wtf why
Look at how many allocations that thing's doing
>>
>>58117144
The levels of my game are currently <30 seconds long. They are short tutorials, so the game world has to be redone and everything reset after each level is completed
>>
Newb here, could really use some help with this webdev-related thing

tl;dr:
- working on a simple client for NodeBB forum software for the sake of learning
- found this: https://github.com/NicolasSiver/nodebb-plugin-ns-login
- discovered that mynodebbdomain.com/api/login will return a login token of some sort if I send user/pass in a POST request

That github page states that I can use some kind of bearer token or a JSON web token of some sort, but I'm not clear on how to interface my user's login with any of that. Obviously I can create a token manually for each user using the admin panel as per the github readme but that's pointless—I'm going for a functional client here which doesn't require admin intervention for each separate user

Anyone have any helpful tips etc.?
>>
>>58117115
bruh don't tell me this syntax isn't logical as fuck

 typedef int (*fp)(int); 
>>
>>58117164
It's an inefficient use of allocations. You are allocating memory, then freeing it, then allocating memory for the very same purpose again, ogre and ogre.
>>
>>58117194
This is why you have block allocators.
>>
>>58117136
The difference might be that the port isnt usually included in the HTTP header if it's on 80. Is that the issue?
>>
>>58117215
Memory pool rather
>>
>>58117059
>Targeted at beginners
Doesn't need to be at "babies first" level, I just need something I can look at whenever I get completely lost in C++
>>
>>58117227
Different name, same thing.
>>
>>58117233
What about "slab"
>>
>>58117225
I have no idea, but you've given me something to go on. Thanks.
Like I said, I didn't write this bastard. Last time I volunteer to clean up someone else's mess.
>>
programming makes me angry
>>
>>58117194
The documentation on Java ported Box2D is too crap for me to put the effort into reusing any of it.

But I will remove some of those other instantiations tomorrow.
>>
>>58117131
Look into pools. I don't really know what you're doing but you might want to try to make things share resources. As an example, a pool of bullets enemies could share and every fire() they automatically request an inactive bullet from the pool. When the bullet hits something it's deactivated. You can probably apply that concept to abstract away a lot in there.
>>
>>58117268
same lol but its worth it
>>
>>58116897
it's not their fault java thinks bytecode interpretation and JIT is a good idea
>>
>>58117357
JIT is a good idea
>>
>>58117321
I'll have a look, this could be good, thanks anon
>>
File: 855a7a3a4c.png (32KB, 908x416px) Image search: [Google]
855a7a3a4c.png
32KB, 908x416px
>>58113953
Finished the logic to create the database in the appdata folder, I've learned that dbs shouldn't be deploy in the /Program Files/ folder, because files there tend to be read-only.
>>
>>58117416
>not self-containing everything in its install folder
i hate you
>>
>>58117440
I mean, that was the first approach, but as I've said: when deployed, the database was made read-only.
I could install the application itself in the appdata (including the db there), but that seems way uglier. (I think Taiga uses that approach.)
>>
>>58117483
having full-fledged installers for programs, especially small utilities, has always been a pet peeve of mine on windows.

i prefer something that i can just unzip and go, personally.
>>
>>58117225
>The difference might be that the port isnt usually included in the HTTP header if it's on 80. Is that the issue?
I think it's something else because it tries to load the addproduct page, then before it gets to drawing the table of existing products it shits itself and returns to the home page.

I just do not fucking get it. The ONLY thing that is changed about the app is which port it's on.

I'm leaning towards maybe something else is causing it because I tried loading up an old version of the site and it does the same thing. But fucking what?!
>>
>>58117524
Why not just use
make install
?
>>
i love writing documentation
>>
>>58117576
I just finished my seventh paper of flowcharts. I can see why you like it
>>
This is my current makefile I created. Is it any good? For some reason this shit won't enter my head. How would I add libraries and includes shit? I've been spoilt by IDEs and seem to be retarded when it comes to these
>>
>>58117619
As long as it works, you should be fine
>>
>>58117619
gcc manpage and pkg-config for learning how to link, in that order.
>>
>still using makefiles
>>
File: feels drive wojak.jpg (64KB, 501x501px) Image search: [Google]
feels drive wojak.jpg
64KB, 501x501px
>>58117166
>tfw literally nobody ever answers my questions in these threads
>I've literally never gotten any help
>but still I try...
>>
>>58117674
t. "Can only use an IDE" Java pajeet
>>
New thread:

>>58117697
>>58117697
>>58117697
>>
>>58117166
>>58117688
I fucked up anyway, I meant to link https://github.com/NodeBB/nodebb-plugin-write-api

not that login thing
>>
>>58117619
>Is it any good?
No. Any given object file will depend on more than just its associated .cpp file. There are header files and other source files.

Here's my generic Makefile, which captures dependencies:
# executable name
EXEC = exec_name


# project sub-directories
BIN_DIR = bin
OBJ_DIR = obj
SRC_DIR = src


# project files
SOURCES := $(wildcard $(SRC_DIR)/*.cpp)
OBJECTS := $(patsubst $(SRC_DIR)/%.cpp, $(OBJ_DIR)/%.o, $(SOURCES))
DEPENDENCIES := $(OBJECTS:.o=.d)


# compiler
COMPILER = g++

# compiler flags
OPTIMIZATIONS = -O3
STANDARD = c++14
WARNINGS = -Wall -Wextra -pedantic

FLAGS = -std=$(STANDARD) $(OPTIMIZATIONS) $(WARNINGS)


# phony rules
.PHONY = all clean purge make_dirs

all: make_dirs $(OBJECTS)
@echo Linking object files to target $(BIN_DIR)/$(EXEC)
@$(COMPILER) $(FLAGS) -o $(BIN_DIR)/$(EXEC) $(OBJECTS)

clean:
@echo Removing object files
@rm -rf $(OBJ_DIR)

purge: clean
@echo Removing executables
@rm -rf $(BIN_DIR)

make_dirs:
@mkdir -p $(OBJ_DIR)
@mkdir -p $(BIN_DIR)


# build rules
# object files
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp
@echo Building CPP object $@
@$(COMPILER) $(FLAGS) -c -o $@ $<

# object file dependencies
$(OBJ_DIR)/%.d: $(SRC_DIR)/%.cpp
@mkdir -p $(OBJ_DIR)
@$(COMPILER) $(FLAGS) -MM -MT $(@:.d=.o) $< > $@
-include $(DEPENDENCIES)
>>
>>58117619
>>58117717
Followup: I don't use make since I discovered CMake, which has the honourable distinction of being less terrible than make.
>>
>>58117546
>>58117136
So I've just set the node app to run on a high port, and used iptables to hand off port 80 over to it.

If I access the site from port 80, I can't get to the admin pages.
If I access it from the high port, I can.

I can even log in on the normal page, then switch to the high port and still be logged in, and then able to use it.

What the everliving fuck?

This is a centos server BTW. Again, not my choice.

I bet systemd is to blame somehow.
>>
>>58117734
Should I look into that then? I don't have much experience with make (obviously), but I just want to use a text editor and compile in terminal rather than an IDE
>>
>>58117745
CMake has some ... idiosyncrasies, but it does a lot of stuff for you that you have to do manually with make, like find dependencies. If you're *really* good with CMake you can do some neat compile-time scripting. Perhaps most importantly, CMake is really the future of C++ build systems. If you search for C++ projects on GitHub, you'll find most new projects are using CMake.
>>
>>58117745
you should probably learn all the basic flags for your compiler first.
cmake works pretty well.
>>
>>58117710
>node
found the reason why nobody replies
>>
Trying to program a chatbot that will pretend to be my gf because I'm cripplingly lonely ;_;
>>
>>58117827
the question I'm asking isn't specific to node, more of a general question about authentication and such
>>
>>58117838
become the gf anon
>>
>>58117709
disregard that

New thread:
>>58117916
>>58117916
>>58117916
Thread posts: 325
Thread images: 39


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.