« first day (817 days earlier)      last day (4117 days later) » 

11:00 AM
All my point was, was that, as I understand it, MVC is awesome :)
 
@Nahiyan right now I'm using Symfony 2, last project I used Slim Framework, which is basically just the Front Controller part of an MVC
@Jimbo it is, but maybe not in the way you though :P
@Jimbo what you mention are called Full Stack Frameworks, which gives you "all that"
gtg
 
@andho I see - yep it is rather a full stack one
 
ffs the Mozilla release cycle is stupid. I just came across something that I want to use the requires FF10, thought "Oh well that's very old by now, should be no problem". You know when FF10 (8 versions ago) came out? Jan 2012. :/
 
That's old
For a browser that auto-updates, why support versions more than a year old?
 
@DaveRandom Here you go, I tried to be VERY explanatory in the comment but it isn't long. pastebin.com/zyL8NriS
 
11:14 AM
0
A: PHP website design

PeeHaaMost tutorials you find on the web or for beginners or simply just bad. You're are correct when you say that you should separate logic from presentation. There are several popular pattern which you can use to do this (some do a better job than others) like a.o.: MVVM (Model-View-ViewModel) MVP...

^ cough cough
:)
 
@PeeHaa Done :)
 
@PeeHaa done too (you meant close vote right?)
 
:D
 
But yes, you clearly put some effort into the answer. RepWhoring PeeHaa again?
 
I needs gold badge :D
 
11:18 AM
@PeeHaa What are you on about? You have 8 GOLD BADGES
I need 1 :P
 
Not really repwhoring though. Because repwhoring works best in :)
@Jimbo None of which are for :(
 
@PeeHaa really? Trying to go back to your old ways I see :P
 
@Jimbo You mean you actually want to change the key and not the value? That's going to be hard, if not impossible. What you'd need to do is decide on static keys, and have the value be a vector with a 'key' member, and update that, I think. The problem is that PHP does not know which key maps to the new key, so it treats it as a totally new member. Where does the data come from? I presume they are not hard-coded arrays like that.
It would be like me saying "you can contact me, but I won't give you my address because it changes all the time". In practice, you are never going to be able to contact me.
 
@ShyamK Neh. Real repwhoring is answering without any effort
 
@PeeHaa Go through all of your high rated answers, and edit the questions to include the tag you want a badge in ;)
 
11:23 AM
@DaveRandom I thought as much, you're going to love this... EN array comes from YAML file (so it'll have English values) ;) DE array will have it's own german values - but the keys MUST stay consistent between the arrays. All array data is stored in MongoDB. The EN data is basically supposed to be the master of keys.
 
@Leigh lol. :P
 
These keys can change and be removed / deleted at any time in the EN...
How would a static set of keys work? As they can change..
 
@Jimbo Yeh I see what you are doing. OK well I would say you want to abstract this variable key business from the actual data - put the EN data into the DB with a static set of keys (so price is always price) and just store a set of mappings in the YAML (which is, for the record, a hateful structure). Then when you need the data to the have the right keys you pass them through a function that maps the static keys to the variable ones and returns the structure with the right keys.
I have to question why you feel the keys should change at all though - keys are keys, they are the things the explain where the data is. What are you actually using them for?
 
@DaveRandom The keys and values are an array representation of the YAML file. In that structure, I can call to_YAML() on the array and it'll place it back into a YAML file with the exact structure I need; kind of the core of my application. So if a Dev adds a new key to the master English language file before uploading to my application to store in Mongo, the other languages also need this key automatically.
The keys may change because the data in the YAML files are in fact used throughout the whole of our platform for displaying strings in the relevant language if the URL is /en or /de
 
hi guys, have you seen those ads about
"Reliable Memcached in a fully automated cloud service"? It's some days I'm trying to find a single reason why I should even consider a thing like that. do you think it's something that could be interesting?
 
@sathia You mean, a memcache server that's not local to your app server? seems a bit silly to me
 
there must be more, it really seem silly to me
 
Developers frequently add/modify/delete keys and values from the master en language files
 
advantage of memcache is the speed - why add internet latency to that
 
11:37 AM
no idea
 
Right, so you are talking about dynamically modifying the DB schema. In a nutshell, the DB schema should be modified explicitly, not implicitly. Imagine it were SQL - you can't just change a column name in your code and expect the DB to know which old name maps to which new name - you'd have to go and actually change the column name in the database.
 
