« first day (1323 days earlier)      last day (3628 days later) » 
01:00 - 16:0016:00 - 00:00

1:15 AM
Shot of the century:
 
 
1 hour later…
2:43 AM
hello
quick question no code, when trying to send html form using ajax, if the page auto reloads and in the url its shows the values sent as the phpvars=value its all going ok?
 
2:58 AM
sorry i meant htmlformvars=actualvalue
 
CV ed both . @BenjaminGruenbaum, Seems like you are after bjb568 ^_^ ?
 
lol, well, 95% of his answers are like that. I actually got to the second one from the first one. I'm actually trying really hard to not go after him right now :P
 
 
1 hour later…
4:39 AM
hey! would someone be able to walk me me through adding image paths to an ID in a database and pagination ? Or point me into a good mysqli tutorial, most i've found are confusing/"lacking"
 
i dont understand your question @av17 by image paths you mean /image.jpg how do you want to attach that to an id, or you mean id would another column of the database?
would be
 
hello
What IDE do you all use?
 
welcome Andrew
 
yeah, i mean, creating a table in a database, setting image paths to an id, and then using it to add the images
 
do you know how to insert something int oa database?
ac17
 
4:51 AM
not really
 
av
ok
 
INSERT INTO bbddcreadadsdvb.cochesprueba (id, marca, modelo, version, puertas, combustible, potencia, aceleracion, vmax, consumo, precio) VALUES (NULL, 'aaaa', 'bbb', 'esdfsdf', '4p', 'sadad', '123123', '000', 'afasfsa', 'adas', '35353');
bbddc etc is the database name ( column1,colum2,...,column n) values (valuecolumn1,valuecolumn2,...value column n)
 
only if you like to read caution its long:
0
Q: form sends data to php, php prints json array,retrieve that array with jquery

user3470815Caution long post sorry Hi im trying to play with ajax, it posts the 2 dropdown list values to php which i can see in the url ref1=value1 ref2=value2 after pressing the input button, with those values in php i make a query and store results to an array. I echo json_encode ($array). And now the p...

@av17
 
k
 
4:58 AM
did you already create the db?
 
yeah
its already all set up
i just need to add the paths to it
and then retrieve the ids to add the images onto my page
 
are you using any ide? @av17
 
phpstorm
 
5:35 AM
hmm
 
6:01 AM
whats up @av17
 
I can't get it to upload into the database
im not getting errors, but it doesn't upload
i posted a stack, stackoverflow.com/questions/23966964/… maybe you can help
 
i cant see the image imgur.com/KhhH5H4 but ill continue reading
 
oh good to know
 
try surrounding the values variables with ''

example, notice the '':

mysqli_query($con,"INSERT INTO Persons (FirstName, LastName, Age)
VALUES ('Peter', 'Griffin',35)");
single quotes
 
6:23 AM
are you in love again with wampp?
 
what do you mean?
 
a couple of days ago you said you had problems with wampp?
 
:o
 
Yes , i was half asleep but i somehow remember something..
 
yeah, it wasnt wamp its something with my ide
have 2 use a diff method 2 debug now
 
 
2 hours later…
8:29 AM
mornin
 
Morning @tereško
 
moin
 
ThW
Morning
 
8:53 AM
mornings
 
9:19 AM
good morning
is that my browser or youtube is broken? (ping is ok, even telnet on port 80 it ok, but.. only for 400 Bad Request)
 
morning @AlmaDo youtube is fine for me
 
9:33 AM
(requires another downvote first though, or we wait two days)
 
10:47 AM
Mohrnin
 
GOOD MORNING
 
11:07 AM
Morning
 
11:18 AM
Anyone have any idea how long the PHPNE tickets remain early bird tickets?
> Early bird tickets are available until June 15th.
Stumbled upon my own answer :D
 
I haven't been following feature requests particularly closely; can we expect to see callable invocation chaining; such as $f()()
For clarity: $f = function () { return function () {}; }; $f()();
 
11:39 AM
morning
 
@DanLugg With a bit luck in phpng…
 
@bwoebi Have you noticed any recommendations regarding it?
 
hmm?
 
I mean, is it a feature that has been actively discussed?
 
no. Just a patch being prepared by Nikita.
 
11:43 AM
Oh, ok. Awesomesauce. Thankyou :-)
I'm really looking forward to seeing the lexer/parser fixed.
Of all the "features", that one probably excites me the most.
Like, in place scope unbinding: (static function () { })();
 
