« first day (444 days earlier)      last day (4519 days later) » 

9:00 PM
Hello @Neal
 
how do I show the changes in a svn repo?
like git diff
 
@Bracketworks And the same to you!
@NikiC svn diff doesn't work?
 
argh, i just hate svn
 
i wish there was an eclipse plugin for git with a big COMMIT button
 
git diff                      svn diff | less
git diff rev path        svn diff -rrev path
 
9:04 PM
All I want to do is revert one freakin comment
 
@NikiC And svn hates you too, so there
 
But SVN doesn't support reverts so you need to do some strange reverse merge
But when I try that I get some error about an SSL handshake
wtf does it need ssl for to revert a commit?!
 
@NikiC It supports reverts...
Ohh, revert a commit. yes, you need to do a reverse merge (which is easy)
 
@ircmaxell Yeah, by reverse merge ^^
 
the thing is revert means something different between the two
 
9:07 PM
yeah svn revert = git reset
 
This is technically off-topic, but everyone here will appreciate it.
(root@brainslug) (none) > CREATE AGGREGATE FUNCTION median RETURNS REAL SONAME 'udf_median.so';
ERROR 1125 (HY000): Function 'median' already exists
(root@brainslug) (none) > select median(1, 2, 3, 4, 5);
ERROR 1305 (42000): FUNCTION median does not exist
Dear MySQL, if you can't keep track of your own user defined functions, please explain to me why I'm supposed to trust you with my data.
 
yeah
@Charles ROTFL...
 
@Charles lol
 
@Charles Why are you doing this as root!
 
@CaptainGiraffe It's the only account in the environment with the privs needed to perform UDF manipulation.
 
9:11 PM
Heh, I give up. I'll just tell someone else to revert it.
 
@Charles Ah, that makes it ok. Ok go ahead.
 
@Charles DROP FUNCTION median?
 
@ircmaxell Database not selected, followed by a function not found when the database is selected.
The root cause is a change in MySQL distros from those provided by RHEL/CentOS to Percona
 
@Charles HUH? Functions are not tied to databases
 
@ircmaxell I know this, but MySQL apparently does not.
 
9:15 PM
@Charles lol
 
Anyway, I think the .so file itself is just invalid for the new binaries, so I'm gonna recompile things and try it later.
 
 
Well, that was a pleasant surprise. Much easier to add comments to my github pages blog then I anticipated.
 
@Neal oO
 
@CharlesSprayberry disqus?
 
9:30 PM
<?php
    function myFunc() {
           return array('foo', 'bar');
    }
    $val = myFunc()[1]; // Parse error: syntax error, unexpected '['
<?
 
@NikiC yep
 
I don't see what is wrong her.e
 
@rlemon you're using too old of a version of PHP
 
@rlemon freenode would say !+ fad
 
maybe i've been spending too much time in JS land.
my php version should be latest.
 
9:31 PM
@rlemon Correct, that feature is not supported until 5.4 (which is not out yet), hence your install is too old
 
PHP 5.3.6-13ubuntu3.3 with Suhosin-Patch (cli) (built: Dec 13 2011 18:18:37)
Copyright (c) 1997-2011 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies
 
@Neal There's still SQL in your controller
 
boooo
 
@rlemon You using Ubuntu?
 
yes sir i am
 
9:32 PM
@rlemon Suggestion: stop, format, install a real server OS...
 
@rlemon That's not very latest ;) We're at 5.3.8 right now :)
 
Suggestion ignored. this is my local machine.
server is seperate
 
@rlemon What is server running?
 
whatever godaddy runs
 
@ircmaxell KDE ^^
 
9:33 PM
but we are switching from godaddy
 
@rlemon :-X
 
so the sky is the limit when i pick a new host.
 
@rlemon uuuuuh
 
@NikiC If you're running KDE as your server, I'd really like to see that. No, I mean seriously, I'd like to see that as I have no idea how you'd do that without a kernel
 
