« first day (662 days earlier)      last day (4286 days later) » 

9:00 PM
@tereško but the problem wasnt in the view source, because as i said - it worked with __construct, just not with other methods
 
@MichałKról , congratulations , you are doing it wrong
 
omg, why wrong?
 
too long
 
9:00 PM
@tereško Urban dictionary... lol... I am not blaming you, as it's a popularly used insult, but it does not do justice to the word dense.
 
i think i already linked you to that article ones .. which you of course , ignires
 
Okay moving on.
 
it works, but yeah - i'm doing it wrong. cool.
 
@rdlowrey It is part of the oauth lib. I haven't pushed this specific service yet, because it doesn't work. But if you look at e.g. the GitHub service it is the exact same code (except for the URI's)
 
9:03 PM
 
user895378
@PeeHaa Do you know if soundcloud has a sandbox I can test against without having to register an API key?
 
@rdlowrey I can send you my credentials :)
 
@webarto Thanks I appreciate it!
 
@rdlowrey whats your mail?
 
user895378
same nick @gmail.com
 
9:05 PM
@rdlowrey ->with($this->isType('string'));
looks promising.
 
@AlexCastro no beer? :sad:
@Chris ;)
 
Can I +rep on this site some how?
In chat, that is.
 
user895378
@LeviMorrison Oh nice does that work? I think that isInternalType (or something like that) also exists
 
@rdlowrey Just discovered it. Playing around now.
 
9:06 PM
@AlexCastro nah, just kidding
 
@webarto :( It'd be cool if we could
 
@AlexCastro In chat, you can "star" a message
 
user895378
@PeeHaa That'd be cool -- I'd like to test it and see if I can't figure out what the deal is so I can fix it if it's a problem on my end.
 
@Chris yeah, I see that, but does it really count for anything?
 
@tereško and?
 
9:08 PM
@webarto there seems to be an issue in my echoing then..
$sql->execute(array($login_id));

while($row = $sql->fetch())
{
echo "<li>".$row['course_id']."</li>";
}
 
@tereško are you implying that echoing this variable is "wrong"? or what?
 
@rdlowrey so, with($this->isType('string') works for the following values for isType:
      'array' => TRUE,
      'boolean' => TRUE,
      'bool' => TRUE,
      'float' => TRUE,
      'integer' => TRUE,
      'int' => TRUE,
      'null' => TRUE,
      'numeric' => TRUE,
      'object' => TRUE,
      'resource' => TRUE,
      'string' => TRUE,
      'scalar' => TRUE,
      'callable' => TRUE
 
@rdlowrey sent.
 
@AlexCastro try uppercase like COURSE_ID or try $row->course_id
 
@rdlowrey And then you can do a type constraint for a specific kind of object using with($this->isInstanceOf('StringOfClass'))
 
user895378
@PeeHaa Cool thanks. I'm about to head out for a couple of hours but I'm going to try to make it work later tonight.
 
@webarto none have worked ;(
 
@AlexCastro try $sql->fetch(PDO::FETCH_BOTH) and try both... also make sure your $login_id is valid number...
 
user895378
9:12 PM
@LeviMorrison Can you do multiple argument constraints? Like with($this->isInstanceOf('StringOfClass'), $this->isInstanceOf('SomethingElse'))
 
@rdlowrey take your time. I've got a temporary solution with my own http client. it's just that I can't stand of I don't get it when something is not working :)
 
@rdlowrey Yep :0
 
of == if
 
user895378
@PeeHaa I understand. I'm the same way.
 
user895378
@LeviMorrison woot. this is what happens when you help people -- you get helped in return :) I've been wondering about that for a while and just haven't gone looking for it
 
9:14 PM
-2
Q: How to change password and be able to encrpyt it by using salt? MYSQLi/PHP

user1394925I am using mysqli and php and what I am trying to do is that I want the user to be able create a new password if they wish to do this. For a user to change their password, the will enter in their username in the "Username" textbox and then type in their new password in the "New Password" textbox...

 
user895378
Thanks for finding it.
 
looks at the answer, made by 100k+ user
 
@rdlowrey It's nice when you have callables for parameters but certain callables are passed different arguments.
You don't have to make multiple stub interfaces.
Just use with constraints.
 
user895378
@LeviMorrison yeah -- I've been going the multiple route. Not any more though :)
 
@tereško another 100k user :)
 
9:15 PM
@rdlowrey Just don't start uploading your tracks under my username on soundcloud ;-)
 
