« first day (2079 days earlier)      last day (2855 days later) » 
03:00 - 22:0022:00 - 00:00

Gon
3:38 AM
Moin
 
 
2 hours later…
5:39 AM
Morning
 
hi guys
I have a little question: Why putting single quotes around the $row? echo '<input type="checkbox" value="' . $row['id']'" name="todelete[]" />';
we just have single quotes in the echo statement
Isn't enough?
 
that misses another dot (concatenation operator)
it's not around the row, you're concatenating three parts actually
'<input type="checkbox" value="' . $row['id'] . '" name="todelete[]" />';
 
5:55 AM
Hi guys is there anyway to resize images whose size greater than 2mb in php?
 
are you able to resize below 2mb? if so then your issue is probably "uploading files larger than 2mb"
 
6:12 AM
The way to resize an image whose size is greater than 2mb is the same way in which you resize an image whose size is less than or equal to 2mb.
What you probably wanted to ask was "Why am I getting an out of memory error when resizing this large image?"
So just ask that instead.
 
@ekin yes i am able resize images less than 2mb but when it is greater than 2mb the getimagesize() function fails ...
 
@astrosixer Try answering the 5 Ws: Why does it fail? How do you know that it's failing? What errors did you get? When you got this error what code did it indicate was the cause of the failure? Where is the code?
I promise you that trying to answer these questions could actually help you reach the solution on your own. But if not, do provide the answers to all these questions and I will be more than happy to help you get there.
 
I believe you got the best response possible already @astrosixer
 
6:31 AM
@kelunik @Duikboot yeh, that is classroom.github.com btw
 
@sherif it shows the :Warning: getimagesize(image/lionel_messi_soccer_player_4k-3840x2160): failed to open stream: No such file or directory in H:\xampp\htdocs\Experiments\thumbnailCreator.php on line 7
but i checked the file is there and an empty resized file is also generated
 
Wes
monnin
 
it has 3mb in size
@Sherif
 
@astrosixer Well, that message is pretty clear. It obviously doesn't have anything to do with the size of a file. It has to do with a file not existing.
 
nope it is there in the folder am pretty sure of it @Sherif
nnOOO.. sorry i got it.. yes I missed the extension .. thank you for pointing out @Sherif
And to Ekin.. thanks bro.. for giving me the some enlightment..
@Ekin
 
6:53 AM
Unfortunately PHP doesn't know how to make a mistake. If it tells you the file cannot be found, I trust that it is right and you are wrong. It's just a matter of why you believe PHP is wrong that needs to be clarified.
In other words, once we figure out what your view of the world is, it's much easier to tell you what the world really looks like.
This is a very important lesson in learning how to ask better questions. Had we just started with the question "I got file not found error" we would have more quickly uncovered the problem.
 
Thank you for your advice .. I will keep it in mind.
Last thing I want to know is ...whethere i should change max_execution_time while uploading such large file to server?
@sherif
 
@astrosixer max_execution_time is not affected by things like file uploads. However, it will be for things like resizing an image. See php.net/features.file-upload.common-pitfalls
 
7:18 AM
30 sec is the default value... whether i should increase it ? @sherif
 
@astrosixer I don't know. Should you?
 
yes I got it from the link you send ...Should increase if it is the case..
 
Wes
don't increase it globally, only where it's needed
 
7:34 AM
probably do set it in the page where its needd
 
Anonymous
\o
 
Gon
o/
 
8:02 AM
posted on June 25, 2016

New Cyanide and Happiness Comic

2
 
8:18 AM
@kelunik you saw forums.comodo.com/… ?
 
@Ekin okay you are right
but the single quotes around the $row I didn't understand it
'<input type="checkbox" value="' . $row['id'] . '" name="todelete[]" />';
anybody has an answer ??
this line is inside an echo statement
my question is why using single quotes around the $row variable
 
Anonymous
8:56 AM
@JohnyNassar Because, you have started with single quotes first: i.e '<input..
 
Anonymous
which means, php will not interpret any variable inside single quotes.
 
ah okay
 
Anonymous
So, you have to close or finish it at some point then put your variable after it, for php to echo it..
 
