« first day (1211 days earlier)      last day (3962 days later) » 

14:00
>
@Muhammet the latter is when using xhtml
@Muhammet Depends on your doctype
HTML5 doesn't care either way.
user1607528
i see, until now i used /> :)
user1607528
Anyone has experince with stripe payment api ?
user1607528
I am getting Call to undefined method Stripe_Object::save() even everything else works before that
14:13
@Muhammet sigh
m59
m59
That naming almost assures me what the issue is.
@Muhammet This is a generic PHP error. It doesn't require any experience with the Stripe API to solve it. The error means exactly what it says: you were trying to call the save method on an object that doesn't have this method.
user1607528
I mean it crashes only in the saving part. I have tested, everything is right as it supposed to be until the last line.

`Stripe::setApiKey(STRIPE_PRIVATE_KEY);
$customer = Stripe_Customer::retrieve($profile['stripe_id']);
$a = $customer->subscriptions->data;
$subscription = $customer->subscriptions->retrieve($a[0]->id);
$subscription->plan = "plan2";
$subscription->save();`
user1607528
@Gordon I know, but everything is as its shown in their api example
m59
m59
so, somewhere in that code is
public function save() {

}
?
user1607528
14:19
@m59 no its a method of stripe api
m59
m59
....
if that call is in your code, and doc tells you to call Stripe_Object::save() their docs are out of date
If the call to Stripe_Object::save() is in the api code, their api library is broken. Ask them to fix it.
user1607528
I emailed them
m59
m59
Are any of you guys really good with apache? I could really use some help. It's been hours.
14:22
@m59 We can only try.
user1607528
I think something is wrong with the Stripe, because if its a mistake of mine, it would crash on $subscription->plan = "plan2" if I didnt do it right
m59
m59
I disabled mod_dir for starters
My plan was/is to just route what needs routing. i don't need it to attempt this and that.
So, consider this structure: www/foo/bar/.htaccess
I can use that file to route things in subfolders like:
RewriteRule ^baz.*$ baz/index.php [L]
So, foo/bar/baz OR foo/bar/baz/ are routed to www/foo/bar/baz/index.php
That's perfectly what I wanted.
However, the folder actually containing the htaccess is being fail.
@Muhammet before the call to save insert print_r(get_class_methods($subscription));
this will tell you which methods exist on that object
user1607528
@Gordon thanks, i will check it
m59
m59
Ohhh, I did just notice it's better than it was. But why is the / still required on a request like foo/bar ?
Well, I know the issue is because foo/bar won't access the htaccess file in bar directory
Wheras foo/bar/ will cause it to be read and then I'm set...
14:28
0
Q: unable to save or cancel subscriptions using Stripe

jco40Using stripe's API with Ruby on Rails I am unable to save subscriptions. I am able to retrieve and update and save customer objects: customer = Stripe::Customer.retrieve(some_customer_id) #this works customer.save #this works I am also able to retrieve subscriptions: subscription=customer.sub...

