« first day (467 days earlier)      last day (4473 days later) » 

2:02 AM
DNS lookup still fails :(
 
@DeadMG Yup. I just checked my account: it appears I served 532MByte of data in 2011 from various static S3 buckets and that cost me around $0.01 (due to rounding. Up.)
 
lol
 
> Use promotional code "WHOIS" for an additional $50 off any plan!
Found at the bottom of your whois listing.
 
Storing various tidbits (worth 115 Gb-Days on average over the whole year) cost me around $15 monthly. I'm cutting down on legacy offsite backups since Jan 1st :)
 
Woo, almost 675 work units completed on Folding@Home on my PS3.
 
2:06 AM
@EtiennedeMartel Check the electricity bill?
 
Huhu.
We got (relatively) cheap electricity in Quebec.
 
Powered by eskimos?
 
hey sehe
wtf is a keypair?
 
@RMartinhoFernandes No, the eskimo's are doing the coding Folding @Home!
@DeadMG Just a regular (ssh style) keypair (i.e. pub/privkey). You can generate one off awsconsole and download it if you want to take the easy route
 
@RMartinhoFernandes Quebec has the world's largest supply of fresh water. We like hydroelectricity.
 
2:10 AM
Hmmm. You're not talking about EC2 keypairs... So, I'm a bit confused. IIRC S3 doesn't require a keypair?
 
no, I am talking about EC2 keypairs
 
I think I use s3sync using only my account id and AWS key
@DeadMG Ok. EC2 is expensive for hosting, so it's not about hosting anymore?
 
no, it is about hosting
I don't know what the other services actually are
 
EC2 is Platform As A Service (~ Azure)
You don't really want to know the rest (MapReduce, Simple DB, Simple Messaging, Dynamo etc)
 
Isn't that a marketing term?
 
2:13 AM
They are for big-iron scalability and number crunching
There. My print job completed. I can go sleep now, Which is precisely what I intend to do
@EtiennedeMartel Wut? PaaS? Very much so. It fits the description though. EC2 offers BSD, Linux, Solaris and Windows instances AFAICT
 
Just found this what does everyone think of the site?
 
@fabianhjr It's way better than cplusplus.com.
I'd even say it's great.
 
Indeed, though I expected to find Boost docs too and was disappointed. ):
Yes, they already have great C++11 C++0x docs.
 
Why should they also include doc for boost?
 
user142019
C++ Reference is awesome, except for the incomplete stuff.
 
2:24 AM
Because their current docs are awesome and the Boost docs I know suck. ):
 
You mean the official boost documentation?
 
rightyo
 
@DeadMG That needs some CSS.
 
now if only my domain registrar would allow me to CNAME for my full domain name..
 
2:26 AM
Do you like cooking?
 
Can't you edit the records directly?
 
only through the registrar's website
 
That sucks.
 
it offers a browser redirect
not really what I was hoping for in terms of hiding the redirection, but it'll do
 
user142019
Registrars suck.
 
2:29 AM
You could map the www subdomain.
 
interesting choice
does that actually work?
maybe I'll just go back to paying Dreamhost for hosting
to serve up a static site, I don't care what services they offer
 
If you can map subdomains, it should work.
 
this web stuff sucks balls
 
Tutututu.
 
OK
the "www" subdomain trick worked
at least, the registrar's site accepted it
 
2:37 AM
:/ How would you measure time in at least the microsecond(nano is even better) scale under C++ STL?
 
Xeo
std::chrono
 
you can't
until C++11, anyway
 
:/ So boost it is.
 
Xeo
You really don't appreciate all the stuff C++11 added until you need it. And then you hate it again, when you encounter something that's not there yet.
 
2:39 AM
<chrono> is awesome.
 
user142019
chrono isn't part of the STL, is it?
 
in C++11 it is
 
user142019
I see.
 
Xeo
No, not part of the STL
Part of the stdlib :P
 
meh
 
Xeo
2:41 AM
Anyways, off to sleep
 
user142019
I see.
 
who gives a fuck about that anymore?
 
