« first day (1675 days earlier)      last day (3287 days later) » 

10:00 AM
moin
 
@SergeyTelshevsky I have trouble imagining an example where you need two layers of routing. Could you give an example?
 
ThW
moin
 
ARA
how does facebook save all url of the profile pictures in database
does it save one by one in rows or any other way
 
@Patrick when you have some route that must do something depending on the POST data
 
ARA
10:06 AM
i have a page and everyone upload and change their profile, now how should i manage the previously uploaded image so the user be able to delete those pictures
 
@SergeyTelshevsky sounds like that should either be part of the application logic or not be part of the POST body?
 
ARA
is there anyone
 
@Patrick to sum it up I make a gateway service that forwards the requests
 
@ARA use a unique identifier (user id for example) as the folder name and then put a user's pictures in there and name them appropriately (profile-large.png for example). That way you can always put it onto a separate storage server
@SergeyTelshevsky hmm I don't think I understand enough about this... Maybe completely separating the layers could make sense, but I don't know
 
ARA
i already done it. like i have folder for every user and they upload their image and the latest uploaded image is their profile picture and it is recorded in database. now i want to show all the images of the user to them if they want to delete and i don't know how to do it.
the previously upload image links are not recorded in database anymore
i want a theory to do this,
 
10:15 AM
@ARA either store the history in the db or list the files from the folder?
 
ARA
from security point, which on is better
 
@ARA DirectoryIterator
 
@ARA it should not matter as long as you don't fuck something up
 
@Patrick I see plenty other situations like when your app first makes some decisions about which classes to instantiate in runtime
 
ARA
@PeeHaa, is there any perfect way to do it from DirectoryIterator like for user 116
 
10:18 AM
new \DirectoryIterator('/path/to/directory/of/user')
 
@PeeHaa *slaps @PeeHee with something from this decade*
 
Hi Kikes about what is discussion going on??
 
@salathe hehe
 
Dammit, FilesystemIterator was 2009 :(
 
ARA
@PeeHaa is it possible to also delete the image form that folder
@salathe what do you recommand
 
10:21 AM
 
I think so I need to take your shit
 
@AdityaGiri WTF?
 
@AdityaGiri right back atcha
 
10:21 AM
/me grabs the kickban feature
> You cannot kick suspended users.
Damn you!
 
@PeeHaa Too late
 
wth was that?
 
Y U NO STACK!!?!?!? :(
 
Hey who else is @AdityaGiri here? I wanna chat with you.
 
We should all be @AdityaGiri
 
10:23 AM
I am Aditya Giri
 
OH HI. Can you please review my website. cornchat.ga
I am currently of 14 and started this website. Please....
 
@AdityaGiri Uhhgggg material design always confuses me
 
That's still in early stage
 
@SergeyTelshevsky I am not sure I understand. Of course it always depends what classes get instantiated. Or do you mean changing the entry point? Or creating new objects like with a factory?
 
@Patrick like factory
 
10:28 AM
@SergeyTelshevsky then just use a factory? :)
 
@Patrick if we use a factory it would instantiate all the objects it may need for ALL of the possible cases (if we don't inject the injector in it)
 
The good thing about using the injector in the factory is that it's setup for all aliasing etc as required
So all your bootstrap configuration for your injector is still carried over even if you use it within a factory
 
now I don't understand the usecase again. Ah well... :(
A factory should not be able to instantiate lot of different thing though imo
 
@Patrick Thing of, the same interface?
ie abstract factory right
 
Can't be the same interface, the whole point is to instantiate the objects with different injections
 
10:35 AM
You can have different objects that do different things, but have the same interface...
Abstract factory for that
 
probably I should demonstrate this :)
 
@SergeyTelshevsky I think he means the resulting objects having the same interface
 
    hi all, could anyone tell me why this fails :
    pastebin.com/NLDFnNKa
all php vars are declared and not empty... no error message, code just stops running on execution, no "failed" or "ok" message :/
 
@Julo0sS use a pastebin and delete the wall of text. thanks :)
 
@Jay you are missing a trim around file_get_contents
 
10:40 AM
@Jimbo sounds like he wants the factory to instantiate completely different objects. But I am not sure, I don't really get it :)
 
@Patrick That'd be two different factories then, rigth
 
ARA
is there any way to view and delete photos of a folder
 
@Patrick is it ok? ;)
 
