« first day (416 days earlier)      last day (4539 days later) » 
00:00 - 16:0016:00 - 00:00

12:00 AM
see ya @ChristianSciberras
 
you may be dismissed , @ChristianSciberras
 
@Anfurny Well, what do you mean by JavaScript dependencies? Simply, you need to have a <script> sent in the output? If that is the case, why does your templating system require multiple classes to know what to output?
 
I may take a look after, thanks @tereško
@CharlesSprayberry Yes, a <script src='...'>. Each class has its own unique set of javascript dependencies (maybe js script A, B, and D) for class 1. And D, E, F for Class 2. And these must all be output in the head of the HTML document with no duplicates.
Does that answer your question?
 
suspect that there might be deeper architectural issues , then just use of static calls
 
No, you shouldn't need static calls to get unique data from your "business logic" to your "view"
 
12:04 AM
I don't need them, no, but I could use them. My question is, how does using them limit me?
 
As your project grows more and more complex and all of a sudden it isn't 10 classes but 100 classes and they're all working with the same static calls. All of a sudden one static call you made 6 months ago is conflicting with the new code you just added. Go find that static call that is messing everything up.
 
To give more information, it's presently setup like this: the base class has a static method registerRequiredScript to be called in each child class's constructor, and a static method, includeRequiredScripts() to be called in the head.
Well, it's either a static call, or a call to a global function. Either way it's the same function.
 
Well, there's your problem. You believe that this data is forced to exist in the global scope.
 
And it does, because we cannot have duplicates, so there must be a global list that prevents duplicates somewhere.
 
I could easily see a View object that has a "helper" object that takes an array of JavaScript files and generates the proper <script> elements
Preventing duplicates doesn't require using global scope.
 
12:07 AM
Well then it requires an array in the global scope.
 
No, it doesn't. Limit the amount of data in the global scope.
 
And don't assume MVC. It's not (necessarily).
Okay, so I'm lost. Please explain your solution again.
 
Well, the solution would be reevaluating the architecture of your application. You're starting off under the assumption that the data must be stored in the global scope. There's sure to be other, compounding, issues due to this design decision.
 
It's not an assumption, it's a conclusion. It sounds like you think you know of a solution that doesn't require a global function or global array, and I'd like to hear it.
 
dependency injection
 
12:12 AM
Well, these classes that are assigning the JavaScript files...what are they doing? What is their responsibility?
But, yes, ultimately whatever specific answer I give is gonna boil down to "Inject your dependencies"
 
Okay, can you please explain that in terms of this hypothetical application? (Because I've looked it up and found it unclear)
 
$db = new PDO( ... );
$foo = new Foo( $db ) ;
$bar = new Bar( $db , 1337 );
 
but in this application, it's not database, what would it be, a string of all the javascript includes?
 
why?
all your JS should be in a single file anyway
unless you are reaching 1MB size of JS
 
No, sometimes I want jQuery, but sometimes I don't.
And regardless of why, let's stay on one topic at at ime.
 
12:16 AM
$JSList = new JSList();
$foo = new Foo($JSList);
$bar = new Bar($JSList);

// inside these objects you could do things like
...
$JSList->add($filePath);
}
 
Okay, so $JSList is an array in the global scopet houg.h
*though
 
@tereško I try, I suck at formatting font in this chat. Is there some cheatsheet that you knwo of?
 
there is a button on left side when you edit the text
 
@Anfurny No, $JSList is an object with a private property that stores the list of files
 
12:19 AM
@CharlesSprayberry Okay... so it's a list object in the global scope... instead of an array in the global scope....
@CharlesSprayberry Alright, so that's dependency injection. Now what advantage does it confer?
 
I think you misunderstand what global scope means
 
<?php
$a = 1; /* global scope */

function test()
{
echo $a; /* reference to local scope variable */
}

test();
?>
Consistent with my understanding.
 
Ok, what does that have to do with $JSList being in the global scope?
 
so $JSList is not a variable within any function or any class. It's just declared in the main php file, right? Is that how it is in dependency injection?
 
Well, dependency injection is just a fancy way of saying that the objects this class needs must be provided by some other source. How you create the object storing your JavaScript files is really entirely up to you.
 
12:23 AM
@Anfurny , watch the video : youtube.com/watch?v=RlfLCWKxHJ0 [38 min]
 
