« first day (1663 days earlier)      last day (3278 days later) » 

user895378
12:16 AM
@LeviMorrison sure, thanks.
 
12:45 AM
hey everyone, how do i automaticatically update a database record when a post is viewed in cakephp.
 
why would this make the function output sit outside the <td>:
<td>".make_link("bio", "more_content", "url=bio")."</td>
 
@LeviMorrison that's why I think nullable return t. would be unnecessary
 
@V-cordUkandu you program it to do so with an sql update statement
 
// specially in this case
function (a|b $x): a|b|null {} // unified syntax
// or would you allow:
function (a|b $x): ?a|?b {}
// or
function (a|b $x): ?(a|b) {}
// ?
@LeviMorrison ^
 
@marcio see what i'm doing wrong?
 
12:57 AM
?
 
this puts the function outside the <td>:
<td>".make_link("bio", "more_content", "url=bio")."</td>
it's a simple echo
 
you probably have an error somewhere else on your HTML or make_link() is generating invalid markup
 
makelink is only hyperlinks
instead of typing out a very long string, i shortened it down to a few characters while testing, since it's a new repo
 
then something on your table might be missing a closing tag, this is something much easier to debug by yourself
 
these are all wrapped inside <td>:
<a href='?url=upload' onclick='return false' onmousedown='javascript:swapContent("url=upload", more_content)'>upload</a>
<a href='?url=notifications' onclick='return false' onmousedown='javascript:swapContent("url=notifications", more_content)'>Notifications</a>
<a href='?url=bio' onclick='return false' onmousedown='javascript:swapContent("url=bio", more_content)'>bio</a></td>

<td></td>

<td></td>

<td></td>
 
1:02 AM
 
somehow if i wrap a word inside a td it sits inside, but in a function call, it fails
 
@phpPluginMaster I'm going to guess that you're echoing inside the function and not returning a string.
 
bingo
 
it's echoing a "special" hyperlink
 
1:06 AM
Just return it, and then contemplate the order in which your code is being called. Using a debugger here would make it obvious.
 
it's returning between </td> and <td>
echo:
echo "</td>

<td>".make_link("upload", "more_content", "url=upload")."</td>

<td>".make_link("Notifications", "more_content", "url=notifications")."</td>

<td>".make_link("bio", "more_content", "url=bio")."</td>
</tr>
</table>
</div>
";
 
> contemplate the order in which your code is being called. Using a debugger here would make it obvious.
 
like 3v4l.org?
is it ever a bad idea to do a lot of echos
 
@phpPluginMaster No, with a debugger:
 
@Danack odd, fixed it with:
require_once "search/index.php";
echo "</td>

<td>";
make_link("upload", "more_content", "url=upload");
echo "
 
1:21 AM
s/fixed/worked around without understanding/
 
or partially
i understand
why don't you do an echo " ". function ."."; like this?
 
I do - but the string needs to be returned, not echoed inside the function. You really ought to learn how to use a debugger - this stuff is much easier to see when you're stepping through the code.
 
why return it, when all you're doing with the function is echoing repeated code?
 
17 mins ago, by Danack
> contemplate the order in which your code is being called. Using a debugger here would make it obvious.
 
that debugging video is really long
i did look at it, and if it's building a long repeated string in testing, the short hand is to do it in a function
 
1:33 AM
@NikiC need some help with kmyacc
will ping you tomorrow
 
1:44 AM
this looks nice: gog.com/galaxy
 
@marcio Oh, this is one reason I've dropped nullable types.
 
Morning
 
Just wondering @LeviMorrison, how is the reflection stuff going for return types?
 
Chime in with a better name than isClassOrInterface
 
1:57 AM
isMethodist j/k
....which might fail as a joke outside of England.
 
lol
isNotPrimitive()
 
isOO
 
anyone here
 
@Danack No, because enums wouldn't necessarily be object oriented.
isComplexType()?
 
2:19 AM
@LeviMorrison That's better than 'isNotPrimitive'. Although people might argue that 'complex' is not a good description of class or interface, it's vague enough to leave it open to future expansion to enums and other things.
 
