« first day (2835 days earlier)      last day (2113 days later) » 

12:13 AM
Hello?
Anyone can help me in equalizing image in php codeigniter
 
@kelunik I am so, very, alway, dumb. Of course, I had made a Factory into which I relished injecting the injector, so everything is new'd everytime.
is it like, acceptable, sometimes, to pass in a DIC to a factory class?
 
 
3 hours later…
3:12 AM
Night
 
Wes
i miss teresko already
he would enjoy this
 
4:16 AM
posted on July 20, 2018

If you've been reading my news as of late, you know that I am in the process of emptying out file cabinets. These file cabinets contain my life. Everything from childhood drawings to business receipts. It also contains a few polished gems. Here’s an example of what 15 year old Jeff was writing for English class. It’s um… well, you’ll see… The Passionate Plumber Come live... [read more]

 
4:27 AM
I'm reading Working Effectively with Legacy Code and something introduced early on is adding tests to legacy code to prevent unwanted behavior changes. In my scenario at work, I'm refactoring the codebase to work on 7, so I'm dealing with a ton of errors. How do I write tests for code in this situation? Break the classes apart and test individually?
 
4:37 AM
@Wes context linksy?
 
4:52 AM
In the time I was in the bathroom, getting ready for bed, my cat moved from the end of the bed, into making her own nest in my blanket
My cat is a dork
 
that sounds very cat-sy
 
 
2 hours later…
7:28 AM
Non-ASCII text in bug reports misencoded – #76650
 
hello everyone
can someone help me with this stackoverflow.com/questions/51453732/…
 
8:00 AM
carte blanche unconditional authority; full discretionary power: She was given carte blanche to decorate her room as she wished, perhaps an unwise decision on the part of her parents.
 
morns
 
@Tiffany Why?!
 
hmmm, why is @tereško suspended?
 
8:16 AM
yes
 
The statement is that tereško is suspected because his account needs to cool down.
 
what you mean by "cool down"?
I hardly think he behaved as a spammer
 
I don't know what SO means exactly with cool down.
But I can imagine, if you're main activity is to think binary and logically, it might happen that you encounter humans that do not always behave in such way.
That can be a frustrating experience ...
@Tiffany why not run the legacy code in a legacy environment?
Just isolate the virtual environment from the outside world if security is your only concern...
 
8:43 AM
I read many of you use phpStorm. I've never used it before, but what's the main advantage over other (free) IDE's like Eclipse?
 
Thanks @Wes @kelunik :-) cheers
Also mornings
 
mornin'
 
9:07 AM
@FélixGagnon-Grenier yes.
 
@Jeeves It looks like a normal UTF-8 problem, I'm surprised that it happens on php.net.. perhaps they should start to use Mantis.
 
@Tiffany actually they're not and those are pissing me off.
 
@mega6382 I think the real question is, why did it take so long for him to be suspended?
 
well, I guess that's just as valid a question
 
9:23 AM
@NikiC people get used to some people being assholes. At one company I worked at, there was a guy who would always start shouting in meetings. At one meeting I'd had enough and starting shouting back at him. I got told off for my behaviour.....even though I was behaving less badly than him.
btw top-tip - if you let some people act like assholes in a company, it drives away all the non-assholes, and you get left with a company full of unpleasant people.
2
 
Mornings
 
anyone happen to know how to build phpunit into a phar file so I can test some changed behaviour easily in another project?
 
9:40 AM
yo @PeeHaa
 
9:51 AM
@Danack Why not install it via Composer?
 
@kelunik it should be easier to test locally rather than push to a repo, add that repo as vcs to the project it needs to be tested in....I would have thought.
 
morning room
 
@Danack Just Edit files in vendor if you quickly just want to test locally?
 
Happy birthday @Ekin !!!
 
@kelunik oh yeah.....(and yes, those nasty 4 letter words.....they burns us).
 
9:54 AM
I do that all the time (editing files in vendor)
 
 
1 hour later…
11:01 AM
Good morning.
@mega6382 I was told he used something akin to a racial slur of some kind to someone.
@Wes She's at 900 million currently. She's going to make it there. Why don't they just go buy her clothes and make-up instead of donating money. Must be nice.
 
