« first day (2955 days earlier)      last day (1976 days later) » 

1:05 AM
@tereško that's pretty funny, seven minutes in and Cartman gets himself stuck
 
in one of the older episodes he managed to kill 4+ dupes that way at once
 
lol!
 
(you can hear the facepalm)
 
PHP 5.6 Can't Compile Source - Failure [tsrm] – #77171
 
1:36 AM
lol
 
Wes
2:27 AM
> Uncaught TypeError: Argument 1 passed to iterator_to_array() must implement interface Traversable, array given
all occurrences of traversable should be replaced with iterable
 
 
2 hours later…
4:14 AM
      for (i = first; i < last; ++i) {
        /* todo: backup previous set of types that need verified */

        /* todo: actually handle these differently */
        zend_compile_top_stmt(list->child[i]);

        /* todo: restore previous set */

      }
Always feels bad to come back to code you wrote the previous day to find more todos than actual work done.
... it's also missing a todo lol
 
4:44 AM
convert error on receiving variables from external sources – #77172
 
Wes
@NikiC @bwoebi how feasible it is to have all traversable's actually implementing one of iterator or iteratoraggregate? they don't have to actually use the methods all the time, like foreach($traversable as $a => $b){} can continue to work like it does currently, with no actual method calls
 
CC me on that reply, please.
 
Wes
ok
i @LeviMorrison 3v4l.org/Xfhmj everybody has this, right?
except it doesn't work for all iterables
 
5:05 AM
No; I do this:
 
Wes
also, i would really know why getIterator() is allowed to return iteratoraggregates
 
function to_iterator(iterable $input): \Iterator {
  if (\is_array($input)) {
    return new \ArrayIterator($input);
  } else if ($input instanceof \Iterator) {
    return $input;
  } else {
    return new \IteratorIterator($input);
  }
}
 
Wes
ah yes
it's that i have ->getIterator() on arrays (with nikic's scalar_objects :P)
does iteratoriterator work with traversables that implement neither iterator nor iteratoraggregate?
 
@Wes To allow for the C traversable-but-not-an-iterator-nor-iteratoraggregate it has to allow \Traversable.
 
Wes
what a mess
 
5:09 AM
@Wes Yes, at least the ones I've checked.
The only one I can remember off the top of my head is PDOStatement.
 
Wes
ah so it's not guaranteed to work even. bleah
 
@Wes What do you mean?
 
Wes
i thought standalone-traversable's had some internal api that looks like iterator, only not exposed to userland
 
Wes
so why do you fear it may not work?
regardless of iteratoriterator though it would really be a good thing to have only iterators and iteratoraggregates
 
5:28 AM
@Wes Because the coding is unverifiable.
Go look at it -- the way iterators are implemented is nasty...
(I mean, the ones core provides)
 
Wes
gah
 
 
1 hour later…
6:31 AM
morning
 
Wes
6:47 AM
\o
@DaveRandom think you can solve this with generics? i have

interface FrozenTuple1<out T1>, then i got
interface FrozenTuple2<out T1, out T2> : FrozenTuple1<T1>
interface FrozenTuple3<out T1, out T2, out T3> : FrozenTuple2<T1, T2>
interface FrozenTuple4<out T1, out T2, out T3, out T4> : FrozenTuple3<T1, T2, T2> etc