@DeadMG Him, of course. Aren't you paying attention?
 
user142019
Yeah me too it's so early :p
 
Xeo
No, I don't. I just have an autocorrection on that.
I seriously don't care who calls it how, as long as I get the meaning
 
2:42 AM
I generally just call it SL.
 
Xeo
nice compromise
 
One less letter, and it keeps the pedants off my back.
 
I am going to hit the sack
fuck you, web shit :(
 
Hit it. With extreme prejudice.
 
DeadMG, have you tried NameCoin Domains, Tor Hidden services or I2P Eesite technology to better manage how someone gets to your website? I heard Namecoins are way more flexible than anything before them.
Or you can listen to Etienne. :P
 
2:51 AM
1 Q.
Who does have license for VS2010?
12,000 $ one
VS10 ultimate
 
I get it for free from University.
The Express version is free.
 
Yeah, but what we shall do when we finish college studies
go and take another one? :)
I have calculated, for 4 year old college studies you need to pay only 10,000 $, while only license for VS10 costs 12k$ :)
So, it will be wise move to invest in yourself.
 
What about dumping Windows, VS, C#, .NET, and actually do work independently of platform.
I use Geany and it is wonderful; It doesn't get in your way.
 
Yeah, you can do it, but things will become so much harder for you.
 
@DzekTrek Again, the Express version is free.
 
2:57 AM
All my code is crossplatform and I believe most things could be done with JS + HTML + CSS.
 
@fabianhjr Yeah, right.
@DzekTrek You don't need the Ultimate edition. The Professional edition works just fine.
And that one is just 800$.
 
:/ Damn small software companies in mexico do Resource Tracking with Horrible VIsualBasic.NET code in which 90% of the time they are making god awful UIs and th other 10% reading on how to do SQL/MSSQL/MySQL queries to manage the data.
 
Also, I think you never used C#.
 
@fabianhjr You can make horrible code with god awful UIs with pretty much any language.
 
@RMartinhoFernandes I see. @EtiennedeMartel but who will give up manual testing, AC, UML and so on? :)
 
3:00 AM
@DzekTrek UML can go fuck itself.
 
yeah, but with that, I understand code perfectly :) It can be little foggy for me without it, especially if we talk about thousands of lines of code, hundreds of classes and so on.
 
If you have hundreds of classes, your UML will look like a camel just puked it.
 
:D so true!
 
@RMartinhoFernandes then we agre you don't need VS or Windows to do so.
 
@fabianhjr Indeed, you don't need VS or Windows to do crap. But we're not paid to do crap.
 
3:03 AM
And...?
 
You also don't need it to do works of art.
 
I still think I'm missing something.
 
An IDE is a tool. VS, despite its numerous shortcomings, is a very good tool.
 
The only difference I find between DirectX and OpenGL is the platform support. .NET could be replaced by Mono, VS could be replaced by Code::blocks, Geany, Eclipse or any other IDE and W
 
3:05 AM
@fabianhjr Never did any DirectX, OpenGL, Mono or .NET, eh?
 
Mono could be replaced by .NET; Code::Blocks, Geany, Eclipse or any other IDE by VS.
What's your point?
That programmers have many tools to choose from?
 
A while ago, I thought that Java was basically the same as C#, only cross platform. Then I started actually using C#, and I realized that Java is a huge stinking pile of crap.
 
That people shouldn't be handing money to MS just because it is the defacto tool.
 
Come on, Java rulez! :)
 
Nope
:P
 
3:07 AM
I think that how people use their money is their own choice.
 
@fabianhjr You sound like those guys at the Site du Zéro who consider Python superior to .NET only because the former is open source and the latter isn't.
 
I actually find Java pretty much sophisticated language for implementing whatever you like. :)
 
@EtiennedeMartel Also known as zealots.
 
Also, platform independence is not as important as you think: 90% of all desktops run Windows, most games run on consoles or mobile platforms, and Web browsers don't give a flying toss about which technology you use to produce the markup they render.
Also, many large scale server applications are made in Java not because it's cross platform, but because IBM makes a very good JVM.
 