@ARA many
 
@Julo0sS your code could use some formatting... :)
 
ARA
10:43 AM
can you please give a source
@Gordon
 
@ARA A source :P
 
@ARA i gave you a link earlier...
 
ARA
@Patrick there is not to much details
 
@ARA there is more than enough
 
@Patrick yep maybe, but this is not many code, it's readable like this... problem is not format related^^
 
10:45 AM
38
A: How to get only images using scandir in PHP?

GordonYou can use glob $images = glob('/tmp/*.{jpeg,gif,png}', GLOB_BRACE); If you need this to be case-insensitive, you could use a DirectoryIterator in combination with a RegexIterator or pass the result of scandir to array_map and use a callback that filters any unwanted extensions. If you use st...

 
ARA
As i am newbie it is a little difficult for me. @Patrick
 
@Julo0sS if you want help, formatting your code properly is the least you can do...
 
@Jay because your file might contain spaces or line breaks and then it's not == ''
 
@ARA so what do you want? should I write the code for you?
 
@Patrick @Jimbo pastebin.com/kW3A3Gdd
this is how Jimbo says it should look like if I've got that right
 
10:47 AM
@Jay yes, but I assume you dont want the else if the content of the file is three spaces or an empty line
 
@SergeyTelshevsky why not route to the proper "action" in the first place?
 
@Jay put === because "foo" == '' is false
 
ARA
@Patrick it would be great because it is so complicated
 
@Patrick because there are multiple things to be done and checked before instantiating the $action, multiple things after, etc.
 
@ARA does 200$/hour sound reasonable to you?
 
10:50 AM
@Patrick it doesn't even sound reasonable to me ;)
and you get across a bit rude tbh
 
ARA
@Patrick great
 
@Gordon well I told him all he needs to know like an hour ago and he's still asking questions instead of trying it...
 
@Patrick yes, I know it's annoying.
 
@Patrick didn't change many things, but is this better ?^^ pastebin.com/53z3SQM7
^^
anyway, my query looks pretty good like this, I don't understand whats wrong with it
 
@Patrick @Jimbo say every action has it's own dependencies, some ask for an http client, some for db access
@Gordon you're right, the resulting ones should have a common interface
 
10:54 AM
@AdityaGiri You want to do what to his shit?
 
?
 
Escalation is the keyword here
 
What you would do with your GF's or wifes...
 
@Gordon Could you please handle that idiot?
 
10:55 AM
We don't have them so it's not a problem
 
@PeeHaa @ziGi what the fuck do you want???
 
@AdityaGiri Shut your tits.
 
@AdityaGiri can you please behave? Thanks.
 
@Gordon You are asking a troll to behave :P
 
Sigh again?
 
10:57 AM
Just ban the fucktwat
 
There is a difference between a troll and an idiot.
 
Why not both? :)
 
@ziGi There's generally a correlation.
 
when the chat's autocomplete suggests him, there is some other avatar aside
 
@MadaraUchiha are you calling me an idiot :D
 
11:00 AM
@ziGi That my friend, you said. Not me.
:P
 
ty @Gordon <3
 
@MadaraUchiha haha, I know, I was just kidding, cause I used to troll from time to time in the JS room
 
@ziGi Go write a distributed map-reduce function in Erlang.
 
@MadaraUchiha it's not in my expertise
 
11:02 AM
hehe
 
@MadaraUchiha Reading the new Manga?
 
@MadaraUchiha it's Monday, cut me some slack
 
@ziGi I think ref
3
 
@SergeyTelshevsky haha I see :D
 
Looks like a pirate hat
 
11:12 AM
SoapClient in php? i want to enable it in order to send a wsdl request. never done before. could someone help?
 
@BigByte You write a distributed map-reduce function in Erlang.
 
Whatsup, anyone here familiar with unit-testing with PHPunit and Zend framework 2
p.s it does look like a pirate hat
 
hi guys
one one here codeigniter expert
?
 
11:28 AM
I can help with CI, depends on what though, would call expert but experienced ye
 
i am sending a mail with smtp, but mail not send
but when i print echo $this->email->print_debugger();
it will shows mail successfully send
 
where are you sending the mail to
 
i don't know what is the error in my code...
 
gmail address?
 
my gmail address
 
11:34 AM
could be that the code is executing the command but the email setting is not being sent properly.
did you ever specify for smtp details
 
