« first day (1819 days earlier)      last day (3126 days later) » 

11:00 AM
@Riccardo990 Ow wait wut??
 
@salathe Maybe you're preparing every statement, regardless of whether they have parameters or not.
 
WTF is DELETE FROM tagesroma WHERE id=id?
 
@Jimbo maybe
 
user5020521
cause I need to pass $idRecord = $_GET[idRecord] to a ajax call into a js file
 
user5020521
and I wanna try to encode a result into a json file
 
11:00 AM
Yes so you prepare
 
 WHERE id=id
 ==
 WHERE 1 (or no where at all)
 
user5020521
and use jsonParse into a js ajax
 
WHERE id = :id
And bind id
 
why are you talking to tiny avatar people ?
 
user5020521
you're fuckin right man
 
user5020521
11:01 AM
i forgot :
 
@tereško wtf, are you sure?! really?! I replaced the most of my IF-statement with array, so I've wasted my time?
 
Also WTH is fetchAll on a delete
 
@JoeWatkins Where did Stackable go in pthreads or is it just not in the polyfill?
 
@Sajad Optimisation shouldn't even be a concern for you until you've gotten the basics of the language down
 
Hehe, @PeeHee is my parrot today
 
11:02 AM
.. I think I am starting to get through
 
user5020521
@PeeHaa i would like to create a bidimensional array and pass it to a ajax js by json_encode inp php and jsonParse in the javascript
 
@salathe oh lol. Sorry :P
@Riccardo990 bidimensional array of what?
 
I think StackChat has a bit of pent up energy from not seeing this kind of code in a while.
 
@PeeHaa Oh it's okay, repetition is good for the people who don't read/listen :P
 
:P
 
user5020521
11:03 AM
of what has been deleted and tell the damn ajax what I deleted
 
also, now I need to go and feed the ATM .. I have only €5 left on the card
 
@Riccardo990 You already have the ids of what is going to be deleted because you use it inyour query
No need to ask the database that
 
I'm gonna go huff rubbing alcohol for a bit.
 
@Riccardo990 SQL Doesn't return what has been deleted after running a DELETE query really
 
@Jimbo I understand your point, but actually my teacher told me, I have devoted 1/4 of the score of your project for optimisation! it is really important for me
 
user5020521
11:04 AM
before the try I have $idRecord = $_POST['idRecord']
 
I mean, you can get the number of rows affected.
 
user5020521
idRecord is a parameter that I use to open the request in the ajax
 
user5020521
like this
 
user5020521
xmlhttp.open("POST", url, + "?idRecord" + true);
 
user5020521
is this clear?
 
11:05 AM
> "Premature optimization is the root of all evil”
 
ergo, your teacher is satan
 
actually he is!
 
user5020521
that's why I wanna have the data returned after the delete or better I need to tell the ajax what I deleted
 
user5020521
I'm trying to use a confirm inside the function that I call inside the ajax function and call it back outside that function
 
user5020521
11:07 AM
the confirm asks this if is true you request else do nothing
 
` "?idRecord" + true`
What
 
user5020521
and inside another function I wanna attempt to handle the error
 
user5020521
if r is false handle the damn error
 
user5020521
true is the async set to true
 
user5020521
when you have an ajax request in pure javascript you must tell whether the async is true or false since it's a boolean
 
11:09 AM
@Riccardo990 he's just confused because your syntax is broken/incorrect
open("POST", url + "?idRecord", true);
 
user5020521
is this broken?
 
user5020521
this is to add a value to a string by the + operator
 
@Riccardo990 what you typed, was broken
 
user5020521
this is a kinda string concatenation
 
5 mins ago, by Riccardo990
xmlhttp.open("POST", url, + "?idRecord" + true);
^^ broken
 
user5020521
11:10 AM
oh shit you're right I forgot the damn coma
 
user5020521
thank you and error aside I'm stuck
 
comas (sic) are very important in JavaScript :P
 
user5020521
distraction error my friend
 
user5020521
thank you
 
@kelunik Threaded
 
