« first day (875 days earlier)      last day (4056 days later) » 

8:00 PM
1
Q: Insert an HTML element in a contentEditable element

ElieI have a contentEditable div where I want to insert HTML tags (a simple span element). Is there a cross browser solution that allows me to insert those tags over my div selection or cursor position. If something else is selected on the page (not in the div), I want to append the tag to the end o...

 
@DemCodeLines Your #content-wrap has a width of 100% so there cannot be anything else on the same line
 
@Gordon Yeah, Chrome opens a process for every tab.
That way, if one tab crashed, it only crashes that tab and not the entire browser.
 
@MadaraUchiha since i have only five tabs open atm that would leave 10 processes unexplained but the link above has a good explanation. its also renderers and plugins
 
@MadaraUchiha unless flash crashes and brings down all tabs :P
 
@PeeHaa When flash crashes, it only crashes flash objects.
 
8:04 PM
i like that click to activate feature. very nifty
 
@MadaraUchiha yeh same thing :)
 
@Gordon Also a process for the browser + each plugin + each extension.
 
-1
Q: Extracting href of a link with a specifik class

RoboFormI'm developing a tool to get some ID's from a list of links. A link could look like this: <dd><a href="#1093" class="jylland_midt">Mødeaften, Aarhus</a></dd> I need to extract the href (#1093) of all links with the class "jylland_midt". Does anyone have an idea of how...

and who gave answer? Kolink. SO much for wanting to keep SO tidy
 
Good evenink
 
@DaveRandom eveink
 
8:07 PM
@DaveRandom The thing about UGT was all bullshit then. By the way, evening ;)
 
@Gordon Hmmm. Never thought he was a repwhore. It's so not like him
 
Hey guys, hope you're having a good weekend! So, I have: array(0 => array('from' => 'email@domain.com', 'to' => array('email1@domain.com', 'email2@domain.com'))) etc . . . basically a list of emails with from/to's. I want to find the email from/to combination which occur the most in the dataset (so, the most emails sent from one to the other). How would I go about this?
Evening @DaveRandom
 
@PeeHaa i only know him like that
 
I've already been here twice today. Also I can see that all the people actually talking in here at the moment are in timezones where it's evening.
So, yah-boo, shucks to you :-P
 
This is the internet. Sarcasm is hard ;) @Gordon
 
8:09 PM
@Gordon Thanks
 
@PeeHaa ah :)
lets find a dupe for it
 
yup
 
hi everyone
 
hola @tereško
 
/me is back from the D&D weekend session
 
8:10 PM
Herro @tereško
 
my druid really sucks
 
@Jimbo I would probably look at normalizing the two components (from/to) into a uniform string (off the top of my head, strtolower(trim()) them and concat) and count the number of identical strings by having an array with that string as the keys, and integers as the values. Actually now I say that I don't like that solution, let me think about it.
 
So, is it only me that prefers to answer a question and then vote it for closure?
Would that make me a repwhore?
 
@tereško What is a D&D weekend session?
 
@tereško which world?
 
8:12 PM
@PeeHaa I'm guessing, Dungeons and Dragons
 
Death & Destruction
 
@DaveRandom Hmm, never thought of doing it as strings! I'd feel dirty :P But as long as it works, it's not for production
 
@Alexander Yes. For obvious dupes it gives OP the idea it is fine to not use the search functionality
 
@Gordon forgotten realms , IIRC , custom campaign
 
@tereško ah the good old forgotten realms
 
8:13 PM
If I vote for @Gordon as first, send and third choices, does that give him +3?
 
lol
 
Too late.
 
:D
 
@webarto , you should be ashamed
 
@Jimbo Well you kinda have to use strings, you are comparing strings ;-) A lot of people would probably be tempted to use hashes but I would see that as needless computational expense for this task
 
8:14 PM
i'm belching
 
@PeeHaa Damn it.
 
@Jimbo you cant :)
 
