« first day (930 days earlier)      last day (4032 days later) » 

12:00 PM
NB: my shortneded urls are pointing to a website wich requires auth from browser to acced, maybe this is why they seen like spam?
 
@okok yeah, i think it's an know issue
I don't remember any way around it
but I may be wrong
 
@Trufa didn't catched sorry, do you mean it's cause of auth or cause fb wants to make me angry?
 
Have you tried other shortening api's?
 
@dragon112 nope sincerilly, G gave 1 Milion urls a day :P
 
@okok facebook just blocks goo.gl links
 
12:02 PM
omfkg :/ really?
daaaamn they scuks pfff ok thanks i'll share not-shortner link so
:D
 
@okok you can try this: pastebin.com/sYMfN647 I used it some time ago. Not sure if it still works tho.
 
thanks dude @dragon112 do you now their daily quota limit?
API limit
 
@okok bit.ly should work
 
don't know if them has similar to google usage limits
if yes i'll check them thanks a lot
 
user652649
another question chaps... passwords salts should be used one unique per account, right? and how should i store the salts in the db?
 
12:15 PM
@Wes
2 db
1 for salt keys
1 for encrypted data
IMO
 
@okok If you need 1 milion urls a day you should make your own shorturl service.
imo
 
@dragon112 only if i need 1 milion +1 IMO :)
1'000'001
 
user652649
@okok using the same table containing the hashed password and the salt is not recommended for which reason?
 
@okok: no that's not true
@Wes just use crypt format (via password_hash) and don't worry about it
 
12:19 PM
@Wes if you need to touch the salt yourself, you're doing it wrong...
 
@HamZaDzCyberDeV why would you invoke me .. i'm not exactly and evil spirit , ya know
 
@ircmaxell @Wes if someone stoles you the enteire db he can acced all data, with 2 you have double possibility to be safe
IMO ..
 
@okok is.gd is also a character shorter than goo.gl
 
user652649
@ircmaxell what about cross platform availability of the hashing functions?
 
I think their keys are also a bit shorter
 
12:21 PM
@Wes all the more reason to use accepted standards
crypt(3) (blowfish) is available almost everywhere
@okok that's why you use a strong hashing algorithm like bcrypt. Splitting into 2 databases is tantamount to security through obscurity...
at least for salts
they are not cryptographic secrets, and as such keeping them secret adds little to no value...
 
> if your code is generating or storing a salt, you're doing it wrong. Use a library.
@ircmaxell by that definition, you may not use your library because its your code :P
 
:-D
@Gordon correct :-P
 
@ircmaxell I don't get that argument tbh. are you trying to say I should trust some library over my own skills?
 
user652649
ok, perfect, thank you
 
@ircmaxell uhm i think i can't catch you really good, but a salt uses an encryption key right? what about put keys in another db? i think it's correct , double security prevention how to say
 
12:25 PM
@okok no, a salt is not an encryption key
 
uhm ok i misunderstood sorry :D
 
@Gordon yes. In this case especially, yes.
 
pardon me
 
@ircmaxell so I should rather download some class from phpclasses and use that?
 
@Gordon stop trying to poke holes
 
user652649
12:26 PM
no wait a question... if i generate a password_hash() on windows, and store the hashed password in the db, it will work on another system too? i mean, will the salt on windows be the same of one another system?
 
@Wes yes
 
@ircmaxell hehehe :) so that tweet should really have read: "if you are not using my hashing library, you are doing it wrong"
 
the salt will be different every time
it's generated and stored in the return result
@Gordon no, there are plenty of other libraries that I'd recommend as well
 
user652649
ouch. @ircmaxell any php 5.4 solution? i just saw password_hash is available only on 5.5
 
user652649
12:32 PM
@ircmaxell awesome thanks :P
 
12:44 PM
Hellooooooo
@tereško no you're not :p
 
Ooh, Kahn Academy Bitcoin tutorial. Not bad! https://www.khanacademy.org/science/core-finance/money-and-banking/bitcoin/v/bitcoin-overview
 
user652649
@ircmaxell where is the salt actually stored? i mean if i generate the password using password_hash on windows, and then verify it on a completely different machine using password_verify it will work?
 
hmm ... i will have to go through some of the PHPUK lectures this weekend
they have posted this year's ones on youtube and at least half of them look relevant
 
1:05 PM
@Wes Yes, that's the idea of a hash. Every time you hash the exact same thing it gives the exact same result.
 
@tereško they should also have those from last year. I find their coverage pretty well.
 
