« first day (647 days earlier)      last day (4305 days later) » 

5:00 AM
well, anyway
I've gotta go now
have a great night, guys
 
@n2liquid Later.
 
@Mysticial the broken tabs is the main thing that keeps me on chrome
 
night
 
see ya
 
bb
 
5:00 AM
greetings!
How is everybody doing?
 
@Mysticial Yeah -- I was running into a bit of the same thing before I switched to Chrome. The only place I see a real advantage to FF is for photographers -- FF has very good color management, where Chrome has essentially none at all.
 
I really wish chrome had an option to get rid of the 'x's on tabs without pinning them
 
That good huh?
Oh thanks, doing fine. :-)
 
@JimNorton Pretty fair. Only problem is that even though it's 11:00 PM, it's still ~85 degrees. How 'bout you?
 
It's midnight here and it's 84F.
An hour ago it was still over 90F.
 
5:03 AM
@JerryCoffin Getting ready for bed... it's still very hot here as well... Feels like in 90's still.
Can't wait for summer to be over
 
@JimNorton pretty good, what about you ?
 
84F here too
 
@Fred Good to hear... oh not bad... getting ready to go to bed...
 
Yeah, what's up with this summer...
 
Thought I'd log in real quick and see what's going on.
 
5:04 AM
aliens
 
This is my second summer in Las Vegas, I don't think I will get used to this freakin heat ... EVER
 
@Mysticial Definitely a long, hot one already -- and we haven't even hit August yet.
 
I wanna go out and get some fresh air... I go grab lunch, come back and completely covered with sweat...
find myself taking 3 or 4 showers a day.
 
@Mysticial I'm trying to remember. You're in Illinois now aren't you?
 
My AC in my house runs nearly constantly
 
5:05 AM
@JerryCoffin yeah
 
this summer is really hard on the body especially when doing sports but hey.. with a bigger water bottle it's still great :)
 
I don't have AC lol
 
When the weather makes you shower more often than you piss... then you know it's serious.
 
I have no AC. Just open the windows at night and close them during the day. That usually works pretty decently (at least I have good insulation), but this year it isn't cooling off enough at night to work so well.
 
I have AC, but I hate being stuck in my tiny room 23 hours a day...
 
5:08 AM
@Mysticial Lol, what I usually do is going out to do some bike, no AC so it's still hot but funnier :P
 
Summer here is rather nice atm. Not too hot :)
 
It's been 95 - 100F outside these past few weeks. The AC (at full power) keeps the room at about 85F. Which is a lot better than nothing. I already have more of my heavier computers shut off or clocked down.
 
@StackedCrooked Darn -- and it'll probably be years before I manage to get to Belgium again.
 
5:35 AM
@Mysticial Where is your apartment? North of Green?
 
@Potatoswatter Daniels Hall actually
So on Green St.
 
@Mysticial Do they charge you for electricity? The university should have an incentive to make A/C work properly.
 
@Potatoswatter nope
 
Hmm… and they complain about balancing the budget.
 
The individual room ACs are the same ones that you get at like Costco. They aren't particularly strong.
 
5:37 AM
What you need is a visit from the Air Products truck ;v)
Thermal insulation should make more difference than the strength of the machine…
especially in a building with lots of small rooms with individual air conditioners
So… I found a framework library which directly addresses my problem just the way I want: code.google.com/p/functionalnavigation . But it's not quite mature yet and its coded in C++-Java hybrid with function pointers used as factory objects.
 
C++-Java hybrid, that must interesting
 
Run with it, or run and hide?
 
anyway, did something about overload resolution change in C++11
 
@Cheersandhth.-Alf Nope
 
because now i find that overload for pointer always takes precedence over overload for array (possibly because latter is template)
 
5:44 AM
What are the signatures?
 
like
void foo( char const* ) {}
template< Size n >
void foo( char const (&)[n] ) {}
i can work around it by providing a templated forwarder for the non-template
but that feels ungood
and it's verbose
 