user5020521
11:13 AM
anyway what can I do to tell the ajax what has been deleted?
 
user5020521
don't I need to use json_encode after the delete has been made?
 
-1
Q: How to replace variable with values in another file

Richerd fuldI am trying to replace values of variable I have following file demo.html <h1>{$heading}</h1> <p>{$paragraph}</p> demo.php $html = file_get_contents('email.html', true); eval($html); here I am trying to include that file and replace values of $heading and $paragraph and than ech...

 
@JoeWatkins thanks
 
user5020521
@Richerdfuld i'm attempting to accomplish something similar to what you're trying
 
how are you doing that ?
 
user5020521
11:19 AM
using ajax in a javascript file separated from php
 
user5020521
but I haven't attained that result yet I'm stuck in the passage
 
user5020521
do you need me to ask a question on SO?
 
Abe
@salathe did you buy a domain just for that? #respect
 
@Riccardo990 I am creating html templet for email with php variable and letter load that file and replace values of variable in php file :/
 
user5020521
11:22 AM
therefore I was mistaken what you're going to do is completely different from my code
 
@Abe *grin*
 
Anonymous
@salathe cast you to hell :)
 
Anonymous
I didn't know today was Friday.
9
 
@tereško heh, really that's not logical: switch is faster than array
 
Abe
@samayo you are starting to behave like a proper programmer
when i wake up i'm like what day is it? what do i do here? what's my name? what year is this?
 
11:37 AM
@Sajad You're not comparing apples to apples :/
 
Stop trying to optimise
 
@samayo *grin*
 
@salathe the output of both of them is the same (apples)
 
Fatal error:  Uncaught RuntimeException: Threaded members previously set to Threaded objects are immutable, cannot overwrite worker in [no active file]:0
Stack trace:
#0 {main}
  thrown in [no active file] on line 0
 
@Sajad ooooooooookkkkkkkkkkkkaaaaaaaaaaaaaaaayyyyyyyyyyyyyyyyyy..... o.O
 
11:39 AM
Uhm.. @JoeWatkins
 
you are reusing an object ?
 
@salathe seems you are nervous a bit ;-)
 
@Sajad how did you get nervous from that? o.O
 
Seems like, but that [no active file] is strange.
 
11:43 AM
@salathe sarcasm?
 
is executed before entering user code ...
so this is a problem ...
Collectable will have to be an interface, so you can have a volatile collectable
 
Just had a first use case for generators, awesome stuff
 
I'll fix it later today @kelunik
oh wait, that won't do it ...
I'll figure it out so you can have a volatile collectable ... somehow ...
 
I tried to upgrade amphp/thread to amp:^1, replaced all Stackable instances with Collectable, not that familiar with the code base there.
 
lol
@WesNetmo Correct. You have won... bugger all.
@Abe :P
 
Abe
11:53 AM
:P
@PeeHaa twitter.com/WesNetmo/status/652451333459546112 only for real top gear fans
 
hehehe
 
:P haha
 
@Sjon Indeed sir
 