@Gordon I started it today, will continue whren I have more time, it's pretty good so far
a little slow if you already had some idea of what bitcoin is
but still
 
@hakre I mean I work for 2 hours then make 4 commits. Instead of commiting each change as they happen
 
user652649
@dragon112 yes but hashing again requires the same original salt, or it does not?
 
@hakre i have watched all the interesting ones from 2012th
 
1:19 PM
@Wes Yes but that's saved inside of the completed hash, correct me if I'm wrong @ircmaxell
 
@Wes , once I upload images from iPhone , it seems like a lot of data ( especially exif data) is missed or changed
 
user652649
@Itamar better if you ask in the ios chat, no?
 
@Wes , great idea , thanks
 
does anyone here know anything about require_once and autoloading in relation to phpunit? If i try to open a unittest it can't seem to find files in the same directory as said test
 
by the way
has anyone tried / passes the zend certification test ?
 
1:26 PM
is it possible to dynamically prepend the keys of an array with another string?
 
Does it worth the 195$ i'll have to pay for being able to attend ?
 

NSChat

Rules → spiff.io/nschat.rules —  Discussion for iOS and OS X ...
 
@Itamar no
@tereško Did he 'fix your code' ?
 
@iroegbu , thanks
@BenjaminGruenbaum , what not ?
 
i'm not sure ... i usually do not inspect latest updates from svn
 
1:32 PM
@tereško The fact these sort of developers exist scares the shit out of me, to think I could have personal information on a site like that :/
 
user652649
@dragon112 apparently a password_hash-ed on linux (5.5) doesn't get password_verify-ed on windows (5.4) using @ircmaxell 's polyfill... so the salt is stored locally somewhere in the OS
 
@dragon112 yes
@Wes what? that's completely not true
 
user652649
@ircmaxell ok i'm trying again
 
array('foo1' => 'foo1', 'foo2' => 'foo2', 'foo3' => 'foo3')
array('afoo1' => 'foo1', 'afoo2' => 'afoo2', 'afoo3' => 'afoo3');
 
hi @BenjaminGruenbaum how are you dude
 
1:35 PM
is it possible to change 1st array to 2nd one?
 
@shankar.parsanamoni Good, coding.
 
hmm well,
 
user652649
@ircmaxell ok it works, nvm... so the salt is actually within the final hash? this is great, i don't even need to change my db
 
@Wes yes
 
my mini-series about character and document encoding with PHP's dom-document continues:
0
A: php: using DomDocument whenever I try to write UTF-8 it writes the hexadecimal notation of it

hakreIf you want to output UTF-8 with DOMDocument, you need to specify that. Simple, isn't it? If you already smell a trick question, you're not too far off, but on first sight, it really is straight forward. Consider the following (UTF-8 encoded) code-example that outputs hexadecimal entities: $dom...

 
user652649
1:38 PM
thank you for the polyfill :P may i ask you why some php commits are only on trunk and not also in the stable branch?
 
@Wes what do you mean?
 
user652649
i mean that it would be nice if password_* functions were also in 5.4
 
solve that problem by transitioning to 5.5 faster than 5,4
 
well it seems like the OS guys does not have an answer either
 
@Pheagey In the times of version control, a developer must take care to not leave too many suspicious trails :)
so always develop in a branch, then squash before pushing.
 
1:48 PM
$new = array();
array_map(function($v, $k) use(&new){
 $new['a'.$k] = 'a'.$v;
}, $array, array_keys($array));
@iroegbu try this
 
oh... thanks
I've solved it :D
 
didn't try it :p
ah ok
 
$new = array();
foreach ($foo as $k => $v) {
    $new['a'.$k] = $v;
}
 
ah xD
I made a simple problem into something complexer
 
@HamZaDzCyberDeV use array_walk for something like that
 
1:51 PM
@ircmaxell oh thx
 
how about a function that converts a list of pairs to an assoc array?
 
list of pairs?
 
[['foo', 1], ['bar', 2]] => ['foo' => 1, 'bar' => 2]
 
user652649
ok these password_* functions are about security, but to ease the usage of new good code, experimental functions could also be included in the stable php version, especially functions that could be emulated in the user space. sometimes this happens, for example the intl and oop-datetime extensions were not that good when i first saw them in the core stable php, but at least we have been able to "know" them :P
 
@igorw but an index can't be an array ?
 
1:56 PM
array_combine(array_map(function($e) { return $e[0]; }, $array), array_map(function($e) { return $e[1]; }, $array));
@Wes I think that's exactly why it shouldn't. Once the code enters stable branch, it's got backwards compatibility concerns. Try out features in beta and RC, and once they hit stable they exist...
 
