« first day (1780 days earlier)      last day (3158 days later) » 

8:00 AM
Does anybody have any idea how to get GMP working in MAMP -_-
 
What version of PHP? It's bundled with 5.5 I believe.
 
5.6.10, and MAMP comes with precompiled PHP which doesn't include it :/
 
I know nothing about MAMP, but maybe this will help jellystyle.com/2012/12/installing-php-extensions-with-mamp
 
GMP isn't in pecl
I think it actually has to be compiled with PHP.
 
Sure it's bundled now, but you can still download the php-src or fork from git and compile it yourself.
Just about the same thing really.
 
8:04 AM
I dunno the answer, but I'll bet it is less difficult to learn how to build your own stack than it is to solve the problem ...
 
Compiling PHP is pretty trivial, really.
 
Let me try getting a fresh 5.6.12 PHP install going in MAMP with GMP. Just figured I'd quickly ask before I did.
 
@JoeWatkins Which keynote was this?
 
I think phpnw talk last year, it was about community ... I never considered that something that seems hostile is probably still trying to say something, and it's worth trying to work out what is being said ...
 
@JoeWatkins Ahh, yea gotchya :)
This is so true. It took me years to grasp this point.
You see, I have this theory that every developer is like a pot on the stove and eventually they hit a boiling point, but after that boiling point things start to settle down and you finally get it.
 
8:11 AM
many of them never hit the boiling point though :P
I hope I'm not being hostile right now
 
They all do eventually. It just takes some longer than others. My theory is based on the assumption that you go from a stagnate state to volatility. If you're already in a pretty volatile environment, chances are you learn how to deal with hostile members of the community more quickly.
When you're in a very stagnate environment, you really don't see the difference between hostile and friendly. You think one is a threat and the other is the norm. Sometimes it takes chaos to breed innovation and as crazy as that sounds it's sometimes necessary to just embrace it and try to extract value, since it's probably going to happen anyway.
 
I have this code I want to get json output
mysql_query("SET NAMES 'utf8'");
$result = mysql_query("SELECT * from test.services");
$rows = array();
while($row = mysql_fetch_array($result))
  {
        echo $row['2'];
    }
 
@JavaFan json_encode?
 
@JavaFan echo json_encode($row[2]);
 
okay
 
8:26 AM
You also might want to stop using mysql_* now. It's only been deprecated for about 2 years.
I think you've had just a tiny bit of warning.
 
I am using an old verion of MYSQL
 
So?
You're actually giving yourself more reasons to upgrade.
Anytime you're actually looking for a reason to respond to "why are you using code that is no longer maintained" you're basically just digging your own grave.
 
@MarcelBurkhard when using json_encode they displayed as Unicode if they were Varchar
 
Best to just get out of the hole and start living above ground.
 
@JavaFan change connection encoding or use either uft8_encode oder utf8_decode or be more specific what the issue is
@Sherif he's been here before, thus I assume he knows about PDO and choose to ignore it
 
8:31 AM
they displayed like \u0633\u064a\u0627\u0631
 
@MarcelBurkhard It's about the time that you've gotten tired of saying it that people are usually just starting to get it ;)
 
@JavaFan that's fine, javascript will display it correctly (AFAIK)
@Sherif that might be true, but I got other things to do right now ..
 
Yea, well I didn't ask you to do it.
 
@MarcelBurkhard Later I want tot parse it with android how they should displayed correctly then?
 
If you have time to tell me he's heard it before you have time to tell him again, anyway.
 
8:43 AM
@JavaFan
console.log("\u0633\u064a\u0627\u0631");
VM2624:2 سيار
 
@MarcelBurkhard console.log in what language?
 
@JavaFan Use a JSON parser that conforms to the spec. Have you tried this and had a problem, or are you just guessing that it's not right?
 
@PaulCrovella I used json_encode
 
that has nothing to do with what I asked. Have you actually had a problem decoding this on android using a proper JSON parser or are you just guessing that it won't work?
 
no I just guessing
 
8:54 AM
stop doing that
 
ThW
Morning
 
morning
 