@ircmaxell That was a joke ;)
@ircmaxell I'm running FreeBSD which is "as kernel as one can get" imho (apart from OpenBSD)
@ircmaxell But I really think there are people who run KDE as their server :P
 
9:35 PM
ok so long and short is i need to first return the array to a local variable then access the elements within?
 
@NikiC :-D
@rlemon either that, or wait until 5.4 comes out :-P
 
yea I'm not waiting on that :P I am seriously shocked this is not implemented yet. seems pretty basic to me.
 
@rlemon Yeah. Or list(, $val) = myFunc();. Or $val = ${!${''}=myFunc()}[1]; :)
 
@rlemon Feature wise, yes. But there are all sorts of implications with memory management and the like...
 
I suppose.
 
9:37 PM
@ircmaxell There are?
 
@NikiC there were. They did it correctly, but it wasn't a trivial thing to do
 
@ircmaxell I don't believe you. Imho the only problem with it was that somebody had to modify the completely f*cked up parser.y, that's all. Nothing bout memory management.
 
Well, they supposidly did it correctly. Time will tell if that's true...
 
@ircmaxell i realize that
but i fixed other issues
 
@Neal bandaids on a gunshot wound...
 
9:39 PM
@ircmaxell Do I really have to find the array dereferencing commit to prove that it's a trivial change?
 
@edorian: thinking of you when reading this file: github.com/maniator/SmallFry/blob/bootstrap/smallFry/…
@NikiC yes
 
@ircmaxell nice :D
 
@ircmaxell ?
 
@ircmaxell uh :(
 
the whole idea of my library was to able to do sql from the controller
 
9:40 PM
So lets start blameing...
 
@Neal watch the video here:
7 hours ago, by edorian
My first publicly available talk at php conference on video: Stop Wasting Time By Applying Clean Code Principles It's about coding practice, professionalism, testing and getting stuff done.. mostly
 
@Neal Constructor? Huh? You mean Controller?
 
@ircmaxell yea
sorry
 
@ircmaxell See, simple parser.y only changes. Apart from those being ugly and incomplete and stuff ;)
 
9:42 PM
@ircmaxell now i am employing alot of the methods that were told to me earlier in the code
 
@NikiC So I was wrong. Fair nuff. Thanks!
 
@ircmaxell ha! for once :P
 
@NikiC It happens more than that
 
@ircmaxell It does?
 
@NikiC better mark it on your calendar ;)
 
9:45 PM
Dude, why is it that nobody understands how transactions work with MySQL?
 
@CharlesSprayberry yeah, great day :P
 
github.com/maniator/SmallFry/blob/bootstrap/smallFry/… <-- That will cause LOADS of problems...
 
user1385191
@Neal you're still doing far too much within your constructors
 
Forget "with MySQL" -- transactions are a minefield in general.
 
@Charles Nah, they are easy to use well
 
9:47 PM
@ircmaxell And easy to misuse poorly.
For example, the code I have to deal with at work.
 
user1385191
include $cwd.'/../../view/missingfunction.stp'; //no such function error is begging for a constant or two
 
@Charles agreed
@MattMcDonald that's begging for more than that
 
user1385191
heh
 
@MattMcDonald for example?
 
user1385191
you also shouldn't feel forced into jamming a code into a one-line return statement
 
user1385191
9:49 PM
return isset($this->template_vars[$v])?$this->template_vars[$v]:false;
 
@ircmaxell why is that?
it doesnt for me
 
The class(es) designed to work with inventory blindly assume that they own the transaction. In the past, this was a safe bet because the moron that originally wrote the system had no idea what he was doing. As we've been adding more and more safety checks, we've been having more and more mysterious bugs pop up that can all be drawn back to a misplaced commit or revert....
 
user1385191
@Neal include $this::PROJECT_DIRECTORY . "path/to/oblivion";
 
@MattMcDonald ??
im not doing includes in constructors
 
