« first day (660 days earlier)      last day (4288 days later) » 

@hakre I am having one of those "It works but I don't know why" situations. Or rather, I can see why it works, but I'm not sure that it'll always work
 
@NikiC You are not developing test-driven. That normally helps to round some sharp edges.
 
@hakre I am developing test driven :P
 
@hakre Sharp edges created when you are getting shot by a silver bullet?
 
That's why I'm wondering why my tests passed even though I did an implementation mistake ^^
@hakre Or rather no, I'm not really developing test driven, but I do have unit tests ^^
 
11:11 AM
@NikiC okay, you might want to test around boundary values, have you?
And if boundary values are already tested, do some massive fuzzing testcase ;)
 
@hakre Is preg_replace guaranteed to replace the first matchable occurance of a string?
 
Hi everyone
Hope everyone is fine
 
@NikiC You mean ORed patterns in a group? AFAIK, yes.
When I need largest match, I need to implement that.
 
Guys i have a problem
 
I.e. if I have multiple alternations ( ... | ... | ... ) will it always match the one which can be found from the current ofset
 
11:14 AM
@NikiC Yes first match is taken AFAIK.
 
i need to send the xml using a html form to asp page.Anyone knows how to do this??
 
@FawwadShafi > Discussion for all things PHP - Don't ask whether someone is here or can help. Just tell us your problem. If anybody can and wants to help, they will.
 
This is a largest match wins (which might not be what you need): github.com/hakre/XDOM/blob/master/src/XDOM/Tokenizer.php#L207
10 hours ago, by tereško
THIS IS PHP CHAT ROOM
 
@hakre I guess he wants to build the form using PHP.
 
11:17 AM
0
Q: XML response from asp page

user994144I have been trying to send xml message from php to asp and output response to my php page using CURL but having no luck in receiving any response. This is what I have tried: <?php $url = "https://someweb.asp"; $post_string = "xmlmessage=<?xml version='1.0' encoding='UTF-8'?> <abc>...

This should be the one you are looking for
 
@Whisperity fair point.
 
How would you call a class that has multiple methods for creating various different (but related) classes?
can one call it a factory?
Also the class which is created does not depend on arguments, but on which of the methods you call. So I'm not sure whether it's a factory
 
@NikiC I call it a factory, however I cannot be trusted with these things :)
@NikiC service locator?
 
nah
 
WHY U NO LIKE regisrties? ;)
damn my typing once agani sucks
lol
 
11:31 AM
My concrete case is that I have various different lexer implementations (six as of now) and they all have different creation processes.
I could obviously have six different factories for them, but ...
 
I don't know whether it makes sense to have "factory" with different methods for different initializations
 
@PeeHaa exactly ^^
That's why I'm looking for another term
heh, probably I'll just have to use six different factories
 
@NikiC I think that would be the best option
 
@PeeHaa but it kindof sucks
Actually, when I think of it: It sucks in PHP
 
11:45 AM
0
A: merge two arrays, merge-sort style

webarto$count = count($a1); for ($i = 0; $i < $count; $i++) { $newArray[] = $a1[$i]; $newArray[] = $b1[$i]; } My work here is done.

 
Because PHP has that "every class is a file" convention
If once could just stick all factories in one file I'd consider it less ugly
 
@NikiC PSR-0 has every class is a file
 
@PeeHaa Nearly everything has class->file mapping. Do you break it?
 
"Do you break it?" nope
 
Would you break it?
 
11:46 AM
nope
 
see
 
whats the differnece between calling a class function like so class->function() and class::function() ?
 
@grasshopper there is only one way: the first one
 
@grasshopper Read up on OOP. This is basics.
 
Greetings
 
11:48 AM
when he called config::read
 
@grasshopper Static and non-static methods?
How I can store data in local snmpd?
 
@grasshopper Suggesting bad practices is what he did there
 
ok, back to books
 
@NikiC That is a class with many different factory methods. So it is a ConcreteFactoryMethodsHost gg.
But Host is a smell.
@NikiC Make each creator one class. So you can exchange the creation as a strategy or provide all of those via some other interface and a parameter of their name.
 
