« first day (2312 days earlier)      last day (2635 days later) » 

1:01 PM
So it throws it even in if…elseif…etc.
 
@JoeWatkins but … but … we've tested it in production?! :-D
 
If I omit the throw new line, it goes fine
 
Anonymous
@Trucy no, it doesn't 3v4l.org/gbuqF. It's not getting a matched value
 
@Trucy Also this line ain't doing much there :P
 
@pmmaga ye I know, I'm in the middle of debugging here :p
 
1:06 PM
My colegue just broke his Mac while using PHPStorm - OSX crashed, so he need to hard restart. After that OSX won't boot anymore :)
 
@JayIsTooCommon It works in 3v4l but not in my code…
(disclaimer: I use ZF 1)
 
Print the value before switch to see? It seems like it always falls into the default case
Also 3v4l on mobile sucks :(
 
@Ekin If I don't put the throw, it works as intended
But as soon as there's a throw, it throws the exception
 
Anonymous
Side note, i prefer something like this over a switch 3v4l.org/RM86V
 
Means the value is not matching any other cases
 
Anonymous
1:10 PM
print the value, see what yow get
 
@brzuchal it most be that famous OSX stability
 
@bwoebi yes, and it works perfectly ... oh wait ...
 
:-)
 
Anonymous
@Jeeves ignore him. You're perfect
 
Anonymous
oh yeah, that bit is broken :P
 
1:12 PM
@JayIsTooCommon @Ekin when I print the value, it's a valid value…
 
@tereško Yeah, I thought OSX never crashes, am on Ubuntu and everybody laught of it, now I can :)
 
@JayIsTooCommon :D
 
@tereško well, typically OS X either hangs because no memory left or after a long while it sometimes corrupts the GPU so badly the kernel panics … for me.
 
lol
 
Also osx updates always scares me
It's 50/50 whether it will come back up again for me
 
1:14 PM
I cant recall a single instance of Win10 crashing for me
 
Anonymous
@Trucy what is actually printed when you remove the throw?
 
@tereško This morning for me :P
Maybe it's just me now I think about it
 
@JayIsTooCommon ewww
 
Anonymous
@JoeWatkins over a switch?? I'd always go for that approach (minus the const which would vary on context)
 
@PeeHaa were you doing anything interesting with it?
 
1:14 PM
@tereško And when I say no memory left, it's because I really, really consume too much memory
 
@tereško Copying files from ftp (filezilla) to network
 
@bwoebi also OSX has a reputation of having really shitty memory management
 
Even got a blue screen \o/
 
@JayIsTooCommon 'w' for example
(if I print $periodicity)
 
@JayIsTooCommon arrays for the sake of arrays ...
 
1:15 PM
@tereško does it?
 
(and WEEKLY if I print $icalRecurrence)
 
@PeeHaa I would probably run a full HW test ... that sounds strange
have you overclocked anything?
 
nope
 
start by testing RAM
 
I think the word "periodicity" is being misused there ...
 
Anonymous
1:16 PM
Or install a new OS, that's a good start
 
Not my machine so ain't gonna touch it :P
 
oh
 
@tereško dunno, but Win 10 also already crashed on me in the VM…
not sure whether it's the VMs fault though
 
Anonymous
@JoeWatkins i'd still prefer it over a switch gist.github.com/MagicTrucy/af48aab881cfa00e35a214c364f2d0a7 imo
 
I just might be having an uncommonly stable one
 
1:18 PM
I am agree with @JayIsTooCommon
 
Anonymous
@Trucy ¯_(ツ)_/¯
 
@JayIsTooCommon Yeah, thought so :D
Also: ¯\_(ツ)_/¯
 
Anonymous
show off..
 
@JayIsTooCommon that's what a switch is for
 
double backslashes init
 
1:19 PM
@PeeHaa oh, I assumed it was yours (which would also mean that you do not have a plethora of viruses and adware)
 
Well it's mine in the sense that is my work station over here
But not my personal device
 
@Trucy Yo, check this line, and the line below it, gist.github.com/MagicTrucy/…
 
then send a message to tech support
 
@Leigh I know, the question wasn't about this part :(
 
something might be fucky
 
Anonymous
1:23 PM
@JoeWatkins aye - I still think array is more readable and easier to change.
 
@Trucy oh, not your code? my bad, sorry
 
@Leigh well it is my code, but I was in the middle of debugging
ofc I won't leave it as is
 
@JayIsTooCommon you know that's subjective ... if you're not going to use a switch for intended purpose, what are you going to use it for ?
 
