« first day (865 days earlier)      last day (4080 days later) » 

12:07 AM
@webarto tanks! thanks!
 
12:21 AM
Last night's Castle was awesome!
There, I said it.
Right, under the instruction of the bot I'm going to bed. Night @all
 
12:43 AM
Anyone around who happens to know php's pcre regexes well?
My question is: is there any way to capture any the subresults when using recursive subpatterns?
Let me illustrate with an example
 
Anonymous
@DaveRandom sleep(10000);
 
say we have this regex: /(P?<braces>\([^()]*(?P>braces)[^()]*\))/
It matches nested sets of braces with basically anything in them, but only if the braces are evenly matched and correctly nested
now assume we have some data to use it on: (a1(b1(c1(d)c2)b2)a2)
Now what I want to do is to loop through the extra's in the layers and get them all matched somehow
so that, would be first a1 and a2, then b1 and b2, next c1 and c2 and finally d
Is there any way to do this without having to rerun the regex on the pattern matches (as if I do simply keep running the regex, I would have the regex engine do the same work more than once - and actually in a fashion that increases the complexity of the entire algorithm)
Oh, and here's the fixed regex: /(P?<braces>\([^()]*(?P>braces)?[^()]*\))/ (just an extra question mark to make the base case possible, the previous regex would only match infinite recursion...)
 
user895378
1:05 AM
^ Why? Why would you want to parse a (non-regular) markup language with regex instead of DOM?
 
@rdlowrey Not html (or another mark-up language) but in fact a programming language.
I know this is almost as bad, except the problem of malformed html doesn't play up. Without that problem, you get hard to write regexes, but that's about your biggest problem.
 
you still should write a parser
it'll be way easier then futzing about with impossible to read regexes
 
user895378
@Jasper lol I'm a dummy. I saw <braces> and didn't even notice the named capture groups. Sorry for my knee-jerk :)
 
user895378
/me slowly backs away
 
user895378
Me too, actually. I tend to write my own parser in almost all situations.
 
1:12 AM
And in fact, I have the regexes written already, so that's not the issue. The issue is that I am now deciding whether use these regexes again or write a more traditionally parser/lexer combination (though I imagine it would be more work, considering it should be in php and I have the regexes already)
 
@rdlowrey just tends to seem more maintainable and you can extend it more easily than you can regular expressions
@Jasper parser/lexer. it'll be more work initially but you'll save time down the road that would otherwise be spent deciphering regexes
 
user895378
For me it usually depends on how complex the grammar is and how important performance under load will be.
 
user895378
For example, if you hammer a stream of raw HTTP protocol input with regexes you're going to have an extraordinarily slow parser (unless the entire message shows up in the first couple of TCP packets).
 
didn't you write your own http message parser?
 
user895378
Yeah, then rewrote it about 100 times maximizing performance.
 
user895378
1:16 AM
(OCD)
 
@Lusitanian Hm... then how would you do it? Would you write a more generic parser that reads more traditional grammar rules from somewhere (e.g. S -> aSa) or would you write a parser that has the grammar built in?
In the first case, it feels like it would be a lot of extra work for little gain, since properly written regexes aren't that different from the grammar rules
In the latter case, I'm not too sure how to keep that cleaner than the regex solution...
I admit this may all just be me, really, and me not knowing my tools well enough, but I'm just trying to explore my options for now
 
user895378
If performance matters and you can't reduce the entire process to one or two preg_match* calls I'd say write your own recursive descent parser that checks the grammar rules as it traverses the tree ...
 
user895378
And beyond that, getting good at writing your own parsers is a very useful skill.
 
user895378
If you don't need the parser to manage thousands of parsing operations per second, though, regex may be a better bet. It mostly depends on what your needs are.
 
@rdlowrey Good point. I have written a couple in university using haskell, but I'd have trouble getting started imperatively.
 
user895378
1:28 AM
Not having any technical training in that area as a base it was something of a "feel my way around in the dark" situation for me. I found skimming the "Dragon Book" very helpful in terms of getting a feel for some of the concepts:
 