@Gordon FYI:
492
Q: How to parse and process HTML/XML with PHP?

RobertPittHow can one parse HTML/XML and extract information from it? What libraries exist for that purpose? What are their strengths and drawbacks? This is a General Reference question for the php tag

 
@Alexander Oo? What about it?
 
8:17 PM
> Let me start out by saying I do not know php. I am not a back-end programmer, I only ever do front-end.
> PHP website keeps getting hacked
 
@Gordon Better that than closing against a generic answer?
 
Ron
htaccess problem again Sorry again, but since the afternoon (5 hours) I am trying to solve it. I got the following address myweb.com/products and I got directory called products therefore the server redirect me to myweb.com/products/ and lists my files. I could overcome the listing problem by using Options -Indexes but it just give me 403 error. how can I "ignore" directories and make the server treat every url as files and not folders?
 
^ I have no idea what I am doing yet I'll take user info
 
I'm out of CVs
I'll let it be
 
@Alexander that one is the generic answer ;)
 
8:22 PM
@Gordon whatever :)
 
@Alexander but pls cv against it. doesnt hurt to have multiple dupes listed in the end
 
3 mins ago, by Alexander
I'm out of CVs
Otherwise, I'd have done it already
In other news, what's this thing about call for testers for PS4? :O facebook.com/…
 
> do all the idiots who think this is real want to invest in a full proof business opportunity? Just send me your bank account info, and you'll be rich!
hehe
 
@Jimbo I'm fairly happy with the basic idea of a normalized string based on the email pair, it's just the O(n) operation at the end that would be required to find the one(s) with the highest number of matches I don't like, my brain isn't working properly :-(
 
8:26 PM
@PeeHaa LOL
 
@DaveRandom Okay, I'll put everything into strings and see how I can progress from there then
 
/me food.
 
@PeeHaa then how would I make it on the same line?
 
DOn't make it 100% width
 
Make it 100% girth instead
 
8:28 PM
sometimes users are thankfully when you tell them how they can turn on error logging:
Dear hakre, thank you for your time, I can now read my php errors log and I find that there is a PHP Warning: Cannot modify header information - headers already sent. This warning is resolved but the main problem remains. As I said in the post, all the other ajax functions work correctly, only this one related to navigation. — user1276136 2 days ago
 
8:43 PM
@hakre , have you seen "Ghost in the Shell" anime series ?
 
@tereško I doubt
 
well .. my recommendation
 
thx. i'll take a look.
 
@hakre it's one of the classics
 
yeah the one scene I just saw on youtube I somehow remember. But I think I never watched it in full.
 
8:47 PM
manga is weird
 
it's basically in the same group as Neuromancer and Blade Runner
 
I used to work as a fansubber for a few huge subbing groups
lol
 
i subbed 15 minutes of starship troopers 2 for a friend in a subbing group once
heh, music from living room. music from outside. thank $deity I had these earmolds made. silence now
well, except for the tinnitus
2
 
hey guys, would anyone be able to possible explain to me, why when i am sending a ajax request to a server as type PUT or DELETE it is being read on the server as OPTIONS?
 
@Vade What code are you using that gives you that?
 
8:52 PM
well its an api written in php and the request is in javascript
also if you are getting 501 method not implemented (different server) would it be safe to assume that that hosting doesnt allow those methods?
 
@Vade possible yes. safe to assume no.
@Vade are you sure the client send PUT or DELETE. Have you tried to intercept the request?
 
err well what i do know is that the put and delete work fine on my local testing machine, but not on the hosting. (the 501 errors) as for the put and delete, i am not exactly sure how to check
 
@Vade ok. when it works on the testing machine its unlikely that its the client causing problems there
you can limit the allowed HTTP methods in the webserver config
if you have shell access to that machine check there
 
yeah the hosting company, i spoke to them earlier and they said that they would look into it for me, the problem is that it is for a uni assignment due monday morning 10 am. all of the methods work locally, so i guess i will just have to blag it somehow :)
 
