[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: 331
Thread images: 29

OBJECT-ORIENTED PROGRAMMING DISCO

NO MULTIPLE CLASS INHERITANCE

STATIC TYPING

RESTRICTED TYPE INFERENCE

NO USER-DEFINED OPERATOR OVERLOADING

PASS-BY-VALUE ONLY

JAVA FOR THE LAVA
>>
>>52664756
op is a faggot
>>
>>52664756
this thread is fucking gay
>>
>>52664756
<html>op is a faggot
>>
OLD THREAD

>>52658863
>>
>>52664756
import gay sex
print op is a faggot
goto kill you're self
>>
PYTHON MASTER RACE
Y
T
H
O
N
>>
>>52664799
>python
faggot
>>
>>52664789
>looking at the past
>not realizing you're increasing suffering
>>
what's the story on op's pic?
>>
>>52664860

Giving attention to programming
>>
Python is the best language. Even nasa uses it.
>>
>>52664785
You're now google certified.
>>
What's the best way to learn programming?

AS in CS, BS in CS, Boot Camps, or Self taught?
>>
Anyone know why on earth maths would work differently on two different machines?

It's on .NET 4.5.2, both machines have it installed.


3.55*9.5*1.4=47.215
but the result the other machine is getting is 80.47

Why in the fuck would this be happening?
>>
>>52665485
I don't believe you. Unless you are doing something exceptionally stupid involving this:
https://en.wikipedia.org/wiki/Endianness
>>
>>52664756
Epic meme, dude.
>>
>>52665527
It's definitely happening, I ended up using an expression evaluator because it seemed to fix the problem before (but it required the other machine to type up the formula).

But this doesn't work now either, I don't understand it at all.
>>
>>52665551
No code = no advice.
>>
>>52665551
>expression evaluator
What the fuck are you doing.
What programming language is this?
Either you are doing something stupid or the people who implemented the interpreter/compiler are doing something stupid.
>>
Reminder that static typing leads to Enterprise Tierâ„¢ programs and is considered harmful.

>AbstractSingletonListenerBeanFactory
>>
>>52664756
JAVA is cancer
LOOK AT THE READ CELLS ON THE JAVA SIDE:
https://en.wikipedia.org/wiki/Comparison_of_C_Sharp_and_Java

TOP FUCKING KEK
>>
File: eVnIHIQ.png (7KB, 418x89px) Image search: [Google]
eVnIHIQ.png
7KB, 418x89px
>>52665563
>>52665572
It's not going to be of any use to look at my code. Because the maths works fine on my machine and completely wrong on his.

If I replaced all this with just standard math (double result = 3.55 * 9.50 * 1.40) it'd yield the exact same result.

The only reason I use the expression evaluator is because it worked before (but it required the user to set up the formula themselves)

Could it be an issue with some kind of culture based thing? They're using the .NET framework in a different language (Same version)
>>
>>52665587
red cells****
>>
First for Github's outage.
>>
>>52665587
You're really fitting in.
>>
>>52665591
In some languages the . is the thousand seperator and , is the decimal seperator.
>>
>>52665591
My guess would be - different input or different locale.
>>
>ActorBeanFactoryServiceGeneratorFactory
>>
>>52665627
But that shouldn't make a difference should it? If it's a simple bit of math in the code how would it magically come up with 80.47 instead of 47.215?

I tried replacing the "." with "," on my machine and it just immediately crashed the program.

Clearly that cant be the issue.
>>
File: mathsinjava.jpg (57KB, 674x490px) Image search: [Google]
mathsinjava.jpg
57KB, 674x490px
>>52665575
>>52665643
>>
>SingletonFactoryStatusCheckerServiceBean
>>
>>52665635
>>52665627
There is no way this should have any impact on
>double result = 3.55 * 9.50 * 1.40

>>52665591
First of all drop as much unnecessary junk as possible. Don't use Expression, don't use String.Format, verify it works on both machines then add things 1 by 1 until you find the culprit.
>>
Is python good to learn?
>>
>>52664756
blood on grills face makes my cock diamonds
>>
>>52667449
yes
>>
>>52667497
That's a rather specific fetish.
>>
>>52664756
i dont believe in anything that bleeds for a week and doesnt die.
>>
>>52667449
Do you suck dicks?
>>
>>52664967
Java is best language. Even White House uses it.
>>
faggot

literally 150 posts early
>>
In my experience, in order of fun factor:
C# > C++ > Java > web shit
>>
>>52670264
WRONG
C++ > C# > webcancer > Java
>>
>>52670413
C# with linq > anything else
when dealing with a lot of collections anyway

And anything involving javascript is automatically bottom of the barrel
>>
Was the OP image deleted because it was trap fag
>>
What are the chances of me bullshitting my way into getting real analysis to count as a cs course
>>
>C# shilling
where the fuck am i
>>
>>52670543
Pretty high. You'll have even better chances switching an off-domain course choice to it, though (that's literally what I did). Go to your undergrad advisor to make sure everything's in order.
>>
Asking experts - what language should I learn to make my own games in Unity?
How should I approach this?
>>
>>52670694
C#
>>
>>52670694
>unity
Suicide.
>>
>>52670816

Ok, so I should code my own engine?
I'm not going to be able to do it in the next 3 years if I start learning today, right?
>>
>>52670875
Depends
A 2d engine/framework is pretty easy
3d - no
>>
>>52670898

I was thinking about 2d engine
>>
>>52670898
How is a basic 3D engine significantly harder than a 2D one?
>>
>>52665326
typical Cshart

CPUs use differently sized FP registers. in java you'd just use the strictfp keyword to get the same result across different computers.
>>
>>52665587
more "features" != better
>>
Looking for some critique on my code. I'm just learning C and what I am trying to do is
1. Read a char from stdin
2. Append it to a dynamically allocated buffer
3. print the string stored in the buffer to stdout

Or is it better to have an array with a fixed length as a buffer? What I was trying to do is save memory (not that it really matters in this case, just for practice).

#include <stdio.h>
#include <stdlib.h>

int main ()
{
char *buffer;
unsigned int len = 0;

buffer = (char *) malloc(sizeof(char) * len);

printf("echo> ");

while (1) {
char c = getchar();
len++;

buffer = (char *) realloc(buffer, len * sizeof(char));

if (c == 10) {
buffer[len - 1] = (char) 0;
break;
} else {
buffer[len - 1] = c;
}
}

printf("%s\n", buffer);
free(buffer);
}
>>
>>52670922
Try it yourself bub.
>>
>>52670875
write your own engine if you're interested in programming and care about quality

