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

10:00 AM
as far as I care, they are effectively the same
 
@thecoshman But you were anally maths-correct.
 
Really :) I can implement O(x) algorithms in many functions, or even OO (visitor pattern etc). But I guess you're right: each of the constituent functions has it's own complexity
 
@R.MartinhoFernandes where? or is that a pun?
 
1 min ago, by thecoshman
it's a classification for a function
 
The function describes the run time of the algorithm as a function of input size.
 
10:01 AM
In a perfect maths wold, computation doesn't take time :)
 
O(1) all the things!
 
That's the difference between maths and computer science.
 
user1182183
@sehe Yeah I would like that >_L, hate my GPS for takings so long, and when playing GTA4 or Saints Row 3 those stupid systems can calculate a path in an instant!
 
> Thank you for shopping with us. We thought you'd like to know that we shipped your items, and that this completes your order.
> Your estimated delivery date is: Wednesday, August 8, 2012
@JimNorton ow, the sea is a slowdown for non-express mail. Only (dictators of) small countries can afford express shipping though
 
Although AoC can be viewed as a runtime bound on decision processes.
 
10:02 AM
@sehe Ow.
 
user1182183
one mouse click on a map and there you go, your route is ready
 
@GamErix The GPS is actually unrelated to the path finding algorithm :) But I get what you mean
 
That irks me too.
 
user1182183
Well I profiled my plugin and the dijkstra takes 20ms / route in worst case
 
user1182183
in GTA4 not even 1 ms
 
user1182183
10:03 AM
or sumthing like that
 
user1182183
those systems are terribly fast
 
user1182183
but yeahm, they pay huge money for that stuff
 
@GamErix that's why your PS3 is about 10 times the size of your GPS unit ¬_¬
 
user1182183
and I don't have so many money to pay programmers to do my stuff
 
Google Navigation is ok, IMO. It takes a bit longer to take the actual traffic into account :)
 
user1182183
10:04 AM
@thecoshman I'm talking about my plugin (gpb.googlecode.com) xD It's also for GTA, just not 4, but San Andreas
 
@GamErix erm... I'm saying your PS3/PC is a damn site more powerful then a GPS unit in your car
 
user1182183
yeah that's true ; p
 
user1182183
youtube.com/watch?v=HeiQvYAgFwI <- the first release of my plugin was horibly slow, 7000 ms for a route omg!
 
user1182183
imagine 1000 request / minute.
 
user1182183
would take 7 000 000 ms, 7000 sec , = almost 2 h to calculate
 
user1182183
10:06 AM
xD
 
user1182183
 
mawning
 
user1182183
lol
 
user1182183
good modification ; o
 
user1182183
10:16 AM
anduh the plugin stopped crashing, instead of kicking me by crashing the server it actually kicks me! xD
 
user1182183
an event 'we are now coding" ? what's that
 
user1182183
and where did the teen-drama label go? xD
 
ok, so f( expr1, expr2 ); the evaluation of expr1 and expr2 may be in any order and may also be interleaved, per GOTW 102. How can it be interleaved? It's never going to run on more than one thread?
 
We are now coding?
 
lol
blame the incremented cat
3
 
user1182183
10:17 AM
xDD
 
user1182183
oh man I hate it to startup my centos VM everytime I want to compile something for linux...
 
@TonyTheLion Consider f(g(x), h(y)).
The evaluation order can be: x, y, h, g, f.
 
but still, the same thing applies, no?
h and g can not be interleaved, if they are always on the same thread?
 
@TonyTheLion g(x) and h(y) can be interleaved.
Evaluate x first, then y, then g(x), then h(y).
 
user1182183
aren't there many orders? y h x g f, x g y h f, y x g h f, y x h g f, etc?
 
10:21 AM
I understand the order of evaluation, but I don't see how g and h can be interleaved? Say h is running, even if it context switches and comes back, it still needs to finish the h codepath, can't just jump in to g, or can it?
maybe I'm thinking of the interleaved bit wrongly
 
Conformant code cannot observe g and h to be interleaved.
(I think.)
 
that's not what GOTW 102 states
 
user1182183
ok so what's the real order it will get executed? xd There has to be some predictable order of execution?
 
