« first day (713 days earlier)      last day (4235 days later) » 

4:00 PM
Just wrote nice validation class =)
$val->setRules('email', 'Please Enter your email', array('validEmail', 'required'));
 
@matt Is the problem that they all go to the same URL?
 
@hakra Thanks, that did it.
 
@Stephane it knows where autoloader lives , because it gets manually included : github.com/fuel/fuel/blob/1.3/master/fuel/app/bootstrap.php#L4
 
4:07 PM
@tereško Thank you. I was looking at core/bootstrap instead of app/bootstrap. I appreciate your looking into it.
 
user1125394
$ oil create blog
 
@cyril it's CodeIgniter with namespaces .. what else did you expect ?
 
:5554083 I'm trying to learn how mvc works (or whatever a stateless mvc is called) and I was hoping to dig through a few frameworks to learn.
 
heh
 
@DaveRa
@DaveRandom yes I need them to be 3 links
 
4:11 PM
@matt Well, they are 3 links, they just all point to the same URL. Because you hard-coded the URL in the loop. Where are you getting the data from for the URLs?
 
@Stephane most of popular php frameworks will be just Ruby on Rails clones .. with varying degree of success
 
(it might be gone dependent on the next message...)
 
Hmm is there anything with that? if ($arr = explode('=', $rule)) { }
 
user1125394
@tereško I'm not a mvc expert at all, just aking fuel is not a bad one, no?
 
There is no place to enter the URL thats the problem so I hard-coded it.
@daverandom if you can help me set a url for each that would be great
 
4:12 PM
the pattern they implement is orm-template-something
 
user1125394
k
 
@cyril , what did you mean ?
 
@matt Right, well what does $services contain? Where does the data come from?
 
the wordpress back end, there is a spot for Title, Image and Description, no link.
@DaveRandom even if we can add a link field that might be the best route.
 
@matt Oh right, Wordpress. Well, to be honest your probably in the wrong place for WP help, I doubt anyone in here really knows it because we are all "proper" PHP devs
^^ that's where you want to be
 
4:16 PM
Good afternoon
 
(no offence intended with the "proper" PHP devs comment BTW)
Well, maybe a little
 
@daverandom Ok lol, well do you see anyway to even hard-code in 3 links?
 
Why this wont work? if ($arr = explode('=', $rule)) { $param = $arr[1]; }
Odd
 
There is not much help over there its prety quiet.
 
@I'll-Be-Back Without more context it's basically impossible to say. It will work, just may not be what you want to do.
@matt Well it's only those three and will only ever be those three, you can just have an array of say, link title -> url translations
 
4:20 PM
From what I understand if it can be exploded then return into $arr which become array
 
@matt: you need to write yourself a little plugin that offers the input fields and then the page template renders based on the input values.
 
@I'll-Be-Back What is "it"? What does $rule contain?
 
@DaveRandom thats what I was thinking, but im a newb to this, any chance you can help me out?
 
$rule can be exactLengt=5 for example
 
Quick trivia: can `$this instanceof self` ever be false when `$this` is an object?
@ircmaxell Yes. My reasoning is that you wouldn't ask this otherwise.
 
4:21 PM
@tereško I'm not looking for an autobuild framework. I'm looking for insight into how controllers delegate and how models work together even if they pull from the same set of data.
 
$rule also might contain without =
 
@matt Well, firstly let me tell you in English how to do it, you can then go an try and implement my explanation in code, and if you can't get it working we'll look at where your implementation is wrong, that sound acceptable to you? We don't like to write code for people but we're generally happy to help them learn for themselves, if they are open to it.
 
@DaveRandom sounds good.
 
@I'll-Be-Back You may use forgotten strtok
 
@matt OK, well to start you need a basic understanding of how an associative array works (associative means it has strings for keys instead of integers) - would you say you know how this to a basic level?
 
4:24 PM
@Robik No. php.net/manual/en/function.explode.php If delimiter is an empty string (""), explode() will return FALSE. If delimiter contains a value that is not contained in string and a negative limit is used, then an empty array will be returned, otherwise an array containing string will be returned.
 
Okay then.
 
user1125394
@tereško sorry I mean is it a flexible one, I'd be interested to use some frameworks with nosql databases, and an external database library, with fuel it would consist to have another docs.fuelphp.com/classes/database/dbutil.html
 
Ahhh I know why.
 
@ircmaxell yes, because self != static
 
user1125394
hmm I will try to look why people choose this MIT license
 
4:27 PM
@DaveRandom i know of it but to be honest I havent had a chance to learn yet.
I plan to learn over this winter.
 
@Gordon and $this must not be self.
 