user895378
 
user895378
There's really no substitute for getting your hands dirty and just trying and failing, but I know it's not always easy to justify spending days not accomplishing anything other than learning :/
 
@rdlowrey As for the performance, it shouldn't be too much of a problem as the result is cached and should only have to be redone when humans modify files, which shouldn't happen a lot of times per second. The number of preg_* calls would be rather variable. Many common constructs it should be able to handle with one or two calls, but something as simple as 5 + 5 + 5 + 5 + 5 + 5 would be quite the pain when ranking the number of preg calls...
 
user895378
IMHO if you have to parse things like that you'll be better served to generate tokens from the raw data source and build an abstract syntax tree. Maybe I'm just not good enough with regex to do it well with PCRE, but trying to run preg_match on material with that kind of variation makes my brain hurt.
 
@Jasper i'd read a set of grammar rules but up to you
@rdlowrey regular expressions make my brain hurt constantly
@rdlowrey this book has been on my list of technical books to read forever
 
user895378
1:37 AM
Well I won't lie to you and tell you I grok'd every word of it. I read enough here and there to get smarter and pick up some new knowledge I didn't have before.
 
user895378
A lot of times I think the hardest part of problem solving is having enough confidence in what you're doing to say, "My solution is a good one and I've done this well." Giving yourself a bit of technical background in the area in which you're working can go a long way in that regard.
 
Yeah, I certainly don't expect to understand most of it but that doesn't mean it's not worth the read
 
@rdlowrey I wrote these regexes before I knew what an AST was. Perhaps that's why it worked: I was free of any of the knowledge how to properly do it at the time...
 
user895378
Well, if you can cover all your bases with regex it'll certainly be a much less time-consuming solution. Don't throw your regexes in the trash :)
 
@Lusitanian And perhaps that's the problem. After I got these regexes working the first time, I broke them up in better pieces and made them more readable. Since that moment, regexes never meant to hurt my head again :P
 
user895378
1:43 AM
Whomever created named capture groups is a hero.
 
@Jasper as @rdlowrey says in that case i suppose you oughta go for it
my view is skewed just because undecipherable groups of characters are not suitable for consumption by my head :D
 