user1385191
forget it, the context has been lost
 
9:51 PM
@Neal Simple. If there's an error, MySQL will implicitly rollback the transaction and close it. So your code still thinks it's in a transaction, but it's not. Hence leading to loads of problems...
@Charles Ahhh, nice...
 
@ircmaxell why is that not good?
@ircmaxell so how should i handle transactions?
 
@Neal errors are not to be thrown from autoloaders.
 
@ircmaxell so how/when should they be thrown?
 
@Neal Don't. And if you must, trap errors in the query function and throw exceptions from there. But there shouldn't be a need to keep track of inTransaction on PHP's side...
 
@ircmaxell then how do i inform the user that the Class could not be found?
@ircmaxell dont remember why i had that transaction boolean there.
 
9:56 PM
@Neal PHP will do that for you. And can you tell me when that would be an acceptable application state?
 
@ircmaxell what do you mean?
 
what do you mean what do I mean
 
@ircmaxell what does that mean "acceptable application state"?
 
@Neal I mean that it's stable to continue in some way or form... PHP will fatal for you, let it...
 
@ircmaxell im still confused
what are you referring to?
 
9:58 PM
don't error or throw exceptions in autoloaders
 
@ircmaxell well i don't. That was scrapped. and is now commented out
 
why comment? there's version control for a reason...
I'll never understand why people are afraid to delete...
 
@ircmaxell lol thats true. ^_^ removing now.
im aslo going to remove that transaction boolean
 
@ircmaxell it's caused by lack of practice (in the sense when you get used to it, you'll stop commenting at some point)
 
@ircmaxell rrrg its not letting me commit
 
10:03 PM
:-D
 
Pushing to git@github.com:maniator/SmallFry.git
To git@github.com:maniator/SmallFry.git
 ! [rejected]        bootstrap -> bootstrap (non-fast-forward)
error: failed to push some refs to 'git@github.com:maniator/SmallFry.git'
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes (e.g. 'git pull') before pushing again.  See the
'Note about fast-forwards' section of 'git push --help' for details.
idk what that means
i tyed pull and it ddt do anything
ok i fixed it
@ircmaxell removed the sillyness from the git (the ones that were mentioned for now)
 
it means that you are trying to do a non fast forward push ^^
 
user1385191
I just took a look at the FormValidator file...
 
reddit.com/r/PHP/comments/o19zj/the_microphp_manifesto/c3dmiev <-- That's a fun thread (and I somewhat agree with the OP...
 
@MattMcDonald lol thats not my file. see the comments
 
user1385191
10:06 PM
it's some hideous mix of OOP and procedural code
 
user1385191
so why commit it if it's an obvious pile of junk?
 
reddit is slow right now
 
@MattMcDonald it works. and if u have another solution ill gladly take it ^_^
 
user1385191
@Neal the solution is: "use your brain"
 
@MattMcDonald oy...
@MattMcDonald i just searched for a form validator that worked on google
so that is what i am using
 
10:08 PM
hi to all,
anyone who can help me with this: http://superuser.com/questions/374277/php-ssh-connect
 
user1385191
@Neal given that you work as a PHP dev, should you not be able to write one yourself?
 
@MattMcDonald lol i have no time
I have a bajillion other things to do
I manage a lot of database apps at my office
@ircmaxell why can't I create any tags on this branch?
fixed it
crap.how do i delete tags?
 
lol
 
@Neal Just edit them out of the question(s) they were added to
or wait for me to do my few-times-a-day NUKE ALL THE NEW TAGS patrol
 
@Charles say what?
@Charles I mean git tags
 
10:16 PM
Oh, nevermind then :)
 
@ircmaxell do u know?
@Charles :-P
 
@Neal Google knows google.com/…
 
not without looking it up
 
@CharlesSprayberry thanks ^_^
 
@Neal No problem. Just practicing my SO answering skills.
 
10:22 PM
@CharlesSprayberry ^_^
w00t
 