it surely isn't a joke i constantly see their ads and someone must be using them
 
Sounds like you need a little schema management UI, I don't think files are the right way to do this.
@Leigh But it uses shards! They are the secret ingredient in web sauce. How can that not be the right way to do it?
The only thing I'm seeing with that is a massively distributed and resilient persistent storage engine. It's not necessarily a pointless service, but I think that the fact they've mentioned memcached is kind of false advertising. They are confusing functionality and implementation.
 
@DaveRandom Well it's kinda like that, except really they're just arrays. That's how the data is stored, in their exact form as n dimensional arrays. So I'm looking at it as just array changes, not database stuff - that's just.. there.
 
@Jimbo Well, if I may say, you are looking at it wrong :-P - it doesn't matter what the data structures look like, it's still just a database schema.
 
11:45 AM
Presuming you guys have used SVN :( lemme ask this... can you delete a file from a tag and then add and recommit that file alone back into the tag... Possible? I'm thinking no. Right?
 
Hey all I'm having a problem with PHP/Hidden inputs. I've asked this question on Wordpress Stack, wordpress.stackexchange.com/questions/79932/…, but I believe it isn't anything to do with WordPress and maybe more so PHP or HTML/Inputs. If you wouldn't mind could you take a quick look, you may have come across the issue before. In a nutshell the 'hidden' input isn;t being set but if I place an identical one straight after that gets set.
 
@DaveRandom You know, this thing is only the uploading of the YAML files I'm handling. The VALUES have to be modified using a nice little UI (i've done this), so really this uploading is the only thing I need. Is my code not close to what I'm after?
 
@ShyamK Doesn't that defy the point of a tag? They are to mark important points in history, you can't change history.
 
Sorry, duplicate. I guess I could just go "nope" if you change a key, it has to be changed in ALL YAML files before uploading
 
@Jimbo I don't think so, because you are treating keys as if they are values (IMO).
You can do it in YAML if you want (personally I hate it as a format) but they should contain instructions rather than mappings
 
11:51 AM
@DaveRandom @Jimbo if you're in a situation where you need to dynamically create or alter schema, you're probably using the wrong type of datastore
 
So like, a one shot upload that is interpreted as "change this key to this new name" or "add this new key in this place" etc
@Leigh +1
@OlegOrlov VPN is a wonderful thing ;-)
 
@Leigh @DaveRandom Gah, I don't want to go about Dynamic Schema stuff x[ - seeing as I've just picked up MongoDB... Gtg for a few mins - electrician doing some checks or something brb
 
@DaveRandom No wonder I failed in History... :P
Thanks :D
 
@Jimbo No no, If you want "dynamic schemas" MongoDB is a tool that is fit for purpose - since it's schemaless. I hope you have the infrastructure to support it though. I've found it not really suited to single instance configurations, or small virtual servers
 
@ShyamK It would be much easier to pass if you could change it :)
 
11:59 AM
Yup... And a lot more fun to learn...
 
Anyone have any comments on my issue. I'm really stuck and it is breaking my heart.
 
