« first day (672 days earlier)      last day (4501 days later) » 
00:00 - 18:0018:00 - 00:00

00:26
is anyone here?
00:51
@Lusitanian what's wrong with it is, if you let subclasses have control over the fields, you lose a lot of ability to guarantee invariants
subclasses end up being able to break promises the superclass made
which violates LSP
about the only place subclasses should be able to do stuff like that is if you have fields specifically for them to fill in info the superclass will use. but even then, setting those fields can almost always be done by passing values to the parent's constructor
i do see a purpose for protected methods that the subclass is expected to override (event handlers come to mind). but fields should be private if the class depends on them at all. informational ones, like "count of bytes read so far" or whatever that are purely output, can be public
with explicit documentation that those fields are purely informational and can not be relied on
01:31
Can someone help explain how to query a DynamoDB table in php?
I am having trouble understanding the documentation
user895378
02:30
@LeviMorrison I like it. I'm thinking I'd like to submodule [PHP-Datastructures] in Artax and use some of its stuff as a basis for a lot of the code, including the HashingMediator. The mediator implementation I have is a bit overkill, I think, and was the result of my first stab at it. It includes many elements that are more appropriate to the Chain of Responsibility pattern.
user895378
Simplicity -- as long as it does what's necessary -- is always a better bet.
02:45
unless it's codeigniter
then you don't need simplicity, you need MY_Controller
private boolean isLoggingEnabled() {
    return MAX_NUMBER_ATTACHMENTS != -1;
}
03:14
-1
A: Minimising PHP logic in the View of an MVC

Matthew BlancarteIf you'd like to move forward without a framework like CodeIgniter, CakePHP, Symfony, etc., you can check out Smarty. It's super easy to use, and makes templates very readable. You can minimize logic, but it gives you enough leg-room to put logic in there if you need it. http://www.smarty.net/ ...

btw , morning everyone
user895378
morning. 1120pm here. There's some dangerous wine-soaked coding going on this side of the Atlantic :)
will a hex color always be 4096 bits? (or 64 when using shorthand)
03:58
its 7 am
04:14
hi
any body can help me with exec command issue ???
04:29
only situation when Christian uses a tag : when he wants something
@Devendra What is the issue?
@sha
@ShaquinTrifonoff : I want help regardig php exec command
@ShaquinTrifonoff Can you help me ?
@Devendra I'll have a look.
@ShaquinTrifonoff : thanks :) ill be waiting
04:37
@Devendra I put a comment on your question.
ok let me put the code i am using
can u see it now ?
@ShaquinTrifonoff : can u see it now ?
@Devendra Yeah, I see it.
@ShaquinTrifonoff ok
@Devendra So you've created a C++ application that you are calling with PHP, and it isn't working?
@ShaquinTrifonoff Yes , exactly
04:45
@Devendra It sounds like there is a problem in your C++ program.
@ShaquinTrifonoff no , it works fine...
@ShaquinTrifonoff funny thins is i tried the wamp server on my laptop with windows 7 64 bit and it too fails to run .exe files from php script
@Devendra See my second comment :-)
u mean system() fucntion ?
i have tried it all like shell_exec , exec and system
all fails to work
04:49
What does system() output?
string(0) ""
What about system('ls');?
just sec
basic_tut my_cv my_cv.cpp my_cv.cpp~ pass.txt pas.txt pas.txt~ test_2.php test_2.php~ test_3.php test_3.php~ test_4.php test_4.php~ test5.php test5.php~ test6.php test6.php~ test (copy).php~ test.html test.php test.php~ string(9) "test.php~"
it gives list of all files in tht directory
That means that system is working.
yeah i guess...
even this code works <?php
$output_1 = exec('/opt/lampp/htdocs/dev/my_cv');
echo "</br><pre>$output_1</pre>";
?>
04:56
So what happens if you open a console, navigate to the directory that the script is in, then execute the command?
it works
the my_cv is a program which copies a file from one directory to the this directory and tht too works fine...
So your copying program works but the other one doesn't?
Can you make the program output testing and use system() in PHP?
(output testing in addition to what it does)
means ?
05:00
Add puts("testing"); to the code in the C++ program.
ok one sec let me try it fast
hello
u there ?
@ShaquinTrifonoff Hello
Yes, I'm here.
@Devendra
well i put two printf commands in my c++ program
one saying "before" and one saysing "after"
and the out put is
beforeafter
beforeafter
string(11) "beforeafter"
the php code for this is
<?php
$output_1 = system('/opt/lampp/htdocs/dev/my_cv_1');
echo "</br><pre>$output_1</pre>";
var_dump($output_1);
?>
Can you make the script print the current directory like here, and compare the output from the terminal and from the script?
wait let me do it :)
05:11
@Devendra You can use argv[0].
like ?
I hardly know any C/C++, but it would be something like printf(argv[0]);.
i see
please give me 2-3 mins let me try
Oops. Sorry. Looks like getcwd() is what you need...
hey
i treid it
the code for php is
<?php
$output_1 = system('/opt/lampp/htdocs/dev/my_cv_2');
?>
and the out put is
before The current working directory is /opt/lampp/htdocs/dev after
 
