« first day (554 days earlier)      last day (4400 days later) » 

7:00 AM
Using mark, I forgot sorry (if you want me to redo it, I will, but the fact that it's all zeros is all that is needed really)
 
Xeo
Okay, what happens if you comment only the deleter line for ArrSearch?
 
The next one fails the same way
removing the [] in the templated deleter function seems to work though...
 
Xeo
Ouch. Yeah, that does it. You never allocate arrays of them
No new[], no delete[]
One question though.. is your prof telling you to use all those pointers?
 
I tried to use unique pointer and shared pointer, and I was told "Thats not how its done"
 
Xeo
Oh, and you shouldn't pass the type of a template parameter in a function call. Just let the compiler deduce it
 
7:04 AM
I barely managed to cinvince him to let me use nullptr (he does not like anything c++03 or beyond)
 
Xeo
Wow..
 
@Xeo, where?
 
Xeo
Dump that course
In your deleters
 
Can't it is required
 
Yeah, take what he says and filter it heavily.
 
Xeo
7:05 AM
or rather, when calling the deleters
 
so I just use <>?
 
Xeo
No, nothing
like create
 
got it, that makes sense
 
Xeo
So, working now (except the timing)?
 
Totally working in debug mode now
 
Xeo
7:07 AM
And release?
 
checking
deleting the linked list is slow
timings are still zero, but it runs
How can I convince him to move into the newer c++?
and also, is the way that I coded this clear?
 
Xeo
Most likely, you can't. But maybe show him Herb's "(Not your father's) C++) talk
 
Great video
 
Xeo
A few empty lines thrown in might be nicer to read
For main
 
got it, but as far as the templates go (as far as I know, everyone else is using ~30 for loops)
 
Xeo
7:10 AM
Speaking from a pure stylistical point of view, anyways. The code itself is bad, very bad C++
 
how so?
you mean no smart pointers?
 
Xeo
I mean the use of pointers at all, actually
Why are the array elements dynamically allocated?
 
The more delete keywords in the code, the worse it is. :)
 
Xeo
(I mean the test arrays)
 
Makes sense to me, but I don't have a choice
 
Xeo
7:11 AM
Huh? You sure do, there is no need to make those pointers. None
 
Seemed easier to do, and still valid. You are thinking hardcode them?
@Xeo, do you mean store everything on the stack?
 
Xeo
Everything in main, anyways.
 
Will do
 
Xeo
like, instead of ArrSearch* arrays[3] do just ArrSearch arrays[3].
And you will want to replace the 3 with LIST_SIZES or what it was
 
doesn't that make create uglier?
 
Xeo
7:13 AM
No need for create, just do initializer like TestArrays
 
?
the goal is to have the same data in every data structure
 
Xeo
Lemme pull up the code real quick
oh, sourceArrays it was called
 
k. I really appreciate this. Have to learn c++
 
0
A: Crash on std::cout string

Cheers and hth. - AlfBorland 5.5. only had partial support for std::string. It may well be that your code is to blame in this particular case, but even so, you will not get anywhere (and you will get nowhere very fast) trying to use std::string with that compiler. If your teacher requires you to use Borland 5.5, th...

^ Oh I answered a practical tool usage question! Wow!
 
Xeo
ArrSearch arrays[3] = {}; will default construct 3 ArrSearch
And then loop them and call populate
I don't think you even need the = {}, but just to make sure
 
7:16 AM
I don't think I do either, but basically, that is all create does
calls populate in a loop
 
Xeo
And allocates the test subjects
 
via populate, yes
 
Xeo
why do I keep saying "arrays" when I mean "test subjects"...
 
Sorry, I am not following
What test subjects?
 
Xeo
ArrSearch, BinaryTree, etc
 
7:19 AM
So isn't create doing what you want it to do, just in a templated form?
 
Xeo
brb, quick afk
 
7:52 AM
@Xeo, @GManNickG, @CheersandhthAlf, thank you for all your help. Good night
 
Night.
 
