« first day (961 days earlier)      last day (3987 days later) » 

8:00 AM
Thank you very much for the explanation and help! This helped a lot. Where can I get a or find a mathematical parser for PHP ? — JayGatz 8 hours ago
Does someone know a PHP math parser ?
 
@HamZa eval()
:-P
(not seriously)
 
I just love eval :D
 
Mornings @all
 
@DaveRandom One does not simply use eval()
morning @DaveRandom
 
@DaveRandom hiya ,,,,, morning
 
8:02 AM
@DaveRandom Morning
 
@HamZa This isn't a million miles away from what he wants. You can pretty trivially add support for more operators by modifying doOperation(), you'd also probably want to remove the error constant resolution mechanism.
 
posted on June 02, 2013 by Liip

Today Patrick Jezek and I sat together to get a grip on one of the major problems we have when using Drupal in a continuous integration environment - module updates involving major updates on configuration settings and database content. Problem description Imagine a usual Drupal installation already deployed on a live server. Imagine further that there is a demand to update at least one mod

 
It's designed for bitwise but the basic concept is the same. It's pretty inefficient because it's largely string based but it does work and it supports infinite nested bracket expressions
 
@DaveRandom thanks dave
 
"use usort function. this is so simple. .:)"
 
8:13 AM
@Mr.Alien lolz
 
emm ... what the hell is going on in Turkey ?
 
I don't even want to DV those guys ...
@tereško We should maybe ask @ihsan ?
 
It is an answer. Everything the asker needs to answer the question is available through that link. – Jim

@Jim So I should post this as every answer Google – Mr. Alien
 
i am getting the impression that Turkey is about day from cutting the internet access
last month there was new about Turkey starting the process to join EU ... this month they are essentially having a full blown revolution going on
 
-8
A: php : sort php array based on key

JimThe PHP manual has a great page on sorting.

hahaha he got downvoted so much xD
 
8:16 AM
yep, cos link-only = bad answer.
it won't last long anyway, because the question is almost gone.
 
I didn't downvoted
 
@Mr.Alien Neither I ...
 
@HamZa We hardly down vote :p
 
Great, you want a medal? ;-)
 
He maybe will think that we did ...
 
8:17 AM
@Jack Oh yes :D I would love that
 
@Jack Nope thanks anyway
 
He got a Peer Pressure badge out of it I would imagine.
 
lolz
 
Not sure if that counts if the qn is deleted before it gets awarded.
 
@vascowhite Peer Pressure x 3
 
8:18 AM
They really should introduce some more negative badges
 
lol
 
lolz
 
I'm thinking [Bell End] could be awarded to 90% of the users of SO
 
Just like how you get prizes for shooting your angry birds the wrong way three times lol
 
Or if you ask 10 q's that are closed as dupes of your own questions you get a [Face Palm] badge
8
 
8:20 AM
Yea, there should be some combo badges, 2x, 3x, 5x, 10x the ultimate
@DaveRandom ROFL...
 
@DaveRandom lol
 
@DaveRandom awesome :D
 
Monring
@Mr.Alien Morning - you pinged me then, for some reason ;)
 
moring
 
8:22 AM
@PeeHaa埽 mon-ring
 
mnoring @PeeHaa埽 have a good weekend?
 
Morning morning every1.. @Jimbo o_0
 
@Jimbo Have been working most of the weeknd :(
 
Ooh, there was some zend certification busting going on earlier /me reads history
 
@PeeHaa埽 sterkte :(
 
8:24 AM
@PeeHaa埽 Which = more £££ :)
 
@Jimbo or more €€€ :)
 
Is there a Markdown tag that always resolves to the user name belonging to an id?
 
@vascowhite Yes, I tried $£$, then $$$, then settled for £££ after giving up on finding the euro key on my keyboard, lol
 
@vascowhite or more $$$ :)
 
Does anyone know off the top of their head what the offline defrag command is for Win2k3? As in the command the reboots the machine and launches chkdsk in defrag mode before windows boots?
 
8:26 AM
@Jimbo on my kb its Alt Gr 4. Alt Gr is to the right of the space bar.
 
I know it exists but I've forgotten what it is and MSDN is shite
 
@DaveRandom Have you tried looking on superuser?
 
Good call
 
