« first day (1077 days earlier)      last day (4097 days later) » 

11:02
hello, i want to open any content file in browser tab using php, please help me
@NikiC abstract classes however can contain implemented method bodies, don't they?
@hakre but abstract methods can't ;)
Anyone up for an interesting algorithm problem? stackoverflow.com/questions/19047889/…
Head on to twiddla.com/1323741 and help with the brainstorming
@NikiC then this non-abstract method needs to be placed into an abstract class :D
but this was about interfaces I guess.
hey guys.. m stuckd with file write function in php.. there is a php script which opens an existing file in a mode, www-data is the owner of that folder. m getting permission denied error for opening that file. i don hav to change the code.. so i cant use chmod or chown functions..
11:11
er, you can't change the code or you can't change the file access rights?
meta.stackoverflow.com/q/198581/166899 < Is that really too much to ask?
please help me to open any content file in browser tab
@Crazy4Php You're going to have to explain yourself a bit more That sentence on its own is meaningless.
Is someone here working with drupal, I am using a Webform and I want to use as default value the profile information field tokens. How can I use them? Currently I have only the possibility to parse the %email token.
11:27
Morning.
morning, @Leri
hey, @AlmaDoMundo, How are you doing?
Good afternoon all!
@AlmaDoMundo Had my driving license exam, failed (again), just arrived at work and I want to leave. :( what a Friday!
11:33
oh =\ sorry about that. I'm going to learn drive too :\
I still have to start taking lessons.... Too busy at work atm.
@AlmaDoMundo Theoretical part is very easy. I've already failed twice at driving and thinking does it worth to try again or not? :/
Good luck to you.
@Leri I have no car.. but since may be I will leave my country for foreign work - I think having drive license will be useful
@Leri ofcourse it's worth it. You'll be so flexible and able to go anywhere you wanna go.. It sucks you failed, twice, but many people did the same. Go try again!
11:36
@vascowhite: thanks for reply, actually i have some file uploaded on my server, now on click of those link i want to open them in browser tab, i wrote a code to download it, but i want to open it in another tab of browser.
@Crazy4Php How the browser behaves is up to the user.
@vascowhite: i want read those file content in browser, same like gmail nd others, how we view attached file in browser only
@AlmaDoMundo Driving license is always useful, I wish I took exams when I finished school, I have more spare-time than any dead man has.
@JoranDenHouting Yeah, you are right, I need some time to calm down but I am damn sitting at work.
@Leri well, since I've finished my school at 14, that wasn't an option for me :p
@AlmaDoMundo How/where? :D
11:39
there is some thing that troubles me a little and I'm looking for the right place where to fix it.
many PHP functions can trigger autoloading and accept a classname.
PHP so far does not check if the classname is actually a syntactically valid classname or not.
@Leri umm.. what 'how'?
Combined with autoloading this leads that PHP injects invalid classname strings into any callback registered with spl_autoload_register.
How did you finish school at 14?
this makes no sense to me, I think this should be more strictly handled. E.g. there is no reason to invoke a callback for an invalid classname or is there some reason?
Morning
afternoon now sheeesh
11:42
@hakre You could validate inside autoloader. I am pretty sure, this has been already discussed.
@Leri I wish I had started driving when I came out of school too, but on the other side, I got a great job, many friends got a drivers license but are not able to buy a car because of no job..
@Leri ah, that.. well, I've started when I was 5 and I've finished 8+9 classes in one year
@hakre Didn't we talk about this already quite a few times?
UPDATE YourTable
SET CountryName = REPLACE(CountryName, '"', '');

How can I change this SQL so it updates all columns and not just country name?
So at the end, I think you are in a great position, busy at work is a good thing.
11:42
That PHP has no concept of a "valid class name"?
Everything that's not the empty string is a "valid" class name
@NikiC are you sure? the parser has some contraints IIRC.
@hakre The parser yes, but not PHP
@JoelKidd What are you trying to do?
is there any way to integrate webkitdirectory to uploadify script
?
23
A: What are the valid characters in PHP variable, method, class, etc names?

NikiCThe [a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]* regex only applies when the name is used directly in some special syntactical element. Some examples: $varName // <-- varName needs to satisfy the regex $foo->propertyName // <-- propertyName needs to satisfy the regex class ClassName {} // <...

11:43
@PeeHaa Remove all double quotes from all fields in the table
dumdidum
@JoranDenHouting Yeah, same here. :)
@PeeHaa That was the closest SQL I found, haven't found one for all columns
@PeeHaa Do I have to reference all columns or can I just use some sort of all thing?
@NikiC well as long as auto-loading is involved it then is clear that the SPL should probably deal with it then (and not for example class_exists).
@Leri So you're all good, having a job is special these days. i.qkme.me/3pv3ag.jpg
11:46
@hakre the autoloader should deal with it, if it is a concern for the particular autoloader you are implementing
I thought about giving it a warning before any autoload callback is called and dropping the call to the callback.
@hakre I think what you really want is to introduce a NUL byte check in require (etc)
Is there a SQL command that will remove a character from all fields in a table?
@JoranDenHouting Hehe, funny image. If I ask boss to go would it sound too bad? I won't be useful anyway.
@NikiC well it's somewhat a defense in depth approach to have it more strict there and prevent users shooting in their feet.
11:48
Actually, that NUL check in require is a genius idea. I wonder why nobody came up with that one yet.
after all we check for NUL bytes in the "normal" file system functions (like file_exists etc)
@Leri, Why won't you be useful? And you can ask your boss indeed, why not?
@Leri Hope you got a good relation with your boss?
5
Q: Replace all fields in MySQL