8:05 AM
Microsoft must act normal and just fix and ship clang with VS.
That would make a whole lot of people happy.
As for the language extensions: they can just fork clang.
But of course "free software" sounds too cheap and unenterprisey.
 
"Microsoft" sounds cheap too.
 
True.
But actually they are expensive. Fukken over a hundred dollars for an OS.
Or an IDE, same story.
 
@soandos no thanks for me? :'(
@classdaknok_t unless you work for / are studying in an educational institution.
they give out free visual studios to all universities.
and IT colleges
 
The pirate bay gives it out for free to me.
Or I crack the trial, whatever. I'm a hobbyist.
 
8:16 AM
Microsoft doesn't get even a single penny from me. :P
 
For me it's Unlocker v4 -> Web Proxy -> Another Web Proxy -> Piracy sites.
damn anti-piracy government. :(
 
@IntermediateHacker or, unless Microsoft decides to give it to you (like, they did that for me). :-)
 
In the Netherlands privacy is more important; nobody can see what you do on the Internet.
Not even the government. And if they can they pretend they cannot and they just shut up.
 
@CheersandhthAlf I'm not in a university yet. and they don't care about high-schools. :(
 
If you call Xbox support and tell them your controller is broken they send a new one for free, you don't even have to send in the broken one.
So you can just lie and you get a free controller. :p
 
8:19 AM
damn, wish I was in the Netherlands
why don't all those freedom internet activists get the Sultan to allow piracy sites? (looking at you Anonymous)
 
If nobody pirates your software, books or art, nobody wants it.
 
all of them were blocked by this evil company, curse them. :(
 
That website is slow as hell.
 
they are too busy blocking all other sites to bother improving their own.
 
:P
In the Netherlands we have anti-piracy.nl but they haven't got much succes. They sue ISPs but the ISPs win every time. :)
 
8:23 AM
cool.
 
Every now and then that site is being DDoS'd and it's out of service.
 
Can they sue ISPs which are out of the Netherlands?
 
Nope.
 
In the Netherlands there is even a law preventing ISPs from blocking websites. An ISP is not allowed to block any website. Nobody is.
The so-called "net neutrality" law.
Good thing.
 
8:26 AM
that's it. I'm moving to the Netherlands.
 
Watch out for Geert Wilders, the blond politician. He doesn't welcome anybody.
 
but then, there are taxes. and I doubt the salaries and job priviliges are very generous.
and I don't know Dutch.
 
If you have no money you don't have to pay any taxes. Make sure you've got no money.
2
 
You can't get the wool of a bald sheep.
 
8:37 AM
@IntermediateHacker dreamspark.com/Institution/CompareSubscription.aspx For high schools apparently only Dreamspark (not Premium) is available. But I could be wrong. Talk to your teacher(s) and headmaster. ;-)
DreamSpark Premium (formerly MSDN Academic Alliance (MSDNAA)) is a Microsoft program available to academic organizations, mainly colleges and universities, although there is also a high school version. The participating schools pay an annual fee for the service, in exchange for which, applicable departments (computer science, computer engineering, information technology, and related fields of that organization) as well as students and faculty can acquire licensed copies of Microsoft software such as Microsoft Windows, Visual Studio and other products. The list of software each college and u...
 
Meh it's earth day.
I hate the earth.
The earth is my trashcan. :P
 
8:53 AM
@CheersandhthAlf I can't find my high-school in the list of schools. :(
 
Xeo
I just invented a new diet. The "I-can't-buy-shit-because-I-have-no-money" diet.
Or, well, not invented.. but I'm at it right now.
 
Fuck, wrong button.
Wow, having no money has many advantages!
 
 
2 hours later…
10:35 AM
The last message was posted 2 hours ago. something's wrong.
You are.
 
Does anyone know any website that turns a matrix of numbers to a colored image? I need help visualizing some data.
 
10:53 AM
@PaulManta what do the numbers represent? and why are you asking here? have you looked closely at the room description?
 
somebody bored?
-2
Q: Having errors in C++ code

Huseynxanthis is my code written in C++. I am using Code::Blocks. 1st problem is whatever i do yenifayl2(); // newfile2 nizam(); //sort foxuma(); //file read fayldavam(); //file continue silme(); //delete yenifayl(); //new file ekran(); //screen daxil(); //show ...

 
Came here just to post that.
Why do people still include <conio.h>?
 
@CheersandhthAlf I know the question isn't C++ specific (my program is written in C++, though). The values in the matrices represent, at every point, the distance to certain important points in the matrix.
I figured visualizing matrix data is something useful to programmers and maybe someone here knew such a tool.
@classdaknok_t In school, people include it just for getch(), which they use just at the end of the main function, to keep the console window from closing.
 
Use a decent terminal emulator then, without one you can't do any serious software development anyway.
 
@classdaknok_t I never said they should use it, I only said why they do.
 
11:00 AM
why they do is irrelevant, what's important is that they're wrong and should be corrected
 
@PaulManta cin.get();?
 
breakpoint?
 
Launch from the command line?
 
@DeadMG Actually, cin.clear(); cin.get() would be better.
 
except breakpoints are a useful thing you have to know
hacking in a "breakpoint" by using a user input function is a silly idea
 
11:02 AM
@classdaknok_t I know, I don't like it when I'm made to use getch(), but it's what everyone is told to do. I don't use it outside of school.
 
@DeadMG And it won't get the debugger to do anything.
@PaulManta told by who? By the teacher? Tell him that it's wrong.
And if he disagrees, tell him to come over to this room and we'll teach him. :)
 
It's a she. :P
 
oh god
dont let her touch c++ then
^^
 
Anyway, can anyone help me with: Does anyone know any website that turns a matrix of numbers to a colored image? I need help visualizing some data.
 
Pen and paper works pretty well.
Model your situation, draw a subset of your matrix.
Then recursively project the subset into your whole matrix in your head.
Done.
 
11:06 AM
@ScarletAmaranth I'm not going to start drawing three 20x20 matrices, all with separate colors for each value.
 
Draw 5 * 5
 
wolframalpha.com
 
@PaulManta why a website? Can't you just put the matrix in a 2D array and map each value to a color, then use some OpenGL magic to color each pixel?
Shouldn't take more than ten minutes.
 
@classdaknok_t Ah, okay, fine I'll do it...
 
Sorry but pen is mightier than OpenGL.
 
11:12 AM
Actually, I'll probably do it in Octave.
 
That's also cool, of course.
I like OpenGL very much for visualizing 2D or 3D data.
9 mins ago, by Paul Manta
@ScarletAmaranth I'm not going to start drawing three 20x20 matrices, all with separate colors for each value.
 
@classdaknokt Thats why you model your situation and draw only an interesting subset ...
 
What if you don't yet know which subset is interesting?
And you model to find that out.
 
In that case you use OpenGL :)
 
