« first day (2007 days earlier)      last day (2948 days later) » 

Anonymous
2:00 PM
 
@GotaloveCode let's put it this way: I haven't done page slicing and dicing like this in years. Most people I know would use some sort of framework that supports templates. Then again, there is no rule that says you cannot do it in the old fashioned way.
@Jay yeah, no worries. I'd never skin a cat.
heading home now. cya folks.
 
o/
 
\o
 
o/
 
Ekn
2:14 PM
\o
 
o/
 
Anonymous
\o
 
o/
 
Awwww, and the wave has ended :(
/o\
LOL
 
@Gordon pastery.net/gekfgq The only thing it does right now is saying : ('there are errors' , but Im getting closer, Should I use json to send errors back? So instead of return $errors, .. print json_encode($errors); ?
 
2:19 PM
Nice recovery.
Now I messed it up :O
 
Haha indeed :D
 
@Duikboot gordon is gone.. FOREVER
 
Derick didn't read the union types RFC.
The weak conversion rule dilemma is in there already ^_^
 
Good morning @Levi
 
Morning.
 
2:28 PM
Anything I can help you with?
 
If you feel like implementing union types then sure. Otherwise not really.
Just the normal start of RFC discussion that isn't worth reading because it was anticipated before the RFC was submitted ^_^
"I want PHP 5.2 back" kind of folks.
To be honest I left more "Open Issues" than I needed to because I'd figure the list would work them out to the same answer and this way they feel like they are contributing. But if they don't work them out then maybe it would have hurt the RFC if I had just included it.
Seems like a win-win so I went for it.
 
@LeviMorrison whut? 5.2? I want 4.4 back! /s
 
Plus it allows me to steer the discussion to those points instead of random other ones.
 
@LeviMorrison Yeah, I think it's fine that way … people often go quickly off-topic in these discussions…
 
I wonder if we might end up in a situation where scalars are simply not permitted in unions.
To be honest I'm fine with that.
 
2:35 PM
I think that pretty much kills the feature for me
 
Basically we need a "least loss of precision" calculation.
Given a string checked against bool|int|float we need to determine which has the least loss of precision and go with that.
 
2 days ago, by bwoebi
float: int -> string -> boolean
string: boolean -> float -> int
int: float -> string -> boolean
boolean: int -> float -> string
 
Yes, yes, but if the type is found in the union then do no conversion.
 
@Naruto Forever :(
 
@LeviMorrison sure
 
2:38 PM
It was probably assumed but I wanted to mention it explicitly.
Also, float(1.3) might arguably be better converted to "1.3" than int(1).
 
@LeviMorrison we just need a moderately sane behavior for weak types. if you pass strings to something accepting int|bool … whut.
@LeviMorrison right… floats can represent a bigger range than ints, hence strings should be converted to floats in case of int|float
 
@bwoebi Your table has int as higher priority ^_^
 
can anybody explain this statement
**The function is given a boolean argument, that controls whether or not
the function may free its arguments (if true - the function must free its
arguments, if false - it must not)**
 
@Duikboot I feel you :(
 
 
2:40 PM
@LeviMorrison nah, boolean has, or are you reading the table wrongly?
 
@John What part is confusing you?
 
though @LeviMorrison we may want to check for is_numeric and convert accordingly
that may be the sanest option
 
that controls whether or not
the function may free its arguments (if true - the function must free its
arguments, if false - it must not)
 
@bwoebi float: int -> string -> boolean; Which is highest priority, leftmost or rightmost?
 
this one
can anybody explain with example
 
2:43 PM
@John What about it is confusing you?
 
@LeviMorrison left
@LeviMorrison If type is float and int is present, use int. If not, use string then bool.
 
So float: string -> int -> boolean yeah?
 
@LeviMorrison everything... can you explain?
 
@LeviMorrison hmm, possibly. string retains more info than int… you're right about that
 
@John Do you know what it means to "free its arguments"?
 
2:45 PM
for string it should be is_numeric() ? float->int->bool : bool->int->float
 
@LeviMorrison no ..sorry...
 
2:59 PM
I'm out, later!
 
Damn pastery.net/rdtxqu someone an idea how I can reach my AJAX the right?
 
hello guys, why the error say : you did not select a file to upload.
here's the form tag (i'm using codeigniter)
<form enctype='multipart/form-data' action="<?php echo site_url('fileUpload/upload');?>" class="ui form">
<input type="file" name="file">
 
@RidleSambow Isn't it obvious?
Pretty self-explanatory error message.
 
i did browse, select the file. really. i don't know what is wrong. @Oldskool
that's why i ask it here, cause i'm new to code
 
3:14 PM
@RidleSambow Well, all you're showing is half a form. By itself that's neither throwing that error message or doing anything useful. You should have some handling logic in your controller.
The problem is likely in there.
 
Evenin
 
\o
 
3:50 PM
hmm ... strange
is it true, that I can call static methods as if they were proper methods?
 
Anonymous
One doesn't simply say "correct true".
 
lets go with "true"
 
Anonymous
Yes, last time I checked.
 
believe it or not, I have never had to check before
 
You can do this but it does not mean you should
 
Anonymous
3:53 PM
I found out by error.
 
Can anyone have a look here? stackoverflow.com/questions/36627993/…
 
@Oldskool seems i forgot the method type hehe
 
@arch1ve The answer is "yes this is possible". See the problem yet?
 
@PeeHaa changed the question so it is concise
 
Anonymous
@arch1ve If you don't want to have duplicate AFC Clayton Juniors for example, you can change the key of your array from [0], [1], [2] to use the facility_name instead. i.e. [AFC Clayton Juniors]
 
4:02 PM
oh and the input name should be userfile
 
@arch1ve Now it's too broad
 
*by default
 
Meh, I'm just going to ignore the points Tom makes. I don't think it's worth the time to have any discussion - his points can just sit there.
People can agree with them or not.
 
@arch1ve What have you tried? Where in specific are you stuck? Why didn't your attempt work to solve the problem?
 
@samayo so that will simplify the problem, but the names are not the only ones that can be duplicate. @PeeHaa I do not understand exactly how it can be done when I have arrays this complex.
 
4:06 PM
What have you tried?
 
@PeeHaa no other example I could find can have so many dupes that can go in so many places as mine
@PeeHaa I do not know where to start tbh. I though of some ways of doing it, but I am stuck at that, because none would deliver the needed solution
 
I would start with a loop
 
Actually I will respond to one of his points.
 
So, there is a loop that goes through the big array. If the name is not in the first array, it adds it. Then it gets to dates: if it is linked to a name that is already in the new array, then it creates a new key, else it goes to timeslots
I probably would be able to achieve it by doing loops that check for each category at a time, but I wouldn't know how to nest the loops so I can achieve the result in one function
 
\o
 
4:14 PM
Just try something. Anything. It will also give you some idea on what needs to happen and possibly how to improve
 
Ok then, I'll be posting it in a bit
 
gl
 
@LeviMorrison I don't see the point of his RFC... this was why union types and nullable types were separate in the first place. I get the impression that he just likes TypeName|null instead of ?TypeName.
 
user4822346
4:32 PM
Hey there! Quick question about some PHP code I'm trying to modify...
 
That's not really quick
 
user4822346
I've got this email template:
 
user4822346
<?php
echo $l->t('To create a new account on %s, just click the following link:', [$_['sitename']]);
echo str_replace('{link}', $_['link'], '<br/><br/><a href="{link}">{link}</a>');
 
user4822346
It gets marked as spam, because it's obviously not that well written.
 
$l, $t, $_ O.o
 
4:34 PM
Yo @Jimbo, look at this new bullshit (you'll love it): hjson.org
I already see it crash and burn everywhere
 
user4822346
However, if I try to modify that first echo to include a newline character, I get a 500 error.
 
@TheBrownOne an email having click, link, account will probably get marked as spam
 
user4822346
It's the email template used by the OwnCloud self-registration app.
 
@Ocramius It's annoying not to be able to add comments
 
user4822346
@littlepootis Yes, I know. Hence my attempts to modify it.
 
4:35 PM
Agreed on that
 
@TheBrownOne What does that look like (thye code)
 
They just should have stopped there and at trailing commas tho :P
 
heheheh :D
 
user4822346
Let me see if I have one of my attempts still
 
user4822346
<?php
echo $l->t('Hey there!\nThanks for trying to register at %s! However, I have to make sure that you're not some type of robot. Not that robots are bad or anything, they just use WAY too much data. To make sure you're a human, go ahead and click down below, or copy it into your browser. I realize this isn't the best way to do it, but at least it filters out some of those things.', [$_['sitename']]);
echo str_replace('{link}', $_['link'], '<br/><br/><a href="{link}">{link}</a>');
 
user4822346
4:39 PM
Wait, I think I should just be able to replace that \n with a <br /> since this is an HTML email template -_-
 
There's no newline character in there?
 
user4822346
The \n is a newline character, just not in HTML >.<
 
!!docs strings
 
[ Strings ] Strings book
 
Or rather...
!!eval var_dump("\nfoo", '\nfoo');
 
4:41 PM
[ 5.5.0 - 7.0.5, hhvm-3.9.1 - 3.12.0 ] string(4) " foo" string(5) "\nfoo"
 
See the difference @TheBrownOne?
 
user4822346
Yes, thank you @PeeHaa
 
user4822346
Would you mind trying to register here and seeing if the verification email gets marked as spam now?
 
user4822346
Nope, nevermind
 
user4822346
500 error again.
 
4:46 PM
Yeah
Also .tk really?
That can only end bad
 
user4822346
Nothing else from that server gets marked as spam, it's just this one template.
 
.tk in general is just waiting for disaster
 
user4822346
How so?
 
The Tokelau registrar is known to snipe domains
 
4:49 PM
And be a crap registrar to begin with
 
user4822346
I've been using them for quite some time now with no issues
 
@Trowski Could you please upload it with smaller letters :P
@TheBrownOne Don't say I didn't warn you
 
Sorry, here's the full size version.
 
o/ @FélixGagnon-Grenier
 
4:51 PM
o/
 
@Trowski I expected ru to be larger
 
user4822346
@PeeHaa I have been warned. Once I get everything running exactly how I want it, I'll be switching to a .com.
 
user4822346
For now, I just want to know why any modifications to this template causes a 500 error
 
The error is in the error log
The problem is a parse error
Look carefully at your string
 
@PeeHaa Same. I was surprised at the size of de.
 
4:53 PM
Use a texteditor/ide that is not notepad
syntax highlighting will show you the problem @TheBrownOne
@Trowski I knew it was large, but not that large indeed
 
user4822346
I'm using vim
 
:syntax on
 
Some people don't seem to understand that union types isn't allowing multiple return types as if it was some new thing.
It's already doable (and is done).
This just allows you to encode the specific options.
 
user4822346
Yes, it is on...
 
Well your error should be clear if it is on :)
If the color changes mid string something is fooked :)
 
4:55 PM
What is the catch with .tk? They have to be making money somehow...
 
@Trowski They snipe active popular domains and dumps ads on it
 
user4822346
Oh, I'm seeing it
 
user4822346
wow, that's a silly mistake
 
user4822346
Nevermind, I should just not touch PHP anymore :P
 
my rule is "always use single quotes, unless there's a single quote in your string"
 
4:58 PM
@TheBrownOne Nobody ever should
 
@JoeWatkins Woot! I'm running the PHP 7 memcached extension in production!
 
@Trowski how long till you're out of business?
 
Seems to be working well so far. crosses fingers
@JoeWatkins Hmm... thought you were a bigger contributor to that extension. My mistake.
 
Kay
Okay so how to convert plaintext passwords in database to hashed passwords?
 
By writing code to do it?
 
Kay
5:06 PM
duh
 
I'm voting to close this question as too broad
You know how to hash passwords @Kay?
 
Kay
No
 
Well sounds like you are going to have to learn about it
 
You should, because I linked the password_hash manual page to you earlier
 
Even wrose
woers
wroes
ewors
 
5:07 PM
wurst
 
Kay
so password hash or encrypt?
 
like I told you earlier
hash, not encrypt
 
@Kay hash
you do never want to recover a password
 
@Leigh Fuck. I could do with a nice wurst
 
Kay
so I can hash passwords that are already stored in a database?
 
5:08 PM
yes
 
1) make sure your login script can deal with both plain and hashed
2) foreach id/password pair, run password_hash on the password
3) update each users password with the hashed version
4) remove the ability to deal with plain from the login script
 