and if that variable is inside double quotes?
same thing as without any quote?
 
Anonymous
If variable is inside double quotes then it can be echo'ed by php.
 
8:59 AM
$row['id'] = "$row['id']"
right?
 
Anonymous
Yes, but if you start with single quotes it won't work, if you start with double quotes, then you have to concatenate with . (dot)
 
Anonymous
Or just use this..
 
Anonymous
echo "<input type='checkbox' value='{$row['id']}' name='todelete[]' />";
 
why it will not work?
 
Wes
because it's how it is?
 
Anonymous
9:03 AM
echo 'this is a bad $sentence';
 
echo 'this will not "$work"' ?
; ?
 
Wes
it won't
 
okay
 
Wes
only the outermost quotes matter
echo '$nowork';
echo '"$nowork"';
echo '""$nowork""';
echo '"'"$nowork"'"';
if outermost quotes are ', variables will not be evaluated. if it's " then they will
 
okay thanks
 
9:07 AM
How would I use preg rematch to turn " into &quot;
 
Anonymous
@TheCodesee You don't need preg_* for that.
 
oh
what should i use?
 
Anonymous
'&' (ampersand) becomes '&amp;'
'"' (double quote) becomes '&quot;' when ENT_NOQUOTES is not set.
"'" (single quote) becomes '&#039;' (or &apos;) only when ENT_QUOTES is set.
'<' (less than) becomes '&lt;'
'>' (greater than) becomes '&gt;'
 
thank you @samayo
 
Wes
9:11 AM
or just str_replace('"', "&quot;", $string)
 
i'll bear that in mind also, thank you
 
@Wes can I write this : echo @johny ' is ' @lebanese; ??
 
Wes
what?
 
I mean $johny 'is' $lebanese;
 
Wes
why would you write that?
no, echo $johnny . ' is ' . $lebanese;
echo $johnny . ' is ' . $lebanese; // string concatenation
echo "$johnny is $lebanese"; // string interpolation
echo '$johnny is $lebanese'; // no evaluation at all
 
9:17 AM
@JohnyNassar I strongly recommend reading the manual for basic things like echo and looking at the examples.
 
Anonymous
@JohnyNassar If you don't take 5 minutes to understand the concept of double/single quote differences and how they work in PHP, you will have more and more problems later.
 
Anonymous
It literally takes 5 minutes to understand it.
 
ah if there's double quotes then it will work without the dot(concatenation
)
 
Wes
not really @samayo not even php actual developers understand ${} stuff in string interpolation, with variable variables and things.
maybe it's too radical of an advice, but you could avoid string interpolation entirely...
 
I think I understand it now
 
Wes
9:21 AM
just the other day i saw something like ${ a} behaving differently from ${a}. with the first interpreted as constant, and the second as variable
it's a mess...
 
@Danack php.net/manual/en/function.htmlspecialchars.php this manual isn't a complete example
 
Anonymous
@Wes frankly, I don't know what ${} does, and don't really care. I've never run into that much problem with string concatenation to dig that far deeper into it.
 
Gon
Hoi!
 
I think that this ${} isn't too much used
 
Anonymous
Yeah, as is the case with many functions, constructs ..
 
Gon
9:25 AM
What's up!
 
@Danack sorry I didn't mean this manual
 
I will read it before I continue with my php ebook
 
@JohnyNassar this room really isn't setup to answer a continual stream of basic questions. People will get bored and stop talking to you long before you run out of questions. Learning to read the manual, and other places that document how PHP works, and then asking questions if you're still stuck after like 30 minutes of reading will benefit you long term.
 
okay
thanks anyways
 
Anonymous
9:30 AM
@Wes Is there any logic to how php is evaluating it?
 
Anonymous
It seems like the internals tried to make PHP a forgiving language, and tried to make PHP some guesses.
 
Wes
there is some logic. it's just hella strange
 
Anonymous
I don't see any logical reason to take an empty space into consideration when evaluating a variable/constant.
 
Wes
9:39 AM
yo jimbo \o
 
What do you think guys about using UUID and explosing them instead of the real incremental ID? In terms on REST resources
 
@Frondor DO EEET.
 