Hey, i have a arry with this schema:
Array
(
[0] => Array
(
[name] => test
[firstname] => Jfdfdördg
[street] => Some Str. 37
[city] => Berlin
[nr] => 6987
[benutzer] => 2
[hash] => fff32f23223f
)

[1] => Array

and like to sort the hash alphabetically increasing. i already have this function but it don't work. any ideas?
usort($data, function($a, $b) {
return $a['hash'] > $b['hash'];
});
 
Abe
user image
14
 
12:45 PM
how does php know which php.ini to take when I didnt specify it explicity?
 
@Gordon It's configured during configure, see php --ini.
 
@Gordon it's compiled in
 
ah. of course. thanks
 
groups.google.com/forum/#!topic/php-fig/wzQWpLvNSjs @JoeWatkins may also be relevant to you because of krakjoe/promises.
 
-1
Q: How to use Restful API in codeigniter with mysql database

Nilesh YadavHi dear all below is the link to create restful API and use it into the codeigniter so you can use this API for all device as one.(i.e. website, mobile apps) http://code.tutsplus.com/tutorials/working-with-restful-services-in-codeigniter--net-8814

 
12:58 PM
@Gordon "how it implements fcgi under the hood" Other than 'terribly' what do you want to know?
 
@Danack all the things
 
@salathe that is dedication. Now please make a post about how they're going to get rid of all the unnecessary {}'s everywhere in PHP.
 
@Danack I don't know yet what to ask for specifically
 
@Gordon I can probably help you with specific questions. But maybe it sounds like you're asking 'how do SAPIs' work in PHP? I don't have a good answer or resource for that, but they all work by filling out a sapi_module_struct structure (e.g. the FPM fills out cgi_sapi_module) which registers some handlers for input and output.
 
20 hours ago, by SammyK
@ircmaxell Sending the PR now... Along with changing if to fi to be more bash-y.
 
1:03 PM
@Danack thanks
I think I need to finally dive into the engine internals
 
@Danack :P
 
@Gordon probably not that far...the engine internals are probably another layer deeper than 'how does PHP-FPM do stuff'.
 
@rdlowrey ping
 
@Danack eih, I am very clueless about these things. have to change it.
 
461
Q: Sort Multi-dimensional Array by Value

stef Possible Duplicate: How do I Sort a Multidimensional Array in PHP How can I sort this array by the value of the "order" key? Even though the values are currently sequential, they will not always be. Array ( [0] => Array ( [hashtag] => a7e87329b5eab8578f4f1098a1...

 
1:11 PM
@HamZa o/
 
@PeeHaa \o
I meant use strcmp()
@PeeHaa How's life?
 
@HamZa Busy as fuck
you?
 
@PeeHaa same here
 
:)
I miss you in here. Every time I found a cool Dutch dumpert video there is noone around to share it with :(
:P
 
hehehehe
It's been a while since I watched dumpert :P
Too busy with school, just finished a guide to x64 buffer overflows
now they want me to create a repository of malware for "research" purposes...
 
Anonymous
1:16 PM
you lucky bastard :p
 
@HamZa That sounds actually cool
 
yeah, along with another project "SQL injection labs for students to mess around"
Should be easy, but I want to add a "console" to the interface
 
@Jimbo I think the recommended C book in here is Learn C the Hard Way
 
401
Q: The Definitive C Book Guide and List

lillqTo follow the example of The Definitive C++ Book Guide and List for C Books here is a wiki post for organization. A tag search for "C" and "Books" returns no complete book list results as of writing this question. That search is here. This post is to providing QUALITY books and an approximate ...

 
1:18 PM
I heard great things about "C: shooting yourself in the foot" :P
 
Cheers Hamza
 
@Fabor Noice
 
@Fabor the only thing I dislike about that book is that they "discourage the usage of IDE"...
I get their point but meh
 
I strongly hope @Trowski will realize that it's absolutely unnecessary to suffix an interface with "Interface" :-(
 
I strongly hope PHP-FIG will realize that.
 
1:20 PM
@PeeHaa lol for commnt
 
@bwoebi You don't have to convince me, you have to convince PHP-FIG.
 
How's that related to FIG?
 
@bwoebi Completely agree
 
do they require that?
 
@AnmolRaghuvanshi I don't mind people writing incorrect English sentences, but that shouts lack of effort
 
1:21 PM
I won't support a Promise PSR with PromiseInterface.
@bwoebi For PSRs, yes.
 
@kelunik bye, bye FIG……………
 
yeah PeeHaa it's lack of effort
 
Anybody have an accessible way to explain to these folk just how goddamn huge these numbers get?
 
@kelunik no comment.
 
1:25 PM
@kelunik idiot, idiots everywhere meme
 
@PaulCrovella bcpow should do the job though ...
 
no... not even close
 
@PeeHaa precisely.
 
@PaulCrovella oh, I C what you did there ;)
 
@PaulCrovella the Ackerman function always grows faster…
/me likes Knuths arrow-up notation ...
 
1:28 PM
even if bcpow could calculate it I'm not sure anyone's prepared to hang out while the thing prints out
 
user5020521
@PeeHaa what do you think of this?
 
user5020521
$idRecord = $_POST['idRecord'];
 
@PaulCrovella I just tried, it couldn't, it hanged at: bcpow(5, bcpow(5, bcpow(5, 5)));
 
user5020521
$del = $dbh->prepare('DELETE FROM tagesroma WHERE id= $_POST["idRecord"]');
 
@Riccardo990 doesn't make sense
 
user5020521
1:29 PM
so why?
 
user5020521
I am trying to tell the DELETE to fetch the $_POST
 
@Riccardo990 you're using prepare without actually using the parameters. Read about preventing sql injections
 
@PaulCrovella that's just 4^5 (that's now tetration, not exponentation)
 
Rules 1, 2 and 3 have to die. https://github.com/php-fig/fig-standards/blob/master/bylaws/002-psr-naming-conventions.md @phpfig #php
 
user5020521
@HamZa what should I do to prevent myself from being screwed up?
 
1:31 PM
@Riccardo990 0 or 1=1 might delete everything :P
 
user5020521
so what is the way to avoid this?
 
2790
Q: How can I prevent SQL-injection in PHP?

Andrew G. JohnsonIf user input is inserted without modification into an SQL query, then the application becomes vulnerable to SQL injection, like in the following example: $unsafe_variable = $_POST['user_input']; mysql_query("INSERT INTO `table` (`column`) VALUES ('$unsafe_variable')"); That's because the us...

 
@kelunik now, please all RT this…
 
Anonymous
@kelunik how will you different a trait, interface or abstract from a class then? that is the problem
 
@PaulCrovella but… it's just 10^2000 digits… (approximatively)
@samayo you don't care about that.
the IDE will tell you, and otherwise whether it's extended or implemented.
 
1:35 PM
@bwoebi 10^10^10^2000
 
@PaulCrovella I said digits… means it's on the order of 10^10^2000
 
user5020521
@HamZa in the answer pdo prepare is used to select
 
@Riccardo990 use delete instead
 
user5020521
actually I need to delete and then if I delete may I have an array inside an execute function?
 
understand the concept
 
1:38 PM
Are there any good resources out there which explain the more newer PHP OOP concepts like traits?
Looking at a book or something.
 
Yep. Room 11. Don't use traits.
 
:V
 
Is traits OOP ish?
 
1:39 PM
traits is copy/paste ish
 
Well, more concrete OOP patterns, techniques etc.
Guess my first resource is Mr. Google
 
Gang of four, :)
 