otherwise fuck off to >>>/vg/agdg
>>
>unironically making a thread ONE HUNDRED AND FIFTY POSTS EARLY
>mods don't do anything about it
4chan is dead.
>>
>>52670922
A basic 3d engine is doable as well
The moment things get rather difficult is when you want good-looking lighting
And of course integrating physics / audio / different input devices / all kinds of 3d model formats takes time as well
Not to mention a good editor
>>
>>52671065
how is this thread early you tard? the previous is >>52658863 and this was posted at like 310+
>>
>>52670988
Allocate a reasonable fixed size of bytes first, let's say 1024 bytes, then of you need to store more than that size, realloc other 1024 bytes more, and so on.
>>
>>52671132
>being clinically retarded
>2016
Wew laddies.
>>
>>52671181
check the timestamps

unless there's a third thread that no one has linked to or anything then you're wrong
>>
>>52671220
ok there's >>52664670

lmao kill yourselves
>>
>>52671220
Found the inbred.
>>
Fag
Fag
Fag
>>
>>52671337
it still wasn't 150 posts early

it was posted around the same time as the other one
>>
>>52671140
For what reason?
>>
>>52671366
Being inbred must be nice. Not a single responsibility, no need to try to make good posts, shitposting all day err day without a worry in the world. Am I far off? Tell us your story!
>>
>>52671394
Because memory allocation is slow, reserving some bytes from start will speed up it.
>>
>>52671511
Thanks for the tip
>>
>campus computational cluster uses queue system
>queues run on nodes with no external network connection
>need to reference genomic features with the biomaRt package
>biomaRt is an R frontend for submitting queries to the ENSEMBL servers' databases
>can't reach ENSEMBL servers from job nodes
>absolutely no help on which ENSEMBL data dumps are necessary for working biomaRt local installation
>can't even run a mysql server on the cluster anyway so this is pointless
>>
>>52670640
Well Ive already taken set theory. Im going to take real this semester though. CS advisor doesnt know anything. But the chair of the math department is also in the cs department so theres some hope
>>
>>52664756
OP, did you remove the image?
Whoever did it is a faggot and i want to say that i took a screenshot and cropped it.
>>
>>52671775
It was one of hiroshima nagasaki's janitors.
>>
>>52671807
you mean hiroshima kawasaki?
>>
>>52671775
you can find the original pic on an archive site like rebeccablacktech.com/g
>>
File: laptimetest.webm (3MB, 1280x720px) Image search: [Google]
laptimetest.webm
3MB, 1280x720px
Do you like me bomb gee?
>>
I want to do Android development but I don't have an Android device. Any suggestions on which device(s) to get?
>>
>>52672267

The nexus devices are always refered to as "developer devices" - the old nexus 6 should probably be decently cheap now.
>>
>>52672299
Thank you for the suggestion. What makes Nexus devices developer-oriented?
>>
>>52672267
get one with snapdragon 800 (adreno 330 GPU) or better

it doesn't have to be very expensive

sony xperia z ultra has a large screen with very responsive touch

if you can get multiple devices then get ones from different manufacturers (they have different quirks like with audio and touch input) and ones from different price classes
>>
>>52672267
>>52672299
>>52672341

Or you could use AVD
>>
>>52672357
you should have at least 1 physical device imo

preferably quite a few devices if you can afford it depending on what you're doing
>>
>>52671944
print "allah akbar" when it turns on
>>
File: 1451549658590.png (201KB, 462x312px) Image search: [Google]
1451549658590.png
201KB, 462x312px
I want the edges of a matrix to not be modified while doing something, but I can't manage to get the last two rows/columns processed no matter what conditions I use. If I raise it by one I get an out of bounds exception, so it's not that simple.

if(i!=0&&j!=0&&i!=S.length-1&&j!=S.length-1){
B[i][j]=3*S[i][j]+(S[i][j-1]+S[i][j+1]+S[i-1][j]+S[i+1][j]);
}


Please help, I'm sure I'm doing something really retarded.
>>
>>52672422
it looks like your spacebar might be broken, or you have no thumbs
>>
>>52672422
for(int i = 1; i != S.length - 1; ++i)
for(int j = 1; i != S.length - 1; ++j)
>>
>>52672478
whoops j != S.length - 1 on the second one

if you're iterating through all of them anyway try
if(i!=0&&j!=0&&i<S.length-1&&j<S.length-1)
>>
>>52672478
Yeah, there's a reason I didn't do that, I just simplified it because I was pretty sure the problem was in the condition.

But now I realize I'm probably a retard and "fin" isn't generated correctly.
>>
>>52672422
why don't you merge the conditions with whatever you are using to iterate i and j
>>
File: file.png (5KB, 547x212px) Image search: [Google]
file.png
5KB, 547x212px
>>52672516
>>52672519
shit, forgot image

>>52672514
Already tried, but no worries, I think it was the other thing.
>>
>>52672534
It was that, problem fixed. I was retarded after all.

Thanks anyway /g/.
>>
>>52672534
java truly is the most readable language
>>
>>52672551
It's 60% java 40% my terrible coding practice
>>
>>52672534
>unnecessary if
>>
>>52672581
If you have a way of doing that without a single int pls illuminate me.
>>
>>52672609
for(int i = ini; i < fin - 1; ++i)
for(int j = 1; j < S.length - 1; ++j)
>>
>>52672631
I was going to add an else later to deal with the edge cases, nerd.
Also you didn't take into account that ini can be 0 and that fin can be S.length, which are both guaranteed to happen at least once per program.
>>
>just want to try composing some game music
>get extremely uncomfortable stringing itching sensations in my back, neck and head like some sort of inflammatory allergic reaction every time
REEEEEEEEEEEEEEEEEEEEEEEEEE
>>
>>52672689
>stringing
stinging
>>
This thread has turned to trash
>>
>>52672704
>t. tripfag
>>
The difference in culture between the C and Lua channels on Freenode is incredible.