!!rebecca
 
@PeeHaa Happy Prebeccaday!
 
yo can anyone explain how result_array() works? say my query result is a single column table, with 2 records (dodit, ridle).
i tried this :
$result = $query->result_array();
var_dump($result) resulting array(2) which is [0] = array(dodit), [1] =array(ridle). arrayception hahaha.
 
I used amphp today for a small client site which goes into production next month. Not many users or anything like that. But... it was great. Thank you everyone here who worked on it!
 
5:15 PM
@AwalGarg They have certainly done an awesome job
 
yup :)
 
!!docs result_array
 
[ is_array ] Finds whether a variable is an array
 
What is a result_array @RidleSambow?
 
formating object result to array? @PeeHaa
 
5:17 PM
There is no such thing?
 
you mean get_object_vars? some day I'll read messages
 
i'm confused, so how can i make a result be array(2) : [0] = 'dodit', [1] = 'ridle'
 
@bwoebi It's late. I only had enough time to push out those two last night.
 
@RidleSambow What API are you using?
 
@bwoebi Agreed - these are just examples everyone can be familiar with.
 
5:18 PM
i don't really know, i am using codeigniter by the way
@PeeHaa
 
And to be honest I'm not sure everyone would understand why I would rather have a union of some final classes that don't have an inheritance tree instead of one that does.
 