@Leigh Confusing the situation a little. He's already using Mongo due to a requirement for storing n-dimensional vector types, now he's talking about dynamically updating the structure of those types (I think based on Johnny Developer's random whim/desire to rename a path). I'm just saying that trying to use some kind of global template object to update all the rest of the object's structure is a bad plan, because it's very difficult to write code that knows what you just changed
So that if you rename something, it renames in in every object, and distinguishing between something that was renamed and a new key.
It's not dynamic schema as such, it's modifying a "schema" while it's still in the fluid (dev) stage.
@Anthony What does var_dump($mb->get_the_value()); show?
 
@DaveRandom I will check now
 
> as for some reason in Internet Explorer the value is output, but in the other browsers it isn't i.e. Chrome, Firefox and Safari.
@Anthony ^^ that is almost 100% definitely a cache issue - press ctrl + F5. The browser you use should not affect what PHP does here
unless it's somehow based on browser sniffing
 
I just did CTRL+F5, no joy
 
user1125394
12:13 PM
@Charles it seems hard or at least not natural to change strongly a language from its roots
 
@Anthony In which browser?
I suspect that what's going on there is that is really doesn't work, and IE is the one that is lying to you.
 
IE is a bigger lie than the Cake.
 
The CakeIgniter is a lie
 
Why would the same statement, repeated again straightafter, work?
Var Dump: string(32) "2013-01-18,2013-01-23,2013-01-24"
 
12:15 PM
The jCakeIgniter is the real lie.
@Anthony Well I have to be honest I suspect wordpress, but that kind of "one minute it works, next it doesn't" bug can be hard to track down. What if you put the var dump before?
 
@DaveRandom I did put it before :(
 
@Anthony And yet it still doesn't work when you do that? What if you do:
 
user652649
someone understands why abstract static methods are still not available in php, since now php supports static inheritance (LSB) ?
 
Hey, does anyone knows why my sql query skips results?
 
    <?php

        //  Get the field: on_the_map
        $mb->the_field('date_calendar_item_not_available');
        $value = $mb->get_the_value();
        var_dump($value);

    ?>
    <input type="hidden" id="date_calendar_item_not_available" value="<?php echo ($value != '' && $value != 'NONE') ? $value : 'NONE'; ?>" name="<?php $mb->the_name(); ?>">
    <?php

           var_dump($value);

    ?>
wat
fixed font not working right :-(
@Anthony ^^ try that
 
12:20 PM
i'll try that, one sec
 
user652649
@user1914940 maybe you are fetching row twice
 
Actually @Anthony the && $value != 'NONE' check is pointless, the result would be the same without it.
 
user652649
get_the_value() the_field() i love wordpress lol
 
The initial value could be '', where as I set 'NONE' there after
 
@Anthony Yes but if the value already is NONE you can just echo it anyway. You just need to check that it isn't empty.
 
12:23 PM
WPAlchemy doesn't initiasie all fields, only those that are stored i.e. it doesn't enter blank field into META, it makes it harder to modify from teh frontend since it relies on another array key
Ill try that anyway
 
@DaveRandom Nope, only once..

$query = "SELECT * FROM complaints";
$queryRun = mysql_query($query);
$array = mysql_fetch_assoc($queryRun);
$numRows = mysql_num_rows($queryRun);

$solved = mysql_query("SELECT * FROM complaints WHERE solved = 1");
$numNows2 = mysql_num_rows($solved);

$noSolved = mysql_query("SELECT * FROM complaints WHERE solved = 0");
$numNows3 = mysql_num_rows($noSolved);


echo 'number of complaints: '.$numRows.'<br />';
echo 'solved complaints: '.$numNows2.'<br />';
echo 'non solved complaints: '.$numNows3.'<br />';
 
@user1914940 You fetched the first row and the top and didn't do anything with it. Remove the first $array = mysql_fetch_assoc($queryRun); line.
 
@user1914940 you shouls use count(); instead of two queries
 
^^ and that
 
@DaveRandom Ohh thanks, it works :D
 
12:26 PM
Also, obligatory:
Please, don't use mysql_* functions in new code. They are no longer maintained and are officially deprecated. See the red box? Learn about prepared statements instead, and use PDO or MySQLi - this article will help you decide which. If you choose PDO, here is a good tutorial.
 
Yep I know, will be looking at that :)
 
Heyho, all our computers have "passed" for the law. Great.
 
PAT testing as a lie.
Completely useless certificate, does not tell you anything at all.
Electrical safety my arse.
3
You want safe electricity, furnish your room with rubber furniture.
 
@DaveRandom It's really strange, its something to do with the input itself. To implify, if I do this:

<input type="hidden" value="1" name="test">
<input type="hidden" id="date_calendar_item_provisionally_booked" value="<?php echo $value; ?>" name="<?php $mb->the_name(); ?>">

It works, but if I do this:

<!--<input type="hidden" value="1" name="test">-->
<input type="hidden" id="date_calendar_item_provisionally_booked" value="<?php echo $value; ?>" name="<?php $mb->the_name(); ?>">
It doesn't
 
wat
that makes no sense :-P
 
12:30 PM
Could it be something to do with the name? _WPAlchemy_Suppliers_Supplier_Details[date_calendar_item_provisionally_booked]
@DaveRandom Believe me, such is why I want to bang my head against the wall
 
@DaveRandom Hey, could you please tell me how can I echo results from table inside html table so it looks better? I would remove table borders so just background color
 
@Anthony seriously clutching at straws here, The only thing I can think of is that there is some non-printable character in the source that's screwing with the interpreter, although I'd have though that would cause a parse error (I have seen parse errors from copypasta where people accidentally copied ASCII non-breaking space 0xA0 into their source before). Try deleting the line and typing it out again.
 
@DaveRandom We may have a winner! One last check
 
@user1914940 Well first concentrate on just generating a table structure - forget about styling it until you have the structure right. It's quite simple - you output <table> before the loop, then you output <tr> at the head of the loop, then you loop over the row (foreach is the easiest way in that case) and output <td>$value</td>, then output </tr> at the end of the loop, and then output </table> after it. Have a go yourself and feel free to come back here (with code) if you get stuck.
 
@DaveRandom Nope but...
 
12:37 PM
Difference between mysql_fetch_array and mysql_fetch_row and mysql_fetch_assoc with examples?
 
@Ritesh ...is quite clearly explained in the manual. What do you have a problem with?
 
@DaveRandom It is to do with the name, I set it to 'test' and it output... So what is wrong with _WPAlchemy_Suppliers_Supplier_Details[date_calendar_item_provisionally_booked] ?
Too long?
 
wat.
@Anthony Not aware of a limit but possible
 
@DaveRandom My head is blown...
 
user652649
fetch_array is the index of the column in the record if you have two column in your record you will have column 0 and column 1, without name
 
user652649
12:40 PM
fetch_assoc you will have the name of the column $row['columname']
 
user652649
fetch_object as object $row->columname
 
@DaveRandom No limit it seems, stackoverflow.com/questions/1496096/…, a user but a string of 10 mil chars and worked fine.
 
user652649
fetch_row you will have both numeric and associative array
 
@DaveRandom Thanks, I already got stuck :S I get no result at all..

<table>
while( $array = mysql_fetch_assoc($queryRun) ) {
<tr>
<td>echo $id = $array['id'].'<br />';</td>
</tr>
}
</table>
 
user652649
12:41 PM
in most cases you should use assoc or object
 
user652649
fetch_array is useful when you don't want to specify aliases for columns with the same name
 
@user1914940 You have to use PHP <?php ?> tags to flick in and out of PHP/HTML like that, what you have there is a syntax error.
You have the right idea though
 
Ohh sure, sorry. Let me coorect
 
user652649
@DaveRandom are you payed for helping people here?
 
@wes No I'm waiting for a backup disk to rebuild, can't really do anything til it's done.
 
user652649
12:44 PM
i hope they say thank to you, at least
 
user652649
i admire your persistence and patience, really
 
@DaveRandom As do I :P
 
Meh, I remember what it was like to have these problems, I had much help from others, it's only fair that I give something back :-)
 
Often it helps to knock ideas off someone else as they most likely will either solve the issue or give you the idea to resolve the issue.
 
@DaveRandom Well that doesnt works either..

<table><?php
while( $array = mysql_fetch_assoc($queryRun) ) {
	?><tr>
	<td><?php echo $id = $array['id'].'<br />';?></td><?php
	echo $solved = $array['solved'].'<br />';
	?></tr><?php
}?>
</table>
 
user652649
12:47 PM
i like helping people too, but here you are teaching the basics
 
@DaveRandom Progress, kind of... I moved this code above output I know works:

<?php

// Get the field: on_the_map
//$mb->the_field('date_calendar_item_provisionally_booked');

$mb->the_field('date_calendar_item_provisionally_booked');

$value = $mb->get_the_value();
var_dump($value);
?>
<input type="hidden" id="" value="<?php echo $value; ?>" name="<?php $mb->the_name(); ?>">

And it worked...
 
user652649
when i started with php, the only answer that i could get was "RTFM"
 
@user1914940 I think if you change the first line to ?><table><?php it will work. You are still in a PHP code block at the start I think.
 
Ohh sorry, I do have it 1 line above :)

?>
<table><?php
while( $array = mysql_fetch_assoc($queryRun) ) {
 
@Anthony I don't really see the difference :S
 
12:51 PM
There is no difference. I'm not thinking maybe an issue in the code somewhere - but no errors. Though it doesn't make any sense as where the code was, above and below, similar items were working fine.
 
@user1914940 Can you show the full code on a pastebin? Also, do you get any errors? If you are getting the white screen of death (nothing displayed at all) you need to turn your error reporting on in php.ini
 
@DaveRandom It's a WTF moment I think!
 
user652649
@user1914940 also display_errors
 
@Anthony Very much so
@wes Indeed, I was going to elaborate on that point depending on what the response was :-P
@Anthony Wait hang on, it now has an empty id? What if you put that string back in there, does it break again?
 
@DaveRandom One sec
 
12:55 PM
@DaveRandom Ok, here it is pastebin.com/3Y3qDTDK
 
user652649
@user1914940 a <td> is missing
 
@DaveRandom All good, that is above working code:

<input id="dateCalendar_provisionally_booked_ID" type="hidden" name="_WPAlchemy_Suppliers_Supplier_Details[date_calendar_item_provisionally_booked]" value="2013-01-18,2013-01-23,2013-01-24">
 
user652649
 
@wes Ohh yes, it still doesnt works :S
 
SELECT ( SELECT COUNT(0) FROM complaints ) AS totalComplaints, ( SELECT COUNT(0) FROM complaints WHERE solved = 1 ) AS solvedComplaints, ( SELECT COUNT(0) FROM complaints WHERE solved = 0 ) AS unsolvedComplaints;
 
user652649
12:58 PM
@user1914940 pastebin.com/aLJJX8LR here it is
 
@wes You commented out a ?> :-P
 
user652649
@DaveRandom i'm not sure but // hello ?> will work anyway
 
@NiekBergman Indeed, although the first num_rows() is harmless since you are using the data anyway. Also: baby steps :-P
 
user652649
even if it seems to be commented
 
Works, thanks :)
 
1:01 PM
@DaveRandom In selectable inputs, ie. Select and Checkbox etc.. Does the 'Selected' have to be written as selected="selected" or is selected simply of
*ok
 
@DaveRandom: Ah, yes, didn't see the data was actually used below. I need Mate :-)
 
user652649
@DaveRandom yes it works! // commented ?>
 
user652649
just tried xD
 
@wes @user1914940 Much as I hate it, this syntax is probably cleaner in that situation.
 
@Anthony i don't know about HTML5 but it was officially selected="selected" before that, though different browsers allowed different syntaxes.
 
user652649
1:03 PM
i hate that syntax! lol
 
@Anthony Depends on the doctype. XHTML requires selected="selected", HTML will accept either.
 
I wonder
 
Actually, regardless, any sane browser will accept either. But in XHTML the correct syntax is selected="selected"
 
@DaveRandom i think sane browser is an oxymoron
 
True that
 
1:06 PM
i wonder is the only advantage to HTML+CSS+JS is being cross platform, or does it make it really easy to come up with awesome looking apps
i have never worked with a desktop widget toolkit so couldn't say
not a fan of dojo toolkit though
 
@DaveRandom I 'deleted' all white space above that code and it now works, sigh!
 
lol
I really have no idea what's really going on when that sort of thing happens, but I have seen similar wtfs before
 
user652649
@DaveRandom would have been nicer if they had allowed boolean attributes in XML......
 
Seriously though... I spent a day trying to figure this out
I will know in future, thanks for your help... you got me to this conclusion, I wouldn't of thought about it myself.
 
user652649
not the whole total random that we have today selected="true" selected="selected" selected="null" selected="false"
 
1:12 PM
if the id attribute of the form does not exists ,tidy create a id attribute with name same as form name,can we stop this behavior of tidy?
 
user652649
@Tarun yes without using tidy xD
 
@Anthony np
 
user652649
@Tarun how are you using tidy?
 
i am passing a html string consisting of form to a tidy.
$arrOfconfig	=   array(                    'indent'            =>  true,
							'wrap'                  =>  400,
							'char-encoding'         =>  'utf8',
							'output-xhtml'          =>  true,
							'show-body-only'        =>  true,
							'doctype'               => 'strict',
							'clean'                 => false,
							'fix-bad-comments'      => true,
							'fix-backslash'         => true,
							'quote-ampersand'       => false,
							'quote-marks'           => false,
							'quote-nbsp'            => true,
 
user652649
@Tarun tidy sucks... better you use www.php.net/dom using repair
 
user652649
1:17 PM
@Tarun why you need to tidy a form?
 
@wes thanks for your suggestion i am using tidy to clear a html string consisting of a form
 
@DaveRandom One last query I have, maybe you know? Is there a tool to reverse a minified JavaScript file
 
user652649
@Tarun why do you need to tidy a form?
 
@wes I need to get some other nodes as well except form node from html document so i though to clear/repair html document first with tidy extension.
 
@Anthony No. You can prettify it (will find link in a minute) but you'll never be able to get the original variable/function etc name back
 
user652649
1:23 PM
@Tarun so you can use DOM using loadHTML for example
 
user652649
@DaveRandom are you from UK?
 
@wes I am indeed
@Anthony That will sort out the indentation etc
 
@wes loadHTML does repair/clean html?
 
@DaveRandom Thanks again
 
user652649
1:25 PM
ok... how is my english? @DaveRandom is that bad? lol... it must be terrible
 
user652649
@Tarun yes
 
No it's fine. It certainly puts my (non-existent) Italian to shame.
 
@wes excelente
 
I live in Uk and my English is not so good as I want. :))
 