MarkI need to replace some chars in the columns of a table, by using the REPLACE command. I know that the REPLACE command needs a column name, then the text to change (in the following example, the 'a' char) and the new text (in the following case, the 'e' char). UPDATE my_table SET my_column = REP...

@JoranDenHouting Because I am depressed. Yes, pretty good.
@PeeHaa How the hell do you do that, I'm searching now and couldn't find x]
@PeeHaa Thank you :)
@Leri youtube.com/watch?v=WlBiLNN1NhQ << That's the solution in many matters :D
11:51
;)
@Leri but to be serious, if you're not feeling to well, why won't you ask if you can go?... I would do the same! Actually, I'm chatting on SO instead of doing work...
Yep, I will. Thanks. ;)
@JoelKidd np
was the first result in my google results btw :)
well that was fun
got tea in keyboard
@PeeHaa What did you search for?
Ahh I was searching for the wrong thing
'd' and shift ain't working at the moment
The force is weak in you young @JoelKidd
@PeeHaa Ugh, building SQL in SQL? That's a sure sign of doing something very wrong a long time ago...
@tereško Laptop or separate keyboard?
Gave my keyboard a proper clean yesterday, crazy amounts of fluff and crumbs in there.
12:07
@DaveRandom :)
@DaveRandom laptop
gonna go and but an usb kb, an hope that it drys out
hi all,
0
Q: Character Encoding issue Json post to php

AndroidI have used the json post for form submit to a php page.In json request russian characters are showing correctly(checked in firebug console).but in php $_POST it shows like this "%u041F%u0440%u043E%u0441%u043C%u043E%u0442%u0440". Added the utf-8 meta tag.saved the file as utf-8.but still it...

Pls let me know any solutions
morning all ... @Fabien go and do some work, stop playing with your keyboard fluff :D
@JoeWatkins lol. I am working. Keyboard was cleaned yesterday.
if our civilzation leaves only one mark, please don't let it be you announcing your concern over keyboard fluff ...
12:21
No chance. Whatever the mark is, it will be cat related.
oh god, that's statistically quite likely ...
@DaveRandom Probably this one ^
If it is a mark left from the Internet it needs to have more stains.
@JoeWatkins lol keyboards are important. Cleanliness is important too.