user652649
i don't know, it could be considered an user choice/risk to use them, not your worrying
 
hmm .. the english "aplomb" seems a lot like russion (transliterated) "ablom"
and they have quite the opposite meanings
 
user895378
2:21 PM
Random thought: has anyone created data visualizations for the php.internals list? I'd be interested to see data viz for things like number of participants over time, average message size, frequency, etc... It wouldn't serve any real purpose but superfluous data is always fun :)
 
user895378
I might have to scrape the list site and make some. Am I the only person who thinks something like that would be cool (don't answer that)?
 
Can someone help me with the correct isset use of this code?
$result = mysql_query($sql);
$currentCategory = "";
$totals = array();
$currentParent = "";
$leftColumn = "";
$rightColumn = "";
$position = 1;
$rightCount = 0;
$leftCount = 0;

while($row = mysql_fetch_array($result)){
$totals[$row['categoryName']] = $totals[$row['categoryName']] + 1;
}
Is my $totals set up correctly ?
 
user652649
ircmaxell aand what about keeping the login session in a cookie? should i use any random string as php does with its session id or there's more i should know?
 
user895378
@eberswine You have a larger problem ... Are you aware that the mysql extension is officially deprecated? You should switch to mysqli or PDO and use prepared statements ...
 
hmm. interesting. So I can just switch to mysqli ?
Ok
 
2:27 PM
@eberswine Your $totals is fine, but your loop isn't. You can't use $totals[$foo] to calculate the new value for $totals[$foo], if it has never been defined before.
 
ok, so my code edit would have to use isset in front of it ?
if(isset($totals)){ } ??
 
Something like if (!isset($totals[...])) { $totals[...] = 0; }, yes.
Btw...you can do that with SQL just as well.
 
What would be more efficient ?
 
SQL
 
how would that work with my example ?
 
2:33 PM
SELECT categoryname, COUNT(*) AS num
FROM table
GROUP BY categoryname
That should do it.
 
great! thanks!
@TillHelge So, just use COUNT(*) to fix this ?
 
Have a look at the result of that query.
Execute it in your DB tool or something.
 
morning
 
I see, Category Name ( 2 count )
Category Name 2 ( 3 )
 
That should be exactly what you want, right?
Well...good luck fixing your thingy. I'm heading home. Weekend, here I come! :)
 
2:49 PM
yes, and that would take care of the "undefined index" notice
thanks. cya
 
word
 
I'm off, g'bye
 
bye bye
me too
see ya all !
 
user895378
What? That's not Rebecca Black?!?!!!
 
3:01 PM
@kaᵠ +1
 
loool
 
@rdlowrey but that is
 
user895378
There we go. All is right with the world once more.
 
The word "hackathon" is now a trademark. https://register.dpma.de/DPMAregister/marke/register/3020120063403/DE?lang=en (via @initrd)
2
 
*facedesk
 
3:09 PM
Would anyone be interested in talking here smartwebconf.com ?
 
farking markdown
 
3:26 PM
Farking LTI TruCam
 
does anyone knows of graph.facebook ?
 
user652649
@webarto FFFFFFFFFFFFFFFFFFFFUUUUUUUUUUUUU. how much?
 
3:42 PM
@Gordon Let's guessathon how long nachtausgabe.de will be online.
 
@NikiC If my C data structures need to regularly call a user-provided callable, do you think that will outweigh the benefits of writing it in C?
 
@Mhche graph.facebook.a.nice.nose.in.the.buttecks
 
@hakre i don't know what bothers me more: that someone actually was cocky enough to register it or that the DPMA apparently doesnt check what they are registering
 
@Gordon DPMA registers what they are asked for. Without the idioty by those kids regsitering this, DPMA would not have done that.
 
@hakre the DPMA are idiots. a simple google search would have told them that the term is an established term.
 
3:45 PM
@Gordon But I think by law they are not required to care. There is the opposition period and it's enough they can wash their hands in unschuld.
 
@hakre that's a dumb law then.
 
@Gordon Depends who you ask. The Amt will tell you they love it.
 
@hakre "night edition" ?
 
@LeviMorrison the folks who registered Hackathon
 
@LeviMorrison yes, that's the translation I guess. The night edition of the newspaper.
 
3:49 PM
@LeviMorrison its some party site. they have pictures of party people, event listing, stuff like that. they apparently dont even have anything to do with IT.
@hakre IMO there is only two reasons to register that: 1. to protect it from other people registering and making it free for use or 2. make life miserable for everyone wanting to use the term.
 
@LeviMorrison no
 
@Gordon 1. keeps a contradiction in it's own so likely not and 2. sounds like the way to go. Screw all those hackathons. But likely not. It might be just creating intellectual property to bring it to use some day - so yes 2.
 
@NikiC To clarify, you think writing it in C would be beneficial from a performance standpoint even if it needs to call user-land functions?
 
@hakre it smells like abmahnanwalt
 
@LeviMorrison yes. but obv depends on what exactly you are doing
but from "datastructures" I followed that even if it would not offer performance it would at least offer large memory savings
 
3:54 PM
@Gordon it smells like stinky shit. Seriously, I would not cry a tear if there is a spontaneous hackathon at their office tonight.
 
@hakre hehe, the phpuceu is this weekend. organize a protest march :)
 
