« first day (759 days earlier)      last day (4188 days later) » 

12:00 PM
i do know GIT has better methods for that
 
well subversion also has hooks.. and a long history of CI
basically both would do the job i guess.. but feature branches can be a pain compared to git's methods
 
git is designed to be good for distributed development.
 
and I am quite impressed with the speed of GIT over SVN (pull, push)
 
Morning!
Did anyone work with Google Custom Search API?
 
Sid
12:07 PM
something carzy happened
 
@dystroy: This is PHP, not C, if you need it to be a string, it would be a string. No one said he wanted big numbers, he wanted a six digit random number. And even with this additional formatting step, my method is still more efficient (and more readable) than yours. — Madara Uchiha 23 secs ago
BOOYAKA!
 
Sid
I copy pasted a php code from test.php to settings.php
then all of a sudden ajax requests are not working
:(
 
@NikiC Where/When do I vote on that?
@cyril That's old, and fake :)
Still good nonetheless.
 
@MadaraUchiha All i can see is, there is a down arrow for each line with options
Also the * and flag marks too
 
@UdaySawant Wha?
 
Sid
12:16 PM
??
 
@Sid "Not working" isn't an error message.
@ClayEllisMurray Hey
 
@Sid check the console... may give something useful... proceed from there
 
So many people have absolutely zero knowledge of debugging.
I really should make an article about debugging
 
@MadaraUchiha it will be very cool
 
Sid
12:19 PM
err.. console?
 
@Sid What browser are you using?
 
Sid
chrome
 
CTRL+SHIFT+J
Or on the menu -> tools -> JavaScript console.
You can even go to the network tab to see the request in progress, as well as the response.
:P
 
@MadaraUchiha i do exactly know
 
Sid
Uncaught ReferenceError: upimg2 is not defined
upimg2 is an onclick eventfunction on ajax .js file
 
12:25 PM
@MadaraUchiha was this image for me ....?
 
I pointed it at you, didn't I?
(I'm referring to your avatar by the way)
@Sid There we go, then it's not defined where you're trying to call it.
 
Sid
it's there
echoed
<script type="text/javascript" src='/js/ajax-profile_image.js' ></script>
 
In JavaScript, a function must be defined before it's called.
@Sid And are you sure it's loaded correctly?
 
Sid
echo "<script type=\"text/javascript\" src='/js/ajax-profile_image.js' ></script>\n";
 
12:27 PM
Check the network tab of your developer tools, and refresh the page. See if your catch anything unusual about that script.
 
@MadaraUchiha now that same will happen with you
lol
hahaha
 
@NullPointer What does that supposed to mean?
 
just fire the crackers ....
 
Sid
Uncaught SyntaxError: Unexpected token ILLEGAL
 
ehh .. i'm kinda back
 
12:30 PM
Run for the hills!
 
@tereško Welcome kinda back.
@Sid ... Your JavaScript code is invalid.
 
user1125394
@Sid vi yourfile to clean it
 
What sort of enviroments do you guys use?
I'm on ubuntu 12.10 with chrome and sublime text 2
 
@ClayEllisMurray Windows 7, chrome, PhpStorm and Sublime Text 2.
 
i use very good environment ... @MadaraUchiha , did you really have to measure yourself publicly ?
 
Sid
12:33 PM
how to vi myfile?
 
@ClayEllisMurray I'm on Windows 3.11 for Workgroups with IE2 and notepad
 
@Sid Just... fix your code.
 
Sid
sorry for these questions guys.
I'm new
:(
 
Open it in an editor, and fix it, it's not valid JavaScript.
You have syntax errors.
 
@sid it's okay we all start somewhere and you have to ask to learn
 
12:34 PM
@tereško You can get arrested for that kind of thing...
 
@tereško Meh, I use this computer as a lot of stuff
It's also my makeshift-personal-project-fiddle-testing-super-charging-winged-dotted developement environment
 
Sid
@ClayEllisMurray Thanks.
 
@Sid Like I said, go there, and fix the syntax errors in your file. If you can't manage to, you can ask on the JavaScript room on chat
 
Sid
alright
@MadaraUchiha Thanks
 
=)
And don't be stressed, most of us are experienced developers here, sometimes we may be impatient, still ask though
 
Sid
12:40 PM
@MadaraUchiha Sid and many other beginners Like that
:D
 
for ($i = 0; $i < 1000; $i++) { }
Excel is the worst piece of shite ever made
 
Wait so what are you mad about?
 
@DaveRandom I think you're forgetting IE.
 
Sid
//Browser Support Code
function upimg1(){
	var ajaxRequest;

	try{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	// Create a function that will receive data sent from the server
when radio button 1 is clicked, upimg1() is called
 
12:44 PM
@MadaraUchiha No no, Excel is in a whole league of its own. At least IE can generally be made to pretend it behaves sensibly, Excel is just immutably awful from start to finish.
 
@sid have you considered using $.ajax in jquery to abstract a lot of this away
 
Sid
and so on for button 2 and 3
but the table gets updated when i access the php file direcly
what might be the error?
oops
sorry
wrong room
 
@ClayEllisMurray I have to agree with this one. AJAX is one of the few things I don't trust myself to perfectly write by my own, so I use jQuery.
But even when I use AJAX, I never use .load or .get or any other shortcuts. Just $.ajax,
 
Exactly I don't like the amount of boilerplate you have to do when you don't use jquery
 
@MadaraUchiha tried "learning" ? I have heard strange thing about that mystical process. Some say it unexpected increase in ability to make stuff.
 
12:52 PM
/me seeths quietly
 
0
Q: Hello, people, I'm practicing some OOP, I have a error, did i overlooked something?

user1703601The error is unexpected T_PUBLIC on line 15 http://pastebin.com/HEhU0fgd

lol
hello people please close vote
 
why a closevote on that teresko ?
its a bit of a short question, but not a dumb question tbh
 
if is "rtfm" question
 
1:49 PM
Anyone here using AES on multiple fields in a single database row?
(or any other algorithm that requires an IV)
 
@Leigh No, but why do you ask?
 
@DaveRandom Wondering the best approach. Obviously key-reuse is not cool unless you maintain unique random IVs per encrypted artefact.
Looking for a scheme that doesn't see me creating a new field to store IVs alongside encrypted data, considering a key derivation scheme
Perhaps based on a global key, and the table name, and then the primary key as a basis for the IV
 
@Leigh I would say unique keys are required, not even up for question. You could use some derivative of the column name for simplicity, although obviously that reduces the security and therefore probably negates the point of what you are trying to do.
 
function insert_id()
{
    return @mysql_insert_id($this->conn_id);
}
 
Got to love that awesome surpressor.. ><
 
2:03 PM
@DaveRandom Key re-use is acceptable as long as a unique (and truly random) initialisation vector is used. Since the IV has to be as long as one block length, and in CBC the result of each round of encryption is fed into the next round as the IV. For AES that means you get around 2^256 re-uses of the key given that you use unique IVs every time.
 
@Leigh My brain broke trying to do that maths. I'm going to duck out of this for now, I only had 4 hours sleep last night and I'm not in a good shape for thinking about encryption.
(or really anything)
 
good morning all
 
@DaveRandom Ahh sleepless nights, reminds me, how's the squirt doing?
 
@Leigh Not been sleeping well, and therefore neither have I. Coupled with the fact that I started watching 24 from the beginning again, my life of late has been less productive than one might like.
 
Hey guys, I've got a little mental block at the moment but can you guys give me a set of tables that i would use including join tables for this scenario please (Table names should do, I can figure out the rest after)? By the way I am writing this in PHP and mysql. I'll write the scenario in the next message.
 
2:09 PM
@DaveRandom I hear little girls like whiskey
 
This is a scenario for a product customiser where an image is generated with pointers where a user could click on customise a particular piece. "There are many pieces of a shoe, each can have a pointer connected to it which in turn has may positions based on a particular angle.
 
I think I'm going to settle on SHA256(global_unique_key + table_name) for the key, and SHA256(primary_key + column_name), that way keys are unique per table, and IVs are unique by key.

Maybe I'll formulate something for security.SE
 
@DaveRandom :cutebabybtw:
 
@Leigh So I believe, but social services are less keen.
@webarto Yeh he generally rocks.
 
@DaveRandom Oh it's a he, my bad (picture is small, was 50/50), little boys like whiskey too.
 
2:18 PM
Like I said :cute:
Dave likes Instagram.
 
@webarto My sister likes Instagram. I don't own a device capable of doing it.
 
@DaveRandom just started watching 24 for the first time.. First session took 5 episodes before i had my fill (and i fell over because of sleep deprivation)
 
@DaveRandom Cool, you're one of us.
 
Oct 14 at 22:44, by DaveRandom
Apple, all their employees, anyone who owns one of their products and particularly the fanboy tossers who tell me their iPhone is better than sex but can't give a single solid reason can all suck by big fat hairies.
 
^_^
 
2:27 PM
@DamienOvereem I'm nearly at the end of S5 and I don't have the S7/8 sets, going to have to do something about it, but I can't find any 1080 matroskas, and I totally cba with mp4 w/xvid because it really sucks, no-one knows how to use either properly. I really don't want to fork out for the BDs but maybe I will end up doing it and I'll create some proper rips.
 
i really dont care much about 1080p, since my tv set only handles 720p :)
 
Ahh yes, 720 "H"D, a full 144 more rows than PAL... :-P
 
When I play 1080 my computer freezes.
 
@webarto Haali by any chance?
 
I think because file is 8GB and CPU and HDD can't handle that without chopping.
 
2:38 PM
@webarto Unless your using an IDE drive I doubt that's the problem. I had some real problems with the haali splitter a couple of years ago, I switched the default matroska decoder to ffdshow and the problem disappeared.
Also trying to monkey-patch WMP to support matroska in any way is known to suck. It works until you try and do anything memory intensive and then it just dies in a pool of glitches. Use, well, anything else. Not that anyone uses WMP anyway.
 
@DaveRandom "HD"-ready ftw :) But yes, its crap.. also old. I think i might switch to a beamer to compliment my lack of pixels :)
 
So I have a gallery type post that I was wondering if I could just show two images but when clicked on show all the images in the gallery set
 
@DamienOvereem I can't criticise people for having crap displays, good ones are so expensive.
 
Well my not buying another set has more to do with form factor then price :) I pretty much integrated my set into my wall :) Hides all cables and such nicely. Downside is that my new set must fit the hole ;)
 
