« first day (1701 days earlier)      last day (3473 days later) » 
00:00 - 22:0022:00 - 00:00

00:07
Hi
How would I go about not caring about case sensitivity using regex?
Example: if (preg_match('~\b(?:one|1)\b~', $test))
00:40
@RahulKhosla add the option i at the end of the regex.
~\b(?:one|1)\b~i
@Trowski Genius! I've been trying /~b(?:one|1)\b~/i
Thanks! :)
@RahulKhosla ~ is the delimiter for that regex.
/ is more commonly used, so you could change it to /\b(?:one|1)\b/i
Doesn't really matter though ...
Ok, thanks, I'll keep that in mind when using Regex
@Trowski is there any way I can add plurals using it? ~\b(?:project|work)\b~i so I don't have to use project, projects, work, works?
~\b(?:projects?|works?)\b~i
? means the last character is optional.
Great! @Trowski Thank you!
Whilst I have you here, any chance you could spare a few mins with something I've been struggling to grasp the idea of? Basically I have an input, set to post, when the user types anything, it displays the user input, and then a message accordingly (using regex). And then the user can type another message in the same input.
Everything seems to work fine, thanks to you with the regex. But when I type a new message, the old one disappears?
01:01
Oops forgot to tag name @Trowski.
@RahulKhosla HTML form input?
@RahulKhosla You'll have to echo the message as the value of the input element.
@Trowski Aren't I already? Example: echo '<br />'.$about;
That shows it on the page, but if you want it in the form field you'll have to set the entered text to the value attribute on the input element.
01:08
@Trowski I kind of get how you mean, could you give me a quick example with that code I supplied? Just not sure how I'd go around that.
Because what I see is:
$test = htmlentities($_POST['test']);
echo "<span class='you'>".$name."</span>: ".$test;

Is already echoing the users input, no idea why it would change when a new input is added as it's already been echo'd?
01:36
@rdlowrey Possibly; I wasn't home.
I can verify that RIGHT NOW my son is watching Thomas the Tank Engine.
@LeviMorrison chrome … 50% … yeah looks like ^^
I'll retry when nobody is using it ;-D
02:12
@bwoebi Now is good.
@LeviMorrison well, you just switched user
but chrome is still CPU heavy^^
@bwoebi It will be closed momentarily ^^
now you logged out, right?
@bwoebi Yep – I am on another machine.
Do note that I have observed highly variable performance in the past due to CPU throttling. I have never investigated it because I've been too busy.
@LeviMorrison that may be a valid excuse… but that's weird.
02:18
Not really. It's simple: if the CPU is running too hot then it needs to slow down so it down-clocks.
We see it in HPC sometimes.
when I do a million requests… I get a 9-12k req/s … when I do 100k requests I get up to 5 times more speed
@LeviMorrison I mean… CPU gets 80% slower… Really that much throttling?!
@bwoebi If it is temperature related yes, that would be a possibility.
yeah, temperature is currently 72°C…
@bwoebi I have verified that they are definitely downclocked to 1.6GHz
I actually have a spare moment and can look into it.
67°C…
slowly cools down…
02:25
Some of the cores are back up to expected; others not.
02:35
@LeviMorrison reading current cpu frequency requires root o_O
(and why do your ssh connections time out that quickly :x:x:x)
@bwoebi Which is not even considered "high"
(High is 80°C)
@LeviMorrison and what's low?
for me low is under 50°C
I'm not sure about low.
My tool is only reporting high and critical
critical is … above 105°C?
98 in this case
02:41
@LeviMorrison what's current frequency?
 3697.765
 3547.289
 3717.023
 3115.250
 3701.617
 2767.546
 1718.859
 3755.273