Agree, @EtiennedeMartel.
 
3:11 AM
Before you bust your ass to make something cross platform, first check if your users actually need that.
 
Well, that is why I pointed earlier that JS/HTML/CSS are really good technologies for writing most of simple apps.(Also because it is an open standard)
 
It's also very limited.
 
And quirky.
And with crappy support.
 
I assume you're talking about Web apps. Well, then, at one point you're going to need something on the server, and unless you go with Node.js, you'll need something more than JS.
 
My school inscription websites forbids me from registering courses if I am not in either Safari, Firefox or IE. Chrome has the same engine as Safari(Webkit), and the only difference is the JS engine(V8 in the case of Google)
Well, Node.js is a good library for server side programming.
 
3:15 AM
Chrome has the same engine as Safari in name.
 
Well, I know it is a fork.
Though, capability speaking they aren't very different.
 
@fabianhjr It's probably just a big if statement.
 
@fabianhjr, what school do you attend? I mean is it something related to CS or ?
 
Instituto Tecnologico de Estudios Superiores de Monterrey.(Tec de Monterrey for short) They call themselves the lead in Technology in Latinamerica.
 
gflags /p /enable radio_emitter.exe finally, I have managed to detect what wasn't OK.
Nice :)
Is it located in Mexico City or ?
Monterrey?
 
3:20 AM
Mexico City :P
Even the archive couldn't snapshot it correctly.
 
Nice. :)
 
Night
 
So what do you learn there? I mean do you have some specializations in areas like robotics, CC, telecommunications ?
 
Nope I am in High School. :P
 
See you later, @fabianhjr .
 
3:23 AM
I just sneak into other classes.
See you later.
 
That is what I did too. :)
OK, see you later pal. ;)
no one can forbid you to attend universities classes. :)
I was more than a month stationed in Harvard campus, and attended there classes for free. :)
OK, ppl, I'm going off too.
Night all.
 
Does anyone know if you can call SendMessage on a window created in another thread and expect SendMessage to block the current thread until the GUI thread has processed the message?
 
ini
3:54 AM
hi
 
4:16 AM
posted on January 25, 2012

Choosing the right data structure turned out to make more of a difference in execution time than removing a horrendous inefficiency in a runtime library.

 
@SethCarnegie It will block, but there are additional considerations including possibility of dead-locking. Here's a link with an answer from Doug Harrision [MVP].
 
4:42 AM
@MarkTaylor ah, thanks very much, that's just what I needed
 
std::bitset or std::array<bool> ?
 
5:03 AM
if you know how many bits beforehand, I'd prefer bitset...
 
 
1 hour later…
6:06 AM
@wilhelmtell Prefer bitset unless you need something provided by array<bool> such as iterators. It's not worth worrying about performance, but if you write for bitset you can change to array later simply by changing the declaration, while the reverse is less likely to be true.
 
Als
6:46 AM
hola
 
 
2 hours later…
9:09 AM
it looked like an overly complex assignment to a long long
 
@John I figured that out , that will cause overflow the variable , will assign 8 bytes the 0x78abcdef at same time overflowing value 0x123456
 
does offsetof work for non-PODs ?
 
2
Q: How to use Templates when working with std::strings and c-style strings?

IntermediateHackerI was just messing around with templates, when I tried to do this: template<typename T> void print_error(T msg) { #ifdef PLATFORM_WIN32 ::MessageBox(0, reinterpret_cast< LPCSTR >(msg), "Error", MB_ICONERROR|MB_OK); #else cout << msg << endl; #endif /* PLATFORM_WIN...

 
9:25 AM
@Abyx In C++03, it requires POD. in C++11, it requires standard layout.
 
well.. is there a way to get pointer to class from non-member pointer to class member?
class Foo { Bar b; }; - get Foo* from Bar*
 
@IntermediateHacker: Am I incorrect in assuming that LP in LPCSTR stands for Length Prefixed, i.e. Pascal string conventions? Sorry, I don't use Microsoft platforms.
 
@Potatoswatter LP is long pointer
 
@Abyx No, of course not. Not even if Bar were a nested type. You could add a member typedef, though.
 
it's from 16-bit era
 
9:29 AM
@Abyx OK, so it's a segmentation thing. I've seen LPZSTR or something like that for a char* which begins with a byte specifying the length, and ends with a NULL byte.
 
@Feeds Scott Meyers in Germany, this sounds really interesting!
> this year, I'm back to an all-English set of talks. During breaks and lunch, I still plan to speak German, however, so if you're interested in hearing my funny accent and colorful grammatical constructs, don't worry. You'll have plenty of chances :-)
 