/me steps away slowly
Can you remove your codeigniter dependency by any chance? :P
I'm failry certain it using some fetch assoc from whatever sql api
 
code-igniter is so rightly named...
 
@FélixGagnon-Grenier Reading messages before replying is for wimps
 
5:24 PM
I was kind of hoping more people would push back on the position of the question mark.
I like the trailing version much better.
 
@PeeHaa i don't know anything about API right now. mysqli maybe?
 
I tried to look at github.com/bcit-ci/CodeIgniter/blob/… for as long as I could, but I gave up
 
is this Jeevs bot opensource ?
 
@LeviMorrison What's the reason for that?
I don't think I have a string opinion either way
 
In english we put question marks at the end.
It's kind of like saying "Is this type Foo?"
Probably why I favor it.
 
5:29 PM
¿Foo :P
That's spanish right?
 
@PeeHaa thank you, maybe i don't ask it right. why result_array() producing multiple array (array inside array), and how to make it produce only string array value?
 
@LeviMorrison I have mostly disconnected code from spoken languages at some point
Not sure sure whether that's a good or bad sign though
 
@PeeHaa Both sides: ¿Foo?
 
gracias
@RidleSambow tbh not sure
 
5:34 PM
Thank you everyone, i tried assign it 'manually' :
$i=0;
		foreach($resultQuery as $row) {
			$result[$i] = $row['username'];
			$i++;
		}
		return $result;