11:26 AM
@kelunik I recently start doing this instead /cc @Danack
"repositories": [
  {
    "type": "vcs",
    "url": "file:///path/to/local/clone"
  }
],
"require": {
  "vendor/package": "dev-local-branch"
}
makes it much easier to turn your changes into a PR
depends on what you are doing, obv, but I have found it easier to work with when I can have 2 distinct PHP Storm projects
 
It turns out building the phar is just 'ant phar'.
So i used ant for old times sake.
 
I have never used a phar because I don't see the point of them, at least for libraries
 
12:04 PM
Looksy what I found here
My buddy
 
12:21 PM
question of the day
 
@PeeHaa whom did it marry?
 
how do you efficiently implement tail -f?
I have no idea how to even approach that
 
in php? with or without outside help, like filewatchers?
I guess streams might work. or you implement a tick function
but whether that's efficient. no idea.
 
@Danack Thank you so much. I figured out what I was trying to achieve. Thank you once again Danack and Mega. :)
 
@FlorianMargaine assuming you want it to be line-based, implementing -n (or indeed, default scroll-back), can only be done by opening an fd, seeking to the end, then reading backwards and counting lfs, then either outputting the buffer of what you read or reading forwards again if you didn't buffer it. After that though, you have an fd at eef and it's just a simple case of inotify(IN_MODIFY), surely?
 
12:33 PM
@DaveRandom yeah I mostly mean the "how do you poll for it"
inotify() can do a single file changes?
I guess so
that doesn't sound super efficient, though
let me check how tail does it
 
well your only other option is busy-wait
I can't see any other way
inotify is afaik the only way you can get the kernel to tell you when to do something
 
@Gordon dunno. Based on the first pages it's a heap porn novel
 
@DaveRandom Mostly I have dev branches which are anyway cloned as git repos by composer, so you can directly commit from the vendor directory.
 
@kelunik sure, I'm talking about stuff from other vendors, i.e. stuff where I don't already have a fork, and I just want to play around and may not end up needing a fork.
 
Non-ASCII text in bug reports misencoded – #76650
 
12:56 PM
tailf is based on inotify
 
1:17 PM
@FlorianMargaine at a basic level, you either have to poll or get something external (i.e. the kernel) to tell you about activity, I can't think of a third approach and I don't know of an alternative to inotify
 
@Code4R7 cause I can't, and I don't want to leave it in a legacy environment
how long does it take for hot tea to cooldown in the freezer?
 
2:06 PM
How do I sort an associative array, if I know the desired sort result? So the unsorted array is :
(
"something" => 5,
"other" => 99,
"adsfasdaf" => true
"asdfa" => "values don't really matter"
)
And I want the keys to be ordered like:
"other" => ...,
"adsfasdaf" => ...,
"something" => ...,
"asdfa" =>
I have an array of just the keys of how I want my desired array to be sorted
OK never mind, I'm stupid
 
Wes
2:54 PM
\o
 
anyone got a recommendation for a mat to use with a standing desk?
 
Wes
like for the mouse?
 
for my feet, as standing in one spot on a hard floor gets painful.
 
Wes
ah. i used double socks and running shoes
 
3:35 PM
@Danack do you have Amazon Prime?
 
3:50 PM
@Tiffany yes, and do almost all of my (non-food) shopping through it...
 
4:26 PM
@Tiffany instead of going through the code and tests, another approach might be to follow the upgrade guides of PHP. With most steps, a find/replace in all code files fixes a lot. If you know of a better strategy, please enlighten me.
About that freezer, there is only one answer: it depends.
@Danack Any programmer that is bound to a standing desk should ask their superiour to work outside in nature, including when it is raining.
And just tell them it is better for their (mental) health.
 
4:49 PM
If a service provider is not PCI-DSS compliant, and they say the following on their credit card form located on THEIR SITE: "Please note that for PCI and privacy/security reasons, credit card data is transmitted via this form directly to our third party payment processor, Stripe, and is not retained by...", but the HTML shows the form submitting to THEIR SITE, which then forwards it to the PCI compliant site. They are doing it wrong, right?
The card data should never touch the non-PCI compliant servers, no?
 
@crypticツ right. That probably needs a reporting.
 
