« first day (1996 days earlier)      last day (2952 days later) » 

2:00 PM
@littlepootis I don't think it will be pretty children when a droid and an elephpant go out for a date
 
yo @AnmolRaghuvanshiVersion1.0
 
o/
 
o/ how'z sunday??
 
2:13 PM
Relaxed
How about you
 
sleeping all the day ;p just woke up
 
You woke up at 8pm?
 
relevant pakalu
taking a nap is always so risky like when will I wake up? in thirty minutes? in 2 hours? in 7 years?? no one can be sure
 
Hey, I get a gallery:1 Not allowed to load local resource: file:///C:/Users/............/public/assets/img/1434652169_tmp_golgo13.jpg is this an issue with php.ini?
 
2:23 PM
@Spiderix seems permission issue
uploading an image?
 
yes, uploading an image echo ' <img src="'. IMAGE_DIR . "/" .$row['filepath'].' " alt="'.$row['title'].'" width="300" height="300">';
 
It doesn't.. work that way
 
ah
and image dir simply points to /public/assets/img/
how does it work @littlepootis
the image folder is in the server folder
 
@Spiderix apparently, it doesn't. Show you code.
 
hence why I tried using the IMAGE_DIR global constant
Ok, this is my gallery.php file pastebin.com/Gsk5SZXb
It displays Title and Delete image buttons just fine and gives the error Not allowed to load local resource: file:///C:/Users/...................../public/assets/img/1434652169_tmp_golgo13.‌​jpg error
 
2:33 PM
I need the full source. Not just the gallery.php
VIEW_DIR, IMAGE_DIR are not defined here
 
define('VIEW_DIR', realpath(DIR . '/../views'));
define('IMAGE_DIR', realpath(DIR . '/../public/assets/img'));
it seems to point to the right directory, just goes faulty on the permission
 
You are not allowed to load local files from your web server.
It doesn't work.
Do you see the file:///? It means, the browser is trying to access a local file while on http://
 
ohhh
but the server is on localhost, it is ment to only run on localhost
 
@Spiderix stop confusing templates with views
 
@Spiderix it's no different from a normal server
In fact, you're running a server accessible by everyone.
 
2:40 PM
/me is making mushroom sauce with mashed potatoes (well potatoes + broccoli + garlic)
 
Ok, so how would one go around showing images on a page?
I mean I could upload the imagest to the database as a blob perhapse?
 
no, just store it somewhere on the server
 
hmm the way I understand it, the image is on the server
 
posted on April 03, 2016 by PeeHaa

# New commands - Added `!!xkcd` command - Added `!!tweet` command - Added `!!lick` command # New features - Non privileged users are now allowed to list the admins using `!!admin list` - `!!docs` now had the ability to find foreach and th...

 
because in cmd I navigated to the root of my project and said php -S localhost:8000 -t public server.php
 
2:42 PM
@Spiderix Of course, it is. But you're accessing it through the file:/// protocol.
 
sec, I will link my github project
 
There's something wrong with your constants.
 
I'll take a look at it after my dinner
Oh, IIT
 
yea, assignment so no direct solutions
I will see if I can figure out how to change it to use http protocol
and not file:
 
2:45 PM
Hello guys, How to define which ajax has been completed for example to check about if any ajax has completed I use this ' $(document).ajaxComplete(function() {}); ' but how to check for specific ajax like ajax associated with function
 
@Spiderix your code is vulnerable to CSRF and XSS attacks
 
Also, your college is the reason I'm going to have to go through this misery.
So yeah, fuck it :P
 
haha, not the colleges fault, I have been slacking
 
No, I'm talking about JEE
 
Ah
Ok thanks @PeeHaa if I get the time tomorrow I will see if I can restrict as much as possible
 
2:48 PM
Start by wrapping all output that has been in contact with a user in any form in htmlspecialchars()
 
!!packagist hakre *
 
@hakre Usage: !!packagist vendor package
[ hakre/xmlreaderiterator ] Iterators for PHP XMLReader for ease of parsing
 
nice.
 
