« first day (760 days earlier)      last day (4171 days later) » 

12:00 AM
@tereško You just received your new daily votes ;-)
 
@Nick that was also incredibly stupid of SO
 
Is it possible to insert mysql sensitive information like raw HTML code via PHP without editing the html?
 
user1125394
@Nick bad idea to give full access based on IP
 
Should I use html_entities and html_entities_decode?
 
@Lusitanian It was. It's stupid to use IIS.
 
12:55 AM
@ShaquinTrifonoff +1
 
user1125394
strlen('Приве́т नमस्ते שָׁלוֹם') is 22 (reading ---->http://chat.stackoverflow.com/users/1477526/lusitanian)
 
@webarto ping
 
user1125394
1:11 AM
ping webarto.com
 
javascript:var u=document.getElementsByClassName('user-gravatar32');for(var i=0;i<u.length;i++){document.getElementById('input').value+='@'+u[i].alt.replace(/ /g,'');}document.getElementById('sayit-button').click();
Execute that ^
 
user1125394
no thx
 
@ShaquinTrifonoff .replace(/ /g,'');? Really?
 
@DaveRandom ...?
What about it?
:D
 
.replace(' ','');
Why the regex?
 
1:14 AM
@DaveRandom That will only replace the first space. The regex will remove all of them.
 
user1125394
'hhh hh hh'.replace(' ','');
 
user1125394
"hhhhh hh"
 
@DaveRandom See? :D ^
@cyril No formatting? :P
 
Oh right, ping everyone. Very funny :-P
@cyril Indeed, I just tried it. I thought /g was automatically applied to a string literal, obviously not.
 
user1125394
should be a replaceAll ..
 
1:17 AM
v2: var u=document.getElementsByClassName('user-gravatar32');for(var i=0;i<u.length;i++){document.getElementById('input').value+='@'+u[i].alt.replace(/ /g,'')+' ';}document.getElementById('sayit-button').click();
@cyril TypeError: Object asdf asdf asdf asdf has no method 'replaceAll'
 
@ShaquinTrifonoff you probably need a space between each user for it to work right. Maybe do this instead:
javascript:var u=document.getElementsByClassName('user-gravatar32');for(var i=0;i<u.length;i++){document.getElementById('input').value+='@'+u[i].alt.replace(/ /g,'')+' ';}document.getElementById('input').value+='ping';document.getElementById('sayit-button').click();
 
@DaveRandom I already fixed that :P
See v2.
1 min ago, by Shaquin Trifonoff
v2: var u=document.getElementsByClassName('user-gravatar32');for(var i=0;i<u.length;i++){document.getElementById('input').value+='@'+u[i].alt.replace(/ /g,'')+' ';}document.getElementById('sayit-button').click();
 
I'm still not gonna do it...
:-P
 
Anyone who wants to help test it, GO TO THE SANDBOX :D
 
(Better)? would be making a ping bomb, but it would require two people to run.
oh wait, or, just one i guess.
 
1:21 AM
@Paul What's a ping bomb? Sounds interesting.
 
Just repeat every 5 seconds.
 
@Paul

Sandbox

Where you can play with regular chat features (except flagging...
The Ping Room
 
@Paul Rig up something that listens for new posts and responds with that, then every time anyone posts anything everyone will get pinged
(and you will get banned)
 
$('.user-gravatar32').each(function(){$('#input').append('@' + $(this).attr('title') + ' ')});$('#sayit-button').click();
 
@DaveRandom hehe, yes, it would be good if it was subtle. Every time someone mentioned mysql.
 
1:23 AM
I was going to use jQuery, but it threw an error.
 
noobs...
 
user1125394
try to ping everyone in all rooms
 
@webarto Sod off with your gayQuery
@webarto have you got that list of random URLs you were using to test the async poller page?
 
@DaveRandom You mean do I have it? f4c3b00k.com
@DaveRandom I bet your JavaScript is like sex... vanilla.
 
@webarto My Javascript hotter than yo mama. Also my Javascript is considerably longer than yours but it doesn't matter because it's also much better designed :-P
My approach to this whole thing is quite a bit different to your it looks like, but I am happy with where it's going.
 
1:32 AM
That means that it is good.
 
Also, my script may be longer but I'm not shipping a ~200K library, most of which I never use with mine...
 
That excuse is so 2009.
 
(although I may be forcing classical inheritance on JS again)
 
Fatal error: Call to undefined function html_entities() in /home2/pinkfluf/public_html/tec/crossroads/cpanel.php on line 373
$newval = html_entities($_POST['index_largetext']);
Any ideas?
 
Basically, I only use XHR, CSS selectors, and event listeners. All of that can be found here microjs.com
htmlentities for one...
 
1:35 AM
I spelled it correctly?
 
Oh.
I feel silly.
 
It's OK, those functions have inconsistent naming. As entire PHP does.
> html_entity_decode() is the opposite of htmlentities() in that it converts all HTML entities in the string to their applicable characters.
 
@webarto Yeh but you are not carrying any of the history with yours, I'm keeping a complete log of every request for each URL.
 
@DaveRandom Yes, that is correct, although that data exists in instance, I burn it.
 
1:39 AM
Yay. I got my own custom CMS functional now.
 
I should really switch to websockets though, I'm using a slightly nasty chunked stream approach for pushing events at the moment and it kind of sucks
 
You should, it is almost standard nowadays.
 
@ShaquinTrifonoff Why is it stupid to use IIS? lol. SO is based on ASP .NET
 
@webarto You've got some blocking behaviour in there though, it takes a long time before anything happens, have you done stream_set_blocking($sock, FALSE); or not?
 
Something is blocking it on large set of URLs. It seems like some servers keep connection opened, etc. What I made is ridiculous. Things are much more complicated, you need to log everything and cover each case.
@Lusitanian IT WAS TRUE
 
1:46 AM
@webarto but the world can't determine the awesome truth about Node.js without the following video which has only been posted here at least three times
 
And I saw it at least 3 times.
 
I'm sure
 
And I've sent it to company internal mailing list. For everybody to see it.
So, for future employees at Site5, being a Node.js rockstar is not a plus.
 
lol
what do you do there?
 
@webarto I know, I'm going to implement an asynchronous DNS lookup mechanism before anyone gets to see mine, that's my only potential block point.
I'm softcore and I'm going to bed
nighty night
 
1:51 AM
I grew a beard, I'm hardc.. zzZzzzZZz...
 
naming problem: how do you call an interactive surface ?
 
user895378
@tereško Care to elaborate a bit more?
 
user895378
A touch-screen?
 
there is a map with sensors on it ( within website )
i need a name for the layer which contains the sensors
 
2:19 AM
what do the sensors do when interacted with
 
@Lusitanian it changes the map's tile to which they are attached
 
user895378
GeoScroller? GeoLocator? I'm not sure ... that's kind of tough.
 
naah .. i think i will just call it "grid" as per 'sensor grid'
 
magicThing is the other option
 
2:44 AM
@Lus
 
@Lusitanian That video (and the one about ruby "rockstars" hits it on the dot
 
Indeed.
 
I pressed enter by mistake
 
Oh, gotcha.
 
2:46 AM
What do you use for async?
Have you ever worked with Java NIO
 
I haven't -- not really a Java person.
 
3:11 AM
Does anybody in here live in Kansas by any chance?
 
Sid
4:01 AM
I'm trying to send an activation email to the users
	$to = $arrusrselect["email"];
	$subject = "Account Activation";
	$actcode = md5($arrusrselect["email"]) . md5($arrusrselect["id"]);
	$message = "<b>Welcome to asd!</b><br/><br/>\n
You are one step away from gaining full access to all the asd features. Please click the following link to activate your account<br/><br/>\n
<a href=\"http://asd.com/user/activate.php?token=$actcode\">Activate Account</a><br/<br>\n
You can also copy and paste the link to your address bar
If you cannot open the link above, go to asd.com/user/activate.php
But the email doesn't get sent
Any reason why?
 
$headers = "From: $from\r\nContent-Type: text/html\r\nContent-Transfer-Encoding: 7bit\r\n";
Try that ^
@Sid Does it work?
 
Sid
wait
nopes
 
mail server not installed? On my initial trial of sending a mail, I had to install the mail server on LAMP...
 
$result = mail($to,$subject,$message,$headers);
var_dump($result);
@Sid Does that output bool(true) or bool(false)?
 
Sid
4:19 AM
true
 
That means that the message was sent, as far as PHP knows.
 
@Sid than what the problem ..its fine
 
Sid
so what should I do?
I tried several email addresses.
none receives the email
 
@Sid what type of hosting do you have ?
as i know it also depends on hosting that mail take up to 30-1hour
replay quick
 
Sid
unix
 
4:26 AM
i mean shared or dedicated ?
 
Sid
shared
I'm using a web server
 
ohhh ... i got it ... it will take atleast 5 minute
or it may be more than a hour or some hours
have you sent any mail before a hour and checked
i had faced same problem ....i had a godaddy hosting ...mail take too much time to sent
 
On my hosting, they seem to have a queue... it only sends every hour/half hour (I haven't checked)
 
@ShaquinTrifonoff exactly
 
Sid
well
I got sent a an hour before.
Now nothing.
All I did was add some html into the $message
 
4:39 AM
@Sid try php mailer
 
Sid
er
 
also are you faimailer with dkim and spf
i think you need them
DomainKeys Identified Mail (DKIM)
Sender Policy Framework (SPF)
@Sid check them ... if you dont use them your mail will show like
form blabal@bla.com vai babla@secure.com
 
Sid
4:55 AM
well I have to check mails after an hour or two
 
@Sid at-least you can try
 
Sid
Can I ask my host to add DKIM and SPF for me?
 
no you have to do it at your own
its the developer end
 
Sid
okay
i'll wait then
 
also have you got this vai
 
Sid
4:58 AM
just to see the email reaches me
yup
you mean via right?
 
ys exactly
i have to run now
 
5:49 AM
@Paul This is true.
Since return types aren't officially part of the interface, it holds.
 
6:02 AM
Good catch, though.
 
6:18 AM
@All Hi
'm very new to php
i wanna call java function fromfrom php
using the php-java bridge to call
when i tried to call my classes shows the error when using in built API works fine.. what should be te reason for it ,, can any please help me here
any body there?
 
I think you are crazy for even trying.
Bridging languages that don't use the same VM is . . . crazy.
 
6:36 AM
'm i wrong any where ? please let me know
@LeviMorrison
 
I can't help you; I'm sorry.
 
@LeviMorrison
 
6:53 AM
Can someone please test my notification test? Thanks :)
 
@ShaquinTrifonoff works for me :)
 
Whatever that was, it logged me out of all my chatrooms.
 
Look at the source.
Sorry about that...
Look at it now. It should be more obvious what it's doing in the background.
 
. . . should you be allowed to log me out from a different domain?
Seems odd
 
6:59 AM
Click-jacking.
I've made it not transparent, have a look at it again.
@LeviMorrison ...so?
 
 
1 hour later…
8:14 AM
morning
 
@ShaquinTrifonoff ain't click-jacking similar to the thing used by some sites for ads and stuff?
 
@PeeHaa morning ....
 
@ShaquinTrifonoff How the... what the... how'd you do that? how are you able to log me out from another site using that? no fair...
 
8:40 AM
posted on November 14, 2012 by Qafoo - PHP

Today we are happy to announce that Benjamin Eberlei will join the Qafoo family as a consultant and trainer in the beginning of 2013. Benjamin is lead developer of the Doctrine project, part of the Symfony 2 community, well known speaker and trainer. Beside that, he is an expert in software architecture and design, especially in the area of business logic modelling.

 
8:57 AM
@Feeds yay!
 
html_substr(), how would you implement this? (in case it is not self-explanatory, an HTML-tag-friendly substr())
As an example: html_substr('hello <b>world</b>!', 0, 8) would yield "hello <b>wo</b>"
(yes, it should understand the fact that in HTML multiple consecutive spaces/newlines/tabs always result in a single space [with the exception of pre-like formatting, but let's leave this out for now])
 
@Christian DOMDocument is your friend :)
 
@PeeHaa I'm not sure how useful it is in this scenario.
Of course definitely better than regex :D
But the problem is how to go about doing this.
An early idea I've had is to use strip_tags(), use substr() over it and somehow map back the resulting string with the HTML one, performing operations as required.
 
1. Get all nodes and 2. traverse them to find text nodes 3. cut string where needed 4. profit
@Christian No Use DOM
Perhaps with XPath just because I love it :)
 
9:14 AM
@PeeHaa That bloody mess? No way. Last time I tried it, wasted hours just to figure out it was inconsistent with some "special" tag attributes. :(
 
XPATH is my girlfriend. Please don't talk down on her :)
3
 
@PeeHaa But text nodes still need to be parsed, no? I don't want to cut through an &nbsp; or such entities...and there's still the whitespace issue.
@PeeHaa Nice girlfriend you've got there. :D I won't comment anymore ;)
 
@Christian You're Doing It Wrong (tm)
:-P
Monring all
 
morning @DaveRandom
Damn eval.in is also down :(
 
@DaveRandom False! I'm not doing it at all. :D Heheh
Which is why I came asking here ;)
Given that I'll be playing with HTML anyway, DOMDocument is probably the way to go. So how would I fix the entity/whitespace issues?
 
9:28 AM
I'm trying to setup a fiddle but all decent codepads are currently down
 
@PeeHaa Use jsfiddle with jQuery and my jqPHP pluigin :D
 
:D
 
Don't forget to install eval.php on your server though.
Oh, and please do share your fiddle with us :D
Also, I've tested it and it seems to work best with servers that happen to contain credit cards. I wonder why... :)
 
9:41 AM
@Christian strip_tag before substr? otherwise, use DOM.
 
@Gordon We went through this though...the result must contain the original HTML (wherever it makes sense). DOM is the nearest solution, but I still need to figure out the whitespace/htmlentities part.
 
@Christian magic($html, 0, 8)
 
@Gordon What's your point, really?
 
hi
 
@Gordon I don't see this working magically, it is obvious html_substr('h a bc', 0, 5) => "h a b" not "h a "
Or another example: html_substr('a&nbsp;b', 0, 2); => 'a&nbsp;' not 'a&'
 
9:51 AM
morning guys, I'm working on a small site that will sell a type of greeting cards, I'm wondering which framework or cms I should pick up that can easily integrate a shopping cart, also I havent work with frameworks before but I have more than enough time to pick one up. Any advice?
 
I think a simple textnode tokenizer paired with dom approach would work best: while($total_tokens > $target_str_length){ $tokens += $next_token; $total_tokens++; } @PeeHaa, @Gordon thoughts on this?
 
Hello!
Is it possible to use Zend_Db_Select to generate SQL query string without having connection with database? I'm asking because escaping strings sometimes (mysql_real_escape_string) works propertly only when connection is established.
Ah, my mistake. Zend_Db_Select::__construct($adapter) is must have argument that should be instance of Zend_Db_Adapter_Abstract
So it is not possible :(
 
mornin'
 
God damn I left Wireshark open on my computer last night with the switch set up to mirror the server to my machine and it's now using 2.3GB RAM and the dump file is 47GB. Oops.
 
10:07 AM
@DaveRandom I think you should scroll to the middle of the log :)
 
@DaveRandom Say, ever had a spare mini computer and 1tb disk with wireshark installed running at your holiday home in a well populated touristic area for the summer?
 
@hakre Shame on you! No "good mornings"!
 
good mornings ;)
 
posted on November 14, 2012 by Lorenzo Alberton

A little journey exploring job queue models and debunking some programming folklore around the effects of batching on latency.

 
10:20 AM
i have in js file the code like that (top:10px , left:10px) and this works fine in all web browsers execpt IE. how this code will be to work also in IE ? thx
 
10:33 AM
@hakre very good morning ........:)
 