The form itself should not be hosted on the non-PCI site either.
 
@crypticツ how can one prevent that the card data is not retained by other servers on the 'net while sending it?
 
@Code4R7 TLS?
 
so if the service provider has a site with TLS, that would be fine?
 
4:56 PM
The problem is you can't trust the credit card form to begin with, since it's hosted on the non-PCI site.
 
@Code4R7 the way stripe do it.
 
it's similar to how people incorrectly submit forms from HTTP to HTTPS.
 
I get your point. Better report it then.
 
It should be HTTPS to HTTPS, just the same as PCI to PCI
 
(I was just checking your question with your arguments :)
 
5:13 PM
@Code4R7 that's what I'm doing... plus using the Whoops library and ticking errors off as they come up, fixing one by one until the site loads.
My first goal is to get the site working on 7 at the bare minimum, refactoring as little as I can.
Once I've completed that, I'm going to start rewriting stuff properly. But I would also like to be able to test that I'm not breaking functionality
The book I'm reading, the author is extremely skilled with refactoring legacy code.
 
Hey
This pen shows a cool example of Horizontal scrolling shadows but on chrome (mac) it doesn't seem to work? Any one else get this bug?
Actually I swear it worked yesterday?
 
Hey i have some php code which works fine which is:
<?php foreach ($foo as $foo) {
}
?>
but i only want to run it for the first 4 items returned not every single $foo ; how can i adapt this?
 
thanks Danack I'm just reading that ; I also found mention of this array_slice ; e.g. "$output = array_slice($input, 0, 3); " ; and then passing $output in as the variable in the foreach loop instead; do you think that would work just as well?
 
try it.....if it does, then yes.
 
well, yes when i say work as well, i mean from a correct programming paradigm as well not just achieve the desired result :)
thanks very much for the reference to break i'll investigate it
break worked great thanks
 
6:02 PM
!!dad
 
Two satellites decided to get married The wedding wasn't much, but the reception was incredible
4
 
^ oh god ^
 
6:28 PM
Can't establish a connection to MySQL after upgrading PHP from 7.2.7 to 7.2.8 – #76651
 
6:56 PM
... why can't I buy Remembrance of the Daleks in the US ... such BS
I either have the option of bootlegging it or buying a DVD. I don't want either.
I wonder if I can buy a UK Amazon gift card
 
7:17 PM
Yay ..! thx God ..! The first paid-question just asked in my question.
I feel great :-)
 
7:30 PM
Evening
I want to post data to Newitems.php without displaying this page to end user <form action="Newitems.php" method="post" enctype="multipart/form-data">
@Tiffany
 
8:13 PM
@Webdev And why can't you?
 
@benlevywebdesign I did it
 
8:56 PM
I need a hashset in core to track which types need to be autoloaded - do we have any functions for doing this in core? Or shall I do the old keys-of-the-map-are-my-set trick?
/cc @bwoebi @NikiC
 
@LeviMorrison yes, use keys
there are empty_element variants that are for that
 
Ah, thank you very much.
 
Can I store images in mysql as .jpeg or png not .bin?
 
9:20 PM
Why are you trying to store images in a database?
 
Would storing images in the database be not that great of an idea and storing references to where they're stored on the filesystem be better?
 
I assume you're trying to store the actual image and not just the file path
 
@Tiffany yeah
the actual image
I have done the task but as .bin extension
 
9:40 PM
but why?
 
why not?
by storing just the file path, you add the risk of introducing inconsistencies between the state in database and state in filesystem
 
@benlevywebdesign This is popular advice. I do not agree.
Consider if you have to scale up beyond a single server; the file system mechanism is a poor idea.
This means you need a parallel filesystem and a parallel database, when only one (the latter) would suffice.
However, there are times the filesystem + db approach is fine.
 
@LeviMorrison yeah. Unfortunately, it seems that most applications (symfony, laravel, and most php frameworks-based apps) are not using the database at all to store files by default.
thankfully, NFS is a fairly mature technology.
@LeviMorrison "parallel" is an odd choice of word
 
9:55 PM
In HPC it's a common phrase shrug.
 
Wes
can you save large files in pdo without loading them in php? and how do you serve them directly bypassing php, from the database?
 