@Sean Traits are edge cases produced by single inheritance. 99.9% of the time you don't need one
 
Concrete OOP .. hm, pattern "builder" gains some .. new sense
 
@Sean there's a github repo with lots of stuff in ....someone has it bookmarked?
 
@Danack Man that's a lot to digest, fantastic!
Thanks ^^
There always seems to be a million and one new front end articles about the latest tools and techniques, but server side stuff always seems to be harder to find.
 
@Sean btw all that stuff isn't that useful without a decent thing to tie it altogether, as otherwise it's too hard to wire up into an application.
"AWS was not able to validate the provided access credentials" - the keys appear to be valid and the code used to work.....anyone know how to investigate what AWS is bitching about?
 
Depends what you're trying to access
 
just runInstances on ec2.
 
also, AWS recommend you rotate access keys, someone hasn't done that have they? If so, the keys will be different
 
1:59 PM
@tereško Have you ever successfully (using PHP) tied up websockets to your default controller / model architecture?
 
@Jimbo I have never even tried to
 
@tereško No interest in that bi-directional communication?
 
there has never been a good enough reason to
 
user5020521
@HamZa what if I converted $foo into a number by intVal function?
 
blah - it was a shitty error message. The keys are now meant to be in 'credentials' => ['key', 'secret']. It was complaining about not being able to read them from ~/aws.
 
2:01 PM
posted on October 09, 2015 by aliceljdc

/* by Frankie */

 
whenever I have tried to think through that approach, I have discovered that it requires excessive amount of engineering. It has never been the pragmatic solution.
 