@Cheersandhth.-Alf It's not that bad. Just the usual JNI stuff.
 
Granted, I've never tried to pass anything more complicated than POD arrays through JNI.
Java Native Interface
 
@Cheersandhth.-Alf Out of curiosity what happens if you pass in a non-const qualified array?
 
5:48 AM
Does it help to add have both const and non-const template overloads?
 
oh, i can't remember doing this for JNI. and i once wrote a JNI framework.
 
There is no qualification conversion for arrays.
 
@Potatoswatter dunno
 
@Mysticial No JNI, I mean using C++ as if it were Java.
 
@Mysticial sorry, i didn't catch on to the context
 
5:50 AM
@Potatoswatter Oh... like that? haha
 
The guy seems well-intentioned, Java is never mentioned anywhere and he didn't use insane namespaces or anything… but you can tell his background.
 
#include <iostream>
#include <typeinfo>
#include <stddef.h>
using namespace std;

typedef ptrdiff_t Size;

inline void foo( char const* const s )
{
    wcout << "p: " << typeid( s ).name() << endl;
}

template< Size n >
inline void foo( char const (&s)[n] )
{
    wcout << "a: "  << typeid( s ).name() << endl;
}

int main()
{
    foo( "blah" );
}
it just heads for the non-template
 
@Potatoswatter I also came from a very strong Java background. I had Java naming conventions for a few years after I started C and C++.
 
@Mysticial Did you pass around function pointers as stateless "factories" instead of just using constructors?
 
@Potatoswatter I don't think I ever did factories even in Java.
 
5:56 AM
@Cheersandhth.-Alf In any case array decay is an 'exact match' in the ranking of conversions when it comes to overload resolution, which is the same as an identity conversion :/ Don't have the time to look further into it just now.
 
Ah. Then you would have an exact match against a parameterization on array size. Less parameters wins.
ISTR a Q&A on detecting a string literal argument… and it had a pretty positive outcome.
@Cheersandhth.-Alf Hackish solution: ideone.com/NebEo
 
6:34 AM
hm
 
7:26 AM
@R.MartinhoFernandes ho yuo souhdl tatoly go fro ti
 
7:51 AM
these are interesting...
The first example is (almost) exactly the only question that I've asked.
 
0
Q: short type pointer?

user1175832i got the following problem with passing an int type to short*: void PacketEncrypt(Packet* packet, int sizeofpacket) { char* pointer; pointer = ((char*)packet+sizeofpacket) -2; short *pointer = packet->PacketSize^0x1A3C; packet->Type += 0x0FFF7; } What i want is compiler ...

weird way to ask a question
 
Oh and I got that link from: reddit.com/r/programming/comments/x1ql4/…
@Flexo I don't see how someone can go from inline assembly to C/C++.
Inline assembly is C/C++.
 
8:38 AM
Isn't only the asm keyword part of C++ and the actual assembly code implementation defined?
 
yeah
But I'm not aware of any other major language that has "inline assembly".
I believe fortran does, but that doesn't count as a major language.
 
what? you don't do fortran all day?
 
I tried reading some it before... lost a part of my soul that day.
I don't know how fortran programmers can do these 5-deep nested loops and call it readable.
 
Cool, they have named loops?
 
I dunno... but the code I was given to read literally had something like this every other line:
 
8:43 AM
Just kidding.
 
for ...
    for ...
        for ...
            for ...
                for ...
                    some MPI stuff + a bit of computation
I was like... you've gotta be kidding me...
and the indicies weren't simple either...
And the last annoying thing was the column major indexing... which I never got used to.
 
@Mysticial Ow.
 
sbi
Such code, arrow-shaped through indentation, used to be all the rage in the 80s. I remember Pascal being considered "aesthetic" when written thus, and BASIC being sneered on, because it didn't do that.
 
@Mysticial how else are you going to deal with five dimensional geometry
 
@R.MartinhoFernandes yeah it was bad
 
8:51 AM
@thecoshman Proper iteration constructs.
 