11:26 AM
hello
 
@Captain He said one line, which I think was graphic or something, but it got removed before I saw it
@Captain I think @ScarletAmaranth saw though
Nom homemade danish pastries
Wow only one word didn't get red squiggled
 
pastries :D ?
 
Well. I kinda messed them up a little and used margarine instead of butter
So they're not the nice flaky kind
But they're still tasty
 
Didnt you make the same mistake yesterday ?
 
11:36 AM
I'm talking about the same ones :L
I didn't realise you were there
 
busted! :)
 
Cinnamon Whirl it is
I actually got the recipe from the Cookbook app on Windows 8
 
I think i'd rather stab myself in an eye with a fork than install windows 8 right now.
 
Do you have any eyes left?
 
I'm running out of eyes :(
 
11:41 AM
:L haha
 
@ScarletAmaranth buy some more.
 
What is this soda pressing meme?
 
11:55 AM
can you make a std::vector<int * const>?
 
morning
 
with pointer to consts?
 
@rubenvb nope. the element type needs to be copyable.
 
Another member of const correctness brigade ?
 
@CheersandhthAlf dang, why not? The pointers themselves should be copyable right?
or is the iterator stuff messed up in that case?
 
11:57 AM
@rubenvb you can copy an int* const, but you can't copy it to an int* const object. that is, to copy it from one place in the vector to another place, you run into the problem that the other place is of const type. not very mutable.
 