Ok, let's see it like this. The evaluation of g(x) has two steps.
Do you agree?
 
yes, x and then g
 
10:22 AM
@Luc want to rant about taking std::function arguments? stackoverflow.com/q/11628765/46642
 
> Once the execution of a function begins, no expressions from the calling function may begin or continue to be evaluated until execution of the called function has completed. Function executions never interleave with each other.
 
@TonyTheLion There you go. That's where the interleaving can happen.
h(y) also has two steps.
There's nothing that says those two steps must happen without anything in between.
 
ah, I see, so it could evaluate y after x and the g and h
 
@TonyTheLion Exactly.
 
@ecatmur ah yes
 
10:23 AM
@R.MartinhoFernandes Lots of stuff to do this week.
 
@GamErix There isn't.
 
Of course, g and h can still be interleaved (by the optimiser), but it is impossible for a conformant program to observe that happening.
 
@TonyTheLion That's why make_unique is useful. It makes sure nothing happens in between the newing and the saving it in the unique_ptr.
 
What's with the 'we're now coding" event?
 
@R.MartinhoFernandes yes, as I just read in GOTW 102
 
10:31 AM
And suddenly, I'm an iOS developer too.
 
so if you're creating locks, file handles etc, is a make_lock etc also advised?
 
OSX is so terrible.
Gaah.
 
@TonyTheLion hehe. advisory locks :)
 
@sehe ask our cat which is being incremented at any given moment in time
 
@TonyTheLion Erm, why?
 
10:32 AM
time is incrementing my cat
 
std::mutex mutex;
 
@R.MartinhoFernandes for the same reason you use make_unique.
well, I was thinking when you have new somewhere in there
but I guess I was thinking wrong
 
@TonyTheLion But do lock constructors take arguments that are susceptible of leaking?
 
Why does dragging a folder onto another Finder window opens it instead of MOVING IT GAAAAAAAAAAH.
 
@CatPlusPlus hehe
 
10:35 AM
@CatPlusPlus what do you mean you are trying to mimic the real world notion of grabing a folder, and moving it into another folder? you crazy man!
 
CTRL+X DOESN'T WORK.
Help I'm trapped in OSX.
How the fuck do you move stuff here.
 
damn, I'm getting undefined reference to myfunc(), even though I've implemented the function.
I'm at my wit's end.
 
@R.MartinhoFernandes normally no
 
morning
 
@CatPlusPlus I think it's CMD+X in OSX
 
10:37 AM
The implementation's source file is in the build target files. So it is getting compiled.
 
or apple or whatever that special key is they have
 
Thank gods it has Terminal and bash.
 
Then why the undefined reference.
 
@TonyTheLion I'm using NORMAL keyboard.
It's called Control dammit.
 
meh
Normal keyboards and OSX are not friends
they are fiends
 
10:39 AM
Now Xcode.
 
damn. still not working. WTF is the problem. :'(
 
This day is bad.
 
okay, what could be the possible problems that result in an undefined reference to.. kind of error?
 
Your code sucks, or your build system sucks.
 
...damn.
let's try building it with the command line
 
10:43 AM
@CatPlusPlus Mwhahaha.
You can replace some of your known Ctrl+<something> shortcuts with Cmd+<something>.
Also, press Enter to rename a file.
 
There's no Cmd unless Winkey acts as Cmd.
 
You're so screwed.
 
I'll just use coreutils.
 
@IntermediateHacker maybe you forgot the classname in your .cpp files?
 
@bamboon nah. the file in question is a c source file. no classes.
 
10:46 AM
Show us the damn code already.
 
first let me check my build process.
I think that's the problem.
 
@IntermediateHacker inconsistent compiler flags, missing link objects, typos :)
 
checked everything
okay, here's the code
the complete project, in fact.
the errors are like undefined reference to pro_display_init()
 
0
Q: Uncertain output of this C code

Shekhar Possible Duplicate: Could anyone explain these undefined behaviors (i = i++ + ++i , i = i++, etc…) here the value of i is 5 but it should be 6 or 7 I guess. What's the reason? void main(){ int i=5,j; j=sizeof(i++ + ++i); printf("%d %d",i,j); }