11:52 AM
@hakre I will do that. But I hate it to create so many small files
 
@NikiC Okay, I can see the point. Then skip that for the moment and refactor later. But if it gets in your way, refactor early.
 
@hakre It is getting in the way
:P
 
@NikiC then refactor. Make each Creator implementing an interface and go ahead ;)
Your code will encapsulate the details away then you do not care any longer about how many files that are ;)
 
@hakre I do care about the files :P
 
It technically can be a single file, too. You just inject some parameter somewhere.
It's just that the rest of your application won't notice the difference.
But if you share some github link I might take a concrete look and have some other idea.
 
11:56 AM
@PeeHaa why do you consider that code bad practice?
 
Btw, vote on finally opened: wiki.php.net/rfc/finally
I voted against for now, so that there are more "no" votes. Will probably remove it later
@hakre Isn't on gh yet
 
@NikiC I lost track of the discussion on it. Is the finally block guaranteed to be executed?
 
@Leigh no
@hakre If my different factories accept parameters of different form, is that bad? It is, right?
 
@Leigh And I still think that its largest use case is "I don't know about automatic resource disposal"
 
12:01 PM
@NikiC I guess I don't get to vote anyway
 
@NikiC You have different creators. Give them the same interface to hide away the differences.
Then these different parameters magically disappear.
Only for the part of the application that needs to deal with the differences, these should be accessible.
 
@NikiC Resource disposal is at the termination of scope right? Not termination of script? (so when a function call ends, handles are closed)
 
@hakre Yeah, I know, I can make most of the differences disappear, but there still are two fundamental formats (namely stateless lexers have a different lexer definition than stateful lexers)
 
@NikiC I assume you mean stateless and stateful.
But I can understand your problem, it is hard to combine those into one Lexer Facade.
Because Lexer and Parser need to work together here.
 
@hakre That might well be
 
12:05 PM
You know the compiler example in the GoF book?
 
@hakre Nah, parser is of no issue there. State is handled inside the lexer
 
is there a site where I can view a complete oop php project like scripts for a whole site, to learn how everything comes together
 
Maybe it helps, it's for the Facade pattern. It's working with subsystems.
 
@hakre nope
didn't read GoF
i generally didn't read any of the programming books :/
 
@NikiC Most people had way more time to read them than you did :)
 
12:08 PM
What number of permission is: drwxr-xr-x?
 
755
 
@Leigh How? :D
 
@DanielsPitkevičs r=4, w= 2, x = 1
 
@Leigh Yes? And what next? I read about some kind of binary conversion, but didn't get actually how get the correct result.
Oh, I suppose I get it
But what does d letter means?
 
@DanielsPitkevičs directory...
 
12:10 PM
@Leigh Thank You
 
Hmm call me captain obvious but didn't he ask for a better way than that? — Sammaye 23 mins ago
 
@NikiC this is one example (page 186, 35th edition)
 
@hakre Which book it is?
 
GoF Design Patterns
 
