« first day (1785 days earlier)      last day (3156 days later) » 

4:02 PM
can anyone help me in notorm
 
Abe
@LeviMorrison a jolly thingy for recursion. imagine $_POST, it's array<string|array<string|more recursion>>
List<String|@>
List<String|List<String|@>>
List<String|List<String|List<String|@>>>
so if you want to check an array that can contain either other arrays recursively or strings, you would typehint "List<String|@>"
where @ is the recursion of itself
 
4:20 PM
Ugggghhh why are opcache bugs always so hard to track down :(
 
@PeeHaa Originally it did but dmitry re-implemented everything.
I would assume he caught at least most of the issues.
 
Well I am fairly sure he didn't killed them all :(
 
Find a smaller reproduce case.
 
The annoying part is I don't know how to isolate this and as such how to properly file it
 
One thing: don't merge files.
That's one tip for dealing with opcache bugs.
When you put things into the same file it changes how opcache handles it
 
4:25 PM
Ugggh tnx
 
@PeeHaa Confirmed via echo or something?
 
@LeviMorrison By var_dumping the thing that is about to be returned
It's $this in this specific case if that means anything
    public function addRoute(string $verb, string $path, array $callback): Router
    {
        $this->routeCollector->addRoute($verb, $path, $callback);

        return $this;
    }
 
Abe
@AnmolRaghuvanshi actually i wasn't right about overloading. it can work with interpreted languages, as long they are strictly and statically typed
 
@PeeHaa why are you insulting Demeter?
 
because he does not believe in gods? :)
 
4:31 PM
@tereško ?
 
you have a procedure which only has parameter that it is passing on
 
Yes?
I'm not reaching into the routeCollector ?
 
Abe
grabs popcorn
 
I really love this wrapper because it makes my life easier
I am seriously failing to see what you mean @tereško?
 
I am actually confused, because it is not LoD
I am having a brainfart here
 
4:42 PM
Meh it happens :)
In lighter news I am drinking tequila right now, because I don't have other booze
#SadLife
 
the bottom line is that having a function arguments just in order to pass them to another function is a code smell
you should have worked with routeCollector directly
 
The (somewhat crap) reason for that is that I make public ::get() and ::post() convenience methods. If I work with it directly I have to change it in those methods too at some point.
 
it's not like your Router::addRoute() is doing anything useful
 
The actual problem here is not programming against my own interface
Which results in the above code
I.e. I basically coupled my thing with @NikiC's thing
 
.. I also have this pet peeve about "router is not a dispatcher", but I am too angry at CoffeeScript now to even start on it
CoffeeScript is a piece of crap
 
4:47 PM
My router class is little more than a collection of routes
And WTF are you working with coffeescript?
That is horrible
 
I am trying to understand Atom code
because I want to use Electron, and Atom seems to be the best example to pick
but it is written in coffeescript ... because github is run by bunch of rails fucktards
 
I thought typescript is the new rage
 
*pushes @PeeHaa to the side and hijacks topic* So from what I've read Interfaces are/can be used as a template for other classes to follow that implement it. So the methods in it must be declared in the implementing class. Is this correct? If so, is there a way to enforce that a constant or property also be declared?
 
@crypticツ yes, no
 
@crypticツ interfaces are contracts between two+ classes
essentially what this means is that for an interface it is more important "where it is used" instead of "what implements it"
 
4:52 PM
that
In simple terms the thing where you use an implementation of an interface you know what methods you can call, but how they are actually implemented is not important
 
when you see something(Submersible $foo), it means that inside the function something will be calling on $foo methods, which are defined in that specific interface
 
yeah, so if I have a lib that manipulates various file formats the interface would have read() write() etc, how those methods actually carry out the task in the implementing class is not relevant.
 
yes
 
k, thanks you guys!
 
anytime
 
4:56 PM
treating interfaces as "class templates" is actually a common mistake ... I blame educational materials
 
Anonymous
I think @crypticツ is on troll mode today :)
 
Abe
@crypticツ properties(get{}set{}) and fields(~variables) can be forced to be defined in other languages but not in php
 