Maybe it's just because the C guys are just inherently disgruntled, and Lua is a happy language.
>>
>>52673088
Lua is a gay language indeed
>>
>>52664785
look I can hack
>>
File: shit.png (94KB, 969x735px) Image search: [Google]
shit.png
94KB, 969x735px
this is fucking amateurish shitware fucking kill themselves
>>
i'm not even going to bother with music for now because composing it and synthesizing sounds is a giant pain in the ass and i don't want my variation of https://www.youtube.com/watch?v=MqZgoNRERY8 either because it's not really a great music track
>>
>>52673525
>that shitty MS Sans Serif edit
My sides
>>
File: Screenshot_20160128-174918.png (1019KB, 1080x1920px) Image search: [Google]
Screenshot_20160128-174918.png
1019KB, 1080x1920px
>>52671906
>>52671807
It's not about the image, i screencapped it when it was in the catalog but was deleted in the thread.
It's about the janitor being such a huge faggot he couldn't handle it.
It does not even remotely violate the rules, some threads start with an even more objectionable image and those images don't get removed.
>>
>>52673621
yes whoever deleted it is a massive faggot but just in case you want to have the full quality version of the pic you can find it on rebeccablacktech
>>
>>52673654
I have a 2K screen so the screencap probably went right.
Just crop and move and on.
>>
File: 1453964185926.jpg (34KB, 392x391px) Image search: [Google]
1453964185926.jpg
34KB, 392x391px
>>52673691
well it got resized at least
>>
>>52673713
+1
>>
>>52673088
##c on freenode is a shithole. People in there have no clue how to do any kind of c whatsoever and you'll learn more about c if you went to #lisp
>>
>>52673621
The worst is that this thread violates the rules but it's allowed to stay up even though a jani was confirmed to have seen the thread since they deleted the image.
>>
>>52673789
Hdym violate the rules?
I wouldn't know what it violates except b-tier content (OP's capslock)
>>
fuck yeah my todo list isn't very large

except i kinda want music ;_; and i don't want to license some crappy stock music and add many megabytes to the file size of this tiny little arcade game
>>
>>52673525
Why are you not using pirated FLStudio?
>>
>>52673525
Use Sunvox, fucker
>>
>>52673961
i have FL studio 10 already installed

do you think it would take long for me to learn how to use it? i just want like 4 instruments at a time and i want to be able to play with different rhythms like 6/8 (123,123 or 12,12,12) on drums for example combined with 4/4 on some other instruments
>>
>>52673998
It used to be the easiest one to learn, not sure about now. It definitely looks better than yours. Usually popular software is easy to learn, or it wouldn't be popular.
>>
>>52673937
there are tons of retards that upload decent libre music on newgrounds and other websites, try that
>>
>>52673525
RENOISE
E
N
O
I
S
E
>>
>>52674029
might give it a go, i think i'll work on something else first though.

>>52674049
i've listened to quite a few moddb tracks in the past and especially the public domain ones aren't that great or don't fit my particular game but good idea although i'd prefer to make my own music unless it's going to take more than a month or two to get something decent
>>
>>52674088
>i'd prefer to make my own music unless it's going to take more than a month or two to get something decent
if you're an absolute beginner you'll be completely lost. there's a reason why the vast majority of musicians (which already requires tons of practice and some kind of education to learn) can't compose for shit
>>
>>52674110
i've watched the entire "TTC - how music and mathematics relate" and i've downloaded a bunch of ebooks on music theory and composing and such and i know a bit of physics, math with the waves, logarithmic scales and such but yeah i know i might be in way over my head on this one
>>
File: 1453653438419.gif (147KB, 850x613px) Image search: [Google]
1453653438419.gif
147KB, 850x613px
Anyone got any good ideas for a simple, yet fun zelda game?
>>
>>52674319
Idk, but if someone does, i might make some app for it and put it on the appstore for $4
>>
>>52664756
Java a literal shit, reminder to use D
>>
Hello. :)
>>
>>52675043
Weird way to spell ocaml, bro.
>>
>lisp
>haskell
>f#
>d
>ocaml
which meme lang will you insufferable spergs shill next?
>>
>>52675175

One of those is not like the others.
>>
>>52675175
c# because it actually fucking sucks
>>
>>52675005
>When his shitty language is attacked, the Javafag lashes out at an imagined group of C users, usually resorting to ad hominems to defend against any and all criticisms. Another common defense seen by Pajeet, usually in response to the criticism that "Java doesn't have X", is "Well you don't need X"
>>
>>52675197
ok the d one was a bit cruel i actually have it on the official approved languages list
>>
>>52675216

Exactly.
>>
>>52675212

desu, Cmen get pretty salty, too.
>>
>>52675251
Yeah, but it's funnier watching the resident Javafag sperg out
>>
>>52664761
>>52664771
>>52664785
>Posts exactly 61 seconds apart
>Samefagging this hard
>>
>>52675270

Fair enough.
>>
>>52673713
>memegenerator
I don't think it was the janitor at all.
OP felt too much shame for using watermarked maymays, deleted their own image.
>>
>>52675216
>official approved languages list

Explain.
>>
>>52675175
F# desu
>>
>>52675396
The official approved languages list:
>C++
>Java
>C#
>D
>>
>>52675216
>ok the the worst language on the list was a bit cruel i actually have it on the official approved languages list
>>
>>52675175
I think I'll go back to shilling opendylan.
You?
>>
>>52675441
Whoops, typo
*the best language
>>
>>52675436
take out Java, c#, and D and it'll be perfect
>>
>>52675436
JUST
ENTERPRISE MY SHIT UP SENPAI
>>
>>52675462
>C++
>perfect

hue
>>
So I have this [spoiler]Java[/spoiler] program that generates a.json and b.json. I'm then reading those files in another program later.

Problem is: When I run two instances, of course those a and b files get overwritten randomly and it all breaks. What's the preferred way to do this? Add an "output filename" parameter? Can I pipe two files to stdout without it getting complicated?

I do have the sourcecode and can recompile.
>>
>>52675533
What are you trying to do? Why do you have things set up that way in the first place?
>>
>>52675533
implement RMI and have the server handle file concurrency :^)
>>
>>52675579
I'm trying to integrate it into a webservice, the .jar does some calculations on a database and I'm doing some filtering on the output to make it look nice

>>52675615
That uuh... sounds complicated
>>
>>52675436
Are you just trying to put people off C# and D completely by associating them with utter dogshite?
>>
>>52675691
I was jesting, but if it's a webservice don't you need only one instance, for the server?

Generate a hash filename for a json and b json then create a c.json and append the latest generated filenames, have the other program use the third file and access all the files dynamically.

But really you must be doing something wrong.
>>
>>52675750
>Generate a hash filename for a json and b json then create a c.json and append the latest generated filenames, have the other program use the third file and access all the files dynamically.
I guess that would be the easiest solution
>But really you must be doing something wrong.
I know...
>>
>>52675777
Wait. Please don't tell me you're running two instances of the same program to make it run faster.

