« first day (759 days earlier)      last day (4183 days later) » 

12:02 AM
@Crowz GOTO 20
 
wat
 
@Crowz velociraptor
 
velocirapture
 
 
What is goto?
 
12:04 AM
:)
 
I am full noob programmer
 
The word that precedes "hell"
 
lel
 
user1357851
that's one tiny dinosaur
 
user1357851
I heard so much vice about goto, sometimes I could not but wonder whether it is whoever designed goto function did not make it work then spread a rumour to stop people using it.
 
12:19 AM
@Telkitty whoever designed goto?
 
user1357851
Think about it how many times programmers inadvertently put in a infinite loop or recursion?
 
user1357851
@sehe some must have written the assembly behind goto :D
 
@Telkitty derp. that's the point. Assembly language has jump instructions. This is what implied goto. Nobody 'wrote the assembly behind goto'.
 
user1357851
In fact if I remember correctly there is goto in assembly it is often used
 
user1357851
@sehe yeah that's what I meant
 
12:21 AM
Someone exposed jump instructions directly in a programming language (instead of designed something; you know, like flow control)
 
user1357851
jump followed by an address
 
@Telkitty If you remember anything else, I'd love to see your assembly.
 
user1357851
I remember there is direct address or relative address in jump/goto instructions
 
user1357851
but my assembly knowledge is limited to the 2 subjects I did in uni
 
user1357851
12:27 AM
@sehe Now thinking about it, it makes sense (or maybe not). In assembly, everything has an address associate with it. Be directly or indirectly.
 
user1357851
But in modern languages address is more dynamic
 
user1357851
like things get pressed onto stack and they get unwinded from the stack
 
user1357851
now if goto instruction gets called, it would be jump with sometimes unreliable relative addressing
 
user1357851
I am not even talking about multithreading
 
user1357851
maybe just a loop with function calls
 
12:31 AM
Does goto allow jump from one function/stack frame to another, or is it restricted to the function it's in? I have no idea - I haven't used goto in a high-level language since M$ 8K BASIC.
 
@Telkitty it depends on the instruction set. for x86 you can only do absolute addressing in jumps by pushing the address and returning.
 
@Telkitty what on earth are you talking about
@MartinJames longjmp
 
Ell
I ought to learn a bit of assembly
 
@Ell Here is how I solved the C# problem.
0
Q: C#: How to Leave ToolStripMenu Open After Clicking an Item

ChimeraI'm creating a ToolStripMenu shown below that is supposed to allow the user to interact with the items "XML" and "Non XML" as though they are regular check boxes on a form. However, when one item is checked/unchecked the menu closes. How can I allow an item to be checked/unchecked without closing...

 
Ell
Ahh that's an interesting solution
Clever, glad you got it solved. And for the record, I think it would be a good user experience :)
 
12:37 AM
Glad you think so. One of the C# guys doesn't think so. :-)
 
Ell
Yeah I saw the comments :S
What is this for btw?
 
I would have thought that there would be some MenuItem 'OnClose' event with some parameter that could possibly do that, or maybe a MenuItem descendant with some 'close' method overridden could do it. Don't know enough C# :(
 
@Ell Tool for work. It is used to help us debug our embedded devices in the field that communicate with slot machines using various protocols etc
 
Ell
Oh cool
 
@MartinJames Yeah, I'm surprised none of the C# experts have come up with anything other than "poor user interface design".
 
Ell
12:45 AM
what I had in my head was to reopen the menu as soon as it was clicked
 
Well as I say, I don't know enough C#, but it sorta smells like it should be doable.
 
@MartinJames You'd think....
 
Ell
Modifying the behaiviour of existing controls is difficult imho
 
I'm not done though. Still going to experiment and see if I can actually do what I wanted. I don't think it would be such a bad user experience.
 
@Ell Depends on whether methods like 'Close', 'Click' are virtual.
 
Ell
12:48 AM
Yeah
 
^ Doesn't feel as depressive as the default looks.
 
@Cheersandhth.-Alf God I hate the look of VS 2012
 
Xeo
@Chimera I love it.
 
Ell
I do too :/ its ugly as fuck
 
Xeo
@Cheersandhth.-Alf Ah, dark theme. Much better than the light one.
 
Ell
12:51 AM
Too much contrast
 