.. what really grinds my gears is how enthusiastic the CoffeeScript users are ... they seem especially fixated on "you have to write fewer symbols" bit from some reason
 
In all honesty I haven't had a good look at it, but I had the feeling I've seen enough by glancing at coffeescript code. Really didn't like it at all
 
Abe
@PeeHaa 3v4l.org/s0vmE u seen this (wrong link)
 
5:00 PM
/me pokes head in
 
@Abe nope :)
@JoeWatkins o/
 
Anonymous
@tereško what name should an interface file end with? FooInterface, FooData, FooConcrete or Fooable ?
 
Abe
just Foo
but definitely not FooConcrete :P
 
a ZTS build gives you different results for srand()+rand() than a NTS one…
 
Anonymous
and class Foo{} @Abe ?
 
5:03 PM
why @bwoebi ?
 
Abe
when i can't give a sensible name to the class, i use
class FooDefault implements Foo{}
 
I see why, but why is it like that ?
 
@JoeWatkins because rand_r() … but I have no idea why…
 
Anonymous
@Abe FooDefault{} ? ewww :D
 
oh srand is not reentrant
 
5:04 PM
@Abe FooDefault makes me think it is some "base" class or something
I.e. abstract super class
 
Anonymous
^
 
Abe
or DefaultFoo
 
Anonymous
eww++
 
oh _r
 
Abe
idgaf
 
5:05 PM
@JoeWatkins yeah, but I expected it to be compatible nonetheless. (because rand_r)
 
banana
 
Anonymous
cherry
 
Abe
kiwis
 
melon
 
patch it to use rand_r
well actually ...
 
Abe
5:05 PM
peach
 
that will break everything ... probably have to live with it, right ?
 
How all events in the voting system of stackoverflow will return back to the first time if there is a error in the vote ? {when I click on the upvote arrow, it will be orange color and total vote will be increase, and if that post be from myself, all jquery events will return back (gray color and total vote decreases)}
there is any ajax code for returning all events like before ?
 
@JoeWatkins no, fix rand_r.
 
nothing wrong with rand_r
Im not sure why we are doing that, are you ?
I'll go further, that doesn't seem necessary or clever ...
do you execute that ? it's ifndef HAVE_RAND_R so might be for something really obscure ...
 
so, basically when it's not supported
rand_r() isn't part of the satndard lib
only POSIX
 
5:17 PM
oh yeah
I can't imagine a platform without it, but guess you have it so it's not that anyway ...
just use the reentrant one all the time seems like the best idea ? not sure you can change it now though ....
 
@samayo I use names that describe what functionality the implementation of interface signifies
 
@JoeWatkins yea…
 
5:47 PM
@LeviMorrison you think I can use this as a bug report test case?
And/or others ^
 
Anonymous
5:58 PM
@tereško but then that would take the name of a class. It's like using Logger and Logger for interface and class.
 
that's an "english problem" :)
 
Logger would be the interface, FileLogger would be the concrete implementation. And you could use AOP (or, basically, automatic decoration, sometimes via those awful annotations) to have the cross cutting concern used where you want it
 
"logger" is just a stupid name... same was as calling "door" an "opener"
 
@JoeWatkins Does this mean anything to you: php: tpp.c:62: __pthread_tpp_change_priority: Assertion new_prio == -1 || (new_prio >= __sched_fifo_min_prio && new_prio <= __sched_fifo_max_prio)' failed.`
 
bottom line: don't use class names that are derived from verbs
(rule of thumb)
 
Anonymous
6:03 PM
Or just don't use interfaces at all, to eliminate this confusion :P
 
You don't always have to interface everything
Only really the things you anticipate may change in the future, you want a contract for, or things you want to be easy to change, even if you don't anticipate a change
 
interfaces are nice for "boundaries" between packages
I have begun using a lot of quotes everywhere :(
 
Anonymous
@Jimbo Agreed! yeah, it's obviously suited for XP. But, I hate it when it gets overused. There are just some people that want to give every function its own interface and class :/
 
I think role interfaces everywhere is nice
 
@samayo some people are dumber than average .. about a half, to be exact
 
Anonymous
6:17 PM
more like 90% according to Sturgeon's law.
 
that's not a thing
and don't even try to making it into a thing
 
Morning guys :)
I have a general question today
Can I ask it ?
 