3:02 PM
wut, there's a bot here now? <_<
 
!!packagist ocramius *
 
[ ocramius/instantiator ] A small, lightweight utility to instantiate objects in PHP without invoking their constructors
 
there seems to be some preference on packages that end with "tor".
 
!!package * *
 
I doubt that that is the only package there :P
got a few out
 
3:25 PM
Hey all I defined a global variable for my assets/img folder on the server

is this the correct approach: define('IMAGE_DIR', realpath(__DIR__ . '/../public/assets/img')); something tells me realpath takes the fullpath
because right now I am getting the following errors Not allowed to load local resource: file:///C:/Users/................../public/assets/img/p1.png and it is using file:/// but I want it to use http
 
@Ocramius looks like it's the first returned by a search (not in listing).
@Spiderix file:// -> directory but http:// -> URL path. That are two related but different things. inside a webapp you normally have a mapping between path on disk and URL - but you need to map, you can't just use file paths within your website. See the error you get then.
 
hmm
 
!!lick @PeeHaa
!!lick *
 
3:43 PM
Where's the source code for this bot?
 
githut
 
!!version
 
@littlepootis ^ there
 
Found it
 
3:54 PM
Yay, manage to finish my assignment and with a whole day left, don't think I ever finished an assignment a day before the deadline
 
@Spiderix That should make you think.
 
ikr, I am starting with the 2nd assingment right now. Never am I going to underestimate an assignment lol
I mean I remember doing the HTML/CSS part and I was like "THis is easy" and figured "I got enough time" I think I started pushing the assignment like 2 weeks before deadline and pushed it all the way up to a few days before deadline
Gotta stop procrastinating :/
 
@Spiderix Or fix the issues in your code instead
 
yea, I am using rest of today and tomorrow on that
cleaning up, securing it some more
I mean, even though this is my first ever webpage I have written, it shouldn't be alright to let it have holes like a swiss cheese
 
true that
 
4:02 PM
I saw this one webpage that teaches you how to secure webpages against different types of attacks but forgot the link, sec.
 
owasp?
 
All Devs should be aware of OWASP
 
Mogguh
 
mon-ringgg Jimbo
 
bon giorno
 
4:15 PM
hi
in order to by pass upload_max_filesize
in php.ini ... im thinking of uploading files via ftp using php
ftp_put
 
yomin
 
can this show progress bar
i mean can i use this thing and show progress to the user in the browser
 
hmm, I wonder why Magento removed this line of code from 2.0.3: $result = @eval($evalString); - what could possibly go wrong?
 
ha ...
 
lol
 
4:19 PM
any one??
@PeeHaa
 
I already gave you the answer yesterday but you won't listen
 
don't ping randomers @techno
@PeeHaa out of interest, what was your answer ?
 
how do i retain leading zeros in excel...? does anybody know abt it?
 
@JoeWatkins Stop using a crappy shared host and get a vps
 
ex: 0234 will becm 234 while pasting it in eccel
 
4:20 PM
@JoeWatkins i know him .. i suppose
@PeeHaa yeah.. but this thing possible
 
Aaaand ignored
 
@techno I don't care ... we don't post questions and then ping everyone, even if we "know them" ...
 
@JoeWatkins well i dont care about what you say
:)
 
eg : echo "0234" > a.xls
i knw we can change tht column as text and paste it.. but im redirecting numbers to excel..
 
4:22 PM
Fix the cell format @sunilk
 
@techno don't ping randomers ...
 
as soon as the excel is created, it will be automatically mailed.. so i cant open it...
 
!!admin list
 
@AwalGarg I'm sorry Dave, I'm afraid I can't do that
 
4:26 PM
!!admin list
 
Joe Watkins, Ronni Skansing, tereško, Félix Gagnon-Grenier, kelunik, bwoebi, Florian Margaine, DaveRandom, Danack, Levi Morrison, NikiC, Gordon
 
oops forgot to pull
 
!!admin fist
 
lol
 
You have some technical fault it seems. How am I not in that list?
 
4:27 PM
Lo!
 