can we re-open and close as a dupe of the right question?
 
Sure, what's the right question?
 
10:52 AM
it's in the sizeof which changes it massively
 
@CatPlusPlus Windows start button is CMD on Mac.
 
Oh, you figured that out already..
 
@Flexo Ah, just saw that.
 
@StackedCrooked They have both Ctrl and Cmd? WHY.
Who the fuck sat down and thought "OH THIS WOULD BE A GOOD IDEA".
 
10:52 AM
Reopen vote in.
 
@CatPlusPlus hipsters
 
@CatPlusPlus Hey, they have a study that says using the mouse is faster than using keyboard shortcuts.
 
It's convenient because I can use cmd-c for copy and ctrl-c for sigint inTerminal.
 
Blasdblasdlb.
 
Also, did I laugh maniacally at your present situation already?
If not, allow me.
Mwhahahahaha.
 
10:55 AM
@CatPlusPlus Btw, how come you're on OS X?
 
Just remember to use CMD-Space for launching applications.
 
@R.MartinhoFernandes Faster for nitwits :)
 
@StackedCrooked iOS.
failOS.
 
@CatPlusPlus The OS that disavowed the mouse :)
 
10:56 AM
@R.MartinhoFernandes there as a saying about cats and leading them selves to death :P
 
@sehe Well, I guess you have to deal somehow when your mouse has only one button.
 
> define it out of line
what does it mean in C++ when you "define it out of line"?
 
Define it out of square.
@TonyTheLion Hint: opposite of inline.
 
@TonyTheLion not in-class
 
ah ok
 
10:58 AM
@sehe Their explanation is that to use keyboard shortcuts you have to: #1 stop and remember the shortcut; #2 find the appropriate keys #3 press them. And while you do #1 and #2, you would have already clicked.
I can find a link if you want to laugh more.
 
Apple: by idiots for idiots.
 
so the inventors of OSX claim that keyboard shortcuts are slower than mouse? WTF is wrong with these twits????
 
@Flexo Any more takers for reopening and reclosing?
Wasn't meant for Flexo
 
Goggles time.
0
Q: C++ strtok return error

user1548465string result="CCY 1.2597 Down 0.0021(0.16%) 14:32 SGT [44]"; char* token; char* buffer[result.length() + 1]; //Space for '\0' strcpy(buffer, result.c_str()); buffer[result.length()] = '\0'; //insert '\0' token = strtok(buffer, " "); while (token != NULL) { /* work with token */ token =...

 
11:05 AM
meh, strtok in C++
fugly as fuck
 
Ok. Question. What was std::string really for, back then when it was not required to actually store a null-terminated string?
 
to store a string of char's that never ends
 
I mean, why not template <typename T> using basic_string = vector; (other than the fact alias templates were not there).
 
or for which you had to manually insert an ending
good point
 
@TonyTheLion No, strings were ended.
But the '\0' was not required to be in the storage.
 
11:08 AM
how, if there was no null terminator inserted?
ah...
 
@TonyTheLion It stores the size.
 
confusing, that is
 
c_str() was allowed to return a copy of the contents.
 
so it would only go up to size()
@R.MartinhoFernandes but I guess now it just returns a pointer to the original contents right?
 
11:11 AM
hmmm
I wonder where the decision to put string literals in read only memory actually stems from?
 
C. It makes sense.
 
not if you want to alter the literal after, which you can't do
 
@TonyTheLion How often does that happen?
Also, char x[] = "blah";
 
I don't know
ah
@R.MartinhoFernandes but doesn't that decay to char* x = "blah";?
 
@TonyTheLion No, that's a real array.
 
11:14 AM
oh
another funny rule in C++
when is there pointer decay and when not?
only when passed as an argument to a function?
 
@CatPlusPlus Wait, do you mean you're going to do Objective-C?
Mwhahahaha.
@TonyTheLion Well, any time they need to be converted to a pointer, basically. If a function takes a pointer argument, you get decay. Otherwise, no.
 
@R.MartinhoFernandes :<
 
unlucky
 