user1385191
oh boy
 
user1385191
the FormHelper class is a colossal mess
 
@MattMcDonald you like complaining but not giving any solution lol
 
you wouldn't like our solution
 
user1385191
well, trimming your lines to a sane length is a start
 
user1385191
10:27 PM
then cleaning up methods so they don't require 7 parameters...
 
user1385191
turfing any and all HTML injection would follow
 
Why are you writing new code using the PHP 4 OO syntax. Why.
 
user1385191
I've recommended you read "Code Complete 2" at least twice
 
@Charles why not?
 
user1385191
lol
 
10:30 PM
 
user1385191
if 95% of the parameters in a method are null by default, you might want to ask yourself what purpose they really serve
 
@Neal Failing to adopt modern practices is a bad sign. By modern, I mean "defined in the past five years."
 
@MattMcDonald thats true.
@Charles what practices are wrong in my code?
 
@Neal PHP4-era syntax has been unnecessary since PHP4 was retired.
You're also using it inconsistently. In the form validator, you're all PHP4, but in the session manager you're mixing the two.
 
10:34 PM
@Charles the form validator is not my code
 
Then what the hell.
 
@Charles but can u show me an example in the session manager?
 
user1385191
what the...
 
Use of private without corresponding public, really
 
user1385191
I just found two private static members in a class of yours
 
10:35 PM
also, what is the class intended to do?
 
@Charles ?
@Charles handle session data without the use of $_SESSION
 
@Neal Why is this a desirable thing to do?
 
@Neal Here's something that seems very odd. Why return in __construct()? github.com/maniator/SmallFry/blob/bootstrap/smallFry/…
 
user1385191
^^^
 
@CharlesSprayberry haha oops. originally that was not the constructor. forgot to remove the return when i changed the name.
 
10:37 PM
@Neal I also don't like how you set your properties in that class. A real mess to try to decipher.
 
user1385191
I'll play the layman, but what exactly is the point of binding properties to a class if you can't access them anyways (private static)?
 
@CharlesSprayberry what do you mean?
I should add comments, no?
(i was always bad with commenting)
@MattMcDonald ?? where is this?
 
@Neal I don't necessarily mean comments but you just list all of the properties with one declaration. Its just confusing to look through and see the different values.
 
@CharlesSprayberry lol ahhh. well i started splitting up variables. did not do it yet in that class.
That I know I need to change
its on my list
 
10:40 PM
@MattMcDonald you obviously do not userstand what a private variable is lol.
 
user1385191
...
 
@MattMcDonald I removed that file. it was unused.
@MattMcDonald Look at Bootstrap you see how private variables are useful?
 
user1385191
the question was about the use of private static, not private
 
@MattMcDonald see Database
There is a good use for it.
 
Eh, I've used private static for cross-method data caches before.
 
10:44 PM
@Charles thank you.
@ircmaxell I also changed it to use the template for the view variables instead of the controller.
 
posted on January 03, 2012 by Fabien Potencier

Symfony2 is a reusable set of standalone, decoupled, and cohesive PHP components that solve common web development problems. Instead of using these low-level components, you can use the ready-to-be-used Symfony2 full-stack web framework, which is based on these components... or you can create your very own framework. This series is about the latter. If you just want to use the Symfo

 
11:03 PM
@hakre Hello. You around?
 
@Neal there is never a good use for private static variables , NEVER
gods ... what a horrible code
 
@tereško What about abstract classes? You might have some classes that are not supposed to have instances but abstract classes can be called statically and therefore can also use static methods.
 
abstract classes are abstract because they are not meant to be used directly
@beta , you are trying to defend a stupid practices with broken "use case"
 
@tereško I'm not trying to defent anything. I'm just trying to challenge the word NEVER in one of your messages. ;)
 
11:24 PM
Hi i want to use ssh2_connect function() ...
I have posted a question into superuser http://superuser.com/questions/374277/php-ssh-connect/374310#374310 .
Anyone who can hep me?
 