@goodmood If something CSS is not working in IE, it's probably because you didn't include a <!DOCTYPE> and it's running in quirks mode.
(or IE is just being sh*t as always, but it should be able to cope with positioning)
also, make sure you include the relevant position: declaration
 
i declared position
position: relative
@DaveRandom and this doctype i never used it as i saw that w3.org is no meaning :)
 
Add <!DOCTYPE html> to the top of the document then. Although I'd have thought this should still work in IE, are you sure your markup is valid? validator.w3.org
 
ok i will add doctype .
 
10:41 AM
@NullPointer A very fine good morning!
 
is there something special doctype for all ie versions ?
ok i saw this doctype u gave me , is it valide for ie versions ?
 
Well, it depends on the type of document you are creating. When I have to support IE, I always use (and validate as) XHTML 1.0 Transitional
 
why they dont remove IE from using and everything will be ok :(
it depends on the type of document you are creating ?? im using php file (myfile.php)
 
@DaveRandom well , if i use doctype and head and body , should i rename my file from (myfile.php) to (myfile.html) ?
 
@goodmood File extensions are irrelevant as long as you set the correct Content-Type: header. You will notice that SO doesn't have any .html extensions (or even .aspx which you might expect since it is .NET powered)
 
@DaveRandom thx so much for the help im glad now :)
 