Mornig
 
Myonyang
 
How's it going Freeman :)
Hard at work I hope!
 
Good :) Bit tired still though :P
 
Celebrated last night?
 
11:52 AM
Thoughts on the ability to expose static variables as properties of a closure?
$f = function () {
    static $x;
    var_dump($x);
};
$f->x = 7;
$f(); // int(7)
$f->x = 42;
$f(); // int(42)
 
@Fabien Yeah. Had a drink with my ex boss :)
 
And he explained how invaluable you were and that he'd give you 1 million to stay?
 
@DanLugg hate it
@Fabien We already had that talk :D
 
So, are you secretly a millionaire now?
 
Nope @DanLugg this room would look so much nicer if that was the case :D
 
11:54 AM
lol FREEDOM!
 
His room currently looks like this
 
:D
brb need to do some shopping unless I want to starve this weekend
 
Caviare and champaign most likely.
 
@DanLugg Ugly, noisy, potential bad practice, source of hacks (when proper solutions exist).
 
@Fabien That's just the downstairs toilet
 
12:00 PM
lol
 
lol
 
(that was hard in MSPaint)
 
ThW
That's unexpected: 3v4l.org/Cin8m ... in HHVM 3.1 $arguments is missing, but the optional argument is there
 
12:08 PM
What php web-hosting would you recommend? I used to use this one, they were (and, hopefully, are) pretty good and up-to-date.
 
@Leri I worked for the company that made JustHost :)
Are you looking for shared or a VPS?
 
@Fabien Shared web-hosting at first, but will upgrade to VPS if everything goes well.
 
Do you do much to any sys admin stuff?
 
@Fabien I don't want to waste my time on server configuration stuff on shared hosting, however, I want to have ability to have quite large possibilities.
Of course, I know security limitations of shared-hosting.
 
I'd suggest bluehost. Both bluehost and justhost are owned by EIG but they were originally from different companies.
So different backgrounds.
 
12:18 PM
I've used BlueHost with clients; it's fairly okay. Obviously not "the best", but far better than many of the alternatives.
 
Better is more money
 
^^ Of course. I just mean, for the price they're comparatively better than most, that I've dealt with.
GoDaddy, for instance; can suck my log.
 
@Fabien I liked the most part of their plans. The thing I did not like is their payment plans. I.e. you need to pay for 12 months, however, 2 months will show me if I need to upgrade or quit using server.
 
@Leri Unsure who else then. But I can't really recommend JustHost :p. I'm a VPS guy.
VPS is fairly small setup you know.
Easier upgrade.
I'm a little desperate for someone to try these guys
Gym time bbl
 
@Fabien Later. thanks for suggestions.
 
12:36 PM
Maybe silly question of the day - can you perform server to server communication over websockets?
 
What does prohibit you?
morning, btw
 
Knowledge :P I can do client <-> server with ratchet. I have no idea where to start with server <-> server
 
@Jimbo a websocket between two servers is called a socket isn't it?
The only reason for websockets is to allow two way communication between a browser and a server - which has always been possible between two servers.
 
@Jimbo that makes no sense. Websockets are just the only full-duplex socket connection browsers allow
between servers you can use just raw sockets…
 
@Jimbo Also, I barely see the need of WebSockets over Web Services. Unless you have very real-time data to be exchanged over socket.
 
12:43 PM
I will want to have real time data exchanged between servers
Via php. Hmmmm
 
@Jimbo yes, raw sockets. you don't need websockets. They're just a layer above raw TCP sockets to be in accordance with w3c specs
 
Fair enough. TCP or UDP?
 
TCP usually
 
And I'll have to do event driven code with React listening on the port that's being connected to I guess
Thanks for the retardation intervention guys :-)
4
 
San
anyone is here with expertise on PHOZO? www.phozo.org
 
12:53 PM
use rdlowrey/Alert and be happy @Jimbo
 
1:07 PM
Morning
 