@KamilTomšík still here?
@KamilTomšík did you stumble over oredev.org/videos/dci--re-thinking-the-foundations-of-oo yet? It's 2 years old but pretty awesome/interesting
 
@user726730 sudo /etc/init.d/apache2 restart
 
i try this
do nothing
 
Hm I've had the same problem
Let me think about it
 
@beta take your time
 
11:29 PM
oh
Did you uncomment it in your php.ini ?
 
No
in which line?
 
I.e. make sure extension=ssh2.so is uncommented
 
i will write this command into the first line
and then i will restart apache
 
No
I think you should insert it next to the other extension commands
*under
 
ok wait to search
 
11:33 PM
Which OS are you running? Debian?
You might want to try this instead
cd /etc/php5/conf.d; echo “extension=ssh2.so” > ssh2.ini
(and restart apache2 after executing this command)
 
nothing
i tryed your coomand
the machine runs lenny
 
Debian 5.0.9 if I'm not mistaken
So you have a ssh2.ini in /etc/php5/conf.d right?
 
yes
but
php.ini is hosted to /etc/php5/cli/php.ini
 
True
yet there should be soft link
 
my friend had installed these before 2 years
 
11:39 PM
In the same dir as your php.ini
There's a soft link conf.d, right?
Where does it point to?
 
no
wait
 
Do you have a real folder there?
 
whele i have /etc/php5/
which has apache2
cli
and conf.d
 
Ok
 
i cant run vi conf.d
seems to be embed
empty
 
11:41 PM
Sec
/etc/php5/conf.d should be a directory
But
 
yes!!
 
/etc/php5/apache2/conf.d should be a soft link pointing to the directory /etc/php5/conf.d
 
this also has ssh2.ini
 
Yes, because you generated it with my command before
 
how can i know that?
inside
aa ok!!
 
11:43 PM
uhm
I don't really understand you
Simply make sure there's a ssh2.ini in all those conf.d sub'folders'
 
i believe that the solution hosted here dk2.php.net/manual/en/ssh2.installation.php
i havee 1 folder named conf.d that includes ssh2.ini
What more?
ssh2.ini file has one line extension=ssh2.so.
 
Ok
I just installed the ssh2 extension on my test server
I just ran apt-get update and apt-get upgrade and installed the extension using aptitude install libssh2-1-dev libssh2-php
 
witch commands did u use?
 
There was nothing else I had to do
 
libssh2-php
package don't found
 
11:50 PM
apt-cache search lib ssh
you might want to try libssh2-1 instead
or simply run apt-cache search libssh2
 
yes
libssh2-1
wait to install it
 
Well it's the wrong package I think. You actually need the PHP bindings
"libssh2-1 - SSH2 client-side library"
"libssh2-php - PHP Bindings for libssh2"
Issue apt-cache search libssh2 instead to find out which packages are available in your repositories
 
libssh2-1-dbg - SSH2 client-side library (debug package)
libssh2-1-dev - SSH2 client-side library (development headers)
libssh2-1 - SSH2 client-side library
3 options
 
Ok so your repository lacks libssh2-php
So it never really installed properly
One moment please
 
11:55 PM
Which repositories do you have in
/etc/apt/sources.list
Won't help you as long as you can't install libssh2-php
 
Permission denied
 
Since libssh2-php contains the bindings between ssh2 and php
Are you root?
 
no
but i can run this
sudo bash
and then i am the root
 
ok
 
how can i view the sources?
i don't know su password
 
11:58 PM
Ok
Compile it from source
gunzip ssh2-0.10.tgz
tar -xvf ssh2-0.10.tgz
cd ssh2-0.10.tgz
phpize && ./configure –with-ssh2 && make
cp ./modules/ssh2.so /usr/lib/php/modules/ssh2.so
 

« first day (444 days earlier)      last day (4519 days later) »