I wish it supported themes / skinning.
 
I love VS2012's look.
 
@Ell Agreed
 
I'm thinking I should be asleep. The Coshman is not around - I'll have to plink him tomorrow.
 
@MartinJames How could you miss the opportunity to plink when you mentioned him?
 
user1804599
12:59 AM
@sehe that hyperlink makes no sense.
 
@Aardvark does it not? It does if your name is @thecoshman
 
user1804599
http://cc/@thecoshman
 
@Aardvark no shit
 
user1804599
Does that trigger a plink?
 
Nov 9 at 20:47, by sehe
@Xeo Another innovation by yours truly, today: /cc @TonyTheLion
 
user1804599
1:01 AM
How stupidly written is this software.
 
@Aardvark Not so very. What is the problem with this?
 
user1804599
It does not make sense. The UX is bad.
 
user1804599
Anyway, got to go.
 
user1804599
Bye.
 
And some C# fucker with nearly 100K rep edits my post to remove the C# "tag" in the question title without bothering to help answer the question. What a dick.
OMFG NO! SO will be forever damaged if that title was allowed to stay! God save us! God save us!
@Ell Just to piss them off, maybe you should upboat my answer? hehe
 
1:08 AM
snurffftim bloja
 
If I set the upper bound iterator of this range to next(it, -4 - 2) I get a valid range, if I set it to next(it, -4 + 2) I also get a valid range, but next(it, -4) triggers an assertion. I'm confused.
 
@Chimera Linux UIs have something similar, I think: tear-off menus. You might want to google that term. It's quite popular in certain circles
 
@sehe Roger...
 
@LucDanton as in "-4-2==-6"?
 
Yeah. I tried with the literal values, too.
 
Xeo
1:11 AM
@sehe What he means, if set to -6, works, if set to -2, works, if set to -4, doesn't work.
 
user1357851
-4-2 == -6 <- true
 
user1357851
-4.00-2.00 == -6.00 <-false
 
@Telkitty Cpt. Obvious and a slowpoke :)
 
I mean, for fuck sake, I'm asking how to override the way winform menus work! I didn't ask for opinions about my choice of user interface.
 
@Telkitty now you're making sense
 
user1357851
1:12 AM
@sehe $
 
user1357851
@sehe coffee starts to take effect in said brain :D
 
@Chimera darn professionals on SO! Won't even help us create junk!
 
@Xeo Negative strides are proving to be annoying to implement.
 
Xeo
Heh
How large is the range, and where does it point?
 
It's 10-large, and it is the beginning of the slice, which is std::next(begin, 7).
auto view = slice<FromTo<7, 3, -2>>(vector); being the relevant invocation.
 
Xeo
1:17 AM
Hm, so no wrap-around either, which could trigger an invalid range
 
@LucDanton hehe looks like nice codebase to get >> or << misinterpreted as shifts
 
That being said, let me check the inputs are what I expect.
 
@sehe Well I would understand if it wasn't subjective.
 
@Chimera Well. There is only so many robots on the site. You know full well how subjective you will get when you select questions to answer...
 
@sehe Of course. But I don't think I would not answer a question just because I thought the "UI" sucks.
 
1:20 AM
I mean, people can't refuse to help for subjective reasons?
 
@sehe Of course they can.
 
Yes, the inputs are correctly 7, 3 and -2.
 
Xeo
What does stepping-through give you?
 
@Chimera Oh. Aha. I see. Did it occur to you that maybe no one knows a good answer, because no one actually did this/something like this (which goes directly to it being uncommon UI)? Maybe even, related to it going against the design of UI framework(s)?
 
@sehe Well, since I don't read minds I would expect them to say they don't know how to do it AND maybe it's a bad idea anyways.
 
1:22 AM
@Xeo "No symbol table info available." mostly. I can trace through the execution but I cannot inspect any value. I've also had mangled names that my toolchain wasn't able to demangle not long ago, so I'm not sure what's going on.
 
Xeo
That doesn't sound good.
 
@Chimera TME. They'll just tell you what they do know. That sucks, but it isn't outrageous. Just ignore them. I give you +1 for your answer :)
 
Xeo
I'm wondering, can't you wrap those iterators in reverse_iterators and do positive strides?
 
@sehe hehe... agreed. thanks
 