@JavaFan console.log is javascript by the way... what I meant to say is it should work fine (as a said before here: chat.stackoverflow.com/transcript/message/25410918#25410918)
 
morning
 
morenin
 
9:07 AM
Good morning. Noob php question for you. I've got an application that is a form with one question, and when the form is submitted the answer updates a database table (form.php). Then a function is called that writes the database table into JSON (function defined in toJson.php). The user stays on index.php the whole time. There is a data visualisation based on the JSON that sits on index.php. Unless I manually refresh the page, the JSON isn't updated.
I’m trying to get it so that when the user clicks submit, the visualization (based on the JSON) is updated automatically. Do you know what I’m doing wrong?
 
morning alll
 
ThW
9:20 AM
@user2694168 No, you need to debug the Javascript and requests using the browsers developer tools.
 
Morning Thomas
 
morning ;)
 
looking today for some advice to php webhook coding. I have used plenty but cant find a guide for php to write one
need to refactor a legacy api thats broken and does a bunch of stuff at the moment, and prob should not
 
good mornin
 
morning
 
9:32 AM
I have a slight problem with blacklists.. I have a blacklist of strings (10 digits each) and have to search through them fast. Currently they're stored in postgres (indexes present). The problem is that there's 93 millions of rows and it's slow. What are better ways to search through that amount of data?
 
It has multiple curl calls and possible return status in the payment script, just trying to look at the code and decide if it should be multiple scripts. One to log the data and one or more to process and then return to the other api.
to help maybe someone could explain Return objects too me, in relation to Guzzle

Are these just to log what you have been returned or to formulate an object you return to someone else. The docs were not clear.
 
@SergeyTelshevsky that's really vague description
 
@SergeyTelshevsky what do you need to check them for? Every request or some form submit?
 
@tereško what kind of info can I add to it?
 
I guess the more you add to the memory and not look up in db on disk the better.
 
9:36 AM
@tristanbailey aproximately every time client gets registered, that's about 10k times a day
 
what exactly is contained in the blacklist?
 
Maybe riak would be faster key value store and search or memcached?
 
@tereško as I have said, a string of 10 digits
 
otherwise maybe sort of sharding it
 
I'm thinking about memcaching it (it's about 1.2gb large)
 
9:38 AM
@SergeyTelshevsky why are you not storing a real number?
 
so sort the digits in order and put batches together that are the same, then you could at least break it down to Millions or less, but I am not sure that would be faster than a db
 
@tereško 2 mins ago I would answer because it's not an integer, but now I can say it is really just a integer..
 
well ... searching number is faster than searching a string
 
Have a look at what sort of index is on your column, and yes what field type.
 
yeah, just thought of that.. haven't thought of it because a week ago it could consist of a-z characters too
 
9:42 AM
I think you have your solution
 
For example if the field 10 max, make the field similar and also the index does not need to be 10 long as it will be faster, (but not as good in a way) the smaller it is
 
yeah, will check it
 
your mean is search in a Id column is faster than something like Subject column ? (suppose Id has 10 digit and subject words are 10 characters)
 
yes, should be as less things to index (not being an index expert) 0-9 vs a-zA-Z.-/....etc so the sort order is easier, as I understand it. I am sure the index uses a different data structure
 
@Sajad yes. An index for numeric field will just contain ordered list of numbers. That lets you performs a binary search
 
9:46 AM
ah I see, ok
 
Also a key will also have Unique on it often so that is better for sorting too, as its not checking dupes
 
@tristanbailey why?
the key doesn't need to be unique in this case
 
sure I agree thats why I said code
could
 
but if he is matching a blacklist and wants it faster, then remove dupes = less to search
just a thought, sort should be faster if it does not have to consider another factor in sorting two or more rows that are the same value.
This is just from my logic thinking not fact as I stated before, just thoughts to make things faster
@tereško i think your CS / code knowledge is higher than mine from your SO profile etc. So I defer to you,
 
9:50 AM
I find it funny when an Android/gmail/facebook user complains about being spied on by his PC
 
Its all about knowing, the spying will always be there at one level or another.
 
one more question about this topic, I have a query like this: where id=? and title=?;, so I want to know it will find id number in first and then check its title with $title ? (in other word the above query is difference with this: where title=? and id=? ?)
 
no, all your queries go through an optimizer in RDBMS
 
ah, too bad :( anyway tnx
ow, I detect a new interesting thing: "Dotted lines between the last comments" they will be hide after a time period :-)
 
Do you need to test id and title?
or just want to check one and return both?
 