user895378
@PeeHaa lol no worries there.
 
user895378
@PeeHaa I'll even super-delete the email from my inbox when I'm finished
 
@rdlowrey :)
 
user895378
I'm really paranoid about stuff like that. I hate sharing passwords and keys
 
@webarto It works but for some reason its not returning ALL the classes. All except the last.
 
9:17 PM
@AlexCastro I think there's a badge you get for x number of starred posts, or a post that reaches x number of stars
 
@rdlowrey For a service like soundcloud I don't care too much. At least not for people I trust and I only know from some vague chatroom on SO :D
 
@Chris oh cool, I'll star from now on
 
@AlexCastro fetchAll
 
user895378
@PeeHaa Yeah I mean, I've got a tan picture I probably jacked from some random person's facebook. Seems legit :)
 
lol
 
9:18 PM
@webarto I replaced fetch for fetchAll and now none are returned, lol
 
user895378
@PeeHaa Don't even think about getting royalties when I get a sweet record deal.
 
Hey at least let me be your agent
 
@AlexCastro LOL, well, experiment :) do you have phpmyadmin or something so you can run query to see if it returns expected results?
 
@webarto yeah I'm going to resort to that, haha
$sql->fetchAll(PDO::FETCH_BOTH);

while($row = $sql->fetchAll())
wait...which do I make fetchAll?
 
@AlexCastro php.net/manual/en/pdostatement.fetchall.php read ... remove the first one with PDO::FETCH_BOTH, that is just for "fetch"... also try print_r($row) or var_dump($row) inside loop
$sql->execute(array($login_id));

while($row = $sql->fetchAll())
{
var_dump($row);
}
 
9:24 PM
@webarto Okay, that's dumping a ton of the db info
 
@webarto , that's kinda stupid to do
 
@tereško He's just debugging with me. It's not the final output
 
i am talking about while( $row = $sql->fetchAll() ){}
 
Ah
I've been told to do it that way by a lot of people here. How would you recommend?
 
I don't always use tables for layout, but when I do, I drink Dos Equis beer.
 
9:29 PM
wait, i'm not supposed to be using tables for layout???!?!?
 
It's not always the nicest way....
Don't use it to style an entire page.
 
and by "not always", surely you mean "never" except for tabular data
 
@Chris I don't always use tables for layouts, but when I do; I get upset easily.
 
Editing old code, found myself being a jackass (again)
 
@Lusitanian yo
 
9:31 PM
hi, i have three minutes
 
@Lusitanian I only need two
 
@Chris , lemme guess , you wrote something that you thought was really smart but did not comment it
 
@PeeHaa do fast
 
@tereško I guess you could say that: I used tables for layout
 
I might have found out why I couldn't get the soundcloud service working kinda. It seems to be something in the artax client :| the curl client just works :P Way to spend two days :D
 
9:33 PM
take it up with @rdlowrey :P
 
I never comment my code, anyway. Don't have to
 
@Lusitanian He's already on it :)
 
oh good
@Chris famous last words
 
can someone explain this regex preg_replace('=((<CR>|<LF>|0x0A/%0A|0x0D/%0D|\\n|\\r)\S).*=i', null, $value); (for email injection)
 
I agree with the principle there
 
9:36 PM
@webarto I've put the SQL code you gave me originally in my PHPmyadmin and MySQL returned an empty result set
 
I document my object APIs, document the database, etc
 
@Chris just won.
 
The inline comments take as much time to read as it would to read the code, and not leaving comments takes away that temptation to do something "really clever" yet inscrutable. I am not allowed to explain it, so I can't be obscure
The verbosity of my code has expanded, but I've never been impressed with code golf so I don't view that as bad.
 
I like useful comments like:
// echo foo
echo 'foo';
 
Lol
 
9:38 PM
:)
 
my comments are more useful
<?php
//start code
 
interesting comment!
 
@PeeHaa return true; // return false
 
hahaha
 
@webarto Are you sure you have pinged me enough :P
 
9:39 PM
	// I apologize in advance to my coworkers, family, friends, and everyone who ever believed in me
	global $vars;
	extract($vars);
 
hehe
 
If anyone has time, I've been working on a PHPlib that parses some public Gaming Api (Xbox Live, PSN, Steam) and I'd love some code feedback. I haven't posted all the Psn/Steam class but they all work very similarly. Anyway if someone's interested in tearing a me a new one -> github.com/nybouchard/FlawkApi
 