ok
C++ is stupid <s>sometimes</s> always
 
nah, top level const doesn't buy you much anyway
just make a vector<int*>.
 
or possibly use one of the "smart pointers" while we're at it :)
 
It's this question I'm talking about: stackoverflow.com/questions/10265695/…
he wants to const-protect the elements of his vector
 
Argh
I just remembered
 
12:02 PM
| it's Argv / Argc FTFY
 
Last night I deleted this long algebraic expression from my eecs homework when I was just a sign off :(
 
@rubenvb I think the practical answer, given that the OP's wish is an absolute, is to use a pointer wrapper instead of a raw pointer, then hand out a reference to const vector. that reference will then only allow a reference to const wrapper to be obtained, which in turn will only allow const access to pointee.
 
rofl
dude
it's 2012
academic titles mean nothing
 
oh fuckles
no wonder my units are not rotating in the correct direction
 
12:06 PM
o_O
that came out of blue!
 
not getting back correct results in my angular comparisons
 
@KianMayne People im in class with don't know how pointers work or why 1 / x approaches infinity is 0. yet they will be getting their "engineer" soon.
 
But
WHAT THE FUCK
@ScarletAmaranth Are you in uni?
 
@KianMayne Yes, Technicka univerzita v Kosiciach
 
Yeah
We're using differential equations though
I'm in high school and my curiosity (and my maths teacher) told me what e was
 
12:11 PM
@KianMayne yeah, you mean the uni approach just to learn an "algorithm" as to how to solve something and then apply it to one type of a problem and then youre judged by how long you spent dumbing yourself down by doing the same problem over and over again ?
 
Huh?
 
We got e defined in the fourth year of Middle School I think.
 
e is sexy, i still prefer golden slice tho ...
 
The question's answers are horrible from a fundamental mathematical point of view.
Engineers are terrible that way
 
@rubenvb Hmm, I think that it's necessary
 
12:14 PM
what's wrong with e = lim_{n->infty} (1+1/n)^n?
 
Because if you have to solve several of Maxwell's equations just to analyse something simple, you're never gonna get anything done
 
Well, physicists (like me) do so continually. We get shit done.
And it's not Maxwell you need to be worried about in modern circuits, it's the QM that'll get you.
 
But it's simpler to think conceptually and abstract the details away
 
sure, but don't you feel you need to at least know when your conceptual thinking breaks down?
 
and you're not distracted by them
 
12:16 PM
Honestly, circuits are shit :)
 
Yeah, but as my prof. says, we are careful to stay in our ' EECS Playground ' >.<
 
:P
 
@ScarletAmaranth I don't even know how to reply to this
 
Circuits are shit. I had an electronics course once, didn't understand because of stupid circuit conventions and formula's that didn't stroke with my fundamental way of thinking.
 
@KianMayne Then just assume it's correct ;)
 
12:17 PM
Hahah
But one example where abstraction is important, is when you're talking about using MOSFETs as amplifiers
 
That's true. Fact is, I never got that abstraction explained well enough. Now I feel bad each time some non-linear circuit is mentioned someplace.
 
It's much easier to pick an operating point and work with it's derivative as if it was linear
 
@KianMayne One thing where abstraction is important is to say : sub rax, 4 at which point i don't "give a care" what happens in the sodding silicon.
 
Haha, I agree
 
But I want to know what can be used to replace that silicon! :P
 
12:20 PM
@rubenvb ture dat, that would be most intriguing
@rubenvb So you study physics, got any quantum-computing basics ?
 
@rubenvb Gallium Arsenide?
 
@ScarletAmaranth nope, no quantum computing. I'm more interested in Relativistic QM.
@KianMayne too expensive. Think graphene or some photonics stuff.
 
@rubenvb So youre a fan of 2nd law of motion! :)
 
