« first day (813 days earlier)      last day (4126 days later) » 

12:00 AM
No idea. Probably just watching us silently :P
 
no body helped me
:'(
 
@MalikUsman I'm guessing nobody knows the Youtube API. I know I certainly don't. Sorry...
 
@DaveRandom its ok but the problem is in php
lol which is about youtube api
so the issue is 80% about php and 20% about youtube api
I have saved my account Youtube access_token in my database and now i want to get that token from my database and post it using Curl I am using AJAX to post Youtube api, in my youtubeeapi.php I have put code something like this but its not working,

This one is working = 'Authorization: Bearer "ya29.AHES6Zenter code hereTdlySWB5UMS1tO5u1XvYDEHejMmHHQv-yEG0X8U2k"'

When i do like this

'Authorization: Bearer "'.$tokens[1].'"'

Can any body tell me what wrong with it Thank you
 
@MalikUsman OK, and when you var_dump($tokens[1]); what do you get?
 
i get that token when i same
in my database
something
aishdiahsdhisahdiuhas.12312jscsda
youtube access_token
string(52) "ya29.AHES6ZQAA4vg-Gte_9tXIDBdhgXKWhjNJmNQk9q2xWleB5E" string(57) "ya29.AHES6ZQQNmvUTJ-KP5zWC5RssYm8g82pYRI_cGpZcYtFEwQKVZl6" string(52) "ya29.AHES6ZTdlySWB5UMS1tO5u1XvYDEHejMmHHQv-yEG0X8U2k"
 
12:09 AM
@MalikUsman What are those two strings and why are they different?
 
lol hmmm... i dont know :/
 
It's always a good idea to know what the data you are working with actually relates to :-P
 
yeah that's right but my main issue was this these tags
This one is working = 'Authorization: Bearer "ya29.AHES6Zenter code hereTdlySWB5UMS1tO5u1XvYDEHejMmHHQv-yEG0X8U2k"'

When i do like this

'Authorization: Bearer "'.$tokens[1].'"'
 
@DaveRandom here's what I found so far: ietf.org/rfc/rfc3279.txt
 
@MalikUsman Well, yes - but the issue there is obviously with $tokens[1]. If it contains the same string as the one the works when you specify it literally, then it will work. But if it doesn't, obviously it won't. So what you need to do is work out why $tokens[1] does not contain the right string.
 
12:15 AM
however, check to see if openssl adds the identifier to the signature (it might already)
 
Yeh I landed there, it doesn't know about SHA512 as far as I can work out
 
OK thanks @DaveRandom
 
@ircmaxell I wondered about that but a) It seems like it shouldn't from what I've read, it should just generate the bit string, plus you have to supply the algo to openssl_verify() and b) HE NO WORKY :-( (I tried it like that and it doesn't work)
 
other than that, I'm not sure... those rfc's are as clear as mud
 
Indeed, but I think this that I just found may be the thing that holds the key
 
user1125394
he/she has a fun description
 
user2742371
lol
 
Try opening chrome://browser/content/browser.xul in Firefox... lol...
 
@cyril also , for some reason she(?) is in my ignore list
 
12:46 AM
@cyril Thanks
 
Hi all
@DaveRandom hello
 
user1125394
@tereško normal from what this thing said in js room >:)
 
@Baba hiya
 
@PeeHaa hello
 
user2742371
12:47 AM
this is a PHP chat, so what do you think of the content of this site: awesomephp.nl
 
user1125394
@Baba yw
 
@cyril would you like to see how i used it
@PeeHaa how are 2013 treating you ?
 
user2742371
and what about the layout?
 
user2742371
the style and css
 
@YassineHoussni The simple login script uses old mysql_* functions and doesn't hash the password
 
12:48 AM
heya @Baba!
 
user2742371
I use PDO
 
user2742371
ah i understand
 
user1125394
@Baba for cooking rice?
 
@hakre .. Happy new year .... :)
 
user2742371
so I gotta update that
 
12:48 AM
@Baba Yo...
 
@Baba Pretty good up til somewhere this week when I was hit by a cold
You?
 
@cyril see
6
A: Calculate which products together would deliver the requested power

Baba Introduction This would have been a Knapsack problem but because you are not not just looking for the optimal solution you also want to find all possible combination Then you can solve this Subset sum problem + Coin Change to get : List all possible Combination and not just total combinati...

 
@Baba Yeah very happy fine new year for you, too!
 
user2742371
PDO vs MySQLi ?
 
PDO if you ask me
 
12:49 AM
@PeeHaa have been having headache since jan 1st
@DaveRandom How is your boy doing
 