@hakra at least in theory :/ codepad.viper-7.com/Lfg6Oy
although, let me reconsider. B is an instance of A, so no, it shouldnt ever be false
 
@matt OK well it's not hard to be honest. Just imagine you have a pile of books with plain covers and no writing on. If you were trying to explain to someone which book you wanted, you'd need to say "I want the third one from the top" or something like that. This is basically an indexed array (one with integer keys).
 
@ircmaxell did you find a case where it isnt?
 
@matt But if you write a label on it, you can say "I want the one labelled Chickens", and it would be easier for them to get a visual handle on the one you wanted. This is an associative array.
 
@daverandom ok following you.
 
@matt So to put that in real terms for what you are trying to do here, what you want to do is make the "labels" on your "books" the title of the service (the one you set in WP) and the "content" of the "book" can be the URL.
 
so I need to create an indexed array
 
@hakra mhmmm
 
@daverandom ok
 
4:35 PM
@matt The basic syntax for this would be array('title' => 'content');
 
@Gordon don't we love PHP backwards compat ;)
 
@daverandom ok so whats next
I dont know what 'title' is
 
So firstly you create your array: $urls = array('title1' => 'url1', 'title2' => 'url2', ... <until you have all your titles>);
This sort of thing is known as a "map"
@matt The title is the same thing you set in wordpress back end for each service
and the URL is the corresponding destination for the link
 
@daverandom gotcha
 
@matt You need to make sure you create the array before the start of the loop
 
4:39 PM
@Gordon Of course
 
ok
so I have: $urls = array('title1' => 'url1', 'title2' => 'url2', 'title3' => 'url3')
 
@ircmaxell apart from LSB?
cuz $this inside static scope is fubar anyway
 
@matt Yep, do you want to update the fiddle so we can see where we're up to as we're going along?
 
@daverandom so before the loop is before:
<?php echo $service['title']; ?>
 
4:41 PM
@matt The start of the loop is foreach
 
@daverandom ok not quite there:
<?php $services = $data['home_services'];
$urls = array('title1' => '/gallery', 'title2' => '/classes', 'title3' => '/contact')
foreach ($services as $service) { ?>
 
Hey guys I just have a quick question. Anyone got a minute?
 
@ircmaxell that one we had already but wondering if there is something else.
 
@matt That looks good - I'm assuming you have used the actual titles instead of title1, title2 etc?
 
the titles I entered into the back end correct?
 
@daverandom here is what I have: $urls = array('Designs' => '/gallery', 'Skanda Classes' => '/classes', 'New Products' => '/contact')
 
@matt Bang on, doing well
So now we just need to tie the loop up with that data.
 
@ircmaxell bindto I would consider cheating in this context, but overwriting through parameter is nice. - oh it's static.
 
@daverandom ok thanks so whats next
 
4:46 PM
@ircmaxell that $this instanceof self thing is sooooo old...
 
You see how in the loop you've got echo $service['title'];? Well, just try changing that to echo $urls[$service['title']]; and see what happens
 
@NikiC sure it is. But so many people have no idea about it
 
Hopefully you should be able to work out at least where we're going with it
 
@NikiC +1
 
4:47 PM
@matt OK you're missing a semi-colon of the end of the $urls = array(... line
 
@daverandom ok
@daverandom ok that changed my titles to my link locations
 
@matt Yep, so can you work out where we're going? You just need to echo the links paths into the href attribute of the links, instead of into the title box. I just did that so you'd get a visual of what was going to happen, and how to use the $urls array
 
Does anyone know how I could check if a php script was called from a form submission -- more specifically if it was called from a POST
 
@daverandom ill take a peek
 
@NikiC ah cool. :)
Can we get trats at runtime like $o = new Foo() use Traits; some day?
 
4:51 PM
@daverandom I dont see any herf parts though :S
 
@matt No, you seem to have removed the <a> elements since you first posted the link - you need to put them back because that's what the links are
 
Ooooooh ok
@daverandom ok.
 
@matt Right, so now all you need to do is echo $urls[$service['title']]; into the href of the <a>, instead of that hard coded link.
 
@daverandom ok now my titles disapeared.
 
Yes, so I see - can you create a new fiddle of your current code?
 
5:00 PM
yees
@daverandom jsfiddle.net/YaJae
 
@matt You're going to kick yourself. You forgot a crucial word, I'll give you a clue, it's what happens when you make a loud noise in a canyon.
 
loud noise in a crayon?
 
@matt lol. echo
 
so when is echo used?
@daverandom links are workign but titles are still wrong.
i added echo to both instances.
 