"Tidy desk, tidy mind" - David Brent
@Fabien you don't happen to be the Symfony contributor "Fabien", right? :D
12:28
@DarkAshelin Unfortunately not. If I was then Symfony would be quite the feat.
Wtffffff #1267 - Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (latin1_general_ci,IMPLICIT) for operation '='
If all tables are general_ci why am I getting mix collations error o.o
I am smashing my head against the wall here
The bottom one is INNODB and the rest are MYISAM, only difference I can see there
@Jimbo Might that be causing the error?
I thought that was just an engine thing, error is collation mix and they're all the same bleedin collation
@JoelKidd If I were in your position, and had exhausted all other options, I would look at that because it's the only difference I could see. Maybe nothing to do with it, but as a last resort, worth the check
Ok cheers!
@Jimbo I know where the problem is, collation_connection
@Jimbo Do you know where that is stored?
No idea on that one, sorry
Ok no probs
Why do your tables have an explicit collation?
@Fabien we all want to be like Brent ...
@Jack I don't know, they were just created like that when I made them
@Jack I don't even know how the error came aroun
around*
Ugh I dislike feeling like such a noob all the time. That's one con of moving into unfamiliar territory.
That doesn't necessarily make you a noob, rather a newbie.
go round pissing over your new territory until comfortable ??
12:46
lol
There needs to be some better MVC tutorials/blogs out there for PHP. I know language is not the concern of a pattern but still it's easier to relate to.
@hakre i cant change the code.. m workin on my local host.. so file permisiions i can change.after a file is created in some folder owned by www-data.. another script is tryin to access that file. shall i change the owner of that oflder..?
Buzzword alert :)
@Jack MVC is just web-scale SRP? :)
Forget about web scale, cloud scale baby!
what is the default collation applied to tables in a mysql database?
12:52
Easy, create table and then do SHOW CREATE TABLE
@all : have you ever worked on TCP/ip socket programming?
I think they have this odd default of latin1_swedish_ci or something.
I'm so glad that @all ping doesn't do what you'd think :)
@JoelKidd show variables like 'collation_database';
@jack : y :) ?
@Jack That truly would be awful
12:57
Anyone seen that new SHIELD series episode yet?
@kanchan You understand the concept of unix file access rights?
you can normally change owner, group and also the rights to read/write/execute for those (and for all).
@Fabien You mean "The Shield"?
@Jimbo Interesting, but somewhat insane
Nope. SHIELD. As in Marvel SHIELD.
@hakre I think he means Agents of S.H.I.E.L.D. the new TV show spinoff from The Avengers ;)
Should the Model and Controller really be loaded from the View class?
13:00
@DaveRandom Seems like it's a step up from sending flat images over the wire though, still shocking that it's this complicated to do something that in 2013 should be so simple
@Jimbo Indeed. Websockets are inherently not great for streaming tbh because of the overheads of the stupid framing layer, you either end up with a lot of transport overhead or a huge lag/startup time
is it okay to use multiple/parallel assignments in PHP or is it bad? ($a = $b = 1;)
@Fabien "Model" is not loaded from anywhere....
called*
who has aligned with ?
13:07
@Fabien The model can be made available to the view, it doesn't load it.
@Fabien No. Firstly, the model is a layer - which contains services, domain objects etc. So, you Dependency Inject both your view and services into your Controller.
@reikyoushin If it's readable it's fine. If it's not readable then it isn't.
it was always so easy to enter some component name plus that tag and then you could find related questions.
So the code I pasted is not really MVC?
but now this is gone ... :/
13:08
@hakre Somebody created an alias for it?
@DaveRandom how about this? $this->name = $fields['name2'] = $name;?
@hakre 5 different people, apparently
@reikyoushin Do you find that readable?
But I'm inclined to agree, and should be synonymous.
because i dont like repeating all the mapping for the $fields array
13:09
tbh whenever I see name2 I think someone has done something wrong, unless it's address2, that's the only exception I can think of
@Fabien Your view is usually the end of the line. You create your controller, DI your services from the model layer and view into the controller, you talk from controller to service, then controller to view to render template
@DaveRandom its okay for me (since i'm the one who wrote it), but for other devs i dont know..
@hakre It was Damien
@reikyoushin That particular line I think is fine, I wouldn't have a problem writing that
FTR that code wasn't mine it belongs to SitePoint MVC. I was just confirming that it wasn't me thinking it was wrong.
13:10
@Fabien If you want to make an AJAX call, this is still treated like a normal request - ie it hits the controller, which has all it requires Dependency Injected, and returns data via the view
@hakre you can bring your case to meta, and ask for the synonym to be removed.
If the tags were merged though, I don't think there's much to do about old questions.
@DaveRandom because i already have a $this->name = $name;, but i need to map it to another array ($fields, from another system) but it has a new set of keys.. my concern is that i am just repeating all of the mapping again which i think make the code bloat with lots of dupe code
@MadaraUchiha I don't think old questions are affected by this.
@Jack Depends, a moderator can choose to merge the two tags
Basically synonyms allows you to only tag your question with and it would show up for those who are interested in
@MadaraUchiha Gasp!
13:12
Retagging all of the questions in tag A to tag B, and then making them synonymous.
Luckily that didn't happen here from what i can tell.
@MadaraUchiha I'll do.
@hakre Cheers
@reikyoushin There is literally no functional difference between $this->name = $fields['name2'] = $name; and $this->name = $name; $fields['name2'] = $name; and $this->name = $name; $fields['name2'] = $this->name; - all 3 do the exact same thing.
-1
Q: Ask to remove Tag Synonym [php-errors] to [php]

hakreThe php-errors has been recently added as synonym to php. It was working pretty well in the past to find related content when you tagged some component (e.g. like phpunit or simplexml) with it. This benefit is now gone. Most often with errors related if not duplicate questions are easily spotte...

well already got a DV
13:19
I <3 fkn Friday
@DaveRandom problem is, there are almost 30 fields on that array.. so i think its cleaner if i do ` $this->name = $fields['name2'] = $name;` 30 times than doing all $this->name = $name; 30 times, then doing another $fields['name2'] = $this->name; 30 times again.. what do you think?
@DaveRandom Except that the first one makes kittens cry.
@DanLugg are you against parallel assignments?
@reikyoushin yes first way is shorter
@reikyoushin but if u are dealing with 30 values there, I would suggest a foreach of some sort
@reikyoushin "Against" is a strong word. I just don't do it.
13:21
@DanLugg Not always, depends on the specific case IMO.
NetBeans auto aligns assignment operators across lines for me, so I just do statement-per-assignment.
@DarkAshelin the object fields and the array fields differ, since its from another system.. i am just trying to map em 1:1, so i can't loop em up. and if i will loop em, isnt it better to just use toArray() then?
Actually, the auto-alignment is awesome for all but a few cases:
$foo                                                = 'bar';
$thisNameIsReallyLongAndStupidButDemonstratesAPoint = 'qux';
if you are doing the same thing 30 times, I would start to think of a better way to handle it
thanks for the support!
13:24
@DarkAshelin im assigning 30 times, but they have different field names.. so it isn't much 'the same thing'
still, there must be a better way
@reikyoushin That sounds like something is funky; that something needs to be refactored.
@DarkAshelin best way would have been if the field names from the other system is the same.. but they're not.
Oh, you're adapting objects from one interface to another?
@DanLugg yes, i'm porting my system to another system.. its more of a 'i have my own DB, and i need to insert into the other system's db too just so the other system (the old one) will still see the changes on the new one'
13:26
Ah, well then.
Gotcha.
so, would i rather use parallel assignments or not?
@DanLugg how often you you really have two variables with predefined values one after another ?
You can probably simplify things by writing a mapping routine, and centralize the field reassignment, but other than that you're probably stuck doing it by hand.
@tereško Defaults?
yes .. how often there are 2 or more values with defaults /
@DanLugg where do you code? how do you do auto-alignments? o.O?
13:29
@reikyoushin Just get NetBeans 7.3
@DanLugg but they say netbeans is slower than eclipse (i also tried that once when i was in a java subject at school)
@reikyoushin *shrug* Then use Eclipse?
i need to go and buy that damned keyboard
@tereško Which?
Anyone know of a good free alternative to SoapUI? There recent releases have gotten too heavy for me. Just looking for something simple to test webservices with
13:30
pasting 'd' all the time is annoying
@DanLugg what 'which' ?
A nice mechanical one @tereško
or the Logitech G11 is nice.
Oh, you mean any keyboard. Your 'D' isn't working?
tereško D isn't working?
no, a dirt-cheep one, to plug in my laptop
[tag;afk]
13:32
@tereško do alt+100 for the mean time hehe
am I wrong if I say Symfony is a lot alike Yii? I'm just a beginner with it, but the structures look very alike
@reikyoushin alt+1 switches a tab )))))
yeh , shift is messed up too
alt + 100, not 1
oh wait, youre in a laptop.. nvm XP
@reikyoushin Well, I don't have 100 button, do you? :D
@Gordon Thanks for the comment on my PHP answer, I've updated it with a link to lxr.
@Incognito np. good answer.
Thanks!
Apparently I had seen it before and upvoted it ;-)
13:37
@tereško Did you quit?
@Gordon @NikiC for the constructor property RFC, did you consider class Foo ($bar) {} syntax?
guys, one question.. since people say the model contains the datamappers, does that mean i should pass from the controller the POST variables to the model and let the model handle it?
@reikyoushin The model shouldn't care where the data comes from.
@igorw briefly. but I don't like it at all. It's so very different from what we are used to
@igorw I considered it: gist.github.com/nikic/8a93e21f83df7cc354c9 Nobody seemed to like
13:39
@NikiC how many people did you ask? imo it's much nicer.
and someone else brought it up too.
@Jack something like Model->save($_POST)? (this is just a simplified version)
@NikiC what's this about?
@reikyoushin Model is not an object.
@Jack oooops, i mean domain object
@reikyoushin If ->save() takes in an array of values and you're using Active Record, then yeah, sure.
Ehh hold on, that's not quite right.
13:42
@reikyoushin Domain object should not know how to persist itself
@reikyoushin What are you actually trying to do there?
@Jack yes it has an ORM, question is where do I map? controller or domain obj?
@reikyoushin Yeah, that's the thing about Active Record ... it violates SRP :)
that would mean that your domain object has a dependency on your database layer and weird stuff like that
@reikyoushin Neither.
13:43
@Jack then where?
Can anyone tell me how these codes work if they're commented? symfony.com/doc/current/bundles/SensioFrameworkExtraBundle/…
With a data mapper you have a few options; one is that the mapper creates the domain object based on a related gateway instance.
@DarkAshelin those are annotations. you can read doc comments through the PHP reflection API, which is what symfony is doing in that case.
@Jack right now, i instantiate a domain object in the controller and map everything.. but they say i need to map inside the model layer, in this case the domain object, no?
@igorw they are still executed, right?
or is it really just a comment
13:45
@igorw on that note, you are against annotations in comments, right?
@reikyoushin the mapper and the domain object are both part of the model.
@DarkAshelin no. they're just comments. metadata attached to methods. which is then read at runtime and interpreted.
@Jack yeah thats what they say.. but my controller does the mapping, so how do i make it so that i can transfer the mapping to the model layer? what i'm thinking is to pass it to the domain object.. or do i make sense? i'm still new to these terms so please bear with me
13:46
@DarkAshelin Reflection
@reikyoushin How does your controller do the mapping?
@NikiC no strong opinion on the matter. metadata can be quite nice at times. putting them in comments is obviously a hack.
@Jack something like this?
@igorw Do you have any idea why there's UserInterface::eraseCredentials() in sf-Security but never called?
$pass = false;
    array_walk($profile_manager, function($item, &$pass) { $pass = ($item == null)? true: false; });