@rdlowrey Agreed. Gotta look up who that was some time :P
Thanks guys, I think I'll rewrite the "compiler" with the current regex based strategy for now and put a proper lexer/parser combination on a wish list for the (far) future.
I really tend to overthink these kind of things (to the point where I don't get the coding done even) and getting some feedback from other people really helps in such cases (even when it seems I already made up my mind beforehand). Once again, thanks.
 
user895378
No problem ... and try to remember ... imperfect software that works is better than theoretically perfect software that's permanently unfinished.
4
 
2:21 AM
that's a good quote, polished off by a nice (removed)
 
user895378
2:32 AM
(removed) is always a nice touch
 
2:55 AM
morning
 
3:08 AM
0
Q: I want to add a text beside the total price calcualtion (how to)?

Diana Trincaso when u choose your quantity .. and you click on the distributor buttons u get message with the total price .. but it's only number .. can I add text beside it appears in this message ? Like 21 Dollars or $ or anything like that ? or can I make this total price appears in a text under the table...

are these type of questions part of our domain?
this is not a software development company
 
i haz issue :( - i have a php file that generates some data and gets ajaxed loaded on to a page.. the only issue is the php file needs data from the page it's getting loaded to
i'm trying to avoid using sessions, but POST is also proving to be an issue
any ideas?
 
@KevinMurphy what's the issue with post
 
i get no error cURLing the data to a file, but the receiving file doesn't get the info.
 
@KevinMurphy does it ever return the expected data. if not, there is a problem with that PHP file and you need to fix it before you can do what you are trying to do
 
pastebin.com/hnfN8Jfx here's the sender
in the receive.php i simply just try and echo $_POST["player"]
 
3:22 AM
did you curl the sender of receive?
 
@andho i don't know what you mean, but I don't think so lol
 
@andho lol...
 
8 mins ago, by Kevin Murphy
i get no error cURLing the data to a file, but the receiving file doesn't get the info.
@KevinMurphy which file did you curl?
anyway, what is wrong with receive.php ? it doesn't echo $_POST['player']?
 
3:27 AM
@andho correct
 
[tag:cv-pls] damn one developer told me that

if (!isset($_GET['cat']) || !in_array($_GET['cat'], $cat_array)) {
redirect_to(root);
}
$cat = $_GET['cat'];

its vulnerable to sql injection lol
 
the sender.php file is cURLing data to receive.php if that answers your question
 
@KevinMurphy then provide code for that file
 
@andho it's literally just echo $_POST["username"];
 
@KevinMurphy let's see
i don't see why it wouldn't echo it, unless you didn't send the data correctly
 
3:29 AM
anyone think its vulnerable to sql injection ?
 
@NullPointer where is the sql to be injected to?
 
well that's why i'm confused as well. is is possible to go to sender.php in my browser, and go to receive.php and have it work? or does it have to be done server side or quickly?
 
@KevinMurphy first you have to make receive.php work. you said it doesn't echo with curl
 
@andho you can see that i am using get and not using prepared statement for that
 
@KevinMurphy let me see the file
 
@NullPointer -.-
 
@andho what that sign means ??
 
@KevinMurphy this is not receive.php
 
@andho oh, i'm sorry. sec.. lol
 
@NullPointer it means (frown)
 
3:33 AM
@andho third ...lol
 
@andho fourth ...lol
 
@NullPointer lolwut
@KevinMurphy you are not echoing anything in sender.php. and I think the relative path wouldn't work with curl
what are you actually trying to do
 
well i have a page, let's call it player.php. within player.php is a div where ajax loads info from other.php
other.php needs data from the beginning of player.php
 
@KevinMurphy so player.php should send that data to other.php in the ajax request
 
3:42 AM
><
\_/
/|\
/ \
 
@andho is that possible if the ajax request is just .load()
meep found a nice article
 
@andho lol...:P (five)
 
@KevinMurphy i think .load only support GET, so you will need to change other.php to handle GET instead of POST or you can just use REQUEST
 
@andho ok thanks :)
 
user652649
am I late?
 
3:58 AM
@wes its too late ...
 
user652649
morning
 
@wes every day new avatar cool :P
 
user652649
i switched to this avatar a day ago... now you see it for the first time?
 
user652649
:P
 
user652649
4:03 AM
by the way it is very cool, yes
 
user652649
do you know what it is? :P
 
@wes your company name
?
 
user652649
no
 
@wes than what it is ?
 
user652649
it is a tribute to a great and awesome (but dead) software company
 
user652649
4:05 AM
nice software companies always die
 
user652649
Jasc Software btw, read the story on wikipedia
 
user652649
lol
 
@wes also its hard to start nice company
 
user652649
indeed
 
4:12 AM
@wes that why i am finding its hard to start ... :P:P
 
user652649
btw, 15 years ago there was Jasc that made Paint Shop Pro, which was as good as photoshop
 
user652649
Corel bought Jasc, which was near bankrupt, and you can imagine the results
 
user652649
Paint Shop Pro still exists but it is the worst crappy software ever published in the whole history of software
 
@wes ya ... its hard to manage .. again
 
user652649
4:15 AM
since corel doesn't know how to make good software
 
user652649
exactly like Sun Microsystems
 
some company make software ... and some make useful and good software .... but both are company ...
 
user652649
nice software companies always die
2
 
user652649
^^ star that :P
 
corel is first type ...
@wes apple is not nice ..is it ?
 
user652649
4:17 AM
apple is evil O_o it is even worse of the worse Microsoft
 
@wes idk why people buy mac os
but apple has awesome hardware
 
user652649
awesome hardware? it is the same hardware of pcs, but 2 years older
 
@wes they really provide .. good keyboard in laptop and screen is also good
saw retina display however i dont have any apple product not apple loving nature . but some time used my friends
 
user652649
but things are going to change... people thinks that apple is good because on windows they had get tons of viruses... but hey... now they are getting viruses also on macs... and they are changing their mind :P
 
@wes also window is also making crap ... like win8
this is not helpful on laptop
 
user652649
4:22 AM
not really
 
user652649
the real crap was vista
 
user652649
windows 7 (and possibly 8) are good enough, surely better than osx
 
@wes yaa.. 8 is really good if you have laptop with touch screen
 
user652649
osx is made for wasting time, it is like trying to be a space engineer with a space shuttle kid toy
 
@wes it looks cool .. to see
 
user652649
4:25 AM
lol
 
but i dont know why many company are using apple laptop
you can see in google tutorial all are apple laptiop
 
user652649
google banned windows within their offices LOL... i'm serious
 
@wes why ?
 
user652649
because they said, windows is too dangerous for security, as a virus carrier
 
lol
i don't mind windows (inb4theflamez)
and inertia prevents me from installing linux on my desktop
 
apple is like linux always annoying
 
user652649
very unusual for a php master :P
 
i hate apple
love linux
and windows is just...eh.
 
@Lusitanian eh...
 
user652649
@Lusitanian ye we know :P
 
4:33 AM
lol
it's nicer than os x though, which is "commercial bsd with a stupid UI and all of the nice features made difficult to use"
 
i love apple like anything ...damn you guys
 
user652649
for me apple products are just a status symbol
 
or in other word i love apple more than banana or grapes
@wes how its ^^ status symbol
 
@wes yup. it's a fashion company.
 
@Lusitanian i want to get apple shoes ... apple jacket , apple t-shirt , and apple e-bike ..:P
 
user652649
4:38 AM
with the same money of a apple laptop
 
@wes yaa .. if they made by metal body :P:P
 
user652649
i can easily buy an alienware, which has the twice as much the power of the apple laptop
 
@wes ahh dell ... i would just say F**k dell .. its costly here twice
@wes i brought dell laptop of 1000$ and just with 4gb ram /500/i5 (2 core)
 
user652649
idk in the rest of the world but here that price is not so far from our price
 
user652649
btw i'm not a laptop fan... my perfect laptop is 11'' and weights 1kg
 
user652649
4:45 AM
:P
 
@wes in usa you can get i7(3ed generation 3.1 /6mb)/1tb/17.3/1tb just for 850$ where in india its like 1300$
and alienware is for 1500$ where as in usa its 1000$
 
alienware is overpriced simply because its alienware
i like asus laptops
 
user652649
yeah here also... but you can't compare prices with usa
 
user652649
alienware is overpriced and still better and less overpriced than any mac :P
 
indeed
 
4:49 AM
@wes but we manage to get it from usa .. with the risk of warranty
 
they're certainly decent but i hate paying for a name
 
user652649
btw there are also samsung of the "gaming" series that are pretty good
 
i have a 2nd-gen i7 laptop from last year that's quite nice and was about $700
but i like my desktop more :D
 
user652649
me too, luv desktop, i dont know what i will ever do without my 3 monitors LOL
 
i have only one but i am happy
 
4:51 AM
likewise, when i'm on laptop having 1 monitor instead of 3 is quite a change
i'd have 4 but i don't have the room on my desk :(
evening @crypticツ
 
hello
 
@crypticツ hiya
 
user652649
@NullPointer i was thinking the same... buy another monitor at least, and you will see the differences...
 
hey'
 
user652649
hello
 
user652649
 
user652649
directly brought from the tron movie
 
@wes Intel Inside?
 
@wes looks like i have to collect mony now
 
user652649
@NullPointer yea
 
4:58 AM
@wes i think you misspelled its troll movie
 
user652649
@crypticツ i guess so
 
user652649
lol
 
lol
 
5:01 AM
@crypticツ
:p
 
@crypticツ :P
 
user652649
you are both right
 
@crypticツ your profile link :P
yupp @crypticツ please
 
@crypticツ you have a w3foolz cert wollut
 
5:04 AM
@wes
 
user652649
@NullPointer you are wrong now
 
@Lusitanian also this i.stack.imgur.com/ciaSW.png
@Lusitanian dont you have that certificate ?
 
lol!
i would be embarrassed to put anything related to w3schools on a resume, considering the ridiculous rumors and misinformation they spread
 
@Lusitanian all the cool smart people are W3Schools certified
 
@crypticツ then i refuse to be a cool smart people
 
user895378
5:06 AM
^ That.
 
user895378
Better to be tanned and dumb.
 
i can't tan :( [though i don't actually care]
 
@NullPointer NOOOOOOOOOOOOOOOOOOOOOOO
 
user895378
I might need a pasty white gravatar change in memorium for my skin honor of all the time I'm about to spend at the beach this summer.
 
5:07 AM
if i go into the sun i just turn red :D
 
@Lusitanian you have it .. dont feel bad ..
@Lusitanian rdlowrey has too
 
i should put "not w3 certified" on resume :)
sir, what are your qualifications?
i'm not w3 certified!
wow, you're hired.
 