@matt When ever you want to output something. If I just put $variable; on a line it doesn't mean anything, if I put echo $variable; it means "send the contents of this variable as a string"
 
5:06 PM
Ok
So now I need to tell it where to get the proper titles?
as its still pulling in the link names
 
@matt Yes, your titles should just be echo $service['title'];, because you want to output that directly instead of using it as a key to lookup the URL
Whereas the href should be echo $urls[$service['title']];
Understand?
 
Yes
I think I got it
its working ill fiddle it
now I know there is a php code to get the current directory of the file, rathe then linking with a complete URL incase you move the site
 
@matt You are already effectively doing that, because you specified a path relative to root and not an absolute path
 
ok but issue is when I link /services
it takes off my other subfolder.
mydomian.com/subfolder/services
it just goes to mydomain.com/services
 
since when does sourcemaking.com/design_patterns/iterator have php code examples?
 
5:12 PM
@daverandom thanks for your help, its OK i can leave it as is and not worry about the URL issue just directly link it
 
@matt No worries
 
@hakra Is that a good sign?
 
@NikiC generally I'd say yes.
 
Nice to learn a bit too :)
Thank you.
Really appreciate that.
 
:-)
Can someone please go and post a message, any message in the sandbox (or here, don't really care), then edit it. Thankyou.
 
5:18 PM
bar
is that good?
 
Nice one, cheers
 
user1125394
is there a point to specify html and css in your CV, it's really common, can just put javascript, no?
 
@cyril Yes, yes, there is. It looks fuller :P
 
user1125394
jQuery ;)
 
Like, hey, I know PHP, HTML, CSS, JS, XML, XSLT, JSON, C++, C :P
Oh, and better even mention Ajax extra :D
And jQuery, yes, very important :D
 
5:22 PM
@cyril do you really know HTML and CSS ?
do you understand code semantics ? is your HTML and CSS valid by default ?
 
user1125394
JSON ... you are kidding
 
@cyril yes, I am ;)
I thought that was clear ^^
 
@cyril just put RFC numbers in
 
user1125394
@tereško I understand what is xml, html is xml + shemas
 
And if you want to make @tereško cry, write down that you know MVC :D
@cyril HTML is not XML based.
 
5:24 PM
.. you just proved , that you have no clue about HTML
 
user1125394
ok ok
 
@NikiC but both XML and HTML are SGML based. The common ancestor is there.
 
It was SGML based, but it's not even that since HTML5
 
user1125394
/me not put it n the CV, actually it's better I don't want to do that
 
@hakra Haven't they abandoned the idea the HTML is SGML based in HTML5? I'm not sure in what way that is true (or even if it is true) I'm just sure I read it somewhere
 
5:26 PM
@hakra "my ancestors were no chimps"
 
@DaveRandom Yes.
 
@DaveRandom The history of HTML5 is shaky. As HTML5 has an XML representation, too, you can not clearly state that it was dropped. For the HTML part they feel a bit inflexible about it I'd say.
 
user1125394
there should be a JSONHTML
 
@tereško I like it when you make jokes about my superb english ^^
 
@cyril Whaaaaatt ???
 
5:31 PM
@hakra , it was more aimed at the "evolution is just a theory" thing that i watched on youtobe today
 
user1125394
@DaveRandom {'script':['app.js'], 'body':'hello world'}
 
but it seemed related to "HTML is XML" subject
.. same mindset
 
well those two have influenced each other over the years.
 
sup peeps
 
5:37 PM
Good afternoon all, So I have a question. I have a list that is populated by mysql database and once you click view, it execute, but takes a little bit of time. How do I increase the time of process? This is drawing about 120 columns in database.
 
@DavidBiga Look if you have calls to sleep and remove any of those.
 
@DavidBiga 120???
 
120 people with data for each one
 
only allow lists with 10 people, that should speed it up.
 
oh you mean rows then, not columns
 
5:45 PM
@hakra I made sure and no, none
Yes sorry, This is going to have thousands.
 
Are you using mysql?
 
Yes. PDO to call everything in.
 
ugh I hate PHP sometimes
 
@hakra I can put a live code of I am doing if you like.
 
you need to use the LOAD DATA INFILE query and pass the file to the server.
 
5:47 PM
@hakra Do you have any examples?
 
can you read?
 
I believe so.
 
oh sure yes, it's chat, I guess you can read.
it's in the manual, you can just look it up.
 
Okay thanks, anything else you recommend?
 
call your DBA.
 
5:49 PM
Win Host is great :)
 
@hakra lol
 
@hakra Hakra I was reading and it tells me that it reads from a text file? But I am not using a text file.
 
@DavidBiga then create one first.
it's not that complicated.
 