user2742371
me too. that's 2-0
 
Also I'm a big fan the DateTime class in favor of date() (hint) @YassineHoussni
 
@hakre any cool projects this year
 
@Baba No, only boring stuff :)
 
user2742371
yeah? why's that?
 
user2742371
12:51 AM
@peehaa
 
Eh, I just wondered how you know all these fancy algorithm / problem names
 
I'm not a particular (understatement) fan of changing .htm(l) files to be parsed by PHP
 
@hakre really .. i don't want to believe
 
@YassineHoussni Better API, won't break after 2038
 
user2742371
hmm alright, thanks for the tips !
 
12:52 AM
np :)
 
@Baba Okay, I will do one crazy website that publishes tons of high-rated philosophical content.
 
user1125394
@Baba ah cool, en.wikipedia.org/wiki/Combinatorial_optimization was cool when i had it in school, the djikstra etc.. but always wonder why people need to solve this problems in php
 
@YassineHoussni You might want to consider adding syntax highlighting to your code snippets
 
And while it does that, it has to look good, too.
 
@cyril .. the main issue with Combinatorial optimization is processing time and power .. you have to hack your way around
@hakre really ... lol
 
12:53 AM
So I will do some electronic publishing related stuff this year. I think moar XML to rock the boat.
Either docbook for the archives or that other standard which I might need to learn for some other project, too, which is used in aviation over here in europe, so probably take that one just to cover two with one.
 
@YassineHoussni the UI is quite dreadful
 
@hakre interesting .... don't forget to send me the URL when you are done
 
@Baba No I don't send any URLs in the internet. I find that dirty.
All these inter-connections.
 
@hakre i would be doing a lot of Behavior Management and also Payment System this year .. its going to be a long stressful one
@hakre How do i get the link .. on your profile ?
 
@Baba No idea. I normally de-realize that much that I don't see any link on my profile page, so I need to ask back: "Where?"
 
12:57 AM
@cyril did you see what i did by reducing the combination with buildSales()
@hakre then i check hakre.wordpress.com
 
@Baba Too many links on that site for my taste ;)
 
hello guys, anyone familiar with Google Analytics?
 
@PeeHaa drinking beer again ???? where are you
 
@LeaHayes Yes, I know how to disable it pretty well to not get spied on me while surfing the web. Why do you ask?
My wine is gone, I mean finished. I should now cut it here ;)
 
1:02 AM
God, stas is at it again...
 
I created an additional profile for my website and added a custom filter to include Request URI that matches the pattern ^/tilesystem/ but the profile still matches other pages like http://example.com/blog
Any ideas?
 
@ircmaxell what happened?
 
The idea was to just show http://example.com/tilesystem/whatever
 
Check internals
 
@Baba Not bad. Yourself/family?
 
1:05 AM
@DaveRandom they are all fine ....
 
@Baba drinking whiskey, but I almost fall asleep from it
 
@PeeHaa guess as much ... your response is like 56 kbit/year :)
 
l.........o............................l
 
@ircmaxell I only have php-dev and actually reading...
 
user1125394
@Baba hmm nice, you solved it with discrete way, I don't remeber can the continuous way solves it everytime or not?
 
1:15 AM
@cyril thanks to you i was able to extend it to more product set and not limit it to just 3 product set ....
-7
Q: Can anyone translate Ruby into PHP?

Brian SmithI have some code that I want converted from Ruby to PHP... Can somebody help me out? It's for a bitcoin application. # Request POST https://coinbase.com/api/v1/transactions/send_money { "transaction": { "to": "user1@example.com", "amount": "1.234", "note...

 
user1125394
yes i saw that's the point of not nested for loops
 
> The content octets encode the data value as specified in [1].
Gee, thanks Wikipedia, that's very helpful.
 
user1125394
no links in [1]?
 
@cyril exactly .....
@cyril I was able to solve it but .. it was using too many processing power .. wanted something minimal
 
user1125394
drawback of discrete way
 
user1125394
1:29 AM
but you mean your solution is better than the raw greedy way?
 
1:40 AM
@ircmaxell yup...
it's sad
I feel bad for him
he's really a smart guy, but there are just some things...
 
Once I get back to my computer, I am going to reply and deconstruct his argument. I am going to take the high road and avoid the attacks or pointing out his issues...
 
but drop that init thing :P
 
88
Q: Best system administrator accident

Alan HI'm looking for amusing stories of system administrator accidents you have had. Deleting the CEO's email, formatting the wrong hard drive, etc. I'll add my own story as an answer.

 
Since when was "\x05\x00" a sensible way to encode NULL?
 