l8ers
 
11:08 AM
Quick stupid question:

function test($arg){
    another_test(&$arg);
}

$a = 1;
test($a);
$a == 1 // => true?
 
@Christian Parse error: Syntax error: unexpected $end :-P
But the answer is "yes"
 
@DaveRandom :D
Yeah, I thought it was obvious, but you never know [with php]... :D
 
because test() is working with a copy of $a, and it is that copy that gets passed by reference to another_test()
(unless another_test() modifies global $a/$GLOBALS['a'])
 
@DaveRandom Whoa! Now that's an idea. Didn't think of that.
I'm not using it, but I really forgot about that, so I suppose in theory $a might change
But that's ok, I would just rename $a to something else if that happens.
Worst case scenario: foreach($GLOBALS as $k=>$v)$GLOBALS[$k] = $ha;
 
11:23 AM
@Christian Incidentally, I presume you aren't really doing another_test(&$arg);? Call-time pass by reference is deprecated for about a million years and causes a fatal error in 5.4...
 
@DaveRandom Oh, good point. I meant that as an argument, not variable.
 
(which makes debug_zval_dump() officially completely useless)
 
But that would require I have to write decleration for another_test...the horror of it!
But yes, you're right, I'm doing it the correct way, function signature, call-time not pass by reference.
 