class Bar { typedef Foo other_class; }; // now Bar::other_class* is Foo*
 
Sorry to butt in but has anyone had experience setting up mongodb for use with visual studio? I can't seem to get anywhere!
 
@Potatoswatter, probably it was wrong example. class Foo { int x; Bar b; }; is better one
 
2
A: What's wrong with my logic? My Vector or an object doesn't push_back a new object. Stays at size of 0

user1147223Simple Error! Can't believe you spent so long on this! Haha. You defined your University inside your while loop! I'm not familiar with C++ (learning myself), but I think it should also be done using pointers and references and the keyword 'new'. Can someone explain the difference between the ...

> I'm not familiar with C++ (learning myself), but I think it should also be done using pointers and references and the keyword 'new'.
ouch
Also, a member function with 80 lines, really? :)
 
9:35 AM
@Abyx That illustrates exactly why it needs to be done as in my example. Because there can be any number of members, you need to specify what type transformation you want. The compiler can't guess which.
Do you want to start with Foo::b and get Bar? That is possible.
But just plain Foo to Bar, how does the language know which direction to go.
Do you want to start with Foo::b and get Bar? That is possible.
 
@Potatoswatter I think you already said that.
 
I want get Foo* from Bar*, with pointer to Foo::b
 
@FredOverflow I have a very poor connection
@Abyx What are you starting with? The type Bar* or the object &Foo::b?
 
well.. things goes more interesting if I have Bar b1; Bar b2; members... that article on intrusive lists was complete crap - altdevblogaday.com/2011/12/06/intrusive-lists
@Potatoswatter &Foo::b have type Bar*
 
@Abyx My question is, what is the input to the metafunction you are trying to write?
 
9:51 AM
I want a function, not metafunction
class Foo { int x; Bar b; };
Foo f;
Bar* b = &f.b;
Foo* f1 = what_I_want<Foo, ???>(b);
assert(&f == f1);
 
@Abyx You need to use inheritance, not membership. What's the bigger picture?
 
IRL, Bar will be IntrusiveListNode
and probably there will be two or more IntrusiveListNodes in Foo
I know that I can use inheritance, but I wonder if it's possible to do it without inheritance
 