Xeo
Or get reverse_iterators from the container?
 
1:23 AM
Night all
 
user1357851
laterz
 
Xeo
night
 
That does sound like a reasonable option, especially considering that I'm not sure I can handle 0 as an upper bound, what with not having a one-before-the-start.
 
@sehe night
 
Xeo
@LucDanton Yeah, I think the standard reverse_iterators handle this by substracting 1 on dereference.
 
1:27 AM
There's a problem type-wise however.
 
Is ActionScript easy?
 
Xeo
How so?
@Crowz Don't even go there. Most wouldn't even consider it a programming language, from what I heard.
Although the newest version may have improved in that regard.
 
Currently the interface allows for slice(range, { from, to, stride }).
 
@Xeo Hmmm very interesting... that makes it more appealing if it's that easy
 
Xeo
@LucDanton Ah, that's indeed bad.
@Crowz That was meant in a very negative way, as in, you can't do shit without jumping through huge hoops.
But well, just try yourself.
 
1:29 AM
@Xeo Isn't it just for animation?
 
So, back to making my slice_iterator and slice_range work.
 
Xeo
You can write games in it. ActionScript is more commonly known as Flash
@LucDanton Yeah, but you could adopt the same idea, I think. Just add an extra substraction before dereferencing.
 
I don't know, the slice_iterator uses inclusive bounds. I'd like to think it should work out of the box.
 
Xeo
Weren't you bothered about 0 upper bound? The substract thing naturally helps with that.
Wait, inclusive, nvm
Wait, inclusive? Meaning [7, 5, 3] in the example above?
 
No. When the user asks for FromTo<7, 3, -2> then they get [7, -5].
So I'm in the code that does the mapping to find the correct information to store.
 
Xeo
1:34 AM
[7, 5], you mean?
 
Yes.
 
Xeo
Okay, I was getting confused.
 
Does any high level type work require knowledge of C? What do employers usually expect employees to be most proficient in?
 
Xeo
@Crowz They expect you to be proficient in whatever is used in the job you're applying for.
They won't expect an artist to know any programming language, for example.
 
user1357851
who uses C nowadays? (Unless it is embeded)
 
Xeo
1:36 AM
While a designer will likely be required to atleast have basic scripting knowledge.
 
I dunno what I want to do haha
 
Xeo
@Telkitty Even being embedded isn't an excuse.
 
What's a job for someone with a compsci degree that's super relaxed and not software-y
 
Xeo
Wrong education?
 
Huh?
 
user1357851
1:37 AM
@Crowz umm ... low paid ones? Unless you are in a managerial position (already).
 
How low we talkin'?
 
CS without too much software sounds like pure research would fit.
 
user1357851
@Xeo There are still plenty of embeded C positions ... mainly prgramming micro controllers for hardwares (like car, machines etc)
 
Wow I just went through learning most of C for nothing then
 
40
Q: Is C++ suitable for embedded systems?

Toby JaffeyA common question, here and elsewhere. Is C++ suitable for embedded systems? Microcontrollers? RTOSes? Toasters? Embedded PCs? Is OOP useful on microcontrollers? Does C++ remove the programmer too far from the hardware to be efficient? Should Arduino's C++ (with no dynamic memory management, ...

> Yes, C++ is still useful in embedded systems.
 
1:40 AM
@Crowz Learning programming is more important than learning a language.
 
@Crowz At least you didn't learn most of PHP. :-P
 
@LucDanton Sure, but C is a lot different than... say, java or python
 
user1357851
@Crowz you can be a software tester or in support
 
That's a good thing. You don't want to learn languages that are the same. There's in fact no point in having several languages be the same.
 
@Telkitty That just entails telling other people they're wrong and breaking stuff, right?
Because I'm real good at that
 
user1357851
1:42 AM
@Insilico err, now we are talking about embedded C++ or embedded C?
 
@Crowz I can't say that's the only thing they do, but that is their primary goal.
@Telkitty Did you read the answers to the question?
 
user1357851
@Crowz testing involves knowing how software work should work
 
@Insilico Welp I manage to break everything in code, so sounds like the job for me!
 
user1357851
you will be using software like the users, maybe write scripts to test the software
 
How much does that usually pay?
 
1:45 AM
@Crowz That depends on where you live, I think. (Things like cost of living, for example.)
 