Hi sorry for posting this but I need help on a python/html/mysql problem and I don't see the related chat! can you help me? thank you very much
 

Python

Room rules: sopython.com/chatroom Code formatting guide: tinyu...
 
11:28 AM
thank you!
 
Im testing out this GeoIP thing on Django/Python, Could anyone share their ip addrs and ill report back their city and country to check if its working?
 
@Yohann Probably not. But for the record, IP-based geo-location to anything more specific than a country is a waste of time ;-)
 
@DaveRandom i know i dont need anything more than a country usually, because im trying to get the timezone of the user, so the posts on my site are local time to the user
is there a better way, preferably without asking the user which timezone/country ?
 
@Yohann Also a waste of time ;-) - the time on the internet is always UTC. Also, it's always beer o'clock.
You'll notice that SO displays all times in UTC
 
im litle confused here w3.org/QA/2002/04/valid-dtd-list.html there is many doctype and i dont know which one i must use :( . i have myfile.php which includes some javascript code . anyone can tell me which one i can use ? thx
 
11:34 AM
@Yohann I'll trade my IP address for your full name, address, and date of birth
 
@goodmood Since you need to support IE, I personally recommend XHTML 1.0 transitional. But it's more than just a doctype, you have to make sure that the markup validates under that doctype as well...
 
@Leigh you should have asked me for a credit card number too
@DaveRandom how is utc determined?
 
@Yohann GMT+0
 
thx for recommendation i will try yours :)
 