Please tell me you know how to use concurrency with java. Please.
>>
>>52675805
No I don't do that. I just want to run multiple instances that produce different output, at the same time (because there would be multiple users using this thing). I'm adding a hash to the filenames now.
>>
I'm working on a website in Flask for the first time and I have data in a tree that I want to show to the user. I'm sending it to the browser with JSON like this:
<script type="text/javascript">
$(function () {
render({{ tree|tojson }})
})
</script>

and using a JS function render defined in another file to show the data. I did this more or less without thinking, but now it seems like a wrong place to use JS. Shouldn't I be generating the HTML on the server? It seems like this is what the templating library provided is for, but it isn't a trivial conversion to HTML. I'd have to write a procedure that generates HTML as a string, which seems wrong. Does anyone have any recommendations for generating the HTML? For what it's worth, the data I'm using is just a named tuple with one field for info and the second for a list of children.
>>
File: file.png (3KB, 481x49px) Image search: [Google]
file.png
3KB, 481x49px
>>52675829
>I just want to run multiple instances that produce different output, at the same time
>>
>>52674319
Does anyone know what language that is?
>>
>>52675861
I don't do it to make it run faster, but just to allow different output to different users based on their input parameters. I don't know, what's wrong with that?
>>
>>52675881
CHIP-8 assembly
>>
>>52674319
yeah but did you code a rollercoaster simulation game? I thought so
>>
>>52675984
Neat, thanks! I've never seen it before even though I've read a little about CHIP-8.
>>
>>52675691
But why is it saving the json files locally?
>>
If you disassemble roller coaster tycoon, will the variables still be named or will they be stripped?
>>
>>52664756
/sci/ here, we need your expert code monkey knowledge.

>>>/sci/7817700
>>
File: coltons_map_1852.jpg (669KB, 1600x1152px) Image search: [Google]
coltons_map_1852.jpg
669KB, 1600x1152px
Are neural networks for video games just a meme?
>>
>>52676460
> for video games
Yes.
>>
Is C worth learning?
>>
>>52675853
Never mind, pretty sure I have the right solution now.
>>
>>52676533
Do you like pain and no jobs?
>>
>>52676533
Yeah but not because you'll really have to use it anywhere. Just learn the basics. It improves your understanding of existing software and programming languages. You'll also be able to write a fast and efficient procedure for use via FFI if you ever need it.
>>
going to switch to C because C++ is annoying me
>>
>>52676651
Enjoy three orders of magnitude more annoyance.
>>
>>52676731
But C++ is an ugly clusterfuck. C is actually elegant and nice to write.
>>
>>52676651
that's retarded - or you don't know what you're talking about

just use C++ tools and don't write things C++ adds if you're so against it
>>
>>52676766
HAHAHAHAHAHAHAHHAHAHAA!
Good joke anon, tell it again!
>>
>>52676651
As who likes his C
Don't
>>
>>52676454
>Java is okay because it looks like C++ but lacks expression. But being honest, C lacks expression when compared to C++ but this is justified by it existing decades before C++. It is beautiful simply by being the father of the most beautiful programming language.
>lacks expression
>C++
>beautiful
wat
>>
>>52676789
Are you seriously implying that C++ is not an ugly clusterfuck?
Good joke, tell it again.
>>
>>52676798
*As a man who likes his C
Jesus
>>
>>52676651
In 99% of cases you shouldn't need C. Maybe even more. Switch to a language like Rust or D or whatever else is happening these days if need the speed. Otherwise use a nicer language.

>>52676789
C's bad, but if you think C++ is better you probably never learned how to write C properly.
>>
>>52676825
>>52676807

