« first day (1345 days earlier)      last day (3829 days later) » 
00:00 - 19:0019:00 - 00:00

19:03
@DaveRandom Hey
@DaveRandom Btw, what's the PHP equivalent to nothing? I tried NULL.
if ($_GET['search'] == NULL) {
echo "Nothing Found";
}
When you say nothing do you mean the VB Nothing?
Im trying to do nothing found nothing.
Actually for that it doesn't matter, you are looking for isset()
19:05
So nothing found within the db.
Well "nothing found" would be a result set with zero rows
(in MySQL/PDO, $stmt->rowCount() === 0)
Ahhh if (isset(get) {//do this} else {//nothing} ?
If mine made sense :P
Well isset() is a funny thing, and indeed the concept of a "set" variable is a difficult thing to grasp in PHP. isset() checks whether a variable exists and has a non-null value
So would my example work?
PHP doesn't distinguish between variables that don't exist and variables that do exist but have a value of null
it sucks a bit
The difference is that when you try to actually use a variable that doesn't exist, you get an error
19:09
Oh I get you now :P
It's a difficult thing to grasp in the first place, and an annoying thing even when you do understand it
Would your example work with just PDO? Im not using mysql: (in MySQL/PDO, $stmt->rowCount() === 0)
Well if you are checking where a SELECT query found anything, you need to check the number of rows in the result set
If you are checking whether a variable exists, you use isset()
They are two very different operations
brb
Ok thanks.
Worked! :)
user924016
@RahulKhosla how is your project going?
19:14
I am trying to improve my response class. http://paste.jesse-obrien.ca/6Ar#9
I would prefer to give a cookie iterator back instead of the array. But I also want to avoid new calls in the class. Should I write a factory and make that a dependency of the class?
@Patrick I have reached the conclusion that cookies don't belong in the request or the response class. While they are communicated via request/response, they are actually a persistent data store, and should be handled in the same way as session data (which also does not belong on the req/resp)
That is to say, the response should have access to the data store, but your code should not access that data store from the response class or the request class
But they are part of the http header?
ah
This is my opinion, YMMV
@RonniSkansing Amazing
Learning so much on the way.
user924016
Great! =]
19:20
@DaveRandom do you use the cookies for anything else than storing the session id?
@DaveRandom Could you have a quick look at an SQL query for me, and tell me why it only limits one result?
$searchStmt = $db->prepare('SELECT * FROM items WHERE tag LIKE :usersearch');
$searchStmt->execute(['usersearch' => "%".$_GET['search']."%"]);
@Patrick I try and avoid it. Doesn't mean I don't do it. (do as I say, not as I do etc)
It worked with mysql, but when I used PDO it messed up :D
Although don't just do as I say because I am in no way an authoritative reference :-P
user924016
The worst is when you run out of paper..
19:22
@RahulKhosla That would return more than one result if there was more than one result, it's nothing to do with your query
Either your query doesn't match what you think it does or your code that handles the results isn't doing what you want it to
You're right I just ran this in my SQL tool: Showing rows 0 - 2 (3 total, Query took 0.0003 sec)
SELECT * FROM items WHERE tag LIKE '%button%'
I would guess your loop logic isn't correct for fetching the results, what are you doing there?
Il pastebin the search.php
no worries
19:25
I'll be drifting in and out for the next hour or so, putting The Boy to bed
No worries.
Its only a few lines anyways :P
@DaveRandom so create a cookie storage object form $_COOKIE and then inject that into the response. Makes sense.
Thinking about it, might as well refactor the $_SERVER stuff into a config class
@RahulKhosla I need to see includes/results-layout.php
Just edited.
and you need to sort your indentation out ;-)
19:26
Ikr
@RahulKhosla you'll have a new url I think
I don't think you can "edit" a pastebin, I think you can only create new ones based on old ones
@RahulKhosla do you have a github?
No look up edited the original links
Rahul Khosla
@DaveRandom pastebin.com/bikT56ws pastebin.com/FyNSCLhZ
Im not sure how I can share comments on this :D
If not you should get one, gist is by far the best paste tool
user924016
19:28
@RahulKhosla you could also use a collabedit
@RahulKhosla Oh right sorry, I get you
@SecondRikudo that is really a good question. I can't even find the code in lxr where echo kicks in.
@RahulKhosla hmm that's odd, I can't see any good reason for that to eat results
Oh @RahulKhosla, require_once ;-)
Shit I love u
@DaveRandom THANKS! :)
@hakre echo not relevant, convert_to_string_ex()
19:32
Now i've got the last issue to sort out, the stupid related products thing.
(or, more to the point, cast-to-string routine, not sure if that's what will be used but probably)
Just does a STR_EMPTY_ALLOC()
@DaveRandom cast to string behaves likewise.
I was looking for echo because of string context. I can imagine that echo was first :D
Well yes exactly my point, it doesn't matter that he's echoing, only that he's converting a bool to a string
You get the same result if you printf(false); for ex
@DaveRandom If I give a final you a problem can you help me solve it?
I can certainly try...
19:34
Okay then my assumptions is, that the reason is that the boolean status should be encoded into stringlength
0 = false, 1 = true.
@RahulKhosla Although brb 10 mins, post problem description and either someone else will help you or I will in a few mins
@hakre I think there's a higher level reason than that
I'm sure someone told me a good logical reason once, although I cannot remember what it is
@DaveRandom http://gyazo.com/a9d69cb2f4faeefbb78833fdfa90605a & http://pastebin.com/sn5fnCma

The following links include a screenshot of my table and the code. The related downloads section will only display one result. I assume its because the tags aren't breaking down into single words?
@RahulKhosla Which section only displays one result (ie which query)? First or second?
Second.
good, that would be the logical answer but just checking
19:46
the :downloadID is the same on both though. If that makes any difference.
So that screenshot is of the tags table?
The full table
Sorry, I misread something, hold on
tag is the section you're looking at, and also maybe ID.
All your values of tag are different
You code is looking for items with the same tag, but all your items have different values for tag
brb
19:49
im wanting to search for
similar tags
ie buttons is in 2 rows.
20:24
@RahulKhosla Yeh but you just did = (i.e. an exact match of that string)
@DaveRandom I tried LIKE too.
What you need there is a separate tags table, and an item_tags table
What you have there is a many-to-many relationship, you need a relational table, you can't do it with strings
Give ma couple of mins
Ok thanks.
It's gonna be confusing on how to do this :D
Also will you help on TV? I also want to show you the redesign.
20:40
sqlfiddle is very broken :-(
@DaveRandom You got mail.
my brain does not seem to be working @RahulKhosla
@DaveRandom Coffee.
I may have to sit this evening out
@DaveRandom Awh :(
@DaveRandom Connect, il show you the redesign?
20:50
@RahulKhosla That does not assist brain function in any way, all it does is make your body stay awake while your brain function continues to decay
Just resent it, went to myself for some reason.
Eat fish, omega 3.
Or nuts (not the mag)
user924016
nn
@RonniSkansing nn?
@DaveRandom Are you coming to visit my screen?
certainly not instantly, I need to try and wake myself up a bit
I can't concentrate on things
Slap yourself 10 times.
Ok np, I'l not change pass
@DaveRandom Ok sorry, would be funny if I started that too though haha :P
21:51
hey
@SivSivSree Ave
@NikolaR. :)
its 3:26 am, in here and stuck over here, lol
@DaveRandom José González - 'Teardrop' ♥ it
never heard that cover before this evening
I always forget that I actually love José González
He really should be bigger than he is
21:58
Got a question...not a PHP one :P
the maximum rep per day is 200
can you exceed that if you have an accepted answer?
@user3739658 Accepts will let you exceed that limit, as will bounties
ok :)
what if its an accepted + upvoted answer
the +10 exceed the limit as well?
get it and see for yourself :)
When you have earned <200 rep, an accept will count towards the 200, after you pass 200 upvotes don't give you anything but accepts still give you +15
@user3739658 200 from upvotes max per day
22:00
I'm sure there's something in FAQ that explains it fully...
ohhh
that makes sense
cause I exceeded 200 rep :)
and I was scared if they would remove some
lol :P
goal for today in total was 500 rep
but I think I will try to get the rest of 50
tomorow
22:01
76
Q: Team members spending too much time on Stack Overflow