@ScarletAmaranth wut?
 
@rubenvb Which part of the sentence do you have problem comprehending :) ?
 
12:23 PM
@ScarletAmaranth Why would I be a fan of Newton's second law?
 
@rubenvb The question is, why would you NOT be :) ?
 
@ScarletAmaranth Cause it becomes incorrect when you go really really fast?
Or have some huge gravitational thing changing spacetime curvature
 
@rubenvb It doesn't :)
 
Woah. 32% efficient solar cells
 
@ScarletAmaranth From random wiki article: Newton's second law requires modification if the effects of special relativity are to be taken into account, because at high speeds the approximation that momentum is the product of rest mass and velocity is not accurate.
 
12:27 PM
@rubenvb The important part is " if the effects of special relativity are to be taken into account ".
 
e.g. If you go fast
 
3 mins ago, by rubenvb
@ScarletAmaranth Cause it becomes incorrect when you go really really fast?
sheesh
 
@CheersandhthAlf do elements still need to be copyable in c++11 I thought there were some changes? like moveable is enough or sth. like that
 
@bamboon that's true.
 
YAY I FIXED ME SOME BUGS
 
12:35 PM
@DeadMG bon appétit!
 
also I hate mathematics hard
no type safety :(
 
there is, the types are just very broadly defined.
and polymorphic
 
12:50 PM
it is ok to go really fast. it is the sudden stopping that can be dangerous.
anyway. i think physicists are wrong to talk about "relativistic" mass and such. i like the example of detonating an H-bomb within a spherical mirror shell: the contained mass and its gravity does not change, even if some of it is now pure light. you don't have to be a genius to figure that.
5
A: Having errors in C++ code

Cheers and hth. - AlfC++ does not support implicit int. It was deprecated in the first standard, C++98, and I believe it was removed completely in C++11 (but do check if you're interested). I.e., instead of yenifayl2(); you have to declare the function like void yenifayl2(); or int yenifayl2(); Whatever your...

^ After dinner, it occurred to me that maybe implicit int was not deprecated but simply removed in C++98. Maybe someone wants to check and then possibly correct my answer. :-)
 
@CheersandhthAlf I don't believe it was ever in any version of Standard C++.
 
What on earth are those function names o_O ?
 
I think, possibly Belgian?
@DeadMG Right, I checked
 
@CheersandhthAlf nope, it's not Dutch.
 
Morning.
 
1:01 PM
@CheersandhthAlf trapped light has measurable mass.
@CheersandhthAlf not quite true. Energy and other observables will differ from what Newton's laws predict.
 
@rubenvb you can't change the contained mass. that's the law of conservation of energy/mass.
 
@CheersandhthAlf I didn't deny that. I don't quite see what you want with "relativistic mass" in that example.
"Relativistic mass" is defined as m/sqrt(1-v^2). You have to be moving very fast (without any acceleration) to give it any meaning whatsoever.
@CheersandhthAlf Your mirror won't be able to keep all radiated energy in the shell either.
 
you have to imagine a purrfect mirror
 
OK. Perfect mirror it is. But there'll be neutrino's and such which can't be reflected anyways...
FWIW, "relativistic mass" is a misnomer. It really has no meaning, except in very simplistic circumstances.
 
it's just that with this example, we know without more silly discussion that light itself can exert a gravitational force, and be influenced by it. you don't have to use general relativity to figure that out, and the conclusion is independent of GR. and so for example the observations of light bending around the sun, OK, but not very good as confirmations of SR or GR, since the conclusion is independent.
i think so it is with much ascribed to relativity
it is really independent
 
1:09 PM
So you think an atomic bomb works without Special Relativity?
Where do the atoms go then?
Where does the light come from?
 
well, Einstein-man himself coughed up the main example showing the equivalence of mass and energy, independent of SR.
so
any theory of physical reality has to produce or at least be compatible with that
 
That I'd like to see (seriously)
 
oh, it was in his for-the-masses book about SR
he considered a photon emitted from a box in free fall
as i recall
 
describing a photon without relativity is kind of weird though.
 
after Einstein produced his papers it was the mainstream physics community that thought his ideas were weird. they were called "semi-corpuscular" (speling?). to put them in same class as the discredited ideas of Newton, because everybody now knew that light was waves
but Einstein wasn't alone in finding that E=mc^2 thing from basics (independent of SR). there was also an Italian guy. But I don't remember the name or anything, sorry.
 
1:15 PM
When I went away, people were talking about taxes and no-money diets... I wonder how it got diverted to Special Relativity and Thermionic Emission.
 
@CheersandhthAlf Are you talking about stuff like this?
 
hello and a nice Sunday to everybody
 
@KonradRudolph you should change your avatar to a reindeer. Then we'd have a polar bear, ape, lion, puppy, unicorn, and cat in here. (no offence meant on your name, real or not)
 
@rubenvb Hmm. Can I change the chat avatar independently from the main site?
 
1:18 PM
@KonradRudolph No idea, sorry.
 
Because on the main site I want to remain “professional” – real name & all that
 
@rubenvb like that, yes. but wikipedia's accounting of it is shattered. they remove all the connections and then some key facts. imho. ymmv
 
@CheersandhthAlf yeah, I gathered that comparing what you said and what's on Wiki. Grumble
But those alternative derivations still depend on SR's spacetime concept...
 
And I need the C++ army again ;)
-1
A: Declaring a very large vector of ints?