superuser > msdn =D
 
:-P
 
8:30 AM
wow alt Gr can do wonders :O
¡²³¤€¼½¾‘’¥¥×äåé®þþüúíðð©©ñdç
 
Do 0153
Edit: found mine
 
@Jimbo lolz
 
:D
 
Can't find mine either, because my keyboard looks like this:
Those are not my feet btw.
 
Haha. Hardcore
Wish I had one of those Optimus LCD ones
 
8:33 AM
S.O.S I need a symfony expert
 
@Mr.Alien sure glad to see at least the i in mysqli :)
@Mr.Alien not mine!
Not that there seems to be anything wrong with those feet ... hehe
 
@Jack why do you explicitely say they are not yours ?
 
@HamZa I dunno why ... maybe it would be better to say that's not my desk, because my desk is a whole lot messier heh
 
@Jack haha :)
 
8:36 AM
@Jack LOL
 
I really should get back to work, but I have a hangover. I'm working it out by DVing shit questions :)
 
Did PHP give you the hangover? :)
 
No, Heineken did :)
 
May 30 at 20:44, by NikiC
Q: How many PHP core devs do you need to change a lightbulb? None, because the dead bulb will be declared as "working as expected" anyway
^^ still hilarious
I want a T-shirt
 
Maybe trim down the contents a bit.
Q: My light bulb is dead. [tag:php]
A: Will not fix [tag:status-by-design]
Stupid Markdown!
 
8:44 AM
How to pass a variable trough multiple pages?
without having it in a url?
 
@Duikboot $_SESSION
But what's your use case
 
Hilarious !
sorry mom, i'll try not to do it again... — user2141046 26 mins ago
 
I have a projects overview with multiple projects, and when a users clicks on a project there is loading a list of partners hwen a user fills in a form I have to insert a new row on the project table
 
how to insert the 30k records into mysql with lesstime 2 mins?
is there any mapreducing ?
 
so :: projects :: > :: partners :: > =:: form :: > [save] I have to insert the project_id into the partners table
 
8:49 AM
@Duikboot Oh okay, so you need your list of 'partners' persisted to the form and then saving
 
I need the selected project.
 
@Jimbo you know any procedure to insert 30k records into db?
 
@naveen mysqlimport
 
@Jimbo it takes lot of time
 
@naveen Yep, that's your server speed bottleneck though, nothing you can do about that really..
 
8:52 AM
@Jimbo is it possible to divide the records(2k each block) and insert all blocks at a time?
 
@naveen Are you on linux?
I imagine you can do a tail -n +1000 /yoursql/file.sql | mysql -uroot -ppassword < table
or >, can't remember
 
@Jimbo no windows i am working
 
You want to go through the file, find a good number you want with a valid end to the sql, and do a tail up to that?
 
will a session b overwritten?
 
8:56 AM
@naveen Well you'll have to manually save 1000 records or something and do it bit by bit
Or, maybe use a regex to find x number of records from the file... figure it out ;)
 
@naveen Why does it have to be fast in the first place ? How long does it take now ?
 
@Jimbo i am using the above method to insert 1000 records using batch. but after sometime internal server error coming
 
@naveen Dude, check your error log :/
 
@HamZa it takes 30 mins
@Jimbo and also it takes 30 mins
 
9:00 AM
@naveen is it a .SQL file ?
 
@HamZa no. i get the xml un formatted data. then using foreach to store it in the array with formatted data.
after that insert into mysql
 
Are you sure that the "insert" process is taking so long ?
It may be the PHP processing the data that takes long ...
Also are you insert row by row ?
 
@HamZa insert takes so long. i am inserting 1000 records at a time insert_batch() in codeigniter method
 
@naveen lolz you're using a framework .. Have you tried using pure php ?
 
yes. but this also takes same time
 
9:07 AM
@naveen I think it's the way you're inserting it is the problem. There was a post on SO on how to insert several records very fast but can't find it ...
Also make sure that the DB is optimised
 
@HamZa ok.Is it possible to insert the records at a time from different blocks
to call that blocks at a time
 
@naveen You mean simultaniously inserting 1K records ?
 
yes
 