@PaulCrovella eih… … oh, it's 5^5, not 4^5 …
 
@tereško I'm thinking for personal projects for that quick response, not just for commercial ones
Where you know, you're doing it for fun :)
 
@AlmaDo staged .. or that guy has never hit anyone before
 
2:13 PM
@Riccardo990 that should fix it
 
@Jimbo are you actually going to the All Your Base conf, or throwing it away/donating it?
 
@Leigh I don't know yet, I need to check the costs of the trains, hotels etc... if it's too expensive I'll donate it, if not and you're going we can have a laugh anyway
 
how big is a typical LAMP "vagrant file" and how long does it take to start it up?
 
@Jimbo It's single track, already putting me off
 
@Leigh Is there a list of talks yet?
Because they better be bloody good if there's only one track...
 
2:21 PM
Yes, there's a schedule
 
Night out in London though.
 
Come on @Fabor, get a ticket
It'll be a right laugh
 
Yeah, I got better things to spend £200+ on.
 
@MarcelBurkhard you probably mean box file, as the vagrant file is just a small bit of text. Centos ones tend to be at least 200MB
 
Like 20,000 penny sweets
 
2:23 PM
@Danack is that downloaded when typing vagrant up?
 
@Leigh Think you'd get a good amount of ££ from selling?
 
nah
 
Might make good tinder.
 
@MarcelBurkhard yes, unless it's already on your system.
you can download them yourself and put them in the correct directory for vagrant to find them, if you want to be able to download them before doing vagrant up. But just doing vagrant up is the easiest way.
 
@Danack ok thanks.
nah that'll be fine
Now I know what to expect
 
user5020521
2:28 PM
@HamZa this is the way
 
user5020521
$myId = intval($_POST['idRecord']);
 
user5020521
$del = $dbh->prepare("DELETE FROM table WHERE id= " . $myid );
 
user5020521
the hell is this? Connection failed: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
 
2:40 PM
Something's wrong with yer' query 'lad
 
@Riccardo990 Looks like you have an error in your sql syntax
 
@Riccardo990 the wrong one, yes
 
user5020521
and again error reporting reports that $myId is not defined
 
There you go then
If $myID is not defined, your query becomes: DELETE FROM table WHERE id= which MySQL will not like.
 
user5020521
<?php
    //call the connection file
    require 'connessione.php';
    //errors enabled
    error_reporting(-1);
    ini_set('display_errors', 'On');
	$myId = intval($_POST['idRecord']);
    try {
		$dbh = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password);
        // set the PDO error mode to exception
        $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
        $len = count($myId);
		$del = $dbh->prepare("DELETE FROM tagesroma WHERE id= " . $myid );
		$del->execute();
 
2:42 PM
Highly recommend learning about sanitising and validation, so you never get to that point in your code
 
user5020521
where the hell am I wrong?
 
@Riccardo990 either step through it with a debugger, or just use bound variables to avoid this problem to begin with.
 
@Riccardo990 Variables in PHP are case sensitive.
 
There you go, quick answers ;)
 
...which leads to an interesting question of how the 'undefined variable' error message was missed.
 
user5020521
2:44 PM
@Danack @kelunik thank you I'm really trying to do it
 
user895378
@FlorianMargaine pong (delay)
 
user5020521
var_dump($myId); might it be useful?
 
user5020521
when dumped $myId is 0
 
So fix that ;)
 
user5020521
@Jimbo this is the last one left
 
user5020521
2:48 PM
Undefined index: idRecord
 
user5020521
I've just fixed myId
 
@Riccardo990 Why do you think idRecord doesn't exist?
 
github.com/thenable/promise/commit/… My problems with Thenables… basically, Thenables are a subset of Promises. All promises need is done(). Everything else is mixing Promisor and Promise responsibilities into Thenables… \cc @rdlowrey @Trowski
 
user5020521
I actually don't think idRecord does not exist php just doesn't see it
 
@Riccardo990 So you think there's a bug in PHP?
 
user5020521
2:49 PM
the hell no I just don't know
 