That's frequency per core
okay, getting an 51k req/s just now
Are you controlling the number of workers by chance?
If so, how many are you using?
Try fewer
02:46
Using 4 workers…
doesn't make it better.
(I just get about the same … yeah…hyperthreading.)
@bwoebi Try 2, 6, 12, 18 and 32
@LeviMorrison but usually there should be no CPU throttling for like 100k requests… which should take less than 2 sec.
2 … 7.2, 7.5
6 … 2.4, 8.3
12 … 3.4, 1.8
18 … 2.8, 3.6
32 … 1.9, 1.9
@LeviMorrison worker count and then 2 runs each with 100k requests (time to complete in sec)
@LeviMorrison as long as I have more than 4 workers (all CPUs), it's rather a game of luck if you get fast or slow ^^
03:09
I'm not sure how to stabilize it more at this point.
It's running a lot of different daemons and services – turning some off may help but it's uncertain.
I can see that stuff throttles but
as far as I can tell it's well within temperature parameters.
yeah, it throttles early… why…
ab is showing in steps of one tenth… I always see that a part of the requests is coming faster than other parts.
@bwoebi There are sometimes BIOS settings for this stuff
I can try altering them; that okay?
yeah, if you know what you're doing ;-)
^^
@rdlowrey I'm shutting down to try some BIOS settings.
@LeviMorrison he's anyway not here right now^^
03:25
@bwoebi The BIOS is reporting much higher temperatures than the CPUs were.
87 C
uh okay?! … why aren't these in sync?!
I am unsure.
What would be the estimated cost of chat application in quikr.com website
@LeviMorrison do u know
?
@Cody Please do not ping people into your conversation like that.
And no, I do not know.
sorry
03:28
@bwoebi It's not dropping. It seems to idle at that temperature.
@LeviMorrison sure it's 87 °C and not like °F?^^ … at least when being in BIOS only mode 87°F sound reasonable…
Definitely Celsius.
o_O
Hmm.
I guess I will order thermal paste and try removing, cleaning and then re-applying the cooler.
As long as it's not just some dust…
03:34
This is quite alarming, actually.
It did not used to do this.
I am going to open it up, blow the dust out and look around for any visible signs of damage.
intel or amd ?
is it overclocked ?
what is the load ?
.. it could be that the heat sensor just has died
@tereško Effectively zero load (in bios) it reports 87. In windows I see reports for 91. The reports in Linux were lower but still high.
@tereško load was nearly none… I was benchmarking in short bursts of few seconds.
It is an Intel processor that is not overclocked.
intel chips can survive up to 105°C in general .. but that's not recommended
03:40
@tereško actually, more than 105… Just fan usually prevents more.
But they can even get up to 115°C usually… but not much more.
@tereško It's throttling the CPU down to like 1600MHz (it's a 3.4GHz processor)
So it's perhaps not damaged but I'm not getting my money's value.
since I seem to have missed most of the convo: are we talking about a new desktop chip here?
No – I think it is roughly 3 years old
Can't remember exactly when it was purchased.
and the cooler's fan is working, right ?
do you have any other temp sensors that can verify that the reading that you get is true?
@tereško even if it weren't working, you'd not have 87°C in totally idle mode in BIOS…
03:47
15 mins ago, by Levi Morrison
I guess I will order thermal paste and try removing, cleaning and then re-applying the cooler.
in worst case, if you have to get a new CPU, you will have nice new thermal compound to use when installing it
;)
 
1 hour later…
04:59
@tereško Sadly no
Interestingly I have cleaned off the thermal paste from both the heat sink and the processor and the BIOS temperature was good.
So I booted.
Temperatures have remained low.
lol
did I got it right: you are running right now with no cooler ?
05:28
@LeviMorrison Hmm, why is ssh not working?
 
3 hours later…
08:24
Morning
Don't feel bad about a downvote on a PHP answer. If you do find out that your cat did it, buy it some treats. — Martin James yesterday
:D
09:26
Morning
Mornings o/
Can we please rename the Throwable interface to ItDoesntWork. That would be semantically fine for Errors and Exceptions and it's what we get in error reports anyway ;)
Hey, you guys tend to be good with uniccode and specifying stuff. I'm terrible at it - if you know the difference between code points and code units and got a few minuts to help I'd love some assistance
09:42
A Unicode code unit is a bit size used by a particular Unicode encoding.
For example UTF-8 has a code unit size of 8 bits and UTF-16 has 16
and UTF-32 has 32.
To represent a character (i.e. a code point, which is a Unique integer assigned
to each character) one or many code units may be
required depending on the encoding.