10:02 AM
@tristanbailey I can do that just with id, but for more security I want to check both of them
 
ok, why more secure? your code needs to be secure not the sql its self?
 
because if I do that with just ID, user can change the ID in the url and steal my data
 
is it the same data in id and title?
sure but then you just abstract the data in the url from the key in the db
 
yes
 
If you watch Phil Sturgeon recent talk about api best practices
 
10:04 AM
really? about my problem ?
 
one of them which is true for all urls. is that if the api/url is crawlable people will
so if you use UUID or another technique and keep the url not the same as the db.
If you list all pages as links on your site though they can all be crawled you would need other sorts of protection and rate limit to stop it
 
@tristanbailey your mean is I hash the Id in url ?
 
that would be one option
 
ok - tnx
 
if you had even your own basic hash it would be harder than 1,2,3,4 to crawl
 
10:07 AM
I have my own approach for preventing crawl: stackoverflow.com/questions/30361740/…
I inject some HTML tags in my website by random, then user can not select the proper data (text).
 
ok, I was just commenting on speed of queries, I dont have thoughts on your issue at the moment
 
@tristanbailey I see
 
@Orangepill i need the tracks to be nested in the playlists, like this playlist1>t1,t2,t3, etc... playlists2>t1,t2,t3,etc... (t for track,fyi)
 
@tristanbailey also I tested both of that query: the diffrent is 0.001sec, like this:
where id=? and title=?  | 0.002
where id=?  |  0.001
I can accept first one :-)
 
when the query is this simple and not under load the DB will to the optimisation, its not complex enough to worry, but at the scale of a big site 0.001 is a good saving for little effort.
 
ThW
10:17 AM
But you need to be careful not to measure the query cache :-)
 
@tristanbailey ok well, but what is your mean of "scale of a big site" ? how many rows ?
@ThW I'm careful ;-)
 
@tereško wow, that move..
 
Can Anybody Please help me with this :stackoverflow.com/questions/32266975/…
i am using Codeigniter Framework
 
hi i am uploading one image through ajax but its not getting in php page.any idea
here is my code
 
@ThW ;) wise point ,
 