@PeeHaa hey, everybody loves free pings :P you know, it is, true :) realtime
 
Comments let you excuse your shitty code in advance. Don't leave comments, thus don't write shitty code. So the theory goes. :D
 
@Chris perfect for being hacked quickly :)
 
9:40 PM
@Nick what exactly does it do right now?
 
@AlexCastro "Stores" Public Data/ Game Data/ Friends Data into different arrays
 
@Nick inject the http client into the class
 
@AlexCastro Here's an example too -> flawk.co/dump/api/Xbox.php?id=IndyMark007
 
@PeeHaa Was that at Nick rather than NikiC?
 
@Chris You rock :)
 
9:43 PM
the only thats there :P
 
:)
 
@PeeHaa Can you elaborate, why am I injecting the http client into the class?
 
They just showed a clip from the BMX event from today's olympics. The dude came off his bike and ATE the track. That really looked like it hurt bad!
 
@Nick pulls my account fine. Looks great! flawk.co/dump/api/Xbox.php?id=inbredsister
*dont judge me by the name
 
@AlexCastro haha good
 
9:44 PM
@Nick 1. you are going to need it for the other services too 2. you are decoupling the client so you can test the class
 
@GordonM I saw it too, he didn't feel well for a few minutes...
 
@Nick are you using Steamworks API?
 
@AlexCastro yup
 
@Nick awesome :)
 
Poor guy.
 
9:45 PM
@Nick it'd be cool to "sign in with steam" on sites to pull your game data.
 
This is why coding is better than sports. You don't nearly kill yourself in front of an audience of millions.
 
like "sign in with facebook"
 
@AlexCastro v2 haha, I know it's possible with PSN and possibly Steam
 
@Nick I'm not sure if it's been done with steam, but if you do it that would be awesome.
 
@AlexCastro Hmmm, I'll definitely look into it
 
9:47 PM
@AlexCastro /already judged
 
@Chris what? haha
 
@PeeHaa ohh I see what you mean, what other services?
 
@Nick PSN, Live etc
 
@webarto this is killing me, haha.
Your SQL code works, but the echoing is messed up
And the $login_id is verified as returning a good int
 
@Nick You are going to need an http client for those services too: DRY
 
9:51 PM
@AlexCastro sorry I'm too tired for it now :D It's probably PDO related, hey, try mysql_query :P
 
Can someone tell me if there is some obvious error here?
$sql->execute(array($login_id));

while($row = $sql->fetchAll())
{
echo $row['name'];
}
 
0
Q: Integrate a forum with symfony 2

kraymond70I'm creating a website using the symfony 2 framework and i need to integrate a forum. Need help! Which forum template must i use and how ? Thxs

uses symfony2, asks question beyond stupidity...
 
@webarto Suggested using mysql_query... Throw him in the flames!
 
@AlexCastro Are you using named parameters?
 
@PeeHaa Thanks, I'll work that in
 
@AlexCastro: do you really need a while loop since you are using fetchAll()?
 
That's the code
The SQL is confirmed to be right
 
paste canna work
 
Unknown Paste ID!
 
UNKNOWN PASTE ID! UNKNOWN PASTE ID! UNKNOWN PASTE ID! AAAAHHHH!!!!
 
9:53 PM
0
Q: Traditional MVC: How should a data mapper return a domain object?

orourkekNote: Ignoring the non-persistent model and other true MVC shortcomings by PHP, this question is about the traditional MVC paradigm - not "Framework MVC" In my model layer I have data mappers, domain objects, and "services" (to liase outside the model layer). I chose to implement a DomainObjectF...

feel free to help me out ^^
 
sqlfiddle.com/#!2/e9fcc/8/0 here is the SQL, make him a PDO
 
pastebin.com/X25aM5r4 woroks fine for me
ah, there was a v
my code has it all
 
FETCH 2x ????
 
$row = $sql->fetch(PDO::FETCH_ASSOC);?
 
9:57 PM
that should be inside loop I guess
 
Where does it say that?
wow those example are unreadable btw
 
while($row = $sql->fetch(PDO::FETCH_ASSOC))
{
        echo "<li>".$row['course_id']."</li>";
}
?
 
@webarto Why is your database so close to where you generate HTML? so brittle . . .
 
the phpcodepad.com guy has gotten smarter!
"permission denied" for eval, exec, directoryiterator
 
@orourkek permission denied for everything ;)
 
@PeeHaa Kid needs to be smacked with a rolled-up newspaper
 
It's super effective
 