2:01 AM
no seriously wtf is stas talking
i thought after my reply he couldn't possibly disagree
well, I was wrong
for my own mental health, I'll resist replying to that today
good night
 
Hi!
Guys, can anyone of you suggest a way or a script, that converts xml to array? Maybe there is built in php solution.
 
@PeeHaa I am a step closer to victory, I have a different error message
 
user1125394
2:21 AM
$.xml2json
 
good night from here, too.
 
2:37 AM
@cyril ?
@hakre cya
 
<?php
if ($_FILES["file"]["error"] > 0) {
echo "Error: " . $_FILES["file"]["error"] . "<br>";
} else {
if (($_FILES["file"]["size"] < 1048576) && ($_FILES["file"]["type"] == "image/png")) {

move_uploaded_file($_FILES["file"]["tmp_name"], "images/profile_" . $_SESSION[myusername] . ".png");
}
}
header("location:profile.php");
?>
image saves as images/profile_.png
why is the session not carried?
@Eugene
@cyril
@D
 
did you start it?
 
yes
NO
JOWFJOISEJOEJFI
 
just wrote my two replies
 
user1125394
> Under *nix system, the command will start the process in the background. ---
 
user1125394
what are *nix ?
 
Unix/Linux
 
user1125394
what I thought thx
 
user1125394
*n(i|u)x
 
2:54 AM
> that's the entire purpose of an RFC. That's what we're doing right here. We're talking about introducing new functionality and features that may make people's lives easier.
@ircmaxell ++
 
:-D
I tried to not directly attack him at any point. Sometimes I had to let one or two minor things slip
And I checked, Stas did vote for generators ;-)
 
The closing paragraph of your second mail pretty much summarized where PHP has been before the RFC process...
 
nah, 5.0 was a pretty massive breaking change
It was just random change without thinking about anything
 
Yeah, but then there's all that "the PHP way" stuff wherein advanced features and syntax were shunned because certain people were terrified of scaring off newbies.
I mean seriously, how many years did it take for the short array syntax to actually happen?
 
Right
or closures
or namespaces
or callable type hints
or generators
 
yeah, that too
 
Hey guys,
 
yay, my new business cards should be in on Monday...
which means I'll have them in time for my next trip :-D
 
I have a question. Is there a way to compress project file size if project is written in PHP?
 
I'm rather glad that business card pricing has come down lately thanks to specialty printers.
 
3:07 AM
In javascript, you have minification.
 
38
A: Is there a point to minifying PHP?

CharlesPHP is compiled into bytecode, which is then interpreted on top of something resembling a VM. Many other scripting languages follow the same general process, including Perl and Ruby. It's not really a traditional interpreted language like, say, BASIC. There would be no effective speed increase...

tl;dr no point
 
@Charles moo.com
 
user1125394
I have a virus
 
