[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: 328
Thread images: 28

File: java.png (195KB, 1080x867px) Image search: [Google]
java.png
195KB, 1080x867px
What are you working on, /g/?
Previous Thread: >>61963889
>>
File: cyclic list.png (21KB, 577x368px) Image search: [Google]
cyclic list.png
21KB, 577x368px
>>
>>61972126
(in retrospect it'd be better to have a list of types as a parameter)
>>
Making a password generator in asm.
>>
File: C.jpg (61KB, 498x602px) Image search: [Google]
C.jpg
61KB, 498x602px
Does anyone actually writes programs like this? Outside of the collage I mean
>>
>>61972297
No. That code smells.
>>
>>61972297
other than the weird newline after the type definition of main i don't see anything wrong with it
>>
>>61972297
all professional work uses a framework or library of some type

you will hardly ever do a File -> New Project professionally
>>
>>61972297
No, that only serves to teach you the basics, i.e. how to not be a retard.
>>
>>61972383
>weird newline
I always do that. It helps me to recognize the function name because it always starts from the 1. column.
>>
https://www.youtube.com/watch?v=7lnud-xVnqk

this is how sick you bay area and seattle cucks are

reminder that /g/ has LITERAL faggoty google shills among its posters
>>
hey /dpt/
what's the comfiest LISP?
>>
>>61972958
Shen
>>
>>61972958
The one you write yourself.
>>
>>61972090
An AI that can discover footjob scenes in every video on major porn sites, aggregates and cuts the scenes and publishes them on a separate website
>>
#include <string>
#include <system_error>
#include <windows.h>
std::string wstring_to_string(const std::wstring &wstring) {
if (wstring.empty()) {
return std::string();
}
int size = WideCharToMultiByte(
CP_UTF8,
0,
wstring.c_str(),
wstring.size(),
nullptr,
0,
nullptr,
nullptr
);
if (size < 1) {
// system_error is appropriate because while WideCharToMultiByte and
// MultiByteToWideChar might not seem to be system calls in the truest
// sense they do prefer to report errors the Windows API way through
// GetLastError
// funnily enough they are provided in kernel32.dll
throw std::system_error(GetLastError(), std::system_category());
}
std::string string("\0", size);
if (WideCharToMultiByte(
CP_UTF8,
0,
wstring.c_str(),
wstring.size(),
(LPSTR)string.data(), // not const since C++17
string.size(),
nullptr,
nullptr
) < 1) {
throw std::system_error(GetLastError(), std::system_category());
}
return string;
}

std::wstring string_to_wstring(const std::string &string) {
if (string.empty()) {
return std::wstring();
}
int size = MultiByteToWideChar(
CP_UTF8,
0,
string.c_str(),
string.size(),
nullptr,
0
);
if (size < 1) {
// system_error is appropriate because while WideCharToMultiByte and
// MultiByteToWideChar might not seem to be system calls in the truest
// sense they do prefer to report errors the Windows API way through
// GetLastError
// funnily enough they are provided in kernel32.dll
throw std::system_error(GetLastError(), std::system_category());
}
std::wstring wstring(L"\0", size);
if (MultiByteToWideChar(
CP_UTF8,
0,
string.c_str(),
string.size(),
(LPWSTR)wstring.data(), // not const since C++17
wstring.size()
) < 1) {
throw std::system_error(GetLastError(), std::system_category());
}
return wstring;
}

FUCK sepples
FUCK windows
>>
>>61973268
#include <codecvt>
#include <locale>
#define wstring_to_string(wstring) (std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>, wchar_t>().to_bytes(wstring))
#define string_to_wstring(string) (std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>, wchar_t>().from_bytes(string))


#include <boost/locale.hpp>
#define wstring_to_string(wstring) (boost::locale::conv::utf_to_utf<char>(wstring))
#define string_to_wstring(string) (boost::locale::conv::utf_to_utf<wchar_t>(wstring))

FUCK boost
>>
>C++

When will /g/ grow up?
>>
daily.reminder.this.is.not.the.official.thread()
>>
>>61973431
other than the lack of an anime image it literally is tho
>>
>>61973431
what's official then?
>>
>hating c++
when will reddit learn?
>>
still writing that language

with "second_file"

love(x, y) is
my = "waifu"
x = 0
y = 0
start
put "#{my} is at #{x} , #{y} OwO"
=>love:i32

>>
bjarne did nothing wrong
>>
>>61973524
delete this
>>
File: 1494823168093.png (17KB, 746x600px) Image search: [Google]
1494823168093.png
17KB, 746x600px
What are some good lectures
>>
>>61973791
Jordan Peterson Personality lectures.

Sort yourself out, Bucko.
>>
I fucking hate proprietary software.

I used to be kind of indifferent to it, but for my current job, I need to get data from measurements using software from a research company. I have never wanted to scream at incompetent programmers more.

>Image names can't be more than 17 characters long (what the fuck?)
>To do something as easy as giving data an offset, you have to go through a bunch of fucking hoops
>In certain cases, the data is saved in-software (you need to access the data from within the software. You can't find it on your OS)
>No macros to help me
>User interface is not intuitive at all. You basically need to know the software front and back to do anything
>Current version of the software actually feels like a downgrade from previous versions
>>
>>61973791
Mike Thermofvitch's Goriller Mindthet
>>
File: 1501122652648.jpg (46KB, 278x251px) Image search: [Google]
1501122652648.jpg
46KB, 278x251px
>>61973839
>>61973910
>>
>>61973857
go write your own free as in freedom version then
>>
>>61973857
What software is it?
>>
>>61973857
I work with medical software. Every program is proprietary win98-tier mess. They were clearly programmed by turning electronic health software standards into feature checklists; they saw "daily backup" and made a .bat file that copies mysql's entire directory to some other place on the same computer. It's the kind of mess that you could improve upon by copy-pasting from stackoverflow. It's that bad.

There's also software that interfaces with the gigantic medical machines like computerized tomography or magnetic resonance imaging machines. Nobody is madman enough to reverse-engineer that shit. Due to the sheer money involved they tend to be better, but they're still borderline unusable windows crap... Radiologists are making too much money to care though. Since they're fuckhuge appliances they could easily fix all these problems by recording all data in volatile internal memory and allow interfacing and transfer via a web browser, or even a HTTP API electronic health record systems could make use of to drive the machine and import imaging data directly into the patient's record.
>>
File: cos.png (5KB, 398x62px) Image search: [Google]
cos.png
5KB, 398x62px
I have to calculate sin(x) using the taylor series [spoiler] in Prolog [/spoiler]

My brain is full of fuck. I thought it would be easy since I already calculated e^x but I have no idea how to deal with the alternating sum and substraction in the series with recursion. I want to cry.
>>
>>61972297
lmao
>>
>>61973253
A cute anime AI trap girlfriend to give me a footjob while I dress her up on my screen.
>>
whats the term for when its someone trying to make your algorithm perform in its worst case?
>>
>>61974396
Wait are you telling me those giant machines a just giant dumb peripherals?

So a 30k+ monster is being led on a leash by a fucking legacy workstation?
>>
File: 1474062352177.png (67KB, 400x400px) Image search: [Google]
1474062352177.png
67KB, 400x400px
>tfw refactoring my colleague's code
>tfw correcting his terrible spelling in comments
>git commit
>before I delete the comments entirely
>git commit
>>
File: chingchangchong.png (37KB, 1653x628px) Image search: [Google]
chingchangchong.png
37KB, 1653x628px
What does everyone think of Streams and Lambda expressions in Java 8?
>>
>>61974447
>My brain is full of fuck
>I want to cry.
Stop, no really, math people have already done this for us, use the facilities available to you.
C promotes doing everything yourself, this is a bad idea, use libraries that have proven themselves functional, you will quite literally go mad otherwise.
>>
>>61974675
Reminds me of Ruby.
>>
>>61974447
Do it 2 terms at a time so that there is no alternating sum.
>>
>>61974613
>>61974613
>>61974613
can someone answer this? i'm having a brain fart but i know it's not rival or nemesis. it's a specific word used all the time
>>
>>61974447
dude it's right in front of you. can't write a loop?
>>
>>61974650
whadda ya think it is?

javascript?
>>
>>61974675

Not as powerful as LINQ.
>>
>>61974820
>prolog
>>
In C#, are enum's static or can you add additional items to them after declaring them?

I'm new to C# and what little background I have is in Python. I assumed they were the equivalent of lists but is that the case?
>>
>>61972297

> Commenting the stdio header.

#include <stdio.h> /* printf and scanf */
// comment to include stdio
//comment to include the comment to include stdio
.....

>>
>>61974675
main(i){for(i=0;i++<100;)printf("ch%cng ","iao"[rand()%3]);}
>>
>>61974759
>>
>>61974447
Nigger they literally give you the formula there.
(defun factorial (n)
(cond ((zerop n) 1)
(t (* n (factorial (- n 1))))))

(defun cosine (x &optional (n 10))
(loop as i from 0 to n
as 2i = (* 2 i)
summing (* (expt -1 i)
(/ (expt x 2i)
(factorial 2i)
1.0))))

out
(mapcar #'cosine '(1 2 3 4 5))
(0.5403023 -0.4161468 -0.9899925 -0.6536434 0.28366297)
[4]> (mapcar #'cos '(1 2 3 4 5))
(0.5403023 -0.41614684 -0.9899925 -0.6536436 0.2836622)
>>
>>61974447
>but I have no idea how to deal with the alternating sum and substraction in the series with recursion.
That's what (-1)^n is for. For even values of n (-1)^n == 1, otherwise it is -1. All you need to do is to increment n for each level of recursion.
>>
>>61974833
I always assumed they were running on updated versions of those wonky programs the original designer made.

Like whatever the giant magnet equivalent of proto SQL was.

Then some modern terminal with a "so ez a 84 year old docotor can do it" gui sent it instructions.

I didnt think it was just sending fat reams of data back to the box for distribution.
>>
>>61974929
adversary is the term i was looking for
>>
>>61975060
>adversary
wtf

never heard of term applied here
>>
>>61972090
Hi,

Still working on my alarm clock. Im almost done adding the TTS portion, but I am stuck.

For user created functions, how do you decide what to import and what to just keep on the main file?

I feel like I could have my main file be 3 lines of code made up of functions inside functions inside functions.

Or it could be 1000 lines with only built in libraries being imported.

What are the PROS AND CONS.

thanks a bunch.
>>
unsigned char sleeve[] = {
0xaa,0xad,0xfd, 0xe9
};
unsigned rotr(unsigned x, unsigned n) {
return (x >> n % 32) | (x << (32-n) % 32);
}
char* dumb(char* input, int size) {
char *state = malloc(32);
memset(state, 0, 32);
memcpy(state, input, size);
for(int i = 0; i < 9; i++){
for(int k = 0; k < 32; k++) {
state[k] ^= (rotr(state[31 - k],3) ^ sleeve[k/8]);
//state[31 - k] %= 4;
}

}
return state;
}

10/10 quality hashing function.
>>
>>61975079
>Still working on my alarm clock
what alarm clock?
>>
One thing i'm thinking about implementing in my language is returning function names as short-hand versions.

function is 
//declarations go here
<=
//statements go here
=>func

func


But, i don't know, maybe that'll make the compiler have to do too much back tracking. Personally, i like having short function names, but I also know it's a pain in the ass for anyone who has to clean up my mess afterwards.
>>
>>61974396
>Radiologists are making too much money to care though. Since they're fuckhuge appliances they could easily fix all these problems by recording all data in volatile internal memory and allow interfacing and transfer via a web browser, or even a HTTP API electronic health record systems could make use of to drive the machine and import imaging data directly into the patient's record.
Brb figuring out how to get into this industry. I have the skillset to write software for these shitboxes.
>>
>>61975069
you'll see it used if you read papers about the stuff
>>
>>61975088
input: abc
output: 476UUUUUOGcÂ


is this supposed to happen
>>
>>61974666
Correcting comments has to be the lowest priority shit ever. Don't bother unless there's nothing more productive to do.

>>61974675
Gonna be honest, I won't touch any version of Java unless I'm forced to. Lambdas can only make the language mildly more tolerable at best.
>>
>>61975125
do you have a particular set of skills?
>>
>>61975163
yeah kinda
>>
Beginner here.

Why does my makefile detecting changes to my main.cpp file even when all I change is a single character, but not when I change a single character in my class files? How do I get around this without having to use a make clean all the time?
>>
>>61975167
>Gonna be honest, I won't touch any version of Java

what do you use, hipster fag? ruby?

hahaha
>>
sometimes i think tripfags make posts they don't actually even want to make, just because they feel obligated to post
>>
>>61975079
think in terms of boxes. Lets say you want to tidy up your room. You would probably put things you want away, like shoes, shirts, magazines, CD's, etc. However, you would also want to be able to find them again, so you'd put those things in the same area (shoes go in a box, shirts go in drawer with socks and pants, etc.) You can do the same with your functions, putting similar things in similar files.
>>
>>61975181
you sound inexperienced with make, so it's probably doing what you're telling it to do in the makefile
>>
>>61975181
is the class file listed as a dependency?

makfiles work like this:

file : depency1 dependancy2
commands

dependancy1 :
commands

dependancy2 :
commands

make looks at the first listed file in the makefile, in this case "file", and checks if it has been changed."file" is considered changed if either dependancy1 or 2 have changes in them as well as if "file" has changes

if only file has changes, only file's commands are ececuted
if dependancy1 has changes, it's commands are ran, then file's.

you can also have things like this

notactuallyafile :
run some commands

(activates only when "make notactuallyafile" is called from the command line
>>
>>61974865
I've seen this a lot in C++ documentation examples but not in any real code
>>
>>61975191
Name me one reason why you would use Java over any of the languages that do its job faster, and cleaner?
>>
>>61975399
>any of the languages that do its job faster, and cleaner

and what languages are they?
>>
>>61974339
Asylum Research, AFM Software.

>>61974152
Can't... Don't own the hardware that the software controlls

>>61974396
Still don't know why no one has invested money into updating decades-old software.
Sure it takes time and money to do so, but so does maintaining it.
>>
>>61975191

It depends on what I'm doing. If I need to quickly process a bunch of data once, you bet your ass I'll write a Ruby script, and I'll get it done faster than had I used Java. If I need to write an application to be used by other people, I'll probably use C++. I'm more productive with it, and I can produce a better, faster application with it.

>>61975181

Since >>61975307 did a good job of explaining why your makefile doesn't rebuild when you change the header, I'll give a few ways to fix this:

1. Use the touch command on every file that includes the header so make will have to rebuild those.
2. Add the header as a dependency in the makefile
3. Just use cmake and let it handle your dependencies.
>>
>>61975427
C++, D, Red
>>
>>61975214
>>61975214
I think I got what my problem was: It's not that it didn't detect changes to them, it's that they didn't check for these files at all. All it checks are .cpp files, so if I modify my .hpp files it won't see any changes and will tell me it's up to date.

So I either split the classes into definition and implementation, no matter how tiny they are, or I make clean every time I make a change to the .hpp files. This is annoying.
>>
File: 1443751078130.jpg (15KB, 226x239px) Image search: [Google]
1443751078130.jpg
15KB, 226x239px
>>61975484
>Since >>61975307(You) did a good job
thanks
feels good man
>>
>>61975509
man makedepend, anon.
>>
>>61975509
a guy was bitching about an operating systems class where everyone failed an assignment to make a makefile for some program, and he was mad that the professor didn't grade. i thought he was joking. it's such a simple concept. read >>61975307
>>
>>61975484
>>61975484
>>61975539
>>61975541
>make looks at the first listed file in the makefile, in this case "file", and checks if it has been changed."file" is considered changed if either dependancy1 or 2 have changes in them as well as if "file" has changes
>2. Add the header as a dependency in the makefile
>man makedepend, anon.

I'll look into these, thanks. It's my first time making a makefile at all, and it seems I'm having a bumpy start.
>>
>>61974447
n_factorial(0,1).
n_factorial(X,R) :-
X > 0,
X1 is X - 1,
n_factorial(X1,R1),
R is X * R1.

n_cos(_,0,1).
n_cos(X,N,R) :-
N > 0,
N1 is N - 1,
n_cos(X,N1,R1),
N2 is N * 2,
n_factorial(N2,F),
R is R1 + (-1 ** N) * ((X ** N2) / F).
>>
If you're not committed to creating only copyleft software then you should leave this thread.
>>
>>61972297
no it's just for teaching
>>
>>61975620
this is an anime general, not a communist general
>>
>>61975620
kys commie scum
>>
>>61975637
ANIME COMMUNISM

COMMUNIST ANIME
>>
>>61974675
mapToObj

Fuckin chug a tall, frothy gallon of bleach Larry. Not even Google can prop up this shitshow.
>>
>>61975658
what the problem, bucko
>>
>>61975674

stop talking like that faggot
>>
>>61975620
I release all my work into the public domain where possible, BSD license otherwise. GPL licenses are faggotry and infringe on the freedom of software developers.
>>
>>61975709
like what, hector?
>>
>>61975719

clean your damn room
>>
>>61975091
I am writing an alarm clock program as my debut into python.

So far it
>fetches Daily news from Democracy now youtube channel as the alarm
>plays music on weekends isntead
>reads tts of date and time

I still need to create a GUI for it and connect it to my work schedule so it can tell me what time My shift starts.

I was using my name before to prevent confusion, but I was being flooded with questions about my opinion on diversity in tech and requests for feet pictures.
>>
>>61975713
this
>>
>>61975713
>I release all my work

what work?

lel
>>
>>61975713
>>61975740
>maybe I'll get a reacharound after some company packages my code into a proprietary product and sells it
>>
>>61975768
fag, no one wants your gpl garbage anyway
>>
>>61972126
What language is this? Haskell?
>>
>>61975735
emily you sly-ass nigga weren't you baiting last thread?

Also what are you using for GUI implementation?
>>
>>61975790
yes
>>
>>61975735
>>fetches Daily news from Democracy now youtube channel as the alarm
>Democracy now

Nice bait. Chuck it in the garbage bin.
>>
>>61972911
that guy who threw the coffee is so physically revolting
it's unsettling that people like this exist
>>
>>61975768
I don't care how my code is used. I write it for the benefit of everyone, not just for some overzealous ethical crusaders.

Also
>implying chinks care about your license
>>
>>61972911
what times the splash, i'm not watching all this
>>
>>61975831
Its not bait.

import urllib.request
import webbrowser
import time
import urllib.parse
import re

def getnews():
query_string = urllib.parse.urlencode({"search_query" : "Top U.S. World Headlines" + time.strftime('%B %d, %Y') })
html_content = urllib.request.urlopen("http://www.youtube.com/results?" + query_string)
search_results = re.findall(r'href=\"\/watch\?v=(.{11})', html_content.read().decode())
webbrowser.open("http://www.youtube.com/watch?v=" + search_results[0])

def getmusic():
query_string = urllib.parse.urlencode({"search_query" : "lofi Hiphop radio" })
html_content = urllib.request.urlopen("http://www.youtube.com/results?" + query_string)
search_results = re.findall(r'href=\"\/watch\?v=(.{11})', html_content.read().decode())
webbrowser.open("http://www.youtube.com/watch?v=" + search_results[0])


See!
>>
>>61975900
3:50
>>
>>61975831
you may be a little bit OK, but you still need to go back to /o/ turd
>>
>Compare two arrays and return a new array with any items only found in one of the two given arrays, but not both. In other words, return the symmetric difference of the two arrays.

function diffArray(arr1, arr2) {
var newArr = [];
var concArr = arr1.concat(arr2);
var currItem;
var sliceArr;
for (var i=0; i<concArr.length;i++){
currItem = concArr[i];
sliceArr = concArr.slice(i+1, concArr.length);
if (sliceArr.indexOf(currItem) === -1)
newArr = newArr.concat(concArr.slice(i, i+1));

}
return newArr;
}

diffArray([1, 2, 3, 5], [1, 2, 3, 4, 5]);



what the fuck am I doing wrong?
it's returning [1,2,3,4,5]
>>
>>61975801
Hiya. I havent decided (found a easy one with a good tutorial for python3) on which one to use yet.

I did however make a mess of my scripts folder trying to install one manually at 3 am.
>>
>>61975910
def get(what):
dct = {}
if what == "news":
dct = {"search_query" : "lofi Hiphop radio" }
else:
dct = {"search_query" : "Top U.S. World Headlines" + time.strftime('%B %d, %Y') }
query_string = urllib.parse.urlencode(dct)
html_content = urllib.request.urlopen("http://www.youtube.com/results?" + query_string)
search_results = re.findall(r'href=\"\/watch\?v=(.{11})', html_content.read().decode())
webbrowser.open("http://www.youtube.com/watch?v=" + search_results[0])
>>
>>61975910

Sad!

>>61975934

I can't go back. I'm here forever.
>>
>>61976012
Are you still obsessed with C#?
>>
>>61976095

It's my primary language, so yes. I am learning Hasklel, though. It's going better than I expected and I don't actually hate it.
>>
>>61975855
You don't mind doing other peoples' work for them?
>>
>>61976117
>Haskell
Deprecated
>>
>>61976127

Not deprecated, but it does generate 1GB/s in garbage.
>>
>>61976153
Idris is probably the next big statically typed FP language
>>
>started learning Java
>started lurking these threads only after progressing a few weeks in
Did I make a mistake
>>
>>61976118

What part of "for the benefit of everyone" did you not get when reading his post? Plenty of people write software knowing full well that others will use it without giving back anything in return. And there's nothing wrong with that.
>>
>>61976118
Only if it happens to coincide with what I'm interested in.

>some faggot makes a github issue titled "need to implement csv export" on my project
>respond "no" and block him from my project
fuck if they're going to get free work out of me for something i don't want to do.
>>
>>61972090
Hey /dpt/

Could someone remind me about the /g/ git hosting sites that some kind souls maintain?

I want to host my little codebase there
>>
>>61976118
No. Like I said, if I release something it is because I want everybody to benefit from it. I believe people should be encouraged to use and create free but I disagree with the methods used by GPL.
>>
>>61976417
"use and create free software", that is.
>>
>>61976317
Where do you draw the line? Are you saying being paid to develop software (ie in the context of a full time role) is something bad?
>>
>>61976317
Knowledge should be free, but what one does with that knowledge is one's own responsibility.

It's just like you can teach a person to farm, but are you going to do the actual farming for them? To do so is not "for the benefit of everyone" - one needs to embrace logic to be able to program, and helping those who are against logic succeed is just like giving nuclear weapons to a rogue state like North Korea.

I think you are just some nigger trying to coerce people into working for free under the guise of political correctness.
>>
>>61975939
please, someone
>>
>>61976376
bitbucket
>>
are cyclic lists possible in lisp?
it doesn't make sense considering all lists are built up out of nested cons
>>
>>61976585
absolutely ridiculous

here's your (You)
>>
>>61976687
Yikes, you used the word "absolute", aren't commies and fascists not supposed to do that?
>>
>>61972911
>Uh, I don't talk to racist bigots
What a fucking pussy
>>
>>61972500
What bullshit is this?
>>
>>61976671
yes, if your lisp allows setting the cdr of a pair, you can make a cyclic list.
>>
>>61976376
>/g/ git hosting sites

Do mean gitgud.io?
>>
>>61975939
>>61976642
>sliceArr = concArr.slice(i+1, concArr.length);
You're only checking for elements present after that point. Every item in your second array will be added.
>>
>>61976585
To elaborate on this:

As the Google manifesto may have alluded to, SJWs can't program because they are against logic so others have to do it for them. And what are these SJWs going to do with that code?
>censor the internet
>suppress political dissent
>attempt to control reality

People need to understand their actions have consequences. Fighting logic doesn't work and comes back to bite one in the ass. Nothing good can come of anything that enables this type of behavior.
>>
>>61976480

>Where do you draw the line?
There is no line.

>Are you saying being paid to develop software (ie in the context of a full time role) is something bad?
No, where the hell would you get that idea? To put things into perspective, most people would consider that working in a cafeteria is not in any way morally or ethically bad. At the same time, volunteering in a soup kitchen (literally doing the exact same thing for free) is also not morally or ethically bad. Yes, it's fine to make money off of your work, and you should if you can. But that doesn't mean you need to trash people who volunteer their time to a service that they think will benefit society.

>>61976585

I am not trying to get anyone to do work that they do not want to do. I am not telling people to make free software. I am telling you to shut the hell up with your complaints about people doing work for free. Just as you have a right to work in exchange for money, you have a right to work for free, motivated only by the goodness of your own heart. This kind of action is considered morally virtuous, and we should not shame others for doing so.
>>
File: work_makes_you_free.jpg (13KB, 227x169px) Image search: [Google]
work_makes_you_free.jpg
13KB, 227x169px
>>61977176
>This kind of action is considered morally virtuous, and we should not shame others for doing so.
I know where I've heard this one before...
>>
>>61977210
Writing free software != "Do this or I'll shoot you"
>>
>>61977223
Is it any different though? Companies in places like SV often ask people for their Githubs, which could be tantamount to saying "write free software or there is a lower chance of you finding a job thus causing you economic difficulty".
>>
>>61976948
>>61977210
Google is a private entity, and regardless of whatever PR they try to spin, their sole motive is to make as much dough as they can; if they fail to deliver, the market will provide opportunities for competitors. That is how economics work. People who think there is some grand political scheme at work are naive, and if they think Google was peachy keen as a company before the memo shitstorm, they are complete retards.

Permissive license users may be useful idiots at times, but if they want to use them, that's their choice. I'm not giving up on free software just because someone you despise may just so happen to use it one day for some reason or another.
>>
>>61977274
>their sole motive is to make as much dough as they can
By brainwashing people and attempting to control reality? Everything Google does is outright dishonest in some way, the only reason they have gotten away with it is that people haven't wised up to what they are really doing.
>>
Goddammit, I'm an atheist, but all of this anti-volunteering crap is making me want to throw a bible at someone.

>Acts 20:35
>In everything I did, I showed you that by this kind of hard work we must help the weak, remembering the words the Lord Jesus himself said: ‘It is more blessed to give than to receive.’

There. Jesus says it's good, so it's probably good.
>>
>>61977252
Most software isn't worth anything, and yours is certainly no exception
>>
>>61977326
>but all of this anti-volunteering crap is making me want to throw a bible at someone.
I'm not against volunteering. However as with anything there should be a good reason for doing it.

>>61977363
Then why not quit your job, or better yet tell your employer you'll work for free? Surely you wouldn't want to be taking money from people for doing worthless things, right?
>>
>>61977373
I never said that programming wasn't worth money, but the resulting software isn't physically commodifiable.
>>
>>61977252

Look at it like this: it stops the chicken and the egg problem of no experience, therefore can't get job, therefore no experience.

>>61977373

In many cases, it's just... "I felt like it." Someone makes a program that suits their own needs, and it happens to benefit others. Or maybe it doesn't satisfy a need, it's just something to make when you're bored, or as practice for greater work.
>>
>>61977387
You're out of your mind.
>>
>>61974666
>git blame
>oh this faggot killed the comments
>your fired
>>
>>61977323
>By brainwashing people and attempting to control reality?
Well... yes. How is this not logical or intuitive? A profitable, ethical company is a pipe dream for retards that worship markets like gods.
The term "virtual signalling" exists for a reason. Companies very rarely believe a word of the pandering political tripe they say. It's no different from when they branded themselves as "patriotic" during the Cold War even though they were eager to do business with Soviet bloc nations that hadn't reverted to capitalism yet.
>>
>>61977418
>Look at it like this: it stops the chicken and the egg problem of no experience, therefore can't get job, therefore no experience.

...or is it that the "no experience no job" meme was created to extort people into working for free? There are companies in places like that commie shithole China where one has to PAY to work just so they can get experience. I can tell pretty much just by looking at a person whether they are reasonably intelligent, I could not fathom why others would have a problem with this.

>In many cases, it's just... "I felt like it." Someone makes a program that suits their own needs, and it happens to benefit others. Or maybe it doesn't satisfy a need, it's just something to make when you're bored, or as practice for greater work.

... felt like it because of commie propaganda and brainwashing?
>>
>>61976808
thank you
>>
>>61977424
>selling easily-copyable bits and bytes for money
And I'm the one whos out of my mind?
>>
>>61972297
Useless code
>>
>>61977483

>or is it that the "no experience no job" meme was created to extort people into working for free?
It's really a supply and demand issue. As people gain experience in the workforce, they become more desirable than people without experience, since they fuck up less and there's less cost to train them. So companies ask for people with experience. If people can gain experience in other ways, they do so. If they cannot, and there are not enough people on the market with experience, then companies will try to import foreign workers who have experience. Failing that, they will hire and train the less qualified employees. It's not really some meme that was created intentionally by some group. Rather, it's the natural result of businesses making the most rational move for their company, and the market adjusting accordingly.

>felt like it because of commie propaganda and brainwashing?
No. Believe it or not, many people actually enjoy programming as a hobby, not just as a job.
>>
>>61977483
>... felt like it because of commie propaganda and brainwashing?
He felt like it because he actually has passion for what he does and enjoys being appreciated by others.
Sorry you're dead inside. That's no one's problem but yours, bro.
>>
>>61977274
https://wikileaks.org/google-is-not-what-it-seems/
>>
>>61977595
Why doesn't someone just copy and paste you?
>>
>>61977667
>companies are in bed with the government
Am I supposed to be shocked or something? Do you have any idea how insanely lucrative a government paycheck can be?
>>
i parsed an obj file using a double linked list. now i have all of the verts and faces stored in these structures. what would be the easiest way to put these into a vertex buffer object and element buffer object (opengl)?


typedef struct vertArray {
float v1, v2, v3;
vertArray* p_left = NULL;
vertArray* p_right = NULL;
} vertArray;
typedef struct elemArray {
int f1, f2, f3;
elemArray* p_left = NULL;
elemArray* p_right = NULL;
} elemArray;
>>
>>61977674
The solution is to make a paid web service that doesn't reveal the code, so that nobody can possibly steal anything from you
>>
>>61977639
Everything you said is a useless generalization. I've seen plenty of "senior" people who don't know what they are doing and moreover refuse to fix their mistakes just because some "junior" guy told them to.

This is nothing more than a new age version of pedophilia from ancient Greece whereby the younger guy has to get screwed by the older guy.

>enjoys being appreciated by others.
Yes, of course useless people like you enjoy others doing your work for you, but what does that really prove?

>>61977704
But that would create value out of the code, and you said that code doesn't have value.
>>
Trying to make a currency arbitrage detection program
>>
>>61977729
Google often creates internal APIs that are very valuable to them, but then they open source them and make them free to use. The code creates value, but it isn't valuable itself as a commodity (it's completely free).
>>
>>61977769
If code is not valuable then why should people bother making free software?
>>
>>61972383
If you don't do that, searching for a function across multiple source files when you don't know its exact return type is a nightmare.
>>
>>61977785
>code creates value, thus is worthwhile to make
>code is hard to market, easy to give for free
>nobody wants to pay for your code anyways
>many people are eager to improve the quality of software that they use
>creating and improving things is fulfilling
>if it can help you get a job, then writing code is creating value for yourself
>>
>>61977999
The amount of circular logic in that post is truly dizzying.
>>
>>61977999
>hard to market
Only if it's shit.

>nobody wants to pay
That contradicts your very first statement.

>many people are eager to improve the quality of software that they use
Not really no.
>>
>>61977999
My god, if you were to apply the amount of skill it took to spin that web of lies to coding, people like you wouldn't be out there demanding people do their work for free.

Some people truly are worthless human garbage, eh?
>>
>>61978071
>>61978058
>>61978028
Samefag

Nobody has to do anything for free, I'm just justifying why many people do.
>>
>>61978092
Only >>61978028 and >>61978071 were me.

Now why would you want to justify people work for free? Why would you even want them to? Why can't people do their own work for themselves?
>>
File: nice_try_tho.png (10KB, 519x152px) Image search: [Google]
nice_try_tho.png
10KB, 519x152px
>>61978092
No.
>>
>>61977829
>what is an IDE
>>
>>61978092
Many people do shit for free because their shit is subpar.
>>
>>61978127
A very slow replacement for grep.
>>
>>61978124
>Why can't people do their own work for themselves?
I do open source work for myself and others for the aforementioned reasons. I'm not just a lazy neet who distro hops in his basement and uses GIMP. I'm actually being paid by a grant to hack on an open source project right now.
>>
>>61978152
So you think that since you do something other people have to be like you, eh? You must think you are god or something.
>>
File: pencil-lain.png (444KB, 670x675px) Image search: [Google]
pencil-lain.png
444KB, 670x675px
>>61978188
I said the exact opposite of that. You're definitely just flaming now, have fun in the next thread.
>>
>>61978139
How do people survive without vim-like regexp replace?
>>
How do you fix the feeling of your code/class structure being unmaintainable spaghetti that you can't build off of or modify? I'm wanting to make a little minecraft clone with OpenGL/C++ and I implemented the basic game loop, rendered a 3d cube with a camera and camera navigation, and implemented simple text rendering, and I am already feeling overwhelmed.

What causes this spaghetti feeling? I think it's because all the little subsystems of the game have to have references to eachother, so they're...co-dependent? It doesn't feel right but I also feel like most software has to be pretty tangled. Is this just OCD autism getting to me?

For example, my main Game class initializes and has ownership of a bunch of objects like Shaders and Textures and a TextRenderer. I have to pass a Shader to the TextRenderer, and my BitmapFonts have a method that returns a reference to the Texture that font corresponds to, which the TextRenderer will need. Does this sound like a normal class structure or is this fucked? I mean with OOP certain classes will have to have references to other ones and depend on them, right?
>>
>>61978212
So you're the devil then, eh? You must think that is "sexy" or something. You're a million times worse than I ever thought.
>>
>>61978237
You need to figure out how to make them not codependent. This is typically done in the OOP world with interfaces, and "seperation of concerns". A lot of complicated systems are designed in layers where each one extends only the one below it (e.g. compilers are built this way). You might have to do some thinking beforehand to figure out how to achieve good design. My biggest tip I can give is always be prepared to delete code.
>>
>>61978237
should have used java
>>
File: Untitled.png (60KB, 744x1030px) Image search: [Google]
Untitled.png
60KB, 744x1030px
Can't build my program because the console application is running in the background, and I can't just end it from the task manager.
Am I retarded, or is Microsoft really that difficult to use?
>>
>>61978233
Literally any IDE worth using has a vim plugin. Most of them are pretty meh, but they pretty much all have regexp replace.
>>
>>61978297
>and I can't just end it from the task manager.
Right click, kill process tree.
>>
File: Untitled.png (56KB, 684x613px) Image search: [Google]
Untitled.png
56KB, 684x613px
>>61978345
>>
>>61978376
try an OS that respects your freedom
>>
>>61978414
I want to learn how to use VS because that seems to be the most used development tool.
>>
>>61976256
How many GBs of garbage can it generate in a second?
>>
File: kok.png (169KB, 1366x768px) Image search: [Google]
kok.png
169KB, 1366x768px
Writing a kernel for ARM64.
>>
>>61978414
Windows gives you more freedom desu, there's so many more software choices.
>>
File: 1499650664566.jpg (799KB, 1080x1080px) Image search: [Google]
1499650664566.jpg
799KB, 1080x1080px
>>61978442
>People use it so it must be good.
>>
>>61978577
Not what I was implying at all. I just want to be familiar with the tools that are used in industry.
>>
>>61978577
That's how capitalism works, anon. If it wasn't good, the free market would choose something else.
>>
In C# I'm trying to convert strings of comma-separated numbers (Arduino sensor readings) to arrays of doubles. What's the best way to do this? Do I need to convert the string to an array of strings and then convert that to an array of doubles?
>>
>>61978555
Alright, how do I do this, but for subdirs also? I.e.

src/a/a.cpp
src/b/b.cpp
src/widgets/whatever.cpp

Currently it only works if every file is in src/, which is inconvenient.

build/%.o: src/%.cpp
$(CXX) -c $(CXXFLAGS) $< -o $@
>>
>>61978625
Didn't mean to quote you my dude. Enjoy your free (you).
>>
File: 1499636057494.jpg (151KB, 484x465px) Image search: [Google]
1499636057494.jpg
151KB, 484x465px
>>61978594
>>61978587

>If i learn this cool new thing called programming i'll make the big bux, better make sure every company is fucking me in the ass while i'm at it.

I wonder how long it will be before he even learns a single compiler flag.

desu
>>
>>61978587
Because everyone knows getting employed is about being able to use an IDE, make sure you learn to use Cortanna for Binging stackoverflow too.
>>
>>61978665
>>61978683
>all of this coming from the board that encourages people to learn stillborn useless shit like Haskell and Idris
kek
>>
>>61978237
An ideal OOP class hierarchy is a tree (as in the math or CS definition), true encapsulation. Which is a terrible idea: https://youtu.be/QM1iUe6IofM
I come from Java, where I got into a similar entrapment of class entanglement. I hear that OOP gurus are now advocating "composition over inheritance". I want something different.
I'm currently learning about Data Oriented Design. The first idea I've been able to latch onto is to separate data from how it's processed, but I'm still churning through learning material.
Resources I'm currently learning from:
https://youtu.be/rX0ItVEVjHc
http://www.dataorienteddesign.com/dodmain/dodmain.html
>>
>>61978683
I actually have a job and MSVS proficiency plays a pretty big part in it.
>>
>>61978709
>separate data from how it's processed
This is fundamental in functional programming too. The only problem is that FP also encourages immutable data structures, which make a lot of sense as data, but tend to be slow for intensive things like games.
>>
>>61978625

Possible solutions:

1. Make a wildcard rule like that for every subdirectory
2. Use fucking CMake.
>>
>>61978733
Several schools of OOP design also encourage the use of immutability.

http://www.yegor256.com/2014/06/09/objects-should-be-immutable.html
>>
File: 1493651375303.jpg (67KB, 800x557px) Image search: [Google]
1493651375303.jpg
67KB, 800x557px
>>61978719
Thats because you're hired by a meme company, hope you're enjoying your cuck bucks.
>>
>>61978749
I think that OO converges to functional programming as time approaches infinity
>>
>>61978747
>using cuck licensed software
>>
is there a simple way to transform a massive excel spreadsheet full of tables and formulas into a java interface
>>
File: cedric-768x512.jpg (77KB, 768x512px) Image search: [Google]
cedric-768x512.jpg
77KB, 768x512px
>>61978780
No, just use Access or VB, anon.
>>
>>61978709
>Which is a terrible idea: https://youtu.be/QM1iUe6IofM

Someone posted that video on my work slack channel and you would not believe how it triggered my coworkers. It was legendary.
>>
File: 1503068401220.jpg (47KB, 645x968px) Image search: [Google]
1503068401220.jpg
47KB, 645x968px
>tfw can't solve problem 51 of Project Euler

https://projecteuler.net/problem=51

Should I just give up and become a burger flipper?
>>
>>61978709
Data Oriented Design will be considered a meme in about 3 years, if not before.
I'd like to see a large codebase that uses it effectively.
>>
>>61978819
no that was actually a pretty tough one. I'll post my solution if you want; it's commented pretty well
>>
>>61978747
Did it like this, seems to work:

SRCS := $(wildcard src/*.cpp) $(wildcard src/*/*.cpp)
OBJS = $(patsubst src/%.cpp, build/%.o, $(SRCS))

build/%.o: src/%.cpp
$(CXX) -c $(CXXFLAGS) $< -o $@
>>
>>61978769
All OOP software will eventually reimplement simpler paradigms in an extremely convoluted way.
>>
>>61978819
Euler is supposed to be hard. If you made it past problem 10 you're already light years ahead of a lot of programmers.
>>
>>61978847
Some game engines use it. Scientific software that needs to process lot of data propably uses it but the source is likely not public.
>>
>>61978871
>=
>:=
>$< -o $@
Why must Makefile syntax be such a shit?
>>
>>61978955
I'd agree but there isn't that much to remember. If it were more complex, maybe. Also, nobody at my company touches makefiles directly since they all just get generated.
>>
>>61978955

It's orders of magnitude better than maintaining an autoconf script that generates a Makefile.
>>
>>61978985
Scons is comfy.
>>
>>61972500
The large C codebase I'm working on at work doesn't even use the C standard library.
>>
>>61978955
My company uses a giant Ruby script to emit makefiles... kill me
>>
>>61978869
>I'll post my solution if you want; it's commented pretty well

thanks, but I have to make it myself to prove I'm not a brainlet
>>
File: abababb.png (8KB, 613x110px) Image search: [Google]
abababb.png
8KB, 613x110px
Check out this code my mate has to refactor
>>
>>61979100
If it's 100 lines of that, gross. If it's just that, not too bad :P
>>
>>61979121
Try over 500 in just the one script he showed me. My heart goes out to this mans.
>>
>>61979130
Shitty
>>
>>61978985

Autoconf is garbage. If you want to use a program to generate a Makefile, use CMake. The syntax is clean and easy to understand, and it has plenty of plugins for extending to other purposes. I've even used it once or twice for Java programs, since all of the alternative build systems are XML based and look like garbage.
>>
>>61979100
What esoteric language is that?
>>
>>61979141
>CMake
stopped reading there
>>
>>61979142
MATLAB. I don't know MATLAB myself but I don't think it has to look like this, right?
>>
>>61979146
Arguments against? Not them, just curious
>>
How do I make a RAM/HDD flooding program?
Best idea I have is

while(new(std::nothrow) char[1024])
;

It eventually fills the page memory as well, but everything fixes itself after restarting.
>>
>>61979151
If there's no plugin to find the library you want it's just way easier to write the Makefile by hand.
>>
>>61979159
while(1) {
malloc(1000000);
}
>>
>>61979170
I am fairly certain that does the same thing and isn't permanent.
>>
>>61979159
spawn new program such that your flooder doesn't die even if you close one.
Add handler for signals that terminate program.
>>
>>61979159
No portable way
>>
>>61979159
>new(std::nothrow)
This is a thing?
>>
>>61979202
Sunds slick but I want to spam actual files everywhere.
Lke, n amount of m-megabyte files in most important folders.
>>
>>61979191
you want to fill HDD space?
while(1) {
int f = open("test", O_WRONLY);
write(f, whatever, whatever);
sync(f);
close(f);
}
>>
>>61979211
Instead of throwing an exception, it returns NULL.
>>61979224
Thanks. Which library is that using? Can it work on fstream?
>>
>>61979232
It's using the C standard library. I don't know much about C++, can't help you there
>>
What programs do you use for code?
>>
>>61979232
I think those are Linux system calls
>>
>>61979245
So your idea is to make one huge file?
>>
>>61979232
I can tell that, but I never knew you could do it. The only time I recognize syntax like that is placement new.
I always thought you had to overload operator new to achieve exception-free new.
>>
>>61979220
just fopen files in the desired locations and fwrite x zeroes until you achieve the desired size
>>
>>61979249
Atom with lots of comfy packages

>>61979261
This but you'll need filesystem-specific routines
>>
>>61979261
Can't I just smack the write pointer 2 million bits ahead and write a digit?
>>
>>61979253
Yeah, but you can modify it to do whatever you want. Maybe change the filename every iteration, or put a specific number of files in particular folders, etc
>>
>>61979269
no you don't, fopen and fwrite are standard library functions
>>
>>61979220
You should just create files, you don't need to write anything in them. The files will still be 4096k.
Also you should have some special characters in the name, it might confuse the shell if user wants to delete them from terminal.
>>
>>61979279
To iterate through the filesystem, no? If I wanted to write an annoying worm that filled every folder you have with junk, for example?
>>
>>61979289
you can use dirent.h on windows at least, the only issue arises when dealing with unicode filenames as windows uses UTF-16 so you'll need to use MS' wchar APIs there. if you stick to ANSI paths you'll be fine
>>
>>61979259
>placement new
Hmm? Can you tl;dr it becaue google is confusing me
>>
>>61977829
no it isn't
>>
>>61979331

constructing something in memory you already have allocated
>>
File: good_lord.webm (2MB, 540x720px) Image search: [Google]
good_lord.webm
2MB, 540x720px
Building out the back end plstform, database, client Android app, and admin webapp for a medical prototyping company. All by myself, trying to finish it before school starts up in a few weeks while working full time wanting to kill myself maintaining outdated military software built in flash. Yes, fucking flash. I tend to bite off more than I can chew but oh well. Springboot is a lifesaver though.
>>
>>61979355
I need more, anon. Please
>>
>>61979331
Obj *ptr = operator new(sizeof *ptr); // allocate memory without constructing
new (ptr) Obj; // construct in preallocated memory
>>
File: ow_cosplay.png (888KB, 673x941px) Image search: [Google]
ow_cosplay.png
888KB, 673x941px
>>61979370
It's all I got senpai. I too am looking for more.
>>
File: 1292691138197.jpg (47KB, 296x286px) Image search: [Google]
1292691138197.jpg
47KB, 296x286px
>yfw the valgrind comes up clean first try after spending hours writing non-stop without testing
>>
File: photo.jpg (37KB, 900x900px) Image search: [Google]
photo.jpg
37KB, 900x900px
>>61979148
it doesn't have to but often does. its the matlab way
>>
>>61979373
>construct
Is the default constructor called?
>>
>>61979510
If one exists, yes
>>
>>61979510
You can call placement new with arguments.
>>
>>61979523
Is it good practice to leave the default constructor blank and never use the upper example?
>>
Learning C++. I don't want to work as a web-monkey for my entire life (C# ASP .NET MVC dev)

i also know C more or less
>>
>>61978619
Okay so in regard to that post, I'm trying to use this:
Double[] nums = Array.ConvertAll<string,double>(stringWithCSVs.Split(','), double.Parse);


But after I build the program, it crashes there. I've made 100% sure the string I am sending it is correct (checking chars until a /n arrives before I readline() to make sure no fucky bytes are read, and then printing the string into a textbox to double check the string) and still no love.

I am using Visual Studio 2005 (.Net 2.0) could that be the problem?
>>
>>61979711
Oh and any fucky capitalization can be ignored, I'm phoneposting without my code in front of me
>>
>>61979701
So what's your question lmao.
>>
What music do you listen to while you kode???


If it's anime please don't even reply to this post. I don't want to even see it.
>>
>>61979727

Nothing, just saying what i'm currently doing. Sadly i can't study C++ except for weekends, no time. I'm so tired after work that i can't even jack off.

Almost finished Lippman's book, enjoying Seepple for now, doesn't look that bad.
>>
>>61979754
Why don't you just learn java? Seriously.
>>
>>61979753
https://www.youtube.com/watch?v=Qx10GYoneME
>>
>>61979768

Are you kidding me? Java is a piece of fucking shit. I tried learning it before becoming C# dev and i vomited week after i started.

C# Is Java if it was good. I learned it in 4 months after C and started working in 6 months, lol.
>>
>>61979801
C++ is just as fucking bad.
>>
>>61979812

C++ is at least brainfuckingly fun. Java is pajeet tier, i can't handle it.
>>
>>61979830
>the pot calling the kettle black
>>
>>61979830
>brainfuckingly fun
You either suck at it or are actually autistic.
>>
>>61979801
C# is just Java with tons of shit heaped on.
>>
>>61979841

I'm autistic. I like C and system programming, i like C++ right not because i'm not far into it yet. Maybe it sucks later.

>>61979844

C# has a lot of useful syntax sugar compared to Java. It's better.

And not only syntax sugar. It's functionality is much wider.
>>
>>61979857
>later
There's an exact point where C++ turns to dogshit, it's when you stop writing advanced C and begin following crazy senseless paradigms.
>>
>>61979857
Most of the new functionality just reduces clarity.
>>
>>61979863

Oh, i'm not planning to write pure "modern C++" code anon. But there are quite few useful functions and paradigms in C++ which i'd mix with pure C code.

Honestly, i'm just tired of reinventing bicycle in C sometimes. C++ can handle such situations.
>>
>>61979873
Every new C++ feature added is to fix an old C++ feature.
>>
>>61979863
I use C++ like C with classes. I write my own containers which internally use void * but are created with factory templates for the type-safety — other than that, I stay away from templates. I like RAII. I like having the built-in vtable if I want it.
>>
>>61979877

Also i'm too stupid for using pointers withtout RAII and not fucking something up, i think.

Maybe not stupid but certainly i have concentration problems and low energy
>>
>>61979899
All C++tards confirmed for being too stupid for C.
>>
>>61979909

Maybe, anon. Maybe.
>>
>>61979899
you just have low stamina. sad.
>>
>>61979909
wtf is the point if you're not developing a kernel or some low level shit. Using C# for windows programs is simple and there's tons of dev tools to port your program to basically any modern OS.
>>
>>61979909
Too unwise, yes. They are more than intelligent for taking 20 things into consideration at the same time.
>>
Is this true?

>>>/v/387588080
>>
>>61979929
No.
>>
>>61979929

No. C will never die in nearest future.
>>
>>61979929
the answer to every /v/ crosspost, in the dpt, should be "no"
>>
>>61979897
>I write my own containers which internally use void * but are created with factory templates for the type-safety — other than that, I stay away from templates.
That's cool.
>>
>>61979941
Type erasure a la Java. There's probably a cooler way to do it but it works for me.
>>
Name my OS, /dpt/
>>
>>61979954
anonix
>>
>>61979899
Ask the doc for some ritalin and start contributing to society faggot
>>
Seriously?

>>>/v/387589096
>>
>>61979929
I think they're right in the context of games
>>
>>61980008
Everything he said is true except Sublime is a great editor
>>
might try the new stack2nix on a project; as I was told this one is pretty good so hopefully can replace the internal version I wrote
>>
Is it valid C to initliaise an array in a seperate function and return a pointer to the array, or will the full array be deleted as it was initialised as a local?
>>
>>61980502
use malloc?
>>
>>61980514
Don't heap allocate if you don't have to. Stack allocate an array then pass a pointer to the initialization function.
>>
>>61980514

I'm just asking if it will be deleted or not, I've not got onto the stdlib functions yet.
>>
>>61980518
Yes.
>>
>>61980518
it'll be removed when it leaves scope.

do what >>61980516 is suggesting and allocate it in the caller and pass it to the callee via a pointer.
but if the callee is creating the object, then you have to malloc it to keep it alive after the stack frame changes
>>
New thread when?
>>
>>61980540
>>61980516
>>61980514

Aite, cheers.
>>
>>61980550
New thread is here:

>>>/v/387587587
>>>/v/387587587
>>>/v/387587587
>>
>*** stack smashing detected *** on program termination
>add a std::cout as the last line in main, right before return
>the stack smashing message goes away

How does C++ work?
>>
>>61980570
谢谢
>>
Lazy fucks

>>61980634
>>
>>61980596
It'a libc, not c++.
Thread posts: 328
Thread images: 28


[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.