2:54 PM
I know there is a way but how?
 
If you know any cryptographers, give them a poke please :)
0
Q: AES using derived keys / IVs. Does it introduce a weakness?

LeighI'm looking for an efficient way to encrypt multiple fields in a database with AES using a single global key, used throughout a large web application. Obviously in order to re-use this key, a unique random IV is required for each field that is to be encrypted. I'd rather not introduce more fiel...

 
@Leigh Sure. @DanKaminsky /ping
 
what should I search for
 
I do feel kind of bad asking a question like ... "Is it ok to do this?" :/
 
@Leigh It's always ok. Be happy, take a coffee or some tea. :D
 
3:06 PM
is there a way cause I can't seem to find one?
 
hey people!
Can anyone help with a php / WP code query please?
 
maybe, go for it
 
@KirstyHarris PHP: probably, WP: less likely
 
if u check this link, for some reason my content is not expanding
ive checked the div which the content sits... and its not got a fixed width.. so im lost!
 
3:09 PM
its not loading either right now
 
@KirstyHarris Sounds less like a php issue, than it does a HTML/CSS issue.
 
could be my connections
its not loading...hold on
 
And "content not expanding" isn't super-descriptive.
 
sorry lol, it appears ive sorted it... was something with the CSS :)
not php but thankyou anyways :)
 