please mention me maybe, if anyone have shorter and right code to assign it instead above. Thank you bros
 
Shorter Bros Codures
 
/me is hunting for food laters
 
@LeviMorrison true, you still can add it :-)
@Levi the longer I have to look at ?int|float, the more I hate it … we really should have int|float|null only…
 
5:51 PM
I don't plan on allowing the shortcut in another union type.
 
good.
 
Ekn
evenings
 
o/
 
7:05 PM
Hello
 
yeah, I need my windows installation back to play Skyrim: youtube.com/watch?v=UztnB91xaWg
 
... the colors are gorgeous
 
Ekn
wow it looks really good
 
7:37 PM
@Trowski I only done a little bit to get it ready for 7
 
user6116249
can anyone tell me why this link would be missing quotes in viewsource <?php echo "<li><a href=" . ROOT_URI. "/member/profile.php?profile=". $uid .">Profile</a></li>";?>
 
Because there is only a quoted PHP string
 
Does anyone have a good (preferably single word) name for an interface whose sole method is collecting statistics and returning them in an array? StatsCollector or so sounds a bit too long to me … :-)
 
user6116249
how could I correct this?
 
echo sprintf('<li><a href="%s/member/profile.php?profile=%s>Profile</a></li>', ROOT_URI, $uid);
 
7:47 PM
\o/
Happy prebecca!
n mornininnn
 
Morning roony
 
@RonniSkansing oh, shit, it's tomorrow!
 
@bwoebi It's not an analyzer is it?
 
Jay
yo
The real Jay is here
 
7:48 PM
@PeeHaa nah, just collecting runtime data about like client count, bytes sent etc.
 
Statistician neh I got nothing
 
Jay
guys how can I make this minus 12 months: date('d.m.Y')
actually: date('Y-m-d')
 
!!docs datetime::sub
 
[ DateTime::sub ] Subtracts an amount of days, months, years, hours, minutes and seconds from a DateTime object
 
@PeeHaa That's my dilemma…
 
Jay
7:51 PM
@PeeHaa
?
 
?
 
Jay
I thoughtyou was telling me something
 
Yes I was answering you
 
you and your problem-solving skills
 
@FélixGagnon-Grenier yeah, @PeeHaa is excelling there..........
 
7:55 PM
It does answer your question or doesn;t it? @Jay
 
well
you can do better ...
 
@JoeWatkins you have a good idea?
 
not for the naming thing
 
oh hoped you were referring to that :-/
 
Statistician sounds like it should a part of laravel, one that we all hate ...
 
7:57 PM
haha :-D
 
@JoeWatkins Don't let the r room hear you :)
 
Does Monitor fit here?
 
I think it does, but just monitor doesn't say much
Is it namespaced?
 
\Aerys\Monitor in that case
 
the name should probably describe what it collects statistics for ...
 
8:00 PM
Was thinking the same
 
@Ocramius Epic
 
The endpoints themselves decides what Statistics they provide … Like I'm calling on Server a method which then gathers statistics from all registered Statistics providers
 
this is too hard ...
 