11:39 AM
@DaveRandom so everything would be a few hours off here or there to all the users?
 
@DaveRandom I beg to differ... the chat seems to display local time... at least it looks like my local time to me...
 
same here
 
but then again that is client side... so... nvm
 
@ShyamK I was referring to the main site, but I should have been more specific I guess. IIRC the times displayed in chat are calculated by the client, the messages from the server don't contain time info.
 
True
{"id":6218045,"time":1352893701}
Not.
 
11:48 AM
I admit I'm a bit rusty on DOMDocument. having <div>text</div> as $node, the text is inside $node->child_nodes[0]->wholeText or $node->wholeText? (my guess is the earlier one). If it is the latter, what happens if there is a <br/> in the middle of text?
 
@Christian wholeText gets the text from siblings as well doesn't it?
 
@ShyamK Hi.
 
@DaveRandom IDK...
 
@DaveRandom I guess ill keep everything in UTC and convert to local on the client side.
 
@webarto Hey, what do I know, I just work here.
 
11:50 AM
@DaveRandom I understood that... a lil late.
 
@DaveRandom wholeText seems to exist in DOMText... DOMElement doesn't have that property.
 
@srinu hi
 
DOMText extends DOMCharacterData extends DOMNode
DOMElement extends DOMNode
wholeText is defined in DOMText
 