Konrad RudolphThis should take take approximately 250 MiB of space1 (or less, depending on architecture) so memory definitely isn’t the problem her, and neither should max_size, which would be in the order of 1017 (≈ 264∕8+8+8). I should mention that I corroborated these calculations by looking at the impleme...

 
1:26 PM
My perfect answer got negative votes :(
 
@KonradRudolph corrected minor nitpicks :)
 
@KonradRudolph oh the anonymous Somebody removed her downvote
 
obviously it's a her
 
@CheersandhthAlf I’m pretty sure that it was Alain, not anomymous, and he explained his – somewhat correct – reason in the comments
 
1:33 PM
@rubenvb Dude I’m gonna smack you :p (no, thanks)
I still don’t get why the OP is so trigger happy with the “accept” button yet so reluctant to upvote – he first accepted Alain’s answer, and then mine, about a minute after it was posted.
 
@KonradRudolph simply eschew the SO points (fake money) system, then no more worries :-)
 
@CheersandhthAlf But … but … but then what reason is there to live?!
 
@KonradRudolph lemme see... girls (no good if you're bleeding from many parts of body), wine (no good if diabetes), music (no good if you have tinnitus). hm, i have no reason to live
oh, one can play cards!
and do c++ programming
 
I have just discovered the 'Ron Paul owns [...]'
:L
 
i am sure that c++ programming must be sinful
i will base my life on that
:)
room topic changed to Lounge<C++>: C++ programming is SINFUL [c++] [c++11] [c++-faq]
room topic changed to Lounge<C++>: C++ programming is maybe SINFUL [c++] [c++11] [c++-faq]
 
1:52 PM
C++ is only sinful when you’re using UB
 
Well then, I will simply endeavor to use UB as much as practically possible.
 
Haha
 
anyone here know anything about prime factorization
 
Using UB practically is like impossible by definition
All the more sinful
Yeah
But I've never written anything
I can see how it would work though
@JohnSmith What's your question
 
I am trying to find an efficient way to find prime factorizations that doesn't rely on trial division
 
1:59 PM
Displacement activity instead of circuit analysis
 
perhaps using a sieve/primes below sqrt(n)
 
Mmmhmm
 
0
Q: Declaring a very large vector of ints?

John SmithIs there a way to do this in C++ without having things crash on runtime? Right now I am declaring vector<vector<int> > myvec(veclength); How can I crank up veclength as high as it will go (properly)? Even at 10^7 it crashes when I should have more than enough computer memory.

-_-
 
@JohnSmith If you find it – publish it.
 

« first day (554 days earlier)      last day (4400 days later) »