Anonymous
@ZahidSaeed go ahead away
 
Thanks
 
@ZahidSaeed I hope you realize that you asked a question to know whether you could ask a question .. but you already asked a question without getting the permissions to ask that question
 
6:21 PM
Actually I have contracted with a partner that we may sale our own POS and then divide it's share for 50 50
But the problem is my partner can market that POS and then sale it again and again without telling me that he is selling it behind the scenes
So the question is, is there any way so that I can get myself secured ?
I mean if he sale that POS to any other that whom I didn't knew about then I don't that POS to run !
 
please, unpack the "POS" acronym ... my brain keeps reading is as "piece of shit"
 
Just like an activation key !
@tereško No it's not piece of shit. It's "Point of sale"
Like I sale a POS then I give my client that activation key
He puts in the POS then it gets activated
I was thinking of using another database of another domain in which I could create a list of all valid sold POS
If the row is found then let it go
Else DROP Database Some Name
And even find all the files and folders and then unlink()
Can you guys help me out ? I'm really confused :/
But the problem is, if I use my method then whoever knows a little bit of coding can remove that piece of that and wola !
He simply hacks it :/
piece of that code *
I'm done
Now tell me any solutions please :)
 
Get a lawyer and let him/her right a EULA
 
@PeeHaa I don't want to get in any kind of lawyers.
I just want to do it with some coding
 
Not all problems can or should be solved with coding
 
6:30 PM
I understand
But is there any other solution ?
 
s/wola/voila
 
@ZahidSaeed SaaS
 
@PeeHaa What's SaaS ?
 
I assume you know how to use a search engine
 
Anonymous
what is search engine?
 
6:36 PM
what is what is?
 
ugggh heisenbug
 
Anonymous
what are these black little structures I'm creating with my keyboard?
 
hi everybody
 
Anonymous
> In computer programming jargon, a heisenbug is a software bug that seems to disappear or alter its behavior when one attempts to study it.
 
Anonymous
wth??
 
6:39 PM
 
I want pass a array to store procedure in php .how do it?
 
@samayo most opcache bugs ever.
 
> You can examine an account's public profile to see if there's recent activity and request that support release a name for you, but keep in mind that not all activity on GitHub is publicly visible.
Hmm interesting
 
@zohreh Store procedure ?
 
Anonymous
@bwoebi hmm? Don't have any experience with PHP bugs, but that definition makes it sound like it's not a bug, but some sort of a virus.
 
6:44 PM
What do you mean ?
 
procedures of mysql
@ZahidSaeed
 
@zohreh Did you mean you want to save the data in mysql ?
 
Hi.
Does anyone of you know Android development?
 
yes i want save some id in mysql and i want pass that ides as a array to procedure @ZahidSaeed
 
@zohreh Then you have to run 2 queries. One for inserting data and one for selecting all the id's from the table (which of course you have to retrieve them one by one and then pass each ID in an array)
 
Anonymous
6:50 PM
Hard to wrap my head around the 'fact' that a computer actually gets slower with age :/
 
@samayo "Just buy a Mac"™.
It doesn't appear to happen to them.....almost as if Apple don't make it easy for bloatware to be installed.....unlike Windows PC where, yes, reinstalling the OS every 6 months is a good thing to do.
 
@samayo it's dust in cooling and OS deterioration
and, while OSX is a bit more stable, you still have to reinstall it every 1.5-2 years
 
there is an android room, @HassanAlthaf
 
@tereško Locked room.. they haven't accepted me in YEARS.
 
7:01 PM
I got accepted in about 2 minutes (base on my profile comment)
 
Because you are a 37k, I am not even a 0.2k. :P
 
you probably need to earn more rep
 
Anonymous
@Danack Yeah, I just read about that. It seems Mac is superior in the way it handles bloatwares that clog process better than Windows.
 