@Abyx There is no 100% conformant way to do it, although people like to do implementation-defined (unless it's UB, not sure) pointer arithmetic using things like offsetof.
 
Make the intrusive list implementation a base class and pass it a pointer to member template parameter.
 
There's the same problem of going from a pointer to an array element (plus an index) to a pointer to the whole array. Apparently in C++ going from a pointer to object to a pointer to subobject is a lossy 'conversion', in a sense.
 
9:58 AM
@Potatoswatter pass what? where to?
 
What you can do however is (ab)use inheritance as navigating an inheritance tree is one way to go from one subobject to one object. Using private inheritance would still leave that as an implementation detail.
 
class Foo : P, virtual Q { int x; Bar b1; Bar b2; };
Foo f;
Bar* b1 = &f.b1;
Foo* f1 = what_I_want<Foo, ???>(b1);
assert(&f == f1);
 
template< typename derived, intrusive_list_link *derived::*link >
class intrusive_list_client {
    //  static_cast< derived * >( this )->*link
};

struct foo_links {
    intrusive_list_link a, b;
};

struct foo : foo_links,
    intrusive_list_client< foo, &foo_links::a >,
    intrusive_list_client< foo, &foo_links::b > {};
 
- more complete example
 
^ just a suggestion, I'll test this… I've done similar in the past
 
10:03 AM
f*ck - valgrind causing me to use swap
 
@Abyx An exampe. Note the careful order of declaration and definition, and how the two types are inherently coupled together. That's not a nice solution at all -- it's all brittle and intrusive.
 
@Potatoswatter so, I should create foo_links for every foo?
 
@LucDanton pointer to vector memory was an issue that I ran into this afternoon (valgrind caught this) - when resizing happened under the covers, the pointers became invalid
 
If you want to make the solution not as 'intrusive' (i.e. use parent(subobject) instead of subobject.parent();) what you can do is declare such a function template a friend and have the template simply do that static_cast<Object&>(arg);. This might look better too.
 
Intrusive lists are a pain to generalize in C++.
@Abyx Eh, don't go down this path quite yet. I'm just testing the waters now.
 
10:11 AM
hmm... ...how do I use std::copy() from a vector<unique_ptr<Foo>> to vector<Foo*>?

or alternatively, can I use std::sort() on a vector<unique_ptr<Foo>>?
lemme do a search on SO
 
well... intrusive_list_node can keep pointer to class containing it
Foo() { b1.init(this); b2.init(this); }
but it will eat memory
 
@kfmfe04 I recommend std::transform + [](std::unique_ptr<Foo>& p) { return p.get(); }
And yes, std::unique_ptr has an ordering that allows you to sort.
 
@LucDanton - tyvm - I will try it out the transform (more than once you've helped me out on the std::transform front :^) - btw, I have a customized sorting function that I'm passing to sort - just modify the sort to take const std::unique_ptr& and it'll work?
 
@kfmfe04 I suppose that'll work. There may be some indirect helper function in Boost though, but I wouldn't know where.
 
@LucDanton - k - I'll try the transform solution first - sorting unique_ptr's makes me a tiny bit uncomfortable anyways
 
10:18 AM
@LucDanton thanks, but it's not what I want - list nodes as members. Also you can't have more than one node with this code
seems that I should read boost.intrusive implementation
 
This compiles and seems to get all the important semantics:
template< typename value_type > // value_type is incomplete
struct intrusive_list_link {
    value_type *prev, *next;
};

template< typename value_type >
struct intrusive_list_head {
    intrusive_list_link< value_type > l;
};

template< typename links, intrusive_list_link< typename links::list_host > links::*link >
class intrusive_list_client {
    intrusive_list_client( intrusive_list_head< typename links::list_host > &h ) {
        static_cast< typename links::host * >( this )->*link.prev = h.l.next;
 
    #include <boost/intrusive/list.hpp>

    class Foo
    {
       public:
       list_member_hook<> hook_;
       //...
    };

    //This option will configure "list" to use the member hook
    typedef member_hook<Foo, list_member_hook<>, &Foo::hook_> MemberHookOption;

    //This list will use the member hook
    typedef list<Foo, MemberHookOption> FooList;
@Potatoswatter with inheritance, it's enough to use tags, to distinguish base nodes
struct a_tag; struct b_tag;
struct foo :
    intrusive_list_node< foo, a_tag >,
    intrusive_list_node< foo, b_tag > {};
 
OK, now it actually instantiates ;v) :
template< typename value_type > // value_type is incomplete
struct intrusive_list_link {
    value_type *prev, *next;
};

template< typename value_type >
struct intrusive_list_head {
    intrusive_list_link< value_type > l;
};

template< typename links, intrusive_list_link< typename links::list_host > links::*link >
struct intrusive_list_client {
    intrusive_list_client( intrusive_list_head< typename links::list_host > &h ) {
        (static_cast< typename links::list_host * >( this )->*link).prev = h.l.next;
 
oh...
 
@Abyx Well, my pointers to members serve as tags. There is no need for artificial tags.
 
10:29 AM
would you really use that if Foo is not an empty class?
what it I have one node in FooBase and another in Foo - I'll need to have FooBase_links and Foo_links and tons of boilerplate code around that
 
@Abyx Yeah, it's not empty in this example because it contains the links inherited from foo_links.
@Abyx The problem is that a class can't refer to a pointer to member to itself in the template arguments passed to a base. Pain in the butt.
 
usually list items contains something other than links to other items...
 
@Abyx Nothing stopping that. The links in this implementation are all type foo *, once the templates are all resolved.
So it's no problem to access members of foo, and ignore the existence of foo_links except to use it once as the base class.
 
the problem is to write all that code
 
Anyway, this is a pet pattern of mine which I've used in creative hacks but never "real" code. So I can't recommend it 100%.
Alternately, you could put everything in the foo_links class and use a metafunction to perform inheritance and transform that generically into the class you actually instantiate.
@Abyx No, the only extra code is the foo_links base, which contains only links. Everything else is the reusable library.
That reduces the 2 class definitions to one class and one boilerplate typedef. Perhaps better, perhaps not.
 
10:41 AM
wait... damn =\ it's was wrong problem - to get Foo from its member.
 
@Abyx Yes, that's the problem I just solved. The question you originally asked was regarding a metafunction, but this is a real function.
 
list node can point to Foo instead of another node, so we can iterate over list with pointer to node member
 
OK, well I think that was 45 minutes well enough spent. Feel free to go find and use another solution though, because I did just improvise it.
Now I need to go get dinner. Good luck!
 
10:55 AM
finally...
template<class T> struct Node { T* next; };

template<class T, Node<T> T::* node>
struct List
{
   T* next(T* item) { return (item->*node).next; }

   Node<T> m_head;
};
 
@Abyx I haven't been reading the conversation, but what is the point in the list class? if you know what node you want to get the next of, why not have a node.next() ?
actually, what ever your doing, it seems confusing as hell
 
@thecoshman List keeps information about which node to use
struct Foo : P, virtual Q
{
   Node<Foo> node1;
   Node<Foo> node2;
};
 
this is a very loose proof of concept isn't it
 
why?
 
ah man, this is funky template shit that just goes beyond me. I can't work out what is going on
 
11:06 AM
the goal is to make intrusive list, where one object can be tracked by multiple lists
so, Foo has multiple intrusive nodes, and List knows what node to use
 
I still can't see it :P I'll just take your word for it
 
anyway I should try it in real code...
 
I don't really see the point in List as all it does it store the head node and provide a function to get a nodes next node
List.m_head seems to server no purpose, other then store a node
why not just store the head node as a variable called something like headNode
 
it's minimal functionality necessary for list
I just omitted begin(), end() and other stuff
 
but list servers no purpose. Just store the head node on it's own and give node a next function
 
11:15 AM
it's encapsulation.
 
and what is the point in Foo? is that attempting to store the head and tail node?
you can call it encapsulation if you want, but to me it looks like needles abstraction
 
no, Foo is some class with intrusive list nodes
 
what do you mean by that?
are you after a linked list where multiple lists can share the same data?
 
sort of. those lists don't own their items
 
what do you mean by that? I am fairly sure, you just want to use the stl list
no point reinventing the wheel
 
11:20 AM
I can't put object in two std::lists
 
Since one of your requirement is that the list doesn't own the items, there's std::list<T*>.
 
@Abyx you put a pointer to the object into each list
 
funny how all the answerers miss the class absense of std::vector::erase after std::remove_if...:
2
Q: c++ STL algo remove_if used with template

user1171015I tried to apply stl algorithm remove_if on template, and met some trouble. Any help is appreciated! template <class T> bool flag_delete(pair<T,int> a) {return (a.second == 1);} template <class T> void fun_delete_by_flag(vector<T> &vec_data, ivec &vec_flag) { ...

 
you normally don't copy the that actual object data into the node, the node just keeps a pointer to your object, so node would just be three pointers
 
@thecoshman anyway, even with a lot of wrappers around std::list, it will be very unefficient solution
 
11:26 AM
noone has the guts to answer my question.
 
@Abyx IIRC the stl has been very well written. And who said anything about wrappers? just store object pointers rather then the objects them selves
 
@thecoshman it's well written, but it's wrong idea to use non-intrusive lists where I can use intrusive lists
also, I don't want to bring std::list everywhere where I want to do something with its items
 
@Abyx huh?
 
I'm going to have to look up what intrusive lists are, it seems be an important requirement for you
 
I need std::list instance to add\remove items, isn't?
 
11:38 AM
and... that's the idea of libraries
 
btw, with std::list<Foo*> how can I delete Foo ?
I can't just put Foo in a smart pointer, I should have all lists of Foo* to remove it first
 
well, you would remove the node from the list that contains your data, or pointer to your data, and then get the data from the nod and call delete on it
head down to fig2. is this what you are trying to do?
your wanting your data to be 'stored' via two lists?
 
@thecoshman sort of.
not "stored" but "tracked"
 
std::list<std::shared_ptr<T>>?
 
and presumably, you want to be able to delete the object form one list, but keep it alive in other lists it is in?
 
11:46 AM
@thecoshman "remove", not "delete" :)
 
but my point is, you want the other lists to not be affected by what you do with others lists
so you can do something like...
 
@rubenvb it helps with deleting, but not with adding\removing, I still need the list to remove object from it
 
listTheFirst.add(myObject);
listTheSecond.add(myObject);
listTheFirst.remove(myObject);
listTheSecond.get(myObject);
roughly speaking
 
ah wait... std::list<std::shared_ptr<T>> will prevent from deleting object, id doesn't help at all %)
 
@Abyx you could have a list managing the lifetime, and then any number of lists just storing pointers to the managed objects. Removing an item in the additional lists will only remove the pointer, but the object survives. If you want to delete the object, do that from the management list, but this will invalidate all pointers in other lists. I'm not quite sure I understand the "intrusive" stuff, so I'll just shut up for now.
 
11:51 AM
@rubenvb by intrusive list, it means having lists store pointers to object, rather then the object it self. so that multiple lists can all have nodes pointing to the same data
 
e.g. with intrusive (double-linked) list I can write ~Foo() { node1.detach(); node2.detach(); }
 
@Abyx is Foo your actual data or a List class?
 
@thecoshman the data
 
then it is very wrong for your data to know about nodes
 
@Abyx that operation won't delete the object from memory, only remove it from the lists, right?
 
11:53 AM
@thecoshman It's called an intrusive list.
 
is it wrong in every possible case?
 
well, depends on what exactly you are doing, but the data it self should no know about nodes or lists
 
@CatPlusPlus Catptan!
 
Data is nodes.
That's the whole point of the intrusive bit.
 
@CatPlusPlus that's not what I get from boost.org/doc/libs/1_48_0/doc/html/intrusive/…
 
11:55 AM
From what I have just read up on 'intrusive' lists, it is where the lists do not store the actual data, the store pointers to it so that multiple lists can all point to the same data
 
> On the other hand, an intrusive container does not store copies of passed objects, but it stores the objects themselves. The additional data needed to insert the object in the container must be provided by the object itself. For example, to insert MyClass in an intrusive container that implements a linked list, MyClass must contain the needed next and previous pointers:
 
I think the name is a bit of misnomer (not any more)
 
ugh.
 
It's intrusive, because it intrudes into the data objects.
 
oh... I was going to shut up cause I didn't understand... Shutting up.... now!
 
11:56 AM
so it's basically a linked list that breaks encapsulation
 
It's a linked list that saves on copying and allocations.
Optimisations are always about trade-offs.
 
it doesn't break encapsulation, in some cases
 
......damn, no one can answer my question. :'(
:"(
 
@IntermediateHacker noone uses SDL
 
@Abyx well, perhaps not encapsulation, more it's breaking the principle of keeping class focused and well defined
@Abyx actually, I have used it for a while, but then got pushed onto Java :(
 
11:58 AM
@Abyx ....damn, no one uses SDL. :( .
 
@IntermediateHacker wild guess answer!
0
A: Coding an X-Bitmap Loader in SDL?

rubenvbGuessing in the wild here... This SDL tutorial example (point 2.5) says that the Surface must be locked before calling this function. Is yours?

 
any ways, lunch time :D
 

« first day (467 days earlier)      last day (4473 days later) »