!!jeeves pull yourself
 
@AwalGarg :P
Can you try the command again @AwalGarg/
 
!!admin list
 
@AwalGarg only humans
 
Joe Watkins, Ronni Skansing, Félix Gagnon-Grenier, bwoebi, kelunik, tereško, DaveRandom, Florian Margaine, Danack, Levi Morrison, NikiC, Gordon
 
4:28 PM
\o/
 
@littlepootis then how is @FlorianMargaine in it?
 
kick me again :)
buhahahaha
 
@PeeHaa nice though :) sauce?
 
!!version
 
4:30 PM
v1.1.0
 
lol wut
#fail
 
looks like continuous deployment is stuttering
 
@littlepootis ^ it has a systemd service >_>
 
@PeeHaa: Maybe you forgot to push a tag?
 
@hakre Nope. Think it's a bug
It should target commits, but the last thing I did was a tag so i think that's the issue
 
4:32 PM
v1.1.0 is latest tag on github however.... .
 
yea
I blame @SebastianBergmann and @kelunik
 
And that is only the top 2 of the blames I guess ^ ^
 
:P
 
@AwalGarg wow
 
Microsoft is porting systemd to windows.
 
@JoeWatkins hmmpf indeed. There appears to be at least a slight bit of communication problems going on. @Sara are you around, and have a moment to talk about how best to communicate?
 
did I say something wrong @Danack ?
 
@kelunik We don't use that anymore do we?
We use that git thing right?
 
@JoeWatkins no - I was agreeing with your hmmpf.
 
@PeeHaa Fallback if no Git information is available. And my bad. github.com/Room-11/Jeeves/blob/master/src/Chat/Plugin/…
 
4:36 PM
I thought you were, I was just asking if I did something wrong to deserve that kind of response ...
 
I believe Sara knows that person through another communication channel - which might be a better one to talk about the issues over, rather than internals list.
 
@PeeHaa very nice. was longing to see some nice PHP7-style codebase like that. looks pretty good!
 
@kelunik :D
@AwalGarg It's mostly made possible thanks to the awesome amphp guys. They are doing a wonderful job
 
And might know the person, er, personally - so could help say stuff in a way that doesn't appear to be a combative way. Basically I think email is shit - and it could be better to sort it out via a different comms channel.
 
Email is shit. Mailing lists are worse
@JonClements sorry to ping you, but can you see mod deleted chat messages by any chance?
 
4:44 PM
less text, more kitten pictures
 
I agree
 
\o/
/ \
 
CUTE!
 
4:50 PM
 
When's the BBQ invite coming?
 
oh how sweeeet ;D
 
that's all the kittehs ...
 
4:52 PM
anyone is able to keep composer cache on travis in a useful manner?
I have 5 minutes download only for composer packages
 
nope
I am thinking of moving the tests to scrutinizer instead
though, I don't know if it will be any better
 
I'm fine with travis generally, they are fast and I like the matrix.
It's just that with this build I have 5 mins deps, 30 secs setup, 1 min or so apt-get installs and then 1,5 for the phpunit suite - if at all. feels so bulky.
 
@tereško scrutinizer runs in the travis infrastructure
@hakre running with sudo: false?
 
there's precedent ... you can just do nothing ... it's your "compiling time" ...
 
If I put even more database dump and import tests into the unit-tests, then I perhaps can extend the runtime drastically ... :D
 
4:58 PM
!!xkcd 303
 
@Ocramius nope, sudo: required (wrong project dir)
 
@PeeHaa Can see the same thing that owners of a room can see re: deleted messages...
 
got a link to the travis build? you might be doing something weird if composer is taking 5 mins....
 