3:11 PM
Ok, I have a php/wp question
 
Ah, you meant the year-old-mucus coloured bar at the bottom was partially masked by your content area ;D
probably needed a clear: both
 
lol...
it aint my personal choiice of colour lol
 
I want to have a post that is for a set of images and I want the max of 3 images to show up on the main post but when you click the post you can see all the images in the set on the single page
 
@Leigh For future reference, it's not $lines[] = $name.':{SHA}'.sha1($pass); but $lines[] = $name.':{SHA}'.base64_encode(sha1($pass, true));
 
@KirstyHarris it never loaded for me
 
3:14 PM
0
A: A practical scenario for using include(), include_once() and require() constructs

NullPointerThe require_once() statement is identical to require() except PHP will check if the file has already been included, and if so, not include (require) it again. The require() function is identical to include(), except that it handles errors differently. If an error occurs, the include() function g...

 
dunno why :S
 
@Christian Wasn't me, I was talking about using 401 headers. Think it was @DaveRandom
 
in the note section am i wrong ?
since book i read ...thats telling like that
 
@Leigh I didn't say "for the record", I said "for future reference" as in something you might need in the future, not a correction.
 
@NullPointer You were wrong to not close as dupe.
 
3:15 PM
is there some reference I can look at or an example
 
Welcome back Kirsty
 