If you think C++ isn't a billion times better than C, you don't know the first thing about C++.
>>
>>52676913
If you think C++ is even close to being a valid replacement for C, you don't know the first thing about either language.
>>
>>52676938
If you think otherwise, you're about as smart and knowledgeable on the subject as my left foot's fungus.
>>
>>52676938
>>52677008
Just fuck already.
>>
If you think anything about anything, then you clearly don't know the first thing about anything or anything about anything else.
>>
wew
>>
>>52675658
You should totally try to do that shit in Ruby
(calling C libraries for whatever needs the performance)
>>
hey guys, first time posting here
I'm in college and I don't have a lot of programming experience, the most complex thing we've done so far is a Donkey Kong clone on java, I also know some C, Assembler and Pascal.
Now I'm on vacation but I have this constant feel that I want to do something useful but I just don't know what, so I'm for some inspiration I guess..
I thought about making a website where you can "read" these old text adventure books called Choose your own Adventure (I don't know if you had them in murrica), basically you follow a story and at the end of the page you are given a few options and jump to another page based on what you've chosen.
>>
>>52677552
fizzbuzz
>>
>>52677552
>I also know some C, Assembler and Pascal.
spotted the nazi
>>
Hey /dpt/

#include <iostream>

class Test {
private:
int n;
public:
Test (int n);
~Test ();
int getN ();
};

Test::Test (int n) : n (n) {
std::cerr << "new " << this << std::endl;
}

Test::~Test () {
std::cerr << "del " << this << std::endl;
}

int Test::getN () {
return this->n;
}

std::ostream &operator << (std::ostream &os, Test test) {
return os << "(" << &test << " " << test.getN () << ")";
}

int main () {
Test test (42);
std::cout << test << std::endl;
return 0;
}


I run that code but I obtain a strange output

new 0x7ffe7d475f60
(0x7ffe7d475f70 42)
del 0x7ffe7d475f70
del 0x7ffe7d475f60


Why do I have 2 destruction and 1 construction. WTF is happening?
>>
File: 1441684460338.jpg (92KB, 1280x720px) Image search: [Google]
1441684460338.jpg
92KB, 1280x720px
>>52677596
>That code
How the hell do people defend that shit?
>>
>>52677652
It's just a test. Please enlighten me.
>>
>>52677658
I'm no Sepples fag, but I assume it's because this clusterfuck:
std::ostream &operator << (std::ostream &os, Test test) {

is making a copy of the argument, which is then destructed after that function, then the original is destructed in main.
>>
>>52677596 (me)
destructors are called by function with argument as value. But constructors are not called.

AND SOME STILL DON'T GET WHY C++ IS ABSOLUTELY DISGUSTING.
>>
>>52677687
Nobody's fault that you're retarded.
>>
About to write a language similar to python for a school project. Trying to fix some of python's deficits and add more features.

Right now it looks a little like:
Lua-like syntax (fuck not having a end-of-block identifier)
First-class functions
More sane scoping rules (like Lua's)
ADTs as part of the core language
ADTs are immutable, runtime will opportunistically use mutable operations to keep amount of copying down to optimal as possible (this allows all ADTs to be arbitrarily nestable unlike Python's)
comprehensions for all the ADTs
lazy-evaluated higher-order functions like map, reduce, etc. but you can force evaluation
coroutines for generator functions and async shit

Trying to work through the design of the class system now. Prototypal inheritance is a hell no, I actually want operator overloading, multiple dispatch, and access protection. But I've never really been much of an OO fanatic, so I'm not sure what to do. Any ideas? Also requesting any features that would improve the language and fit with what I have now.
>>
>>52677710
C++ fans will always defend their language even when huge flaws are spotted.

A destructor is called without the corresponding constructor call.
NO IT'S NOT A FLAW, YOU'RE RETARD.

Stay pleb anon.
>>
>>52677715
Choose lisp syntax instead. Or at the very least, ML syntax (ML syntax is very conductive of pattern-matching and lisp syntax is great for its unbeatable regularity).
You should make everything strict by default, with a keyword to delay the computation.
As for class, either remove them completely (use sum and product types instead, or add ML-style structs), or do them via typeclasses.
>>
>>52677745
It's too bad that you were born without a brain.
>>
>>52677596

Two conductors are called, and two destructors are called here. The constructors are the normal constructor, which takes no arguments, and had been overwritten to print it's address to stderr, and a copy constructor, which is not overwritten, bit which must necessarily be called when passing the object by value (rather than by reference or pointer) to the ostream operator overload you provided. The copy is destroyed at the end of the ostream operator call, so you will see the destructor called twice. Notice that the memory address for both calls are different.
>>
>>52677596

Two constructors*

Goddammit autocorrect. If there's any other typos there, I blame Google keyboard.
>>
I wish real life was written in Haskell.
>>
>>52677756
>(use sum and product types instead, or add ML-style structs)
Not particularly familiar with ML, how does OO work in it? I was thinking about type classes at first. Not sure about pattern matching though, that's quite a departure from python.
>>
>>52677868
I wish Haskell was written in real life.
>>
>>52677906
You wouldn't use classical OO. You would obtain either a closed or open type which contains "constructors" and optionally values. For instance,
type 'a tree = Leaf of 'a | Node of 'a tree

is the type of a tree which holds arbitrary items. One then pattern-matches to destructure the object
let do_something f = function
| Node tree -> do_something f tree
| Leaf value -> f value

With closed types, this is restricted to tree-typed objects only. With open types, anything that has a constructor called Node and another called Leaf can participate.
ML-style structs are basically like C-structs but with a functional spin (you can do functional updates on them efficiently).

If you really insist on real OO, there's smalltalk/dylan or ocaml-style OO which are both a lot nicer than "classical" OO.
>>
CONDUCTOR WE HAVE A PROBLEM
>>
>>52664793
ERROR: cannot parse "kill you're self"
>>
File: 1452403462016.png (79KB, 307x400px) Image search: [Google]
1452403462016.png
79KB, 307x400px
>Sepplesfags will try to justify the output of this program
#include <iostream>
#include <exception>

template <typename T>
class Test {
T n;
public:
Test() : n(0) {
std::cerr << "horrible " << this << std::endl;
}

Test(T n) : n(n) {
std::cerr << "shitty " << this << std::endl;

if (n % 2 != 0) {
throw std::bad_exception();
}
}

Test(const Test &old) : n(old.n / 2) {
std::cerr << "meme " << this << std::endl;
throw 7;
}

~Test() {
std::cerr << "language " << this << std::endl;
}

friend std::ostream &operator << (std::ostream &os, Test test) {
return os << "(" << &test << " " << test.n << ")";
}
};

int main ()
{
Test<int> test();
std::cout << test << std::endl;
}
>>
Hey can someone make a script to download images from http://rule34.paheal.net/ based on a search term?
>>
>>52664756

Anything that I'd be tempted to use C++ for now, I'll try to use Rust instead.
>>
>>52678458
I could, but why can't you?
You should be able to throw something together extremely quickly with python + requests + beautifulsoup.
It's good practice.
>>
>>52679072
>write 2 lines of code after importing a million different libraries to do the actual work for you
>"good practice"
haha
>>
>>52679083
If someone else has already done the work, and they've probably done it better than he can, why should he waste time reimplementing it?
What do you suggest he do it in, str8 C?
>>
>>52679083
Yeah, and those idiots who import the standard libraries need to learn to code
>>
>>52677868
>tfw no type-safe gf
>>
Any actionscript bros. Nothing big just wanna know what this does. I'm ripping textbooks from webaccess and it has each page as a .swf.
I can render it but some swf renderers simulate the action script and cause this to have "WIDTH" and "HEIGHT" in red text

dims._alpha = 0; if (gApp != eval("undefined")) { dims.unloadmovie(); dims._alpha = 0; } else { foo._visible = false; dims._alpha = 100; var tThis = this; tThis.onmousedown = function () { if (!key.isdown(68)) { foo._visible = false; dims._alpha = 0; } else { foo._visible = true; dims._alpha = 100; } }; tThis.onmouseup = function () { foo._visible = false; dims._alpha = 0; }; } stop();


im guessing gApp is some variable that a parent swf would declare
>>
>>52679124
>he doesn't first write a programming language specific to the task and then implement the solution in that
>>
>>52679119
>and they've probably done it better than he can
Why do you assume that if a library exists, it's automatically better than anything you can produce? Why not try and do it yourself? If you don't, you never actually learn how to do anything and you're just doing the equivalent of copying and pasting code from the internet. There's nothing wrong with using libraries if you're not actually interested in learning to program, but don't try and suggest that it's "good practice" to just use 3rd party libraries for everything, you're not practising anything except copy+pasting.

>>52679124
Read again, he suggested that using libraries for everything is a good way to practice programming. This is objectively false.
>>
>>52679226
>don't try and suggest that it's "good practice" to just use 3rd party libraries for everything

It usually is when you're trying to get work done.
>>
>>52679296
Read again, if you're not actually trying to learn how to program (for example, when you're working) then go ahead, but this guy is obviously trying to learn how to program and it's unhelpful to just say "use these libraries". It's like someone asking a javascript question and just being told "use x function in jQuery". Sure, it's easier to do with jQuery, but if you're trying to learn JS - why are you, well, not learning JS and just using other peoples' code?
>>
>>52679329
>this guy is obviously trying to learn how to program and it's unhelpful to just say "use these libraries".

I suppose that's true, but you don't need to implement EVERYTHING yourself.

For instance, someone who wanted to learn how to program wouldn't need to reimplement sockets. Sometimes you just learn how to use things and move on.
>>
>>52679072
mine is slow as fuck
from urllib import urlretrieve
import requests
import re
import os

searchTerm = 'foo'

def findAllBetween(string, start, end, match='(.*?)'):
regex = re.escape(start) + match + re.escape(end)
return re.findall(regex, string)

def extractImageUrls(source):
return findAllBetween(source, '<a href="', '">Image Only</a>', '([^"]+?)')

def getFileExt(url):
return url.split('.')[-1]

def getNumPages():
lastPage = findAllBetween(downloadPage(1), '<a href="/post/list/{}/'.format(searchTerm), '">Last</a>', '([0-9]+?)')
return int(lastPage[0])

def downloadPage(pageNum):
url = 'http://rule34.paheal.net/post/list/{}/{}'.format(searchTerm, pageNum)
contents = requests.get(url)
return contents.text

def makeSaveDir():
saveDir = os.path.join(os.getcwd(), searchTerm)
if not os.path.exists(saveDir):
os.makedirs(saveDir)
return saveDir

def downloadImages():
saveDir = makeSaveDir()
numPages = getNumPages()
saveFile = 1

for pageNum in range(1, numPages+1):
print 'Downloading Page: '.format(pageNum)

page = downloadPage(pageNum)
images = extractImageUrls(page)

for image in images:
filename = '{}.{}'.format(saveFile, getFileExt(image))
savePath = os.path.join(saveDir, filename)
urlretrieve(image, savePath)

saveFile += 1
print 'Saved an image.'

if __name__ == "__main__":
downloadImages()
>>
>>52679365
Sure, I agree that there's a line to be drawn somewhere, but just listing off a bunch of libraries instead of offering actual advice is unhelpful and counterproductive.
>>
File: tt.png (178KB, 2392x300px) Image search: [Google]
tt.png
178KB, 2392x300px
why can't I put a static instance of a child class in that child class' abstract base class and then access the static instance variable without getting this error

PaddleStrategyAI inherits from IPaddleStrategy, I don't get it

it also works fine if I put the static instances in their own respective classes instead of the base class; I can do that but I want to know why this isn't working before I move on, because this makes absolutely no sense to me
>>
File: fblogo.png (4KB, 300x300px) Image search: [Google]
fblogo.png
4KB, 300x300px
if(x == true){
y = true;
}
else if(x == false){
y = false;
}
>>
>>52677868
unfortunately god chose Java
>>
File: 42233472_m.jpg (120KB, 428x600px) Image search: [Google]
42233472_m.jpg
120KB, 428x600px
>>52679174
a
>>
>>52679800
MY EYES
y=false;
if(x) y=true;
>>
>>52679856
Not sure if inbred or just braindead.
>>
>>52679856
y=x;

I didn't know we have feminine coders here.
>>
>>52679884
>>52679886
true
>>
>>52679886
x isn't boolean, it's a custom type with overloaded equality and assignment operators. :-]
>>
Does C inline composed functions? like:
foo(bar(bat()))
becomes composedfunction() bat -> bar -> foo with the code from foo bar and bat all stuck together into one function?
>>
>>52679934
There must surely be a compiler option for it.
>>
>>52679934
Depends on the compiler and a whole bunch of other shit.
>>
>>52670975
In the case of type inference, user defined operators, and value types, I'd have to say that yes, more features is better.
>>
>>52679934
That's just normal inlining, and if the C compiler decides to inline the code then yes it would.
>>
>>52679998
ok charles

i for one don't use those features not even when i have them available to me
>>
>>52679906
Kill yourself.
>>
>>52679884
I'm braindead. I haven't slept all week m8.
>>
>>52680045
I use "auto" in C++ religiously and it's fucking great.
Disallowing user-defined operators would make sense if they didn't magically exist for object types like Integer and String etc. It just makes the entire language inconsistent and not very expressive.
Value types are useful but I guess not that useful if you give no shits about memory and performance, and if you avoid mutating state.
>>
New to /g/ first time poster

I recently began some mechanical engineering courses this semester and down the road they have us start learning to program in Matlab.
I wanted to look into starting into learning it ahead of schedule just to make it easier down the line.
I checked the wiki but I didn't see a recommended book/ starting point for Matlab.
Could you help a newfag out?

Also, how quality is Matlab in terms of engineering?
Should I look into learning other languages as well?
What languages would best suit my purposes post grad?
>>
>>52680205
Go back to facebook please we don't want you here.
>>
>>52680205
you'd probably get better answers in >>>/sci/questions
>>
Thinking about learning lisp but I'm not sure what it would be good for that other languages arent. If I do what should my projects mainly be doing that would be easier than in other languages?
>>
>>52680205
Not really for mechanical engineering. All the MEs I knew fucking hated programming. Learn matlab or Wolfram Mathmatica. Either one will get you there. I don't have any books, just learn as you go.
>>
>>52680242
>learning useless languages
>>
What kind of a programmer are you, /g/?


Do you program without any clear direction or do you have a clear idea what your end goal is and then program?
>>
>>52680321
Fuck off.
>>
>>52680321
At work? Desired component, desired outcome or desired behavior.
Though sometimes I start with "I think it will need this component" and things bubble together from there.

On personal projects, while architecting and thinking of all the bigger problems and more interesting systems is fun, it's very important, mentally, to get the motivation that comes with having pumped out some working component.

Even if it ends up being useless, accomplishing some "thing" subcomponent with a tiny bit of polish proves essential to the motivation to go forward.
>>
What are some good beginner tutorials for C++?

I learned BASIC back in the mid 90's and want to get back into coding.

Thanks.
>>
>>52677596
You didn't write a copy constructor for your class, so the compiler wrote one for you (because it's needed due to your passing your object by value to your op<< function). And of course the compiler-provided copy constructor doesn't print out a message. If you write your own copy constructor and put a message in there then it should make more sense.
>>
>>52680418

Covered that 3 hours ago, broseph.
>>
>>52664756
learning lisp for meme purposes
>>
>>52680321
i have an idea in broad strokes what the end goal is and then details might change and i'll add more details as i go along
>>
So now days RISC is better for direct hardware, but what's better for a virtual implementation? also RISC? or CISC?
>>
Is there a tutorial out there for making simple websites like this?

Basically, you click something and it updates the page immediately without reloading it

http://br.sidoh.org/
>>
>>52680888
this is a dumb question as far as i can tell can you just stop asking it over and over again
>>
>>52680889
>>>/g/wdg

i'm guessing it's done in javascript but it should be doable in html+css too
>>
File: 643.jpg (177KB, 1600x1200px) Image search: [Google]
643.jpg
177KB, 1600x1200px
>>52680236
>>52680262
Thanks anon

>>52680227
I wish I could
but after 6+ years of lurking this shit hole pic related seems to be more of a reality for me
>>
>>52680942
looks like javascript from inspecting it

I'll ask them if they have any tutorials for basically that too then
>>
>>52680568
okay how the fuck do I set up an environment to write lisp in?
I didn't think I'd fail this early
>>
>>52680990
install gentoo
>>
How worth it would it be to do a CS/Linguistics dual major for pursuing computational linguistics? Stuff like translation software, speech recognition, Siri-like AI, etc.

I study language on my own, and figure I could use either degree to get a job if computational linguistics falls through. Already a year into CS. Is it a big enough field to warrant the dual-major?
>>
>>52680915
But this is the first time I've asked it.
>>
>>52681077
I did a social sciences field and some CS-y stuff and it got me into one of the top 5 CS programs in the world for my phd. I figure if I had bothered to look for jobs right out of undergrad I could've gotten one no problem.

I say do it. maybe even emphasize that you're mostly a linguistics dude who happens to be able to do all the computational stuff (knowing linguistic/social sciences theory background is hard to "backfill", but it's common to pick of development/CS skills as you go)
>>
>>52681078
well i recognized the question, i might have been thinking of this:

https://archive.rebeccablacktech.com/g/thread/S50814141#p50819327
>>
>>52677985
Yeah I think I'll not have inheritance. If you want to emulate it an instance of a derived class can be kept in the object's fields. So it will act like Go's system, but with typeclasses. Also I'll stick with the concept of immutable ADTs with all objects. Changing the state of an object by modifying a field copies the objects, so the reference you use to access it points to the copy. It will simply do a mutable change to avoid the copy if the object only has a single reference. In this way every change in state makes a new branch in the data tree and shared mutable state can only be done explicitly by reassigning variables. Types will be able to be specified anywhere and errors are thrown if the type of the value is not in the subset of permitted types. It's essentially a less verbose type assert.

Generally, I think the reason that many people stay away from functional languages is that the syntax is fucking unreadable. Especially if you are coming from a C-like language.

For instance:
a = [1, 2, 3, 4]
b = a // copy not done yest
a.push(5) // copy is done, a is the reference used to change the data so a now points to a copied and updated list
print(a) => [1, 2, 3, 4, 5]
print(b) => [1, 2, 3, 4]
// might add an 'alias' keyword so you can have shared multiple state if you want, but at least it's explicit
>>
File: fun.png (5KB, 240x317px) Image search: [Google]
fun.png
5KB, 240x317px
data is code!
code is data!
homosexuality!
>>
\0
>>
File: aaaaaa.jpg (30KB, 470x466px) Image search: [Google]
aaaaaa.jpg
30KB, 470x466px
I'm just here to float all of your flexboxes to the right
>>
>>52670264
>>52670413
>C isn't the most fun
die

