« first day (2029 days earlier)      last day (2916 days later) » 

10:01 AM
@crypticツ Yeh but if you just do it at midnight UTC once a day then you only have a specific set of pages (< 10) that you are interested in. And if you keep track of the message IDs, you are just reconciling for missed messages rather than looking for any tagged message
@crypticツ It happens, it's still very-alpha atm and will be off during deploys etc. It will get more robust over time but it's still worth doing (servers go down, BGP leaks happen, etc etc)
 
ah ok, so if Jeeves sends me message id 1111111 and and that's the latest entry recieved I start message searching from 1111111+?
 
@crypticツ Well you can just get chat.stackoverflow.com/transcript/11/2016/5/5 (Y/m/d) and walk the pages listed in the index at the top of the page
If you do it at like 00:05 UTC for the previous day
 
Doable!
Also, I'm currently using JSON to store the IDs as I was fetching as a batch. Since we'd be individually adding IDs as they come in I'd like a better way to manage storage. I think an SQLite file would suffice for such a simple thing, unless we want to integrate other services to use the same DB.
 
Well a small pgsql DB might be in order (that way you could keep a historical list as well, which we could maybe do other interesting mungey things with)
Could see when multiple rooms cv the same question, for example
 
I'd need help with that then. I've never used that before, and I'm terrible at database design =oP
 
10:10 AM
@PeeHaa you got any idea who has the #11 packagist details?
I have a feeling I created it when I made the gh org but I can't find it and there are packages in there that I don't remember adding
@crypticツ Well, MySQL if you must. Be yeh we can easily come up with a schema. Suggest initially you just go for a flat table in the same format as your json store, and filter on room ID for display
@Danack chat.stackoverflow.com/transcript/message/30381132#30381132, that packages in there seem to be your repos
 
@DaveRandom I didn't even know we had a packagist account
Oh right. Yeah. @Danack added a http package iirc
 
@crypticツ if it's just json, you can write it as that into couchdb
 
@PeeHaa we can pw reset but no way to know which email addr is registered
There's an open issue for packagist to support github orgs
 
@Gordon never used couchdb. Are you saying it accepts JSON in its queries?
 
Anonymous
Does anyone know the rfc for \\ this
 
Anonymous
10:18 AM
I'm guessing it's a new feature, as I've never seen it before.
 
@crypticツ i am saying you can store json in it
 
@samayo It's a comment that github doesn't render correctly
 
Hey, quick question please, what is the alternative way to use $something->variable ?
 
What do you mean by "alternative"?
 
...
 
10:19 AM
What are you trying to do?
 
Anonymous
Ah, good I was very confused.
 
@Gordon and still query specific info from it? I'll read up on couchdb so I can better understand.
 
I have this property on the class with this name vinelab-editor-text I can't access it in the regular way
 
@PeeHaa ?
 
@crypticツ yes
 
10:20 AM
I can't do $this->vinelab-editor-text
 
@user297904 Fix your property names instead
 
I assume that's from JSON
 
@ircmaxell I waved to say hola :)
 
Yes its json
 
@user297904 $this->{"vinelab-editor-text"}
 
10:20 AM
@user297904 Use arrays instead
As in pass the true param
!!docs json_decode
 
that ^
 
[ json_decode() ] Decodes a JSON string
 
@Gordon Thanks, this is what I meant
 
But also you should tell the people who gave you that JSON to fix their naming
 
I give up
 
10:22 AM
It's bad form to use non-perl-word symbols
 
@PeeHaa What do you mean use arrays instead ?
 
@user297904 you're welcome, but you should really listen to @PeeHaa and @DaveRandom's suggestions
 
@user297904 If you pass true to the second argument of JSON decode, it gives you arrays instead of objects
 
@user297904 3v4l.org/sL8c0
 
Nothing happened
 
10:25 AM
@PeeHaa lol XD, thanks, its cleaner like this !
 
@user297904 In 99% of the case you want to get arrays when decoding json
 
@PeeHaa I don't like assoc JSON decoding, there's no diff between objects and arrays then.
 
@kelunik Neither is there in javascript
 
I would be nice if we had a json_populate_object(string $json, $objectOrClassName) though
 
That would actually be nice
 
10:27 AM
@DaveRandom That's a thing, just not in core.
 
!!package json
 