user895378
Yay!!!!
 
user652649
@Tushar respect for your avatar
 
5:10 AM
lol
 
user652649
LOL
 
loool
 
looks suspiciously like me you @PHPNooB
3
 
@Lusitanian happy now :P
 
@NullPointer much better
 
user895378
5:13 AM
I had to change my gravatar so no one recognized me after the w3schools certification embarrassment.
 
user895378
They'll never suspect anything
 
you now look pasty white
 
user895378
I actually am pasty white. It's the middle of winter.
 
indeed it is
every time i open cyberlink powerdirector my computer bsods
 
user895378
The tanning myth is mostly for @webarto's benefit. But the womanizing ... that's for real (as evidenced by my continued late-night presence on stack overflow).
 
5:17 AM
the tale of the disappearing witty banter
 
user895378
The little known 11th plague of Moses was:
 
user652649
The meaning of life is:
 
user652649
@Lusitanian pinnacle?
 
user895378
I wonder how long it will be before mods get legitimately annoyed by the removal joke.
 
tbh, i don't think they'll care
 
user652649
5:18 AM
pinnacle is crap also eh... what about adobe premiere or whatever it is called?
 
user895378
^ 4000Gb of RAM.
 
user895378
Nope. Adobe is like the Mozilla Firefox of design/creativity software.
 