it would make sense to change the method to OPTIONS when the other methods are disallowed because that would tell you which are allowed
@Vade cant you just demonstrate it in a Virtual Machine?
 
9:03 PM
i will probs have to, the uni have provided some hosting for us, but it is on an IIS machine towhich i need to sort out the webconfig file but i havent got a clue, spent most of the day trying to make it work. i have it working using htaccess on my apache machines but IIS - no idea
 
yeah i have been trying to learn from the suggest url on there isapirewrite.com but i am afraid i cant seem to make it work, it might be because i am rushing to get this finished (would like to spend a little bit of my weekend with the kids)
 
@Vade VM sounds like the quickest solution then.
 
aye, the brief says that she wants 1 uri with at least 1 verb in an example client, so i have basically done a js ajax with a GET and that works so that will do for that
thanks for the help though @Gordan
 
@Vade you're welcome
 
9:20 PM
quickly @Gordon i am not sure if you are allowed to say, but you wouldnt know of any "cheap" web hosting which allow put and delete methods?
 
@Vade any basic webhosting is cheap nowadays. dont know about their restrictions though. sorry.
 
no worries bud
 
you could try heroku
 
9:36 PM
@0ɟɟouoɟıɹʇuınbɐɥs perhaps you can help?
 
hmm
@DemCodeLines Help with finding a host?
 
Evening
 
@Gordon 30 minutes in, and it's mind-blowing already. thanks for this!
 
@0ɟɟouoɟıɹʇuınbɐɥs jsfiddle.net/TJvsS
 
9:43 PM
If question gets closed due to a cv, then whos names are listed in the explanation?
 
@DemCodeLines What's wrong with it? Are both the elements supposed to be next to each other?
 
@0ɟɟouoɟıɹʇuınbɐɥs
its a sidebar kinda layout
except one div is side bar, second one is a container. in the second one, there is a div inside it which is centered

[sidebar][ [centered div] ]
 
@DemCodeLines ah
 
Except as you can see in that JS Fiddle, the container div is pushed down to second line because its width is 100%; but I need it to fill the rest of the screen and I am not sure what to set its width as
 
@DemCodeLines Use the calc() function
 
9:48 PM
Could anyone explain why after calling setrawcookie, $_COOKIE array is empty? Can it be influenced somehow with custom session handler? Last one is probably stupid.
 
Can't it just be done through css?
 
@DemCodeLines calc() is a CSS function
 
Ahh, never mind, its confusing me and it will complicate everything
 
@0ɟɟouoɟıɹʇuınbɐɥs what's the point of <!-- and --> /
?
 
9:53 PM
@DemCodeLines Whitespace can mess up the layout.
But if the whitespace is commented out, it doesn't, while keeping the indentation
 
unnecessary addition
 
@DemCodeLines What do you mean?
 
<-- and <!-- is unneccessary addition. Its just adding stuff for a minor reason
 
@DemCodeLines If it's not added, the content goes underneath the sidebar, so I would say it is a necessary addition.
 
well of course it is, i mean its pointless to allow it to happen in the first place.
 
10:11 PM
@0ɟɟouoɟıɹʇuınbɐɥs just sat idling and have learnt something new, thanks!
 
10:30 PM
my little constellation of scraper
 
@0ɟɟouoɟıɹʇuınbɐɥs for some reason it isn't working as it should
do I need to do something different for chrome?
 
@DemCodeLines Define "isn't working"
 
interesting place.
i have never been here before! :D
 
Welcome @PålTønder :)
 
thanks.
 
10:38 PM
@PålTønder Your nickname hurt my eyes
 
i will change it.
if possible
 
Neh keep it
 
@PålTønder Nah, I'm kidding, you can keep it :D
 
@MadaraUchiha image link #fail
 
10:40 PM
@PeeHaa Why so? I see it fine
 
