« first day (2481 days earlier)      last day (2691 days later) » 

19:00
what does "doesn't work" mean?
Actually there is a php page which is not a part of the main page. It needs to have the login user id
is session_start() disabled in India?
I use session_start();
... that would actually explain quite a lot of my outsourcing experience ..
@Alesana It's not that bad, but things like mixing spaces / tabs and consistency in spacing for blocks throws me off
19:01
But still. Lol I like your humour
@PrakashPatil you will have to show some code
I think you are just using the sessions wrong
@tereško :P
I had to check
<?php
session_start();
error_reporting(E_ERROR);
require_once("dbcon.php");
$userLoogedId=$_SESSION['userid'];
Also inconsistent indentation @Alesana
And I prefer short array syntax with trailing commas
19:03
@PrakashPatil where are you setting the value?
is it the same domain?
The code I showed you is in another php page
The main page contains:
session_start();
if (!isset($_SESSION['login_user'])) {
header('Location: signin.php');
}
include('dbcon.php');
$user_check=$_SESSION['login_user'];
Yes it is for the same domain.
@PeeHaa Ah I didn't realize that I used any spaces
@PrakashPatil there are some minor differences between $_SESSION['login_user'] and $_SESSION['userid']
@PeeHaa By short array syntax do you mean one-line arrays?
Can you start by fixing those things please. And please use spaces instead of tabs <3
@Alesana Instead of doing array() use []
19:06
Ah I understand. 2 or 4 spaces?
4 glorious spaces
Okay :B I will go ahead and fix those
@Alesana show me too!
2 spaces, then fill the rest with a tab.
@tereško I guess you are right.
Lemme try
19:08
@Alesana Awesome
oh, well, I am on my last glass of wine
... then again, the glass is 620ml
@Danack what do you think of space tab space?
@tereško Haha okay hold on
.. I hope it's not wordpress
@PaulCrovella with tab width set to 2? Sounds good.
19:12
isn't that the joy of tabs? you can set the width to whatever you like
@Danack real men indent with semicolons
My tab key indents with 3.5 zero width joiners
@PeeHaa Should I be adding : string/array/whatever it returns after every function?
I had never seen it before
@PeeHaa you can always just not use monospace fonts
@tereško I use windings
@Alesana yes please define the return type too
19:17
@PeeHaa Okay I will fix that now
@PeeHaa you should try papyrus
cool <3
@PaulCrovella I like it
thought you would
19:19
If it returns $this->chatClient->postReply It would be : object or : Promise?
Promise
Okay
And for future reference is it bad practice to have a function return either a string or a boolean (false)?
In general that is a smell yeah
Ah, I have...
    private function get_array_key(string $needle, array $haystack)
    {
        foreach ($haystack as $key => $item) {
            if (in_array($needle, $item)) {
                return $key;
            }
        }

        return false;
    }
