« first day (677 days earlier)      last day (4257 days later) » 

11:01 PM
@NikiC we are on the same page :P why $i = 31, what is expected result of $cidr, etc...
$mask = "\xff\xff\xff\x00"; // 24
ff ff ff 00 is not 24 heh
Thus, The CIDR notation 198.51.100.0/24 would be written as 198.51.100.0/255.255.255.0
makes sense
 
in any case, in the second problem he is basically looking for the log2 of the inverted number
which is a pretty well investigated problem
With a few algorithms listed here: www-graphics.stanford.edu/~seander/…
 
which reminds me I have 3 maths to pass in a month
@NikiC nice man
 
but that won't help him, because those are optimized for C-level speed, which probably isn't something he needs ^^
 
echo log(-256, 2) && 0;
 
yeah
 
11:12 PM
 
subnetting... shudder
 
@ircmaxell I see, so $i = 31 is probably related to 255.255.255.254
@NikiC nice, was going to suggest you, but you edit so fast :D
 
@webarto Only problem is that it doesn't yet work :D
 
yes, 254 (fe) returns 32 instead of 31, right?
 
I think this works more or less:
$cidr = (int) (32 - log(~current(unpack('N', $mask)) & 0xffffffff, 2));
It's soooo ugly :D
 
11:26 PM
@NikiC ugly in a good way :D I'm still getting 32 for fe
 
$ /c/php-5.4.1/php -r 'var_dump(1 << 32);'
int(1)
$ /c/php-5.4.1/php -r 'var_dump(1 << 33);'
int(2)
$ /c/php-5.4.1/php -r 'var_dump(1 << 34);'
int(4)
WTF
I think PHP's shift is going in circles :D
 
what exactly does || ".%" do in an sqlite query?
 
@orourkek concat I think
i see you're doing stripe ctf?
 
attempting, anyways
spent over 10 minutes now just trying to figure out what that means
google is no help :{
 
just assume that it is concat ;)
 
11:35 PM
concatenating what, though?
 
14
Q: String concatenation does not work in SQLite

BahaiResearch.comI am trying to execute a SQlite replace function, but use another field in the function. select locationname + '<p>' from location; In this snip, the result is a list of 0s. I would have expected a string with the text from locationname and the '<p>' literals.

 
@NikiC hahaha
 
google fail 101: querying for sqlite "||" returns nothing
 
@orourkek Think of the ? || ".%" in the code as doing $namespace . ".%" (just with proper quoting)
 
my mind is clouded with google frustration now... gotta refocus
 
11:45 PM
$mask = "\xff\xff\xff\xfe"; // /31
$x = (int) (32 - log(~current(unpack('N', $mask)), 2));
if($x == 32) $x--;
echo $x;
xD
 
@webarto Why does that happen?
 
@NikiC I have no idea? Does it happen to you?
 
sure
I generally don't get what I did there
 
dat feeling
 
It kinda works and kinda doesn't :D
 
11:55 PM
~works :D
@NikiC probably because I'm on 32bit etc
 
@webarto happens on 64 bit too
 
level 1 was a lot easier than level 0 for a PHP dev
 
Hm, I'll delete that answer
The whole thing is too instable
Using a float log for bitwise stuff just doesn't work out
 

« first day (677 days earlier)      last day (4257 days later) »