Afternoon
 
11:50 AM
@SergeyTelshevsky lol
 
@PeeHaa have u every used zend2?
 
@StephenWolfe Nope. I have only used zf1
 
@PeeHaa ahh dam. Do you use any frameworks
 
Nope not really. I use my own CMS and complementary library which you could call a framework of sorts
 
hi all
I want to get users events form facebook using PHP can any one help me
 
user4661379
11:58 AM
Hi all
 
how I can do this
 
user4661379
Please help me in my issue
 
user4661379
1
Q: How to check and remove the additional back slash coming in account for for apostrophe in PHP?

PHPNutI've a string in a variable titled $str as follows. This I got after converting it into JSON format. So the one more additional slash is added by JSON so please ignore it as it would not display while showing the string. $str ="Let\\'s\nIt\\'s\nHe\\'s\nShe\\'s"; # \n is used for new line chara...

 
Now I want to check the presence of such backslash/es...
No you don't
You should prevent them from being added in the first place
 
can any one help me
I want to get users events form facebook using PHP
 
user4661379
12:01 PM
@PeeHaa: I can't prevent that since it's coming from mobile app.
 
@RavinderKumar don't spam pls
 
@PHPNut What mobile app? Yours?
 
There's one thing I am still trying to comprehend. How does my computer freeze when it gets too hot.
 
@ziGi Probably not your computer. Probably your processor. If the processor gets too hot it can be damaged. Most motherboards monitor the temp and have a safety shutoff if it gets too hot
 
@Machavity yeah but the question is why does it FREEZE when it gets too HOT
 
@ziGi :P
 
@Machavity "If the processor gets too hot it can be damaged." Is that really true? I used to have an AMD machine that would run at close to 90C...
 
12:29 PM
cc^
the crystal starts melting :D
 
oops, meant @Machavity.
 
@ziGi The simple answer is that when it gets hotter, the processor begins to return bad data (has to do with the electron paths, etc). So you send an instruction to your processor and it does something weird with it. Hence the freeze
@Danack I'm truly impressed it would run that hot. Most auto-shutdowns kick in at about 50-60C
 
@Machavity I know how it works, I know that also when it starts returning bad data it recalculates which makes it even hotter. The question is why is the word "FREEZE" used when the CPU is "HOT"
 
@ziGi Oh. Lol. Sorry. Because it stops responding, the computer appears "frozen". As in mouse no longer moves, etc
 
@Machavity It used to be standard for CPUs to run too hot to touch - computerhope.com/issues/ch000687.htm
 
12:35 PM
@Machavity haha ok, you totally ruined the joke... :D
 
@ziGi Sorry man. Thought you were asking to learn
 
@DaveRandom remember the challenge I was making? I still ended up using python. I used "pexpect" instead of "popen". Its API is quite nice and you can automate a lot of stuff: pexpect.readthedocs.org/en/latest
 
@Machavity Haha, thanks for your responsiveness nonetheless :)
 
@Gordon uh...
 
@ircmaxell I like the post. It's good food for thought.
 
12:45 PM
in general, sure
 
I am somewhere inbetween the function hell and X til you drop team though
 
I just didn't like protected abstract String getSymbol(String symbolName); and would rather see that as a "SymbolResolver" dependency
or not, I don't know
feels like code that's better written using functional style than OO...
 
ARA
i have saved an uploaded image in three sizes in three directory with different names. is it possible to delete all three files at once with php
 
@ARA yes
but you do realize that the way you are asking about these things all morning don't get you too far, do you?
 
ARA
1:00 PM
no, because i stack in at this point from evening
 
@ARA that's what I am saying.
 
ARA
@Gordon, how is it possible
because i haven't save their links in database
 
101
A: How to delete a file via PHP?

GordonThe following should help realpath — Returns canonicalized absolute pathname is_readable — Tells whether a file exists and is readable unlink — Deletes a file Run your filepath through realpath, then check if the returned path exists and if so, unlink it.

 
ARA
the problem is, that if i save all image url in database then it will be a headache
 
@Gordon actually, then you need to check is_writeable() for the directory which contains a file. R/W permissions on file have nothing to do with permissions to unlink it
 
ARA
1:07 PM
is there any other alternative to save all three image address without saving it to database.
 
@PeeHaa I was wondering, do Dutch policemen eat stroopwafels instead of doughnuts :D
 