@JoeWatkins a giant goto maybe?
 
Anonymous
I'm not going to use it at all if I can help it :P
 
1:25 PM
@Trucy You know how people say else is evil. Switch is just a big if/else.
 
@Leigh but easier syntaxically
 
@JoeWatkins Although subjective I am agree with jay here
More readable. "Easier" to add stuff. Less to read. Early bail out
 
@Leigh you know how people say goto is evil, if is just an unlabelled goto ... in fact almost everything you ever write is just a fancy goto ...
 
^
 
@JoeWatkins You know I know this
Long live the JMPZNZ opcode
And I use goto, because I know when to use goto
 
1:28 PM
PHP needs an asm instruction :)
 
we could do that ... but the kind of assembly you would need to write is just so extraordinarily complicated
 
nah treat it as x86, assemble, put into buffer, jump to buffer :D
 
reminds me when I was coding in C…
good ol' times
 
@Joe I think PHP would be better off with greenlet functionality ehm
 
C is the one true code ...
@bwoebi yeah, I got the ping :D I did actually play with it for about an hour on friday night ... I'm just getting oom errors and nothing interesting is possible yet ...
 
1:32 PM
@JoeWatkins x86 is the only one true code
 
@Trucy you spelled C wrong
 
prft, C
 
@Trucy who uses x86 asm?! The only true way of coding is storing µops in the firmware!
 
Why do you need all these fancy "variable names" and "type hintings"?
 
it'll be extra fast too!
 
1:33 PM
haha
/me is afk, getting wife from work
 
@bwoebi switching the transistors by hand is the way to go mate
 