user1357851
@Crowz depends on the role, good testers with sound system knowledge get paid pretty well.
 
user1357851
Also depends on the person, most people in software development find it boring
 
I don't think I can do software development
 
@Telkitty You said you've been at it for a year no?
Like I said prior, a year is not enough time to get really good at it.
 
1:52 AM
If I am elected mayor, I will never interfere with a man's right to dress as a woman wearing a mustache.
 
@Crowz That clearly follows from what I just said. :-P
 
Quick question guys how do set my variable outside the scope of the case statement here so i can use it in my loop?:
    switch(gamePlace){
			case 0: MainMenu result(theme); break;
		}

		while(gameBool){
			window.clear();
			result.create();
			window.display();
		}
 
Yes, I considered being mayor instead, so I figured I should start campaigning now!
do this, Dave
 
@Dave What variable? (btw the formatting is atrocious)
 
result
which using the class "MainMenu"
i pressed ctrl + k and it came out like that lol
 
1:55 AM
@Dave That's no excuse. I can hardly read that without stumbling into the weird indentation.
 
@Dave put the variable outside the scope of the case statement there
 
Can you please put the code on Github, dave?
 
@MooingDuck so before the case:

MainMenu result; ?
 
@Dave yes
@Dave the existance of other case statements may change my answer
 
@MooingDuck Presumably the constructor for MainMenu does something that should only happen when gamePlace == 0.
 
1:56 AM
@Dave if you have to construct it from theme or another variable depending on gamePlace, then the correct thing to do is put the switch in a function.
 
mainMenu loads images for mainMenu so its before my game loop
its the preloader
theme = map<string,string>
 
user1357851
xcode is seriously pissing me off
 
user1357851
xcode 4.5 to be exact
 
user1357851
freezes all the times
 
1:58 AM
@Insilico in that case it doesn't make a whole lot of sense to use MainMenu no matter what gamePlace is
@Telkitty Visual Studio!
 
@MooingDuck i was planning to put it in a function but the scope will still be lost outside the function?
 
@MooingDuck Who said that MainMenu was designed well in the first place? :-P
 
user1357851
@MooingDuck visual studio for window's phone
 
> error in "slice": check std::next(boost::begin(view), size) == boost::end(view) failed
 
1:59 AM
(this was supposed to be an edit)
 
user1357851
Window's phone's certification takes forever
 
Kinda odd as I had an assertion elsewhere that checked for the same thing that didn't fire.
 
@MooingDuck ah thats good ! that solves the scope issue :) thanks
 
user1357851
Linux rocks :D
 
@Dave time to go now. bye.
 
2:01 AM
see ya :)
 
Xeo
@LucDanton maybe size got corrupted?
 
@Xeo I check it is 3 just before that.
What do you know, the assertion does fire.
 
Xeo
huh.
 
Oh right, inclusive bound. I suppose I need to check my iterator code.
 
Xeo
Why inclusive bounds, I wonder. Wouldn't half-open be easier, in a way?
 
2:04 AM
When I grow up, I'm gonna be a woman
 
@Xeo Consider Stride<4>({ 0, 1, 2, 3, 4, 5 }), what is the end iterator for that slice?
Oh man, that syntax instead of slice<Stride<4>>({ 0, 1, 2, 3, 4, 5 }) is giving me second thoughts.
 
user1357851
@Crowz I heard sex assignment operation can be costly
 
Xeo
6. :P And advancing the iterator does a min(stride, dist_to_end) :D
 
@Telkitty Can I at least be a male lesbian?
 
@Xeo Okay, now then decrement that iterator.
 
2:07 AM
From this day forth, let no lesbian be discriminated against! Man or woman!
 
Xeo
@Telkitty enum class sex{ male, female }; sex s = sex::male; s = sex::female; // I fail to see the cost
 
user1357851
@Crowz depends on how much you make as a tester I suppose
 
This chat room has the weirdest interleaving of topics I've ever seen.
 
Xeo
@LucDanton It was meant as a joke answer, btw. I see the problem with that. You'd need a few state members to make it work.
 
user1357851
2:08 AM
@Xeo you need to do a deep reassignment, not a shallow reassignment (member wise re-assignment) :x
 
@Xeo Current representation is iter, last, past_the_end.
 