@Gordon I saw the edit. again, wrong (: you can have no access (even R) on the file, but if you have write access on directory, which contains it you will be able to unlink it (:
 
@ziGi I think donuts is global :P
 
ARA
should i save the uploaded image url in database, if i save it then for 200 image 200 column should be created.
is it a good idea
 
@Gordon For those sorts of things, like removing directories too, I much prefer letting the O/S handle it and using backticks
 
1:20 PM
 
@bwoebi ^ shouldn't that be possible?
 
@marcio no, why?
it's T_YIELD_FROM '(' ')' what you're writing there
 
yea, a function called from()
3v4l.org/7TS02 works with yield bar();
 
@marcio lexer has no idea about functions and constants
@marcio just tell me what that means: yield from ($foo);
function call from($foo) or yielding from $foo?
 
1:24 PM
it means you are yielding the return value of from(); call
 
@marcio yeah, previously. That's the only BC break in the whole thing.
 
@bwoebi ok nevermind, I can do 3v4l.org/H7s8e
I have a weird code that will do yield (from('something')); xD
 
@marcio yep, that still works.
As long as you break the lexer from yielding a T_YIELD_FROM … ;-)
 
ok, it's a corner but is enough for me :P
 
@marcio // DO NOT remove these parenthesis around the function call! It will break horribly!
 
ARA
1:30 PM
is there anyone to answer my question
 
31 mins ago, by Gordon
@ARA yes
 
@bwoebi I had to add the parenthesis, they are not going anywhere from now on
 
ARA
should i save the user uploaded image urls in database by creating new table by their name
@Machavity
 
Save the file names and manage them through PHP. Seems pretty straightforward to me
 
ARA
then their will be 200 column for 200 images
is it ok
 
1:38 PM
oh, I also would like to consult you about something @bwoebi how much do you hate syntactic stropping?
 
ARA
@Machavity
 
@marcio [just read up what syntactic stropping means^^] depends a lot on the token to be marked as special…
 
@ARA Why 200 columns? Can't you make a separate table and link each row?
 
@bwoebi we could very easily have any name for classes and ns by using stropping but there is one major con: it feels very ancient
 
ARA
should i make separate table for every user
 
1:41 PM
@marcio what feels ancient?
 
ARA
@Machavity
 
@bwoebi stropping :P and I'm also having trouble to pick a char
 
@marcio what for?
 
turn down for what ♪♫♪♫
 
it has to be a character that fits everywhere, I think algol used a ' (we can't use it ofcourse)
 
1:43 PM
@marcio no, what feature?
 
class 'List {}
new 'List();
 
oh
 
just an example, it can't be ' and neither a \ in respect to your feelings
 
ARA
@Machavity should i make separate table for every user
 
just parse namespaced fcalls as a single token and use class namespace\List {}
 
1:44 PM
@ARA I have no idea. You know more about your application than I. But Tables should store as general a data as possible. If you have to make more columns or tables you really should rethink your data structure
 
ARA
@Machavity what do you think that how facebook manage their image
 
@bwoebi the problem is that if you parse namespaces as a single token there will be a bc break
 
$result = mysqli_query($conn, "INSERT INTO users (username, password) VALUES ('$username','$password')");` returns false. Why?
 
Creating tables per user is just one of the worst ideas.
7
 
1:46 PM
@marcio why?
 
@bwoebi

This\Is/**/\Possible\Now\WTF;
class Something implements\WTF {} // is also possible
 
@Danack My company: one database per user..... .....
 
@Jimbo Is this your new job or old one?
 
@marcio it just was a suggestion …^^
 
@Danack current, LOL
 
1:48 PM
@bwoebi that means that parsing namespaces as single tokens can only be done on PHP8
 
@Jimbo I would say From orbit, the only way to be sure. - but if you mean per client, then there are use-cases where that could be okay...
 
@Danack Actually, yeah, per client, which often tends to be just one user though
 
ARA
@Danack do you suggest any idea. My website is simple, it have users that upload images and i want to view every user uploaded image for them and they are able to delete their images too.
 
@ARA yes, you should read that link I sent you, and then be able to understand how to normalise the data to be accessible.
 
@bwoebi only laughable easy solution is stropping :)
 
1:50 PM
Separate DB's per client seems pretty normal. That's not the same ballpark as table per user in a DB, imo.
 
@marcio don't like that idea too much because it will be somehow awkward to read in code, I believe
 
and PHP has this uncanny ability to use every typeful character for something ^^
class ´List {}
class ¬List {}
class ·List {}
class `List {}