different language, same problem. apparently you are using an outdated client library
m59
m59
So, I thought about adding a slash to the end of all requests with a rewrite rule in `httpd.conf. That got strange results.
user1607528
@Gordon I see now, thanks a lot, so downlaoding a new library should fix this
@Muhammet yes
user1607528
thanks a lot
m59
m59
14:29
It would actually tell me that foo/bar/index.html couldn't be found - suggesting that the slash was added, bar htaccess was read, and the rewrite rules applied, but then it couldn't find files.
@m59 because your rewrite rule only rewrites urls with "baz" in it and foo/bar doesn't have "baz"?
m59
m59
@andho apologies: RewriteRule ^.*$ index.php [L]
that's not it
user1607528
@Gordon actually earlier today i read that question, but I think from now I need to pay more attention and fully read it. I cant believe it
user1607528
I guess I always look for straight ready answer, that is one bad side of me
14:33
@Gordon You've probably already seen this: codeascraft.com/2012/05/22/blameless-postmortems It's only when an engineer does something stupid like disable the broken tests before committing that bunny ears would be appropriate.
user1607528
It's so hard to read on black background
@m59 rewrite rule was not applied. Otherwise it wouldn't complain about foo/bar/index.html right?. Turn on logging for Rewrite module and check the logs
@Muhammet my thoughts exactly
user1607528
:)))
woww me 2 :P
hello guys. Does anyone here know about XPCOM Mozilla API ?
@Danack thanks for the link. Haven't seen it. I absolutely agree about not blaming people for mistakes. im not a friend of a zero defect mentality either. blaming is not the intention of our bunny ears. the bunny ears - for us - are a playful support item during our transition from sprint based development to trunk based development.
m59
m59
@andho I somehow got it working =D
running with no mod_dir. Now I feel like a bawss (until someone let's me know this is awful)
@Danack they are not meant to belittle the user or as duncecaps. Also, they won't be used if the team decides against them in the next retro.
14:58
@Gordon tbh I wish we had something similar at my last company. The vast majority of our outages were caused be either i) People disabling tests 'temporarily' and then forgetting to re-enable them or ii) The tools being totally inadequate - i.e. someone who's been woken at 3am and had to edit a text config file by hand and not to suprisingly makes a one character error.
one of those is clearly a problem caused by management decisions - the other deserves a cone of shame.
@Danack Yeah, but you don't get managers to wear them ears ;)
Btw, I dont think people should be ashamed. I see the ears as a self ironic way of admitting and reflecting I did a mistake. It's an expression of taking responsibility for a mistake I did.
user1607528
15:19
Does it happen to you that sometimes little things take your hours to find the bug
user1607528
It's weird, it returns true and errorInfo is empty but db is not updated

$sql = "UPDATE users SET plan_id = ? WHERE user_id = ?";
$stmt = $this->db1->prepare($sql);
if($stmt->execute(array($user_id,$plan_id))){
return true;
}
else{
return false;
}
user1607528
I checked the values of $user_id and $plan_id they are correct
m59
m59
I'm reading tutorials talking about groupadd, but it doesn't mention where you run this code ;(
What do you mean by "where"?
m59
m59
cmd prompt?
15:24
Where do you normally run your commands? :P
m59
m59
My best guess was apache\bin\httpd groupadd etc
huh? What does apache have to do with it
m59
m59
heck if I know =D
15:26
It's just a normal nix command. So groupadd myawesomegroup
m59
m59
People give answers without explanation. Everything just says "create this" and no real attempt to explain why or what it actually is.
@m59 It doesn't matter where you run it.
user1607528
@Danack let me see
m59
m59
I tried that also, just randomly. I'm on windows, so that's probably the issue.
lulz
15:26
APPLY DESK DIRECTLY TO THE FOREHEAD
m59
m59
;D
I'm switching to Linux as soon as I get a job.
^ catch 22 lol
user1607528
@Danack none 0 row. How the heck it returns true when executing then ?
user924016
=] been moving my brothers stuff all day
user924016
finally some back at the screen
@Muhammet because it didn't cause an error, which doesn't mean it's doing what you want.
user1607528
15:30
@Danack what could be the problem, i mean everything is in place, i can't imagine, if it doesnt cause errors it looks like everything is right ?
@Muhammet btw, the problem is that your code is bollocks (sorry, technical term) - Execute doesn't take any parameters. You're using prepared statements but not binding the params - php.net/manual/en/mysqli-stmt.bind-param.php
user1607528
@Danack so I have been passing variables directly for 2 years ? :D
I have no idea what you have been doing - but execute takes no parameters php.net/manual/en/mysqli-stmt.execute.php
doh - not mysqli...
user1607528
15:33
yep :D
user1607528
isn't pdo better than mysqli ?
user1607528
anyways what can I do, i am lost
user924016
^ not really, they can do something "the same". One provides something the other does not have
user924016
Like pdo is a dbal for alot of databases systems
user924016
mysqli is for mysql
user1607528
15:38
hm, can you help me with my problem above please
user924016
@Muhammet I do not think so =]
mysqli also have more features than PDO, but ofcourse it's specific to mysql
user924016
^
user1607528
My problem is that query executing returns true but affected rows are 0.
user1607528
19 mins ago, by Muhammet
It's weird, it returns true and errorInfo is empty but db is not updated

$sql = "UPDATE users SET plan_id = ? WHERE user_id = ?";
$stmt = $this->db1->prepare($sql);
if($stmt->execute(array($user_id,$plan_id))){
return true;
}
else{
return false;
}
15:41
@Muhammet The way I would debug it if it was my problem, would be i) step through it with a debugger - there may be something obvious that you're missing. ii) If that didn't work, remove code until only that single thing is being called. You will almost certainly find the problem by doing that.
However, drumroll please.
plan_id = ? WHERE user_id = ?
$user_id,$plan_id
Why are they in a different order?
user924016
^ =]
user1607528
damn
user1607528
how i couldn't see that stupidity level at 10
user924016
lol at the STARt img Fabian (ol ie one)
user1607528
does drumroll please mean when you get success tell me ?
user924016
15:49
@Muhammet did it not work changing the order?
user1607528
it surely did :D
user924016
=]
user924016
great
user1607528
i feel dumb
user1607528
@danack thanks, the debugging method you wrote is the usual way i do it :)
15:50
user1607528
haha :)
user924016
@PeeHaa have you started that chat transcript scrape thingy?
@RonniSkansing I think I will run the script starting tonight somewhere
user924016
Ah cool. Good luck on that.
tnx :)
user924016
16:37
Having a good weekend? (all you ya)
16:47
whats with all the new elephants. why yellow. yellow is hadoop already!
user924016
=]
not php
user924016
hehe
Why does childNOdes->length return a number that's greater than the number of actual nodes?
@SineLaboreNihil likely because you consider only element nodes to be nodes
16:49
@SineLaboreNihil Why do you assume it returns an incorrect number? ;)
@Gordon Ok, and what does length consider them to be?
@PeeHaa Well I counted about 30 nodes in this file: news.yahoo.com/rss, but var dump of channel->childNodes->length returns 41.
@SineLaboreNihil there is likely also DomText nodes in it. Try to load the document without preserving whitespace
@Gordon The text nodes I see in it should be grandchildren of the channel node.
When in doubt loop through them, inspect the type and use DOMNode::getLineNo()
user924016
@Gordon the elephants remind me of South Park, the episode "A Scause for Applause"
16:54
4
A: Printing content of a XML file using XML DOM

GordonExplanation for weird #text strings The weird #text strings dont come out of the blue but are actual Text Nodes. When you load a formatted XML document with DOM any whitespace, e.g. indenting, linebreaks and node values will be part of the DOM as DOMText instances by default, e.g. <cellphones>\n\t

@Gordon Thanks. :)
@RonniSkansing i dont like SP so I don't know that episode
@Gordon Gordon, that worked beautifully. Great explanation. I voted it up. :) Thanks. :)
17:02
@BenjaminGruenbaum you around?
@MadaraUchiha sup?
Are there binary trees in C#?
user924016
@Gordon oh ok =] It reminds me of this horrible class of wearable/takeable items that promotes a statement to wear/show
@SineLaboreNihil thanks
(As in, native implementation of them)
user924016
17:04
a tactic used for example in breast cancer awareness/donation
@Gordon The guy that asked that is Serbian. :) I understand his XML node names. :D
@BenjaminGruenbaum?
@MadaraUchiha yes, of course.
@MadaraUchiha why?
@BenjaminGruenbaum Brother's homework, apparently he didn't listen/didn't take notes in class, and has no idea how to work with a binary tree
Since I never worked with them, I don't even know the public API for one XD
Does this sound about right? pastebin.com/nAHY6Q9z
17:13
@MadaraUchiha oh, there is no binary trees exposed to the outside, it's too basic of a data structure. They're used for stuff - I think SortedDictionary for example
@MadaraUchiha you don't need Get and Set methods in C#, use getters and setters
Also, make the methods virtual for inheritance
@BenjaminGruenbaum 11th grade homework, move on.
private BinTreeNode<T> Left {get; set;}
Shorter, does the same thing as your getters/setters , no need for ()
public class BinTreeNode<T>
    {
        private T info;
        private BinTreeNode<T> left { get; set; }
        private BinTreeNode<T> right { get; set; }
        public BinTreeNode(T info,BinTreeNode<T> left = null, BinTreeNode<T> right = null)
        {
            this.left = left;
            this.right = right;
            this.info = info;
        }
        public override string ToString()
        {
            return string.Format("({0} {1}, {2}",left,info,right);
        }
    }
@MadaraUchiha
That's 13 lines, kind of shorter than your 46, does the same thing
@BenjaminGruenbaum I'm just trying to figure out the public API for a binary tree XD
The question is "write a function that gets a tree and returns a boolean based on whether the left side is a reflection of the right side of the tree"
Hey. I change my name to full. (Adding A.) Try to mention me for test.
@MaciejA.Czyżewski
@MadaraUchiha ooo thats works, thx!
17:26
@MadaraUchiha You want a C# way to do it.
@BenjaminGruenbaum I want a way to do it XD
You want to define a GetEnumerator who is a generator
But let's not pollute this chatroom
17:38
aaaaagghhh!
I just wasted 2 hours tracking down a 4 year old bug in PHP (https://bugs.php.net/bug.php?id=50688)!
I wouldn't mind so much if I was on an old version of PHP, but I'm running 5.5.9 and it still isn't fixed!
/rant
user924016
^ just tried.. result:
string(59) "usort(): Array was modified by the user comparison function"
=/
Do I live with a test that fails, or use the evil @?
@vascowhite fix the test
@Gordon How? The test is fine, but generates a warning because of this bug in PHP.
@vascowhite if it's a warning you can set expectedException()
17:48
@Gordon Never thought of that. Thanks.
@vascowhite PHPUnit_Framework_Error_Warning
it will then fail though once that bug is fixed :)
@Gordon Yeah, just copied it from PHPUnit output, thanks :)
@Gordon Thanks, very much. That worked.
@vascowhite \o/
Does having your RAM usage full all the time reduce the lifetime of the RAM or should it still pretty much last forever
was just wondering:
I have 3 columns, id, name, cat, how can I echo ALL names using the same cat?
user924016
18:00
David can you mention anything that does not wear over usage?
user924016
Even magnets do... =]
@Gordon I'm ok so. Was just wondering because my laptop is about 3 and a half years old and when I've all my programs running the RAM usage is about 85% for the whole day
@Gordon Do you know anything about virtual machines?
18:19
@David i know how to use them
I have Ubuntu 13.10 installed using virtualbox. I/O seems to lag a bit when using the OS
using the ubuntu OS. It lags by not even a second but you can notie it
Is that normal?
@David hmm. no idea. sorry. i never noticed anything like that, but it might be I am just bad at noticing ;)
@Gordon The host OS is Windows 7, I have firefox, chrome, mozilla thunderbird, virtualbox, phpstorm, apache, mysql server, photoshop and a few other things running but still have 20% ram left and the CPU is basically idle
I am thinking maybe it could be my graphics card that is causing the delay because I have my desktop extended to a 40 inch 1080p monitor
and the ubuntu is on the big monitor
Hmmm I don't know if I can use this OS in the virtual machine the lag on the input is too annoying even though it is just a few miliseconds
@David sorry. that's a bit too specific :)
@David David before going into the whole virtual machine route please try Google App Engine and Heroku. Not only are they free but they are a much better alternative if you are going to do just one thing like run a webserver.
@mAsT3RpEE I'll take a look thanks.
Before I go, does anyone know how much of a dependency injection container should be automatic?
@mAsT3RpEE Oo
@mAsT3RpEE are you confusing VPS with VM?
@David not sure I understand the question. A DIC should require some sort of initial setup and then it should give you the defined services without any further configuration. have a look at the Sf2 DIC or RGInjector
good morning

If someone has a sec could you take a look at this question I posted?

http://stackoverflow.com/questions/21649337/importing-post-from-database-id
@Gordon For example, your application does not have a Router so you make one, should you just be able to make one with no configuration(or very minimal) added to your DIC? The DIC will just use reflection to inject the dependencies into the new Router or is it always better to just do object instantiation and inject its dependencies manually but encapsulated in the DIC? Hope that is clear enough.
@Gordon I'm not VPS cost the same as VM so why even bother with a restricted VPS?
18:41
@daugaard47 any particular reason for including the server name in the URL?
@David +1 please give a link to a sample php dependency injection container.
@mAsT3RpEE A VM is free. At least the one David is talking about. He's running it on his local machine.
@Gordon I do this so I have a direct path to my links/ images when I move it from my dev site to the live site.
@Gordon why do you suddenly know that much about cake
shame on you ;)
@David that depends. Reflection Based Injection is one way to do it. Wiring it up is another.
18:45
@Gordon When you saying wiring it up do you mean doing it manually inside the DIC?
@David either that or through some config file. for instance, Sf2's DIC allows you to setup the DIC from an XML or a YAML file in addition to the manual wiring in PHP
@daugaard47 but when you move it over to the live site, it will have the server name of the live site
Using DOMXpath with the query '/html/@xml:lang' or '/html/@lang' returns empty for me on for example this page: bikbok.com/se/Categories/Collection/Knitted/L-Wool-jumper/… Why is this?
@Gordon that's how I do it with all my links to make an absolute path to the file. I shows up as http://mysite/imagefile

Are you trying to say this is a security risk or bad practice? If so what would you recommend using instead?
@Gordon watched that video?
@daugaard47 no, I was just wondering why you don't simply use /path/to/image without prepending the server name
@BenjaminGruenbaum no, I did my laundry, went shopping and checked out elasticsearch
18:56
@Gordon j'accuse!
@BenjaminGruenbaum je ne parlez francais
@daugaard47 but speaking of security This $result = mysql_query("SELECT ID FROM knollsnews WHERE id='$id'"); is a classic SQL Injection vulnerability.
@daugaard47 apart from that, you are using the deprecated mysql extension. it will be removed soon. Better use PDO or mysqli to future proof your application
@Gordon Hmm didn't know about /path/to/image that I will have to look into that.

Do you happen to know a solution I could use to get my problem at hand working properly?
@Gordan I realize my code is deprecated, but cant seem to find a good book that teaches the new practices. Do you know of any?
@daugaard47 doing $id = (int) $_GET['id']; should fix it. If it doesn't make sure the ID is actually send to that script, e.g. do a var_dump($_GET) in that script to see what it submitted
@Gordon Ok thank I will go try this.
44
Q: Are there good Tutorials on how to use PDO?

openfrogMaybe someone did a tutorial that shows the important thing: Setting everything up and using it with MySQL?

19:06
Sweet thanks!
also make sure to have read
2429
Q: How can I prevent SQL injection in PHP?

Andrew G. JohnsonIf user input is inserted without modification into an SQL query, then the application becomes vulnerable to SQL injection, like in the following example: $unsafe_variable = $_POST['user_input']; mysql_query("INSERT INTO table (column) VALUES ('" . $unsafe_variable . "')"); That's because th...

19:17
@Gordon well that didn't seem to work. the var_dump came back with this....?

array(1) { ["id"]=> string(2) "60" } I don't know what that means...
@daugaard47 php.net/var_dump
You probably ought to start learning how to read the fine manual. It will be quicker than asking people online every time.
@daugaard47 it means the id got submitted. so using $id = (int) $_GET['id'] should work for your query
@ErikLandvall This is because if you use DOMDocument::loadHTML that xml:lang attribute is parsed as local name, not as namespaced name. Normally you would need to register namespaceURI http://www.w3.org/XML/1998/namespace as xml and then you could query it.
@PeeHaa what? where? why?
But the HTML parser makes it a local-name, you need to query it as one:
//html/@*[local-name()='xml:lang']
19:25
@hakre Yes .. thanks that works. But there is a lot of new syntax that I'm not familer with..
@hakre What do you mean by register a namespace? I tried the function registerNamespace('xml', 'url...'); Still the same issue..
@Gordon The css / styling of my post, but all the info is missing. Title , date , description... Here is how I have the code written out:

`<?php
$id = (int) $_GET['id'];
$result = mysql_query("SELECT ID FROM knollsnews WHERE id='$id'");
while ($image=mysql_fetch_array($image));