maybe he doesn't want to reinstall his server 10 times a day?
 
10:02 PM
@webarto ..... it works!!!!
thanks
 
@SomeKittens :-)
 
@PeeHaa haha I didn't even try to run any normal code :P
I thought maybe he was learning...
 
@stack98 So what you're telling me is that you want to repeat an action n times without a for loop (and I'm assuming while is out too). I hear gotos are pretty nifty, especially for those with your coding style. — SomeKittens 46 secs ago
 
@AlexCastro But serious. Where di you find that example in the docs?
 
I'm always at a loss when I try to pluralize a coding term in ```
 
10:05 PM
@PeeHaa fetchAll(PDO::FETCH_ASSOC);
search that
 
@orourkek just going to it and with the default echo that's in the box, permission is denied... so paranoid about his stuff, that he's made it unusable... i guess it could be "learning"
 
@AlexCastro I have the docs in front of me. I'm asking where that specific example is so I can fix it
 
@PeeHaa Wow, what a male chicken.
 
@SomeKittens It´s the same idiot I had a "discussion" with last time. Same question same stupid additude
@GordonM
 
Got similar a few days ago when I answered a question by some dude called ThinkingMonkey
6
A: PostgreSQL field type for unix timestamp?

GordonMI'd just go with using TIMESTAMP WITH(OUT) TIME ZONE and use EXTRACT to get a UNIX timestamp representation when you need one. Compare SELECT NOW(); with SELECT EXTRACT(EPOCH FROM NOW());

 
10:08 PM
A few days ago I posted a comment to ask the OP for more information. He replied something like "While I value your comment, I don't think this information is relevant".
 
user895378
@PeeHaa Is it possible to get a reproducible example of the behavior using just the Artax\Http\Client so I don't have to understand OAuth? Something like this:
 
user895378
$body = array(
    'client_id'     => 'xxx',
    'client_secret' => 'xxx',
    'redirect_uri'  => 'xx'
);
$body = http_build_query($body);
$headers = array('Content-Type' => 'application/x-www-form-urlencoded');

$request = new StdRequest('https://api.soundcloud.com/oauth2/token', 'POST', $headers, $body);
$response = $client->request($request);
var_dump($response);
 
The OP is probably still waiting for a reply to his question...
 
user895378
Otherwise it'll take me forever to figure out what I need to do to test :)
 
@rdlowrey Sure let me make a test for you
 
user895378
10:10 PM
@PeeHaa I just am not sure where to put which value and what not and don't really want to have to think :)
 
np
 
Thoughts on an idea: allow a user to take a picture with a mobile device of the front of a credit card, then use OCR to pull the number off. Put the number in a text field for edit/correction.
 
@Chris You can always just use Squareup.com
plus, a picture can be faked information
 
Nope. For one, the client already uses Paypal and already has quite a bit invested in internal systems that integrate with Paypal. Plus, the items being sold really count on instant and close integration with the broader system, Square is not sufficient. Second, the IT manager is categorically opposed to Apple products (the client is a Microsoft shop 110%).

Finally... if I can come up with a stable, reliable alternative to Square the industry is booming :)
@AlexCastro Do you know how easy it is to fake a physical card? I'm making a fake of your credit card right now, as a matter of fact.
Hope you like Mexico
:p
 
@rdlowrey Just 1 more second. I've just lost track of a dump somewhere :|
 
user895378
10:24 PM
@PeeHaa no problem
 
help me with this question stackoverflow.com/questions/11461131/…
please
 
@Chris why not use the PayPal equivalent of Square?
 
@AlexCastro I am looking at that too, but from my understanding there is a larger fee attached than the normal one. It is one of the possibilities, but I had the idea of using OCR and wondered if anyone can think of any huge deal-breaker reason why not
Fakes aren't really a worry -- you can manually type in a credit card number anyway, so if you already had the number there's no sense in making a fake to cheat the OCR system
 
Yeah true
Someone should make a website called "Storage Wars Stats"
and track the overall winnings of these guys, lol
 
I love that show
 
10:31 PM
lol.. so built it
 
That is literally the only TV show I watch
 
build it*
 
Justin, that would mean I watch all the shows
 
@Chris lmao not only that they play it for 4 hours straight
 
lol
 
10:32 PM
Yep.. Better get to work ;)
 
hahah
hey so php question
 
4 hours straight?! I don't watch that much TV, I'd scratch my own eyes out!
 
php chatroom :D
 