@Leigh I wanted to get 200 rep today, to get to 7000, I now see it is impossible because of idiots :D (I don't have the nerves)
 
12:18 PM
what do you get at 7000?
 
I get to the point where I need 3 more to 10k :P
 
@Leigh Nothing. 5k, 10k, 15k and 20k.
 
@Whisperity Ah, long distant memories... *^_^*
 
Again, need to ask - anyone known with Cacti system?
 
So whats the rush? I did a rep push to get to 3k (close votes), and now my highest voted answer is average and I'm dissapointed it beat all my good answers.
 
@deceze :jealous:
 
@Leigh you are on your way to Unsung Hero (Zero score accepted answers: more than 10 and 25% of total.) badge :P I got to 5k fast, then stopped...
 
I'll never get more than 25% of total 0 score accepted
I'd never write an answer so bad so frequently for that to happen :p
 
Only gold badge I have :D No, it's not about that, it means you answered correctly, but haven't got attention. You can see that some jQuery RTFM answers have more than 200+...
 
12:24 PM
@webarto Still, I'd have to go and delete all my other answers to bring the total down enough to get it :)
 
why you give me a negative rating , this is a suck ? — Saqib 49 mins ago
 
hahaha
@Leigh good for you :P
 
@deceze aaand closed.
 
@deceze What kind of sentence is this is a suck? ?!
 
@Leigh That is a suck for him.
 
12:26 PM
you, sir, are a suck
 
And someone else topped it off with a dv to bring him back to 1 rep, lol
 
The amount of Indians on Stack Overflow is not rationally in parallel with the amount of developers otherwise, and I have taken India's 1200 million population into account.
@Leigh We'll soon experience another please delete me user or someone asking that What does restricted from asking questions mean?.
 
hm... I think I'll need a FactoryFactory
 
@Whisperity The problem is outsourcing agencies, and this is not just speculation. Agencies have pools of developers with maybe one specialisation each. If they get a tender for a job nobody can do, they will still bid for it, and assign unqualified developers.
 
@NikiC yo dawg, I heard you like Factories, so we put a Factory, in your Factory
 
12:29 PM
@NikiC But who'll build the FactoryFactoryFactory? Outsource it to India?
@webarto ...so you can factor while you Factory...? O_o
 
And then when you have to refactor the factoryfactory, what factors do you take into consideration?
 
@deceze Noo... you can build while you build. Like 3d printing 3d printers. * RECURSION *
 
:mindblown:
 
@Whisperity But then... who printed the first 3D printer?! O_o
 
mornin'
 
12:31 PM
@deceze John Smith, CEO and Employee of the Year of Whatthefacktory Inc.
 
@Whisperity Haha, I like.
 
Curiousity kills the cat. looks at username... Hehe.
 
@Whisperity Touché!
 
@SomeKittens Yes, yes we know.
 
12:33 PM
2
Q: What happens internally if I overwrite the original variable with a reference?

RoboTamerWhat happens internally if I overwrite the original variable with a reference? Meaning is this bad, does it cost extra time or resources? <?php function db(){ global $db; if( empty($db)) $db = new PDO('sqlite:/tmp/default.db3'); return &$db; } $db = db(); ?>

^ Wrong on so many levels...
 
@NikiC Well, I'm freaking excited (all username-based puns aside)
 
nasa.gov/images/content/673381main_mccuistion-43_full.jpg <-- fullsize image... go nasa, breakthrough in high res imagary
2
 
@leigh Wow I can almost see the pixels!
 
4432
A: RegEx match open tags except XHTML self-contained tags

bobinceYou can't parse [X]HTML with regex. Because HTML can't be parsed by regex. Regex is not a tool that can be used to correctly parse HTML. As I have answered in HTML-and-regex questions here so many times before, the use of regex will not allow you to consume HTML. Regular expressions are a tool th...

 
@Whisperity Yes, almost applies...
 
12:35 PM
@Leigh wait, we're sending pictures from ANOTHER PLANET and you're complaining that they aren't big enough?
(we'll get high-rez and color later this week)
 
Actually I just read the text, apparently it's supposed to be that big
it sends back 64x64 thumbnails
 
@deceze Basically the cataclysm pattern described in the answer. World implosion and massive mental disorder.
 
Hi-rez wallpaper or it didn't happen.
 
Ah 64x64, makes sense really.
 
@Whisperity Yo dawg, I heard you like references, so... ah what the hell
 
12:37 PM
@Leigh What's up with all the w h i t e s p a c e s ?
 
@Whisperity TONY THE PONY!
 
We've been talking about outsourcing, and then this happens:
"I have seen [outsourced] spec + implementation time exceed the 'do it in your own office' by a factor of 4." http://answers.onstartups.com/q/41083/4254?stw=2
 
@Whisperity I've seen outsourced projects fail due to terrible project management, while in-house devs play "who can spin on their chair the most before they throw up"
 
or constant back-and-forth and the outsourced guys try and do the minimal amount of work while talented coders waste time trying to get the outsourcers to do work
 
Hi
 
12:45 PM
I recently spoke to some guys who still work at the last company I worked for. 3 years after a project was started, it was thrown out. The problems are all down to the outsource company.
 
I am setting up a pretty basic database with questions, categories, answers etc
I am unsure whether I should name the table for categories just "categories" or "question_categories"?
Anybody who can help me out?
 
A typical naming convention would require you to have questions, categories, answers.. then join tables named after both in alphabetical order. So categories_questions
The specific convention used isn't all that important.. but sticking to one is
 
@Dude Does the categories table just contain categories, or does it link them to the questions?
 
just categories
I am not thinking of the join table now
 
then call it categories
 
12:49 PM
what do I do if different things may have categories in the future? Not only questions as it is now
 
create another table, that links question.id to category.id, or whatever.id to category.id
 
i.e. categories_questions
 
Yes, I understand that....but I mean what do you call the other Categories table if there is one
let say you have Question and Category as the models now
 
or maybe categories_entities with a type column that specifies the entity (question, answer)
 
in the future you might get Book and Category
 
12:51 PM
@MikeB isn't that a step towards EAV?
 
now you have used the categories table name for the question entity...do you understand?
 
eav?
 
@MikeB entity attribute value tables, they are the eval of db schemas
 
The problem is @Leigh that everyone wants the biggest profit with investing the lowest possible (zero?) amount.
 
@Whisperity Absolutely, but in most cases, as long as you shop around, you get what you pay for.
 
12:53 PM
@grasshopper It uses static all over the place
 
And in most cases, it's worth paying a little extra for support in real English, without having a 2 week turnaround on your tickets :)
 
Never heard of it called that.. but it's basically a tag cloud
Why is it the eval of db schemas?
 
@hakre That reminds me. Can I have a link to the superglobal $tatic image too add to a comment :)
 
Shoot me in the head...
F*ing cacti
 
12:55 PM
what's the good word?
 
@MikeB what you suggested wasn't EAV, but as the name suggests, its usually a table that identifies an entitiy, then an attribute of that entity, and then the value of it. Usually they're badly indexed and end up with serialised data in the value, because they lack proper schema.
@ircmaxell usageaster is a good word.
 
@hakre 14:55 - someone: what is SUPER::$TATIC anyway?
@webarto I just wanted to know the language/framework + on question =
 
 
12:59 PM
@hakre Gracias
 
or the big one?
 
@Whisperity yeah, adapt an language to be an app :D
 
@Whisperity Super::$tatic is the silver bullet you need to shoot some value across all scopes. It makes global looking like kindergarten because $GLOBAL['is'] = 'lame';
 
@webarto I just started to write a kind answer on the question.
 
what is meant by Client-side Canvas-based Identicons with Fallback to Server-Side
what does that fallback to server side mean?
 
1:02 PM
but runkit is not active :/
 
@Leigh Ah gotcha.. never knew that had a name. Thanks :)
 