@thecoshman It was actually only 2 dimensions, but it made extremely heavy use of tiling to get cache locality.
 
for(auto cell : five_dimensional_gimmick.cells()) {
    // do things
}
 
I would split it into functions.
 
@Mysticial bah, seems like too much effort to be worth while
 
@thecoshman That's why compilers do it.
 
8:53 AM
@thecoshman The author said the tiling made about 10 - 20x speedup. Not something to be pushed aside that easily.
I've done worse thing than that to get only 2x speedup. Though I've never had more than two levels of loops.
 
@Mysticial did he have a insure with 'speed' in the first place?
 
I tend to prefer recursive structures.
@thecoshman It was a numerical library. So it had to be fast to compete with existing ones.
 
"recurse through the dimensions" is quite tricky to follow too though
 
@Flexo In the worst case, it can be bad.
 
@sbi 80's hairstyles also looked much different then :p
 
8:59 AM
anyways, off to bed... 4AM here
 
Goodnight!
 
sbi
@StackedCrooked Actually, 80s hairstyles looked the same in the 80s as they look now.
 
@Mysticial But I just got here!
 
@sbi Ok, meanie!
 
9:00 AM
@R.MartinhoFernandes Move to a real timezone.
 
This is the only real timezone!
Also, I don't see how timezones are relevant to being awake :P
 
sbi
@Mysticial Why real? Move to a rational timezone. Or a natural one. Much better.
 
@Mysticial but did the loop he spent time optimising prove to be a bottle neck?
 
@thecoshman if it yielded a 10-20x speedup, it's hard to see how it could not have been a bottleneck
 
user1182183
/me hates unhandled exceptions @ if statements >_>
 
9:06 AM
lol
 
I hate multiple string classes
 
I'm making a new one!
Just in case.
 
our code is a perpetual battlefield between std::string and QString
 
user1182183
Yes I beg for help knowing nobody has to care or help, xD
 
QString is winning, but std::string is holding out in several strongly defended positions
 
sbi
9:07 AM
@jalf Ah, but he didn't say whether that was overall performance. It could have sped up the loop 10-20x, which could have been irrelevant to the application.
 
user1182183
;o nice battle going on?
 
@GamErix An access violation is often the result of indirection through an invalid pointer.
 
and now I had to make some changes in one of the std::string areas, I thought... Turns out to cross the threshold into QString territory, so I have to convert strings left and right, and figure out which to use when
 
It's not weird, it's pretty normal UB.
 
@jalf My code is littered with conversions between the two: toAscii().data() and c_str().
 
user1182183
9:08 AM
Yes I use a pointer, accesing a list, how can I check if I actually acces a valid pointer?
 
user1182183
from a std::list
 
sbi
@jalf At least you don't have another two or three home-grown string classes mixed into that. Back in the 90s, no serious codebase had less than that.
Writing string classes once was the most popular indoor sport among C++ programmers.
 
user1182183
 
As a general rule I always use std::string and do just-in-time conversion to QString where necessary.
 
@GamErix Is the playerid valid?
 
sbi
9:10 AM
@GamErix You can't. Either it's NULL, or you just have to assume it's valid.
 
@sbi lol, serious.
 
@sbi oh, we've got some C strings too, and probably one or two MFC strings too
 
user1182183
@sbi then how come data from std::list is null when accesing? :O
 
@GamErix It's not a null pointer.
 
user1182183
I clearly push back when a player connects and remove in disconnect :$
 
9:11 AM
"Access violation reading location 0x64a69d20" <- if it was a null pointer, it'd be 0x00000000.
 
sbi
@jalf Yeah, every framework came up with their own string class. I was, however, speaking of an additional 2-3 home-grown string classes, which had crept into the project via some inhouse codebases that got incorporated over the year.
 
Break in the debugger and see which pointer has that value.
 
sbi
@GamErix Note that I didn't say the pointer is correct if not NULL. I said you have to assume. That's because there is nothing else you can do.
 