@PeeHaa Usage: !!packagist vendor package
 
Oh right. On the list somewhere :P
 
That should work really
 
10:28 AM
@DaveRandom you mean Jackson. The equivalent would be JMSSerializer
 
@PeeHaa No I meant what I said. I won't be nice until we get it.
 
hehehehe
 
@Gordon I'm going off schemaless anything more and more as time goes on
XML is too way too complicated and verbose but it has the right idea in that respect, at least. Need some kind of middle ground which is actually interoperable.
 
@DaveRandom I am not judging your preferences. you can do with your shemales whatever you want.
 
:-P
 
Good to know I'm not the only one who saw that
 
was just incrementing the message id
 
lol
 
@crypticツ :P
 
@crypticツ I'd say, it doesnt get akward, but definitely crowded
 
10:33 AM
dammit I want to know what room that is now :-P
 
c++
 
probably
 
obviously
 
You don't even need to have a room id for that one
 
@PeeHaa ahoy hoy there
 
10:34 AM
@ircmaxell How's the car? :)
 
so far, so good :D
though currently about 5500km from it ;-)
 
IIRC I already have seen it on top of a tow truck? :P
 
yup
blown tire
 
How? Why?
Oh
 
I am so impatient I am actually considering phoning @Danack to find out if he has the creds for packagist
 
10:35 AM
hit a pothole
 
No spare?
 
nope
"fix-a-flat" kit
 
No run-flats?
 
nope
 
What will packagist do if I try and add a package with a different vendor name to my account? Anyone know?
 
10:37 AM
@DaveRandom ... try it? :-)
 
Yeh I will, I was getting precious about my commit history, having a load of "Maybe packagist will play nice this time?" commits annoys me but sod it
 
@DaveRandom Don't think that's an issue, see amphp.
 
@kelunik cool, we need to get a known setup for the #11 account but I have literally no patience.
 
Why do we need that?
 
patience?
 
10:45 AM
#11 account
 
For packages that belong to the #11 organisation (of which I am creating 2 new ones) so they are manageable by more than one person
 
@DaveRandom Just add another maintainer
 
What's the best datatype to store these? MySQL
- null
- 0
/* the length of other numbers is always 7 digits */
- 0000000
- 0000001
- 0000010
- 0000011
/* and so on */
- 1111111
 
Following the instructions here and it links to this are these keys are only for verifying the Git repos? How would I verify the SHA hash? I don't see a signed SHA signature anywhere.
 
10:47 AM
lol @Danack just twitter DM'd me, too many communication channels
 
But usually, you don't even need multiple maintainers, because there's nothing you have to do on Packagist.
 
@kelunik good to keep it organised though
meh, whatever
 
@kelunik I always like to have the option to ragequit and burninate packages :P
 
hello
 
Is there an easy way to find an event listener based on an element clicked in jabbascript?
 
10:51 AM
@stack if that's a bitset, you can store it's base-10 representation, e.g. you can store it as an int
 
@PeeHaa As said, just add another maintainer, you don't need a shared account.
 
I inherited a project, but I cannot see what's preventing my click :()
@kelunik True
 
@PeeHaa In dev tools you mean?
 
@kelunik Anything is fine by me atm. I tried stepping through it, but this thing is huge
 
Just click on it → Inspect → Go to events panel on the right in Chrome.
 
10:53 AM
@Gordon No INT isn't good for me. because 01 and 1 are equal in INT
 
Holy shit. Mind blown
<3
 
@PeeHaa With jQ you are fucked, it puts listeners way up the DOM and uses bubbling to delegate them
 
@Gordon What about BIT(7) ?
 
@DaveRandom I am using jquery obviosuly because it's great and does all the event handling
@ircmaxell That sucks :P
 
10:55 AM
@stack not sure what you mean. If it's a bitset, how can it be 1 if it's a bitset?
 
Emma
@stack INT with length 7
 
Anonymous
@stack you are right
 
@Gordon bitset = that number is always has 7 digits ?
 
@stack They are equal for any practical purpose.
 
10:59 AM
@stack a bitset/bitmask can be of arbitrary length
@stack please see the linked post. is that what you have?
 
What you have there is really a TINYINT NULL
 
@Gordon I got it what's bitset. and yes it is bitset. Actyally this is what I need
 