I've been reading a bit, and most ppl say that it doesn't provides moar security
 
Wes
never used uuid yet but ocramius and danack convinced me doing so :P btw @Danack what implementation do you suggesto to use?
s/suggesto/suggest
 
@Wes Ramsey::uuid or however it's named....seems to be the standard.
 
Wes
9:42 AM
thanks, bookmarked
 
@Frondor It doesn't provide security - what it does is make your application be a lot saner, as you are able to create 'complete' objects in just your code, rather than having either 'incomplete' objects, or having to hit the DB to be able to create an object.
 
But... what's the difference in querying the DB using a simple userID (incremental) and a UUID?
Or maybe the difference is not there
 
@Frondor On querying, there isn't really a difference. Both perform equivalently.
The difference is when you do new User(...) - does that function have to hit the DB to be able to return something, or does it just live in code?
 
Wes
difference is that you know what the id is going to be before save. if you use auto_increment you need to save in order, and sometimes is not possible (circular references) or inefficient
 
9:49 AM
I think i'm getting the idea... And what about uniquness?
Let's say
How can Ramsey::uuid know that the generated UUID doesn't exist, without querying the DB first?
 
@Frondor It can't. You have to write your code in way that assumes that persisting stuff to the database might fail. In theory, that is a pain in the butt. In practice, you ought to be assuming that the DB save might fail anyway - and so you ought to be writing code like that anyway.
And the chance of UUID's clashing is really, really small.
 
Oh! But the chance of creating two random UUID is there! You can't say it won't happen sometime... That kind of bothers me a bit to be sincere
 
> the chance of creating two random UUID is there!
Yes, you need to create a unique index on the column that stores the UUID in the DB, and plan for inserts to 'sometimes' fail.
 
Oh I forgot about unique thingies on mysql
so that fixes it I think
What about using both UUID and incremental IDs? If I use UUIDs, should I stop using incremental IDs?
 
Mornings
 
9:56 AM
Hi
 
@Frondor If you used both, you'd have the downsides of both...
 
For UUID1, the ID is namespaced, and you need to generate IDs faster than your CPU can operate in order to hit a duplicate.
For UUID4, the ID is random, but it's got enough entropy space that the odds of collision are vanishingly small. Not zero, so you do have to cope with potential failure, but neither you, nor MS+Google+Facebook *COMBINED* generate enough traffic for that probability to be statistically noticeable.
git has the same "problem", actually. There is a non-zero chance that two commits could result in the same hash despite having different content, but the odds are so ASTRONOMICALLY low, that the recovery mode is "try again one microsecond later", and it WILL work the second time.
 
@Danack Last question, exposing them on the response body of a REST endpoint, good or bad?
@Sara Thank you! Gotcha
 
@Frondor exposing uuids is fine (imo) - they are unique enough to make them not be guessable......so there's no need for any obfuscation of them. They are annoying though, as it makes testing harder:
 
It's awesome how back-end development has evolved up to this point... Just saying. I'm front-end... Just trying to be fullstack xD
 
10:01 AM
/competition?competitionId=1
Easy to type.
/competition?competitionId=123112-123124-3454355-3453457
Annoying to type.
 
That's kind of odd to me... What if I want to display an user profile just like facebook does
let me copy&paste
https:// www.facebook .com/profile.php?id=100011097580726
https:// www.facebook .com/profile.php?id=123112-123124-3454355-3453457 is just crazy...
 
It's just formatting.
either of those are more difficult to type than "1"
 
And creating another "index/unique" row seems stupid
 
Why can't you just use an autoinc field?
 
Well... those numbers used to be 6-8 characters long few years ago
cuz they are incremental, it seems
@PeeHaa That's kind of the topic of this argument :D
 
10:05 AM
There are reasons when somebody cannot use it, but I am asking why you can't
 
If you're going for unique numbers rather than incrementing numbers.....just use UUIDv4 - unless you really have a strong reason not to.
 
And no I just woke up and didn't read back to see whether you can't use them for some reason
If you can directly insert something and get the insert id use autoinc value. If you cannot for some reason use a uuid as @Danack said
 