Anonymous
But, my question was more like, why when I format my PC now, it'll be slower than the first time I bought it with similar config and apps running. But, this was due to the fact, programs today require more computing power to run than they did 5 years ago.
 
my windows computer doesn't get slower with age :P
but I also take care of it and don't install crap
(my copy of windows didn't come from a manufacturer)
 
7:06 PM
Windows software does tend to leave behind a lot of crap upon uninstall though
 
the solution is rather zen:
don't install stuff in the first place
but I do prefer Linux Mint to Windows
 
Anonymous
I used to format it like once every 2 months (best anti virus ever), before I began the whole dev thing. Good times :/. Now, to format it, I need a whole lot of time reinstall everything.
 
Anonymous
and an ext hard disk
 
the best antivirus is an exploit mitigation (e.g. EMET) + keeping your software up to date
also, browser extensions such as NoScript and RequestPolicy
 
@samayo problem is that latest Macbooks are basically glorified tablets (based on internals)
you would be better off getting a normal ultrabook and installing linux on it
 
7:10 PM
I almost got a job at a mac shop last week :(
 
congratulations
 
but then they said "we actually can only offer you $20k/year less than advertised, and surprise it's no longer remote you'd have to move to Miami"
 
Anonymous
@tereško Nope, I'm not into Macbooks despite what I just read. I don't think any amount of feature can sway me to buy an overpriced ... anything.
 
@ScottArciszewski it's not a bar and they definely are not geniuses.
 
I dodged a real bullet there
I'll never even visit Miami again
me and my best friend (who drove, since I'm half blind) almost got killed by the terrible drivers
 
Anonymous
7:14 PM
I think in 2 weeks, I will backup everything and try to format and clean my current laptop. It'll def get me some speed, and enough wool to make a new blanket maybe.
 
you could install a temperature monitoring tool
last time before cleaning, my laptop was hotting 70°C just by watching youtube
.. after cleanup: 35°C for everything but games
the main issues with all laptops is that when they heat up, the CPUs get throttled
 
@ScottArciszewski I believe (though it may have changed) even with being careful, that some Windows system file can fragmented just through use and are really hard to defragment. i.e. the standard disk defrag didn't resolve the fragmentation on the last version of Windows I used.
 
Anonymous
@tereško really? There is a temp monitoring tool? My laptop does not heat that much, but the fan makes a lot of sound and yet very little air comes out. I think there is too much dust in there.
 
> My laptop does not heat that much, but the fan makes a lot of sound
Contradicting much?
 
ok well
the fragmentation issue is a windows thing
because it tries to cram as much stuff in as little space as possible
that's NTFS being dumb
 
Anonymous
7:18 PM
well, it's a big laptop so it's never in my laps. But, I checked again and still not that much heat. Actually, less than my galaxy note 3. @PeeHaa
 
@samayo HWMonitor is a reasonable option
 
yes
it's one of tools people tend to use when checking behaviour for overclocking
 
Anonymous
@tereško fast install :)
 
Anonymous
but too much info.
 
Anonymous
7:23 PM
 
Anonymous
Don't know which is which.
 
you CPU temps are ~50°C
 
Anonymous
I assume that's fine.
 
that is 10-20°C more than expected (the ambient room temperature makes difference)
and based on your CPU load, you basically doing nothing
 
> Fatal error: Uncaught TypeError: Return value of CodeCollab\Router\Router::addRoute() must be an instance of FastRoute\RouteCollector, instance of CodeCollab\Router\Router returned in
jesus the bug has returned...
 
Anonymous
7:28 PM
Room is cold, plus it's on a ~cold marble table. @tereško but probably too much for a one browser and sublime text. Also, considering the windows glossy gui is removed.
 
Anonymous
I'll match these results when I clean it up again.
 
The temperature totally depends on what cpu it is.....and 50C is nothing.....kids today...
 
@Danack laptop
 
schmaptop
 
@samayo when you clean it, you will need to also change the thermal compound too. And since it's HP laptop you will also need to disassemble the fan (it has a design flaw which causes dust to accumulate in corner of it) so you will need a complete if tiny screwdrivers
 
Anonymous
7:36 PM
yeah. I'll get a chance to learn a bit about the components at the same time too.
 
Anonymous
\o/
 
Hmm.....you should only do that if you know it actually really needs it. If it's just a bit of dust, just use a vacuum on it. As just a bit of dust isn't worth risking your laptop for...
i.e. you should look up what the operating temperature is for that CPU and see if it's temp is outside the normal range.
 
@Danack never use vacuum cleaner on electronics
 
@tereško Even with a hose? Why not?
 
you can fuck up the circuits, because the airflow induces static charge
 
7:39 PM
dont ESD the CPU/GPU
 
"because the airflow induces static charge" - that's crap. There might be static charge on the air coming out of the vacuum - but there is not possible way for there to be charge induced on the sucking air.
 
CPU and GPU can work upto +75
until unless youa re overclocking
 
charge lies on your finger, charges are much harder to trace on non conductors
 
Anonymous
@tereško how is airflow related to electrical charge?
 
7:40 PM
ya know what, trust @Danack ... I will just shut up here
 
Anonymous
I don't trust anybody, but I am curious to know.
 
Anonymous
It seems like two completely unrelated fields of physics.
 
The only thing relating to air to avoid with computer components is to avoid using compressed air to blow dust off. That can cause the dust to be forced into places where it normally can't reach.
 
Anonymous
eh, yet another reason to feel bad for quitting in highschool. :/
 
7:49 PM
(no physics though)
 
hey everybody
 
Anonymous
@tereško wow, thanks. I was actually asking for something similar online a month ago as I'll take a highshool exam maybe next year, so this is cool.
 
Anonymous
I was looking for a torrent audio to listen to, on the get go, but could not find much except for one chemistry book.
 
Anybody here ever use Amazon AWS? Was wondering if I could get hit with a big bill for a test stack
 
@taco yes, annoyingly they still don't have cost limits. They tend to waive the first 'oops' one though.....just never ever put your AWS credential inside a directory controlled by git or whatever VCS you use.
 
7:59 PM
ok, hmm
so I'm ok if I spin it down, but I can f myself if I leave it online (which I will probably do)
@Danack yeah I read if you leave your AWS keys in a VCS that Bitcoin miners crawl repos looking for them and abuse your account for bitcoin mining
 
8:39 PM
Guys in a shopping cart website, if a user clicks on the "Add to cart" button then does that item is saved in the browser cookie or do I need an ajax and then store item info in database ?
OR is there any other way to do it ?
 
@ZahidSaeed are you trying to build some sort of e-commerce software? because "shopping cart" is not some "Add to cart" button. Later on your client will want to ship the products to the moon, use PayPal, debit payment, 3 more payment gateways, tons of reports and gazllion other features
and if you are not familiar with all this stuff you are better off to use one of the already existing e-commerce platforms
 
9:03 PM
> if you are not familiar with all this stuff you will already know you are better off to use one of the already existing e-commerce platfo
Fixxored.
 
:)
 
Anonymous
9:27 PM
I don't know if I have made my mind believe C is a hard-ass language, or it really is a hard-ass to learn. I can't seem to get it.
 
Good evening Ladies and Gentleman - read an article here stackoverflow.com/questions/1257371/… . Answer states that if a method relies on an object instance's state it should be an instance methods. If a method is general for all or no instances of a class, and does not rely on the object state, it should be a static method. Do you agree?
 
wat?
 
@tereško just quoting and asking for opinion
 
Anonymous
@sitilge can you simplify your question?
 
only methods that should be static are "alternative constructors" (it's a different question whether alternative constructors should even be used)
everything else should be non-static
 
Anonymous
9:34 PM
@tereško do you mean to say global calls by "alternative constructors?"
 
no, I mean cases, when a class has a legitimate reason for having more than one constructor
I personally don't like them, but I have seen some people here using that approach (with good enough reasons)
@sitilge if you are a beginner, the simple answer is: "never use static anything"
 
@tereško well, just an example here - could it be considered good practice to call method that sets static variable that is later used by the same class' static method? Something like gist.github.com/anonymous/7967178094314b357f61
 
@sitilge that is really really bad code.
 
so avoid that?
 
it uses class to act as a namespace for globally scoped functions
 
Anonymous
9:39 PM
You didn't need static methods for that @sitilge
 
So is it bad to use it like Autoloader::path('somepath') ?
Yes, I could avoid that
 
yes, it is bad
 
just the feeling for instantiating a new object for that
 
that class depends on global variables and namespaced functions ... it is completely unrelated to OOP
 
and not using it afterwards
 
9:42 PM
you can always have $atuoloader->register();
 
@tereško yes :)
 
where
public function register()
{
    spl_autoload_register([$this, 'load']);
}
 
Anonymous
public static function loadSingle($file, $extract = null) {
    if ($extract) {
        extract($extract);
    }

    if (is_readable($file)) {
        return require static::$files[] = $file;
    }
}
 
Anonymous
Does not make sense.
 
bottom line is this, @sitilge, whenever you see a static variable: it is basically a glorified global
@samayo it's an autoloader and templating engine wrapped in one abusable package
I suspect that rest of the code is purely procedural (include-oriented programming)
 
9:45 PM
Hey guys, I want to exec some arbitrary php, and I would like to check if any notices or errors occurred, would the best bet be to just parse the output?
 
oi
 
Anonymous
Oops. Autoloader and templating .. quite a breed you got there @sitilge
 
@AydinHassan what's your level of experience with PHP?
 
@tereško @samayo could avoid that
 
I dunno man, I've worked with it for a couple of years
 
9:46 PM
@AydinHassan depents. PHP has built in lint tool: php -l <filename>
 
lint tool doesn't show anything on errors or notices, I checked that
 
Anonymous
@sitilge if you have to use extract($extract); for templating, at-least make sure to use it properly. i.e. extract($extract, EXTR_SKIP);
 
21
Q: How to catch this error: "Notice: Undefined offset: 0"

meotimdihiaI want catch this error: <?php $a[1] = 'jfksjfks'; try { $b = $a[0]; } catch (Exception $e) { echo "jsdlkjflsjfkjl"; } ?> Edit: in fact, i met this error on line: $parse = $xml->children[0]->children[0]->toArray();

@AydinHassan ^
 
I don't think those are actually used for templating
 
haha
 
9:47 PM
hoho
 
@tereško those are
 
no good because I can't modify the code
 
@tereško just loading views with that one
 
@sitilge autoloader should load classes and each class should be in a separate file .. and the class should be only thing that the file contains
 
@AydinHassan I don't like hacks, so not my area
 
9:49 PM
@tereško but they are in seperate files, hmm.
 
Anybody know of a super light PHP docker container?
 
what are "they"?
 
Anonymous
the classes
 
assumptions ..
 
it's not really a hack. I'm building a PHP port of github.com/workshopper/learnyounode. User gets given a task, they write a script. A run the program with the script filename they wrote. Program verifies. I just wanted to provide better feedback
 
9:50 PM
@samayo said that first
 
My current Docker container that I use is kind of thick. Like 200mb I think. Looking for a lighter PHP setup so I can spin up tons of them.
 
then what is the point of extract($extract);?
 
Speaking of which, I started a Docker room, if anybody wants to idle there when they drop by. I'm an advanced noob, but I try to answer questions when I can.
 
Anonymous
$foo = '';
function foo(){
    ..
}
class foo{
    ...
}
 
@AydinHassan If you have to use exec() or something like that, I consider it a dirty hack
 
9:53 PM
it's bad any way you look at it
 
Well that's a bit of a blanket statement. There are use-cases
 
i know
 
Anonymous
@sitilge Conclusion; use a simple/psr-0 Autoloader.
 
@AydinHassan surprise be. What would be the case when having @samayo's posted code would not be bad?
 
Anonymous
@tereško go to sleep.
 
9:56 PM
is he talking to tiny people?
 
Anonymous
It seems like it.
 

« first day (1785 days earlier)      last day (3156 days later) »