Can someone explain to me why I see so many PHP devs regexing html? Is there I reason people are not using php.net/manual/en/book.dom.php ?
 
@AustinPray They are not informed or think the regex is more suitable in some way.
(or both)
 
The php dom module is built-in right? Everyone should have it? (sorry don't use PHP often)
 
Should have it, yes.
 
2:41 AM
Ah okay thank you!
 
why would you want to parse HTML with PHP?
 
if i have a switch (TRUE), how do I do a default:
 
switch(TRUE) ?
what do you mean
 
2:59 AM
@ziGi switch(TRUE) automatically means it's either true, or false OBVIOUSLY
 
why would you use a switch then, but not an 'if'?
 
i prefer to use switches
 
you do realize that a bit redundant
 
errors return false
 
what about this
 
3:04 AM
lol, it's asking if true is true
 
well obviously you are not going to say $foo = true;
but instead
$foo = your requirement;
 
yep
didn't you know about that?
 
trolololo
tro lo lo, tro lo lo
 
the code in your repo tells me you were lying to me
you do use if statements
@phpPluginMaster whats your question exactly
 
3:12 AM
is it in javascript, or php?
 
PHP
 
that's probably a minor one, not a major one
 
ok tell me your question again
 
i'm trying to figure out how to turn on, and off load_more
 
what is load_more
 
3:15 AM
in the repo there's a load_more script
 
so what is the requirement
to turn it on
 
i'm trying to figure out how to turn on, and off the load more script when it's loaded by default
i'm also running swap_content
:-? i think i got it
yep
had to move the content div
@zigi like the repo i'm building?
 
3:44 AM
lexer built. parser built. Now to wire the two together
 
 
1 hour later…
4:49 AM
moin
 
morning
 
zan
5:17 AM
Morning
 
5:55 AM
ProTip: until we have infinitely large screens, don't have elements that scroll to infinity: No human can model this experience, annoying.
 
6:23 AM
hi all
 
More of evenin' here, but mornin' nonetheless.
 
good moring all
 
6:44 AM
Morning
Where's the coffee at?
 
7:12 AM
I ate it
good mornin
 
@JoeWatkins the irony of saying this on twitter :D
 
@SergeyTelshevsky Ate what?
 
Did you remember to put it in the freezer so it became solid first?
 
7:29 AM
no, but I think I drink too much of it lately
 
One cannot drink too much coffee
 
7:45 AM
@FlorianMargaine they don't have a footer ...
try to click a link in the footer ...
infuriating ...
 
@JoeWatkins hahaha
 
good mornings
 
any idea why include/require returns int(1) if the file really large? (even when the return statement is on the first line)
 
moin
 
good morning
 
7:58 AM
morning
 
marning
 
@Patrick Define "really large"? Cannot repro with 640K, cannot be bothered trying any larger. More likely pebkac, I would suggest...
Also, ftr, return statements in included files is horrible.
 
20k lines. But found a smarter solution
 
Maybe "not putting 20K LoC in one file"? :-P
 
return []; for a config file is bad?
@DaveRandom yeah not doing that now :D But still, weird behaviour
 
8:02 AM
Morning
 
moinhaa
 
hi @PeeHaa
 
@Patrick That may actually be the one and only case where it's not. But I would still argue that if you are using a PHP config file then you may as well just declare a var with a known name, it's not really particularly functionally different.
 
@PeeHaa read your rfc...^^ headache after that...
 
It's not really mine :P
 
8:04 AM
yep :P
but didnt really help. Helped understand the concepts, but still nowhere^^
@PeeHaa I tried to build something with nodejs, which seems to be an easy tool for that
 
@DaveRandom But then the config file is polluting the global namespace? Could lead to name conflicts and you would have to check inside each file to be sure. I like the return option here. Are there any drawbacks?
 
it works fine but what would be better? build a ws server with php? or with that * nodejs?
 
8:33 AM
@JoeWatkins so what do you suggest, paginating?
btw infinite scrolling can be modeled in real life
for example a treadmill which has a front side displaying something to the user and back side changing what is being displayed infinitely
 
hello I have a trouble
in my application
 
posted on May 06, 2015 by kbironneau

/* by Tavrne */

 
@mangulom it's more proper to say I am in trouble or my application is in trouble
I don't think it's possible to have a trouble in something
 
ok
thank you
My application is in trouble
it´s correct?
is it correct?
0
Q: not loading the content of a remote file

mangulomI have a file edit.blade.php. I want to load content in a div with load ajax @if(Auth::check() && Auth::user()->admin) @section('modal_body') @if($errors->any()) <div class='alert alert-danger'> <a href="#" class="close" data-dismiss="alert">&times;</a> @for...

 
8:53 AM
0
Q: Smarty layout tpl with Codeigniter with subView

RetroI have integrated smarty with codeigniter and I know basic of them but I am having a issue of handling the layout, even though i have create but still I am confuse how to make it work more efficiently, I have a layout in which header, footer, menu and body layout, in body it will be depend on th...

 
@Retro why are you using codeigniter in 2015?
 
and smarty
 
@Patrick why are people sticking to frameworks in 2015
 
9:08 AM
@Patrick what should i use then?
I am new and learning things
:(
 
@Patrick tbh I'd just rather use a proper config file format, one that doesn't execute code. If you must use a PHP config file then I suppose it's marginally better to return, the issue for me is more that you are includeing it in the first place
 
for a small scale application which will extended in future what is the best way to implement, I also dont want to put effort on creating so much helper things?
 
@DaveRandom like... yaml? :D
 
9:53 AM
@Patrick If you really must. Something like that, anyway. Something that does not have such a gaping arbitrary code execution flaw.
 
Hmm, is it really the best advice to avoid frameworks? I'm of the opinion that if you don't know why you shouldn't use a framework, then you should use one.
 
10:06 AM
hello
 
user1105787
I've been pulling my hair out trying to get Sonata User Bundle setup in Symfony 2.6.6 has anyone ever managed to get userbundle and mediabundle up and working with FOS ~2.0@dev? Am willing to compensate with paymet for time at this point.
 
I'm developing in php with codeigniter and want to handle database errors like heavy load , violation of constraint etc ...
I searched the web , didn't quite find what I want
I'm using mysql
can someone help ?
 
@DaveRandom YAML YAML YAML
 
Mornbo
 
10:38 AM
@DaveRandom Why would that matter for config files? The people who edit them also write the code...
 
hi developers
 
Hello
 
10:57 AM
Hey,
When using PHP -S localhost:8889 orsomething... what can be the reason I am not able to send emails?
 
@Duikboot CLI might be using other config files ...
 
Oh ok
 
@Duikboot How are you sending mail? sendmail? smtp?
 
Well I stopped using MAMP and try to do now everything
with the CLI so I have no clue.
I am trying to make use of WP_MAIL ( phpmailer)
 
11:19 AM
Hi
 
Hello
 
Is it possible to bind the browser to PHP storm so when you edit a script from the devtools to be updated in PHP storm and vice versa?
 
Whatsapp with github?
 
down
 
> All systems operational
Yep.
Down, officially.
 
11:36 AM
whys it matter if git hub is down?
are the files not stored locally
 
Anonymous
down
 
I got my own git lab server haha :D
 
Anonymous
@StephenWolfe you must be the first in the world.
 
@DejanMarjanovic What is mukuru? 3rd world funding?
wow three edits...
 
@samaYo what do u mean?
@samaYo because i have a server?
 
11:39 AM
Yes, basically, remittance :D For people who can't open the bank account legally. @PeeHaa
 
Anonymous
@StephenWolfe I am a bot.
 
Anonymous
Countdown to buy a new laptop: 3 weeks, 2 days, 17 hours, 09 minutes, 13 seconds
 
What one you getting?
 
@Patrick The people who should edit them write the code. Also, people are idiots/lazy and can hack extra bootstrap routines in the config files instead of putting them into the correct place (I have seen this IRL, it took me several hours of debugging to find it), if the config files are not executable you eliminate this danger.
 
Anonymous
11:43 AM
@StephenWolfe dell xps 13"
 
13" for work?
or do you have a monitor?
 
this is what i bought last year johnlewis.com/…
@samaYo thats tiny!
 
Anonymous
@Patrick I have a benq 22" for work
 
then you should be fine I guess
 
What do people use for back up soloutions
 
Anonymous
11:47 AM
I can't wait to finally get a good laptop. Mine is currently sucking the life out of me. I haven't done any coding in 4 days :/
 
I still haven't found one thats convenient to use
 
Anonymous
@StephenWolfe copy/pasta
 
@samaYo sarcasm# today.
 
@StephenWolfe Faith :P
 
Anonymous
+1
 
11:50 AM
@PeeHaa I use to believe in faith with my toshiba laptops never ever had one go down. then I switched to an Asus ultabook and i had two of them both died 4/5 times each from HDD failure :( now I have a Lenovo and that just had a HDD die in 3 months of use. Faith lost
 
Anonymous
I am currently with my only and first laptop ever :/
 
What is it?
 
Anonymous
hp
 
@samaYo how comes you have only every had one laptop? how old are you.
 
Anonymous
because my life sucks as much as your grammar
 
Anonymous
11:53 AM
/sarcasm
 
:D
At least your getting a dell XPS
 
I beg of you help me understand the issue,i have a value that is the result of a json decoded post variable, this value has a space in it "&nbsp;", i want to transform it to normal text, so i html-entity-decode it like so html_entity_decode($string, ENT_COMPAT, 'UTF-8'); , the problem is the space gets decoded into Unicode Why ? i just want a normal space " " .
The post variable is a result of an ajax call
 
hii i am unable to pass array in please look my code paste.ofcode.org/zkt4rZCviinc9ZB4d72P32
please help
 
Anonymous
what in the name of php is that?
 
guys ?
 
11:58 AM
@Edge Nobody is going to help you with obfuscated code
 
@PeeHaa I wounderd what that was
lol
 
No it is not obfuscated code it is Extended Euclidean Algorithm
 
It's obfuscated
 
it's not valid php
 
Also that
 
12:00 PM
I want to pass that Algo logic in that function
I am actually an Android Developer who now have to do that logic in PHP
I had converted all the logic but not able to find out where it is not working
From line 5 to line 47 all is logic which is providing right answer to me in my Android
But not in PHP
I am trying to pass an Array to a php function
like [10, 20]
 
oh dear
 
[], not {}
int is not valid either, and you are missing a semi colon, and you cannot echo an array
 
You're also not actually calling the function
 
Anonymous
@Edge please rename your variables properly in the future.
 
and the function not being called is a huge problem ...
but it does work, if you call it ...
 
12:02 PM
How to call a function
is there any main method
 
Anonymous
lol
 
> Process exited with code 137.
Gee, thanks HHVM
 
Process exited with FUCK_YOU
 
Investing in a good laptop is some how a high priority for me. Also a good bike as well
 
12:09 PM
lol what error is that? i have never seen that
 
Guys i had asked a question some minutes ago i don't mean to be naggy but can no one help ?
 
@Joseph Sometimes it takes time to get a proper answer
 
@Joseph What's the hex value of the resulted "space"
 
Anonymous
@Joseph how about don't decode it?
 
@Joseph I didnt understand your question lol so didnt answer
 
12:16 PM
@HamZa that's the one u00c2
 
Anonymous
or just use str_replace() for lazyness
 
Anonymous
21 mins ago, by Joseph
I beg of you help me understand the issue,i have a value that is the result of a json decoded post variable, this value has a space in it "&nbsp;", i want to transform it to normal text, so i html-entity-decode it like so html_entity_decode($string, ENT_COMPAT, 'UTF-8'); , the problem is the space gets decoded into Unicode Why ? i just want a normal space " " .
The post variable is a result of an ajax call
 
I think you got the wrong char
 
@samaYo if i don' decode it, it will be '%List&nbsp;of%'
and i need it for a query
@HamZa my bad , This \u00c2\u00a0
 
12:19 PM
@Joseph Seems to be documented "commonly abbreviated as NBSP": fileformat.info/info/unicode/char/00a0/index.htm
If you want to change that, then a simple str_replace would work.
if it's for displaying purposes. I wouldn't bother much
 
@HamZa no it's for quarrying the DB
querying *
 
@Joseph the context is a bit missing for me. I hope you got your answer now...
 
Anonymous
produce a simple code example, with result and expected result.
 
i think you answer is more then enough :) thank you
 
@Joseph I just tested it and it works...
 
12:23 PM
@StephenWolfe On a POSIX OS, it means someone did kill -9 on the process (or in some other way send a SIGKILL). Exit codes >138 should be reserved for processes that terminated because of a signal, where the exit code is 128 + $signalNo. SIGKILL = 9 so when you kill a process that way it should exit with 128 + 9 = 137.
In the case of 3v4l, that probably means the script was taking too long to execute
 
@DaveRandom thanks
@Joseph
<?php

$str = '%List&nbsp;of%';

echo html_entity_decode($str);

This works.
 
ffs
That should read ">128"
 
@HamZa @samaYo @StephenWolfe the funny thing is that when i output the value with decoding it, it prints List&nbsp;of, after using html_entity_decode($str); it returns null, so i go and use html_entity_decode($str, ENT_COMPAT, 'UTF-8'); and this result in this List\u00c2\u00a0of
I'd say weird
i agree 100 % with you @StephenWolfe, html_entity_decode($str); should suffice , only it doesn't
i must be missing something
 
show us ur code
 
past bin ?
 
12:27 PM
If you have utf8 characters then the second code is the way to go IMHO
 
@DaveRandom Where have you learned that? Just curious, book? tutorial?
 
i do have UTF-8 chars and i am using the second way
@StephenWolfe pastebin.com/VL72v6kE
 
@Joseph can u pastebin the jason data
 
sure
actually i can do it here , it's not that big for my example
{"groupOp":"AND","rules":[{"field":"3","op":"cn","data":"List&nbsp;of"}]}
 
12:37 PM
@Joseph where is the value of $filter->data;
ahh
one sec
 
maybe i should send the data not encoded thru the post request
 
its works ...?
 
maybe it's this json decode, i am not using php's json decode function because it doesn't exist in the version which i am running, in stead i am using a library to emulate it
let me test
 
"because it doesn't exist in the version which i am running"
O.o
 
It doesn't exist in your version? That doesn't sound good
 
12:43 PM
@HamZa Dunno, known it for ages, it'll be well documented on the internet
 
Yikes. That means 5.1 or earlier
 
@PeeHaa lol
@DaveRandom I see
 
yes indeed < 5.1
 
@Joseph you got bigger problems than I thought
 
12:45 PM
it's not by choice that i have this version, it's my employees ...
 
@Joseph your employees?
@Joseph tell them to migrate then
 
@StephenWolfe I am assuming it's a typo and he means employers
 
@Machavity :P
 
If he really means employees I think we're done trying to help him :P
 
12:48 PM
lol
 
since when this forum has become an English course ?
 
@Joseph Also you should read this blog post
@Joseph Look, we don't criticize grammar all that much but you can't use some words interchangeably. Employees != Employers
 
hi, anyone knows about twitter card
 
@StephenWolfe Employer's the right word
 
@Joseph is english not ur native language ?
 
12:55 PM
no it isn't
 
Okay makes sense now
 
not that i don't know the difference between and employer and his employees ...
 
nor the difference between an and and :P
 
TYPO
:D
 
@Joseph Does your employer leave his doors unlocked at night?
 
12:59 PM
twitter card
 

« first day (1663 days earlier)      last day (3278 days later) »