@hakre That is just enough to answer the difference between PSE and SO.
 
*"client-side with server-side fallback"* → if it don't work on client-side, it will fall back to the server side, which will do the job instead
[tag:hope-that-helps]
^ I borked Markdown rendering?
 
@deceze EOL in text? apparently it does
 
@deceze Please tell us the magic exploit you make use of, please ;)
 
Yesssssss.....
 
some wicked UTF-8 char :D
 
*"xxx-yyyy"* → xxx
[tag:hope-that-helps]
woot?
 
[tag:hope-that-helps]
noobs
 
line break that is
 
1:10 PM
vbCrLf
 
But it works without break, too: [tag:hope-that-helps]
 
But it works without break, too: [tag:hope-that-helps]
 
@webarto Yay ♥ . Is it VB6?
 
my most popular vb6 based app: subfiles.net/webcow
 
On Error Resume Next :D @Whisperity
 
1:14 PM
can identicons be generated with php. i mean i dwlded a javascript one. but it dont know how its working
 
@webarto That was one silver bullet too.
 
resume next. what a great way of temporary subroutines.
 
@hakre I remember in there were Public Function and Public Sub and else. It was quite a few years ago...
 
I maybe should just put the webcow sources on github.
 
1:17 PM
With pseudo-object orientation I even build this filter-cow-pad and wrote an XML parser so save the configuration to XML: subfiles.net/webcow/docs/filter.filtercowpad.html
 
@hakre I only have executables of an old thingy I made. No source codes or whatsoever. Might try a decompiler later on.
 