{
?>

<li data-id="id-<?=$image["id"] ?>">
<article class="postwhite">
<h2 style="margin: 10px 0 !important;"><?=$image["title"] ?></h2>
<img alt="<?=$image["title"] ?>" src="http://<?php echo $_SERVER['SERVER_NAME']; ?>/knolls_file_manager/source/NoticesImages/<?=$image["file_name"] ?>" class="img-max" title="<?=
@ErikLandvall you can not register that in this case, because the attribute has (wrongfully) no namespace.
@hakre ok, so your query is the only solution?
it would have been something like $xpath->registerNamespace('xml', 'http://www.w3.org/XML/1998/namespace'); but as written, this does not work (but is standard)
user924016
@daugaard47 "Discussion for all things PHP. BEFORE chatting in this room read : git.io/chatroom-pact"
19:30
@ErikLandvall AFAIK yes.
The problem is that HTML has no namespaces.
@RonniSkansing okay sorry for the code dump
@hakre ok thanks man .. tried this a lot .. (beer)
user924016
np
prost!
heading for some saints row, l8ters
19:34
Hi please help me PHP error.
http://pastebin.com/YJThEJqZ
Error message:Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\dd\cat1.php on line 12
Line 12 would be line 4.
@MadaraUchiha I did, but I couldn't find how it would be fixed in my situation.
@RahulKhosla It boils down to "your query is invalid, your connection returns false, fix your query, and make error checks properly".
I am using google maps api v3 and you have to define the map element like this:
Also, Please, don't use mysql_* functions in new code. They are no longer maintained and are officially deprecated. See the red box? Learn about prepared statements instead, and use PDO or MySQLi - this article will help you decide which. If you choose PDO, here is a good tutorial.
19:39
var map = new google.maps.Map(document.getElementById("map-canvas"),
    mapOptions);
@MadaraUchiha I've already queried on the same page (before). Can I double query or not?
thats great but I need to use a class name instead so I can have multiple maps on the page
@RahulKhosla Yes.
Also thanks for links.
19:40
Mmm, this makes stuff confusing. Could you take a look at the full code and help me pit @MadaraUchiha ?
@daugaard47 while ($image=mysql_fetch_array($result));
@RahulKhosla Do some error checking.. you should go the exact error easily...
Use the Google Luke!
I really don't mind helping you out, but you gotta learn how to help yourself, before asking for others' help :)
@MadaraUchiha I think I love you.
You just helped me fix it :)!!! thanks.
@Gordan still same as my previous comment, stylinging of my post is there, but all the info is missing...? IDK I'll get it figured out sooner or later. Thanks for the help though I appreciate it.
19:59
@vascowhite look who showed up @teresko

« first day (1211 days earlier)      last day (3962 days later) »