That's an integer. Storing it as a string of 1s and 0s is just silly.
!!docs bindec
 
[ bindec() ] Binary to decimal
 
@DaveRandom look, I need to use SUBSTR() for that number. So I think I have to store is as string
 
11:02 AM
@kelunik \o/ killed the listener
 
@stack then you can store it as an integer. however, if it's a bitmask like in the example on the linked page where each bit stands for some preference, then it's better to store the individual preferences
 
@stack Why do you need to use substr()? What purpose does this serve?
This smells of X/Y
 
@Gordon Ah ...
@DaveRandom Ok, let me say an example ..
 
posted on May 06, 2016 by kelunik

- Implement monitoring system - Always properly close HTTP/1.0 connections - Fix wildcard address matching

 
shiny
 
11:05 AM
o/
Does there exists some "general" extension for calendar items, MAC/Windows user can use? ( Am setting up some news feed but I want to allow a user to click a button to 'save' the date as a calendar item)
 
@stack you dont need substr when it's a bitmask. you just do $bitmask % PREF_XY == 0 to see if the bitmask has this preferences or not.
 
@Gordon Here is what I'm trying to do:
I have this table structure:
// User
+----+---------+----------------------+---------+
| id |  name   |        email         |  ban    |
+----+---------+----------------------+---------+
| 1  | Peter   | peter931@hotmail.com | 0000000 |
| 2  | Jack    | j281_ab@gmail.com    | 0100000 |
| 3  | John    | black_car@yahoo.com  | 0100100 |
+----+---------+----------------------+---------+
 
I know this isnt the proper place for this but since I dont seem to find a chat based on Excel is there anybody here that controls formulas in excel? (VLOOKUP mostly).
 
Actually that 7-digits number determines current user is banned in what case?
0000000
      ^ voting
     ^ commenting
    ^ flagging
   ^ favoriting
  ^ answering
 ^ asking
^ editing
So
- first user isn't baned at all
- second user cannot ask question
- third user cannot both as question and flag something
 
@Gordon but what you effectively have is an array of bools in that case, and that's how you should handle them @stack (store them separately)
@stack Yes, store them in separate columns
It's much easier to write queries for an reason about in general
 
11:08 AM
@DaveRandom Why? I can use simply SUBSTR()
 
Yes, but you can't do indexed searches (for example)
 
How many reasons are there to ban someone? And why do you love binary so much? -_-
 
And your queries become harder to read
Bitmasks are useful in places where space is at a premium. Databases are not one of those places
 
Ekn
lol
        $ohMyGodJoeReally = "Inspector\Global";
        $function = new $ohMyGodJoeReally($functionName);
 
@DaveRandom I don't need to make an index of that column. When user login. I store $_SESSION['ban']= $result['ban']
 
11:10 AM
@stack Don't get me wrong, bitmasks are good for things and what you are suggesting will work, but 1-year-from-now you will not thank present-day-you for doing it
 
@stack yes, that's a classical bitset/bitmask and you just store the decimal representation of it and then modulo on it. BUT again: you want to store them as individual columns
 
@stack read stackoverflow.com/questions/11880360/… to see (hopefully) why the substr approach is wrong, even if you are going to use a bitmask
 
@DaveRandom I really don't understand why you and @Gordon say I have to use separated column. In that case I have to add 7 new column to my table. Which almost always all of them are 0. rarely one of them will be 1 (when a user is banned in that case)
So I think a column can be enough.
 
yes, but database columns are technically cheap. Complex queries that are hard to read are cognitively expensive.
Write your code for humans to read, they need a lot more help than computers
 
9
A: Binary data in MySQL

jspcalif you're dealing with binary numbers you can use a bit field, e.g.: bit(64) is a bit field with up to 64 significant bits (the maximum size allowed). to insert constant values, you can use the b'value' notation like so: insert into bits values (b'0001001101001'); you can convert a bit fie...

@stack
 
11:15 AM
@DaveRandom :-)
@SagarNaliyapara Thank you
@DaveRandom ++
Ok I will store them in separated columns. So what datatype? tinyint(1)? or bit(1) ?
 
@stack a bitmask is efficient from a space point of view, but you usually don't have that constraint. and if you dont have that constraint, having multiple columns is more descriptive and easier to query.
 
Hi please somebody tell me is it possible to attach files with php mail() function?
 