10:24 AM
hi im looking do you guys know any link with a good tutorial or something about table pagination i need it because my database has lots of records
 
@AndréMarques there actually might not be a straightforward solution for you if you really have 'lots' of records. How many are you talking about?
 
Wes
@JoeWatkins wondered if you could add return new class extends self|static{}; currently says self is reserved
 
i wanted something like this http://www.synkron.us/assets/paginator.jpg

i dont know how many exactly because there always will be added more records
 
How many recods do you have now?
Wait wat
html table pagination... :)
Do you know about OFFSET and LIMIT sql keywords?
 
10:32 AM
⸮⸮
 
@PeeHaa does that offset or limit give me pagination
 
Yes it does
 
like in that picture?
 
Gon
o/
 
@Danack yes, read the whole thread, pretty horrible CEO IMO.
 
Wes
10:48 AM
also, comodo (the software) sucks donkey butts
 
[laravel] I have this controller's method
function getUser($id) {
        $user = User::find($id);

        if ($user->updated_at > app('request')->get('last_updated')) {
            throw new Symfony\Component\HttpKernel\Exception\ConflictHttpException('User was updated prior to your request.');
        }

        // No error, we can continue to update the user as per usual.
    };
How can I refactor the if statement?
I need to do the same checking for products
 
Gon
Hunter x Hunter Ep 131 was sooo... Badass...
 
@kelunik comodo?
 
11:05 AM
Comodo were being asshats to (the revolutionary and awesome) @letsencrypt. Got called on it. Backtracked. https://twitter.com/ArsTechnicaUK/status/746588495616028672
 
Wes
gogogo with twitter shaming
 
he did it to himself. He personally went in to that forum thread and made a utter ass of himself
I get that it is kinda annoying to see your business vaporize, but man...
brb barber and food
 
They can either have their business vapourize, and have huge numbers of people hate them, or they can have their business vapourize, and have people still think about using them.
 
11:30 AM
@PeeHaa yes
 
 
2 hours later…
1:08 PM
evenin
o/
 
Anonymous
I've never see any application that works when it 'feels like it' as sublime's minifier does.
 
Anonymous
@PeeHaa the creator of nodejs also shared the same fate.
 
Wes
arstechnica.co.uk/tech-policy/2016/06/… it's 3 pages... worth reading
incredible what can happen to a programmer...
 
Anonymous
There was a reddit AMA about a hacker who went to jail ...
 
Anonymous
can't find the link though :\
 
Gon
1:28 PM
E_TOO_MUCH _FEELS
 
Wes
@Gon who the fuck are you
 
Gon
> @Saitama
 
@Wes see how annoying changing names is?
 
Wes
ahahah i knew this was coming
is @Gon short for Gonorrhea
 
Gon
i doubt it....
 
Anonymous
1:35 PM
Only thing that comes to mind is for Gon is this tekken character :)
 
Wes
@Gon so there's a chance :B
 
Anonymous
Nice!
 
@salathe why you voted against iterable?
 
Anonymous
@Gon is this gitlab.com/pmikkelsen/asm_snake/raw/master/snake.asm the only code making the game work? I find it hard to believe the code does not have logic in it
 
Gon
1:39 PM
i dunno actually.. I just happened to stumble upon that link in reddit...
 
@samayo Define "logic"?
 
Gon
i'm currently downlading qemu...
 
Anonymous
@PeeHaa the game has logic, doesn't it?
 
It's there?
 
Anonymous
When the snake collides, or eats the mouse, gets longer ..
 
1:42 PM
It's got comments and everything - gitlab.com/pmikkelsen/asm_snake/blob/master/snake.asm
 
Anonymous
I mean, I don't see any if/else in there.
 
It's asm not php
 
Anonymous
:)
 
kids these days
 
Anonymous
That's one screwed up language tbh.
 
1:47 PM
...
 
Anonymous
Either the code is obfuscated, or the language is using tons of wrappers / syntactic sugar..
 
Uhhmmmm yea..............
o.O
 
Wes
assembly syntactic sugar?
 
@Wes syntactic sugar for current through the cpu!
 
Wes
i believe syntax sugar for assembly is called "all programming languages"
 
Anonymous
2:18 PM
Aftermorn
 