10:29 AM
$.ajax({
method: "POST",
url: api_url+'all_access.php',
data: {'user_id':userid,'action':'user_edit','fullname':name,'email_address':email,'phone_number':phone,'image':image},
dataType: 'json',

success: function(service_data) {
if(service_data.status=='1'){
$('#dealer_location_id').children('option:not(:first)').remove();
$('#brand_id').children('option:not(:first)').remove();
$('#service_type').children('option:not(:first)').remove();
$('#test_drive_date').val();
$('#test_drive_time').val();
$('#address').val();
 
@Sajad doesn't matter how big your db really its how many visitors a hour, minute second.
 
... and Arun goes to the ignore list
 
@Arundivakar you might want to post your code sample on Gist or similar so you can better explain, as that it just javascript and the error code be here, or php or the html it is working on, so it is not possible to tell
 
@DaveRandom don't know how to screen that… it's about 5 or 6 pages big... Just try with am-dns new_API branch… (to dump packet, see functions.php:419):
<?php

require __DIR__ . '/vendor/autoload.php';
Amp\run(function() {
    var_dump(yield Amp\Dns\query("google.com", Amp\Dns\Record::ALL));
    Amp\stop();
});
 
@tereško how you use tags in this chatroom ?
I want to use "I-give-up" tag, how ?
how ??
 
10:44 AM
@Sajad [ tag:tagname ]
 
@MarcelBurkhard ah tnx :-)
 
@DaveRandom Nah, @rdlowrey has even less idea of that than I do… he didn't even nknow about truncated messages or DNS over TCP…
 
11:03 AM
Hmm ... doing taxes is still confusing
it took me almost 15 minutes and I am still not sure whether I did them right :(
 
@tereško are you retrieving money? Or do you need to pay?
 
neither
 
I just need to declare that I have not had any income outside of direct salary
 
Fill in that you need to retrieve.. They will check it anyway.. I don't understand why we need to fill in that crap.. Since they check it afterwards anyway...
 
11:18 AM
retrieve?
you get paid by the government? ^^
 
what you retrieve are the extra taxes that your employer has paid
 
ah ok, that doesn't work that way here
 
companies tend to pay all the income taxes for a year in january
 
in switzerland people pay their income taxes themselves
which leads to other problems but yeah
interesting anyway
 
@tereško where are you living now ? and what percentage of your income is belong to taxed?
 
11:32 AM
Riga, Latvia (it should be visible in my SO profile)
and I actually have no idea how highy the taxes are
 
ah ok
 
whenever I have negotiated my salary, it always have been in terms "how much I will receive directly"
 
MGE
Hello, I have an array with:
 
especially because companies do various tricks to lower the amount they have to pay in taxes
 
@tereško I see
 
MGE
11:33 AM
date => 00/01/02, hour => 5, price >= 15 | date => 00/01/03, hour => 5, price = 15 | date => 00/03/02, hour => 5, price = 15 | date => 00/01/02, hour => 7, price = 15
I want to group in the same "array" values with the same hour and price
there is any function to group arrays by fields?
I have this but it only group by one field
function group_assoc($array, $key) {
$return = array();
foreach($array as $v) {
$return[$v[$key]][] = $v;
}
return $return;
}
 
@tereško ~27%
 
11:55 AM
To start with DDD i must know
Domain
Repository.
Domain Service
anything to be added??
what actually DDD is?? why to use ???
 
MGE
solved
$multidates = json_decode($this->eventinfo['multidates'],true);
$uniondates = array();
foreach ($multidates as $key => $value) {
  $tmp_dates = array('id' => $value['hour_start'].$value['hour_end'], 'date' => $value['date'], 'hour_start' => $value['hour_start'], 'hour_end' => $value['hour_end']);
  array_push($uniondates, $tmp_dates);
}
function group_assoc($array, $key) {
    $return = array();
    foreach($array as $v) {
        $return[$v[$key]][] = $v;
    }
    return $return;
}
$uniondates = group_assoc($uniondates, 'id');
 
If you don't know what it is or why to use it, why are you asking how to start using it?
 
I came across this word DDD many times in this room so want to learn?
 
@AnmolRaghuvanshi do you know google?
 
MGE
what is Google?
 
11:58 AM
another one for the ignore list
 
MGE
with that name, I do not foresee them a good future
 
@MarcelBurkhard i know just taking some suggestion
 
posted on August 31, 2015 by nlecointre

/* by Mulder */

 
12:40 PM
When you're doing a simple comparison in PHP (i.e. ==), is there any way to show what PHP is converting them to before comparison?
 
@Machavity not that I'd know…
 
Interesting question that prompted that
6
Q: Comparing strings, containing space with == in PHP

FaeryI am curious why this is happening in PHP: '78' == ' 78' // true '78' == '78 ' // false I know that it's much better to use strcmp or the least ===. I also know that when you compare numerical strings with == they are casted to numbers if possible. I also can accept that the leading space is i...

 
@JoeWatkins pong
I'm behind the GFW now :/
 
you're in china @NikiC ?
 
yes
 
12:45 PM
okay i might have an odd request
 
but luckily the university vpn seems to work just fine :)
 
i'm looking to re-order my mysql query result so instead of 1, 2, 3, 4, 5
it returns as 1, 3, 5, 2, 4
so it returns the odd rows first and then the event ones after
is something best to do with php after i have fetched the query?
 
what you doin in china ?
 
sounds like an xy problem, @AaronHarding
 
@PaulCrovella yeah?
 
12:51 PM
the reason I pinged you is this ... I have a problem in pthreads much like the one where the address of the iterator changed in apcu, I can't reproduce with any simple tests, but do have code that reproduces and I wondered if you might take a look at it for me ... @NikiC
 
i'm actually just going through some exercises :c
 
it's not caused by any of the mistakes I made there, custom object is cast and initialized and allocated properly, I triple checked ... a million times ... it really looks like that, but it isn't that ...
 
1:04 PM
morning, happy monday :-)
 
uggggghhhhh mornign
 
morning
 
@PeeHaa two weeks really free time now. :)
 
@JoeWatkins Just vacation really. I'll be here (Beijing, Shanghai, Toyko) for the next month
 
@kelunik You have two weeks now?
Nice
 
1:08 PM
@NikiC oh, nice
 
@PeeHaa Kinda, after that the next learning phase begins. ;-)
 