you probably don't want to bypass php, but to stream from database to php to client
 
Wes
i suppose that's what i meant yeah
 
> Example #1 Displaying an image from a database
 
Wes
i think i've tried to use that once
$lob is a reference
will look into that
in my head big files in databases are stored like regular files, except that you have improved functionality to search them, reference them, etc
 
10:07 PM
this sounds pretty inefficient to me. having to hit php and a db to do something that could have been done by the webserver is meh..
especially considering NFS as Florian mentioned
in the end of the day, with proper caching it doesn't really matter much
 
HELLO
 
Wes
hello
 
Anyone help me in image equalizing in codeigniter?
using imagick
 
Wes
@FélixGagnon-Grenier he was suspended
what's equalizing?
 
Wes
10:12 PM
ah
 
@mareena get the code working from the command line first, if you don't know how to get error reporting/logging to see those errors.
 
error logs are not opening
 
@mareena $image->equalizeImage($imagePath); you don't have any $image at that point
 
...use an IDE that shows those errors.
 
10:16 PM
5 messages moved to Trash
 
!!canon errors
 
481
Q: How to get useful error messages in PHP?

CandidasaI find programming in PHP quite frustrating. Quite often I will try and run the script and just get a blank screen back. No error message, just empty screen. The cause might have been a simple syntax error (wrong bracket, missing semicolon), or a failed function call, or something else entirely. ...

 
@pmmaga how to fix that ?
 
read the link above and start looking at your errors
 
My problem is my error logs are not opening why it is showing me access denied
 
10:30 PM
@pmmaga honestly, NFS, despite being a mature technology, is a horrible piece of shit
 
@mareena probably because of the way that apache is configured on your windows. you can try to open them by running notepad as admin and then opening the file from notepad.
 
NFS is also the reason why most event loops implementations have some issues
most notably, most of them are not running the open() in the thread pool, because they assume it always returns instantly
 
ohh.. interesting
 
if you do an open() on an NFS filesystem, it will totally block the whole event loop
 
TBH, at my current work we just serve all static content from a static.domain.tld subdomain and that works pretty well
 
10:34 PM
still it is giving same error
@pmmaga
 
@pmmaga what about private files?
 
@FlorianMargaine yeah, those go through php :P
 
problem solved logs generated
 
but IIRC all private files in our case are dynamically generated pdfs, so they aren't actually stored
 
There are a few cases where we resolve self at compile time. We also forbid using it as a type constraint if it's not a method and not a closure.
However, we don't treat parent similarly because we don't store the parent of the active class in a global/file-global at compile time.
This would actually be useful; for instance this doesn't have warning/notice or anything:
class A {
  function m(): parent { return $this; }
}
 
10:46 PM
@pmmaga I couldn't resolve the errors can you help?
or any one else?
 
@mareena I suggest rereading and doing the answers already given to you.
31 mins ago, by pmmaga
@mareena $image->equalizeImage($imagePath); you don't have any $image at that point
31 mins ago, by Danack
...use an IDE that shows those errors.
 
@LeviMorrison why is ce->parent not enough for that case?
 
Because it's not hooked up yet.
 
I know but how to pass the image I am giving the image path to the variable but I don't know why it is not taking it
 
@LeviMorrison so during the compilation of m() it still hasn't resolved parent and interfaces? I'd would have thought so, to check for compatible signatures and what not
 
10:52 PM
It can't, because the parent class might be in another file.
It must delay that to runtime.
 
ahh yeah
 
But we ought to be able to store that there is a parent, and its name.
This let's us reject the code I posted, among other things.
 
Wes
11:22 PM
i'm trying to reverse engineer this error but i am not sure how it could've happened twitter.com/blokatt/status/1020758554125320192
i thought it was floats but how?
 
@Wes two different systems? One counts the score for each of the options, and then the other counts all of the options and normalises the score for each of them to add up to 100........with some really bad maths.
 
"webscale maths"
 
Wes
lol
 
Don't we have a "globals" per-file now or something like that?
 
11:58 PM
posted on July 21, 2018

New Cyanide and Happiness Comic

 

« first day (2835 days earlier)      last day (2113 days later) »