Setting -1 for the expire-time of cookie means "forever" ?
 
Wes
twitter.com/FreeMemesKids/status/745754257228435457 the internet, what a marvelous place
 
@JayIsTooCommon morgins
 
lol
 
Gon
3:04 PM
ahahahaha
 
i have lost 2kg \o/
 
I lost 2kg too
 
3:15 PM
I'm happy if I don't loose 2 kg.
 
how much you weight bwoebi??
 
52-53…
 
i weight 125 so i am happy to loose 2 kg :P
 
@bwoebi same..
.
 
Gon
4:13 PM
I weigh 45 \o/
 
4:28 PM
Jesus. How old are you?
 
Gon
14, apparently...
 
5:43 PM
How can I ensure that php-fpm is running? I accidently disabled it in froxlor and now, the file content is shown instead of froxlor. I am using apache2.4
 
systemctl status php-fpm
Or whatever the service is called
 
@ChristophBühler @bwoebi @rdlowrey Another reason for Aerys. While using Aerys the whole time, it felt really strange putting code into the webroot.
@ChristophBühler The service not running shouldn't result in all your files being exposed usually.
 
What's the reason for aerys?
 
@PeeHaa Awesomeness.
 
@PeeHaa I don't know what the service is called. I try reinstalling it, so that I can open froxlor..
 
5:50 PM
Lol
@ChristophBühler you tried the command?
 
@PeeHaa Not putting your code into the docroot.
 
@kelunik how is that related to aerys?
 
@PeeHaa Yes, it said that the module does not exist. sucks.
 
@ChristophBühler check the systemd directory
 
ok thanks
now I get a 403 :O
 
5:52 PM
@PeeHaa Because files don't need to be in the docroot? Or are never executed when in the docroot? It's just not based on files.
 
@ChristophBühler check the error log
 
Btw are you running selinux @ChristophBühler?
 
I guess
client denied by server configuration
 
Blame selinux
 
6:01 PM
@ChristophBühler I would blame selinux but considering it's apache might as well be an incorrect apache config
 
@PeeHaa so if I enable php-fpm with "a2enconf php5-fpm", I get a 403. If I disable it again, it just shows the file content. Do you have an idea?
 
Install nginx :p
No idea besides selinux or broken apache config
 
6:17 PM
okay thanks for the help
 
6:31 PM
@ChristophBühler 403 is the right thing. Now have a look at the user running php-fpm and the file permissions.
 
6:47 PM
Hi..anyone can help me..
 
@kelunik how can I allow my php files for all requests?
 
7:17 PM
omg my life is too precious for this crap ^^
 
7:38 PM
 
Wes
nais
 
7:59 PM
@ChristophBühler Which user runs your php-fpm pool and which user has access to the files?
 
8:34 PM
mornin's
 
Anonymous
@ChristophBühler xD
 
@PeeHaa otherwise known as "apache config"
 
Anonymous
Are you on hols? @DaveRandom
 
I'm not actually away any more, but v. busy weekend so not really present at the moment
 
Anonymous
8:41 PM
Ah, how was your holiday?
 
or probably for the next week or two tbh, will be a bit hit and miss, I'm moving house as well
holiday was good, I look suspiciously not-white for a computer person
 
Anonymous
lol
 
Wes
Files changed (129) one day i will stop changing everything
 
I may be able to beat that, not sure
 
Wes
i mean, at some point things to be improved will finish. right? :B
 
9:08 PM
user image
2
 
😭😭😭😭😭😭😭😭😭 WHO MADE THIS?!?! Ahahahahahaha SO WEIRD AND INCREDIBLE! https://t.co/wVHb4l8ugR
4
 
lol
 
Wes
@Danack "sorry, we were drunk the first time"
 
@Wes Some of 'em honestly were
 
Wes
9:17 PM
indeed
people interviewed "did not believe" that market would fall in pieces. it did in just few hours
a lot of people would vote remain now if referendum was made again, imho
 
Something like that?
 
Same data, presented a bit more scaremongery
 
this is what it looks like when rich people throw a tantrum
 
Uh.... rich people didn't vote leave, poor people did
 