@CharlesSprayberry Alright, so that's dependency injection. Now what advantage does it confer?
I'll take a look. I'm not gonna pause this conversation for 38 minutes though, so I'll watch it afterward.
 
Easier to test, not relying on manipulating the global scope, forces you to abstract out your functionality.
 
@CharlesSprayberry , would you give him 38min to watch that video ?
 
So, give me a hypothetical where having done my project with static is gonna be a major pain in my ass.
 
by all means, I need to do english homework anyways
 
12:25 AM
@tereško We're at the heart of it now.
 
@Anfurny I already have
As your project grows more and more complex and all of a sudden it isn't 10 classes but 100 classes and they're all working with the same static calls. All of a sudden one static call you made 6 months ago is conflicting with the new code you just added. Go find that static call that is messing everything up.
And now I go do homework
 
well if you're going you're going, but I still don't really find that clear.
I can't really image what's gonna conflict with what in "Don't include this js twice." I also don't see how this conflict would have been avoided with injection.
 
That being said, watch the video @tereško linked and read Clean Code
 
I think you don't know.
It's a pretty simple question, and it's the heart of the issue.
 
what was the question ?
 
12:34 AM
@tereško So, give me a hypothetical where having done my project with static is gonna be a major pain in my ass.
Following all the parameters we layed out over 30 minutes above.
I see both solutions, and I just don't see the advantage of dependency injection over the other.
 
i did not pay attention to most of that .. you said that you are talking with Charles
 
29
Q: Are global variables bad?

timpIn C/C++, are global variables as bad as my professor thinks they are?

I understand wanting to question things. But, sometimes when everybody says "Don't go that way you'll get burned!" it might actually mean that if you go that way you'll get burned. Also, you're ultimately questioning a very basic concept of modern programming and saying that all of those extremely smart people before you got it wrong.
 
yo
 
Heyo
 
12:49 AM
how goes it?
 
damn .. i always remember that i wanted to pick your brain about one application architecture related thing , and when you are online i have already forgot what the question/subject was about
 
Eh, it goes. Wanting my next semester to be started already, this first one was...boring. Didn't learn hardly any programming stuff.
How goes for you?
 
lol
 
Okay, that video was mostly a waste of my time.
 
It's good for me. Just started my new job today (same company, but transitioned from contract to full-time and got a significant promotion)
 
1:00 AM
Basically it was entirely about dependency injection to justify/ease unit testing.
Congrats @ircmaxell
 
Thanks!
 
Tom
What do u guys think of the captchas?
 
@Tom , its the easy way out
 
Tom
I'm new here and people seem to dislike them
what do u suggest then?
 
Use them
 
1:02 AM
Use em
 
they are easy to beat, but provide a barrier to entry for spammers
 
Tom
ya
 
either that, or hook into a service like Mollom mollom.com
 
Tom
I have also played around a bit with animated captchas
 