no idea how to do that ...
@naveen take a look here stackoverflow.com/q/3096785
@naveen and this http://stackoverflow.com/a/4833520/
it seems they all refer to http://dev.mysql.com/doc/refman/5.1/en/load-data.html
 
@naveen Are you using prepared statements? When do you commit?
 
9:17 AM
@PeeHaa埽 no i am not using Prepared statements .by default it is commit
 
@naveen What is by default it is commit?
After every insert statement?
 
0
A: parsing/scanning through a 17gb xml file

hakre I considered xmlreader, but as I see it using xmlreader, the program would be reading through the file a whole lot of times(find question, look for answers, repeat a lot of times) and hence is not viable. Am I wrong ? Yes you are wrong. With XMLReader you specify your own how often your want...

 
I hate this error so much ! :p Invalid parameter number: number of bound variables does not match number of tokens'
 
9:23 AM
@hakre simple_xml i am using to parse the xml file from url.
i think simple_xml and xmlreader parsing taken time is same
 
Lol seems there is a little problem with a belgian radio station mobile website : m.stubru.be/DSTWAR/Transcoder/_http/www.stubru.be/mobiel
 
9:40 AM
@Duikboot Indeed there is a problem. They are using jquery
 
Paging @ircmaxell to a stupid question about peppers, paging @ircmaxell to a stupid question about peppers. Doctor ircmaxell, please deliver a smackdown. Thank you. stackoverflow.com/q/16891729/168868
 
@PeeHaa埽 hahaha
 
Lol :P
 
@Jimbo thx :)
@naveen Well simplexml is faster but uses more memory than xmlreader. Just use the right tool for the job, e.g. round about a 256 MB file you can't process any longer with 64mb of memory limit in PHP. In the question the OP has a 17 GB file, this will hardly work with simplexml :) It's just too large. Just use the right tool where applicable.
 
Is it hard to create such thing as this? :
Can I rename my file to my description?
 
9:52 AM
@naveen BTW, the XMLReaderIterator I've linked there offers you SimpleXMLElements on a subset while iterating with XMLReader as well, so best of both worlds :)
@Duikboot This should be explained in the documentation of your operating systems file-system. Or what do you mean?
 
@crypticツ that's why you need to combine it with getmxrr() if you want to do anything useful with it. that said, the best way to test if an email is valid is by sending an email :)
@crypticツ Also, FILTER_VALIDATE_EMAIL is a regex, just a better one than you would be able to cook up :)
 
I want to rename in my php site the file uploads to the description name
move_uploaded_file($_FILES['file_upload'.$i.'']['tmp_name']
Can I set for the ['tmp_name'] the current post var from that field?
 
Why don't you post valid PHP code first and then ask the question again?
 
10:01 AM
Is it just me, or is it strangely satisfying when you fire up IE10 to test your code and it actually works straight away?
 
the upload i currently working.
I just have to rename the filename.
 
rename to what?
 
@Duikboot - It'll be in $_POST I think.
@Duikboot - $_FILES only contains uploaded files, not the POST information sent with them (that should be in the $_POST superglobal).
Be sure to sanitize your filenames, or someone will upload a file called .htaccess or something.
 
You mean to remove spaces etc.
 
10:04 AM
Better yet, don't rename to anything the user can control.
 
^ that user has an extreme "Please explain me how to read the manual based on my code-examples" Question-Asking attitude.
 
This is a file upload for an administrator only, he has to rename his document to upload and it should be uploaded onthe server then with that name in the database.
like aflsdkj323.png > testImage.png ( testImage) is the description from the form field.
 
Anonymous
@Duikboot I am with jack , never let users rename your directory
 
It's not the directory but the file itself?
 
10:07 AM
Shog9 on May 31, 2013

Community management at Stack Exchange is an… Interesting job. Parts sociologist, cat-wrangler, therapist, software analyst and cheerleader, this small band of dedicated people work daily to make sure each individual community has the tools and support you need to be as awesome as you are. Of course, we don’t do it alone: from the very start, Stack Exchange attracted some amazingly helpful and insightful folk who’ve donated their time and effort to help out – and I’m pleased to announce that we’re adding one of them, Tim Post, to our full-time staff of Community Managers. …

 
@Duikboot well, then make sure to strip everything off that's not a \w.
 
yiz
cheerleader?
 
yiz
...
 
Allright.
Thanks! :-)
 
