« first day (509 days earlier)      last day (4457 days later) » 

5:02 AM
@rdlowrey Going home. Might work on the code standards a bit before I hit the hay.
 
user895378
@LeviMorrison Cool. My brain's fried too. Calling it. Will hit it in the morning.
 
user895378
peace out to the homies
 
I'm trying to put together a quick javascript tag on a php wordpress file
{this.value = '''';}"
you'll see 4 single quotes there... what character(s) do you place in front of the ' to allow it to pass through? the string itself is started with '
 
@RSolberg \
if i'm understanding your question right
 
hello everyone
 
5:16 AM
Thanks! Thats what I thought... yeah... I had a brain lapse for a second and forgot it was called an escape character. I just found that :)
 
sup
 
and personally, I dislike spaces.
so I have my IDEs setup to convert spaces to tabs automatically on save
 
5:34 AM
@andho at work we use BSD-KNF formatting, so that's what mine is set to also.
 
 
1 hour later…
6:47 AM
@ircmaxell I got a surprisingly large amount of feedback on the type hinting stuff: nikic.github.com/2012/03/06/…
 
7:02 AM
Morning
 
morning @Eugene
 
@NikiC Hi
@NikiC Have you ever used TeamViewer?
 
@Eugene No
Is that some remote desktop tool?
 
@NikiC correct
 
7:42 AM
TeamViewer is too slow
anyway, i have seen lots of code(Excel-reader) where hexadecimal values are use to define constants in php,any specific reason why so?
 
 
1 hour later…
9:04 AM
@tereško: hey
;-)
 
what the hell are you talking about ?
 
> Any handy tools to control SP sources? To deploy them?
You say they are better... well, I don't agree
because it is much more difficult to support them
 
i fail to see the difference
 
Ok. You changed the SP
how is it supposed to be deployed to the production
?
 
how much changed
 
9:06 AM
the SP body
 
then there is no difference , when compared to multi-statement transaction
you have all the same problems
 
there is a difference - if you have the queries in the code vs you have a SP
just because it is more difficult to manage SPs
for the code I just do hg pull && hg up
 
really ?
 
depends on the projects
somewhere there is a deb-packages
and full BPD-cycle with CI
and somewhere it is just hg up (if it is my CV page)
 
if you have a transaction , which adds data to 2 different tables , and updates 1 and you need to change how that transaction works , will you really just do hg pull && hg up ?
are you kidding me ?
 
9:09 AM
you must haven't understood the question?
you're proposing to move the logic from php to database SP
which actually doesn't answer to the question at all
 
i am proposing to put database logic where it belongs
 
how it answers the question?
and who told it should belong SP?
 
are you trying to just make me mad ?
 
nope
I've read a lot of stories about moving the logic to DB and moving it back after while
 
OP's question was "my multilti-prepared-statement transaction does not work, what to do? "
 
9:12 AM
and I don't see the reason to move the logic from the code where it is easy to maintain to DB, where it is difficult to maintain
no
the question is
> Does anybody know if it's really a PDO bug?
"rewrite anything in the way I like" is not an answer
and you still didn't answer how to deploy SPs in easy way
 
what i gave was a working solution
 
so how would you propose to deploy SPs?
and version theirs sources?
 
by doing a dump
if stored procedure changes , so does the whole database structure
 
dump of what? of the whole DB?
or of just SPs?
 
SP and tables which it handles
 
9:15 AM
or of a single SP?
and how to deploy it? manually?
by executing it in PMA?
so you should manually control what you have changed?
 
lemme ask you this , how you do version-control an architectural change in databases ?
 
by migrations
 
because that is what causes change in stored procedures
 
Hi all, which SPL exception matches the following:
if (!isset($_SERVER['HTTP_ACCEPT_LANGUAGE']))
{
throw new X;
}

I know what I am leaning towards, but i'd be interested in an unbiased choice.
 
@tereško: migrations for tables are much more automated rather than managing stored objects
plus php scales perfectly and db not
 
9:18 AM
WHAT !?!?
how did that make sense ?
 
what what?
 
you have a php code which works with SQL
 
that makes sense to "better"
 
1 min ago, by zerkms
plus php scales perfectly and db not
 
yes
 
9:19 AM
this make no sense at all
 
"much better" doesn't either
 
if the database does not scale , then php's interaction with database DOES NOT SCALE
 
anyway, who told you about that "much better"?
 
is this you problem ?
 
it is more difficult to manage, it is more difficult to control sources
 
9:21 AM
there is no difference in managing it
gods below
 
there are differences
 
it is not a single query vs a stored procedure
 
it involves A LOT of manual work
which is error prone
 
i have wasted enough of my time
 
do you know any tool that can make migrations for stored objects in mysql easier?
yes, it is a good way of ending the discussion without any proof
@tereško: so any tool? For sources we have a great one, mercurial
anything similar to DB?
@tereško: hey, is it so difficult for you to just point to a software name? Or you just don't know any
 
9:25 AM
Nothing is difficult for teresko, he's just such a strong advocate of self-learning :D
 
@Leigh: he is just an advocate of loud words without proofs
you know - it is easy to say "much better" then prove nothing and quit with "i have wasted enough of my time"
but it is really difficult to admit that there is no a great tool that really could do the process much better
@tereško: hey, don't be so shy ;-)
 
On a slight tangent, the queen sucks and I hate her
 
@Leigh The Queen of England?
 
@Leigh: why so? You should live in russia for a month probably )
 
she decided to visit the city where I live, and make use of the road with all of the bus stops on it, so this morning, there was no busses
ok there were, but they were all moved, with little indication as to where
 
9:33 AM
this happens each morning and evening in Moscow
 
the queen fucks up your busses?
 
not queen but gov guys
 
ah, the KGB, gotcha
 
when I lived there I couldn't even realize how strong are the stereotypes outside
 
tbh, I'd be quite happy to live in Moscow if I could keep my UK wages, my alcohol bill would certainly go down
 
9:37 AM
lol
that doesn't worth it
the price always correlates to the quality
here in NZ we spend about 2 times more money for the food but the quality is just incomparable
I bet the same is true for alcohol
 
After the first couple, you don't notice the quality of the rest :p
 
lol
well, I drink because of good taste thus only beer & wine ;-)
 
I drink to escape the harsh realities of life
 
Guys can anyone help me with jQuery?
 
Try the javascript room
 
9:50 AM
@AliGajani: SO is not a place when people do your work
 
@zerkms Didn't you hear, SO is the largest 2nd level outsourcing resource on the planet
 
@Leigh: what's the first?
and, no, I didn't
 
The first is India
 
doubtfully
 
yeah doubtfully
 
9:51 AM
otherwise @AliGajani wouldn't ask
 
You guys get me wrong
I am not asking to code
 
I think you missed my point.... "second level outsourcing"

The chain of outsourcing: Your country -> India -> SO
 
I am asking to help me figure out what bit of line should I do
 
@AliGajani: you didn't ask the question
 
I asked.
 
9:52 AM
SO public like when the question is clear
 
How to edit my existing JS script to upload form when submit is clicked?
 
lol
"how to edit" == do the work for me
2
 
Here did you get this stat?
I mean where did you get this stat?
 
you didn't do any research, otherwise you would ask some particular question
@Starx: actually it is obvious for everyone :-)
it is not a secret that even a big companies move their support to India (to the outsource)
 
How to edit doesnt explicitly mean : Do the work
Your perception mate
 
9:54 AM
@Leigh: NZ branch of apple has IVR with indian voice :-S
 
I know india is ahead, but where exactly did your data come from
You want to read it , so, i am asking?
 
@AliGajani: well it doesn't. How to edit == edit it for me
 
@zer
 
@Starx: It came from my experience of SO questions and their askers :)
 
Alright.
 
9:56 AM
and "ahead" isn't exactly the word I would use
 
@AliGajani: you need to debug your code and fine a line that actually works not as expected. After that you could ask something more particular
 
LOL.... I frankly love SO, especially the wittiness of the people in it. Its fantastic
 
@Leigh: what do you think about IVR thing?
 
@zerkms What's IVR?
 
@Leigh: uhm, the Interactive voice response
the thing replies to you with "press 1 if you want blabla"
 
9:58 AM
@zerkms: They probably put out to tender, and India undercut everyone else with their cheap expendable workforce
 
but gosh, it is apple
how about ultimate quality everywhere?
 
@zerkms i think you are a bit unfair here. @AliGajani did not ask you to write any code for him. He's asking for a tip on how to approach the problem. Helping him with that might or might not end up you doing his work but we're not there yet.
 
@Gordon: I think the most helpful comment so far was: Try the javascript room ;)
 
@Gordon: huh? every developer should know how to debug its own code
 
@Leigh that's true though
 
9:59 AM
that is what developers are supposed to do for the every single day
as long as you're unable to debug it - you learn how to do that or look for another profession
3
that's simple
 
Hi all
 
RT @mike_stockdale: Using a debugger is a code smell.
 
is there any debug facility in netbeans for codeigniter(using wamp server)?
 
Only chuck and jon skeet can write code without bugs
@Gordon: stackoverflow.com/questions/9615335/combine-bytes-php -- this question is pretty similar to the js one, but just about another programming language
 
@zerkms the point is, if developers are supposed to do [debugging] for the every single day, then they should learn how to do less bugs and not learn how to debug. cure root causes. not symptoms.
 
10:06 AM
@Gordon, I always wanted to ask one of the top guys a question, "How do you find time for SO? DO you do it side by side with your office work, or just focus on it, for hours or play with it, when you are bored?
I hope I am not offending anyone
 
@Starx side by side. and often too often ;)
 
@Gordon: debugging takes at least half of programming session of every developer, by definition
I don't believe anyone spend less time for that
 
@zerkms then im probably not a programmer because my sessions sure dont look like this
 
ok
so all the code you write works from the very begin?
without any fixes?
 
@zerkms no. but its certainly not so broken that i have to spend half the day debugging it.
 
10:10 AM
ok, may be I was too pessimistic with 50%
but well everyone should know how to debug
 
@zerkms yes. they should. but they also should learn how to avoid those bugs in the first place, so they dont have to debug.
 
actually I spent this day of the long debugging session while trying to figure out why Zend_Tool is so terrible
no one could avoid writing bug-less code
so the debugging is a must-know thing
 
@zerkms because it has Zend_ written in front. that is by definition terrible ;)
 
Just see the original question stackoverflow.com/questions/9615019/…
the OP doesn't even know where to start
most likely he didn't write the complete code but just copy-pasted it
otherwise I cannot explain how is it possible to write completely broken function without even a try to check if everything goes as expected in the middle of the work
 
@zerkms yes, I pretty much expected it to be like this, but still: when he came in here you couldnt know. you just assumed. i just felt that was a bit unfair. people should get a chance, before they get attacked, shouldnt they?
 
10:15 AM
> but still: when he came in here you couldnt know
actually it was obvious from the very begin
and you know that ;-)
When someone comes with just a piece of code and without a particular question but "what to change to get the rocket here" - it is definitely a such case
 
@zerkms i assumed it. but sometimes they surprise you
 
You know that good question implies some research that is explained in the question
if nothing has been done - then OP doesn't want the issue to be solved
 
@zerkms, i have very strange problem with a fellow user, can you take a look?
 
@zerkms fair and square. all im saying is, it was a bit unfair to accuse the OP of expecting us to do his work for him when he didnt even asked the question yet. or had a chance to explain his problem with the code.
 
@Gordon: he asked here "how to change the code"
it is enough
 
10:55 AM
@Gordon do you use github for personal projects?
 
@Gordon Yea yea, do you have a paid account?
 
@Leigh no
 
You don't seen to use it very often either. I have a voucher for 3 months free -> micro upgrade, or $21 off a paid subscription
 
11:09 AM
@Leigh i only use it for my freetime projects and freetime is limited
 
i have seen lots of code(like in Excel-reader) where hexadecimal values are use to define constants in php,any specific reason why so?
 
@fluty Possibly directly taken from an implementation in another language. Also in hex you can more easily identify which bits are set in a number. Think of it like hex is to dec as monospace is to times new roman
 
11:41 AM
thanks Leigh but it makes difficult to read code
 
@fluty well, thats why you defined a constant, to give it an easy to comprehend name instead of using the hex codes all over the place ;)
 
@fluty: I guess that's purely circumstantial. With proper alignment I find it helps quite a bit.

define('CONST_ONE',   0x2000);
define('CONST_TWO',   0x4000);
define('CONST_THREE', 0x8000);

define('CONST_ONE',    8192);
define('CONST_TWO',   16384);
define('CONST_THREE', 32768);

I know which one I'd prefer to read.
 
@Leigh which one? and why? what do the integers express that the hex dont? without context they are purely meaningless magic numbers.
 
@Gordon Because looking at "32768" it's hard to see which bits are set, if you look at "0x8000" you know instantly. "24576" is even more meaningless, but "0x6000" shows you it's 0x2000 | 0x4000
Obviously context is needed for anything to mean something
I guess maybe it's just a preference from coming from a more low level programming background
 
@Leigh im usually not interested in the left hand side of the const definition. im only interested in a proper name.
 
11:55 AM
@Gordon I spend a lot of time in a debugger/disassembler, I often have to break down combined values (which are usually displayed in hex) into their component parts.
 
hey guys :)
what is considered server side scripting in php?
 
@Vlad everything
 
Gordon do you have your own blog or some sort of favorite stuff for oops , i really enjoyed reading your post on stackoverflow
 
yes php is run on the server, but i think when i say server side scripting in php that means creating scripts that run only behind the scenes or?
what is fcgi used for? isnt that something with php?
 
@NikiC wow...
 
12:00 PM
@fluty thanks. i do have a blog at gooh.posterous.com but i rarely update it. if you are interested in OOP check SOLID and GRASP in Wikipedia and follow each and every link. Also, google for Martin Fowler, Robert C Martin and Misko Hevery to name a few well know software engineers.
 
@Gordon Even a little tool you run from the console?
 
@Leigh thats an interesting question, given that could be anywhere with PHP installed. But I understood the question as serverside vs clientside in a web environment and there PHP would be serverside always.
 
@Gordon thanks.
 
@Gordon I was going to say, I think I'd classify anything that processes requests and serves results would be server side scripting, but technically even if you write a CLI tool, it's taking your request and serving a result. I know the distinction in my mind, but I can't formulate it very well
 
@rdlowrey That's complete FUD. You still need to rewrite all of your SQL. All of it. So it's not like you're just updating a setting line, and boom you're on another RDBMS. So at that point, the fact that they share the same API actually becomes a negative to me (If I need to rewrite the SQL anyway, I'd rather be able to take advantage of specific features)
 
12:05 PM
@Gordon nice blog btw :)
 
@tereško That's not true on all fronts. For some of my production apps, I don't use FK, but I do use triggers, views and stored procedures. But others I do use FKs quite heavily. The point was not that I don't use them, but that I have applications which don't need them because the performance is far more important than the integrety...
 
@Vlad thanks.
 
.. random old replay
@ircmaxell , i just recalled that you used MySQLi , and that seemed like a plausible explanation ( because i recalled that you said you keep tables simple )
 
nope, I said I use MyISAM and no FK, which does not mean simple... :-D
 
oh , yeah
sorry .. i have been up for 28h , and going
thought , i would insist that MyISAM == simple tables
 
12:10 PM
And I could show you dozens of cases where that's not true
 
lets just agree to disagree .. today i have no taste for trolling
as for @rdlowrey's comment .. well .. PDO has nothing to do with SQL queries you write .. thus it cannot magically change them as you change DSN
 
PDO is abstract interface enabling you to access any db by just specifying the db driver
 
@Vlad not true
you also need to specify the queries correctly for each db type
 
well yes i guess one or two db types are used at same time. no big deal
 
lolwut ?
 
12:18 PM
???
 
My point is that it's not an abstraction layer. It's just a common interface between disparate APIs. Which takes away a lot of the specific features that I want to be able to use...
 
true
 
switching DB drivers is a big decision that's been attempted to be trivialized. It doesn't work that way in real life. You don't just flip a switch, a lot of work needs to go into the switch (porting data, optimizing queries, using the correct db-specific features to get the job done right, etc)
I think PDO is a nice idea that won't work as a general solution
 
well .. it is a general solution for connection to database and executing queries on it , but that's it
 
yes i was talking about queries. I guess there is not much dfference between different types of databases. @ircmaxell
 
12:21 PM
... @Vlad , and how many RDBMS have you used ?
 
odbc, and mysql
odbc for mssql
 
@tereško Right, but how often do you just execute queries on it...?
@Vlad ODBC is an even worse layer...
 
heh
 
@ircmaxell And still more stuff incoming ^^ Some even send mails ^^
 
@NikiC I'm replying to that one
 
12:22 PM
@ircmaxell Which one?
 
Good afternoon
 
krofna :)
 
I really didn't expect that people are so interested in the topic
 
@NikiC the one from Jordi
 
@ircmaxell Great, can you cc me?
 
12:26 PM
did already, and sent
@NikiC: did you see t.co/mNHUCudW ? How is that not about parameter hinting? From what I can tell, it is basically my exact proposal minus the word hinting...?
 
In any case, I don't even have time to keep up with all the comments ^^
 
:-D
I see that as a good thing
and am a little disappointed I didn't get more :-( ;-)
 
12:48 PM
what does SAPI means. shell API for php?
 
no
It's the different ways to interface with PHP
E.g. there is a cli sapi (command line), there are cgi, fcgi, fpm sapis (servers) etc
Stands for server application programming interface
 
@NikiC wow thanks.
 
@ircmaxell It definitely is. Always good to have community opinions.
 
there are shell scripts for php? any example?
i mean custom made.
 
@ircmaxell Did you have an earlier RFC than your 03/03 one? Otherwise his predates yours
 
12:56 PM
Guys, look at this question, please. stackoverflow.com/questions/9570384/…
1
Q: What algorithms could be used to rank popular blog posts in blog aggregator?

Valeh HajiyevI am building a blog aggregator like Techmeme that finds most popular posts from several blogs. Unlike Techmeme, first, I aggregate blog posts from a variety of RSS feeds, then save the headlines and relevant URLs in database. After that, I have to find what the most popular blog posts are. For ...

 
Hi @AlexandruTrandafirCatalin
 
Can someone help me convert an array to a more readable one?
I've got it from the XMLParse using a function I've found on php.net
I want to change that, into someting like key => value
Well basically I want to read the xml into an associative array
But it is huge so I'm using a function to detect when I get 100 items, then stop.
 
Simple foreach would do it I guess
 
Yeah, I'm trying, but I don't get good results.
 
Can you give me some php array syntax to work on?
 
1:13 PM
How do I do that?
 
Or part of xml?
 
posted on March 08, 2012 by The odd bit

The slightly odd title is there for a reason. This post exists for a reason. I’ll explain both… I’ve always struggled to remember the order in which hyperlink styles should be defined in a stylesheet. Hyperlink styles? Order? I’m talking about these (in alphabetical order): :active :hover :link :visited They should be specified in the right order or things won’t work the way you’d expect th

 
One moment..
Part of XML here:
This is what I use now: pastebin.com/mUXv5MFA
 
Have you tried xml_parse?
 
That function gives me the array I have showed you, including other xml info. Then I do a RecursiveArrayIterator to get an array only with property elements
@HighKickX Can I do xml_parse and get only the amount of elements from the xml that I need?
 
1:21 PM
@AlexandruTrandafirCatalin No no, it's not the same as in previous link
 
@d
sorry
@Donut that is the xml file
Will a serialized array be good for your testing?
I don't know how to give it to you in other format.
 
I mean XML that represents this pastebin.com/zJjrqWAt
 
@Donut here is var_export of the array: pastebin.com/HZBdPvge
 
@NikiC I really enjoyed your article on scalar type hinting. One of the better articles I've read. Really nice.
 
The XML is the source one but I do previous parses on it before I get that format.
@Donut I need that array to be converted into something like key => value
 
1:28 PM
@CharlesSprayberry Thanks :)
 
@Leigh looks like it does...
 
1:43 PM
@Donut I've almost got it, I've got some little trouble at the images but it's almost done.
 
@ircmaxell How long were you talking about it pre-RFC? Maybe he really really liked your idea and stole it :D
 
@Leigh the 29th, 1 day after
 
@AlexandruTrandafirCatalin why do you need an associative array at all? why cant you use a DOMTree?
 
How do I use that?
I think I've got it solved for now to get going..
Well I need to acces like this $item['field'], $item['field']['subfield'], and so on..
 
Gm all
 

« first day (509 days earlier)      last day (4457 days later) »