@Jack I don't know much about the lasagna that is the security component, but maybe take a look at FOSUserBundle? it probably uses it somewhere.
13:51
@reikyoushin Sort of, but if Lead is an ActiveRecord you need some kind of factory that can create the binding with the database.
I'm trying to check for null values in array
@igorw Lol, any other security component you would recommend?
@Jack nope. I have some ideas, but not seen anything that looks very usable.
@iroegbu array_walk is not the right thing for that. use a normal foreach loop
13:53
@iroegbu You mean like in_array(null, $array) ?
@igorw I see, I've started reading up on Security. I must say that the documentation and walk through is pretty decent :)
@Jack uhmm i didn't get it. isnt it the ORM binding it to the DB? now my question is should I (and how do I) move the mapping to the Lead object instead of the controller
Even if it's indeed Lasagna(tm)
@iroegbu any('is_null', $profile_manager), using something like functional-php
@Fabien or that, assuming you add a , true at the end ;)
13:54
Hmm, I have array_some() for that .. same thing as any() I guess.
yes
@reikyoushin What ORM are you using?
@Jack some() actually seems like the more common term for this.
I was explaining the Voter system to my boss and he just took another sip from his beer haha
@Jack hmm.. Eloquent, a bit like doctrine, just simplified
13:56
@reikyoushin It's like Array.some() for JavaScript.
I was actually going to propose a hack for array_sum() and array_product(), which mathematically can do the same thing, but that wasn't going to work out.
@Fabien that does it... Thanks
GODDAMN YOU IOS7!
There... I have said it
Downgrade noooow!
@Jack Yeah I really wish I could tell me users that ;)
@Jack so, should i leave that alone or do i need to transfer the mapping code inside the Lead obj?

« first day (1077 days earlier)      last day (4097 days later) »