its damn big
 
user895378
No amount of RAM is too much.
 
@rdlowrey depends on need ... 6 gb is even big for me
 
5:21 AM
lol
 
average ram use of mine pc is 3.3 ... even most of server can not handle that much ram
 
i have 32 gigs of ram...guess i need to use my entire secondary 2tb hard drive as swap space
actually lemme go grab another hard drive just so i can run firefox in swap at the same time
 
@Lusitanian why one need 32 gb ram ?
 
meh, it was on sale when i built the desktop for the same price as 16
and it's nice to cache to a ramdisk and run 4 vms at once
can isolate multiple test mysql/postgresql servers in different machines which is nice
 
@Lusitanian yaaa that is cool ...
i have 8 gb ram in my desk .. but want to save power
@Lusitanian isnt is use more power ?
 
5:24 AM
ram uses a trivial amount of electricity
the biggest power hog is the 3 monitors
otherwise there's nothing particularly power hungry in it and it's only on when i'm using it
 
user895378
user image
2
 
lol
 
@Lusitanian led uses less power too i have 20inch and it just uses .. 15 wat
 
you changed your gravatar again @rdlowrey
from left-to-right i have a dell 24", a samsung 23" and a dell 17"
but i don't know the specific watt usages of each
 
user895378
Sometimes you just get gravatar happy. Wait ... are you subscribed to my gravatar feed?!?!? :)
 
5:25 AM
nope
 
I absolutely love having three monitors. There is no going back for me.
 
@crypticツ you should add that comment as an answer
 
@crypticツ your comment is really legit answer
 
5:34 AM
@NullPointer is a RTFM question and I doubt it will help but a select few individuals who haven't bothered to read what a cookie is before using one.
 
true
 

« first day (865 days earlier)      last day (4080 days later) »