1:21 PM
I need help with linux system calls again, namely with tcp and files anyone here?
Oh hai @bwoebi can I poke your head a bit?
 
Hello
 
Hello,
I need help about ZF2
How I can disable inarray validation for select element
I already tried with this
'disable_inarray_validator' => true,
'inarrayvalidator' => false,
But it doesn`t work
 
^do
 
one more delv ^
 
ii cant delv
 
1:53 PM
@Jimbo UDP is unreliable therefore if you are not sending data that might be corrupted on the receiving end, you'd need to implement packet tracking at application layer. TCP already has one at lower layer (I don't remember, which layer it is (transportation more likely /me looks @DaveRandom).
 
@Jimbo as a general rule, don't use UDP for anything other than broadcast over a LAN or real-time streaming, when designing a new application it's not particularly useful for anything else. (IMO, YMMV)
@AlmaDo In Soviet Russia, datagram protocol uses you!
Jan 17 '13 at 15:40, by ircmaxell
I'd tell you a joke about UDP, but you might not get it
 
Fair enough, TCP it is then.
I'm basically having it so that, when connecting from client -> my server over websockets, my server can then choose from other servers to get it's torrent data. And obviously, this needs to be async ;)
This is getting a little complex
 
@Jimbo So you mean separating out the HTTP service from the seedbox?
If so, may I recommend a HTTP API. Although that said, if you are coupled to transmission you should be able to do it anyway since it has an RPC control port which already operates over TCP...
 
@DaveRandom Yeah. I can then scale up or down boxes from different services as / when required for adding torrents, and save a server ip against a torrent when a user adds one. So that'll be autoscaling + also load balancing
 
2:07 PM
@DaveRandom in Russia we're calling postal service UDP
 
Not coupled to transmission, it'll handle other services too remember
 
Morning.
 
hi, @LeviMorrison
 
@Jimbo Then consider writing a JSON API to sit on the back end boxes
right, I need to go do some shit, bbiab
 
@DaveRandom See, it'll still be making a request to these back end boxes at least every second. That's a lot of HTTP requests - hence why I wanted a socket implementation -> one socket open, sending all the data down it
 
2:11 PM
I want to pipe a tcp socket directly to a file, how would I do that in C?
 
Write two programs - and pipe them together?
 
well.. socket is a file (:
 
Or just write one program and pipe it's output?
 
@AlmaDo I know that :P
I want to pipe the socket to a file without having to put the contents in user space memory.
 
@Jimbo This is probably something for a blog post, but you really don't want to have lots of separate requests. I needed something similar at my last place, but didn't get round to implementing it - but the best architecture I think is:
i) A queue on the local server of the things to send.
ii) Something that does batch reads from the queue, and sends multiple things to process at once to the other server.
iii) Something on the other server that accepts those batched requests, and saves them into a queue there to be processed.
iv) Something on the remote that sends the results back to the first server, also batched up.
The problem with making that many separate requests isn't just the HTTP bottleneck - it's the DB and filesystem contention that just cannot be solved if you have hundreds of requests all fighting for the same resources.
If you break the pipeline of work into pieces, each bit can work with just a single thread, really, really quickly and pass the work onto the next bit with almost zero contention.
 
2:25 PM
Exactly, it's multiple queues, async sockets and async mysql queries
I was thinking react/socket and something like async mysql.
There's also the possibility that I just say "screw it" and do all this normal HTTP stuff
 
Hint: don't use PHP if you need that sort of thing.
 
PHP can do it :-)
 
Of course it can, so can COBOL.
When all you have is a hammer every problem looks like a nail.
 
I am not using JavaScript, you dirty, dirty heathen.
There's a when.js port of promises you can use with react though - that might work? react/promises
 
Ok, enjoy writing hundreds of lines of PHP and debugging for hours when it's a 50 LoC solution with NodeJS and socket.io
No, since PHP is slow, PHP promises are unfeasable for lots of concurrent connections if you need that. WhenJS itself is only marginally fast enough for some apps.
 
2:30 PM
See I'm sure there's no point in a big job queue because the main server is going to be asking for exactly the same information from all the little servers
 
What are you actually trying to do here?
 
Okay so this is what I already have working
Client connects over websockets to server, subscribes, and then receives looped pushes over websockets of data, some of which comes from mysql
So instantly there, there's no async stuff for the mysql. It's not a complex query at all, but it's still blocking
But anyway, I want to make it so that my server is only a mediator between the client and another server which has the data there
Meaning I can scale up or down the other servers when I like
 
afternoon all ...
I see the word async ... what's occurring ?
 
@Jimbo "no async stuff for mysql"?
I'd use node, seriously, that sounds like something trivial to do with socket.io, and the client becomes really simple too.
 
Yeah, the client subscribes over ws to the server. The server then starts doing a mysql query every few seconds to get the data to push back to the client
^ I have that working
 
2:38 PM
That's literally 30 lines of node :/
 
So two issues: 1) make those mysql queries non-blocking, and 2) make my server only an arbiter that chooses other servers to get data from. All must be async
Stop trying to convert me to node you judas :P I'm enjoying this as a learning curve ;)
 
if only there was some way to multithread ...
 
I mean, literally 30 lines.
 
@BenjaminGruenbaum stop with your preaching already. PHP is a language better than JavaScript and C# combined, go away :P
 
And you can do 10K clients.
 
2:39 PM
@JoeWatkins You think multithreaded is the way forward? I remember asking you ages ago and you told me pthreads isn't what's needed here
 
With Bluebird promises.
Oh gods, don't do threads that'd drive you insane. You can do this all without threads, it's literally 30 lines of code in Node.
You get to learn a new technology too.
If you don't want Node, it's like 40 lines of code in SignalR, although for some dumb reason that requires jQuery on the client side :P
 
@BenjaminGruenbaum That's all well and good, but then I run into problems getting the stuff that's working in node running alongside and working with my php stuff
 
I've read literally the last 6 lines you typed, it sounds from those lines like a solution, if you gave me more information last time and I said don't bother then don't bother ...
 
@Jimbo why would that be a problem? I run Node alongside asp.net all the time
 
@JoeWatkins Nope that's it I think, already using websockets for client -> server. Then I asked could I do async connections from server -> the other servers.
 
2:41 PM
@BenjaminGruenbaum What's wrong with doing this using thread pools (heavy work goes in background and when result is ready main thread is invoked and passed data)?
Why is that insane?
 
@Leri because it'd take so much more work. You already have LibUV to do that for you, that uses pthreads interally but can also tune up the load for you.
Why would you want to use semaphores, and mutexes if you don't have to? Why jump to the hardest possible solution first?
 
@BenjaminGruenbaum what you just said, makes not much sense ...
you are also assuming it's hard ...
it's not ...
 
@JoeWatkins wanna bet on it? Bet you I can build a faster web socket server in a day than you can in a week with php (alone!) to do that? (Query SQL, let all subscribers know every minute)?
I'm also willing to throw in that there will be less than half the LoC
 
@BenjaminGruenbaum hmm?
 
@BenjaminGruenbaum So you say that all .NET async stuff is totally useless?
 
2:45 PM
@BenjaminGruenbaum Wait, I already have a websocket server going
 
@Leri of course not, then again - async/await doesn't fire threads in .net, it's nonblocking when it should be non blocking.
 
A task is not a thread.
@Jimbo if I wasn't sure of its simplicity, I would never have agreed to code against someone like @Joe :P
 
you know how many LoC it is to create a pool of threads ?
it's 1
this is simpler than you think it is ...
 
ok, show me.
 
2:48 PM
$pool = new Pool($threads)
 
not that :P
Build a server that takes subscribers over websockets and send them the result of the same mysql query result every 10 seconds. The query executes every 10 seconds too.
 
You're missing the point - I have already coded the subscribers, ws stuff etc. It's merely the mysql stuff, and it's every 1 second ish
 
I don't have a solution on my fingertips, I'm not within a system that already has the websocket server and half the infrastructure written, but if the task is take data over the network and use it to generate mysql queries then results asynchronously, then it's easy, putting that into an already existing system would not be difficult ...
 
Then the server arbiter
 
@BenjaminGruenbaum How's what I said any different from async/await at interface level?
 
2:52 PM
@Leri it doesn't enforce threading.
 
Soooo :-)
@JoeWatkins Could you elaborate on how easy it is?
 
you have this online somewhere ?
 
hello again
 
@JoeWatkins I have the old architecture online. It's very dirty, I'm re-writing it. It's on bitbucket
The general gist is there
Here is the actual WS server from ratchet that is run. And here is the event handler that responds by getting torrent data / mysql data etc
 
3:07 PM
Did you pick a host? @Leri
 
can't signin to bitbucket
forgot password
 
Gahhh
 
and email and username and won't let me use any twitter/github/etc
 
is it 'IBuiltPThreads' ?
 
probably krakjoe
 
3:08 PM
or 'pass1234'
 
Your username is krakjoe anyway
 
I'm in
 
The general gist is, user connects, $actionHandler is a factory that returns a handler depending on the topic subscribed to, so one may be "torrents", "statistics"
All handlers have a common method, handle(), weirdly enough
You know what, it's probably too messy and complex
At some point in there, it connects id's and things from the database, with torrent data from the command line, and creates objects from it
 
@BenjaminGruenbaum Sorry for late answer. Got distracted by real-world work. At api level what I said is pretty sane (demonstration, because I am more fluent with code: pastebin.com/jMbDUPFL). The thing is that in php the only possible implementation now is via pthreads.
 
In Node?
That doesn't work.
 
3:13 PM
@JoeWatkins Oh yeah, I found the class that does the db stuff here URGH
 
@Fabien I think I go with vpsdime I liked their plan. I am going to choose minimal plan and UK Pure SSD because it's way closer to me than other alternatives.
However, I am afraid DDoS attacks.
 
Nice. let me know how they are. It's a VPS no?
 
it's very difficult to know what does what here
 
I know :( Hence why it's being rewritten. Perhaps a general overview of what needs to be done to make the mysql / command line calls that get data async? As well as connection stuff async?
 
@Fabien Yeah it's vps. Have not ordered yet.
 
3:23 PM
Worst case scernario, only $7
Why worry about DDoS?
 
@Fabien Dunno, people here (who knows what they are doing) is addicted to that kind of fun. E_POST_SOVIET_RUSSIA
Fortunately, their number is not more than 1-2K
 
@Leri Fair enough
 
Hello, newbie online
Can anyone suggest me a nice site to learn php?
 
Oh god, yet another framework called blockify
 
@Evenure Not really a tutorial but guide phptherightway.com
 
3:33 PM
@Fabien I would describe it more as "collection of links to latest hype"
there is little to no educational value in that page
 
Hence guide rather than tutorial. Not learn but how to. As far as resources go it's not the worst.
 
user4203923
hi
 
user4203923
someone know how to get temperature from some cities ?
 
Then again at such an early stage of PHP I wonder if it matters.
 
A thermometer is a device that measures temperature or a temperature gradient using a variety of different principles. A thermometer has two important elements: the temperature sensor (e.g. the bulb on a mercury-in-glass thermometer) in which some physical change occurs with temperature, plus some means of converting this physical change into a numerical value (e.g. the visible scale that is marked on a mercury-in-glass thermometer). There are many types and many uses for thermometers. Temperature While an individual thermometer is able to measure degrees of hotness, the readings on t...
 
3:36 PM
ho ho
@PeeHaa What changed on the proxy you set up for me anyhoo?
 
Ow shit forgot to look into it.
 
Meh, only inhibits my illegal activity :P
 
I think I read somewhere their domain was seized, but they got it back within the day or so
Is it still not working?
 
Furry muff
Aye
Get an XML response
 
What does the xml look like?
 
3:38 PM
Hello everyone. Could someone help me understand what this code does exactly ? a friend of mine have been hacked and this code is running on all his php pages :
https://gist.github.com/cute/8130292
it is a gist so no worry
thanks in advance
 
@fadomire Tell your friend to stop using wordpress
@Fabien Uhhhhm that is strange.
 
lol i know, i told her. and i also told her to delete her site completely and start fresh
 
Somehow you are hitting my autodiscover test @Fabien
 
but i m wondering what the malicious code does exactly.
 
3:40 PM
Some ugly code in that hack. Poor indentation and style. Naming conventions are horrible.
 
Error must be somewhere on my side.
 
Also why would you name your script 'trojanhorse'
 
@fadomire echo the code and find out
 
@PeeHaa It's my 1337 hax.
 
Why do you want to know what the code does btw @fadomire?
 
3:43 PM
Level of exposure I am guessing.
 
<?php
interface Client {
	public function respond($data);
}

/* I dunno what a client looks like */
class Dummy implements Client {
	public function respond($data) {
		var_dump($data);
	}
}

/* This is partly magical */
class DB extends Threaded {
	public function __construct($config) {
		$this->config = $config;
	}

	public function getConnection() {
		if (!self::$handle) {
			self::$handle = new mysqli(
				$this->config["hostname"],
				$this->config["username"],
				$this->config["password"],
sorry
@Jimbo ... something like that I guess ...
 
is getConnection() a singleton?
 
@PeeHaa i wanna know just out of curiosity. it seems to do some curl requests, but i m wondering 2 things : how the hacker edited files and what the hack does. Just hitting some random IP or something else. the code seems wired to me
 
@Jimbo Have not you seen this yet? fuelphp.com
 
@Leri Yeah, used it when I first got into php, and didn't like it
@JoeWatkins How do I choose which objects in my code extend worker, and which extend Threaded? Is there a rule of thumb?
 
3:45 PM
@Jimbo I don't like that word, it's not a singleton in the real sense of the word, in that all threads do not share a single instance, that's what it is really doing, providing each thread with a unique instance ..
 
bbl
 
is there a forum somewhere to ask for an explanation of this code ?
 
@Jimbo Just having a look and at least they use proper naming so far.
 
@fadomire Without looking I can tell you it fetches some malicious payload from an external (probably also "hacked") server and rendering an iframe with said payload on every page unless you are a search engine spider
 
echoing it dont give me info
 
3:48 PM
How they "hacked" it: wordpress...
@fadomire Sure it does
You just have to echo the correct parts
 
@pe
 
@Jimbo a Threaded is a threaded object, anything you intend to use in multiple contexts should be threaded, Thread is the base thread abstraction extending Threaded and Worker extends Thread and provides the Worker like functionality, the only time you want to use Worker is when creating workers directly, but you should usually use Pool for that ...
 
@PeeHaa indeed the correct parts :) but need to find them
 
Do you know how to debug php code?
 
no iframe on the page where code is executed. debugging php ? not really. i know other language tho so it can help
 
3:50 PM
@Jimbo things I notice while looking around, you are creating processes to generate zip files, don't do that, also, you'll need to read about Pool::collect I think it's detailed in manual ...
 
@JoeWatkins Is there a chance to arise racing conditions in your sample?
I was looking at it for a while and could not answer that myself.
 
race conditions for what ?
 
@fadomire It should be the same as with other languages. Get a starting point and either step through it manually (var_dump() / echo) or use a debugger
 
@JoeWatkins For connection. I.e. one thread closes connection, while another still runs that connection..
 
not shared ;)
nothing really is in pthreads and you cannot race for what you are not sharing ... which was my point, I guess I was being obtuse ...
 
3:54 PM
thanks @PeeHaa i did that from the obfuscated code and got the output as the gist i sent. But anyway i guess you are right, it must obviously try to download some other malicious file and execute it on the target server as it seems to try to get some server vars from php
 
Oh, cool. And another dumb question then: does not that have some overhead? note: by "some" I mean noticeable
@JoeWatkins Yeah. Basically, you took hard thing and implemented it in an easy way (I remember people saying that threading violates php's idea at its early stages).
 
@fadomire Basically just check it out like 3v4l.org/uvme9
And don't forget to htmlspecialchars() parts where it renders html
 
@PeeHaa thanks, i'll try that some more
 
($f = function($x = null) use (&$f) {
    return $x ?: $f;
})()()()('var_dump')(9);
 
I'm sure @DanLugg just jizzed all over your avatar :D
 
3:58 PM
@JoeWatkins Thanks very much for the example :-) I shall play around with this and see what I can accomplish
 
@Leri noticeable implies we can measure a system which doesn't work this way and compare the difference, no such system will simultaneously exist and be usable ... so, no not really ..
 
01:00 - 16:0016:00 - 00:00

« first day (1323 days earlier)      last day (3628 days later) »