>>52670434
SQL a fun :^)
>>
Hey guys. I see you faggots are still angsty as usual. Anyways, do you thing rust will replace C in embedded systems in the near future or is rust just a meme?
>>
>>52676938
>C++ is a replacement for C
stop
>>
>>52681230
People just don't understand the fun we call pointers
>>52681286
Meme
>>
>>52681286

The latter, but at least it's a fun meme.
>>
>>52681286
If they're going to replace C for embedded systems, they'll need to develop something that is less than or equal to the heft of C (so not much) and simply make it more efficient :^)
>>
>>52681394
> If they're going to replace C for embedded systems
That's been happening for a while.

There isn't anything which C can do which C++ can't. In terms of code density, it's easier to perform procedural abstraction with templates than with code generated from macros or a preprocessor (or just duplicated). Templates also require fewer compromises when use a common code base in multiple products and/or on multiple architectures.

You can get C++ compilers for uCs with less than a kilobyte of RAM, and anything at or below that scale is typically done in assembler rather than C anyhow.
>>
>>52681142
Lol that was me, forgot I asked that.
I don't know anything about computer architecture other than what I've taught myself, I probably shouldn't be making virtual machines.
This is the third VM I've worked on, the other two were failures I abandoned.
Fuck it, I'm just going to go with RISC, again. Fixed length instructions are more convenient.
>>
>>52681286
No, it's just a meme.
>>
File: TLPI-front-cover.png (183KB, 454x600px) Image search: [Google]
TLPI-front-cover.png
183KB, 454x600px
Working through pic related, and doing an exercise where it's asking me to implement tee. I modified it slightly so that entering an empty line will stop the program. However I'm having trouble with getopt in that when I enter "./tee -a filename", it throws an error because optarg is null.

#include <sys/stat.h>
#include <fcntl.h>
#include "tlpi_hdr.h"

#define MAX_READ 100

int main(int argc, char *argv[])
{
int fd, opt, numRead, numWritten;
char buf[MAX_READ + 1];

if(argc < 2)
{
usageErr("%s [-a] file", argv[0]);
}
else if(argc == 2 && argv[1][0] != '-'))
{
fd = open(argv[1], O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR);
if(fd == -1)
{
errExit("open");
}
}
else
{
while((opt = getopt(argc, argv, ":a")) != -1)
{
switch(opt)
{
case 'a':
fd = open(optarg, O_WRONLY | O_APPEND | O_CREAT, S_IRUSR | S_IWUSR);
if(fd == -1)
{
errExit("open");
}
break;
case ':':
usageErr(argv[0], "Missing argument %s\n", optopt);
break;
case '?':
usageErr(argv[0], "Unrecognized option %s\n", optopt);
break;
default:
break;
}
}
}

while((numRead = read(STDIN_FILENO, buf, MAX_READ)) > 1)
{
if(numRead == -1)
{
errExit("read");
}
buf[numRead] = '\0';

numWritten = write(STDOUT_FILENO, buf, numRead + 1);
if(numWritten == -1)
{
errExit("writing to stdout");
}

numWritten = write(fd, buf, numRead + 1);
if(numWritten == -1)
{
errExit("writing to file");
}
}

close(fd);