@R.MartinhoFernandes muscle memory much :) I'd argue that a mouse inhibits routine tasks: it never gets any faster than 'novice-level' since - well you have to #1 stop and grab the mouse #2 find where the cursor is #3 remember where to look for the command you want #4 navigate there #5 click. All this requires hand-eye coordination all the time and you can hardly do anything else, like, contemplate your next move during that time.
Mousing sucks for computer literates. It sucks even thought they may be used to it.
They just don't know it then.
@TonyTheLion fugly as uck
 
11:21 AM
lol
 
> It’s a nice idea, but 100% politeness 100% of the time is unattainable. I personally view a very high degree of politeness as disingenuous (“What is this person not being honest with me about?”)
(from the comments on blog.stackoverflow.com/2012/07/…, if you care)
 
11:32 AM
int main (void) {
  int x = 1;
  while (x) x <<= 1;
  return x;
}
what's wrong with this?
 
11:46 AM
Signed overflows are UB.
 
user1182183
heey does anyone have any tutorial about shifting enablind and disabling bits for division/multiplication/addidtion and substraction? I want to create a 64bit variable from 2 32bit variables but I need to be able to run calculations on it :$
 
12:02 PM
@GamErix do you want floating point or int?
 
user1182183
int :)
 
signed or unsigned?
 
user1182183
well, in pawn you only have signed integers
 
you will need to use something like struct{int lower, upper;}; and then add in operator overloads such as operator+ that will handle addition of two numbers
 
user1182183
yeah i know that.... just, how to accomplish the bitshifting, or, I could make a plugin which puts all bits from the 32 bit variables into a 64bit variable, and does the calculations, then returns the 32 bit variables ; o
 
12:05 PM
will require a fair bit of checking to make sure you can detect when you under of over flow
 
user1182183
but that would require me to make a new plugin lol xD
 
what are you on about 'plugin'?
 
user1182183
Well there is a modification called 'san andreas multiplayer' and it uses an VM to run scripts,
 
user1182183
unfortunately the VM has only 32 bit signed integer support
 
¬_¬ do you really need to store numbers large enough to require 64 bit ints?
 
user1182183
12:06 PM
but you can add extensions with plugins made in C/C++
 
user1182183
yeah
 
user1182183
experience system ; d
 
is 2 billion not big enough for you?
 
user1182183
I can't really get a real good formula other than something like log((2^31-1)^0.5)/0.08973
 
user1182183
then the max level is 52
 
user1182183
12:07 PM
but the um, how to call it
 
user1182183
difference between one leven isn't really that good
 
user1182183
level*
 
you could always use to variables, one for level and one for current xp on this level. After all, some one who just has level 10 (for example) will have say, 1 million xp points just form the ten levels. You surly do no need more then 2 billion points of xp per level
else you might want to consider rebalancing your numbers
 
user1182183
any number balances online which proven to be good ? :x
 
huh?
 
user1182183
12:11 PM
well do you maybe have any chart ? xD with numbers ; p
 
I am saying that if is taking more the 2 billion to count all the xp for one level, you might need to rethink your numbers. You have a serious case of inflation
you must either be giving the players millions of xp points for trivial tasks, or expecting them to spend fuck for ever to get any leves
 
user1182183
xd
 
user1182183
there has to be a max : P
 
user1182183
I had a level system which did go up to lvl 1500 using one variable (2 bilion exp) and in 3 months many players managed to get that
 
user1182183
don't want to let this happen again with the new server
 
12:13 PM
so, like I said, one variable to count level, one to count xp on the current level
the amount of xp they get from stuff is the same, the only difference is how much xp it takes to increase the level count, which is going to be increase with level. and presumably never get to the point where it is 2 billion per level
 
user1182183
yeah, hm, um, fck.. no log() in pawn >_>
 
user1182183
anyone haz source of an log() functioneee? XD
 
Howdy.
 
user1182183
hmm I think this should do the job for giving/taking exp:
Player[killerid][Experience] += floatround(Player[playerid][Experience]*0.1,floatround_floor);
Player[playerid][Experience] -= floatround(Player[playerid][Experience]*0.15,floatround_floor);
if(Player[playerid][Experience] < 1)
{
Player[playerid][Experience] = 1;
}
 