"it smells like stinky shit" => is there shit that is not stinky?
 
@Gordon They fill their plush elephants with napalm.
 
@NikiC yes. mine. smells like roses. and vanilla.
 
@NikiC sure, there is sweet good smelling baby shit for example.
 
3:55 PM
@Gordon Did you eat roses and vanilla recently?
 
@NikiC no. it's a gene defect
 
@NikiC no he eats döner kebap and then this turkish delights afterwards.
the roses and vanilla shit gene defect.
but it can be that the gene-effect is with ones own nose, not with how the shit stinks actually.
 
@NikiC I am regularly approached by the perfume industry because of it
anyway, @hakre do you think they'll get sued for it?
 
@Gordon The company who registered or the nerds who are holding a hackathon?
 
@hakre the company who registered. maybe from EFF or some other NPO protecting our stuff
 
4:00 PM
@Gordon Ah nah, theee germans love their laaaahw far too much.
I wonder actually if there is anything "wrong" with it by the letters of the law.
Those company did back that up with their patentanwälte it looks like if that's not just some service company where you order online.
 
@NikiC Are you familiar with splay trees?
To be honest, I am not really 'familiar' with splay trees, it's just the latest data structure I'm trying to understand and it's one that I'm hoping to speed up.
 
okay, today first of all DPMA will be slashdotted.
and according to the registered classes, there is: *"Class(es) Nice 41:
Durchführung von Live-Veranstaltungen, Organisation und Durchführung von kulturellen und sportlichen Veranstaltungen; Unterhaltung"* which really looks like they want to bring that into action. Also for any kind of events and for clothes. So this is actively targetting both confs/events and swag.
It's maybe just the right time that nachtausgabe.de is being asked what they thought when registering this.
Parov Stelar tours europe parovstelar.com/index.php?id=19
 
@hakre I did that via Twitter already. I just dont think I'll get an response. Their Twitter is dead for quite some time now. But I'd appreciate if t3n or any other news site could investigate that
 
Good Evening
 
@Gordon If they play uboot it's not a good sign.
 
4:14 PM
Hello, could anyone take a look at this question?
0
Q: Protecting Root Directory from all but IP, allowing Subdirectory

jmalaisI've seen some other questions and answers here, but I'm not really getting things to work. I have two directories: ROOT/ and ROOT/SUB/. I also have two .htaccess files in those directories. My ROOT .htaccess has the following code: # Send them get access ErrorDocument 403 /SUB/index.php # BLOC...

 
@jmalais AllowOverride directives would be set in httpd.conf, you can't set it in a .htaccess. Try changing it to Order allow,deny in both files
 
@DaveRandom So do I just change it on the .htaccess, not create an httpd.conf?
 
httpd.conf already exists, it's the master Apache configuration file, you can't create another. If AllowOverride none was set then none of you .htaccess files would ever be processed, I highly doubt that's the issue. Just change the values in the .htaccess, I'm not sure if it will work or not, I can't remember how the precedence works, but I think there's a fair chance that's the problem
What version of Apache are you running?
 
Let me check
@DaveRandom Where do I check this? I'm looking at phpinfo() but it doesn't clearly say version.
 
It should be near the top, and it will say something about SAPI. But it doesn't really matter if changing the Order directive works
 
4:33 PM
 
Server API: CGI/FastCGI?
 
obviously not done (or anywhere near it)
@jmalais FastCGI
 
@ircmaxell That's my apache version?
 
I have no idea
 
@jmalais It really doesn't matter if changing the Order directive works
 
4:36 PM
@DaveRandom When I change the order directive can I still list deny all first?
 