@Christian codepad.org/g80WjR5G - siblings as well
@Christian Single text node: codepad.org/Zd3pG7Bm
 
@DaveRandom Odd....it ain't documented. :(
 
11:58 AM
@ShyamK I am working on joomla , how to retrieve row->id from one page to next page in joomla.
do u now telugu?
 
@DaveRandom -_-
 
@srinu I haven't worked with Joomla... and no I don't know Telugu... Sorry
 
@DaveRandom unlink php_manual.chm; wget http://developer.mozilla.org/real_manual.chm
 
@Christian why?
 
12:00 PM
@ShyamK Read the discussion please.
 
@ShyamK Ok no issues.
 
@LoverOfEvening I see where you were going with that username, but somehow it just makes you sound like a guy who hangs out in strip clubs.
 
:-P
 
nop i'm not
:)
and we d'nt have strip clubs here..
 
12:09 PM
@DaveRandom I'm not sure if either of them are bad actually.
 
12:20 PM
is this good way to do validation:
	if(empty($name)){
		$error_name		= true;
	}

	if(empty($message)){
		$error_message	= true;
	}

	if(!in_array($spam, $FORM_SPAM_QUESTION_ANSWER)){
		$error_spam		= true;
	}
 
@DaveRandom True :D
 
i think he just meant to tell everyone that he likes evenings .. and failed
 
@Olli Make $errors array and than push errors to that array, later read from that array and display errors, and of course, stop the process...
 
@webarto ok, thanks
 
12:35 PM
do ajax calls get interrupted if you click a link? like page1 has a looped ajax call and when I click a link on that page... for a brief moment (b4 the other page begins to load) I see the error message that I kept in case of a failed ajax call... any particular reason why?
 
@tereško, failed??? :) i dnt think so... (with environments here)
actyally i a have blog have the same name, and it have good meaning in my local language.. :)
*actually i have a blog have the same name loverofevening.blogspot.com
 
12:53 PM
What language is this?
 
@LoverOfEvening Oh, good. And the one with the straight lines through letters?
 
@webarto, i dnt get you, -straight lines through letters?- , from literal meaning my answer is no
 
yesterday, by DaveRandom
@NullPointer दिवाली की शुभकामनाएं
What sorcery is this?
 

« first day (760 days earlier)      last day (4171 days later) »