« first day (1945 days earlier)      last day (3228 days later) » 

00:55
@PaulCrovella It'll be nice once we get a viable cosmic neutrino detector; we could see the CvB as well.
 
1 hour later…
02:02
yeezy yeezy yeezy just jumped over jumpman
 
1 hour later…
03:25
can someone help me on this:
0
Q: Get Page Name And Content From Wordpress Database

Jack SmithHow would I get page name and page content from a wordpress database I want to show it in separate PHP file that is not inside of wordpress folder? Thank You For All replies

IIRC, there's a posts table. name and content should be in there, or in some obviously-named linked table.
yeah, wp_posts. Everything you need is in there.
03:50
What would be the best way to secure a php page from any access other than a cron job?

if i pass in a token in the cron job to the php page and verify whether its the same token on my php page ?
04:48
0
Q: Get Page Name And Content From Wordpress Database

Jack SmithHow would I get page name and page content from a wordpress database I want to show it in separate PHP file that is not inside of wordpress folder? Thank You For All replies

05:04
hi
indeed @AnmolRaghuvanshiVersion1.0
05:37
_o/
06:22
does anyone know what kind of "json" or type the following content is: 42["message",{"message":"hello world!","sender":"you"}] - is this valid json or anything?
good morning
Good morning
Wes
Wes
06:33
btw, the revenant was a shit movie
06:51
hii!!
07:09
@Andrew I feel you have to reconsider your design.
Wes
Wes
@YourCommonSense why? cc @Andrew
running everything in a transaction is a good idea
Morning and happy Rebecca day!
@Gizmo Not sure, but if json_decode doesn't work you might wanna try unserialize();
If that's any help :P
07:46
@Gizmo is the "42" number part of the string?
07:57
@Epodax ah alright, thanks! and yes it's somehow part of it, but I can easily remove it, leaving the [ ] bracket thingy
08:08
moin
@Gizmo it's a valid json with "42" prepended to it. Depends on where did you get this
@nikita2206 Deep Thought. Turns out it had both the question and the answer, but it ran on PHP and they cast the output to int at the last step.
heh, so that's why it took so long for it to finish the calculation
Most of it was spent in do_fcall
08:17
any cakephp developer?
I'm a PHP developer and I like eating cake, does that count?
BTW I am finding difficulty to upload file in cake via move_uploaded_file()
Everything is file but move_uploaded_file always throws false
I thought Cake was long dead, anyway?
Ugh, apparently not
08:19
@YourCommonSense may I know why ?? or a wrapper is generally a bad idea ??
@DaveRandom I want to read csv file. For that i need to upload csv file first and i don't want to save it in database
Can i read csv file without uploading?
@vinaysingh Not without uploading, but you don't need to move_uploaded_file(), you only need to do that if you want to store the file that was uploaded, all you need to do is fopen() it, do whatever processing and then it will be automatically deleted when you request finishes processing
@PeeHaa @DaveRandom I know you guys want it
5
Actually fell for it
<3
hope you listened to it until the very last second
08:24
@DaveRandom you should "star" it
good mornings
@Wes well, in a way, everything is already run in transaction. Which gets committed after every query. Without any intervention on your part required.
@Andrew Well, speaking for a PDO, it's really hard to make it better while it's very easy to spoil its native features. Either way it depends. First of all do not confuse a PDO wrapper with a Query Builder, like many do. That's two different kinds of software. A query builder is a good thing but even harder to implement properly.
Wes
Wes
i'd only allow queries to be run inside transactions... unless you are planning to use storage engines that don't support them (why would you???)
Hi all
how can i parse the following json in PHP
{"result":{"0":["Adobe FrameMaker Document (.fm, .book)","application\/dca-rft"],"1":["Adobe Illustrator File (.ai)","application\/vnd.illustrator"],"2":["Adobe InDesign File (.indd)","application\/vnd.indesign"],"3":["Adobe Photoshop Document (.psd)","application\/vnd.photoshop"]}}
first of all it is valid json or not
@Wes But again - all your queries are already run in transactions. That gets autocommitted. You don't have to do anything special for this.
08:34
@Wes When you "strart" a transaction, you're actually stopping an autocommit. So, Strating transactions manually you will actually stoopping autocommit for the every query. I see very little sense in doing it.
Why not to start a transaction only when you have to run a couple of queries that have to be run in a single transaction?
@Vini json_decode()/json_error()
@DaveRandom thankyou. How can parse in PHP. i tried but json_decode
@YourCommonSense var_dump($ds_mime_type->result)
@YourCommonSense thanks for clarifying the difference between PDO wrapper and Query Builder :D, arh, so you mean the benefit gain from transaction only happens when grouping multiple query ??
it returns like array(1) { [0]=> object(stdClass)...}
@YourCommonSense
$json = '{"result":{"0":["Adobe FrameMaker Document (.fm, .book)","application\/dca-rft"],"1":["Adobe Illustrator File (.ai)","application\/vnd.illustrator"],"2":["Adobe InDesign File (.indd)","application\/vnd.indesign"],"3":["Adobe Photoshop Document (.psd)","application\/vnd.photoshop"]}}';
$decoded = json_decode($json, true);
var_dump($json, $json['result']);
foreach ($json['result'] as $pair) {
    list($type, $mime) = $pair;
    var_dump($type, $mime);
}
That JSON structure is terrible, by the way
08:41
grumble
morning
@DaveRandom NULL only return
Last night played Rocket League til 1am, don't want to go to work :(
@Andrew yes, exactly. That's what a transaction what for.
@Vini in his example, $json['result'] should be $decoded['result']
08:43
Morning 11
@Andrew Not just any multiple query, but such a pack of queries that have to be executed either all or none.
Wes
Wes
@YourCommonSense i know how transactions work :P i'm saying that you shouldn't allow programs to be designed around a weak api. if your code is bound to use autocommit and at some point you decide to run it into a transaction, you must be able to do that... that was my only advice
Wes
Wes
mornings all
@Leigh Oh yeh
S'ok bro, I got your back
@Wes But you were talking about wrapping every query run into [explicit] transaction? Or I took you wrong?
arhh, Unfortunately, not every database supports transactions, so PDO needs to run in what is known as "auto-commit" mode when you first open the connection. Auto-commit mode means that every query that you run has its own implicit transaction, if the database supports it, or no transaction if the database doesn't support transactions, so PDO will try to run transaction regardless ??
@Andrew "so PDO will run transaction regardless ??" - yes, If I took you right.
08:49
@DaveRandom Haha, nice. :) Not a bad song actually.
Wes
Wes
@YourCommonSense i'm saying that is a good rule. if you turn off autocommit transactions are terminated earlier, and that's important for performances
especially if row locks are involved..
@Andrew rule of the thumb. You need to hassle with explicit transaction only if there are several queries that have to be done in a single transaction. So in general you never mention transactions in your code. that's why I was surprised by your question.
@Wes Sorry I don't understand that your last message.
@nikita2206 a live chat website
@YourCommonSense thanks for clarifing :D I wasn't too understand what a transaction is so previously I explicit transaction regardlessly
So into this chat that I hit the windows key and started typing "room 11" before I realised what I was doing :P
Moin 11, have a kitty.
Cat shrug. https://t.co/0giMZMZmMV
08:58
@YourCommonSense looking forward to your tutorials :)
Wes
Wes
@YourCommonSense what happens if you do SELECT * FROM foo WHERE pid = 20 LOCK IN SHARE MODE with autocommit on? doesn't that lock the rows till a new query is run, or the connection is closed?
Happy fridai
Wes
Wes
@Sean +1 for making a twitter account for your cat. rofl :D
@Wes Isn't it the very purpose of locking?
Wes
Wes
@YourCommonSense yes, but you want the locks to be released asap
09:05
posted on February 12, 2016 by nlecointre