Basically if it's Apache 2.3 or 2.4 you should use Require directives instead of Order, Allow and Deny but it really doesn't matter, all versions of Apache for the foreseeable future will provide backwards compat with the old way of doing it
@jmalais The order of declaration of the actual Allow and Deny directives doesn't matter, they can be in any order you like as long as the Order directive says allow,deny
It's not very clear on the order of precedence when you have multiple levels of .htaccess though. The sane thing to assume would be that the more specific file has precedence, but this is Apache so the sane thing to do doesn't really count for anything
 
Finally PHP 5.5 will fix this: Case insensitivity no longer locale specific!
 
@LeviMorrison nope
 
@DaveRandom It seems to be working, though it doesn't reflect the file location in the address bar. It's like a phpinclude of the subdirectory page.
 
@NikiC I have known of them for a few years but never dug around in how they work until this week.
 
4:42 PM
@DaveRandom My next step is to write a PHP script that will fwrite to that .htaccess file and append a submitted IP
 
They'll work nicely for sets because recently accessed nodes are near the top of a tree. So you'll get something much better than O(log n) in practice if you commonly access the same keys regularly.
 
Do you foresee any issues with that?
 
@jmalais ...that doesn't sound right, what is in the address bar and what are you expecting to see?
 
@LeviMorrison I personally don't think much of using binary trees for maps or sets
 
@NikiC Well, you can't always hash something uniquely. This avoid the issue.
 
4:44 PM
@jmalais Well, not necessarily, but you might be better off proxying requests through a PHP script to handle the black/whitelist - but there will be a bit of a performance hit if you do that
 
I do offer HashMap and HashSet though for when you can (like database ids).
 
@DaveRandom Well the ErrorDocument 403 redirect is to ROOT/SUB/index.php but it only shows on ROOT/index.php
 
@LeviMorrison Sure you can always hash something uniquely ^^
Imho one should only use tree based maps if one actually wants to make use of the underlying order
 
@jmalais Ahh right, ErrorDocument doesn't do a redirect (nor should it), that only tells Apache which local file to serve
 
If not, hashmaps are always faster and imho also easier to implement
 
4:45 PM
You shouldn't redirect to error documents because it means that HTTP loses the semantics of the response code
 
@DaveRandom So I shouldn't have an issue executing PHP on that page? Also I'm not quite sure how to do the php proxy, but I'll research it
 
@NikiC But are not unique. This really is a problem.
I do agree that using them when you need the sort order is the usual case.
 
@jmalais Executing PHP on which page, the error document?
 
Alright, so would I need to do like a response redirect? Can it be done with the Order property? Or do I need to enable the rewrite engine, etc...

And yes on the error document page
BTW This page is meant to be accessible by me only....and then I'd like to be able to grant myself access when based on different IPs
 
Right, no you can't execute PHP in an ErrorDocument page, you will need to proxy the requests through PHP. You need to set up a catch-all rewrite rule in the root directory to route all requests through a PHP script, and in the PHP script you look at the requested URI and determine what to do
 
4:49 PM
Yes you can create your 404.php, it works as well with ErrorDocument directive.
 
@hakre I'm sure it doesn't, I thought Apache treated all ErrorDocument directives as static files?
In any case, a PHP proxy is the way to go here IMO
 
@DaveRandom No, you can have something that resolves to static on local server, to dynamic on local server and even a redirect.
@DaveRandom yes, better idea then rewriting .htaccess. that can screw the security. if you just re-write it while the site is accessed.
maybe doing both is the way to go.
like the double the better
and also you should re-write the iptables to just block there.
this then would be three layers of defence - yay
 
I say just RewriteRule (?!^proxy\.php$).* /proxy.php [L] and do all the logic in PHP, I can't really see how you'd need anything else :-P
every time
 
So that apache code, will that force all visitors to go through proxy.php?
 
@jmalais yes something along the lines, yes.
 
4:55 PM
That will force every request to a file called proxy.php in the root directory. Then you can examine $_SERVER['REQUEST_URI'] to get the path the user requested, and $_SERVER['REMOTE_ADDR'] to get the user's IP address
The other advantage of this approach is it means you can put all the actual files you want to serve outside (above) the root directory, so if some idiot turns off .htaccess processing or whatever then the files still won't be accessible, because the URLs don't map to real paths on the server file system
 
Would I want to use a database to store the allowed IPs?
 
Whether you want to is a decision for you, but this way it means that you can a lot more easily
You wouldn't want to do this is a high traffic scenario because the rewriting + PHP + database is quite expensive, but for the situation you describe it will be fine
 
Alright, and on the business side of things. Are there any services that provide this? Like a personal and private homepage?
 

« first day (930 days earlier)      last day (4032 days later) »