user1182183
12:28 PM
no I can base my levels on it
 
user1182183
I think I can make it a float value, the EXP,..
 
if you use a float, you are going to have a bad time
 
user1182183
ow? ; o
 
Not necessarily.
But the language is terrible anyway.
 
@GamErix I would store a "modifier" instead of changing the original state.
 
user1182183
12:31 PM
Player[killerid][Experience] += (Player[playerid][Experience]*0.1);
Player[playerid][Experience] -= (Player[playerid][Experience]*0.15);
if(Player[playerid][Experience] < 1.0)
{
Player[playerid][Experience] = 1.0;
}
Now I don't need to worry about players not getting any exp xd
 
tell me, is the xp ever going to be negative, is the xp per level well known, is the maximum xp for a level ever going exceed what a built in int type can store?
 
user1182183
not rly, hm I think I could do multiply everything by 10 and use just ints..
 
user1182183
Player[killerid][Experience] += floatround(Player[playerid][Experience]*0.1,floatround_floor);
Player[playerid][Experience] -= floatround(Player[playerid][Experience]*0.15,floatround_floor);
if(Player[playerid][Experience] < 10)
{
Player[playerid][Experience] = 10;
}
This then ; D
 
¬_¬ I give up
 
user1182183
its an int ^^ xd
 
user1182183
12:35 PM
with this code I actually ensure that for every kill you get at least 1 exp
 
ooh I see, your no longer on about numbers larger than 32 bit
FYI we cannot read your mind
 
user1182183
too much trouble
 
user1182183
64bit integers in an application which disabled them.
 
user1182183
blah
 
user1182183
there would be too much overhead between plugin<->VM communication i think xD
 
12:37 PM
I told you, just use two separate ints. one for the xp in this level, and one for level
so, lets say it just 1000 xp per level, and a guy is on level 4, at 999 xp, he gets one more point of xp, he goes to level 5 with 0 xp
 
user1182183
yeah ok, one more variable in the mysql database won't hurt
 
¬_¬ it's the same amount of data as doing 64 bit ints
assuming you are using 32 bit ints
 
user1182183
I fail.xD
 
user1182183
hmm... Apple I-Fail. Waiting for it. I wanna buy it.
 
Soliciting feedback on another blog post (and I really need my own blog …)
This blog post exemplifies why microbenchmarks should be considered harmful; their conclusions are mostly pure bullshit http://lemire.me/blog/archives/2012/07/23/is-cc-worth-it
=> microbenchmarks are almost always flawed, and even if they aren’t, they’re useless if they cannot explain the result
 
user1182183
12:42 PM
java faster than C++? HAHA
 
user1182183
No way.
 
Java will deplete your system's resources faster.
 
user1182183
a.k.a. Minecraft, you mean.
 
user1182183
Just look how hungry it's
 
user1182183
xd
 
12:47 PM
Never played it.
 
user1182183
I woul like to see a C++ version, and beat it to hell.
 
user1182183
for '95 graphics you have to get a i7 and GTX250 with 4gb DDR3 ram to play smooth
 
user1182183
"at highest settings"
 
user1182183
and, because of that game, my friend old laptop, died,
 
user1182183
We ran the game, it lagged - so I said,: WELL, Le'ts lower the freaking options! , ESC -> We click options -> BOOOM
 
user1182183
12:49 PM
SCREEN Gone,
 
user1182183
all vertical lines
 
user1182183
etc
 
user1182183
almost nothing visible,
 
user1182183
tried to acces with teamviewer - SAME VERTICAL LINES and can't see anything.!
 
user1182183
reboot not solved, even in bios.
 
user1182183
12:49 PM
totally dead laptop....
 
user1182183
[*] Will remember.
 
user1182183
Gotta some good parts out of it... at least one advantage over a disatvantage xD
 
ok, enough with the craptop
 
user1182183
beleive me if minecraft was made in C or C++ even my Casio fx-CG 20 could run it
 
user1182183
but it's in java and even modern computers can't cope with it XD
 
12:57 PM
from my understanding, it's not really a language problem, more a case of poor design
 

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