if I make a page that is created based on GET with stuff like class=5
Would I set up a class.php php page templated to the variables?
 
@Chris not implying I watch 4 hours of it. But whenever it's on they marathon it
 
10:34 PM
Alex, I was all ready to help, sitting forward in my chair, sleeves pulled up, poised to spring into action. Then I realized that I have no idea what you're talking about.
 
user557846
10:36 yet to start work, they should fire me
 
user895378
@PeeHaa thanks
 
@rdlowrey Client and Response should the artax stuff and I see a typo print('<pre>');var_dump('Eeeeek error: ' . $resonse->getBody());print('</pre>'); -> should be response
 
10:37 PM
@Dagon Same here... Except my day is over in 23 minutes lol
 
@rdlowrey have you setup the callback url in soundcloud?
 
user895378
@PeeHaa I haven't done much of anything with it yet :)
 
@rdlowrey basically you need to make the file public. and setup the link to that file in the api: soundcloud.com/you/apps/yadeotest/edit (when logged into soundcloud)
God I suck http_build_query($params) should be http_build_query($bodyParams) :P
btw do you guys consider this too long?
const AUTHORIZATION_METHOD_QUERYSTRING_ACCESS_TOKEN = 2;
const AUTHORIZATION_METHOD_QUERYSTRING_OAUTH_TOKEN = 3;
 
wey help
 
My day was over 51 minutes ago
Later!
 
10:52 PM
@Chris yup :(
later @Chris!
 
11:03 PM
build_monster($_REQUEST['seed'], $_REQUEST['size']);
what does this seed mean?
 
<phpunit bootstrap='bootstrap.php' colors='true'>

    <testsuites>
        <testsuite name='Requests'>
            <file>Entity/RequestTest.php</file>
            <file>Interactor/RequestCreatorTest.php</file>
            <file>Validator/RequestTest.php</file>
        </testsuite>
    </testsuites>

</phpunit>
^ that tries to load Requests.php.
Why?
@rdlowrey Praying you know . . .
 
from the github
<?php
/**
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
* @author Andreas Gohr <andi@splitbrain.org>
*/

build_monster($_REQUEST['seed'], $_REQUEST['size']);

/**
* Generates a monster for the given seed
* GDlib is required!
*/
function build_monster($seed='',$size='') {
// create 16 byte hash from seed
$hash = md5($seed);

// calculate part values from seed
$parts = array(
'legs' => _get_monster_part(substr($hash, 0, 2), 1, 8),
'caps' => _get_monster_part(substr($hash, 2, 2), 1, 8),
 
user895378
@LeviMorrison Not sure -- my experience with the <testsuite> block has always been one big annoyance. I'd try renaming it to something else.
 
@rdlowrey It just fails with a different problem when I remove the name altogether.
It also works if I specify <directory> instead of a bunch of <file>s.
 
user895378
<testsuite name='X-Requests'> <--- did you try just renaming the test suite?
 
11:15 PM
@rdlowrey Still tries to run it.
It tries to load the file if I don't specify at least one <directory> in the test suite.
My understanding is that I can just list the files I want to run.
 
user895378
I'm not sure. Any time I've tried to do stuff with that configuration it's pretty much done the opposite of what I expected it to.
 
Well, I guess I'm going home for the day. Hopefully I'll figure something out tomorrow.
The configuration file needs better documentation :/
 
user895378
@LeviMorrison welcome to the world of phpunit docs :)
 
I'm off guys. later!
 
user895378
@PeeHaa later dude
 
11:26 PM
what one should do when he find his company is way too stingy in terms of offering appraisal
 
change the company
if you thing that you are undervalued in your current workplace , just change it
though, judging by your profile history, @fluty , you might be overestimating your own skill
 
@tereško i know what i am , i know i need to improve a lot and i know i am not overestimating myself..because the salary package is too low.
 
@AlexCastro I didnt see that you sent me a message before, is there something else?
 
/s/thing/think .. i messed up again
@fluty , then you just have to look for more options. Just blindly quiting the current job might be a bad step. Instead you should look into some alternatives. You could try picking up some freelance jobs, look for other job ads in area. Also, you could focus on creating your "online persona" - that would entail writing something programming-related on twitter at least few times per month , posting few project on github and maybe participating in stackoverflow
it seems like your current situation is "my job sucks but there is nothing else i can do"
 
11:43 PM
@tereško thank you very much for your valuable suggestions :)
 

« first day (662 days earlier)      last day (4286 days later) »