So are you saying populate a text file each time from db code than run the inline? And I know, just never used inline.
 
@hakra she is very annoying to listen to. Especially since it's mono...
 
5:55 PM
@ircmaxell oh it's easy to map from mono to stereo, isn't it?
 
eih...
 
Um I got the answer sort to this question stackoverflow.com/questions/12644729/… but I am wondering what would I do to change what I have to make it so that the content is always inside the tags?
 
@DavidBiga i thought you have got a textfile already. if the data comes from the db already, you might want to do something like SELECT ... INTO
 
@hakra No never did I am using a direct - $sql = "SELECT firstname, lastname, email, phone, username, password, status, statuschangedate,customernotes FROM csvdata WHERE memberview =:username ORDER BY lastname"; to populate a table.
 
that does not populate anything, it only selects some rows.
 
6:02 PM
$sth= $DBH->prepare($sql);
$sth->execute(array(':username' => $username));
Than I am using a while ($row = $sth->fetch(PDO::FETCH_ASSOC))
 
user895378
6:18 PM
Just venting, don't mind me: damn you, relational data impedance mismatch!
 
Was not expecting this: codepad.viper-7.com/nnt15o
 
Evening!
@ircmaxell This look like PHP bug? Static is not declared.
 
huh?
 
public static function { }
and you have public function run() {} in your code
 
6:38 PM
so ... what did i miss ?
@NikiC naaah .. it would not make me cry .. though, throwing things might be likely
 
user1125394
@ircmaxell depends if static is uncommented or not eval.in/1220
 
user1125394
it seems giving the last static binding as expected
 
youtube.com/watch?v=RlfLCWKxHJ0 I just watched this, and I'm wondering if there's a way around service layers, especially with regard to data stores.
With respect to the law of demeter
and DI
 
@Stephane , can you write a code example , which illustrate your problem ?
 
user895378
@Stephane I don't claim to be an expert, but I'd say your best bet is to look into DataMapper/Gateways. You should be able to inject those into objects that deal with data from the persistence layer pretty easily.
 
6:48 PM
@tereško I'll give it a shot
@rdlowrey Thanks. I'll type up what I'm thinking and maybe there won't be an issue
 
user895378
It also makes unit testing objects that use data from the persistence layer trivial (and wayyyyy faster) because you can mock the data mappers and never fiddle with the actual database in your tests.
 
@rdlowrey , i get a feeling that it's not what he was talking about
 
user895378
@tereško Yeah I wasn't quite sure myself ...
 
Go for DCI. I might upload a code example later. You need to bounce PHP a bit but it works.
 
Anybody know of some smart way to to log methods being executed in JS?
 
6:53 PM
@PeeHaa debugger?
 
@PeeHaa , extent Function.prototype ?
 
@hakra As in?
 
@PeeHaa as in you need one?
 
@tereško Might do that. Would also be pretty trivial to log the params right?
@hakra Not sure whether I need a full blown debugger. You have anything good?
 
@PeeHaa not really.
 
6:57 PM
Setting up hashcat for a demo at PHPNW...
SHA512(pass+salt) == 12 seconds to crack a 6 character password on my laptop...
 
@ircmaxell , we will expect you to bring back video for us
 
user1125394
@ircmaxell with what you crack it?
 
user1125394
well it's hacker stuff should not ask
 
he is using a secret tool , know as "loop" : cprogramming.com/tutorial/c/lesson3.html
 
user1125394
but the salt is not known
 
7:02 PM
@ircmaxell via CPU or GPU
 
@cyril , define "not known"
 
user1125394
yep I'm saying dumbs
 
CPU...
 
Cool
I've crack MD5 before on GPU
so fast :P
 
@ircmaxell you giving a password hashing talk or something?
 
7:25 PM
I'm going to give a lightning talk about password_hash
and prepping for the talk in Toronto
I've been debating building a mini-itx GPU based attacking system. Just for the heck of it...
 
When you going to do talk talk in UK :P
 
Not sure, I just signed up already for the unconf...
 
let me know if you are
:)
 
7:43 PM
Yo
 
n00b OOP question (sort of): Are static properties ever acceptable in terms of introducing global state? The specific use case is effectively a constant who's value cannot be determined until runtime.
 
don't be concerned about ever
Good != Good Enough
 
@ircmaxell So basically "make it work first, worry about perfection later"?
 
@DaveRandom , afaik , not anywhere in php
i could imagine statics be a nice solution when you are dealing with desktop application , and multiple instances sharing one DB connection
if you loose the connection , you should have some mechanism to reconnect
but even them you could solve it without resorting to global state
thing is , the global state doesn't really give you any benefits in context of OOP, i see it more like a time-bomb
 