@Trucy (that's basically what µops do)
 
@bwoebi (shit you went deeper than me :()
lowest level I ever done was with programmable logic controllers
good ol' days
I learned many things at school
So far I used maybe 0.1% at work
 
 
trying it
 
1:38 PM
@Trucy Get yourself a breadboard and some PICs and some resisters and LEDs, it'll be fun
 
@Leigh I tried it a few months ago, I lost everything I knew :(
 
Symfony (likely noob-like) question: I need to pass some parameters to a Service in a bundle. The bundle has its own services.yml. It's easy to use parameters from app/config/parameters.yml in the services.yml, but it misses the validation/structure from config.yml.
Should the parameters.yml parameters be passed to the services? Or should the config.yml parameters be used? In the last case: how? .. I have a *bundle*Configuration dependencyinjection, and I validate the config structure there, but I still see now way to use the "config.yml" as the source for the service configuration.
 
but you have... the internet!
 
I managed to make a thermometer
@Leigh but I have… laziness!
I'm focusing on PHP now
But my gf would like a home-made weather station
 
@DamienOvereem ping @Jimbo - He's our resident symfonite :)
@Trucy What does she do?
 
1:40 PM
You already just did, didn't you ;p
 
I did :)
Just wanted to include both of you
 
Then I consider him pinged.
 
@Leigh unemployed, and she doesn't like programming
(she made a semester in CS, then got severly depressed and had several problems)
 
@Trucy She could get busy on a weatherproof enclosure then... void of contents... waiting for you to fill it
 
(so for her, programming is basically a PTSD :()
 
1:42 PM
Symfony is confusing me where configuration is concerned..
 
@Leigh She's working on a planting planning right now!
 
@DamienOvereem Config Driven Development
 
This summer she made a few tests to see what can grow in our soil
 
CDD? That comes awfully close to OCD
 
Aug 26 '11 at 11:25, by teresko
well .. in that case i recommend changing hobby .. try gardening or beekeeping
 
1:44 PM
apache + php + php framework, the 3 horsemen of apocalypse
 
@Trucy looks like someone took my advice
 
@tereško :D she went from full geek to full naturalist
 
strange way to have a breakdown
 
(but she still know her way around in a shell)
@tereško She has mental issues/conditions (don't know the correct word), so her case is special
 
@Trucy Nice, I have a half baked plan for a project for some indoor growing. I want to use an arduino + v-slot system so a little worker robot can go along some rails, and test soil for moisture to see when plants need watering :)
 
1:47 PM
lately it seems like having a diagnosed disorder is the new hot thing
 
hey, I had my disorder before it was cool
 
@tereško like Leigh said, in that case she's a mental illness hipster :)
 
Started running over work lunches. Trying to not be lazy goes against everything I am as a developer :P
 
Perhaps lately people are realising there's less stigma than they thought, and are actually getting the diagnosis they should have already had, and are being open about it
 
@Leigh still doesn't work :( I give up. I'll just put a die() it won't work with a die() either :( )
 
1:51 PM
I actually missed the original question, what are you trying to do?
 
@Leigh or diagnosing kids with various disorders has been quite lucrative for some time already
 
@Leigh I have a periodicity column in a table. The value of this column is d, w, m or y. I have to convert this value to a valid RECUR rule in iCal
(using Zend Framework 1)
 
@Trucy and what's the problem you're having?
sorry if I'm asking you to repeat yourself
 
@Leigh the problem is when I put a throw new in a condition (whether it's an if else or a switch, it'll throw it, no matter what
 
whaaat O_o
did you dump the value from getPeriodicity?
and is the exception definitely thrown from your function?
 
1:56 PM
@Leigh that I don't know. Because when an exception is thrown, ZF just displays a "Application error" message.
and the value is correct
 
Anonymous
@Leigh that would be so cool, have you made any start to the project or just a plan for now?
 
Anonymous
oh, plan.
 
OK so if I just throw an Exception without argument, it works
wait
 
@JayIsTooCommon I have the arduino...
 
no it dosen't
phew
 
2:00 PM
@Trucy are you sure that the value returned from getPeriodicity() doesn't match any of the values in your block? Because it really shouldn't get to the exception.
 
Anonymous
@Leigh it would be incredibly awesome if you did that
 
Are the values returned lowercase? Are there spaces on the start/end?
@JayIsTooCommon Yea I'm envisioning something with a rail either side, and a robot over the top with a probe it can jab into soil... and some piping to... something
delicious plant beverages
 
Anonymous
is it me or is arduino site down? arduino.cc
 
It's you
 
It's you
 
2:06 PM
loads for me
 
It's you
(How are you gentlemen)
 
Anonymous
nah, it's down. you're all wrong.
 
@Trucy Well I'm rough and @PeeHaa is a woman
 
Current status aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
2:07 PM
current status: building a docker image for the bajillionth time
 
Anonymous
@Trucy currently rubying so same status as @PeeHaa
 
Hi guys, not a php question but hoping someone has a quick answer
 
very quick :O correct
 
2:09 PM
I have been working on a website using it by IP, now i want to use a domain i have purchased. Should i map the domain, or does forwarding do the same thing
because at the moment its forwarding, and when i go to the url it works
but not sure if this is bad for SEO or anything
 
what do you mean by "map the domain"?
You mean in the web server config?
 
You'll want to create an DNS A record pointing to the IP (and make sure your web server knows what to do with the domain when it encounters incoming traffic for it)
 
Leigh , instead of forwarding?
 
Forwarding is probably a hosting provider redirect?
In this context?
 
@Leigh positevely absolutely sure. Everything works without a throw line
 
2:11 PM
@Trucy That is.. mad
 
yes
 
@Leigh It is :(
Maybe it's ZF 1's fault
 
@virepo Yea, so it's an unnecessary intermediate step, it does hurt both performance and SEO
 
@Trucy OK so I am 1000% sure that you have a logic error somewhere
Is there any way you can share the code?
 
2:15 PM
OK, and the specific line where you are having a problem?
 
If I put this, the exeception will get thrown everytime, no matter what
If I don't put it, it works as intended
 
@JayIsTooCommon like this: youtu.be/3gpeDRt4V6I?t=101
 
@DaveRandom aka reducing disk space with dangling filesystems and not freeing them despite adding all the flags
 
Anonymous
@Trucy what's the exact output if you var_dump($code) in that method?
 
NULL
string(1) "m"
(plus the JSON object as intended)
 
Anonymous
2:20 PM
@Leigh keep us updated with the proj ? Sounds really interesting. I may have a dabble in creating something simpler
 
@Trucy well that NULL would cause the throw..
 
where does the NULL come from?
private function periodCodeToToken($code)
{
    static $codeMap = [
        'd' => 'DAILY',
        'w' => 'WEEKLY',
        'm' => 'MONTHLY',
        'y' => 'YEARLY',
    ];

    if (!isset($codeMap[$code])) {
        var_dump($code);
        throw new InvalidArgumentException('Unknown period code: '. $code);
    }

    return $codeMap[$code];
}
also that
 
Anonymous
i mean.. @DaveRandom you've taught me well chat.stackoverflow.com/transcript/message/35635156#35635156
 
Err, I don't know. It comes with the var_dump
 
well there's your issue :)
 
2:22 PM
Well you don't get that exact output unless you call var_dump() twice
 
@DaveRandom meh, less performant
;)
 
@DaveRandom OH SNAP, thanks
 
@Leigh I would argue more sane
 
hello, PHP
 
Never thought of that
 
2:23 PM
Branch optimisations in regular PHP is sort an insane thing to do...
 
@DaveRandom It's not a branch optimisation, it's just doing less work
 
guys i have a profile page with this $profile = $_POST['user'];, which gets what user was clicked on and displays their profile, but if they type in profile.php manually in the url, it will throw an error as $_Post has no value, is there anyway to get around this
 
You probably don't want to use a POST request to GET information (hint, hint)
 
i thought the only difference was that POST like hides the info from ppl or something
 
Anonymous
!!? HTTP Methods
 
2:38 PM
it stops it being in the address bar, sure, but most of the time if you're getting a user profile, you don't care
 
Search for "HTTP Methods" (https://www.google.com/search?q=HTTP+Methods&lr=lang_en)
• HTTP/1.1: Method Definitions - The set of common methods for HTTP/1.1 is defined below. Although … The Host request-header field (… (https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html)
• HTTP Methods for RESTful Services - REST API Tuto… - HTTP methods tutorial on how to use them for RESTful API or Web Service. (http://www.restapitutorial.com/lessons/httpmethods.html)
• HTTP request methods - HTTP | MDN - 15 nov. 2016 - HTTP defines a set of request methods to indicate the desired action to be performe
 
oh ok i dont mind it being in the address bar, sec ill change it
 
@RachelDockter Example that number is your user id.
Perfectly fine to have that there, it's not secret information
 
yeh thats what the 'user' is in my example too, thats perfect
but if i type profile.php manually, its still giving me an error
 
You'll need to use $_GET
 
2:40 PM
thats what i did, $profile = $_GET['user'];
error is undefined index
 
So you're going to profile.php?user=123 ?
 
I have an /admin/index.php and a /files/header.php. The header.php is included in my admin index.php and this header file includes another PHP file which is in the same directory. If I try to access the index.php I am thrown a "No such file or directory" error - any ideas?
 
no im just typing profile.php
 
@RachelDockter so how does that page know what the user variable is supposed to be?
 
i want to make it whoever is logged in by default
 
2:42 PM
Rachel, do you have a login page?
 
@nicarpe are the file locations correct, if u need to go back a directory put ../index.php
i log in on the homepage so kinda
 
@RachelDockter Then you probably want to store that data in a session
 
Yup, this header file is included in my other files and works fine.
 
did you have time to look at git?
 
@Rachel Dockter Start a session, save the User ID in a session variable and then you can later grab it in your profile file
 
2:43 PM
i didnt look at git, times like this is would probs be helpful
 
Anonymous
@DaveRandom if Jeeves ends on 'listening on tcp yada' it normally indicates a connection issue - right?
 
Sec, I'll give you an example
 
@Leigh i think i fixed it, i just added if the user is logged in, redirect to profile.php?user=username
which is their own profile
 
That would do it, but it's not the right way.
That would allow any user to view any users profile.
All they'd have to do is change the username
 
yeh thats not a problem
 
2:46 PM
Well.. it is
 
like facebook, u can view anyones profile
 
right
 
what was u thinking?
 
sure, do it like that then
Because you said "if the user is logged in", I was thinking you might be displaying additional info on that page
 
the actual question is: should the page for your own profile and profile of somebody else contain different information?
 
2:47 PM
no its the same, i just meant if the user is logged in, go to their own profile
 
You could make a User class and do this: pastebin.com/4AtySDfj
 
@nicarpe please dont share so shitty code
 
lmao im sorry but that made me laugh
 
Just giving an idea to how it could be done lol
 
s/done/done wrong
 
2:50 PM
Tell us what you'd do
 
global - it's been a while since I saw that one
At least it uses a prepared statement :)
 
to be used in an external file so you don't need to define it every time is what I use it for
how could I improve it then
 
And it was pasted 59 minutes ago
 
@nicarpe learn about dependency injection
 
@Leigh no it expires in 59 minutes
lol
hmm alright suppose I'll look into that
 
2:52 PM
ah, not a big pastebin user ;)
@nicarpe Also check out guard clauses
 
oh yeah I used to do that instead when I wrote java lol
 
also, @nicarpe, that method of yours can return three different types: null, false and an array
 
I'll try to rewrite it
hmm
 
Pretty sure Marco has something for this..
 
yeah I see how
I should return it in the actual function
sec lemme try to rewrite it
 
how's this lol
woops missed a $
oh well you get the idea
 

« first day (2312 days earlier)      last day (2635 days later) »