I also have a colorpicker that initially worked on win 3.1 which is where I started with webdesign.
maybe later today gg Let's create a vb6-nostalgica org on github.
 
@hakre Cool. I've written a armagetron admin control panel once in vb6. Damn those were the times :P
 
It is sad that chat applications with Websocket are considered cool in 2012...
 
@webarto yeah IRC is so lame.
something not running in a browser: lame.
something running inside java in a browser: even more lame.
labeling html5 whatever comes first: priceless
 
1:32 PM
@hakre I (partially) wrote IRC client in VB6 10 years ago (I was like 12), and seeing WebSocket is the same thing as Winsock in VB6... 10 years after... makes me sad :)
 
and I needed to leave an answer as a comment, please do not downvote it urgs
@webarto Ah great, I have done something similar. It never went stable in the end.
 
Hi all
 
@hakre I was never able to get VB6's database connection thingy (ADODB element?) to work properly.
 
@Whisperity Adodb. Yeah. ActiveX database objects or something. Worked like a charm. You could even connect to MySQL later on.
@webarto: You could actually motivate the OP to "accept the answer if it helped" ^^
LOL
 
I used MySQL for RAT, about 100 computers, only thing that was PITA is that you have to pack all of the dependencies etc.
@hakre :D
Of course PHP can do that, there is no limit in that ( unless you loose eletricity ). - Start timestamp - Make a loop ( or whatever you want ) work while new timestamp >= old_timestamp + 30 minutes. That's it. Just make sure your time_limit for php scripts is greater then 30minutes ( let's say 35 ). — Dainis Abols 2 mins ago
dafuq
 
1:43 PM
loosing electricity. I need to remember that one :)
Super::$tatic works even when you loose electricity.
3
 
@hakre What about tight electricity?
 
what is tight electricity?
very strong electrical power?
 
@Whisperity You should never tightly couple electricity to your classes
 
@PeeHaa But you can with Super::$tatic.
That is only one of the many reasons why it is the silver bullet solution in PHP programming.
 
@hakre In that case it is okay
 
1:45 PM
@hakre The biggest possible current throughtput on a line with very small diameter, of course with super::$tatic float constant Resistance = 0;.
 
someone should write that there are CLI virus scanners, because I haven't seen one time "AV in PHP"...
 
@Whisperity Resistance is a term that does not exists for silver bullets actually.
@webarto no, I do not think that this information is missing there ;)
 
@hakre Resistance exists on the power cord we are transmitting tight electricity. To prevent heat and maximize performance, we need to super::$tatic it to zero.
 
as a side effect it will zero all bugs.
 
scumbag Vimeo, doesn't allow HD embed...
 
1:46 PM
it is just so great. it does all these wonderful things.
 
0
Q: how to extract text using preg_match()?

brilI have following text stored in a variable $new <div class="img"> <span style="float:left; color:#666;">1.&nbsp;&nbsp;</span> <a href="/Books/info/J-R-R-Tolkien/The-Lord-of-the-Rings/0618640150.html?utm_term=lord+of+the+ring_1_1"> <img src="http://cdn-img-b-ta...

 
Oh boy again. By the way, what does s/(?<!SHOOTING YOURSELF IN THE )FOOT/HEAD/g do? I know it's and string replace but my regex capabilites are crippled.
 
@Whisperity Learn them.
I mean, seriously. Regex is awesome
 
stackoverflow.com/users/408773/periklis counting until this guy changes his statement :D
 
@webarto :-P
 
1:53 PM
@NikiC I know it is. I just don't know what input it wants and what it will change.
 
@NikiC SRLY, you can even summon Cthulu using them.
 
stackoverflow.com/questions/5527191/… when @ridgerunner said it was easy, I was like #fml if this was easy ...
 
@Whisperity BTW, I suspect there's a typo in that regex. Shouldn't that be s/(?<=SHOOTING YOURSELF IN THE )FOOT/HEAD/g?
 
@MikeB landed :)
 
1:56 PM
@hakre Indeed! I was bouncing off walls last night.. very tired this morning :)
 

« first day (660 days earlier)      last day (4288 days later) »