user1182183
well ok I'm gonna do a debug again to check the value
 
But check if playerid is ok (i.e. not less than 0, and not equal or greater than MAX_PLAYERS) first.
 
sbi
9:14 AM
@R.MartinhoFernandes Yes, absolutely. I suppose that, throughout the 90s, where I was mostly studying, and not coding for a living, I was involved in the creation of maybe half a dozen proprietary string classes, which implemented at least three different string class paradigms. Thankfully, they all have been washed away by std::string.
 
@sbi So, by today's standards, you used to be evil.
 
user1182183
hmm the value of i is 4906632, is that the address ([ptr] 0x0212b958) or the value of playerid = *i; ?
 
user1182183
weird value.
 
user1182183
if it's *i
 
user1182183
the debugger doesn't show anything for playerid, like it doesn't know what value it has
 
sbi
9:18 AM
@R.MartinhoFernandes What? There was no standard string class back then! The fact that you could create your own ones was considered progress.
 
@GamErix That's the address. Put *i on a watch.
 
user1182183
 
Then there's your problem.
The playerid is wrong.
 
user1182183
how can it become like that ; o
 
user1182183
if that's the value
 
9:21 AM
Your list has bad data?
 
Why are you using list anyway.
 
0
Q: boost / creating streams

Vis VivaCan you provide a simple example of the simplest code to create a boost "in" stream (boost::iostreams)? Im trying to create a stream that can be assigned to a file_sink later on. Thanx in advance.

What should I close this as?
 
user1182183
@CatPlusPlus if you have another way to fast delete (playerid) from an array I woul like to hear it :)
 
There's no "close as RTFM".
 
What?
 
user1182183
9:23 AM
List seems to be the easiest option as it provides remove(value) :$
 
Also that code is terrible.
 
user1182183
and playerid's are uniquee
 
Finding and removing an element from a small array might be faster than from a list.
@GamErix std::set
 
user1182183
the max size would be 1000 of the array (unless the developers make the max player count higher)
 
Also, is that still that stolen/leaked source code.
 
9:25 AM
What did I miss?
 
Jul 6 at 22:51, by Gam Erix
I'm kinda curious how many people are interested in the source code of pandemic's studios / activisions' Dark Reign 2.
 
user1182183
It's no stolen/leaked source code.
 
user1182183
It's my own anticheat for San Andreas Multiplayer, made from scratch
 
user1182183
and the source code of DR2 I didn't touch cuz I don't know what to edit
 
user1182183
Now I'm kinda curious how you can search for posts that fast
 
sbi
9:27 AM
What did I Ms?
 
He shoots! And he Mrs!
 
user1182183
if it gets to deleting does it matter if I use unsorted_set or normal set?
 
user1182183
something like .remove(value) ? and just push_back equilivant
 
user1182183
then I just iterate through it,
 
9:30 AM
Do you need the things sorted? Yes? Use set. No? Use unordered_set.
0
Q: const array of fixed size const array as argument of a method in C++

Kevin MOLCARDFollowing my question about passing array as const argument, I am trying to figure out how to write a method where the argument is a const array of fixed size const array. The only writable thing would be the content of these arrays. I am thinking about something like this: template <size_t ...

Also, kill me now.
 
user1182183
well in pawn we can just pass [] and then do sizeof() and everything is fine ; x But that's just the "awfull" pawn..
 
What's "pawn"?
 
user1182183
Didn't I mention it already? xD -> "Small Embedable Scripting Language"
 
user1182183
also known as "SMALL"
 
An awful untyped language.
 
user1182183
9:34 AM
www.compuphase.com/pawn/Pawn_Language_Guide.pdf
 
user1182183
it has more than you think ; p
 
user1182183
Maybe I can recomend page 133?
 
user1182183
<and now everyone is downloading and reading it.. how quite..>
 
I know it, and it's terrible.
 
user1182183
you build your C(++) app on top of it, provide scripting functions and voila, you don't have to worry about many stuff you usually have to in C(/C++)
 