@Alesana throw an exception instead
19:22
@tereško Ah thanks that would make sense
I think you can do without that method
Oh wait. It's another level
then again, the whole method seems a bit fucky
I will probably complain about that later
that ^^
I couldn't think of a different solution haha
Maybe I am just doing the whole thing wrong
19 mins ago, by tereško
@Alesana show me too!
19:28
@tereško One second :D
@PeeHaa why returning Boolean is code smell or string?
I'm not getting less drunk here :P
@Linus Because you want to be able to tell what you get back instead of having to check for it
Also it is an indication a function/method is actually doing two things
19:29
also ^
Yeah make sense now so throwing exception will be good...
@tereško here you go :P
Thanks.
@Alesana github.com/ShawnCorrigan/Jeeves/blob/… : this should go in an external config
@tereško Blame Jeeves' current architecture
19:33
@tereško I was thinking about that I wasn't sure where that would be
@PeeHaa What exactly did you mean by inconsistent indentation? Like, incorrectly indented?
@tereško you solved my problem.
I was so silly there.
@PrakashPatil yw
Thanks a ton.
@Alesana There were some different indents going on in the same if statement. May be fixed now too already
@Alesana github.com/ShawnCorrigan/Jeeves/blob/… should use Kelvins as base temp
19:35
@tereško I have no idea how temperature conversion works haha, do you mean to say I should convert all to kelvin, and then back to whatever the end type is?
the "internal value" should be in kelvins
basically, the conversion should happen from both input to kelvins
and from kelvis to the requested output
similar to all the other conversions?
I guess that would make sense
well .. if I wrote it, it wouldn't support Fahrenheit at all
So it would be 3 switch cases to detect farhenheit/celsuis/kelvin input, then from there another 3 switch cases for the ouput?
the total is still 6 conditionals
the difference appears,when you try to add another temperature scale
because in one case it is 2*N and in other N!
19:42
Yeah I was thinking about how the number of conditionals would increase fast if you add more
it might be fun to add Plank temperature units
Good point
@tereško If you have any suggestions on how to find out what kind of unit it is without using my get_array_key method I would be glad to hear it :D
@Alesana suggestion nr.1: stick to the same naming schema, FFS
everything else is in camelCase
Haha I always switch up my casing
I can never decide :|
best_Of_Both_Worlds
19:47
@PaulCrovella only for unit tests
@Alesana camelCase is is the standard
I switched that and one other function over to camelCase
I was thinking there must be a better/cleaner way to concat strings than using `., like in...
            return $this->chatClient->postReply(
                $command,
                number_format($parsed_params['amount'], 2, '.', ',')
                . $from_unit_arr[1]
                . ' = '
                . number_format($converted_currency, 2, '.', ',')
                . $to_unit_arr[1]
            );
!!docs sprintf
19:53
[ sprintf() ] Return a formatted string
Probably cleaner
Ah thanks, I had seen that used around in places but never used it myself
@Alesana use temporary variables to add meaning, and to avoid having like 6 different things happening on one line.
20:08
@Danack I'm not sure exactly what you mean. You're referring to what I just pasted there?
yes.
$fromAmount = number_format($parsed_params['amount'], 2, '.', ',');
$toAmount = number_format($converted_currency, 2, '.', ',');

$message = $fromAmount
                . $from_unit_arr[1]
                . ' = '
                . $currencyString
                . $to_unit_arr[1];


return $this->chatClient->postReply(
                $command,
                $message
            );
the indenting will looking less rubbish with sprintf
That would be cleaner, I am rewriting it to use sprintf now as well so it would be 4 things on one line.
@PeeHaa Do you use spaces over tabs because that way it looks the same over all IDEs?
That and convention
I didn't realize it was convention aha
It also has the limited advantage of being able to do sub indents where needed
20:22
That makes sense
I need to learn how to test Jeeves on my computer to see if this works right haha
Yeah sorry I didn't have time yet for you :(
There's no rush :P
Is it bad practice to reset a variable using that same variable? ex...
            	$parsed_params['amount'] = number_format($parsed_params['amount'], 2, '.', ',');
Uh... no.
Pretty standard thing, tbqh
Okay haha, thanks then :B
Well I made that last switch case a lot cleaner
@tereško When you suggested to throw an exception should I throw a normal exception or should I extend the Exception class?
20:45
So why doesn't PHP error on exceeding max file size? Or who would I ask about that?
@Fabor What does that even mean?
When would you get to that situation?
Uploading a csv to my site, exceeds maximum file size according to php.ini but there's not notice or anything
@Fabor I think that it does.. you mean if you try to upload a file via a post form that exceeds upload_max_filesize?
It just returns an empty $_FILES.
$_FILES should at least be not empty
$_FILES['userfile']['error'] should be 1 if you try to upload a file larger than your upload_max_filesize value
20:53
Is promoting websites allowed here?
If new users do it it may be handled as spam
A ty
Well i am pretty new xD
yeap :-)
@Alesana I would make a custom exception
it doesn't need any functionality, just a good name
What are you guys working on?
20:58
@tereško Is it overkill to make 2 custom exceptions? 1 for invalid parameters, the second for failling an http request?
they dont cost anything
and you gain better semantics
Makes sense, thanks
21:25
I think I fixed a lot of bad coding style pastebin.com/6E00dCEy
I don't know how I should be spacing out my code as far as returns go, though
21:39
Bread time o/
Oh BTW i finally found my \ key \o/
Still no pipe though.
21:55
I feel like there is some secret meaning to what you said but I can't figure it out :|
how is keycdn so cheap
feels like a scam
and you feel like spam ;)
22:13
I found the perfect sticker for @tereško
do I really seem so vindictive?
Well, you are known for your strong opinions...
I don't mean it to be an insult. Apologies if it was taken as such
22:33
@Machavity naah, no worries. It was not taken as an insult. I was just wondering if people really see me as unreasonable.
that would kinda hurt :/
I try to be an asshole only when it is for a purpose
I have gotten used to 11's stern way of giving advice so I haven't noticed anything unreasonable :P
22:50
Room 11 is not a safe space for the easily butthurt
23:04
@Allenph sorry, been on vacation, I'll get that forwarded to the group closer to you

« first day (2481 days earlier)      last day (2691 days later) »