@JonClements :(
 
5:00 PM
@Danack That weird thing is called "magento2 installation"
 
NelsonHaHa.jpg
 
$a->$b->$c->$d ??= e() is equivalent to ($_1 = $a->$b ?? null) !== null ? ($_2 = $_1->$c ?? null) !== null ? $_2->$d ?? $_2->$d = e() : $_1->$c->$d = e() : $a->$b->$c->$d = e() and $a[$b][$c][$d] ??= e() is equivalent to ($_1 = &$a[$b]) !== null ? ($_2 = &$_1[$c]) !== null ? isset($_2[$d]) ? $_2[$d] : (is_object($_2) ? ($_3 = $_2)[$d] = e() : ($_3 = &$_2[$d]; $_3 = e())) : $_2[$c][$d] = e() : $a[$b][$c][$d] = e()
??= is a monster.
 
@Danack see before_script.sh section for example: travis-ci.org/ktomk/n98-magerun2/jobs/120430538
 
@bwoebi uhhmmmmm
 
5:02 PM
@JoeWatkins ^ look at that … how we'd have to transform ??= (will be a bit more succinct in VM ops, but…) \cc @MidoriKocak
 
@JoeWatkins I have one within phone-shot
 
@Leigh they look so good in b/w, don't they?
 
@bwoebi I see it ... I just ... I ... just ...
 
@PeeHaa well said.
 
@hakre yeah...right - I'm definitely going to debug some magneto stuff without getting paid for it......if you're using this for a commercial product, you should look at setting up your own Jenkins box, so that you can cache everything yourselves.
 
5:03 PM
@Leigh love it ...
I know what to put on my office walls ...
 
@JoeWatkins … don't find any words to accurately describe that abomination?
 
@bwoebi none ...
 
Had to get a signed print, after all, he's given me hours of enjoyment :D
 
@Danack sure, all magento projects, one or two have jenkins builds configured. that's the testsuite for a commandlline tool called magerun which actually has kind of acceptance tests with diverse magento installations. The magento 1 version tests against I dunno how many different magento versions and this Magento 2 one against all 2.0.* ones.
 
@Leigh remember source ?
 
5:06 PM
monrings
 
mogguh
 
But as Magento has it's own repo I have the feeling Travis does not cache - for packagist I have the feeling they can install packages faster than on a local box.
 
ah
thn
x
...
 
5:08 PM
sudo make me a sandwhich - perfect for the kitchen!
 
My collatz conjecture t-shirt used to got a lot of attention, it's old now and bits of the print have come off. It was good for starting conversations, and then ending them as quickly as they began
 
@NikiC btw. note the (is_object($_2) ? ($_3 = $_2)[$d] = e() : ($_3 = &$_2[$d]; $_3 = e()) in the array assign; this is to properly handle ArrayAccess and normal arrays … with objects, we can't just offsetSet($d, $reference), that wouldn't work… but on arrays we need to hold a pointer to a non-copyable type, hence we just create a ref to $_2[$d] directly and assign e() to that then.
 
[ getenv ] Gets the value of an environment variable
 
5:34 PM
Morning
 
o/
 
huh, at least it doesn't have a 1,5k code pasted now
 
:P
 
omin
 
5:48 PM
mornin @JoeWatkins
 
!!wiki morning
 
Morning is the period of time between midnight and noon or, more commonly, the interval between sunrise and noon. Morning precedes afternoon, evening, and night in the sequence of a day. Originally, the term referred to sunrise. == Etymology == The name (which comes from the Middle English word morwening) was formed from the analogy of evening using the word "morn" (in Middle English morwen), and originally meant the coming of the sunrise as evening meant the beginning of the close of the day. The Middle English morwen dropped over time and became morwe, then eventually morrow, which properly means...
 
!!wiki Sunday night blues
 
@RonniSkansing Sorry I couldn't find that page.
 
6:07 PM
i have an image stored as binary in a postgres db i'm trying to get the data back and create an image from it, but i haven't had any success
i've tried imagecreatefromstring but i'm getting invalid or empty string
 
!!wiki "metasyntactic variable"
 
@hakre Sorry I couldn't find that page.
@PeeHaa error has been logged. Fix it fix it fix it fix it.
 
lohlsen
A metasyntactic variable is a placeholder name used in computer science, a word without meaning intended to be substituted by some objects pertaining to the context where it is used. The word foo as used in IETF Requests for Comments is a good example. By mathematical analogy, a metasyntactic variable is a word that is a variable for other words, just as in algebra letters are used as variables for numbers. Any symbol or word which does not violate the syntactic rules of the language can be used as a metasyntactic variable. For specifications written in natural language, nonsense words are commonly...
 
here is the data in question pastebin.com/rEyXWCZx
 
@danidee That's not the data stored in the database is it?
 
6:15 PM
why did you store an image in database?
 
@PeeHaa it was the simplest approach at the time...i'm working with openerp
 
That's not binary
That's probably the base64 encoded representation of the binary blob
 
so i should base64 decode?
 
Yes
But why are you storing it like that in the first place?
 
okay....brb
 
6:20 PM
Storing images in your db is... meh (see @tereško's post), but storing base64 encoded images is really icky
 
i decoded and i wrote it to a new file....but i still can't get it to display the image. but the file type says binary
 
well, look at the exact process how you stored the image
then reverse it, add the correct image header and echo the content
.. and don't store files in database ever again
 
`$temp = explode(".", $_FILES["file"]["name"]);
$newfilename = round(microtime(true)) . '.' . end($temp);
move_uploaded_file($_FILES["file"]["tmp_name"], "../img/imageDirectory/" . $newfilename);` is this will be good approach to rename uploaded image??
 
use the hash as filename instead
It automagically prevent duplicates
Also note that if you are going to store a lot of images like this you will have to look into splitting it up in directories
 
6:30 PM
yea or just md5_file / sha1_file directly
 
np
 
actually, it should be "userid-timestamp-hash.jpg"
for management purposes
 
0
A: Pass an array of interfaces into a function?

Kuba BireckiSince you want to pass these various interfaces to the same function, I assume they have some behaviour in common. If you can name that behaviour, the cleanest solution would be to create a separate interface for it, and make sure the other interfaces extend it. Even if that interface doesn't co...

 
@JibinMathew You have to pass them into the function as an untyped array, there is a hack to type check them:
 
public function __construct(array $sourceLocators = [])
{
    // This slightly confusing code simply type-checks the $sourceLocators
    // array by unpacking them and splatting them in the closure.
    $validator = function (SourceLocator ...$sourceLocator) {
        return $sourceLocator;
    };
    $this->sourceLocators = $validator(...$sourceLocators);
}
 
@PeeHaa That's cruel and awesome.
 
@Danack so do i get the benefits of using interface then?
 
:P
 
@JibinMathew I don't think I understand what you're asking.
 
6:39 PM
@PeeHaa lol
 
@tereško thnks more better..
 
@AnmolRaghuvanshiVersion1.0 sometimes you want to delete all the files, that are associated to an account, or clean out old garbage
 
@Danack i need to pass an array of objects , with reference to an interface
 
@JibinMathew Create yourself an SplObjectStorage that only accepts objects of a certain interace.
 
@tereško when user request for account deletion do we actually delete it's data from DB and releated files from filesystem or we just make them user inactive..
 
6:44 PM
Ok. That code checks that the array only contains things that meet that particular interface.
 
"Create yourself an SplObjectStorage" ::frowny-face::
 
@AnmolRaghuvanshiVersion1.0 in EU it's a bit more complicated. If user requests account deletion, then you are expected to delete all of its content
 
@tereško it depends … if he explicitly asks for deletion of all records (e.g. per direct mail to support…), then yes. For a normal deactivation function, not needed
At least that's what a game admin told me… (game of several thousands of players)
 
you can also look at it this way: if each user ends up with 200MB+ of images, I would delete the user completely even if it wasn't mandatory
 
6:57 PM
seriously wondering why it's not allowed to comment "What have you tried so far?"
 
You
Hello
It's me
 
Anonymous
@Ekin
 
Anonymous
124
Q: "What have you tried" epidemic

Brian WebsterStatistics The usage of "what you tried" is growing (v2) In Q1 of 2012 - 0.0134 such comments per question (~1.33%) In Q2 of 2012 - 0.0167 such comments per question (~1.66%) In Q3 of 2012 - 0.0169 such comments per question (~1.68%) In Q4 of 2012 - 0.0193 such comments per question (~1.92%) I...

 
thanks
 
in other words they mistook the symptom for the problem
 
7:05 PM
oh, joy ... another "improvement" by Shog
 
@tereško hmm?
 
@bwoebi I have seen that mod being associated to the majority of the stupid decisions in SO
 
@tereško perhaps it seems that way because he is the community manager?
 
@tereško Who is "Shog"?
 
@bwoebi so you think, that he's just a mouthpiece ?
that IS a possible explanation
 
@tereško for a certain share, definitely … I just don't know how big that share is.
 
7:32 PM
offtopic, 80s pop
 
@Shafizadeh 105
 
Why ? What's the algorithm of your calculation?
 
are the operations commutative?
as in: a+b = b+a
 
@Shafizadeh the pattern for every n+m is (n+m)*n
 
7:46 PM
@tereško I think so ...
@PaulCrovella Great ... tnx
 
@PaulCrovella mh, you're right … I thought the base 10 numbers were substituted by other numbers in another base… (but that leads to no end)
 
@bwoebi yeah, I too was looking at the "numbers are not what they mean" approach
 
I was looking for the same at first, then the pattern jumped out at me.
 
@tereško yeah, but it doesn't work as we have 3 different leading digits but only additions of each one digit
 
hence my questions
5 mins ago, by tereško
are the operations commutative?
 
8:13 PM
ugh.. I'm gonna be visiting 10houses in two days... and need to decide which one to move
 
user image
3
 
that must've caused a really bad headache
 
sudo make me chicken with potato and salad # it works
 
don't forget to run make test :p
 
Wes
@Saitama simpsons did it
 
8:27 PM
@Ekin I think you mean make taste
 
:D
 
whats the best way to include a large amount of html to be returned from a php function?
 
@AlexGray what do you mean by "to include"?
Returns from a function as HTML are normally done by string, but DOMDocument is capable of being a HTML return value as well.
 
8:43 PM
I'm trying to make use of the function used to create a shortcode here: http://codex.wordpress.org/Shortcode_API#Output

I would like my shortcode to basically place a pretty good amount of html wherever it is located
 
@PeeHaa: How to allow Jeeves !!wiki compound words?
 
I'm willing to look it up and read my self/try to learn my self, I just need some words to google to achieve my goal
Something to do with string output and that's converted to html? Does it return a string with its html tags therefore is interpreted by the browser?
if I look up how to return a string from php function it will be correctly interpreted as html?
 
@AlexGray do you want to include a file lterally? As by the include construct? Then do as shown with ob_start on the codex page you just linked.
@AlexGray Yes, you only return a string with HTML fragment, the browser has the heavy work to parse the final document and display it.
 
ahhhh, so I could have two files in my plugin folder
 
splitting code over multiple files is useful if it helps you (as the author) to keep things in order and well separated.
 
8:46 PM
so it's an audio player I'm embedding, it would be better to have a plugin file that has the shortcode function, and the shortcode will grab the whole html file of the player and embed it?
 
one common thing is to differ between program logic and templates for example.
@AlexGray yes, that's the way to go. So the HTML of the player would be a template you can change later on (e.g. a different player style).
The program logic for the shortcode would not be affected, just the template
Also if you see something is wrong, you can most likely pretty fast say whether it's a logical error (=> program) or HTML output (=> template).
Just make your own life more easy.
 
yeah, that would be nice. Right now I managed to get the plugin when activated to just add the player at the top of each page. Skins/the admin page where it uploads and orders, removes, edits, etc., the songs is a whole journey lol. But I know my goals so I should be able to do it
 
@AlexGray You can also integrate templates with the theme: wordpress.stackexchange.com/q/4462/178
 
function player_embed_func( $atts ){
	return
<?php locate_template( $template_names, $load, $require_once ) ?>
;
}

add_shortcode( 'player', 'player_embed_func')
?>
can I use something like that to return the file where the shortcode is located?
 

« first day (1996 days earlier)      last day (2952 days later) »