user1182183
9:40 AM
but that's just me.
 
Typeless? That sounds more like "most people won't worry, but not worrying doesn't make type errors go away", than "you don't have to worry" (Disclaimer: I haven't read the thing)
I want to not worry because the compiler worries for me.
 
user1182183
well I don't know what they mean by Typeless but I have to use my keyboard to script anything.
 
user1182183
@R.MartinhoFernandes you mean the byte code compiler? Well people have made JIT compilers for it and some other stuff
 
@jalf but if that loop only took 0.01% of the time to execute an operation, I would rather see a 50% increase in the loop that is 90% of the operation
 
> Written by bestselling programming author Herb Schildt who is on the C++ standards committee and has been writing about the technology since its inception
@sehe An he's still lying about his affiliation to the SC.
 
9:46 AM
@GamErix Lol.
 
user1182183
@CatPlusPlus ye? xd
 
user1182183
BTW can anyone explain what O(N) and example O(logN) means?
 
user1182183
log i know..
 
@GamErix O(N) means that the time it takes to do 'the function' is directly proportional to the number of elements, for instance, listing all the number from zero to N. O(logN) means the function is proportional to the log of N (can't think of an example of the top of my head
 
O(N) is the set of functions f for which there exists a point m and a constant k such that for all N > m, kN > f(N). O(log N) is the set of functions f for which there exists a point m and a constant k such that for all N > m, k log N > f(N).
 
9:52 AM
it's a way of showing how complex an operation is
 
I'm awesome.
 
it's known as Big O notation
 
user1182183
so if it takes O(N) to calculate a route, where N is the amount of elements, and let's assume N is 50, and to access one element it takes 1 ms, it would take 50 ms?
 
user1182183
and when it would be log N then it would be log 50?
 
user1182183
9:53 AM
then what ; o
 
It's about growth.
 
@GamErix not exactly
 
However they explain it to you, always keep that in mind: it's about growth.
 
user1182183
wikipedia sux if it get's to understanding 'basic' stuff. they always make something big from stuff, even if it's just 1+1 the will work it out on 10 pages.
 
think of something that is O(N) compared to O(N^2)
 
9:56 AM
When someone says something takes O(N) it means that as the input size (N) grows, the measurement you're concerned with (could be time, could be space, could be something else) grows linearly or slower.
 
how can this be? :
$ grep -v NET 9022.nets | grep NET
$ grep -v NET 9022.nets | sort -n -k2 9022.nets | head
NET 7
NET 8
NET 9
 
user1182183
hm ok
 
for one item, they are the same, but for 2 items, O(N^2) is twice the 'work', for 3 itmes.. etc. etc
 
user1182183
ah oki
 
@Riga I suspect you're on the wrong place.
@thecoshman Woah, woah, what?
 
user1182183
9:57 AM
so to keep it simple, it's just to compare, if I have O(N) and O(2N) it takes the second fnction twice as long to execute? ; d
 
user1182183
O_o
 
O(2N) is the same as O(N)
 
user1182183
or takes double space..
 
user1182183
9:57 AM
Oh
 
Keep it simple. Keep it correct. Pick one.
 
user1182183
e
 
@GamErix excet, O(2N) is just, O(N) it grow linearly, double N and you double the space, time, cost etc
 
Again, it's about rate of growth, not time it takes to execute (or whatever).
 
user1182183
hm ok, I think i understand it a bit, but, I have to wait when school begins againm then I can ask my teachers, and hopefully they can explain it in my native language xd
 
9:58 AM
big O notation is to show how a function reacts when you increase the numbers it works with
 
@R.MartinhoFernandes No way. Is that a lie?! Amazing
 
it's a classification for a function
 
user1182183
oki ; ) thanks
 
@thecoshman algorithm, actually
 
9:59 AM
¬_¬ I do not care enough about maths to get that anal
 

« first day (647 days earlier)      last day (4305 days later) »