exit(EXIT_SUCCESS);
}
>>
>>52681593
Ah shit, indentation got fucked
http://pastebin.com/Qd5ZUF9T
>>
>>52681167
wtf am i looking at senpai
>>
>>52681593
>>52681686
Figured it out, the colon goes after the character in getopt
>>
File: ac9585a9dfb1448cb087e3771249d106.jpg (432KB, 1280x853px) Image search: [Google]
ac9585a9dfb1448cb087e3771249d106.jpg
432KB, 1280x853px
>>52664756
Anyone doing stockfighter.io ? I'm just started this morning.. Doing it in lua because lua a best.
>>
File: sp42.png (10KB, 470x417px) Image search: [Google]
sp42.png
10KB, 470x417px
>>52681732

sp4.
>>
File: sp4rec.png (23KB, 556x656px) Image search: [Google]
sp4rec.png
23KB, 556x656px
>>52681827

Hmm, at least I know it supports recursion now.
>>
>>52681827
what kind of abstract meme is this?
>>
File: 1318198366001.png (87KB, 455x451px) Image search: [Google]
1318198366001.png
87KB, 455x451px
So what the fuck were the creators of spring MVC thinking?
"We want to make the smallest thing as hard to do as possible... for no reason"
or what
Anyone else who's used spring should know what I'm talking about. What the fuck were they thinking?
>>
File: ptrs3.png (15KB, 613x372px) Image search: [Google]
ptrs3.png
15KB, 613x372px
>>52681880

It's my own abstract meme. It's the second iteration of SPP (SPPPP, or SP4), but I started all over (except for the parser). All the functions work in immediate mode, so values are substituted in by *(var), or ^(var) for globals. The other major difference is that it has real functions, as you can see.
>>
I'm well versed in all the obvious languages from C to javascript to SQL etc.

What weird ass language should I now learn to stay current?
>>
>>52681956
That's really cool. How much work have you put into it and is it open source?
>>
File: CWgV0ruUsAAcUD7.jpg (155KB, 1024x1024px) Image search: [Google]
CWgV0ruUsAAcUD7.jpg
155KB, 1024x1024px
>>
>>52681953
i love spring

bean service factory 4 lyfe
>>
>>52681953
>unironically using spring
>>
>>52682043
What could possibly be in Javascript: The Good Parts?! I smell bullshit.
>>
>>52682043
I'll take "Things that never happened" for 500.
>>
>>52682068
How the fuck do I initialize a bean with a non-static constructor (and why is it so easy to instantiate beans with static constructors, that's literally useless)
All I want to do is grab the IP from the user visiting the page and then check it against an internal function to prevent DDOsing but it's being more of a pain than kidney stones.
>>
File: 1453782850239.jpg (184KB, 850x782px) Image search: [Google]
1453782850239.jpg
184KB, 850x782px
Does anyone know how this image was created?
>>
>>52682043
Nice shop.
Everyone knows real world haskell isn't a thing.
>>
well something pretty great just happened
>writing an interpreter
>just manage to get it to be able to do recursion
>it's really, really fucking slow
>it's resolving all function calls before doing any evaluation
>this results in the final input being sent to the evaluation function being a fucking enormous pile of operators and numbers
To explain why this is even more of a problem than it sounds I need to step you through something else
>resolution only goes one layer deep each iteration, i.e.
>10 fact
>10 9 fact *
>10 9 8 fact * *
>...
>10 9 8 7 ... * * * *...
this is so I can evaluate the conditions of an if statement before resolving its arguments, so I can do recursion
the result is that the resolution function is called with its own output a potentially enormous number of times, and the output grows each time
While this isn't a huge problem with factorials, when I try and run an O(2^n) recursive fibonacci function through it, it just shits itself
So I decided to break my pretty input>lex>parse>resolve>evaluate diagram and make the resolve function evaluate expressions with numeric operands with each iteration (requires adding 3 lines of code)
the result
>before: fib(25) takes like 5 minutes
>after: fib(25) takes about a second
so still pretty shit, but I think I'm going to drop this interpreter now and write an entirely different one
I now realise why using RPN instead of a tree was a terrible idea
>>
NEW THREAD!

>>52682123
>>
>>52682108
It is under fiction desu.
>>
How do you guys plan out your projects? Or do you program shit on the fly?
>>
>>52682029
>How much work have you put into it

I dunno, probably 2.5 hours yesterday and it was in the state you currently see.

It doesn't actually have any real control flow, math, etc. built in. Just the basics to test it out is all.

> is it open source

Nah, it's not serious.. just a toy.
>>
>>52682140
>How do you guys plan out your projects?
Badly.
>>
>>52682140
a bit of forethought is never a bad thing but I just plan things as they're needed
>>
>>52678358

The program prints 1. I am not entirely sure why, but I'm pretty sure it's just undefined behavior that has to do with you declaring test like this:
Test<int> test();


Which is actually declaring a function called test that takes no arguments

Instead of like this:
Test<int> test;


When done the latter way, it does this:
horrible 0x24fe20
meme 0x24fe30
terminate called after throwing an instance of 'int'

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.


Which makes sense, because you made your copy constructor throw an integer, had nothing to catch it, and then invoked the copy constructor in the ostream operator.
>>
>>52682140
on the fly and it never works out well
>>
>>52682140

Poorly, and that's why they're all half-finished garbage.

Well, except for the small ones
>>
>>52682201
^this, even if you can't plan, if you can blast through it in an hour it should still get finished at the very least unless you're autistic.
>>
>>52682103
tessellation?
>>
>>52682103

In Microsoft Paint, or similar freedom-software variant.
>>
>>52682362
>A tessellation of a flat surface is the tiling of a plane using one or more geometric shapes, called tiles, with no overlaps and no gaps. In mathematics, tessellations can be generalized to higher dimensions and a variety of geometries.

I don't think so

>>52682368
I doubt someone made this manually.
>>
>>52682140
I usually throw some initializations in there and do research. If I get past research and start implementation it usually means I'm gonna finish it.
>>
>>52682103
looks like mspaint. look in the upper left corner where the lines don't match up perfectly and the grey color is poorly filled
>>
Does any one have any ideas for projects that are difficult? Preferably something low level but not to the level where I'm building a compiler or something?
>>
File: 1445217028409.png (17KB, 651x641px) Image search: [Google]
1445217028409.png
17KB, 651x641px
>>52682380
>I doubt someone made this manually.

Why? They all do it manually.. and they do it FOR FREE
>>
File: paint.png (85KB, 1014x1088px) Image search: [Google]
paint.png
85KB, 1014x1088px
>>52682707
real funny m8
>>
>>52682083
Can you suggest me an alternative that allows me to actually have fucking constructors for the classes responsible for loading pages
Thread posts: 331
Thread images: 29


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