Also more likely that is about revenge votes :)
@MadaraUchiha refresh the page
 
@PeeHaa Still fine
 
hmmmm. In that case imgur blocked me ;(
 
Cleared cache, hard reload, still fine
So yeah, problem on your end :D
 
:P
 
10:48 PM
i want to split this text into two lines...how to do that
$cell[6][0] = 'Average annual farmer income increase due to Olam intervention (factoring out price changes): (in US$)';
 
into two lines?
based on what?
 
while printing...it is moving to the other cell in the table
i want to make this text to sit in one cell in the table
 
then you should style it using css instead of splitting it using php
 
@MadaraUchiha I confirm that @PeeHaa is the problem
 
10:58 PM
is it possible to create your own rooms in stackoverflow chat?
i know, its not php related.
 
Anyone know what timezone github is based on?
 
now it works. But it didn't work in the first place.
 
Also, does my look odd to everyone?
 
@DaveRandom GIT +1 I think
 
lol
 
10:59 PM
@DaveRandom this is a troll right?
 
No, seriously, I have no borders on my tags, but everyone elses are displaying right
 
It has to do with the plugin
 
I haven't done anything, and I couldn't do anything anyway, it's presumably a CSS thing
 
Check the dom
 
11:01 PM
Yeh but it was working and now it's not, I haven't changed the plugin for a while, certainly not in any way I can think of that would do this
 
Also, does my look odd to everyone?
 
Mine doesn't have plugin shit, but yours does @DaveRandom
 
In the DOM the styleattribute is missing.
 
Oh yeh
So it is
 
The name is there but the value is gone
 
11:02 PM
Hang on I'm going to restart chrome
What the hell man
 
lol
I think it likes you.
 
nopez. not the plugin. I've just disabled the thing
I think your special
 
damnit!
I would ask on meta but they'd probably think I was trolling
 
@Shog9 Can you come look at this?
 
Oooh, bringing out the big guns
 
11:09 PM
do it @DaveRandom before you know you have to live with it for the rest of your life
 
@PeeHaa :D :D :D
@DaveRandom My approach is that the best way to deal with problems is to nuke them.
 
Quick @Shog9 it's super urgent!!
:)
 
hmm I somehow managed to write code that PHPstorm consumes more and more memory.
 
yay
 
11:11 PM
That is bizarre
 
so does this mean we can inject XSS stuff into chat?
 
Very, it's your computer he likes, not you. You aren't special.
 
Seems really odd that should be affected by the client side, because
 
@hakre Kinda looks that way
 
11:12 PM
^^ what @hakre said
 
@DaveRandom put some dangerous characters in there to test
 
well, I'd say it's worth reporting.
 
I mean webmasters love it when they get potential security risks reported on saturday ;)
 
That's evil ^
 
11:13 PM
hehe :P
 
Seriously though, change the favicon or the title, it's horribly confusing
 
@DaveRandom the one is different o.O
 
I was thinking about using the cv icon the other day
 
@Alexander That's kind of the point :P
 
Didn't had time to put it up yet
 
11:14 PM
mirror it vertically ;)
 
@hakre I like that
 
@PeeHaa it's easy and visually enough to not get tricked.
 
11:15 PM
 
wtf
 
@DaveRandom Can you put a " in a tag to test
 