(which uses captcha internally, but only as a last resort
 
Tom
1:03 AM
gifs with 3 slides
1st one is a number second is an operation third is a number
 
nice
 
Tom
wow nice
i hate recaptcha
 
@Tom , thats actually not a bad idea
 
Tom
ya
it works well
quite hard to do it automated with animated gifs
hard(er) to beat
 
1:05 AM
i prefer using a "honeypot" input fields , and use captchas only if everything else fails
 
Tom
like u mean hidden fields
that only bots fill out
 
yeah , with name="url" or something other bots always try to fill out
 
Tom
ya i guess that could do a bit of help
 
thing is , users hate captchas , if you can get away without using them , your userbase will be happier
 
@Tom piece of cake. Quite easy to generate
@Tom Actually, animated gifs are just frame after frame, so it shouldn't be difficult... The only thing going for it is that it's not common
 
1:14 AM
or you can use some simple mathematical puzzles , instead of captcha
but all the solutions are just protection against "opportunity spamming" .. if someone will really want to fill your site with crap , he/she will write a bot specifically for it
 
I like the "Are you a robot? [______]" input fields
 
trick is : it will be almost as useful as custom captcha
 
1:41 AM
I prefer stopforumspam's api
ie stopforumspam.com/api?ip=31.31.114.187, parse xml, block user
 
 
1 hour later…
2:50 AM
// Takes the first letter of each word and string them together to form abbreviation
function abbreviate ($string, $numChars = 1) {
	return array_reduce (
		explode(' ', strtolower($string)),
		function ($v, $w) {
			return $v.substr($w, 0, $numChars);
		}
	);
}
 
I feel like an idiot, because I'm not sure why this won't work
 
If anyone would like to support a PHP wrapper for the SE API, please vote -------^
 
It seems like $numChars isn't defined inside the callback
 
@YiJiang it won't be
function abbreviate ($string, $numChars = 1) {
	return array_reduce (
		explode(' ', strtolower($string)),
		function ($v, $w) use ($numChars) {
			return $v.substr($w, 0, $numChars);
		}
	);
}
 
2:59 AM
Ah, so that's how it works
 
yeah, it's not like JS, you need to be explicit about the scope binding
 
 
4 hours later…
6:33 AM
How can I phrase an if() statement do be true only if a number given to it is a multiple of 3?
 
hello @Ezra
 
haiiii :3 @IndianGirl
 
@Ezra may you help me by giving an advice on mysql plz
I'm trying to use this expression is it correct ?
$ldp=mysql_num_rows(mysql_query("SELECT id FROM ".memberlogtbl." WHERE (totalleft-paidleft)>='100' AND (totalright paidright) >='100'"));
can I do like this (totalleft-paidleft) in mysql expression ?
 
@IndianGirl i dont know, google it?
 
I tried
 
6:40 AM
Or w8 till someone come on here who knows these things :P
 
please , stop using outdated `mysql_* functions .. learn how to us PDO or MySQLi with prepared statements
 
My server doesn't support mySQLi, actually mySqli extension is not enabled
 
@IndianGirl hi
 
hello
hello @Stacky my you help me plz
 
@IndianGirl whats up with this bit? (totalright paidright)
 
7:03 AM
totalright means total joining of the week (MLM)
in right side
thus totalright
 
and paid right?
 
@IndianGirl , is memberlogtbl a constant ? and do you rally store varchar in totalleft-paidleft ?
 
7:27 AM
no I store INT there
 
hey Iam looking for a php/ajax expert
 
@tereško Plz help me
 
WHERE (totalleft-paidleft)>='100'
you are comparing it to a string ( varchar )
@celebo , whats the salary and location ?
 
my budget is 100$-500$
 
for ?
 
7:34 AM
hmm, not easy to explain :-)
can you javascript too?
 
@tereško I have not understood, the field is INT(11)
 
WHERE (totalleft-paidleft)>='100' ... '100' is a string
 
@tereško then,
 
@celebo , of course i can , but i am off to do some shopping ..
 
hmm
how long? :-)
 
7:38 AM
@IndianGirl , "then" what
link an hour ..
 
ok Iam here, I write you an documentation what I need, ok?
 
@tereško 100 is string means , Then how I can do that ?
 
@IndianGirl dont use the quotes if its a number
 
Good morning @people.
 
good morning
 
7:41 AM
@IndianGirl , string , as in "string of letters" , an in varchar
you are comparing a number to a text
 
How can I phrase an if() statement do be true only if a number given to it is a multiple of 3?
 
o not wrap it in the quotes ( the ' symbols )
@Ezra if ( $foo % 3 = 0 ){
 
Hello @tereško. Got a question if you've got a minor two. I've got a logger which basically serializes a backtrace into JSON.
json_encode($backtrace);
But when the $backtrace contains, for example, a resource, json_encode (rightfully) complains and encodes it as null.
 
@Ezra , or if you have extremely large number ( like 800 digits ) , then if the sum of all the digits divides with 3 - then the whole number will too
 
I need two things: [1] make it not to complain. [2] if possible, I'd like to (string)$resource instead of seeing nulls :)
I'm thinking about a foreach($backtrace as $i=>$v)if(is_resource($v))$backtrace[$i]=(string)$v; // <- you get the idea...
 
7:45 AM
... it shouldnt be a "resource"
 
@tereško I don't understand, what shouldn't be a resource?
 
the result of debug_backtrace()
 
oh, the result isn't.
But function arguments may contain a resource type
 
emm .. it an image
oh
 
yes, well, streams, images, files etc all are resource types.
 
7:49 AM
so instead of using the built in method , you are writing something your own
cute .. but i am AFK now
 
ok, cheers. later
The problem is getting much more complicated by the second... I'll start with a question on SO, be right back...
 
@tereško w00t, works :) ty
 
second time I notice @casperOne making odd moderator decisions: stackoverflow.com/questions/8388410/…
 
Hi @IndianGirl
 
8:06 AM
I need a freelanceeeer :-/
php / ajax
current status you can see here: pureblackgroup.com/test
 
0
Q: PHP json_encode a debug_backtrace() with resource types

Christian SciberrasCurrently, I have a logger which logs errors together with a backtrace. The logger serializes the backtrace to JSON via json_decode(). Let's look at some hypothetical code... <?php error_reporting(-1); // show all errors function test($b){ echo json_e...

@Gordon, @tereško when you get some free time... :)
 
8:22 AM
do we have multi threading in php?
 
@NikiC Currently it seems like it
@tereško In response to chat.stackoverflow.com/transcript/message/2026636#2026636 : What's your take on the subject, I'm not able to figure it out from your line. Did you mean "Who would think doing so is a good idea?" ?
 
Hi
I need some help generating ms-word reports from PHP
I am converting XML into MS-Office Open XML by using XSLT
I just took an example from the msdn library: msdn.microsoft.com/en-us/library/ee840137%28v=office.12%29.aspx
now I need to insert images into the word document, there it comes the problem
how can I do it?
what should I put in the XML file and in the XSLT?
any hints?
???
 
8:38 AM
@ivanfreire no idea. sorry
 
I've only used PHPExcel and related to deal with MS formats
 
is PHPExcel good to get Word documents?
 
"If you hang out at the bar with functional programmers til 5am there will be side effects" @stevevinoski #yow_oz
 
Well there is "PHPWord" but i don't know if thats a fit for your case
 
Is there nobody who can help me?
 
9:03 AM
@IndianGirl hi
 
how do I detect if a file upload is empty in PHP?
if($_FILES['file']['name'] != '') isent working
 
9:51 AM
@Gordon you couldent be a lil more specific?
ooo this is awkward :P
 
Just realized I'm a trillionaire... by calculating the total amount of competitions, lotteries, funds, transfers etc, I've somehow won from emails from Microsoft, Google, UK international lotteries and the ever so generous Burkina Faso, Bank Of Africa and Kiev banks. Hawaii, here I come!
 
10:28 AM
0
Q: PHP json_encode a debug_backtrace() with resource types

Christian SciberrasCurrently, I have a logger which logs errors together with a backtrace. The logger serializes the backtrace to JSON via json_decode(). Let's look at some hypothetical code... <?php error_reporting(-1); // show all errors function test($b){ echo json_e...

 
11:08 AM
teresko, are you back from shopping? :-)
 
 
1 hour later…
12:13 PM
0
Q: Uploadify FOLDER

Dileep DilI am using Uploadify to upload Files and using Codeigniter framework. Here is my Uploadify code : $("#change_profile_icon").uploadify({ 'uploader' : '/project/style/scripts/crop/uploadify/uploadify.swf', 'script' : 'http://localhost/project...

 
1:03 PM
35 suggested edits open. oO
 
1:15 PM
posted on December 06, 2011 by Mayflower Blog - PHP

> .serendipity_entry h1 { font-size: 20px; margin: 13px 0; } .serendipity_entry h2 { margin: 7px 0; } .serendipity_entry ul { padding-left: 3em; } .gist-data { max-height: 250px; overflow: auto; } In yesterday's article of our advent calendar, we explained the concepts underlying Doctrine 2. In toda

 
1:33 PM
Iam looking for a freelancer
 
1:48 PM
please tell me I have this json coming from iphone {"GenInfo":{"type":"Request","appname":"XXX","appversion":"1.0.0"},"searchDish"‌​:{"userId":"295","dishName":"","estb":"1 Plus 2 Pizza &amp; Wings"}} but i do print_r($_REQUEST['jsonRequest']); in my index.php its comes only upto 1 Plus 2 Pizza but it breaks from & why?
 
Are you looking at the results in a browser?
 
no no i am looking for server side handling this issue...
 
@celebo you might have better luck at careers.stackoverflow.com or at one of the many freelancer portals. this chat is really just a chat.
 
is anyone who chats here regularly a freelancer?
 
@salathe me.
 
1:58 PM
okay :)
 
2:18 PM
anybody?
 
foreach ($chatRoomPpl as $person) echo 'heya';
 
posted on December 06, 2011 by Stefan Koopmanschap

Just a little heads-up for people working with Symfony2/Twig: Today I ran into an issue that I couldn't figure out. "It shouldn't be this hard..." I thought, and indeed, it turned out not to be as hard. It's just easy to overlook: Make sure to close your twig tags correctly :)

 
2:47 PM
Good Morning
 
Hiho
 
im a complete moron using phpmyadmin, can anyone help me with this? i have an eamil marketing database that is part of a CRM i need to accept duplicate emails that are coming from a webform, so im in the database on phpmyadmin and i located the column "emailaddress" and i can modify it, which exact attribute should i modify so it allows duplicate emails? right now its NULL not even sure if it matters for this purpose
 
3:15 PM
 
sebas
@sebas
Make sure the column isn't unique or primary
 
how can i check htat @nine7ySix?
 
Are you at the table?
 
yes
 
Click on Structure
 
3:18 PM
yes
im there
 
At the bottom of the page, under Indexes, just make sure that email isn't under Field
 
@nine7ySix i locate that indexes section but here is the thing, im in the database then i clicked structure and now i can see a lot of rows
emailaddress is one subscriberid is another one etc.
this is all under email_list_subscribers
 
What is the Type for emailaddress
 
thats the thing it doesnt hav a type
 
Woah
Um
 
3:23 PM
the indexes section below at the bottom is for the whole list_subcribsers
 
Click the pencil on the right side
For emailaddress
 
i can not see the type for each emailaddress, subscriberid etc whhc is at the TOP
 
Click the pencil
 
ya that takes me to the emailaddress properties
type VARCHAR?
 
I would give it a type of 'Text'
Oh
Varchar would be better
I always use 'Text' cuz I'm lazy D:
 
3:24 PM
ya ti says varchar but no mentino about the promary or unique thing
 
How did you create the table?
Via PHPMyAdmin or SQL?
 
its a script, via a wizard, it was mysql
 
hi
 
the only section where i can see the Primary/unique thing is before clicking on the pencil and at the bottom
 
What is the Field of the Keyname PRIMARY?
 
3:28 PM
Can anyone help me with my problem. I have mysql query SELECT country.*, count(*) AS count FROM air_countries` AS country join air_cities AS city ON city.coid = country.coid GROUP BY country.coid` but I need to alter it to display countries that don't have any city too, just in count show 0. Is it possible in one query?
 
@nine7ySix check this out: i41.tinypic.com/ruclm0.png
this is email_lists_subscribers under the database
 
Ok
@sebas, so you want to be able to have duplicate emailsaddress, right?
 
exactly
 
Try clicking 'Eliminar' for email_subscribers_email_list_idx
But
I'm not too sure
Best to have a backup before you do
 
@nine7ySix any way to try that without deleting it? like "disabling" it temporally so i can check it thats the case or not?
 
3:35 PM
I can only think of setting it as UNIQUE again
alter table people add unique (emailaddress)
alter table ___ add unique (emailaddress)
How long will it take you to test if it works?
@sebas
 
the thing is i dont even know how to do a backup for this so if i delete and its not that..
 
It should be that
Want me to tell you how to do a backup?
 
that would be cool
 
I can't read Spanish
 
export?
 
3:39 PM
On the top, there should be export
 
its up there..
ok done
 
Click Go at the bottom
 
done
 
Copy and paste that text somewhere, this is the table dump
 
now im gonna delete email_subscribers_email_list_idx?
 
3:40 PM
Under Indexes, yeah
 
done
 
Try it
 
damn didnt work
 
What did it say?
Like, the error
 
the error page i made before
that is triggered when the email was already on the db
 
3:43 PM
Oh
I think the PHP script it preventing it from inserting duplicate emails
 
yes it has to be that becuase i can manually add duplicate emails from the crm backend
but when i do it via web on a form it doesnt work
 
Then there was nothing from with the database
@sebas
Check your PHP code, the one dealing with the email part
 
should i import the sql?
 
Yeah
But drop the table first
Then import the table from before
 
gave me an error after importing the sql Duplicate entry '10' for key 'PRIMARY'
 
3:54 PM
@ircmaxell Whats up
 
00:00 - 16:0016:00 - 00:00

« first day (416 days earlier)      last day (4539 days later) »