9:22 PM
yes
 
old people too, of course
 
with "old" you mean "not millennials"
 
And people who have looked at implementing the business processes necessary to comply with EU vat law.
 
now, that's a legitimate concern
 
Well, okay... over 40s
 
9:25 PM
@Danack it's like developers, when looking and country trying to vote on law to change handling of daylight-saving time
 
Anonymous
And the market hasn't fallen into pieces. It's a major event, there's always going to be instability at first, but it's certainly not 'in pieces'
 
Wait until Scotland fucks off
And NI
 
there is also online petition calling for "Re-vote" ... because of course online petitions have worked out so well in UK recently
 
Anonymous
not really the point I'm making... But sure.
 
Anonymous
Yeah I think that petition will be ignored like the rest of them
 
9:30 PM
Shit... I had better nap. Need to be up in like... 3 hours to leave for the airport
 
Wes
the tragedy is that even if remain won, europe would still feel resentment for that ~50% that voted leave
 
Anonymous
Which in a way, is the right thing to do.
 
@JayIsTooCommon I can already see Cramer running in circles and shouting that sky is falling
 
Anonymous
:p
 
@Wes yeah, it would have been a lot nicer, if the result was 60-40 or more
 
9:31 PM
This is the UK, the sky is always falling
both figuratively and literally
 
granted
 
I live in a probably-misguided hope that sanity will prevail in the end
 
though, when I was visiting, the weather was really nice (it was January ... at the time Latvia was having -30°C) ... I might be biased)
 
Anonymous
@DaveRandom were you remain or leave? If you don't mind me asking
 
@JayIsTooCommon very much remain
 
Wes
9:35 PM
another tragedy is that you left us alone with the germans and the french. god save us
:D
 
@DaveRandom so .. you hope that the petition will get picked up and UK will be voting again?
... that will backfire so hard
 
Anonymous
Yeah it wouldn't go down well at all.. There's another petition for MPs to veto the vote completely (which they're actually entitled to do) but it would cause so much shit
 
(I hope you just mean that people will just calm the fuck down and start looking at what they can do with the new hand they have been dealt)
 
I haven't thought out the mechanics of it at the moment, I'd ideally like some way out of it that wont result in even more shit but yeh, mainly I'd like people to calm the fuck down and get a fucking grip of themselves
 
@JayIsTooCommon there are precedents for both (Lisben's treaty and Greeks)
@DaveRandom yeah, there seems a huge portion of people on both sides, which really should start acting as adults now
 
Anonymous
9:41 PM
Yeah I agree, work on Friday was a fucking nightmare. Just a bunch of people flapping
 
(of course the "remain" camp is understandably having harder time to deal with it, since they lost)
people always have strong (and usually - completely uneducated) opinions about education and politics
 
Anonymous
Aye. Hey ho - whatever happens, let's hope it works out well.
 
and having both camps spreading FUD the entire time up till the vote isn't helping the matters
 
@tereško If they were capable of that then it wouldn't have turned into the crapfest that it did
 
I blame the media
 
9:45 PM
^ I think I will get this printed on a T-shirt
 
when Times is publishing same quality articles as DailyMail, it gets really bad
 
/me sleeps, carefully dreaming non-European dreams, with lot's of black pudding, jellied eels and other such disgusting things
 
I have never understood why some people are so fond of eels
:/
btw, what have you people bought on Steam sales these past days?
 
Anonymous
I'm too into architect to look at other games right now :p
 
prison?
I bought "NEO scavenger" - it's a cruel cruel game
 
Anonymous
9:51 PM
Yeah prison, awesome game :p
 
Anonymous
@tereško what genre?
 
rogue/survival/pixelart
 
Anonymous
Ah, are you into the rust/h1z1 like games?
 
nope
it's isometric
closest one I have to it is "Sword of the Stars: The Pit"
 
Anonymous
Aye, what I don't like about those sort of game is that they require friends - and that just isn't fair.
 
9:57 PM
no friends required
store.steampowered.com/app/233700 : Sword of the Stars: The Pit
 
03:00 - 22:0022:00 - 00:00

« first day (2079 days earlier)      last day (2855 days later) »