Java uses UTF-16 and this means the code unit size is 16 bits.
Unicode has over 1 million code points (10FFFF+1 in hex).
16 bits can represents only FFFF+1 code points.
(This range is called the BMP (Basic Multilingual Plane.
It's on the internet so it must be true and accurate..
I read what it is, I need help from someone whose experience with unicode is better than reading one or two tutorials.
So....you didn't post your actual question?
"In particular, when you create the result string the elements must be code units" - presumably they actually meant that "In particular, when you create the result string the elements must form code points, from the code units".....which you've already covered by only handling code points in the first place.
@DaveRandom Hey man, I'm at download :-) what's up
09:59
@Danack "they" is Mozilla's Allen Wirfs-Brock, which is a pretty smart guy.
 
2 hours later…
12:16
hi everyone, anyone can help on tinymce issue?
I need to get the value sent via execCommand function
What do you mean? You are trying to capture the execcommand call?
that's my code, I'm trying to print the values passed on the popup window
I can only print 'attr' because it's been passed as url params
Well in that case I am sorry I don't know what wptabsy is and looking at the prefix I'm not sure I want to :)
I just need to know how to access the variables passed
via execCommand
Monkey patch it
12:23
what do you mean by that? :/
good mornings all
good morning ;)
user924016
MOooooooooooornings
@JeffreyCarandang var tmp = window.execCommand; window.execCommand = function() { // do your stuff tmp.apply(this, arguments); }
But I doubt that is your actual question
Hey @iroegbu @RonniSkansing o/
user924016
yoyo =]
12:26
I don't really get it sorry :(
I just need to pass values from tinymce image atts to popup
Pass it how? With what goal?
How will you retrieve it?
What will you do with it?
on image double click, a tinymce iframe popup will open. I need to pass value to that popup
Well it sounds like that wptabsy thing whatever it is already has access to it, becayse you set the content to it
yeah, but I need to know how can I print those contents
12:42
Ok I will try it one last time. What is it exactly what you are trying to do?
And please be specific
Access the contents passed through tinymce execCommand to the popup window
here : generatewp.com/take-shortcodes-ultimate-level/#comment-3629 . I hope you know wordpress editor ;)
Access from where?
the popup will show on image double click, which has the values I need to pass to popup
editor.addCommand('bs3_panel_popup', function(ui, v) {
    //setup defaults
    var header = '';
    if (v.header)
        header = v.header;
Isn't that what you want?
Only in your case it is not header, but value
no this one
editor.on('DblClick',function(e) {
the functions on the dblclick
I need to pass the image attributes to popup
12:53
That's what you are already doing , because you are passing it as the 3rd param to execCommand
oh! I get it
The problem is editor.windowManager.open
on how to pass the parameters without adding the values to the url
13:20
anyone remember that website that is a guide of how to write/deploy 'modern' apps - e.g. single code base/multiple deployments. Something like "15 steps"....
PHP 7 will be better than many other languages http://marclabs.com/en/php-7-will-be-better-than-many-other-languages/ #php #php7
wah
@Sherif stahp.
I don't think PHP is a bad language - but so many of it's developers are....
I'm not sure how much people realize this, but I have bench marks dating back to PHP 5.2 that demonstrate how poorly Python and Ruby perform by comparison to the same computational work in PHP. Wonder why everyone thinks PHP is only improving as of 7.
Honestly, Ruby and Python are on the lowest end of the spectrum. I compared a benchmark of PHP to Play (Scala) and PHP still kicked the ass out of Scala.
I love it when the Java guys tempt me with performance though. If it's slow it must be slow because PHP sucks, not because my code sucks :)
@Sherif Imo, mostly because of Symfony and Zend are architected in a way that means that it is non-trivial to write an application that has a response time of less 500ms with them.
And the solution to that isn't just to make PHP faster, but to make the web sapi suck less....
@Danack Yea well that's the "your code sucks" part now isn't it
When a "Hello World" comparison between Scala and PHP shows that PHP is an order of magnitude faster than Scala that says something.
It says the language isn't what's slowing you down. So go fix your crappy code.
13:37
@Sherif you still have link to those?
@iroegbu Unfortunately no. Thanks to stupid linode I lost everything on my vps.
Though you could try to port PHP's benchmark.php to Python and Ruby yourself and compare that :)
okay... thanks
13:54
Hey guys.
/^[a-zA-Z0-9]+$/
I have that regex.
How do I allow spaces along with alphanumerics?
is this correct for making context menu popups in javasript i'am having problems with this
$('#but1').click(function(){
var _div = $('#popDiv');
var _bum = $('#but1');
alert(document.getElementById("popDiv").style.display);
if (document.getElementById("popDiv").style.display == "block") {
document.getElementById("popDiv").style.display = "none";
} else {
document.getElementById("popDiv").style.display = "block";
}

$(document).mouseup(function (e) {
if (!_div.is(e.target) && !_bum.is(e.target) && _div.has(e.target).length === 0) {
document.getElementById("popDiv").style.display = "none";
reclicking the button doesent hide the context menu.
@HassanAlthaf just add space /^[a-zA-Z0-9 ]+$/
49
A: regular expression to allow spaces between words

Andrew Cheongtl;dr... Just add a space in your character class! ^[a-zA-Z0-9_ ]*$   Now, if you really want to be strict... As commented, due to the fact that * means zero or more, all the following are allowed: An empty string, "". A string comprised entirely of spaces, "      ". A string that leads...

JavaScript

Topic: Anything JavaScript, ECMAScript including Node, React, ...
also, use pastebin.com if you want to show code
oh iam sorry wrong group :(
@iroegbu Thanks but I already solved it with \s
hmm ... should I buy Fallen Enchantress ?
14:13
@Leigh Which error is thrown if random_bytes couldn't succeed due to sufficient source of randomness not being available?
14:23
Wooo
simply cant wait
14:58
@kelunik false. But I've never seen that happen…
The only situation where this may happen is like a badly set up chroot jail…
15:11
do you know why C's vector when it's filled always doubles its capacity?
why double the capacity and not just, say, add the initial capacity?
$v = new Vector(10);
// ...
$v[11] = 1; // realloc, capacity is now 20
// ...
$v[21] = 1; // realloc, capacity is now 40 (why not 30, instead?)
Because reallocs are really expensive?
And memory is cheap.
ok, makes sense
15:33
@bwoebi Hmmm, RFC says "throws error".
Hey everyone
Hey @TaimurAyaz
Need some help over here
I want to use php and if my url is accessed by android show X, if it is accessed by iOS or Desktop show Y. where X and Y are some xml files
And what is the question?
Lol
How can I do it?
I don't know how to code in php?
15:38
What is the problem in specific? Serve the xml? Differentiate between android and ios? Open your editor?
For example when someone enter into my website I want to know if he is using android or IOS or Desktop then based on his platform a string variable will be stored in a xml file with time and date
You could check user agent string
@Worf It's not always done like that
Always adding a fixed amount it also used as the allocation strategy in some cases
I want to use a goto in PHP ... something about that feels wrong.
@kelunik no idea, just checked source^^
15:48
But linear growth is normally only used if you know that you'll be growing very rarely
@kelunik It throws a warning and returns false
I would not check for it
It can't happen
If it happens then your setup is f*d up
yeah… and then you likely have other issues anyway^^
@NikiC linear growth means?
@Trowski Obligatory: xkcd.com/292
@Worf Adding a fixed amount
@AllenJB heh, yeah. I can use a do { ... } while, but the loop condition would be unnecessary.
15:52
@NikiC which means? :D i apologize for my lack of minimal knownledge :P
@Worf An example: Smart strings in PHP start with size ~256 and then grow in ~4096 increments
is that done automatically? or you write ->addCapacity(4096) ? because otherwise it would do currentCapacity*2?
@Worf automatically
@Worf Nothing is automatic
@Worf it's internally always doing a check if it needs to realloc
15:56
and is this part of the C's standard vector class? or it's a peculiarity of php?
@Worf C has no classes and no vectors
@Worf there's no Vector class in C… only C++ … and it's PHP specific.
uh? what the hell i am reading then :D
@NikiC automatic depends on the PoV ;-) When you look from the outside at it, it happens "automatically" … from the inside, obviously not…
@Worf Whatever it is, it's not about C
15:58
yeah it's c++
@PeeHaa thanks for your help i was asking for my friend and he just made it work himself
i'm just random reading because i'm extending SPLFixedArray to do automatic resize, but i don't really know what it should do @NikiC
@Worf Double the size
Though I feel that would kinda conflict with the fixed part ^^
splfixedarray can be resized already, but it's not done automatically
heh
16:03
was being curious tho. i'm gonna use it for immutable stuff mainly, so no need to resize at all
btw, what would you suggest to avoid using intermediate arrays for to fill splfixedarray? are there some cases i can optimize, maybe using variadics, generators?
is there anyway to test my simple php website without having to use apache webserver? I can't get it to work for the life of me..
@bwoebi It's not up atm.
@JoeSmith Use php's built in webserver
16:21
HI ALL!
I have problem with Codeigniter
I need to load requested url and if in the end of this url is abbreviature of any languages, whitch I have enabled,
I need to add this languages info in sessions and then call controllers without this abbreviature.
So I created application/core/MY_Router.php and in this file is this code: http://codepad.org/dXNtI2bt
Now I need to load this Core class before controllers.
I search in google but nothing found.
can anyone help me?
@bwoebi Since I have removed the thermal paste I need to monitor it really closely and I'm not home at present.
@LeviMorrison the exchange of heat between the cpu and the heatsink happens anyway, it's just slightly efficient. i wouldn't worry much as long you didn't left the computer bruteforcing @PeeHaa's porn passwords
@Worf The whole reason Bob wants to use it is for benchmarking stuff ^^
so it's not temporary? :P
@Worf can you help me?
16:30
@Worf lol. porn is behind passwords now?
lol
why did you remove the thermal paste anyway?
@shalvasoft i know nothing
@Worf because temperatures were way off in idling mode and CPU downclocked all the time, making it essentially useless for benchmarks.
16:53
so you did that on purpose to stress it? :P
17:29
@Worf no, haha
17:54
@JoeSmith There is a built in webserver but to be honest, that's only usable for really light testing. For actual dev work, just using vagrant and automating the setup of your webserver + php is a far better strategy.
yo, anyone here know much about woocommerce?
Just tried their Free template..:) That all.
ahh ok, trying to do something kinda custom - wandered if anyone had an idea about the best way to implement :D
18:35
1
Q: Storing the last input text whilst using the POST method with PHP

RahulThe idea: I have been trying to create a one-way chat system based on predictions from the user, using pre-set automatic responses through the server side. The problem: What I have so far works great, although the problem I have now is that I can't store the last user inputted message locally ...

@Rahul You already got a good answer. You have to store it either on the client (just appending new stuff through ajax) or the server (session, db, file, whatever).
@kelunik No other way apart from sessions / storing?
@Rahul How do you want to persist messages if you don't store them somewhere?
@kelunik An array of answers?
@Rahul If you're using the web sapi, every request will be a separate process, so you can't have persistent objects without storing them somewhere.
18:44
@kelunik So could I append them to an array, and each question would have the answer of $test[1], $test[2], …?
@Rahul No, because your array will be gone in the next request with the second question. You have to persist it somewhere outside of variables in your script.
@kelunik Oh ok, so your best bet is Ajax too?
Depends. If you just want them to be there until the user browses away, ajax would be fine. If you want to persist them forever, store question + answer server side.
@kelunik, no just until the user closes the window.
Everyone can have access to it, do individual sessions I guess, until the user closes the page.
In that case, ajax or sessions will be fine.
18:48
Sessions from PHP?
Yes.
But if you don't need anything else, I'd go with ajax, because you don't have to store anything on the server then.
@kelunik I'm totaly new to JS/AJAX, I only know basics of PHP so I guess I've reached an wall, so I'll probably use PHP?
@kelunik I tried Ajax and got this far: pastebin.com/JwhSRh1Z any ideas on what I'm doing wrong?
@Rahul If you want to use jQuery, you have to include it into your HTML.
I have in header
And you have to catch the submit event for that form. You want to do your ajax request in that submit event handler.
19:02
Ok thanks, I'll see what I can do. Thanks for all your help :)
19:29
if i'm not wrong there was a way to get refcount in user space, is it? but i can't find it :|
yes, could be
thanks!
it looks to not be working anymore @Danack :P
> The add of "Call-time pass-by-reference" as E_DEPRECATED makes it impossible to get the real refcount without getting an error
what was trying to do is:
class CopyOnWriteWrapper implements Stuff{
    function __construct(Stuff $wrappedStuff){
        $this->stuff = $wrappedStuff;
    }
    function setSomething($something){
        if(refcount($this->stuff) != 1)
            $this->stuff = clone $this->stuff;
        else; // no need to clone, this instance holds the only reference to the instance
        $this->stuff->setSomething($something);
    }
}
@Worf oh god else;
I don't think I ever saw that one before
@NikiC i added else for the comment.
gawd!
!!historyChannelGuy PROGRAMMERS
okay, that else; is really golden, haha
19:36
it's for the comment!!!!!!
stop trolling pls :P
I can't help it, but I'm still laughing
anyway, is there a way to do that somehow?
@Worf Write else { /* */ } :)
@Worf Unless you're using references that does not matter
@Worf now, we're not leaking the refcount, sorry :-P … well… you could abuse debug_zval_dump()…
@bwoebi debug_zval_dump() seems to not print the count anymore
19:40
@Worf version and type of value?
@NikiC it's an object according to his example?
oh. i didn't try with objects :D php7 wait
@Worf ah, haha
object(stdClass)#1 (0) refcount(2){}
yeah it works with objects :D
what do you think of that anyway?
goto hell; … no, you really don't want to do that…
just always clone.
(and maybe check if you have already cloned)
19:45
what if it's big SplFixedArrays? :D i would avoid if possible cloning them, if it's not necessary
well, we obviously could make clone by ref, just like internally zval_copy_ctor ^^
@Worf just use a normal array :>
i was thinking that clone could do this optimization automatically
@Worf how could it? you have input and you have output?
clone doesn't know what you will do with the output…
if an instance having refcount = 1 is being clone;d then don't clone anything
idk?
yeah, you'll have two times the object then^^
doesn't work.
19:48
yeah :P
20:08
Morning.
 
1 hour later…
21:14
@LeviMorrison we forgot to stuff return types inside NEWS and UPGRADING ;)
when did packagist.org get a total revamp? it looks much better now.
Anonymous
@NikiC that blog did not solve my question. It was mostly how memory is handled in php6.5/7 .. my initial question was to know the memory footprint b/n functions, arrays, class ... in other words .. how much more memory is allocated to class that implements \ArrayAccess from one that does \FixedArray
Anonymous
Ok, off to bed ...
Anonymous
someone ping me if you have the answer
@marcio Couple days ago, but people have been worknig on it for more then a year
^^
@marcio yeah, old version indeed looked better… it had sharper contours … it's too flat now.
Flat design, okay. Too flat? go away!
@marcio (oh, I totally misread… it's better now?!? why?)
00:00 - 22:0022:00 - 00:00

« first day (1701 days earlier)      last day (3473 days later) »