@stack TINYINT(1)
 
Google should be able to help
 
@Gordon Yes it is more easier to query. But why a simple-query is important for you? I want to write is just one time !!
 
11:18 AM
@stack I'd recommend tinyint personally, because that allows you to expand it without altering the database schema - e.g. you might one day find that something becomes tri-state, like unrestricted/restricted/banned
 
!!google is it possible to attach files with php mail() function?
 
Search for "is it possible to attach files with php mail() function?" (http://bit.ly/1TMk7Nj)
• Send attachments with PHP Mai… - I need to send a pdf with mail, is it possible… (http://bit.ly/1TMk5F9)
• PHP mail attachment script an… - This custom function or PHP mail attachment sc… (http://bit.ly/1rZI3Ei)
• PHP: Sending Email (Text/HTML… - Sometimes email contains file attachments, bot… (http://bit.ly/1rZI1fU)
 
@SagarNaliyapara ok
 
@AwalGarg that console detector thingy is cool
 
@astrosixer yes possible
 
11:18 AM
Danke Gordon
 
@DaveRandom reasonable
 
@stack because code is much more often read than written and easy to read code is important
 
We should make !!google work with a message ID @PeeHaa
 
@DaveRandom !!google 30382812?
:P
 
:-P
 
11:20 AM
@Gordon you are right
 
@sagar But every one points out phpmailer ? I want to do it simple
 
There is nothing simple about sending mail
Just use a mail library
 
really very this ^
 
Mail sucks. Just send pigeons.
 
And I speak as someone who has written mail libraries
 
11:22 AM
yet i havent used phpMailer .. it require smtp to enable and i dont know where to enable it . so i googled it ..
 
24
A: insert image in mail body

sarcastyxTo create an HTML email you can do something like this: ... $message = "<html><head></head><body>"; $message .= "<img src='link-image.jpg' alt='' /></body></html>"; $headers = "From: $from_email"; $headers .= "Content-type: text/html"; mail($to, $subject, $message, $headers); This should bui...

@astrosixer
 
come up with some smtp account to create or enter?
 
@astrosixer It can also use sendmail or whatever transport
 
@astrosixer i might be wrong, but iirc you dont need to use smtp. see github.com/PHPMailer/PHPMailer/blob/master/examples/mail.phps
 
I so wish that was a rebecca link
missed opportunity there
 
11:24 AM
:)
 
@SagarNaliyapara how abt attaching excel sheet or something like it
 
The file type is irrelevant, you just need to specify the MIME type exactly like you do with HTTP messages
 
@Gordon I downloaded that but require some user name and password to use smtp..
 
@astrosixer no, it doesn't
 
@DaveRandom tinyint(1) needs 1 byte storage but bit(1) just needs 1 bit. So still are you believe tinyint(1) is better in my case?
 
11:26 AM
It only requires that if you specify a transport that requires it
 
145
A: Send attachments with PHP Mail()?

SDCI agree with @MihaiIorga in the comments – use the PHPMailer script. You sound like you're rejecting it because you want the easier option. Trust me, PHPMailer is the easier option by a very large margin compared to trying to do it yourself with PHP's built-in mail() function. PHP's mail() functi...

 
it defaults to just using mail() I think
 
@astrosixer
this one with phpmailer
another one is
21
A: Send attachments with PHP Mail()?

Simon MokheleFor PHP 5.5.27 security update $file = $path.$filename; $file_size = filesize($file); $handle = fopen($file, "r"); $content = fread($handle, $file_size); fclose($handle); $content = chunk_split(base64_encode($content)); $uid = md5(uniqid(time())); $name = basename($file); // header $header = "...

@astrosixer
 
@stack a bit column takes up more than one bit on disk (disks can't store a single bit, the smallest unit a disk understands is a byte)
 
with simple mail() function of PHP
 
11:28 AM
Ok @Sagar let me check then ...
 
@DaveRandom Isn't it dependent on the block size?
 
@SagarNaliyapara you can just write @username and the link. no need to put the @mention in a separate message.
 
@DaveRandom Ah, so there is no difference?
 
I seem to remember at some point I could only create 2MB directories when I cocked up a fs
 
@stack Certain store engines might to some clever grouping or whatever, but I'm willing to be that a few bytes of disk space is not an optimisation you need to make
 
11:29 AM
@Gordon it annoys you?
 
@DaveRandom ok
 
@SagarNaliyapara mildly
 
Again, code as if you have been asked for a lot more features than you need at the moment. Don't pen yourself in in future for the sake of a few bytes of disk space.
 
ok will keep in mind @Gordon
 
@PeeHaa Yes, but that's a superfluous thread here really. Databases designed around the limitations of a thing that is several layers of abstraction below doesn't sound like a good plan :-P
 
11:34 AM
@PeeHaa ty :)
 
@stack what it comes down to is this in fact: Don't optimise things before you know they need to be optimised. Do the easy thing, and if that doesn't work out, then you can think about what the best option of the hard things is.
 
btw @PeeHaa is your software distributor thingy ready? I am actually looking for something like that right now
inb4 6 to 8 weeks
 
s/weeks/beers/
 
s/6 to 8/60 to 80
 
s/inb4 6 to 8 weeks/let's go to the pub/
 
11:36 AM
@DaveRandom I cannot do that .. there is some snakes in my head that tell me your code isn't optimized .. Optimize it before continuing.
 
@stack Everyone has that. You can learn to ignore it though.
 
@DaveRandom Well I love that book which teaches me how to ignore it !!
 
It's called a bank statement :-P
 
:)
 
BAAAH! ElasticSearch. I hate you! Y U NO ACCEPT MIXED CASE IN TERM QUERIES???
 
11:43 AM
@Gordon why can't you just store your data in normalized lowercase form?
 
@stack A argument I use to convince myself not to is that the gain should be worth the effort, so if you spend lots of time optimizing but only get minimal improvements, it's most likely not worth it.
 
@bwoebi because reality is not lowercase
oh, actually "reality" is.
 
@Gordon In elasticsearch I mean…
 
@Epodax exactly ..!
 
not in the database
 
11:45 AM
@bwoebi that's apparently what ES does by default. But that means I have to remember to lowercase the term query when I am going through the java api and obviously I forget this most of the time which then leaves me staring confused at my failing tests
or rather it stores the data in mixed case, just like I send it there, but I cannot search for that exact same term then due to how it handles the index then. what do I know… it just annoys me.
 
There's some initial things to note with - and . too.
 
Anonymous
Is there a way to merge (group) arrays that share the same root key?
 
this-string-search vs this.string.search. And underscores
 
o/
 
12:00 PM
Dat moment when you can successfully do something in git...
 
@samayo elaborate please?
 
array_merge_recursive?
 
sup guys, have a QQ re: Traits. I dont fully understand them and about to do some research to see what's up. For things like "Tags, Comments" that are available across multiple objects with the same functionality for "getTags" etc... does it make sense to put that in a trait?
 
@Andy If the functionality in question is a discreet, self-contained unit of code then yes
If there's any variance at all then probably not
You don't want a trait with "settings"
For that you probably want a separate class for that purpose, which is injected and then the methods are passed through from the public API as needed
 
@Sagar thanks it worked
 
12:18 PM
@AwalGarg Yea 6/8 weeks :)
 
so
my idea for a project for today is to compile Friday method namer to JS
i.e. hack on ELC until it works well enough to compile that too
 
@Gordon decorate the API so that the wrapper does the lowercasing for you?
 
@bwoebi yes, that would one option. Or I could add a table mapping or I could just remember it. Trying the latter now.
 
@DaveRandom currently for Tags im using a Tag interface that is then used within the Tag servicelayer to get the tags for the object vs. having the functionality in the model. does this sound "right" --- or should i trait it up?
 
@Gordon I'm predicting the latter will horribly fail you in future
 
12:22 PM
@bwoebi that's how you learn ;)
 
let's see, what would I need to implement…
 
@Gordon yea… but you know it's bad …
 
@Andy Would have to read code to have a valid opinion (and do not have time atm). For me, traits are usually a default implementation (or partial implementation) for an interface that is used a lot in a way that only special cases change the behaviour.
 
mrrrrg
 
arrays, strings, callbacks, references, array_values, array_filter, explode, strlen, trim, mt_rand, count, preg_match_all, array_map, str_replace, strtolower, ucwords, htmlspecialchars, $_SERVER
I can implement all of this within 24 hours, right? :p
 
12:25 PM
@bwoebi decorating is more effort though
 
@Gordon more effort than bughunting in two weeks when you'll have fogrotten about the lowercase requirement again?
 
@PaulCrovella I am so going to alias git merge to that for when merging things I am angry about
 
@Andrea good luck with callback semantics, and scoping
also, have fun implementing zpp exactly as is.
 
@bwoebi hehe
I think I cheated so far. Lemme check what var_dump does…
<?php declare(strict_types=1);
namespace RebeccaBlack\Friday;

class Party
{
    /** Fun, fun, fun, fun
     */
    public function funFunFunFun() {
        /* ... */
    }
}
also, ^ reminder
 
@Andrea after the first 4, the rest is easy
 
12:29 PM
@bwoebi yes :)
 
@Gordon Let me doubt it :-)
 