Oh, come on, solving this naming problem is only NP-complete…
 
IProvideStatisticsForAThingAndMayThrowExceptionsAndAmHairyLastlyCanAlsoCookSaus‌​ages
 
Ekn
8:08 PM
:D
 
@bwoebi that is "relatively simple"?
 
@NikiC precisely. Just too hard for me.
@JoeWatkins Java, the life of a tortured Demeter.
 
> uh, red? go fish. blue? go fish PURPLE? go fish green? GOT IT echo "green";
 
yeah ^^ that's epic
 
I just have no idea what was going through the head of the person writing those words ...
 
8:16 PM
@JoeWatkins Message tweeted.
 
At the time? Op and god. Now? only god
 
@JoeWatkins yeah … as said … Java killed Demeter.
 
@JoeWatkins Too much Dr Seuss technical documentation probably
 
8:44 PM
Is this sentence correct? (specially ones in the end of sentence)
Great answer ... But look, You have 400k rep .. So please let us to answer this kind of questions (easy) and you can answer hard ones
I mean of "ones" is "questions"
 
Ekn
9:04 PM
better if "... let us answer to ..."
but, but I don't think your argument is correct
 
ah ok thx
 
@bwoebi This is an interface, not an implementation?
 
@LeviMorrison yes.
 
How many different kinds of statscollectors of bytes being sent do you expect to have?
The name seems fine to me.
 
@LeviMorrison Well, it's also an interface for users, not only for internal usage. Like Websockets have a wide variety of things they collect: github.com/amphp/aerys/blob/master/lib/Websocket/… or Server: client count, IP count, active parses, etc.
And users may have their own things they want to monitor
class Router implements Bootable, Middleware, Monitor, ServerObserver { < it's only 4 interfaces until now… :-D
 
9:47 PM
I see.
That makes more sense than what I thought you were saying ^_^
 
10:16 PM
@Wes It is possible. That guy failed massively and was being a creep.
 
user4822346
10:37 PM
Well, you jinxed it @PeeHaa :P
 
user4822346
Within 5 minutes of you all saying that .tk is bad, Freenom suspended my domains for being "Abusive", despite my content clearly following their guidelines.
 
user4822346
So, now, I'm up and running on owncloud.browntech.space
 
user4822346
Thank you all again for the help earlier, too.
 
10:58 PM
@TheBrownOne :P
At least it's friday :-)
 
Ekn
can someone point out a repo or something that can show me a sample file structure that could be compliant with PoEAA? I feel like I need something more visual to properly grasp this
otherwise it's getting confusing to cross review stuff from different resources (the book, SO, c2 etc)
 
@Ekn The file structure doesn't matter....the only thing that kind of matters is separating layers....which is what github.com/rdlowrey/auryn allows. I use that through my 'Tier' framework - which you can see an example of at github.com/Danack/TierJigSkeleton tier.phpjig.com
 
Ekn
mm I remember those, I see
okay, this fills the blank actually, thanks @Danack
 
11:14 PM
I need to write more docs for those....but first....sleep.
 
Ekn
nn
 
Kay
11:33 PM
Is there anything wrong with this? $sql= ("UPDATE Exchange
SET poundRate= $_pounds,
dollarRate= $_dollars,
euroRate= $_euros");
$result= mysql_query($sql);
 
11:51 PM
unless your column types are integers and the values are as well, you might lack single quotes around the values. you should however use parameterized queries and PDO (or mysqli). here's an ok tutorial for beginning pdo
 
hello
i am having a problem
trying to export mysql data into a excel file
<?php
$db = mysqli_connect("locasdfost", "tvdfsdstar5_gocyw", "123sdf12sfd3123", "tvstar5_gdfocdfw");
if(isset($_POST['downloads'])) {
//create query to select as data from your table
$select = "SELECT * FROM cyw_netsignups";

//run mysql query and then count number of fields
$export = mysqli_query ( $db, $select )
       or die ( "Sql error : " . mysql_error( ) );
$fields = mysqli_num_fields ( $export );

//create csv header row, to contain table headers
//with database field names
for ( $i = 0; $i < $fields; $i++ ) {
that is my code
i get this error: Catchable fatal error: Object of class stdClass could not be converted to string
 
Kay
I checked again. The script runs for me only if I enter values for all 3 fields
How do I change it if say, I only want to enter values for 1 or 2 fields instead of all 3?
 
@TheBeast next time, please dump your code in a gist or pastebin
 
ok
my bad
sorry
 
np
@Kay you have to change the sql statement. something like if isset value append sql to query
 

« first day (2007 days earlier)      last day (2948 days later) »