user2711965Almost 8 months ago, I introduced encouraged my team members to follow Stack Overflow so that they can read questions, help others, and build their skills. But now this has gotten out of hand. I have a team of 5 developers, and three of them make at least 150 points on average,each. (This is most...

@user3739658 Rep only gets taken away from you for 1) voting irregularities (i.e. you have 2 accounts and you use them to vote on each other) or 2) when a user is removed from the site (they voted on your posts and they no longer exist so the rep changes they effected don't exist any more)
@DaveRandom oh ok and no all my answered questions got legit voting :)
☺
@DaveRandom You're back in function?
22:04
@user3739658 No worries :-) btw you should set a proper username and avatar, people (rightly or wrongly) tend to treat userXXXX usernames + identicon as "hit and run" users who don't have anything to contribute to the site. If you passed the rep cap I'm guessing you have something to contribute, you'll get a warmer reception if you have a "proper" username and avatar
[offtopic] How do I resize and image (<img>) in bootstrap?
@RahulKhosla Not really, I'm a bit drunk and listening to music.
(i need it to be fluid)
I'm done with the real thinking for the eve
@DaveRandom Oh, come on TV?
Its a presentation :D
22:06
@RahulKhosla img { max-width: 100%; height: auto; }
@RahulKhosla Honestly, cba. Will do tomorrow though if you want
@DaveRandom Thanks, I was thinking of changing my username and picture once I reach 500 rep in total
@NikolaR. Thank you!
Hopefully tomorow, I like to set goals
@DaveRandom Ok no problem, I can just send over some screenshots if you want to see the new design.
Need some feedback on it :P
22:07
@RahulKhosla fyi [tag:off-topic] ->
Thanks!!
:D
@RahulKhosla Just post it in public a) you'll get a faster answer and b) more opinions are better
@NikolaR. What do I do if I want this to be fluid?
<img src="images/thumbs/<?php echo $row['id']; ?>.jpg" height="300" class="thumbnail"/>
first thing, get rid of height attribute in img tag.
Next would be to add some style to .thumbnail class such as .thumbnail { max-width: 100%; height: auto; }
I need the height
Just to make the resolution bad so people can't copy and paste it.
22:12
then it's gonna be stretched, not fluid. I am not sure what are you trying to do now
@DaveRandom What is this/whats it do?
@DaveRandom Cool man, #Music
@RahulKhosla It lets you programmatically manipulate images
HOLY SHIT
HOLY SHIT!!! YOU CAN WATERMARK IN PHP?
22:13
@RahulKhosla Yup
WHAT THE .... I've spent 123123 hours watermarking all my images in photoshop.
eureka :)
WHAAAAAT
Im not sure if i'm angry or happy at this point!
@RahulKhosla what are you working on, if I may ask?
22:15
@RahulKhosla fyi, it's an epic pita to work with
It does work really well though
Stock photo website.
@DaveRandom So does it store the image on the server?
(I've been drinking, and working all day, I seem to be in chillout mode)
As in
Redo the original image?
22:16
Depends what you do, it's insanely complicated.
Or does it just do some wierd z-indexing?
What you do with the image depends on how you output it
you save it to a file or just send it directly to output
I'd rather just output, I don't really want to waste diskspace
And you can just generally all kinds of craxy shit with it
@RahulKhosla heh, photoshop has a batch feature...
22:17
see also imagick (google it)
@HamZa I hate you.
@RahulKhosla not saving it is a huge waste of CPU
@RahulKhosla Sounds familiar
@HamZa Not really <3
@DaveRandom good call!
In general you want to perform a specific image operation once and cache the result
Image manipulation is pretty expensive
22:20
I guess it is.
@DaveRandom now listening to what? :P
@DaveRandom Can it do anything regarding image resolution ie DPI ?
tbh getting fed up of cruising yt, prob going to put Big Calm on after this so I don't have to thing about it
(morcheeba)
could really do with a joint right about now :-P
@RahulKhosla What PHP version are you using?
5+
Not sure on the exact on GoDaddy.
And i'm working on localhost atm.
22:25
imagecopyresampled() is prob what you want then
Thankau
5.5 has a simpler way of doing it, the name of which I forget
imagescale()
that's the badger
Thanks, so basically what i'm gonna do is;
Store the images in images/photos/ and then echo them out in thumbnails and the large version. The only concern I have is someone breaching image/photos/
@DaveRandom Whats good about the imagescale() than imagecopyresampled() ??
than 5.5 :P
@DaveRandom uk3.php.net/manual/en/image.examples.merged-watermark.php Why not just use a transparent png?
22:30
@RahulKhosla If you send the image to someone, they have the image - so if you send a full res, they already have it
@SivSivSree Simpler API and much lower memory usage
Plus copyresampled requires that you create another image resource, scale() just resizes the current resource
@DaveRandom I'm just going to use this; uk3.php.net/manual/en/image.examples-watermark.php
@RahulKhosla Honestly, not my area
got it checked the php manual

thanks man
I've basically managed to make GD do what I want it to in the past by playing with it (and often shouting at it) until I have the result I want
I don't know a huge amount about how it actually works
I do happen to know about imagescale() because I happened to be in IRC when it was being discussed
22:33
What are alpha channels?
0
Q: Phpunit test with disabled error handling is totally slow

hakreI've refactored some code and introduced deprecation warnings with trigger_error() and the E_USER_DEPRECATED constant. Therefore I needed to modify the test that is touching that feature public function testMethod() { $expected = 'value'; $actual = $this->subject->callDeprecatedMethod...

to whom it may concern... Q&A style :)
@RahulKhosla transparency
rgba is red/green/blue/alpha
AHHH NOW I GET RGB...A
Wow
I didn't see that comment before I posted mine.
Our minds are connected @DaveRandom
22:37
This is one issue with GD, every single pixel takes up 4 bytes in memory
this gets pretty ridiculous pretty quickly
The lib that that extension uses underneath
@RahulKhosla the library you two are talking about whole time
A 1024 * 768 image takes 3 MB of memory, and it's an exponential scale :-(
this is a major reason why you should cache your thumbnails @RahulKhosla
Oh my god.
My photographs are gonna be shot with pro cameras...
So thats a large res.
@DaveRandom The idea behind my website is that it will offer free photographs, but only two a day. I have 100000's of spare photos I can use.
The only problem is after 2 downloads, I don't want users to just copy and paste the photos.
So if I just save the thumbnails as 72dpi, a watermark will not be needed?
22:44
@RahulKhosla dpi isn't really relevant tbh, it's just res that matters, and more than that it's just making sure that the thumbs you show on the site are good enough quality to see the picture but not to be actually useful
@DaveRandom I can just do them manually then.
You can, but I'm guessing that will take a while...
You could probably script PS in some way though
I imagine it has COM model as well
Possibly even some .net stuff
I would never buy stock photo based on 200x200 preview... so consider higher resolution previews with watermark, really.
just my 2 cents...
22:46
@RahulKhosla Windows specific shite, don't about it
@NikolaR. Again, the idea is you can download 2 a day anyways.
And you pay $X for 10 a day, $X for 20.
is it considered backwards compatible if all you do change is triggering E_DEPRECATED errors?
DETACERPED_E
DERPRECATED
I have no idea why I did that. You just said backwards.
22:55
@hakre Meaning you are triggering an error that was not previously triggered, or you are eliminating an error?
@DaveRandom I'm triggering the error so that users become aware that some odd feature is going to get away in some time.
semver would make that a minor I think, so yes that's BC
The actual functionality is the same
> Minor version Y (x.Y.z | x > 0) MUST be incremented if new, backwards compatible functionality is introduced to the public API. It MUST be incremented if any public API functionality is marked as deprecated.
is triggering an error public API?
error log is side-channel, not main channel
If the error is a side effect of calling a public API method, yes
If it's internal impl, then no
the api of that channel is not changed: we are just using the error log as before.
that has not changed. API Check #1: OK, no change.
Has the public interface of the class changed?
that has not changed. API Check #2: OK, no change.
All public interfaces have been checked Ok (2/2).
23:01
Errors are part of the API IMO
(ymmv)
That would be good question to ask on SO ^^
probably more programmers.SE
still not sure of diff between those two, having said that, but it feels more programmers somehow
well, if an error message is like a string.
As long as sendString() or getString() don't change, the strings can change, right?
I consider am error message to be more like a result (i.e. a type of return val)
If you threw a new exception, that would be an API change
sure, that's a clear case with the exception.
so it's not good if this pisses users suddenly having notices.
if I semver one up, I don't have such a hassle. leaves also some room for further improvements.
23:08
> PATCH version when you make backwards-compatible bug fixes.
A new error is not a bug fix
deprecating that shite is a bugfix :)
Disagree. In composer terms, if I ~1.1, I install on a server, two weeks later I install on another, if I suddenly get a new error that's unexpected
I'd expect breakages if I minor version up
yeah, I will handle that conservatively. users can then decide when they want to step up.
^ that
23:18
on the other hand: getting one revision up for every new deprecated notice is not that practicable as well.
I should combine that with some more API changes then that only add to the interface, so it's still backwards compatible.
@hakre assuming you have some changes to make. It's not like you are going to run out of numbers...
Hi guys
I have a wordpress in my subdomain, it is loading in my office computer but in other computers it is not finishing up the loading of the page. I also tried it my home laptop and it's just the same not completely loading. What might be causing this? A slow server.

Note: I cleared the cache
the subdomain is made in wordpress
23:53
@DaveRandom Need Music :P lol
00:00 - 19:0019:00 - 00:00

« first day (1345 days earlier)      last day (3829 days later) »