@bwoebi :)
 
@Andrea I'm sorry Dave, I'm afraid I can't do that
 
@FlorianMargaine yeah :p
 
Got tired of all the Rebecca links so I created https://www.youtube.com/watch?v=kfVsfOSbJY0 (this tool) to detect them before I click them.
 
not so good :(
 
does room 11 have a twitter account?
 
@Andrea Nope, but @Jeeves has.
 
It's Friday, Friday, naming #PHP methods on Friday… http://ajf.me/mini/fridaynamer/ https://t.co/rnAKhP9w52
2
there we go. now you can retweet that terrible creation of mine
 
Anonymous
12:32 PM
@DaveRandom I don't know how to describe it ..
 
Anonymous
but take this ..
 
Anonymous
return [
  '/var/www/foo/bar',
  '/var/www/foo/tar',
  '/var/log/nginx',
  '/var/log/php-fpm',
  '/srv/foo',
  '/srv/bar'
];
 
Anonymous
The goals is to group them together.
 
Anonymous
Not sure if there is a non-ugly solution for this.
 
12:34 PM
user image
10
this won't fool anyone
 
:D
 
did jeeves just call rebecca a tool?
 
:P
 
oh, but @Jeeves is sending the link now it gets unboxed in chat. thank you whoever did that
 
#fail
 
@Gordon it's unboxed on twitter too
 
are there any existing projects to write the PHP standard library in PHP?
serious question
oh, actually, I think HHVM has that
 
most of it at least
 
however, HHVM's is written in Hack/HNI, and I can't be bothered to update the Zend Engine to support that
so I guess I'll have to do it myself
 
@ircmaxell yes, Jeeves would previously say Message Tweeted instead of posting the tweet url
 
12:41 PM
:)
 