1 hour later…
08:22
Yo
@tereško Wow, you've been busy.
lil' bit
08:40
@tereško I'm curious. What makes you so generous and helpful to complete strangers like us? It always baffles me that there are honest helping hands asking for nothing in return... Very thankful though!
3 parts "boredom" , 1 part "arrogance" , 1 part "how one could write such a dumb answer"
:D
Mind blowing.
@Darius , actually , in my experience , teaching and explaining things to others is one of best way to learn
I see, makes sense. Thank you for that answer. Curiosity settled.
09:43
good morning
morning
how is it going chaps?
good as always :)
you?
that's the spirit :) "woke up alive" :P
well .. i decided to write some code
09:50
ah, I should do that too... haven't done anything this week really...
@tereško wow
yeah , i know .. shocking
@webarto yeah, me too ^^
btw , the first thought when i woke up was: "what the fuck did i just saw ?!?"
updated ZF, and integrated ZF debug toolbar, beat this :D @tereško
@tereško wat did you saw? :D
09:55
i honestly cannot explain , in the most "down-to earth" part i knowingly swallowed some pill that would make me feel sick and i spent some time dry-heaving
and that was the bit, which made sense (there was some sort of con/scam in progress)
not a good feeling I guess ... haha
lol
you have dreams...
@NikiC strange indeed, I thought we don't dream... I guess you are more fried than us because you fiddle with C :D
... you intentionally misinterpreted that, right? :P
10:50
11:51
While email editing mail body from 1 and half our also during this period a continuously searching other emails in account after completion of editing in click on email sender box immediately showing login screen ...
is it pssible session out during editing email and searching viewing email account
?
12:06
well, i made my search and add friends codes. but now i have a query. While creating images with php, the image was returned through the headers anywhere in the webpages, is there a way i can put the strings "Friend Request Sent" or "Friendship already Requested" in a similar way as with the images?
well, i dont want to do it with url's
@iHungry , what ? This was not in English. I get a feeling that you are just replacing the words from your native language with English counterparts. Languages do not work this way.
Do you want to force user to sign out while viewing email ?
Good morning
@tereško, how is it possible .... i continuously editing email and searching the mails and viewing ... with rest of 1 and more minute...
after writing email i click on email sender address bar .... it showing me logout screen ... i mean i guess it occur due to session out ....
then y it allow me writing mail and viewing other mails and searching emails if session expire
?
i think its a biggest bug
in the system
I cannot understand what you are trying to say.
how is it possible while editing , searching and reviewing email with out rest a minute ...
it shows me login screen while i click on sender email address box
really i frustrated i wasting my all writing effort along with time due to this
12:15
@blackbee ,are you talking about something like this ? php.net/manual/en/function.imagettftext.php . But i have a feeling that it would be a memory-intensive operation, which might be quite painful in anything but very small social networks.
yes somewhat like that, but i want to pass the strings.
what ?
wait
i'll explain
array imagettftext ( resource $image , float $size , float $angle , int $x , int $y , int $color , string $fontfile , string $text ) .. notice the last parameter
@blackbee , or is it, that you just want a text overlay , that covers part of image , without altering image itself ?
well you didnot understand me, i was saying that i have form called addfriends.php which checks if a userid reciverid and the friendship id is present
12:21
> ... is there a way i can put the strings "Friend Request Sent" or "Friendship already Requested" in a similar way as with the images?
and depending on the result it echo's if the friend request is sent
or the user has already requested a friend
but the problem is, when is echo's out the text's its in the webpage called addfriens.php
@teresko exactly
how is any of this related to image ?
but i want the text to be echo it the page where the request was made i.e. the searchfriends.php
1 min ago, by blackbee
@teresko exactly
what ?!
no in an image we can use the header to see the images(example captachas) produced whereever we want, we don't need a seperate page for it
12:24
/me puts in playlist an old The Sisters of Mercy album and goes back to writing code
ok leave it, i will do it with url's...... i will set a variable as $msg and give it a value 1, 2 or 3 and then check it and print the corresponding error mssg in the page where i want, i just wanted a safer way
nope my doubt is how session out while editing email and during editing i viewing and searching other mail for write main email .... after completed my writing it directly shows me logout screen when i click on sender email address bar for write his email id
if session is out during editing and viewing , searching email ... it have to shows me logout screen immediately logout screen
i think cookies can do the work..... hold the cookies until the user clicks log out and retrive the session variables for every page from the cookies, err, i may b wrong
@ircmaxell welcome back to 8th circle of hell
well @tereško if i send the value with urls in the header, will the trim,striptags,stripslashes and htmlentities validators be enough for validation of the variable which will store the value of $_GET['id']
13:27
@teresko its not happening as i thought
:(
the header is not redirecting to the searchfriends.php page
i put it like this
if($reponse=="WAIT")
{
$msg=2;
$url="/chatwhiz/searchfriends.php?respid=".$msg;
header('Location: '.$url);
}
in the addfriends.php
and in searchfriends.php
i have $getmsg=striplashes(trim($_GET['respid']));
....
but its not redirecting from addfriends.php to the url
morning...
@ircmaxell morning
@PeeHaa morning
13:49
Damn it's hot. And beer as breakfast doesn't really help
And I'm being unproductive again :(
@NikiC Same here :(
14:14
well .. i am making some food , is i am productive .. at the moment =/
@PeeHaa , how do you deal with validation in domain objects ?
@blackbee I think I've told you several times in the past myself.
Mark code as code using CTRL+K
@tereško I'm having some trouble making my Request object
I don't understand what kind of information should I put there (and how)
it kinda depends on what are you gonna use it for , @Truth
@tereško Well for starters, to determine the wanted controller and action
well .. any problems with it ?
@tereško What should I use? $_GET? $_SERVER? (and if so, why not just use them directly?)
14:27
IMHO, the source from which request's parameters are extracted should not be hardcoded
So?
Pass it in?
but i use $_SERVER[ 'PATH_INFO' ] , because i like to use it
$uri =  isset( $_SERVER[ 'PATH_INFO' ] ) ? $_SERVER[ 'PATH_INFO' ] : '/';
$request = new Request( $uri );
$router->route( $request );
@tereško Okay, and then what do I do with it and with router?
mostly because i can use http://who.cares/i.php/user/list without any rewrites
@Truth , in router i do something that i shouldnt be doing =/
public function route( $request )
{
    $uri = $request->getUri();

    foreach ( $this->pool as $name => $route )
    {
        if ( $parameters = $route->getMatch( $uri ) )
        {
            $this->currentRoute = $route;
            $request->setParameters( $parameters );
            return;
        }
    }
}
IMHO, this should not be done this way , but i do
so, how should it be done? :)
14:34
it might be better it instead of Router to implement a Dispatcher
something that creates the Request instance
@tereško You're breaking the request's responsibility with this
You're messing with it from a different object
in this version i just set the URI value in the constructor , only to extract it in the next method
the "messing with object" is not the problem
@tereško So how should it be done in your opinion/
i don't know
i think the current version might be fixed it the router itself receives the URI directly in the constructor
s/it/if
@tereško What does setParameters do?
14:46
public function setParameters( $parameters )
{
    $this->resource = $parameters['resource'];
    $this->action = $parameters['action'];

    unset( $parameters['action'], $parameters['resource'] );
    $this->parameters = $parameters;
}
@tereško I see
i think i should start pushing that half-baked framework to github
having another pair of eyes on that disaster might be a good idea =/
@tereško You should
$router = new Application\Common\Router(new RouteBuilder);
What's a RouteBuilder @tereško?
it's a builder for the routes =D
namespace Fracture\Transfare;

class RouteBuilder
{

    public function create( $name, $parameters )
    {
        $parameters += [ 'conditions' => [] ];
        extract( $parameters );

        $pattern = new Pattern( $notation, $conditions );
        $instance = new Route( $pattern, $name, $defaults );

        $pattern->prepare();

        return $instance;
    }

}
15:00
it's what you would replace if you decide to change the structure of routes
@tereško And Pattern?
this way you can keep the same routing mechanism , but , for example , use kohana's or symfony's routing patterns
What are notation and conditions?
"main": {
    "notation": "/:action",
    "defaults": {
        "resource"  :   "Authentication",
        "action"    :   "Login"
    },
    "conditions":   {
        ":action"   :   "(login)|(register)"
    }
},
this is a definition of route , in JSON
and i should change the "main" there =/
@tereško So basically this example routes both /login and /register to the Login page?
15:07
in that example , yes
"fallback": {
    "notation": "",
    "defaults": {
        "resource"  :   "Site",
        "action"    :   "Landing"
    }
}
@tereško What's resource role in all of this?
"resource" is the name of controller and view classes
And action is the name of the method
@tereško And what's fallback?
it is part of the name
A different route?
15:10
it's the last route in the JSON
this matches , if all other routes failed
In case nothing matched?
That's basically the 404 page?
it can be , yes
those fragments are from project-in-progress , currently the fallback route actually ends up in page with var_dump's all the input for debugging
@tereško When changing state you mean?
15:20
dunno .. depends on when you actually do the validation , @PeeHaa
I often do it in the setters. Have been thinking about it for my new project though
$serviceFactory->register('Router', $router);
@tereško What are you registering the router with the factory for?
@Truth , because the factory caches initialized services for the model layer , i treat routing as a service , but it is service which is provided by a framework and has custom initialization process
the routing service is utilized by view later
How?
for generating pretty URLs
this is one of reasons why each route has a name
@PeeHaa , and what do you do with the error-state ? hold it internally ? throw exception ?
15:27
@tereško Give me an example?
will have to think of something .. haven't written that part
$router = $this->serviceFactory->build('Router');
$url = $routed->transcribe( $name = 'someroute' , [ 'controller' => 'Some' , 'id' => $key ] );
$this->template['panel']->assign( 'foobar', $url );
That translates into what?
/woohoo/some/42/
or maybe you need it to translate into woohoo.php?page=some&id=42
@tereško I depends, but I will throw an exception in most cases. Opinions seem to differ, but imo a validation error should be an exception in most cases
@tereško What does that have to do with the View?
15:37
@PeeHaa , here is an example : registration form
@Truth , would you want to rewrite every single template , if you update the routing scheme ?
@tereško So that's how you generate links?
currently i don't generate them yet ( i am still wasting my time in general View API ) , but yeah , the URL generation will look something like that
hmm .. actually the API for routes should be : transcribe( array $parameters, string $route_name = _current_ )
@tereško In that specific case storing the errors will prove to be much more useful, because you may want to display the errors to the client. Which would be much cleaner when you simply have a list of errors instead of handling exceptions
well .. this would apply to any domain object which might at some point get filled from a html form
15:53
Basically yes. The thing about HTML forms it is not really en exception if something is wrong.
which is fast framework in term of development
phpunit
@khizaransari I hear great things about vanilla PHP
@tereško have u used phpunit @PeeHaa what is official website of vanilla... i heard about symfony and yii
@NikiC Why do people keep asking for a keyword for generators?
@LeviMorrison what ?
that did not come out in english , ya know
@khizaransari , here is a hint : learn OOP before you start playing with frameworks
@tereško On the PHP mailing list. People keep saying that they need a keyword to make it obvious that the function is a generator.
what is a "generator function" ?
besides , IIRC, there was "does PHP even need function keyword" floating around last week
16:10
@tereško By the way, the answer should be 'no'.
I hate properly designed software
E.g. I just installed postgres
And I just want to create a damn database to run PHP tests
but now I have figure out how to properly authenticate with it
With mysql it just lets you in :P
@NikiC Is it only accessable locally?
@PeeHaa Right now it's accessible with sudo :D
@NikiC You could setup pg_hba.conf and set all local connections to trust
and i have to create a user for myself, right?
with the same name as the process owner?
16:16
@NikiC By default installation the postgres user is created. So you can just do su - postgres and psql to get in through command line. For PHP to access it you should create a new user in postgres
@PeeHaa I already changed the password of postgres to the empty string, but I still can't auth
only through sudo
@NikiC Have you made the changes to the pg_hba.conf file?
i guess you will have to read the manual
I don't want to read the fucking manual
:(
16:18
Uh, I think I'll just run the tests as super user
@NikiC , this is like the most common solution on ubuntu : chmod -R 777 /
Heh, and I can't even su. Does su have a different password than sudo?!
crap
I hate rights
16:23
@NikiC , you must be republican
I hate people trying to limit my rights :P
Now I'm liberal :P
@NikiC AFAIK, su takes the password of root (or the user you are logging into), sudo takes your user's password to create a root shell.
@tereško Nice comic link!
I think I figured it out now
logged in as postgres, created role for my user, created database, now seems to work
16:31
15 mins ago, by PeeHaa
@NikiC By default installation the postgres user is created. So you can just do su - postgres and psql to get in through command line. For PHP to access it you should create a new user in postgres
:)
well .. @PeeHaa , this assumes that you are using a distro which was made for servers
@ircmaxell Has there been any recent discussion on https://wiki.php.net/rfc/scalar_type_hinting_with_cast?
@LeviMorrison no
@tereško That's as far as my knowledge goes for nix
heh, but I still can't run the tests...
16:34
@NikiC error?
@PeeHaa , well , to do su - postgres you need to be logged in as root
ubuntu does not have available root user by default
@NikiC I'd like to see it go forward. I cannot think of a better implementation.
and most of ubuntu users are not even able to unlock it
Hmmmz in that case su postgres will do :)
@tereško On my system, basic plain Ubuntu desktop or server, from my non-root (but sudoer) user I can do su -l username (or su - username) for short, no need to sudo before it.
16:36
@PeeHaa that would not make a difference
@tereško huh? You are telling me you cannot switch users?
you can
@Whisperity do you , really ? even if user has no password set (or to be exact, it has password but you dont know wht it is)?
Now you are confusing me. If you can su postgre won't you just be able to acces psql? @tereško
@tereško Then press enter on no password. Well... if I don't know the password for the target user, I can't log in using that method.
@PeeHaa write !== access
16:39
@tereško What does that mean? Once you are logged in as postgres user you can do with postgres whatever you want
@PeeHaa "Unable to connect to PostgreSQL server: fe_sendauth: no password supplied" ;) Does that mean that the user needs to have a password?
(considering a default installation)
@NikiC it means that in pg_hba.conf is set that you need the password
@NikiC Yup. Just check the pg_hba file and check out the "authentication types"
When I was setting up source engine servers (on the srcds) user, and sometimes I needed to apt-get install something, I just did su - whisperity, typed in my password and that's it.
16:50
Great, now it works
I set everything to trust:)
Only 9 failing tests ;)
17:03
hi guys, have some problems with rawurlencode. if i try to convert haroonahmad.co.uk?index.php?feed=xxx&aff=zzz using rawurlencode, i get http%3A%2F%2Fwww.haroonahmad.co.uk%3Findex.php%3Ffeed%3Dxxx%26aff%3Dzzz. it converts forward slashes and colon too. is there a way to prevent this?
@WeContest How are you creating the URL?
only encode the parts that you want to encode...
the problem is that url is scraped from another websites, so I cannot explode it
why do you encode it?
because sometimes url cointain spaces and strange characters (è,ì,ç, etc.)
17:07
rawurlencode(end(explode('?', $url)));
@WeContest - Does that work?
just a second. i try it
nope, it doesn't work
i have the some problem
basically, rawurlencode has to convert only spaces and strange characters and not everything
@WeContest What are you trying to do?
i want to encode only spaces and strange characters (è,ì,ç, etc.) in a url according to RFC 3986
i want to use rawurlencode but the problem is that it converts the whole url, instead of just spaces and strange characters
@WeContest :/?=& are all encoded according to RFC 3986 using rawurlencode.
yes, but rawurlencode encodes every character
e.g. haroonahmad.co.uk/?index.php?feed=xxx&aff=zzz becomes http%3A%2F%2Fwww.haroonahmad.co.uk%3Findex.php%3Ffeed%3Dxxx%26aff%3Dzzz
17:18
That is what RFC 3986 is. It sounds like you don't want RFC 3986.
@WeContest
Hello.
ok, i'll try it thank you
i am soo out of focus, i need to redo my app again.. i wonder if there is a stackoverflow forum . .
hello! i am pulling tracks in from soundcloud using javascript. i was wondering if you can help me with this?
SC.get("/users/me/favorites", {limit: 4}, function(tracks){

$('.1 src').html(tracks[0].stream_url);
});
</script>
<li class="1">
<audio controls='controls'>

<source src="insertURLhere" type="audio/mp3" />
</audio>
</li>
how do i target src ?
maybe a replace function ?
You should check the Javascript room.
17:29
oh ok
thanks
np
Anyone tired of impostors? I made an area51 called "How To Hire" so real developers can inform service seekers properly. area51.stackexchange.com/proposals/43451/how-to-hire/…
@Brian Sounds like a good idea.
Thanks =) Sucks when people are miss informed
It would be awesome to see Stack with a site like that. Bridging the gap between client and developer knowledge.
00:00 - 18:0018:00 - 00:00

« first day (672 days earlier)      last day (4501 days later) »