10:10 AM
@Duikboot - It'll be in $_POST and you can use the rename() function (php.net/manual/en/function.rename.php)
 
Okay, lets try!
["file_upload0_text"]=> string(15) "wqefqwfwqefeqfe"
["file_upload0"]=> string(11) "profile.png"
 
@LightningDust Don't use rename() for uploaded files; use move_uploaded_file().
 
You will need to sanitize the input and check if the dest file exists if you don't want stuff getting overwritten
 
Indeed or I have to add a random number at the end? b
 
Depends on whether it would otherwise overwrite data it shouldn't.
 
10:12 AM
@Duikboot - Sanitizing is better, if you're going to add random numbers why are you letting people rename files? Why not just use a random number and give them a link like tinypic etc?
Is there any reason not to use scrypt for password hashing at this point?
AFAIK it's an order of magnitudes more secure than bcrypt
 
scrypt is not very well supported yet.
 
I'm using ZF2 which has scrypt as an option
I may hit 2k rep today, scary.
 
not sure about the orders of magnitudes bit either; you could be right, but at this point i haven't bothered with it yet.
 
Well, most sources say the cost of a hardware bruteforce against scrypt is 4000x greater than against bcrypt
 
10:17 AM
meouw
 
@hakre Jesus. That OP produces crap
 
yeah, such a help vampire
 
10:18 AM
Best question ever in IRC the other day
 
@PeeHaa埽 He/she implements CrapFactoryGenerator().
 
'How do I put text on the screen?'
Someone says 'Use a permanent marker pen' :D
 
@Jack interface Crapable?
 
hehe
 
10:20 AM
@PeeHaa埽 yeah, like "poep in je hoofd" ;-)
 
public class HelpVampire() {
    public function postOnStackOverflow($issue){ ... }
    public function research($issue){ postOnStackOverflow($issue); }
}
 
@Jack lol
 
10:22 AM
class BetterHelpVampire extends HelpVampire {
    public function research($issue) { $this->research($issue); }
    public function postOnStackOverflow($issue) { $this->research($issue); }
}
 
Generates .... stack overflow ^^
 
> Do not forget to also vote for deletion of bad questions. Otherwise you will only find them when you use google the next time.
 
Do not forget to tell everyone to stop using mysql functions either. Why are so many tutorials still using those?
(Though, they are faaast)
 
"Do not forget to tell everyone to stop using mysql functions either" --- it actually annoys
 
10:25 AM
mysql and md5 should be external libraries, once you pass a test on their correct usage, you're allowed access to them.
 
don't forget to tell mysql_ is evil, don't forget to tell md5 is "insecure", don't forget to tell singletons are bad
 
@zerkms Why are singletons bad?
 
Google's idea of useful search results; search for "zend studio loggertrait" ... the first four results are all from the same fucking google groups thread ...
 
@LightningDust are you trolling me now? ))
 
10:26 AM
@zerkms - No, ZF uses a lot of singletons.
 
@LightningDust ZF is far from ideal
 
I suppose Zend knows what they're doing right ... ahem.
 
ZF also uses phpunit 3.4. so what? )
 
I quite like ZF2, without it I always break MOVE principles because they're hard to implement.
Which is a terrible reason to use something, but makes my code actually maintainable.
 
plans got changed
 
10:28 AM
What is move principles?
 
I'll link to the original filename but will add the description in the download URL.
 
@Jack - MOVE is like MVC, but with Controllers separated into Events & Operations
Because Controllers became a dumping ground for everything
 
@PeeHaa埽 i have a doubt on SQL, i'll ask, ok?
 
10:30 AM
> Discussion for all things PHP - Don't ask whether someone is here to help you. If someone is around and wants to help they will.
@NokImchen ^
 
@PeeHaa埽 The Query Below takes just 0.0004 Seconds
SELECT b.TIMESTAMP,b.CLOSECLOSE1,a.CLOSECLOSE2 FROM TEST2 b,TEST1 a WHERE a.TIMESTAMP=b.TIMESTAMP
@PeeHaa埽 ah!
 
@Jack what you trying to say about my regex capabilities? =oP
 
@NokImchen You expect it to take longer?
 