/* by ispuk */

moin mr random
sent that hours ago ...
moin all
morning :)
Guys, need some help replacing a value in an array for URL routing. Would love if you checked out this question. Been trying to use array_replace(), but can't get it working properly. Thanks in advance!
0
Q: Add language to array[0] if website language is selected, otherwise leave empty

Gjert Ingar GjersundI'm using this simple PHP URL router, and I want to implement multiple languages on my website. I want this to happen the following way English Version: www.example.com/en/about-us Norwegian Version: www.example.com/no/about-us Norwegian Version: www.example.com/about-us How can I make this ...

anyone know how to match this url with regex: i.imgur.com/WHATEVER.png
@KristianHareland What have you tried?
09:09
@KristianHareland /i\.imgur\.com\/WHATEVER\.png/
:P
@KristianHareland /.*/
#http://i.imgur.com/WHATEVER\.png#
Wes
Wes
@KristianHareland regex101.com/r/jP0xO4/1
oh you're a hash man, I'm generally a tidle man myself
Wes
Wes
09:10
@Leigh :P
@Leigh I actually am more of a parens kind of guy :)
friday
Wes
Wes
regex101.com/r/jP0xO4/3 forgot to escape \.
@JoeWatkins \o/
09:11
@Leigh lol #friday
Wes
Wes
dammit i need another coffee
What do you think about the following syntax people:
Hate it
Wes
Wes
it's terrible
struggling to start too @Wes
09:12
At least it's not using tabs
@PeeHaa your syntax is bad, and you should feel bad
!!regex /pattern/ [sample1, sample2, sample3, sample4, sample5]
?
@JoeWatkins lol
@PeeHaa Where samples is a set of thing to test whether expr matches?
Skip the regex keyword, and use regex to verify the next token is valid regex
09:13
stop for a minute while I prepare a dude, I heard you like regex meme @Leigh
the only place that regex won't look out of place is in a perl script ...
WTF /^((?:(?:[^?+*{}()[\]\\|]+|\\.|\[(?:\^?\\.|\^[^\\]|[^\\^])(?:[^\]\\]+|\\.)*\]|\((?:\?[‌​:=!]|\?<[=!]|\?>)?(?1)??\)|\(\?(?:R|[+-]?\d+)\))(?:(?:[?+*]|\{\d+(?:,\d*)?\})[?+]‌​?)?|\|)*)$/
Welcome to regex
it could even be a perl script ...
09:15
Please leave your sanity at the door.
@PeeHaa I foresee all sort of problems unless samples is required to be a valid JSON array (or something with rigid escaping rules), and I suspect that limitation would mean that !!regex /pattern/ sample where sample is separated from /pattern/ by one or more whitespace chars is the only sane thing to do
I've started to use extended mode quite a bit
TL;DR KISS
can @Jeeves go interactive ?
09:16
!! -a
nothin ... disappoint ...
Jeeves interactive mode should result in him inviting you to a room for you and Jeeves
Wes
Wes
i love this room
09:18
Hi chaps
yo @Damien
Ahoy there
Good morrow fine sir
I am fed up with KISS as a principle. We should come up with a new one. How about SMOOCH?
Look at that. The room is in such a good mood today
09:20
/me wonders if @Gordon came up with an acronym ahead of time or is now desperately trying to think of one
the latter
I'll go for S.L.O.B.B.E.R .. I'll think of a full version of that abbreviation later
and here we are, back to naming things
Anyways. A long shot question, but does anyone know -why- the readline library is not supported for windows?
SMOOCH = Simplicity must object oriented code have
09:21
Every resource I can find states that it is simply not supported, but my inquisitive mind desperately wants to know why
We didn't register my son's birth until the last day I was legally allowed to, and we were still deciding on the name in the car on the way to the registry office
Good for you Yoda :)
Wes
Wes
@Gordon and pronounce it as yoda would?
yeah, have to go with the zeitgeist, you know
@DaveRandom What happens when you pass that date? Does the government randomly generate a name for you? O.o
09:22
@Gordon I love it! It's got object oriented, it's got simplicity, it's got yoda, what else does one need?
SMOOCHY = SMOOCH ~ Yoda
@Sean I don't know. You get fined, probably.
@DaveRandom Your wife is a factory factory :x
You get an official Certificate Of Being A Bad Person Who Should Feel Bad in the post
09:24
@Leigh That was quick :)
@Damien no
Well I thought it was
I meant about readline
09:25
:)
Using PsySH in a project which is hosted on IIS+PHP.. works decent, but no tab completion without readline. Not deal breaking, but it got me curious.
as far as I can find out, there actually isn't a build of readline or libedit (the underlying libraries to readline ext) for windows, there are some "ports" of it, with different API's that are mostly incomplete, but we don't build against weird stuff when rolling releases for windows ...
tangent: I did some experiments trying to remove everything in the "ext" directory (because technically they should be optional), yea... I quit pretty quickly, some "extensions" are tightly coupled to core, especially date stuff
@Leigh --disable-all keeps ext/date?
is non-optional
09:31
@FlorianMargaine Not sure about exposing the classes etc., but routines from ext/date are used in core regardless
I basically wanted to know how much guts was really required to run the language, as a syntax without anything else
so is standard, reflection, pcre and maybe some others, can't remember ...
What's the point of the prototype pattern? I don't really understand this example
@Leigh it's quite a lot, everything from Zend/ and main/ and at least one sapi/[probably cli]
Zend on it's own is pretty useless
@JoeWatkins I found it quite interesting. These days there are not that many libraries left that are not supported on windows. (Aside from the obvious ones like POSIX)
@Sean I think it's saying, objects that are initialisation heavy can be cloned for improved performance
09:35
@Leigh Ah, right I get it. Thought there was something bigger I was missing
i got a question since i was a child .. WHAT IS ZEND in PHP??
Like, initialise up to point X, clone obj1 from X and finish specific init, clone obj2 from X and finish init
@GourabNag it's the php engine
ohhhh I get it now....
Thx Gourab. You made me feel old now. When I was a child PHP did not even exist.. to think of it, neither did the internet.
09:37
@Sean It's actually kind of relevant to something I'm working on at the moment. Custom AFL forkserver for fuzzing apps without having to go through the whole lex/parse/compile step each time
How much old are you @DamienOvereem ??
age is just a number, I'm still a child ... yesterday I bought superman shoes ...
For yourself of for your kids? :D
for me, and batman ones for the misses
You should not ask a lady her age Gourab!
09:38
hehehe
And age is definitely just a number... I tell all the 20 year old girls.. :x
are you FEMALE @DamienOvereem ????????????????????????????????????????????
Nope. That was just a random comment.
your name is a proof to that.. :P
@GourabNag That is the incorrect reaction to have, if he was, by the way
09:40
Got some budding manboobs though, so I -do- have some female features.
is it valid to call a function by replacing part of its name with a variable(that contains the same string it is replacing in the function's name)?
ie.
`$section = $_REQUEST['section'];
$id = intval($_REQUEST['id']);
$data = "echo $section"._data_id($conn, $id);`
valid !== sane
valid == yes .. + what leigh said :)
I tend to use call_user_func for that sort of thing though, just to make it a little less messy
ok - i dont know what call_user_func is - will read up on it
@AgniScribe are you going to eval($data); there?
09:42
shivers
was going through https://github.com/tpunt/PHP7-Reference PHP7 got some nice features.. !!
@leigh i would go on to call this: <?php echo $data[0]['title']; ?>
I want to send a PR to php/php-src doing an s/eval/evil/g...
urm ... nah ...
@Damien why the shivers
09:45
@AgniScribe Ok, well I don't think the code you supplied wouldn't even work, but seriously, don't use user input to directly call a function name
it doesn't look valid to me, and it doesn't matter whatever ... something can be so horrible that even though it will work, we call it wrong ... this is one of those times ...
PHP 6 was the major PHP version that never came to light. It was supposed to feature full support for Unicode in the core, but this effort was too ambitious .... dont really get why it was skipped...
@GourabNag It got to the point where nobody wanted to work on it.
ok - it's horrible - i'll get better - this is where it is at the moment
well ...
09:46
Ok, too few people
why was it turning into a mess ???? clash of ideas ???
it was more that it became apparent that it wasn't worth working on ... adding unicode support adds complexity to any application and changes the requirements with regard to resource consumption ... unicode was added on top of PHP 5, an extremely inefficient engine that I'd like to forget happened, unicode on top totally ruined the performance of PHP, it could never have replaced PHP 5 ...
i see.........................
so is there unicode support in PHP7?
09:49
"support"
but, PHP 7 is a sensible starting place for adding it ... it'll still cost ... but it won't have the impact it had on 5
internal data structures don't care about unicode, but you can still work with unicode using specific extensions
ohhkay!
yeah it has the same support it always had, but not what was attempted for 6
also, someone may have written a unicode string class ...
someone like you
09:52
mmm ... that works, but I don't think it the best solution any more ... I think we probably should pursue native support
@AgniScribe Using any form user input in variable function names is pretty scary security wise, to say the least. I'm quite sure in your situation that $section does not represent an unlimited number of options. You probably have a way to validate $section (ie. by checking in your database if the giving section exist.
Event Date	Event Time	Event Detail	Event City
2/12/2016	12:19 AM	In Sorting Facility	UNITED KINGDOM
PHP 6 apparel
If sections is limited to say 5 options.. it would be better to not use a variable function name, but to check if $_REQUEST['section'] matches any of those options and use the appropriate function when it does.
@Leigh w00t
@Leight PHP 6 apparel? .. That should be worth its weight in gold somewhere in the future ;p
Can Haz t-shirt? :)
09:55
madeinproduction.com @Damien
@Damien - thnks - have begun doing that
I got php6 and respect hoodies ... they're not too bad, could be warmer ...
> D:\Projects>php -r "foreach (glob('./*', GLOB_ONLYDIR) as $dir) passthru('cd ' . $dir . ' && git add --all && git commit -m refactoring && git push && cd ..');"
I am a bad person
@DaveRandom agree
Thinking i should get me a tshirt
09:58
Doesn't matter much, I knew there were 6 projects with changes, all not on master, and all of which I will squash before merge, but I forgot to check in last night and I'm lazy
BTW does<=> really look like a spaceship??
Depends which planet you're on
On Kronos they call it the bat'leth operator
Holy crap, why is it even legal to make shit like etsy.com/uk/listing/259414245/latest-klingon-batleth, let alone sell it to idiots on the internet
@DaveRandom for f in $(find . -type d -maxdepth 1); do (cd $f; git commit -am refactoring; git push); done
I love the parentheses in bash for this kind of thing
@FlorianMargaine Even the most retarded bits of bash are better than the best bits of cmd
@DaveRandom Because knives are ok to sell too? Even to idiots. If you omit the idiots you can only sell to roughly 5% of the human population.
10:12
@DamienOvereem because only 95% of the population are idiots?
Idiots with knives
> Before you criticise a man, walk a mile in his shoes. That way, when you criticise him you're a mile away, and you have got his shoes.
13
@DaveRandom lol
Looks like the blades are blunted anyway
githubs import tool is slower than clone / remote / push :x
Not as blunt as I'd be safe around, but not sharp
10:19
@Florian Am I being too generous?
morning, sci-hub.io
@DamienOvereem in my personal opinion, not at all. I think it's more like 5% of the population are idiots.
Hm interesting, didn't know the internals book was published officially php-src.github.io
14
Anyone please help me in acumatica soap api
Anonymous
10:30
@Leigh damn you
Buu..... Buttttt WHY @Leigh ??? php-src.github.io
@GourabNag First friday in Room 11?
welcome :)
:-//////
10:32
never click links on friday
ok LOL!
You guys should write that in her - room-11.github.io
0
Q: How to update sales orders in acumatica using API