user895378
@bwoebi Yeah, I don't really care. I seem to be the only one in the PHP world who thinks thenables are stupid.
 
user895378
(they are)
 
@Riccardo990 Do you know what $_POST['idRecord'] is?
 
user5020521
idRecord is a parameter that I am attempting to pass from ajax js to php
 
user895378
They're a poor abstraction and even javascript is moving away from it.
 
2:50 PM
@rdlowrey Well, we're three… me, you and @kelunik ^^
 
user895378
It's like everyone in php is five years behind javascript.
 
@Riccardo990 Cool, seems like the problem might be in your ajax call?
 
@rdlowrey do they?
 
user5020521
in my ajax call I got this
 
@rdlowrey Of course they are, lowest barrier to entry
 
user5020521
2:50 PM
xmlhttp.open("POST", url + "?idRecord=", true);
 
@Jimbo the lowest barrier would be actually simple Promises with just when() (or done() or whatever it's called)
 
@Riccardo990 So, your key value pair, idRecord, doesn't have a value
 
user5020521
it should have it
 
?idRecord=LOL would mean $_GET['idRecord'] would = "LOL"
 
@Jimbo Wrong ;)
 
2:52 PM
And in general, we can make simple when-Promises the PSR, thenables are a superset of Promises and people can use these in their libs.
 
@PeeHaa It's friday
 
I assume xhr calls would work the same as normally in that querystrings are always GET
 
@Riccardo990 There you go, it's GET you're passing through, not POST
 
@Jimbo Fuck right it is!
/me has been drinking since 11 :P
 
2:54 PM
@PeeHaa Going to test ride a 35mph electric bike tomorrow
for a laugh
 
user5020521
I bellieve to pass POST not GET
 
user5020521
how the hell am I passing GET?
 
user5020521
 
user5020521
go see the fiddle please
 
xhttp.open("POST", "ajax_test.asp", true);
xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xhttp.send("fname=Henry&lname=Ford"); <---- set your stuff here, not in the url bit
Dude, just read the manual
 
2:55 PM
@Jimbo lol
 
@Riccardo990 Issue is that you believe, you don't know.
 
@Trowski @rdlowrey what I actually can live with is having separate functions for failure and success… but everything else should be mostly like Amp/Promise (watch isn't necessary, but talking of when())
 
user895378
For completeness, I should say that I don't actually think thenables are bad. Functional pipelining is good ... I just think coroutines are better than artificial flow control with .then() in a userland API
 
user5020521
@kelunik is @Jimbo giving me the bug fixing?
 
user895378
Yeah the single method function with error-first parameters is just a performance thing
 
2:57 PM
@rdlowrey and ultimately, that's what Amp\pipe() exists for… we create a new deferred we control and return there.
 
@bwoebi With separate functions we loose the error first advantage.
 
user5020521
should I set the request header
 
user5020521
@Jimbo did you look at my fiddle?
 
@Riccardo990 That's what you got from that copy and pasted example, with a comment in it? Don't set your ?idRecord bit in the url. Set it in the send method
 
2:57 PM
@bwoebi Amp\pipe isn't that good for pipelining.
 
@kelunik oh, why?
 
@rdlowrey How does this check out ... service locator or appropriate use of auryn in a factory.
 
@kelunik you'll still have to done(null, function($result) { ... })
 
user5020521
@Jimbo so I just remove it from there and set it in the send
 
@bwoebi Because it doesn't work that fine with chaining, same issue as all array_* functions in PHP.
 
2:59 PM
@rdlowrey not even sure here… what we gain by just one function is already lost by the typical if ($e) {} branching
 
good morning btw
 
user895378
@Orangepill seems fine to me. It's giving them an extra layer of abstraction on top of auryn shielding them from any API changes that may occur down the road (a good design strategy)
 
@kelunik you shouldn't multilevel chain a Promise in one same place…
 
user895378
@bwoebi well you're more knowledgeable on that specific perf front than I am, so I'll defer to you on that
 
my head feels like I probably did things I wouldn't normally do yesterday
 

« first day (1819 days earlier)      last day (3126 days later) »