class Table<Tuple> where Tuple : FrozenTuple1< ? >
{
    function __construct(
        Tuple<String> $titles
        Iterable<Tuple<Object>> $rows
    ){
        // essentially i want to enforce $titles to be the same width of $rows
also cc @LeviMorrison
i am fairly sure that's not possible in c# but yeah, it's not my language so maybe i am wrong
maybe java?
 
 
1 hour later…
8:00 AM
shunpike a side road taken instead of a turnpike or expressway to avoid tolls or to travel at a leisurely pace.
 
 
1 hour later…
9:17 AM
@Wes Hmm, it's possible with TypeScript's tuple types... I don't think it's possible to do in C# or Java tho
 
9:30 AM
@Wes Not terribly hard I would say
Basically a matter of creating an InternalIterator class, which wraps the get_iterator API into an actual class
 
Wes
why isn't it like that already then :B
 
@Wes nobody done it :P
 
Wes
:B cc @LeviMorrison volunteered i think :B:B
@MadaraUchiha how would that work?
 
10:02 AM
Damn message length limitations
@Wes ^
Something like that
Although with idiomatic TypeScript, I wouldn't use tuple types here.
 
Wes
[key in keyof T]: string what's this?
 
key is a "variable" (not exactly, because this is all at the type level)
This basically means "an object where each key in T has the value of type string"
And since T is an array type (thanks to the constraint), the result of the type mapping will also be an array.
Try type Whatever = ToString<[number, boolean, string]> in that playground, and put your mouse over Whatever.
 
Wes
it's such an odd syntax gosh
 
Meh. Syntax is just syntax.
What matters is what you're capable of expressing with it.
 
Wes
yes except i don't get it :B
 
10:11 AM
Remember that in JS, an array is essentially a "special" object
{
  "0": "foo",
  "1": "bar",
  "2": "baz",
  "length": 3,
}
More or less (not exactly, but close enough)
 
Wes
what is keyof ?
 
TypeScript's typesystem is modeled after JavaScript.
In JavaScript, it's very common to use an object literal as a data structure (even moreso than PHP's associative array)
So you have tools to work with those.
const x = { foo: 'whatever', bar: 42 }; // TypeScript infers this as {foo: string, bar: number}

type TypeOfX = typeof x; // {foo: string, bar: number}; distinction between values and types
type KeyOfX = keyof TypeOfX; 'foo' | 'bar'
i.e. it returns a string literal union of all of the keys on an object
 
Wes
i see
 
TBH, with TypeScript, I would pass an object as the generic
i.e.
new Table<{the_number: number, the_boolean: boolean, the_string: string}>(...)
This allows me to use keyof to also enforce the right column names
And possibly even the order of them, if I manage to think of something, it sounds to me like it should be possible.
 
Wes
a class you mean
 
10:23 AM
@Wes No, I pass an object type
TypeScript has a complete conceptual separation between types and runtime "things" like classes and objects.
{the_number: number, the_boolean: boolean, the_string: string} is a type, not an actual object.
Think of types like free floating interfaces, that also include properties, not just methods.
 
Wes
@MadaraUchiha is what i meant
 
PHP has no concept of free floating types (much like Java), you have classes, which are types, and interfaces which are types, and scalars, which are types, but all of those are tightly coupled to their runtime counterparts.
This doesn't allow my ToString<T> type manipulation, for mapping one type into another.
Or the keyof operation for that matter, since there are no free floating types.
 
Wes
10:47 AM
i've seen the owner of the bar where i buy snacks climb up a ladder to turn on a tv so many times over the years. yesterday i finally realized that and i asked why it was necessary to climb up a ladder to turn on a tv. basically if the hdmi monitor is plugged in, the computer won't boot, so the guy every day 4 times a day climbed up that ladder to disconnect the hdmi cable, turn on the pc, reconnect the hdmi cable
i was like pffff, i can fix that easy
but obviously i failed
maybe a newer bios would fix it, i didn't try that
technology sux
imagine the life of the guy, climbing up ladders for years
also he is past his 60s
 
@Wes The answer to that, is get a new computer.
 
Wes
or a new gpu
 
11:17 AM
Morgnisnm
 
11:30 AM
Hello everybody
Somebody to chat about codeigniter
?
form_radio issue to save selected element, always take first
 
can anyone help me over on sql chat?
 
 
2 hours later…
1:10 PM
Hardcore git users, I need your help.
About a year ago, we split a portion of our huge repo into a repo of its own
I've noticed recently that it seems like our history is screwed up a bit, specifically, the paths.
I'm seeing that beyond a certain point, diffs that should have been listed on /website/client/components/ is listed under /client/components
The current working directory is in good order, as after that point, Git managed to get over the hiccup and put everything in the right path
However, our history (file history, blame, etc) is suffering.
Anyone has any ideas on how we could go about fixing it?
 
@Tiffany No not just user input. Any non static data
Also @Tiffany what OP did was using data from the request and insert it into the query
 
2:25 PM
@tereško :-)
btw @tereško, We've used Elastic search as our website's search engine .. it's awesome. It reads your mind and shows the most related post as the first result as fast as possible
the issue is, we cannot install it on the server .. you know, our server has 1GB ram, it will be filled while installing it
any idea?
 
2:51 PM
well, you could start by mailing your hosting provider and asking what it would take to upgrade your server to 2GB or 4GB
 
 
2 hours later…
4:53 PM
mm tea
 
5:17 PM
@tereško I think I'm starting to get the hang of it after watching halfway into this video. I think I'll try this afternoon.
 
(y)
 

« first day (2955 days earlier)      last day (1976 days later) »