@Leigh can you provide dup link ?
also about the Note
 
@NullPointer require and include can both have a return value. Also, I'd discourage using require(...) with a bracketed format since it's a language construct, not a function. require '...' makes that distinction
I've never had a use-case for anything other than require_once tbh.
 
3:19 PM
@Leigh nor i did
 
why I want stuff thats not easy to find is beyond me
 
@Leigh You need require() to load templates.
 
@Leigh Would be a nice rule to stick to if PHP was consistent across language constructs/brackets, which it is not (list(), isset(), empty())
 
I mean it's a pretty common use-case.
 
Also if (require 'something.php') {} looks wrong.
 
3:20 PM
@DaveRandom You forgot eval() :D
 
@Christian If you have some mad nested template stuff, perhaps. I've never needed to do that though.
 
@Christian I am trying to, but people keep reminding me.
 
@Leigh no, no. Imagine sending an email using tpl.email.php, and in some case you need to do it twice.
 
Because of templating nature, once you get a dirty/rendered one, you need to do another require() to get a different one.
@DaveRandom That reminds me, round brackets after require are important.
 
3:23 PM
@Christian $template = require email.tpl followed by format_email($template, $junk) - Your template obviously won't contain logic, that's illogical
 
This may not be obvious, but if I remember correctly, $r = require 'test.php'; returns something different than $r = require('test.php');
@Leigh echo $name; <- yeah very complicated logic.
Look, it's no use trying to hide the truth, PHP is a templating system, and no matter what they say if/else are parts of template system.
 
@Christian Truth is, I've never needed anything other than require_once :)
 
Poll: Xeon E5-2407 or Xeon E5-2420. Votes please.
 
For me, PHP is a bad templating system.
It doesn't have let's say... XSS protection - htmlspecialchars() call doesn't count as it's long.
 
@DaveRandom is it for your pc ??
 
3:26 PM
@GlitchMr That is plain stupid.
It had SQL injection protection. It used to be called magic quotes.
 
@NullPointer No, I've just been asked to spec up a low-ish end (read: cheap) server
 
Lots of good it did to us all, didn't it?
 
In many templating engines, simply printing escapes
 
Unless you would specifically mark it as markup or something
 
3:27 PM
@GlitchMr Again that's plain stupid.
 
Basically it comes down to 6C@1.9GHz vs 4C@2.2GHz
 
echo $description; <- was this out of a wysiwyg? or a plain text field?
 
@DaveRandom ill go with 2420
 
@NullPointer Yeh I'm leaning on that as well, it's another £150 but I think it's worth it. Will be running shudder SBS 2008 R2
 
exactly ..also cache memory is 5mb more
 
3:30 PM
@DaveRandom 32gbs ram looks good to me (over 25)
I suppose you could tweak 1.9gb to 2.2 (they say max is 2.4)....idk about warranty.
 
@Christian I am not going to overclock a server. Just buy a better server...
 
DDR3-800/1066/1333 <--- also supports 1333 ram
 
@DaveRandom In that case, I'd recommend you don't buy a blade server.
 
on the top Cache 10 MB Intel® Smart Cache<<<<15 MB Intel® Smart Cache
 
Loads of companies build their own thing (eg; Google) and it's usually better.
For instance, my PC at home is several orders of magnitude faster than the server we have here, and it's supposed to be .5ghz more than mine (mine's better with the RAM though, 10gb, whereas here's at 4gb)
 