@Telkitty Hah. Member wise re-assignment.
 
Xeo
@LucDanton For random-access, the answer would be rather easy - just save an index. :/ Won't work as nice for anything less, though.
 
Nov 8 at 11:41, by Luc Danton
Okay, got that strided iterator to work. And iterating over a strided forward range is only quadratic, yay! It sucks!
 
user1357851
@Insilico that's why there are so many people here :D
 
Xeo
2:10 AM
I didn't see that
Why don't you take a peek into boost::strided? They have to make it work somehow too.
 
It doesn't work for forward-ranges at all, no.
 
Xeo
Oh?
Docs say Single Pass Range atleast
 
Oh, what doesn't work is that the result is not bidirectional or better for bidirectional or better then.
 
Xeo
Even though the docs say so? That sucks then.
 
What the hell. I'm mixing it up with sliced am I?
 
Xeo
2:15 AM
I guess?
 
That one does require RA and returns RA.
 
damn my classes are confusing me
 
They do it via explicit specialization.
 
such a complicated maze following it all
 
Xeo
2:19 AM
@LucDanton Ew. So how does it work for bidirection-or-better and going backwards?
 
@Xeo Perhaps there's some nasty template metaprogramming stuff going on?
 
Xeo
@Insilico With runtime parameters? Unlikely, except the specialization.
 
@Xeo Right, I meant the whole specialization part.
 
question if had :

ClassName objName();

Then obj. (no members available) what does it mean I've got incorrect... i do have a function in the public yet i can't seem to call it
 
Xeo
MVP
 
2:21 AM
@Dave Chamge it to ClassName objName;
 
for (difference_type i = 0; (it != m_last) && (i < m_stride)    ; ++i)
    ++it;
This doesn't look right.
 
@Dave Congratulations, you've run across the Most Vexing Parse.
 
Xeo
@LucDanton Why not?
 
@Insilico no () ?
 
@Dave Yes, no (). The absence of the () is intentional.
 
2:22 AM
@Xeo If you get to the end and you decrement, what does the code do and where do you end up?
 
Xeo
Wait, that's the code for decrementing?
 
but then i can't send a std::string which was my plan
 
No, but the code for decrementing is similar.
 
@Dave Send a std::string to where?
 
Xeo
Well, why don't we simply try what happens?
 
2:23 AM
ClassName objName(string_here);
 
@Xeo Already on it obviously.
 
@Dave That's the correct syntax.
ClassName objName; constructs an object of type ClassName with no parameters.
 
then afterwards objName(args); ?
 
ClassName objName(string_here); constructs an object of type ClassName with string_here as an argument.
ClassName objName(); declares a function that returns an instance of ClassName.
 
the string i was sending was going to assign to a private variable in the class
 
2:24 AM
The most vexing parse is a specific form of syntactic ambiguity resolution in the C++ programming language. The term was used by Scott Meyers in Effective STL (2001). It is formally defined in section 6.8 of the C++ language standard. Example with classes An example is: class Timer { public: Timer(); }; class TimeKeeper { public: TimeKeeper(const Timer& t); int get_time(); }; int main() { TimeKeeper time_keeper(Timer()); return time_keeper.get_time(); } The line TimeKeeper time_keeper(Timer()); could be disambiguated either as # a variable definition for variable t...
@Dave So what's stopping you?
 
like i say when i want to call a function in the class with objname no members are available when it should be
 
@Xeo Oh boy.
 
Xeo
?
 
i have a function in the class:

sf::Sprite CallBack();

Yet i cannot do objName.CallBack();
 
I get the last element if I do *std::prev(boost::end(r | strided(4))).
 
2:26 AM
@Dave Is Callback() a member of the class?
 
Xeo
:s
 
yeh its set in the header and the relevant cpp file under the public :
 
So tl;dr of that subdiscussion: Boost.Range sucks etc.
 
Xeo
So much for that, yeah.
 
Is it written as sf::Sprite MyClass::CallBack() { ... } in the cpp file?
 
2:27 AM
cpp has:

sf::Sprite CreateSprite::callback(){
	return sprite;
}
sprite is a private variable
 
@Dave So is it callback() or Callback()?
 
no capitals
objName. will normally give me a drop down box in VS2012 of functions i can chose
yet i can't pick any
 