@ircmaxell Somehow your avatar makes me think @rdlowrey is here.
 
I probably should be working on my PHP-Compiler backend instead of ELC, but the latter is more fun
 
@kelunik tur dat
 
is it just me or the linux version of MySQL Workbench is made using spittle and toilet paper ?!
 
I have this little snippet of code which will tell me if there are enough items on storage. pastebin.com/Dp7KfEk7 My problem is now javascript/php edit. When I edit the storage value and send it with ajax, I would need to refresh the whole page to get the warning disappear, how can I acquire that info without full page refresh?
 
12:49 PM
trying to get phpmailer to work on a simple static html css page but im getting the error page isn’t working and is currently unable to handle this request.
HTTP ERROR 500
 
@Andrea francois pcs
 
@NikiC ?
oh, I see
 
Anonymous
@tereško I would assume every linux software has a crappy gui
 
Anonymous
since it is open source
 
not specifically what I'm needing
 
12:51 PM
@Andrea err, I overestimated google there. github.com/flaupretre/pecl-pcs
 
ive downloaded the class.phpmailer.php file, and when i submit the post i do this code pastebin.com/hQs6mMBV
 
@NikiC yeah, I see it now :)
 
@samayo Not every Linux software is open source.
 
Anonymous
I know, but the majority is
 
12:57 PM
Oh awesome
No, nothing to do with me
 
Even better :)
 
!!request google.com
 
So re. the packagist thing, basically packagist is dumb so we have to get Danack to add room11 packages for the time being and use his key for the webhook @PeeHaa
 
12:58 PM
(star pls)
 
@DaveRandom Less work for us @Danack
 
I think we also need to shout at Jordi
 
Morning guys
 

« first day (2029 days earlier)      last day (2916 days later) »