but id i try to save the result using CREATE TBALE, like the query below, it takes 28 seconds!
CREATE TABLE TEST3
(SELECT b.`TIMESTAMP`,b.`CLOSE`CLOSE1,a.`CLOSE`CLOSE2 FROM TEST2 b,TEST1 a WHERE a.`TIMESTAMP`=b.`TIMESTAMP`)
 
@crypticツ I'm letting you make up your own mind on that ;-)
 
10:32 AM
@LightningDust No, m so glad that it takes so less time! but wen i try to save the result into another tables, it takes more than 28 seconds, any solution?
 
@NokImchen Do you have to persist the data or can you use an in memory table?
 
@LightningDust reading ... seems like it's a wrapper that just enforces the right way to code MVC no?
 
10:34 AM
@PeeHaa埽 i neeed to persist the data for a while, because i have to to do a lot for further calculations on the data returned
 
@Jack basically yes, it's an improvement on MVC
@Jack But follows very similar principles to MVC.
 
@NokImchen in mem table provides that
 
@PeeHaa埽 let me google "in mem table: , brb, thanks a lot :)
 
Arguing is so much fun
 
is i get error on this, can u please tell me y?
DECLARE @TempTable TABLE
(
TIMESTAMP DATE,
SYMBOL TEXT,
CLOSE1 DOUBLE,
CLOSE2 DOUBLE
);
 
10:39 AM
dear PHP developers , i have a full website for user managment i upload it in the server in my office but when i try to use it with the same database on home wiht local server WAMP server its work but it didnt add users or even log in wiht users
 
@NokImchen have you tried to READ error message?
 