user652649
lol I don't believe you... my english fine? lol
 
1:27 PM
"as* good as I want" ;)
@wes it's obvious you're trolling now
 
user652649
btw where in uk if i can ask?
 
@andho thanks
 
@Leigh Nice trick. Does it work?
 
user652649
@andho i'm not trolling because i always have difficulties when i'm writing in english... and i hate that! damned place where i'm born in to. i wish i had been born in uk or usa only because of the language
 
user652649
... mhhh no usa no... australia better
 
1:32 PM
@wes aye mate
 
@wes how many languages do you know?
 
user652649
php html js.. a little of italian and a bit of english
 
user652649
lol
 
lol
 
@wes a little of italian? hehe, what's your mother toungue then?
 
user652649
1:35 PM
lol.. italian... was a joke
 
@wes italian was the first language I wanted to learn, but now more interested in japanese and french.
 
@shiplu.mokadd.im No idea - wouldn't like to be caught testing :)
 
Spanish is one of the easiest foreign languages to learn..
 
@Leigh You could ask in MSO
 
@shiplu.mokadd.im if the tag was actually relevant to the question, you're actually improving the site too
 
user652649
1:39 PM
when i will have time, i will re-learn english and possibly chinese because of its diffusion
 
does it become difficult to integrate lots of symfony 2 bundles together
 