@Dave So your header file has Callback(), but your .cpp file has callback()?
 
i just checked they are case matched
i typed my header one instead of copy pasta :P my bad
 
@Dave Is callback() listed within the class declaration, like class CreateSprite { ... sf::Spring callback(); ...};?
 
2:29 AM
class CreateSprite
{
public:

	CreateSprite(std::string&);
	sf::Sprite callback();

private:

	sf::Texture image;
	sf::Sprite  sprite;

};
 
So what's the exact compiler error you get?
 
its not a compiler... my VS 2012 won't let me do objName.callback();
it says theres no members to objName
 
@Dave ???
So did you even try compiling your code?
 
do you use VS 2012?
no cos i can't finish the script unless it lets me do objName.callback();
 
What do you mean by "unless it lets me do objName.callback();"?
 
Xeo
2:31 AM
@LucDanton I don't get the last, but I get std::prev(end(), stride) :/
 
Visual Studio is not going to prevent you from typing objName.callback();.
 
@Xeo Is it a random-access range? :p
 
Xeo
std::list
 
Well I am using std::list as well. I'm on 1.51 however.
 
Xeo
Me too
 
2:32 AM
 
@Dave Forget about Intellisense. Type it out yourself and compile it.
 
usually when i place the period it gives me a drop down box of options but it says no members when the callback(); should be there
ok
 
Intellisense is full of shit.
 
The compiler has the final say on if your code compiles or not. Not Intellisense.
 
Xeo
int main(){
  std::list<int> l;
  l.push_back(0); l.push_back(1); l.push_back(2);
  l.push_back(3); l.push_back(4); l.push_back(5);

  auto ls = l | boost::adaptors::strided(4);
  auto it = ls.begin();
  ++it; ++it;
  assert(it == ls.end());
  std::cout << *--it << "\n";
}
 
2:34 AM
Ignore Intellisense. It's a convenience tool. It's not part of the source-code-to-machine-code magic that happens when you compile it.
 
Xeo
prints 2 for me
 
error C2512: 'CreateSprite' : no appropriate default constructor available
error C2065: 'Background' : undeclared identifier
ah i see. ill ignore it in future then :D
 
@Dave Well, obviously since you haven't declared a variable called Background in create().
@Dave Yeah. Just ignore Intellisense. Intellisense != The Compiler.
 
caw
 
i have created Background for callback() : CreateSprite Background(theme["Background"]);
callback returns the created sprite for that string which is part of CreateSprite class
 
2:36 AM
@Xeo My test program was inspecting the original range and not the strided view!
 
Xeo
lol, fail?
 
@Dave You may want to avoid using verbs for class names.
 
why?
 
I keep thinking CreateSprite is a name of a method.
 
oh
 
2:38 AM
Example: Sprite sprite = CreateSprite();
 
@Xeo Not as much as Boost.Range :p it's still wrong.
 
what would be a better choice of name ?
 
@Dave I dunno. SpriteFactory or something, probably.
 
Anyway, my immediate problem appears to be that next(begin, size + 1) == end holds for the result of FromTo<7, 3, -2> instead of the usual size.
Come to think of it, I get the size wrong, so that's several problems.
 
Xeo
@LucDanton Yeah, sure.
I think you'd need an overflow variable, for "how much after end am I?"
To make it work for bidirectional iterators.
 
2:50 AM
What do you know, boost::end(view) - std::prev(boost::end(view)) isn't 1!
 
Xeo
Oha
 
@Xeo It works for bidirectional iterators as far as my tests show. Not for negative strides however.
 
Xeo
@LucDanton Mhm.
I think I'd have to try and implement that myself to help you much farther here, I only have some vague ideas floating in my head right now. :/
 
No biggie. I'm writing tests and reviewing code.
 
Xeo
Dead for anyone else? (aka blank / 404?)
 
2:52 AM
Also considering what delicious food to eat next. I'm craving something coconut-y.
 
@Xeo Nope -- I'm seeing a normal list of topics and such.
 
Xeo
@LucDanton I'm currently having a persimmon. Yummy, too bad I didn't discover those earlier.
@JerryCoffin Dang router being stupid again, then. Thanks.
 
No problem.
 

« first day (759 days earlier)      last day (4183 days later) »