Vishal KamalI'm not able to update my sales orders in acumatica using SOAP API. Whenever i try to save with ORDERNBR it's save new order. This is my code: $Customer = new Value(); $Customer->Value = 'C000006';//$data['Customer']; $Customer->FieldName = 'CustomerID'; $Customer->Objec...

nah, it's funnier if people fall for it, and the friday video keeps getting hits ...
The amount of amusement she's given us, she deserves the hits to be honest
even though I told you, you'll still click links on fridays ...
10:38
I guess self-destruction options had < 15secs
10:49
I think I'm gonna move to linux... Enough of Windows... a Simple IMAP extension for PHP cannot be used...!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@DaveRandom yes
@GourabNag I advocate developing in the environment you intend to deploy to
@PeeHaa Then definitely see next reply
yeah.. I usually deploy in azure...
@DaveRandom So only allow a single sample?
@GourabNag That should have been a friday link :P
10:52
yes... =)
@PeeHaa Well, maybe you could allow multi input, but it would have to have a constraint on it (either "must be valid JSON array of strings" or "input strings cannot contain , or ]" probably). I'd say that by default it should look for single input string, probably the multi-input would need to be a different command (what if my input string is "[a, b, c, d, e]"?)
!!regex /foo/ foo bar
<-- foo
just a quick suggestion... Linux Mint or Ubuntu??
Yeah you are probably right. It is the easiest
@PeeHaa To sum it up in four words: too many edge cases
Yea you iz rite
10:55
I want !!s/expr/replace/ like caprica does anyway :-P
@DaveRandom Yea, but that is more fun than useful :P
E_FRIDAY
Feel free to implement it though if you want it :D
...and that's the end of my useful work today :-P
10:57
stackoverflow.com/questions/35360466/… LoL the answer recieved two downvotes as soon as it was posted.. :P
morning
Morgen @kelunik

« first day (1945 days earlier)      last day (3228 days later) »