[tag:tag-with-"-char]
 
:(
 
yeh that doesn't render, and I wouldn't expect it to
 
11:17 PM
if ($nick == 'DaveRandom') { echo 'Mindfuck'; }
 
I may actually have to go to meta
 
Ow wait btw:
If Nick = 'DaveRandom' Then
    Response.Write("Mindfuck")
End If
 
hello, need some advice, i made a function, they are working as i expected(and fine) but i feel something wrong with them, please warn me if there is a better aproach, here are my codes:
function createTree($elem,$depth = 0)
{
    echo str_repeat("-", $depth);
    echo $elem->tagName."<br/>";

    if($elem->hasChildNodes())
    {
        $depth++;
        foreach($elem->childNodes as $child)
        {
            if($child instanceof DOMElement)
            {
                createTree($child,$depth);

            }

        }
    }

}
 
You meant advice me
 
11:19 PM
outputs what i want:
 html
-body
--p
---strike
----em
-----strong
---em
----strong
--p
--p
---a
--p
---img
but i'm not sure are there any better way.
@Alexander yes.
output should be same.
 
@hakre are you here?
 
user895378
All righty, time for the mid-weekend hangover recovery coding binge!
 
@shnisaka huhu!
 
@hakre what is a good hashing code that I can use instead of the MD5()
 
user895378
11:22 PM
A few years ago that used to be known as the "mid-weekend prepare to get hammered again in a few hours coding binge," but now I'm old.
 
and you will likely not have PHP 5(.5), there is a PHP userland variant of it:
 
exactly that one ^^^
 
I do have PHP5
 
@hakre meant 5.5 :)
 
11:22 PM
@shnisaka Yes I meant 5.5
 
My website is still running on mysql_query.. I am trying to fix it to PDO then update to 5.5
 
@shnisaka 5.5 isn't released yet :)
 
@draconis If you're just interested in some different code, here is some:
14
A: Debug a DOMDocument Object in PHP

hakreThis answer is a little late probably, but I liked your question! PHP has nothing build-in directly to solve your problem, so there is not XML dump or something. However, PHP has the RecursiveTreeIterator­Docs that comes pretty close to your output: \-<html> \-<body> \-&l...

 
And it will sadly probably take some months before it is
 
why is position:fixed conflicting with display:inline-block?
 
11:25 PM
Define conflicting
 
@hakre thanks.
 
@hakre and @PeeHaa Thanks.
 
np
 
@PeeHaa ^
The second one has position:fixed, but messes it up
it should look like the first one
 
13
Q: My chat tags are borderless

Kyle TraubermanWhen I post a tag into chat, borders on my tags are missing, but other's tags have them: also: inspecting the page source, the style attribute for my tags are missing: normal tag <span class="ob-post-tag" style="background-color: #E0EAF1; color: #3E6D8E; border-color: #3E6D8E; border-s...

(I have no clue)
 
11:27 PM
Hack the planet @DaveRandom!
 
that is secret sauce.
 
@PeeHaa ?
 
@DaveRandom Well, unless balpha wants to jump in (you can ping him if you want :D), that's the most definitive answer you're going to get
 
I have been considering asking balpha for some stuff relating to chat recently, I doubt it would go down well though
 
@DemCodeLines because it is display:inline-block; the element is displayed where it is making all the objects after it (in the same line) move to the right
 
11:29 PM
@DaveRandom Try from a different browser (on the same computer)
 
@hakre Can I edit a typo there? :)
 
@Shog9 Thanks, nice to see I'm not the first experience it, but odd that it seems to be a self-resolving issue with no reasonable explanation.
 
position:fixed; it moves with the page when you scroll up and down.. it is not an inline element anymore.
 
@Alexander yes please do. I'm not so good in writing English.
 
@shnisaka so how should i go about fixing this?
 
11:31 PM
@hakre It was just a small typo though, not redaction: stackoverflow.com/posts/8631974/revisions
 
I've just been inspecting everything to do with this and there's just no good reason for it that I can see, it does seem to indicate an XSS vulnerability at first glance because it appears that a specific machine is able to affect it, but when I look at the raw postbacks it's just sending markdown, so it must be something server side, but something specific to a client
 
@Alexander Thanks you.
 
i need to preserve the layout while keeping it fixed to the left
 
> so it must be something server side, but something specific to a client
English!!! Do you speak it? @DaveRandom
Just throw out your machine
It's clearly broken
 
When there is server there is client side.
 