3:34 PM
Hi guys ! Can someone help me ? I'm creating tests with PHPUnit. I have a mock object, and i need to call it's method twice in a row. First time it returns as it was specified with ->will($this->returnValue($someXml)); , and second time i get empty row.
hete's the definition of mock object
$mock->expects($this->at(1))
->method('__doRequest')
->with($this->stringContains("History"))
->will($this->returnValue($xml));
 
How do you do single.php files for different post types like images, videos, etc.?
 
4:03 PM
lol
 
@Malgin That code is awful. JK. Ask a Question on main site.
 
why doesn't it work like is says its supposed to :| I followed what the codex says
 
Anyone got experience with grabbing expired domains?
 
What do you want to know?
 
I want to know why single-image.php doesn't go to single-image.php but single.php
 
4:13 PM
Not you, @Leigh
 
@benlevywebdesign Ask WP dudes. I think we can't help you as they can.
 
@webarto I did and they are butt holes and not helping
 
Yes, bunch of failed PHP developers and designers.
 
yeah bunch of dick heads
 
4:22 PM
Well that is not nice, someone might read it and feel offended.
 
yeah bunch of dick heads, that are sometimes nice(edit)
they always just say ask on main site instead of just helping with the simple questions
 
@benlevywebdesign i am here to read i am feeling very bad
 
@NullPointer what?
 
so you are telling d**k head to us ..... there are mostly same user online .....
 
@NullPointer NO! You guys in this chat are cool a fcuking awesome
 
4:26 PM
it isnt nice ....as @webarto tails ...... even its good enough that the replied .... it mean they spend time for you
 
user1125394
is there an array_filter filtering on keys not values, please?
 
@benlevywebdesign okkk cool ....
 
user1125394
/me array_intersect_key
 
@benlevywebdesign This is a family channel, keep your language clean.
 
-1 escalated quickly ... aaaaaaaaaaand it is gone.
Even the algorithm is offended by the question.
 
4:55 PM
Is it possible to do a call_user_func_array() style call to pass an array of arguments to a constructor without resorting to eval()?
 
user1125394
$predicates=array('foo'=>array('baz', 'bar')); array_walk($predicates, 'sort');
 
@DaveRandom yes
 
user1125394
this smells
 
user1125394
I'm sure there's shorter
 
I think
let me test
 
4:58 PM
@MadaraUchiha php.net/manual/en/reflectionclass.newinstanceargs.php, but I don't like it, I think my design is probably wrong
 
No, it's impossible in the straight way
class Foo {
    public function __construct() {
        var_dump(func_get_args());
    }
}

$foo = call_user_func_array(array("Foo", "__construct"), array("This", "Test", "Lol"));
fails
 
user1125394
of course I'd like to end up with array('foo'=>array('bar', 'baz'));
 
$ref = new ReflectionClass("Foo");
$ref->newInstanceArgs(array("Test", "Foo", "Bar"));
Seems to do the trick...
 
user1125394
$predicates=array('foo'=>array('baz', 'bar')); $predicates=array_map('sort', $predicates);
 
user1125394
not working
 
user1125394
5:10 PM
anything shorter than?
 
user1125394
function test($a){
	sort($a);
	return $a;
}
$predicates=array('foo'=>array('baz', 'bar'));
$c = array_map('test', $predicates);
var_dump($c);
 
user1125394
5:28 PM
ok nvm
 
user1125394
for html lovers: <button>+</button> Vs <input type="button" value="+"> ?
 
user1125394
taking 2nd option for now
 
user1125394
nvm
 
user1125394
how to make a selector to get input of type search?
 
user1125394
#main input [type=search] {
width: 100px;
}
 
user1125394
5:33 PM
ahh sorry the space after input made it fail.. ok I shut up now
 
I don't have coffee and I hate everything youtube.com/watch?v=DTTARq6V48M
 
is it possible to hide a part of a post on the single.php page
 
Of course it is possible. You probably meant how is it possible...
 
5:58 PM
Hi All
 
Abend
 
@MadaraUchiha I don't think that you can vote :/
 
6:16 PM
0
Q: Custom single.php files for different post formats

benlevywebdesignI have 3 custom post formats. One is for image, one for video, and, one for gallery besides the default post and they each have a view comments link on the bottom right corner at the end of the post. Check it out here: http://benlevywebdesign.com/wordpress On the single.php page I would like to...

 
user1125394
I think wordpress have a chat..
 