user1125394
curl 127.0.0.1:9200
{
  "ok" : true,
  "status" : 200,
  "name" : "Fateball",
  "version" : {
    "number" : "0.20.2",
    "snapshot_build" : false
  },
  "tagline" : "You Know, for Search"
 
user1125394
that's the elasticsearch welcome message I guess
 
3:10 AM
@ircmaxell Nifty!
 
@Charles cheers
nice reply
 
yeah, I'll let you know waht they are like when I get them. I went for the mini cards...
@ircmaxell on one side (big on different color backgrounds), and my details on the other on a light blue background...
although I found it odd that I didn't put my phone number on it... Isn't that an interesting take on the state of society that phone numbers aren't really that relevant anymore...
 
3:26 AM
Stas is a retard. Starring.
 
yes
 
user1125394
hmm not a good idea
 
Just replied (against my better judgement)
> There's no way to check lots of things unless you look at the code. In fact, there's tons of more pressing issues then this. What if the code calls shell_exec("rm -rf /");... OMG!!!
Dam, I just thought of another argument against his examples of broken promises
You bring up this point in a language that thinks that strings are always ints and vice versa... Really???
 
@ircmaxell What are you guys talking about? :o
 
3:40 AM
internals
 
gotcha, shall read shortly
 
> Also unclear: If Frieman's ticket is dismissed on the grounds that he and the corporation constitute a carpool--could the San Rafael activist then be fined for driving with an un-seat-belted passenger?
 
LOL
 
=====================================================================
Number of tests :  273               261
Tests skipped   :   12 (  4.4%) --------
Tests warned    :    0 (  0.0%) (  0.0%)
Tests failed    :  124 ( 45.4%) ( 47.5%)
Expected fail   :    0 (  0.0%) (  0.0%)
Tests passed    :  137 ( 50.2%) ( 52.5%)
---------------------------------------------------------------------
Time taken      :  105 seconds
=====================================================================
I can't believe we're over 50% in only 1 week :-D
I'm off. Good night!
 
4
Q: How to show password reset option

ShipluIn my website I put password recovery option hidden. I know there are two options to deal with it. Classical way, Show it as the next sentence to the register link. Example, "Want to try? Sign up for it. If you forget password, try reset it". Here Sign up and reset is linked to registration and...

What do you think?
 
user1125394
4:10 AM
@ShaquinTrifonoff try this pastie.org/5629654
 
@cyril Doesn't work
 
user1125394
really hmm blocked port wait
 
user1125394
there, and to put data use pastie.org/5629673
 
user1125394
well more simply $.getJSON('http://138.96.242.20:9200/twitter/tweet/_search?q=message:shaquin elastic', function(d){console.log(d);})
 
user1125394
i don't know why I can't use $.post, but works with $.ajax and type:'POST'
 
4:27 AM
@cyril That works
 
user1125394
o well I'm stupid just type in your browser 138.96.242.20:9200/twitter/tweet/…
 
user1125394
?q=message:sha* works
 
5:01 AM
i need help with pdo
How do i do something like
mysql_fetch_array in pdo
 
->fetchAll(PDO::FETCH_ASSOC);
 
still not working
<?php
include('connect.php');
$db = new PDO('mysql:host='.$mysql_host.';dbname='.$mysql_database.';charset=UTF-8',$mysql_user,$mysql_password,array(PDO::ATTR_EMULATE_PREPARES => false, PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION));
$sql = "SELECT * FROM usernames";
$sth = $db->prepare($sql);
$sth->execute();
while ($row = $sth->fetchAll(PDO::FETCH_ASSOC)){
echo "<div class ='subject'>".$row['USERNAME']."</div>";
only the div tags show
 
var_dump($row);
 
where should that go
 
5:06 AM
somewhere after its set but before its used
 
there's only one place
 
how about that
 
ok
it shows a bunch of stuff
 
that stuff is what you have access to
 
how do i access it through the array
 
5:11 AM
I can't tell you that without seeing the array
 
You're fetching the entire result set into $row
so $row[0]['USERNAME']
but that's probably not what you want.. use fetch() instead
 
so $row is.. well a row
and not all rows
 
thanks!
 
rad
5:19 AM
can anyone please help me solve this?
problem: gist.github.com/4465229
its a really weird one
 
this script doesn't work either
<?php
include('connect.php');
$db = new PDO('mysql:host='.$mysql_host.';dbname='.$mysql_database.';charset=UTF-8',$mysql_user,$mysql_password,array(PDO::ATTR_EMULATE_PREPARES => false, PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION));
$description = $_POST['desc'];
$sql = "UPDATE usernames SET DESCRIPTION = ? WHERE USERNAME=? AND PASSWORD=?";
$stmt = $db->prepare($sql);
$stmt->execute(array($description,$myusername,$mypassword));
 
5:34 AM
can someone help?
 
5:49 AM
@javawarrior yo
 
Hey null!
I'm having some more problems
<?php
include('connect.php');
$db = new PDO('mysql:host='.$mysql_host.';dbname='.$mysql_database.';charset=UTF-8',$mysql_user,$mysql_password,array(PDO::ATTR_EMULATE_PREPARES => false,                                                                                         PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION));
$sql = "SELECT * FROM usernames";
$sth = $db->prepare($sql);
$sth->execute();
echo "<div align='center'><div class='subject'>Our Team</div>";
while ($row = $sth->fetch(PDO::FETCH_ASSOC)){
this is the website
 
@javawarrior please format code ,,, by ctrl+k
 
@javawarrior whats problem/error in this code ?
 
the text is all offer the place
there's no errors
but i had an image and a description in mysql
neither showed up
 
5:51 AM
should be echo "<img src='images/profile_".$row['USERNAME'].".png' width='100' height='100>";
 
it's a little better
 
make sure that in data base DESCRIPTION is in block letter
 
but my description doesn't show
block letter?
oh
it is
 
@javawarrior is description colon name is in block letter in database name
 
yes
 
5:53 AM
capital letters
ok kk what you getting in print_r($row) ?
 
erm
nothing
actually an array
but the descriptions don't show up
 
it mean there is not description in that colon
did you checked database ?
 
yes
also why does only the first entry have the correct css?
 
@javawarrior can you show your new code ? looks like there is something wrong
 
<?php
include('connect.php');
$db = new PDO('mysql:host='.$mysql_host.';dbname='.$mysql_database.';charset=UTF-8',$mysql_user,$mysql_password,array(PDO::ATTR_EMULATE_PREPARES => false,                                                                                         PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION));
$sql = "SELECT * FROM usernames";
$sth = $db->prepare($sql);
$sth->execute();
echo "<div align='center'><div class='subject'>Our Team</div>";
while ($row = $sth->fetch(PDO::FETCH_ASSOC)){
 
6:00 AM
how you getting ?

<img height="100><br><p></p><br><div class =" width="100" minisubject'="" src="images/profile_FaceRadiation.png">
 
here (`height='100><br>"`)is problem .. try this

echo "<img src='images/profile_".$row['USERNAME'].".png' width='100' height='100' /><br>";
 
yes
solved!
 
@javawarrior are you resetting css?
 
what is resting?
 
6:04 AM
@javawarrior sorry are you using any css reset
?
 
yes
 
you can try cssreset.com there is some good css reset .....
also you should work on ui and design
@javawarrior you can check see some good design here awwwards.com and can adopt some part ..
 
6:20 AM
<?php
session_start();
if ($_FILES["file"]["error"] > 0) {
echo "Error: " . $_FILES["file"]["error"] . "<br>";
} else {
if (($_FILES["file"]["size"] < 1048576) && ($_FILES["file"]["type"] == "image/png")) {

move_uploaded_file($_FILES["file"]["tmp_name"], "images/profile_" . $_SESSION['myusername'] . ".png");
}
}
?>
Warning: move_uploaded_file(images/profile_Barakados.png) [function.move-uploaded-file]: failed to open stream: No such file or directory in /home/u891835225/public_html/php/profileupload.php on line 8

Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpwHLGgY' to 'images/profile_Barakados.png' in /home/u891835225/public_html/php/profileupload.php on line 8
 
warning telling problem exactly ... either path is not correct or there is not directory .. try by using absolute path for checking
 
there is a folder
there is an image there
 
MORNING
 
HI @WEBARTO
 
@webarto mornign
@ShaquinTrifonoff hola
 
6:27 AM
OH
 
:7035788 try

if(is_dir($dir))
echo 'directory exists';
to check directory exist . before use
 
the directory is located not in that one
but in the folder holding the folder holding that script
i get nothing when i run that script
 
Success!! I've finally been able to modify a url using javascript when the user clicks a table row, the variable $id is appended to the URL and is echoed in the PHP Script! w00t!
Now I just need to know, "How can I look up other data in the db, using this variable that has been passed?"
<html>
<form>

<?php

$id = $_GET['id'];

echo $id;
?>

<input type="date"> </input>
<br>
<input list="auditors" placeholder="Auditor" />
<datalist id="auditors">
Javascript:
 
ben
 
$(document).on('click', 'tr', function() {
    var id = $(this).attr("data-recordId");
    $('#section2').load('data_entry_form.php?id='+id);
});
 
6:33 AM
i use mysql
and i use sessions
 
I've used mysql also
that is where the data is stored...
 
do you use sessions?
 
I load a table from MySQL
nope
 
use them
they save you work
 
how/why?
ahh ok.
 
6:34 AM
thay handle the data inside
but i need help
On my website, people can't upload images for their profile
maybe you can help
 
but I'm trying to set this up... so that... user clicks a row from the HTML table, then a "poof" a form is populated on the right hand side of the screen, and the form includes the data from the table row... then I can add more data using the web form... and then hit submit.
ok I'll try
so what is the issue?
 
the php file is in /folder/php/file.php
and the image i want to access is in /folder/images/image.png
what path would i use to get this image from the php script
 
src "../../images/image.png" ?
 
7:08 AM
oh sorry guys >< please close the question and i upvote for your link — Toussant Landowner 7 mins ago
lol
 
7:38 AM
1 hour later...
 
Hello
I am a beginner
of php
I want to be a zend certified developer
If today is my firstday
 
with php
then what do you think
that
when can get that certificate?
is it too hard to get?
 
@Shahriar nothing is too hard if you do work hard
 
You think I am a talkative person
Actually I am here to get the talkative badge
 
7:48 AM
@Shahriar i know there are some ... who have got zend certificate it may be tough ...
 
Posted 10 messages, with 1 or more starred, in chat
 
@Shahriar its isn't talkative ...
no one here gonna just star message .. because other want badge ... imo
and come here for only badge ...
 
you could :D
 

« first day (813 days earlier)      last day (4126 days later) »