user652649
/me is still fighting against paypal
 
1:55 PM
@all Hi
 
@Alex_ios hi
 
@andho How are you doing?
 
@Alex_ios I'm fine thank you. How are you?
 
@andho I am good. Thank you.
 
1:57 PM
@Alex_ios What brings you here today, good sir?
 
@andho Of course I am learning php. So that brings me over here ;) what is that sir? didn't get it.
 
@Alex_ios sir (Noun): Used as a polite or respectful way of addressing a man, esp. one in a position of authority: "excuse me, sir".
 
@andho I am not in a position of authority and I wonder what feature from my side made you feel like that? If you respect everyone like this, then I would have to use it for you too as per quote "Give respect and take respect". ;)
sir.
 
@Alex_ios I just use it normally in greetings.
 
Okay. Good habit and I like politeness in others. :) What else? How is your work.
@andho
 
2:12 PM
I have a quick question why sorting of this array using arsort comes like this
http://codepad.org/IPJcoBp3
It must be like this
`[2] => 55*Harry Potter and the Prisoner of Azkaban
[3] => 27*Harry Potter and the Goblet of Fire`
[0] => 9*Harry Potter and the Philosopher&#039;s Stone
[6] => 9*Harry Potter and the Deathly Hallows Part 1`
some one clear it
 
@BasicBridge No, read php.net/arsort - why you want to do is probably called natural order, maybe it works: php.net/natsort - you might need to reverse the result then, see php.net/arrays
hmm, why doesn't the php.net shortcut /arrays doesn't go to the list of array functions any longer?
 
@Anthony Use Chromes developer tools and click on {} (pretty print)
 
@hakre thanks so much this seem to be working. great help
 
@BasicBridge consider that PHP looks at the bytes for the arsort function, not at numbers that you see (as a human).
 
CvPlsHelper.chrome.ModuleLoader.prototype.loadModule(moduleName) {
  var i, originalCtor, newCtor, args = [];

  if (CvPlsHelper.chrome[moduleName] === undefined) {
    throw new Error('The specified module ('+moduleName+') could not be found, it may not be supported on this platform');
  }

  // This is a bit of an ugly hack, but it avoids an flawed O(n) operation because we
  // don't know the number of arguments. The alternative is a switch/if-else tree.
  originalCtor = CvPlsHelper.chrome[moduleName];
 
2:17 PM
@BasicBridge I think @hakre is right about using natural sort
 
Javascript makes me hate myself sometimes.
 
@DaveRandom Instead of hating yourself hate the broken thing that is called javascript :)
 
@DaveRandom why don't you pass arguments directly? or what that is there?
 
@hakre Because it will have the module name as the first argument, also, as it turns out, it doesn't have Array in it's prototype so you can't .shift() it, and apply() doesn't play nice if the passed object is not 0-indexed.
Plus FF (incorrectly) borks at delete obj[index]; in strict mode
 
now, as you were too lazy to close the question, here is an answer ;)
0
A: PHP - Create xml files by DOM and download them as zip archive

hakreBasically its done in the two steps, Create xml files dynamically (stock.xml, bills.xml, orders.xml). Use DOMDocument and its done. Retrieve these files and store them as ZipArchive. Transaction.zip (will contain stock.xml, bills.xml, orders.xml)

 
2:23 PM
@hakre I'm sorry, I can't bring myself to upvote that. Voting to close the Q, that's the only right course of action.
 
@DaveRandom Please close vote, yes. I just wanted to gather more attention.
 
lol
 
user652649
@PeeHaa javascript rocks
 
No, it really doesn't. Some of the stuff you can do with it rocks, but the language implementation is really bizarre and quite hateful.
 
@wes What that british guy above me said
 
2:25 PM
javascript is flexible as hell, but even more grotesque than php
 
user652649
php is a total random, it can't be even compared to javascript
 
@DaveRandom I have a love/hate relationship with it myself. It can do some really awesome things and it's just so damn flexible that you can add just about all it misses. But it misses those things in the first place and it can be such a pain to write code in it from time to time
Just wondering: What do people around do their php development in around here?
 
@DaveRandom yes, please delete. The answer is hilarious.
 
good morning :)
 
2:30 PM
@igorw very good morning Sir!
 
user652649
damn keyboard... @igorw good afternoon
 
@Jasper Netbeans FTW :)
 
@Jasper I flick between EditPad Pro and Notepad++ when they piss me off periodically. I know a few people here sing the praises of PHPStorm, I've never got along with PHP IDEs personally.
 
@DaveRandom heya, got a stream_socket_client question for you. when using the STREAM_CLIENT_ASYNC_CONNECT flag, is there any sane way to get errors if the connect(2) fails?
 
@DaveRandom Has good JS support, too ;)
oh wonderful, now even getting downvotes. hrrgh, ca m'est egale. I take that with honors ;)
 
user652649
2:32 PM
in what way notepad++ piss you off @DaveRandom lol ?
 
@wes notephp++ is better and the names are so close, that he is remembered all the time about that.
 
@Jasper I've recently moved over to phpstorm and the more I get to know it, the better it gets. Netbeans takes some beating for the price though.
 
@igorw Appears in $e in the stream select when it times out, what happens when you get a RST depends of platform (windows and BSD it appears in $e, certainly fedora so presumably generally *nix it appears in $r and it's feof()). To get the actual error code though you need to socket_import_stream(), which is why I created that bug report, because ext/sockets is not available everywhere.
stupid markdown
 
user652649
@vascowhite isn't netbeans free?
 
@wes Yes, that's what I meant ;)
 
2:36 PM
I'm using notepad++ myself without a local php install (using a ftp to a server instead - yeah, I know). Now that I think I might need a local php install (for xdebug/PHPUnit) I feel I might as well start booting into linux and install it there. Just need to decide what I'll use there as there is no Notepad++
 
@wes Oh just occasionally bits of the UI design annoy me, things are in odd places. Also EPP has serious regex capabilities, like you just don't get in anything else I've ever seen. But in EPP it is way too easy to accidentally close things, and there's a bug present in all versions I've ever used whereby at random when you startup from standby the toolbars don't render and there's no way to get them back.
 
user652649
no one here uses eclipse?
 
@Jasper I use phpstorm on windows and linux, it works and looks the same on both. I think the same is true of netbeans too.
@wes, I have done for java, but didn't like it for PHP
 
@wes Only because I'm forced to for Android stuff
 
@Jasper PHP on Win is not bad for dev, there are very few cross platform compat issues with the things you actually use on a daily basis.
 
user652649
2:39 PM
i will try netbeans... in past eclipse pdt was better compared to netbeans
 
@wes For PHP development, really try PHPStorm
 
@DaveRandom Hi!
 
user652649
but now it isn't really supported anymore...
 
What isn't?
@Alex_ios hey
 
@DaveRandom How are you doing?
 
user652649
2:40 PM
eclipse pdt... it is nearly dead... i filed bugs years ago, they never read them lol
 
Oh, not bad. Needs MOAR sleep.
 
@wes I like eclipse PDT better, but it's easier to integrate xdebug with netbeans
 
But I am using eclipse pdt only now.
 
@wes yeah, it's not being developed anymore as they could not keep up with the other plugins
 
The same to me lol.. @DaveRandom
 
2:43 PM
@DaveRandom It's not that I don't feel I can't use windows for it, I just want to take this as an opportunity to finally start using linux (at home) more. Just yesterday I was using non-git stuff in msys-git just because the task I set out was easier to accomplish using the very limited set of unix tools it bundles than to use something on windows
 
Can you guys look at the marked answer? I am thinking to implement that in my situation. Is it okay? @DaveRandom @andho
@Jasper
 
@Alex_ios link?
 
@Alex_ios what answer? oh okay
 
@Alex_ios please don't ping everyone for stuff like that, it can get quite annoying ;-)
 
2:45 PM
Okay. But I am just pinging those who I know already. Not everyone. Right? Anyways I wouldn't in future.
 
@Alex_ios Yes. If you are using transactions, that is the basic structure for the way you would implement them.
 
user652649
currently i use eclipse pdt only when i'm devloping in php only, because working on templates (html+php) it is simply impossible... the damn eclipse thinks to be smart when is completing my html for me... but it does that in the silliest way... as i said previously today... then.. how is the templating with phpstorm and netbeans?
 
Obviously you have to ensure that the DB driver will throw exceptions on error though
(is that how MySQLi works anyway? Not used it for ages, can't remember)
 
@DaveRandom But do you remember my code? I haven't used msqli in my code. You have seen this morning.
 
@Jasper Well I can't fault you for that. Can't you boot the linux in a VM though? That way you could use the Windows GUI to run your tool of choice and just work in a network drive mapped to a samba share on the *nix box.
 
2:47 PM
basically for that question, putting a START TRANSACTION in a header file would answer the question
but the accepted answer is the way to go
 
@Alex_ios Not really :S one sec let me find it in transcript
 
@DaveRandom thanks, I guess it's time to figure out how to do that in libev then. also, it looks like there is a new libev extension: pecl.php.net/package/ev
 
@DaveRandom Okay. I would also search for it.
 
@DaveRandom By default it does not throw exceptions. This can be done, but it is not widely known. One major point people throw at MySQLi is that it doesn't throw exceptions, but in reality it can.
 
@andho Even you will get idea by looking at my code.
 
2:50 PM
@Alex_ios where is teh codez
 
@Alex_ios Oh OK you're using ext/mysql, that kind of make it a little more difficult because if won't throw exceptions, you'd have to throw them yourself
stupid keyboard
@andho This is from yesterday, dunno what it looks like now: pastie.org/5654732
brb smoke
 
@wes Eh, I've had no trouble in either of them.
 
user652649
@LeviMorrison thanks, i will try
 
@DaveRandom If I use mysqli, would it throw exceptions by itself like in java? Because I am familiar with java but not much on php.
 
user652649
there was another cool ide for php... mmmmmmmh aptana? was pretty decent
 
user652649
2:56 PM
nobody had ever tried it?
 
I use notepad++ pretty exclusively
 
@wes worked with it until I found storm
 
http://hasin.me/2013/01/10/how-to-add-custom-meta-boxes-in-wordpress/
Planet PHP
how to add custom meta boxes in wordpress
Hasin Hayder
1357828200
 
user652649
what about svn/git integration in storm and netbeans?
 
What about the next answer that is there after the ticked answer which is given by the OP itself? It doesn't use mysqli. Can I follow that approach? @DaveRandom
 
user652649
2:59 PM
btw thanks guys this evening when at home i will try them both
 
@Alex_ios I'm not all that familiar with MySQLi (I use PDO) but looking at the docs/google I don't think so. There is a mysqli_exception class but nothing seems to throw it and there doesn't seem to be a way to control this. Yet another reason why PDO is better :-P
 
typical case of blood in the stomach not in the brain: just wondering for 10 minutes why the hell the constructor is not called. then seeing function is named __create not __construct :/
 

« first day (817 days earlier)      last day (4117 days later) »