@cyril yup but its not that good
 
@NikiC ping
 
pong
 
How are you doing today
 
6:28 PM
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
if is not needed here...
 
@Baba good :) You?
 
Not bad ... looking at a interesting question
 
<input type="hidden" name="t" id="t" value="firstname">
 
3
Q: PHP Senior Developer Role Interview about string manipulation and reversion

vknyvzLet's categorize this for PHP only. Ok so I had an interview yesterday for a Senior Software Developer role. I can't remember the question very well but I try to write it as much as I remember. Question; Write a function that takes a string as the input and return true if traversed, false if n...

 
I have this in a form. Is it ok to say
if($_GET['t'] == "firstname") {}
 
6:30 PM
I really don't think its possible because
No looping every character in the string
No Built-in PHP function can be used
i would include strlen , substr , strrev ... etc
The first question is how do you get the length of a string without looping or declaring another variable or substitution
No variable within the function , ` String param must be passed by reference`
are this conditions not too much ???
What do you think ?
 
@Baba I think the question is totally stupid and pointless
 
@NikiC 100% i agree
why would one give such kind of interview question ??
 
Palindrome test for senior PHP developer... what a joke.
 
@Baba I think the solution they wanted is the recursive one
and by no internal functions they probably only meant that you shouldn't use strrev
though it's still pure bullshit
 
@NikiC still don't think its possible with out strlen .. you definitely have to use a PHP function
@NikiC i agree ....
 
6:39 PM
in particular as the given recursive solution is tail-recursive, so it's directly equivalent to a loop...
 
Even in Tail Recursion String param must be passed by reference. and Only one input (string) type. would make it fail
Except am wrong
there most definitely be a way to remove the last string .. how can you do that when you don't know the length ??
it would result in endless loop having to pass the only string am trying to reverse
 
It is still a fizbuzz type of question and it is pointless.
 
Yeah .. i just wanted to be 100 sure that is why i wanted to discuss with some friends here
You really can say i might be wrong
 
Wow. One of the most useless interview questions I've ever seen
 
hello
 
jo
 
user895378
I've determined that ~ 90% of Qs in the can be decomposed to:
 
user895378
> I don't know how to do this and I have minimal (or less) programming knowledge. Can you please provide a solution so I can skate by without learning anything?
 
user895378
7:12 PM
Usually accompanied by some apology like, "sorry I'm new with PHP" or "I know, my regex skills are terrible"
 
and the remaining 10% are questions using deprecated mysql_*(), and often full of SQL injections vulnerabilities
 
user1125394
7:37 PM
hmm please, is a dot valid is a url path part?
 
@cyril ofc
 
user1125394
domain.com/test/ok.bar
 
user1125394
@PeeHaa k
 
never seen http://example.com/index.htm ? ;)
 
user1125394
yes.. that's just a little bug in my side, my url is cut at domain.com/test/ok
 
user1125394
7:40 PM
ahh that's my damn router rules
 
Good evening ladies and gentlemen, welcome to the starlight ballroom, I'd like to start this evening with a little number I call stackoverflow.com/questions/13367575/…
 
@DaveRandom very Good evening ....:)
 
Hoya @dave
WTF. some mods...
> declined - Declined. No activity found.
Why do I even bother
 
Thankyou very much, you are too kind. Now this next one is a bit more upbeat, and it goes a little something like this: stackoverflow.com/questions/13367664/…
 
7:53 PM
Is there some chatroom where mods gather?
 
quick question i really need some help, i re-formatting some json to get it into a javascript var, i got it working with json_encode but i need it to output ' symbol instead of the " symbol, is there a way to do that?
 
@NullPointer As a non-native you won't be aware, so let me tell you: the Daily Mail has never once in its entire existence had anything useful to say.
 
in JavaScript, Nov 5 at 16:43, by rlemon
Please use proper English (or at least your best attempt at it), "MSN talk" is prohibited.
 
@Michael Why would you need to do that? And no there is not, because ' is not a valid enclosure in JSON
not without some nasty ass string replacement operation anyway
 

« first day (759 days earlier)      last day (4188 days later) »