@JoeWatkins I'll try to look into it tomorrow. Can you send the reproduce code?
 
it's on github
 
ah, a test failure?
 
no, it's krakjoe/promises seven branch, the example.php code
it's too complex for tests, but I've been using it for a long time as testing code ... because it's quite complex, using interfaces and traits and what not ...
when I try to reproduce with simple code (with the same kind of structure) I just can't do it ...
I probably spent about three days looking at this all in ... I just don't know what's up ... appreciate some eyes, thanks ...
there's more than 60 tests, they cover a fair amount, and they all pass, even on windows ... so, I dunno ... it must be something about that code but I can't see it/trace it ...
I can see what is happening (I get a different object back from PTHREADS_FETCH) on submitTo(0, ...) than I should, but fuck knows why ... first call to submit() (pthreads_stack_add) is fine, but subsequent calls are operating on invalid memory, though nothing crashes, strangely ...
 
1:15 PM
@Orangepill Here i have explain whats the problem, let me know if you can help me, Thank you. pastebin.com/WzAA70qj
 
This weekend I learned I am too old to do a 2 day festival without any sleep...
/offtopic
 
@PeeHaa eih… how did you achieve that when you were young?!
 
Substances @bwoebi, substances :P
 
hmpf…
 
The good thing is that I am now totally broken and can fully focus on programming
 
1:28 PM
@bwoebi That's totally possible when you're young as long as you don't fall asleep because you're too drunk. ;-)
 
Anonymous
b
 
@kelunik is there any way to find out what is not covered yet using phpdbg? Is scrutinizer 7 ready yet?
Or is this the difference between xdebug and pgpdbg's:
  Classes:  0.00% (0/1)
  Methods: 33.33% (2/6)
  Lines:   83.33% (20/24)
cc @bwoebi
 
@PeeHaa Line coverage is supported with PHPUnit 4.8+, I don't know about scruzinizer, I don't use it.
@PeeHaa There are some differences, e.g. closing } are still marked as executable in PHPDBG or is that fixed, @bwoebi ?
 
@PeeHaa you need to look at the actual coverage, not only the resume…
@kelunik no, still marked.
 
@bwoebi How do I get that?
I stole this from @kelunik
phpdbg -qrr vendor/bin/phpunit --coverage-text
 
1:38 PM
@PeeHaa yeah, use html coverage for that
 
@PeeHaa --coverage-html=coverage/
 
Can I easily view that on travis or do I actually have to open the html?
 
@PeeHaa You can use coveralls.io to view the Travis results, just have a look at amphp/amp for the setup.
 
Check it out <3
BTW @bwoebi can I haz exit alias please :)
 
@PeeHaa ?
 
1:42 PM
exit -> quit
 
you mean q command in phpdbg?
 
@PeeHaa Just use q, but exit might be worth an alias.
 
@bwoebi yeah
@kelunik Oh I always type quit :P
 
@PeeHaa but like with all these interactive commands… just use ctrl+d ^^
(close stdin)
 
@bwoebi Yeah, but that is nix only :(
 
1:44 PM
@PeeHaa use a real OS…
 
Same could be said about your OS :P
 
Not about mine... :P
 
@kelunik Which is?
Android? :P
 
Currently Ubuntu Gnome, but I might switch to Fedora the next time I set it up.
 
Linux as desktop just doesn't work for me
 
1:48 PM
Why?
How about hooking your entire dev fs subtree into a Docker container dynamically? I don't know if that's supported on windows..
 
As bad as MS office is I hate libre/open office. gimp is an ugly piece of crap. I don't know any decent oss emailclient
@kelunik I doubt it
 
Yeah, same here..
I don't know, does Office work under Wine? :P
 
lol dunno. Haven't dicked around with wine for a loooong time because nothing worked nicely with it
Oh I forgot smb also sucks under linux
 
The only things I installed under wine are games via play on linux, they ran surprisingly good TBH
 
They do? That is actually pretty cool
> Your repos are syncing...
Y U SO SLOW COVERALLS
 
1:55 PM
I tried hearthstone and some other, the only thing that sucked was that I had to explicitly use my internal onboard graphic thing instead of the GPU, because otherwise it rendered just non-sense in the battlefield client, the game was OK through.
 

« first day (1780 days earlier)      last day (3158 days later) »