@DaveRandom also , there is noting more permanent then temporary solutions
 
@ircmaxell OK reading that has made me realise that what I am doing is arguably premature optimisation, but more importantly that my model is wrong anyway. I didn't understand my own problem. Helpful and informative as always, thanks a lot.
 
:-D
 
@tereško What I am talking about, as it happens, is a very long running application, but I was approaching the thing from the wrong angle in the first place. Thanks for the input though, I've taken it on board :-)
 
8:02 PM
what's the difference between bound parameters and prepared statements when using mysqli?
 
831
A: What is the best comment in source code you have ever encountered?

Rohit// somedev1 - 6/7/02 Adding temporary tracking of Login screen // somedev2 - 5/22/07 Temporary my ass

@hanleyhansen , you use the former in the latter
 
So the proper terminology would be that if i want to use bound parameters i'm techinically using prepared statements?
 
no , it means that, when you use prepares statements , you will need to bind the parameters
binding parameters is also don in other constructions .. fore example: in templates
 
@tereško Gotcha. Thanks. Just wanted to get those to terms straightened out.
 
@tereško Not technically true. There's nothing that says a prepared statement must have a bound parameter in it. It would be an edge case where you have a static prepared statement but there may be some use case somewhere in some long running application.
 
8:11 PM
@DaveRandom , if your query has no parameters , you should not be using prepared statement
 
@tereško What if you had some mega-complicated UPDATE statement to do something like e.g. rep recalcs on SO, which is triggered by a daemon that maintains a persistent DB connection? Sounds like it might be a use case to me (although like I say, edge case). If you disagree I would like to here why though, may be something I haven't considered about that.
 
s/here/hear
 
why would you want to prepare a statement , which has no parameters ?
 
@tereško If you want to run the same statement multiple times.
 
if it is because it will be executed all the time, then just make a stored procedure
 
8:17 PM
Because it pre-parses/caches an execution plan etc. Although I can't argue with the stored procedure point.
 
@tereško at work I got once a crash in a program we use. The text of the error was "What exactly is throwing this error?" Not very informative and useful...
 
"oobar" with md5(pass+salt) was cracked in 11 seconds. 7 minutes into blowfish, still not found
 
8:40 PM
hiho
 
@DaveRandom which ISP are you with? I am thinking to change it.
to Fibre connection but the bandwidth wont be unlimited :/
 
@I'll-Be-Back Virgin, got a cheap deal through someone I know who works there. If you want an FTTC connection see if you can find someone who will do it you on Entanet (don't think they do direct sale retail but they have an awesome network and their traffic shaping is minimal, they're not cheap though). You won't find a single FTTC provided who will do you an uncapped connection though, trust me.
 
Entanet? I have never heard that and I will check it out.
 
Hey there @edorian, how's it going?
 
8:47 PM
@ircmaxell Moved to Berlin today. Temp apartment for 1 month. Everything went fine except for the fact that there is no darn Internet connection for this place
 
yet
and congrats on the job
 
Thanks :) And no "not yet". Not for the whole month. Not even a phone line so no change on getting internet here
 
mobile hot-spot?
 
It seems to be one month phone tethering.. which will cut into my gaming significantly
 
yeah. that sucks
 
8:50 PM
I have just tried PhpStorm editor.. much slower than netbean :/
 
oO - First time i ever heard that [Insert long Netbeans/Eclipse rant and PHPStorm praise here]
 
@edorian I will give you two example why its slow. File -> New Project -> browse location (It will 6 seconds to popup)..
Also menu on PhpStorm is very responsive.
 
@I'll-Be-Back enta.net they're a wholesaler, but quite a big one. Having trouble tracking down a "partner" (retailer) worth dealing with though :-(
 
I might give them a call tommrow and see what they can offer me.
I am using Be There isp at the moment
 
8:57 PM
i just use Sublime Text 2. It works
 
@I'll-Be-Back The most important thing to remember with ISPs: as with so many things in life, You Get What You Pay For. Get a cheap deal, you'll probably regret it. Having said that, if you know someone who can get you a Virgin friends and family deal, get that - I get TVXL with 2 HD boxes, 30/3Mb (which speed tests at about 25/2.2Mb, not bad for UK) and phone line for £32/mo. Call charges are a rip off but I don't use land line much anyway
 
Does Sublime Text 2 support IDE? Like $this->[popup-menu]
 
IDE means "Integrated development environment". What you describe is called "autocompleten, code completion or intellisense" or something along those lines
 

« first day (713 days earlier)      last day (4235 days later) »