(╯°□°)╯︵ ┻━┻
 
hello guys :)
 
@marcio We could use !
It's not yet used^^
 
! is already an operator
 
1:56 PM
facepalm… yes… the not.
 
! $true
some languages use '<name>':
class 'List' {}
namespace Bla\'List'\Blah;
 
ARA
@Danack can you give any idea
what is your idea
 
@marcio what about a prefix like 0?
 
hum?
 
identifiers generally must not begin with a number…
 
1:57 PM
you mean '0' or '0?'
 
the zero.
 
@ARA dude - you need to take people's advice when it's given, which for me is for you to go and read those things as you don't understand the 'problem space' that you're operating in. My other advice is to not act like you're currently acting, as it tends to get you ignored.
 
morning
 
@bwoebi class 0List{} // nope
 
@marcio why not? It would work :-D
[no, not seriously^^]
 
1:59 PM
other languages use a . (dot)
class .List{}
 
user895378
morning
 
morning
 
morning :)
 
Ah mondays:
> The "https://api.github.com/repos/nrk/predis/tags?per_page=100" file could not be downloaded (HTTP/1.1 502 Bad Gateway)
 
posted on May 18, 2015 by kbironneau

/* by Tobi */

 
2:05 PM
@Danack Rainbow unicorns be angry, yo
 
user895378
@Danack hmm ... I need to help transition you to amp/redis ;)
 
One day maybe - tbh I don't really need the extra speed just yet. Redis running locally and connecting via a unix socket is fast enough for the approximate 1 message per second that I send to it.
Wait, it's more like 5 messages.
 
hello, can any one explain to me why does the second EOF in the code below give a unexpected '<<' please ?
$html .= <<<EOF
		function build_List(element){
			//some code
			}
EOF;

$html .=	' 	var dataString = '.json_encode($this->_query_fragments).';';

$html .= <<<EOF
		//some code
EOF;
 
It's... so... beautiful ;_;
 
does anyone know what I have to define as the type when I want to create a mysql function that accepts an interval?
it's apparently not "interval"
 
2:22 PM
Are you sure mysql has a data type for intervals?
 
@Gordon I have a suspicion you will need to use a time value rather than an interval.
e.g. the built in function ADDDATE() Add time values (intervals) to a date value uses time values.
 
I bet their DATE_SUB() function (and the likes that take interval) define a special syntax for an interval and don't actually take interval as an argument. Basically the interval argument is a language extension that function adds itself
 
Today my PM posted this on his facebook.
5
 
posted on May 18, 2015 by Anthony Ferrara

In my last post, Tries and Lexers, I talked about an experiment I was doing related to parsing of JavaScript code. By the end of the post I had shifted to wanting to build a HTTP router using the techniques that I learned. Let's continue where we left off... Read more »

 
@nikita2206 @Danack yeah, it's inside the parser. not too easy to get around in < 5.7 apparently
 
2:43 PM
@PeeHaa You said that you use scrutinizer just for coding style stuff - do you that just by turning all the other stuff off?
And can anyone else recommend a CI code-style checker that doesn't make me want to punch things?
 
user895378
The only one I've tried is scrutinizer and it made me want to punch things.
 
BTW is it free for OSS?
 
Scrutinizer? Yes. Though only if you count your time, sanity and hair-loss as free.
 
lol ok
 
@Danack What is the issue?
 
2:52 PM
@Feeds a few days late...
oh wait, no, that's post #2.
 
> Monday, May 18, 2015
 
Whoops
 
:P
 
/me doesn't even know his own blog
 
hehe
 
2:53 PM
@PeeHaa I was just wondering if that is what you did to get Scrutinizer to only do code checking.
 
guys can I put a condition inside a string concatenation?
"asdasdasd".($b)?"asd":"qwe"."somethingelse"
 
@Neoares You could, but you don't want to....
 
why not
 
@Neoares Initialize it before
 
2:58 PM
 
People will punch you
 
none will punch me :)
 
@Neoares Trust me people will find you ;)
 
2:59 PM
and then they'll needle you 24/7
 

« first day (1675 days earlier)      last day (3287 days later) »