yup here it is
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DECLARE @TempTable TABLE
(
TIMESTAMP DATE,
SYMBOL TEXT,
CLOSE1 DOUBLE,
CLO' at line 1
 
@NokImchen have you tried to READ it?
 
there is no error when i try to login in or register with user its told me that there is no such user like this
 
@zerkms yup
 
10:41 AM
@NokImchen so?
 
@MohammedALJakry You need to do some basic debugging yourself. Before you have done that we cannot help you
 
mysql cannot recognize DECLARE
and it explicitly expresses it to you
 
i dont knw y am getting the error, so asking for help to u guys.. ;(
 
@NokImchen please try to find a DECLARE mysql command description in the official manual
when you do - come back here with link
 
@zerkms heheh thanks :)
 
10:44 AM
"@Mr.Alien It is not deprecated, it is removed." means what :-/
 
i did , but the problem is the whole website is work in the office with the database in same structure , but its not working in my local server
 
it's not the problem
but a fact
 
the problem is that someone wrote something that cannot log its errors properly
or the problem is that someone cannot read the logs properly
@MohammedALJakry do you drive a car?
 
10:46 AM
so here is an analogy then:
 
is that the link?
m so confused :(
 
when I drove to the work - the car worked. But at the work I changed my tshirt and now my car doesn't work
 
@Mr.Alien Dude, you know nobody uses <center> any more right? Deprecated
 
@MohammedALJakry now tell why it doesn't work
@NokImchen mysql told you that it cannot parse DECLARE command. I'm not sure how that is related to memory storage engine
 
@Mr.Alien imho the argument has turned pretty pointless.
 
10:48 AM
@zerkms oh, since Mysql Cant recognised DECLARE command, so i'm thinking of other alternative
 
@NokImchen why did you think DECLARE is a solution?
 
because your tshirt ?
 
@Jimbo Agreed, Even I don't use it, the thing was the OP used center, in many cases it happens OP cannot change the markup, he depends on CSS, this guy changed the markup inorder to get his solution work... so I just told him not to change the original code
 
why not, say, DELETE?
@MohammedALJakry because of it's cloudy today
 
@Jack I didn't replied.. zzzzz he was the 1 who told that id starts with a number, I am still not sure is it valid or not
 
10:49 AM
@zerkms hmmm cos i'm trying to make a in memory table as @PeeHaa埽 suggested me :)
 
@NokImchen and how creating a table is related to DECLARE?
 
so when my database will work ?
 
DECLARE is used to declare a variable
@MohammedALJakry when someone that can debug will debug it a bit?
 
@Jimbo It happens many times when op uses <font> tags, I never remove them, I suggest with a note at the end of the answer that the particular tag is deprecated, it is same like mysql & mysqli, we can't give op a PDO solution if he is using mysql
 
@Mr.Alien id starts with number? surely i'm missing some context ;-)
 
10:50 AM
Thought you had a valid point there @LightningDust
 
No, I was wrong
 
@zerkms i dotn knw! i saw that in a tutorial blog, like that way to create in memory table using DECLARE :|
 
It was deprecated in 4, removed in 5
He is right, <CENTER> is no longer defined in HTML specification so people shouldn't use it.
 
Totally, and completely removed?
 
The reports seem to contradict.
 
10:51 AM
Yes
 
Has anyone used this pecl.php.net/package/taint ? There is little to no documentation, and want to know if it would be a better alternative to PhpIDS
 
@NokImchen it makes sense to read before you apply something. Especially before you're asking a question
 
@Jack LOL oh yes, there's a crappy article on the internet
 
"XSS code sniffer"
@crypticツ sounds silly
 
<CENTER> is as much a valid tag as <MYTAG>
 
10:51 AM
@zerkms i did read a lot :|
 
@LightningDust GOOGLE MAKES MORE MONEY THAN WE DO, THEY ARE USING center, the whole context was that markup shouldn't be changed as per your convenience
 
@zerkms ok, new code i found
 
create table tbl1(fld varchar(64)) engine=memory;
 
10:53 AM
@NokImchen here we help writing code, not validate some crap you've found somewhere
 
@Mr.Alien, just because somebody who is successful does something doesn't make it the right thing to do. Many people who are more successful than me snort cocaine but I'm not going to pick up the habit. :P
 
@LightningDust +100
 
here is a a code that work
create table tbl1(fld varchar(64)) engine=memory;
but ubfortuabtely i dont support TEXT, any solution to enable TEXT?
 
@zerkms I mean I'm not going to use it to handle any security, just log an event if something is detected. PhpIDS works great in doing that, but it's a separate package. So wondering if a PECL extension made by a PHP dev would work just as good.
 
10:53 AM
Microsoft make more money than I do and they produced IE6. :(
 
Alien
 
@LightningDust and ie6 was a great product
 
some issue with DATATABLES......
anyone having knowledge ?
 
I have to agree, at the time, IE6 was pretty darn good.
 
@UreshPatel no one, bye
 
10:54 AM
@LightningDust They developed IE6 when we were wearing diapers
 
so dumb
 
@zerkms - No, it wasn't. IE6 was a horrible product compared to Netscape and Mozilla suite at the time.
@zerkms - It took until IE10 for MS to have any respect for standards.
 
Adhering to "standards" !== being a good browser.
 
I say this as someone who actually quite likes IE10 and Windows 8, I'm not a frothing-at-the-mouth Microsoft hater or anything.
 
10:56 AM
I hate those 'undefined inxed' errors :p
 
@LightningDust all modern browser nowadays don't adhere to standards
 
@Jimbo Don't, he will cry
and he will blame me
 
;D
 
It's the way they keep progress
 
@Jack - Disagree, refusal to adhere to standards makes our job as web developers far more difficult and tedious. Imagine if a C++ compiler decided not to support a bunch of mainstream functions and came as standard with a major IDE.
 
10:56 AM
Screw him, it's a duplicate and isn't needed on SO
FOR THE GOOD OF THE REALM
 
@Jimbo stackoverflow.com/questions/16853999/… that was our first encounter
 
Invalid parameter number: parameter was not defined' no shit sherlock
 
@LightningDust @LightningDust The inequality is not meant to be symmetric :)
 
@Mr.Alien I don't see any encounter?
 
@Jack We evolve standards so that we can assume that something will work the same across browsers. By not adhering to those standards, browser developers make it very difficult to support them all.
I don't see an issue with going above and beyond the standard specification, but we shouldn't refuse to support it.
 
10:59 AM
@Jimbo read the very first line of my question, it links to this question
 
id starting with a number is technically supported but most browsers don't.
 
@LightningDust My boss earns crores, using pure asp, he doesn't hash passwords, he doesn't use HTML5
I Am not against the standards, but sometimes we have restrictions to change stuff of old projects when working in a company
 

« first day (961 days earlier)      last day (3987 days later) »