11:33 PM
I know that's a total oxymoron, but it is kinda true
 
@DemCodeLines use the element twice. one with display:inline-block; and the other time is with position:fixed; you can also edit the position by using left:30px or whatever
 
@PeeHaa $machine = new Exception; throw $machine;
 
Hang on I'm just waiting for FF to start
 
:)\
@DaveRandom Yeah. That thing loves to keep you waiting
2
 
Go back in the chatlog and find the first instance of it :)
 
11:34 PM
heya @cv-pls :)
 
@PeeHaa Damn true
 
lolwut
 
W. T. F.
 
11:34 PM
It even persist between browsers
 
lol
hehe
 
That's something I haven't seen in a long while
 
...and accounts
 
You are doomed
 
It must be your computer. I hope you still have the receipt
 
11:35 PM
They have rate-limited your CSS borders :)
 
Hang on, I'm gonna ping via a VPN, I'm thinking it must be IP address? That's my last idea
 
Persistent even after a browser restart.
Persistent between different browsers on the same computer. (wtf)
Persistent between different users on the same computer.
 
@shnisaka im not sure what you mean by use it twice. if you mean copy and paste <div id="sidebar"></div> so it becomes <div id="sidebar"></div><div id="sidebar"></div> then it doesn't work.
 
An IP issue is the only thing I can think of
You've dropped on the same IP as that guy
 
11:37 PM
hehehehe
 
Right, uber fail
 
this is getting really interesting
 
This would mean XSS as I see it somehow
 
I mean how could the IP affect the markdown rendering
 
INSPECT ALL THE SOCKETSTREAM!
 
11:39 PM
@hakre I'm not sure, but if I were @DaveRandom I'd start looking for admin stuff.
 
hehe
no no xss btw
@DaveRandom can you link a question?
 
right now only the value of a style attribute is missing, admin seems far, far away ;)
 
0
Q: stop IF statment from excuting in php when erorr occurs

shnisakathis is a simple demonistration of how my code looks like : if($allthevaluesarenotempty) { if($pictureexist){ // upload picture code } else { $message = "erorr"; } //sql query here } My goal is that whenever $message occurs I want to stop the next code (sql query) from executing how can I achi...

 
OMG your titles are orange as well :D
 
Empty style attribute again
 
11:40 PM
@DaveRandom can you now go to stackoverflow.com/admin ;)
 
404 :-(
 
:(
 
Thing is, it doesn't seem to be anything to do with the client side, I did two identical posts from the machine where it works and doesn't and they are identical apart from auth tokens
 
Strange things are happening I tellz ya
 
@shnisaka ?
 
11:45 PM
@DaveRandom Probably the region you are being mapped against?
 
@PeeHaa perhaps you can help me solve the problem that @shnisaka was trying to solve?
 
Have you tried setting the width to 100%?
 
@Alexander I dunno. I'm just going to ignore it for now, doesn't actually cause any real problems
 
@PeeHaa atleast look at the jsfiddle before mocking me
 
Who am I mocking?
Yeah you already told me so
And no it is not messing things up
 
11:50 PM
so how should I fix the layout
 
I already told you how
 
O mighty @balpha, I summon thee to help this poor soul!
And now, I'm off to bed, good luck :D
 
Setting an element to position fixed moves it out of the normal flow of the document
2 messages moved to bin
 
@MadaraUchiha If we're summoning @balpha, I want him to bring an unminified version of the main chat JS with him... :-P
 
@PeeHaa by making it width:100% ?
 
11:52 PM
@DaveRandom I wish JS beautifier also had the ability to name things properly
:P
 
@DaveRandom Why are you telling me that? Tell it to him when h arrives
I wish I had my superping power in so chat :D
 
@PeeHaa Yeh I know lol, I've reverse engineered a few elements of it but there are some bits that are just too impenetrable without real names
 
@PeeHaa ?
 

« first day (875 days earlier)      last day (4056 days later) »