« first day (1011 days earlier)      last day (4163 days later) » 

15:00
i have a doubt on looping a result
is any one free to answer
?
@Manoj drop your Q and we'll see ...
thank youy hamza... i ll explain now
PLB
PLB
How safe is having class name in name attribute (For example, <input type="text" name="namespace\class[propertyName]">)? I use this to simplify data binding, i.e. don't use user-input to create object.
@crypticツ You haven't checked out kimsufi.co.uk - way cheaper
@DaveRandom jollyGood();
i am using amazon mws and i get the result in the following format like this
Amazon_Marketplace_Reports_ListInventoryReport_Results Object ( [outputArray:protected] => Array ( [ReportRequestId] => 7602145812 [GeneratedReportId] => 11788887823 [Report] => sku asin price quantity 0010900 B005KDEHB0 5.99 33 0011023

how can i get only the asin from this @HamZa
15:03
@Manoj what is "asin" ?
asin is a unique number to represent the product in amazon @HamZa
@Manoj so this is 0010900 B005KDEHB0 5.99 33 0011023 asin ?
this one? asin ... B005KDEHB0
@Manoj ok, you know how to get sku asin price quantity 0010900 B005KDEHB0 5.99 33 0011023 ?
sku 0010900
asin B005KDEHB0
price 5.99
quantity 33 @HamZa
these are the related fields over there... but the format it is displayed like the first one i posted
yes
@HamZa
15:07
@Jimbo I want something in the US. This datacenter is 10 minute drive from where I live.
ok then you have a string like this
sku asin price quantity 0010900 B005KDEHB0 5.99 33 0011023
If you know that it's going to be always like this, why don't you use explode ?
@HamZa Ah je me disais bien que tu parlais français, à en juger de ton prénom
@Alucard my first name isn't french :p
@HamZa it contains more like this ... so i think we cant explode
Amazon_Marketplace_Reports_ListInventoryReport_Results Object ( [outputArray:protected] => Array ( [ReportRequestId] => 7602145812 [GeneratedReportId] => 11788887823 [Report] => sku asin price quantity 0010900 B005KDEHB0 5.99 33 0011023 B002C0ANW6 47.33 60 0033720 B003BHWVOM 81.70 3 0042119 B000IJSSKC 79.27 18 0057307 B001ET6WFI 2000.00 289 0081760 B00063ZVK0 114.99 19 0121178 B002NKVXH4 728.98 1 0150250 B000PWCNVW 1116.45 1 0395343 B001H1GQ8G 24.92 36 0505594 B003P9WJKW 215.35 5 0505636 B0010777EY 332.17 2 0594135 B004GCGZCA
@Manoj Please, how are you getting this ? Are you viewing it from a browser ? then view the source
15:11
@crypticツ How about digitalocean.com/pricing ?
i saw the view source from browser @HamZa

it displays like the below
Amazon_Marketplace_Reports_ListInventoryReport_Results Object
(
[outputArray:protected] => Array
(
[ReportRequestId] => 7602145812
[GeneratedReportId] => 11788887823
[Report] => sku asin price quantity
0010900 B005KDEHB0 5.99 33
0011023 B002C0ANW6 47.33 60
0033720 B003BHWVOM 81.70 3
0042119 B000IJSSKC 79.27 18
0057307 B001ET6WFI 2000.00 289
@Manoj See, there are newlines, now it's just a matter of exploding
@HamZa Or, use the API that the object presumably provides
@salathe heh indeed
@HamZa thank you i ll try ur suggestion
@can u suggest me the code to explode for this format
@HamZa
15:18
@Manoj or you could try it yourself with the help of php.net/manual/en/function.explode.php
@cptnk i feel a little
confused because of these lines here
Amazon_Marketplace_Reports_ListInventoryReport_Results Object
(
[outputArray:protected] => Array
(
[ReportRequestId] => 7602145812
[GeneratedReportId] => 11788887823
[Report] => sku asin price quantity
$string = 'sku asin price quantity
0010900 B005KDEHB0 5.99 33
0011023 B002C0ANW6 47.33 60
0033720 B003BHWVOM 81.70 3
0042119 B000IJSSKC 79.27 18
0057307 B001ET6WFI 2000.00 289';


$lines = preg_split('#[\r\n]+#', $string);
$headers = explode(' ', $lines[0]);
for($i=1;$i<count($lines);$i++){
	$results[] = array_combine($headers, explode(' ', $lines[$i]));
}

print_r($results);
@cheesemacfly fancy
@HamZa preg_split('#[\r\n]+#' -> preg_split('#[\r?\n]+#'
@Neal For the price, I would say the service is pretty good
that doesn't make sense
remember [] is a character class
@Manoj I still think your using the amazon api in an inappropriate way. As this "string" you are showing us describes a object.
I think I should comment this code line… I'm sure in a few weeks I won't understand anymore what I've done here :o $query .= " $table (".implode(", ", array_keys($fields)).") VALUES (".implode("), (", array_map(function ($i) use ($fields) { return "'".implode("', '", array_column($fields, $i))."'"; }, range(0, count(current($fields)) - 1))).")";
@HamZa let me try that
oh okay
@HamZa Oh yea, forgot it was in a class, I don't usually use those in preg_split, I like to preserve blank lines, so when I iterate over the result, I can give accurate line numbers
15:24
@crypticツ Yep, well you can choose America when you go with kimsufi too, they have data centers in northern france and east northern america
@Jimbo and Germany
@Leigh gErMaNy
Home of germs
Lol
I think that the German word for germs should be... Germenschwunden
@Neal Interesting. A friend of mine recommended Linode too but the cheapest VPS is 4 times the one from DO. For what I use it, DO is doing good! (I was with AlienLayer before so anything is better)
15:26
But it's actually Keime according to google translate
@cheesemacfly hmmm
hey guys can you help me?
@Jimbo keim is like, germination, krankheitskeim is for disease-like germs
guys???
user895378
> Discussion for all things PHP - Don't ask whether someone is here to help you. If someone is around and wants to help they will.
15:28
does anyone here know anything about the facebook API?
@Leigh [\r\n]+ will even match \r\n\n\r\n\n\n
@David No. No-one.
sorry and thanks
@HamZa Yea, I don't like that, that should never happen
@David The FB API does
15:28
it sucks
@HamZa I hope you're exploding on tab characters there.
seriously though does anyone know how to use it?
you have to be logged in the get a companies public statuses which does not make sense to me
@salathe those are spaces :p
is it possible to json encode a number of records in mysql db into a json object
?
4
A: Explode text into array as per paragraph

HamZaYou might be on Windows which uses \r\n instead of \n. You could use a regex to make it universal with preg_split(): $array = preg_split('#(\r\n?|\n)+#', $test); Pattern explanation: ( : start matching group 1 \r\n?|\n : match \r\n, \r or \n ) : end matching group 1 + : repeat one or more ti...

^ how about this ?
15:30
guys?
is it possible?
or is a number of jsons being passed?
@sharath why don't you try it out ?
user895378
@Baba Who knew PHP was capable of such awesomeness!
15:31
@HamZa Why would you do \r\n?|\n, when you can just do \r?\n
@rdlowrey almost there ...
@rdlowrey let you know when am done so that you can test
:)
user895378
@Baba Whenever :)
user1125394
anyone know how to make this less verbose, basically I would like to filter my table and then join vpaste.net/Ssgwf < but it's somewhat repetitive
\r?\n will match \r\n and \n
While mine matches \r\n, \r, \n :)
@HamZa Why would you want to match \r on it's own. It only comes from OS9 (and older) files, which should die
15:33
@Leigh haha cross platform, cross platform !
@HamZa then you need to also match \n\r for old BBC micros
@HamZa Shame, the data is tab-separated
it should be matched :)
ya know
\n and then \r :p
Hyuk hyuk.
Buy faster hardware, it's cheaper than programmers. — Bracketworks 44 secs ago
@salathe Can't be helped, maybe because SO converted it to tabs? Here it's all spaces
anyways I don't care that much, I mean I wrote almost all the code for him.
@salathe I would preg_match it all hahahaha
@HamZa Regex All The Things!
OK guys, gotta go ...
Btw nice code @salathe :)
15:38
@HamZa ciao
the is kicking ass and taking names today
user1125394
is this sql query all right:
user1125394
select MAX( a.balance - b.balance)/a.balance, MAX( a.balance - b.balance) from orders AS a inner join orders AS b ON a.ct < b.ct AND a.balance > b.balance where concat(a.broker,a.broker_user) IN($as) AND concat(b.broker,b.broker_user) IN($as) and (a.type='sell' or a.type='buy') and (b.type='sell' or b.type='buy')
user1125394
(big repetition in the where clause for both a and b)
@HamZa I agree, in most cases exploding on \rwon't break anything. I do \r|\n as well.
$lines = array_filter(array_map(function ($line) {
    return trim($line);
}, preg_split("/[\r\n]/", $input, null)));
user1125394
15:47
!!am I on global ignore list:p?
@cx No
user1125394
not yet cool
@DaveRandom Where is the source? :)
@ircmaxell: PHPs' crypt() has a problem taking NUL bytes as salts: 3v4l.org/eXBed - how is this best reported?
@cx does it give you what you want? from the surface it looks okay.
15:49
@salathe It's on GitHub, but I'm not telling you where until I've tidied it up :-P (it's just a proof on concept and it's a procedural spaghetti mess at present)#
It'll be good to go in the next couple of days though
@salathe Generally check out github.com/PHP-Chat
user1125394
@Orangepill it does work thanks, but I'm wrting twice the same where expression for each joined tables
@DaveRandom Ah cool
Thinking about the rules for a parser of a DSL that is whitespace driven. Taking HAML as an example, a tree of nodes can be defined like:

%html
    %head
        %title
user1125394
@DaveRandom hi man, any sql comment :)
Wondering what rules I should have about mismatched whitespace like:

%html
    %head
        %title
      %meta
       %link

So meta and link are still obviously children of head, but is link now a child of meta?, what is metas relation to title?
15:51
@cx -- This is an SQL comment
Or do I just call the whole thing illegal
user1125394
@DaveRandom ## grr
@cx Can you make it a bit more readable?
user1125394
it's hard for me
Actually, can you make a fiddle?
@Leigh You should call it illegal and go round to their house and beat them with a large fish.
I hate that kind of thing. Either indent properly or minify. Half way between and complete randomness is totally unacceptable.
user1125394
15:55
user1125394
see the rapidity
@DaveRandom Was thinking about saying anything that falls between currentIndent and parentIndent is part of currentIndent. You have to go beyond those boundaries to create a new indent level.
@cx OK, and what's wrong with it? (i.e. what do you want that it doesn't give you?)
user1125394
bah it's ok..
So just kind of code review?
user1125394
15:57
yep
Looks fine to me as long as your date/balance columns are properly indexed
And obviously redundant second b.type = 1 is redundant, but I guess that's not in your real codez
user1125394
there are several different types and users, how b.type would be redundant?, I need to make sure to calculate the 'drawdown' of a specific user, for these types
@hakre what's going on there?
@ircmaxell In my understanding crypt should use 16 NUL bytes as salt if provided that way. In PHP it does not.
16:04
it should throw that salt away, as it's invalid
@ircmaxell it isn't invalid.
> For the SHA-based methods the SALT string can be a simple string of which up to 16 characters are used.
The Law of Demeter (LoD) or principle of least knowledge is a design guideline for developing software, particularly object-oriented programs. In its general form, the LoD is a specific case of loose coupling. The guideline was invented at Northeastern University towards the end of 1987, and can be succinctly summarized in one of the following ways: * Each unit should have only limited knowledge about other units: only units "closely" related to the current unit. * Each unit should only talk to its friends; don't talk to strangers. * Only talk to your immediate friends. The fundamental no...
^^ is the last sentence of paragraph 2 under "Advantages" correct?
@hakre interesting. I don't know
bring it up on list
@ircmaxell well which list? Should I just include all in akkadia.org/drepper/SHA-crypt.txt ??? :D
I mail that guy first, maybe I get a response.
16:10
Kool story bro. — Neal 44 secs ago
@iroegbu I would not assign "correct" or "incorrect" to any of it. The best description seems "blah" .. or whatever name you give to the type of content that students create in order to grow a badly written research paper to the appropriate size, by inserting meaningless content.
@hakre I'd actually mail crypt-dev on openwall
okay, will do, sounds good.
there's not a lot of activity, but the people there are the ones who maintain libcrypt
@tereško it seems to be against the summary at the top (3 points). How can talking to fewer people generate more words than talking to more people?
16:14
wut
http://hasin.me/2013/07/23/css3-storyline-animation-using-jquery-transit-library/
Planet PHP
CSS3 Storyline Animation using jQuery Transit Library
Hasin Hayder
1374594840
Anonymous
http://stackoverflow.com/questions/17815078/pdo-multiple-statements
@Feeds thank you .. another "I suck at javascript but want to show off" article was exactly what i wanted.
@tereško You would freak if you saw what I'd written about 'mvc' for my dissertation. 80% of it was meaningless content.
@Feeds what's with these people I've never heard of, publishing to planet-php?... about CSS and jQuery!
16:19
@tereško lol
@Jimbo naah ... i would freak if i saw you referring to CodeIgniter as "MVC framework"
what does exit_status() do ? i can't find anything on it
@bushdiver nothing. It's not part of PHP: php.net/exit_status
Anonymous
Zzzz...
4 pinned messages too many.
16:23
On a laptop I can see only 3 messages (on a good day)
@tereško thanks
Anonymous
The php manual makes it too vague to understand the differences b/n bindparm() and bindvalue()
Anonymous
anyone know the differnce?
Anonymous
@tereško if your feeling teachy...
one binds the reference
user1596138
16:26
It's odd having never used a server without register_globals on and now I am.
@rdlowrey simple app ready ... raw canvas
user1596138
Keep fucking stuff up. Haha
user895378
@Baba excellent.
Anonymous
what is the reference?? that is what I dont get @tereško
@rdlowrey UI taking take but it still works .... enough for today
@rdlowrey do you have any j2me emulator or phone
user895378
16:27
I don't, though I can probably download one.
@rdlowrey Oh ok
@Simon_eQ if you use bindParam() and then change the value of that parameter, then the bound value will also change
@rdlowrey you can put on your server protocal_mod ... so that i can make it work with that
user895378
@Baba Are you asking if I can run the protocol_mod.php server from my machine?
I need an array-reduce function where the key is also passed to the callback …
16:32
@rdlowrey yes
user1596138
Why in the hell is _SERVER["PHP_AUTH_PW"] plaintext?
why not?
what would you expect it to be?
@Jhawinsss That's how it comes over the wire....
user895378
@Baba Okay, it's running at 174.107.156.0
@Jhawinsss that's why you should be using HTTPS
user1596138
16:33
It's just odd. I know no one should have access to any of it, but you don't often see passwords in plainText, anywhere.
@Jhawinsss sure you do
@Jhawinsss bullshit
just not stored plaintext
user1596138
Examples speak louder than opinions ;)
user1596138
That wasn't meant to be passive-aggressive as it may sound.
16:34
@rdlowrey cool one moment
tinyAvatar++
@Jhawinsss you need a plain text password , that can be hashed and matched against the stored hash
i have a form with method="post", but $_SERVER['REQUEST_METHOD'] is returning GET on the request side, how could this be?
AFAIK all passwords are sent plaintext...
@Orangepill No, there are mechanisms like DIGEST which don't send it plain text
user1596138
16:36
@tereško Of course. But it isn't usually stored for any significant amount of time as plainText. The variable should be emptied
@bushdiver because it's not set as POST
> Watch out for buggy Internet Explorer browsers out there.
Anonymous
@tereško still thinking about this, and makes a little sense. I can only call bindParam() once. like $stmt->bindParam(1, $foo, PDO::PARAM_STR); I dont see a case where I need to change anything in that
should say watch out for internet explorer (sauce)
@Simon_eQ prepared statement , where in loop you are executing it with different values . prepare once, bind once ... execute multiple times
16:37
I always smile when I find an excuse to use my old friend do {} while();
user1596138
Of course they are plaintext at some point.
@tereško hmm I just tried as method="POST", but got the same thing (GET)
@bushdiver look in browsers dev tools (network tab).. how is the request sent ?
it might be some XHR-related bug
GET method in networks tab..
well .. then look at you code
how is the form submitted .. is it done by JS or natively ?
is the HTML valid ?
user1596138
16:40
I just cringe every time I see my password...
@Jhawinsss then stop using passwords that make you cringe
@rdlowrey ChatForm.run.IOException :Untrusted MIDlet attempted to connect to a restricted port .. I wonder .. let me figure that one out
user895378
@Baba I wonder if the j2me doesn't let you connect to port 80 by default :)
user1596138
@tereško I'll start using hashes of my own, which are then hashed as passwords... That'd be wild.
@rdlowrey Maybe ....
@rdlowrey am seeing this for the first time
@tereško thanks for the help, the problem was between the keyboard and the chair
user895378
@Baba Well if it requires a different port the server can do that too, of course.
@rdlowrey lets give it try
user895378
@Baba Which port number do you want me to open up?
16:48
@rdlowrey 1337 is a good one
user1596138
@Baba 539
user895378
@Baba Up and running at 174.107.156.0:1337
@rdlowrey works perfectly
user1596138
@Baba Huh?
16:53
@Leigh I would say whitespace rules as 0 or 1+: given 0, they are siblings, given 1+, they are children.
user895378
@Baba Cool. I guess the emulator just doesn't like it if you try to connect to a port it knows belongs to HTTP :)
@rdlowrey hehehehe
@rdlowrey Fun!
user895378
@Neal :)
17:02
@rdlowrey nice!
@rdlowrey I had a web chat app a couple years ago... it seems it was deleted (I forgot to pay for the server... rrrg) and I had no backup... :-(
user895378
To whomever was asking what library does that ... I just started up a static http file server using it at 174.107.156.0 ... should answer your questions.
user895378
DAMN IT. Stop breaking my JS. It's a demo.
user895378
It's not a production-ready battle-hardened javascript. I'm not filtering your input you monkeys.
ehh .. another "twitter bootstrap" page
user895378
17:06
@tereško I don't have time for CSS. I need something readable that doesn't waste my time. It's not a "page"
user895378
It's a stopgap so I don't have to answer questions.
@tereško Y U NOT LIKE BOOTSTRAP?
user895378
@Baba FYI: I'm stopping the server on 1337
the same reason people don't like mumford and sons anymore, its overplayed
user1596138
17:18
@rdlowrey I love the "This link doesn't go anywhere" haha
30
Q: How does this regex find triangular numbers?

polygenelubricants Part of a series of educational regex articles, this is a gentle introduction to the concept of nested references. The first few triangular numbers are: 1 = 1 3 = 1 + 2 6 = 1 + 2 + 3 10 = 1 + 2 + 3 + 4 15 = 1 + 2 + 3 + 4 + 5 There are many ways to check if a number is triangular. There...

^ highest art of regex :O
I hate it to type accidentally $this in static functions :-( I do it too often…
@rdlowrey ok
17:43
@bwoebi It's especially bad if you call it within an instance method of object of another class... then $this is the wrong object :(
n/m I'm all wet on that one...
I was thinking of the behavior where you statically call a method that was not defined static... $this becomes the caller.
18:13
all your regex freaks: Should I do . with s (DOTALL) -or- just \C to match every byte (non UTF-8 mode)?
either
18:28
wow, now that's a puzzle I created for myself now.
I have a unit test that is always providing the same data.
and the code doesn't change.
however sometimes the tests pass.
but sometimes they fail.
could it be that LSB in PHP has timing issues?
what test?
HUH?
test/Unit/Password/Implementation/SHA256Test.php
there's a random component there
the salt generation...
so that's a possibility
can you paste the code?
Is it a valid use case of goto to jump around in switches? Or is even this use evil?
Does anyone know ajax?
and Jquery?
@ircmaxell the salt generation is mocked, isn't it?
In computer science, Duff's device is an optimized implementation of a serial copy that uses a technique widely applied in assembly language for loop unwinding. Its discovery is credited to Tom Duff in November 1983, who at the time was working for Lucasfilm. It is perhaps the most dramatic use of case label fall-through in the C programming language to date. Duff does not claim credit for discovering the concept of loop unrolling, just this particular expression of it in C. Background Loop unrolling revolves around lowering the number of branches made, by batching them together. To ha...
but if not for that test, it could explain it.
@hakre Sometimes, not always
18:33
I will debug this.
@ircmaxell It's: I want case a do some thing, case b some thing, case a, b and c the same thing and default another thing. How to in PHP without goto?
and without too many ifs
@bwoebi what?
@ircmaxell do you know how to use ajax to parse a php json encoded array?
can you show an example
@EliteGamer "use ajax"?
here is the PHP
$UserData = array(
    array(
        "User" => $twitteruser,
        "ProfileLink" => $ProfileLink
    ));
 echo json_encode($UserData);
here is the ajax
				$.getJSON('/tweet/tweets.php', function (Username) {
					var Username = UserData.User;
					var $TwitterUser = $('#twitterbox').contents().find('#usr');
					$TwitterUser.html(Username);
				});
18:36
@ircmaxell how to rewrite switch ($var) { case 1: do_1(); goto case_3; case 2: do_2(); /* fall through */ case 3: case_3: do_3(); break; default: do_default(); }?
idk why it is not working
or is this correct use of goto?
@EliteGamer #1. That's not "ajax", it's javascript. 2. Don't use .html(), use .text()
@bwoebi case b: ...; case a || c: break; default: break;
@cheesemacfly that doesn't exist?
18:37
i thought getJSON was a ajax function?
if you don't use break it goes to the next statement
a||c is evaluated as boolean expression
@cheesemacfly switch (0) { case 0||1: echo "never reached"; }
@ircmaxell but why is it not working. I have everything typed correctly
@bwoebi you're right. the idea was more to play with the break statement
@rdlowrey Ping
18:44
@bwoebi I don't understand your code sample. It doesn't do what you describe earlier, right?
OOP oddities 2: I cannot instantiate an object and passing parameters to the constructor via call_user_func_args() without some ugliness: call_user_func_array([new ReflectionClass("classname"), "newInstanceArgs"], func_get_args());
@cheesemacfly it does…
@bwoebi That code doesn't make sense
@hakre E_CONTEXT?
@NikiC it doesn't, but it works.
Why not just (new ReflectionClass("classname"))->newInstanceArgs(func_get_args()) ? I.e. why the additional call_user_func_array around it?
18:50
Does anyone know how to parse JSON from a PHP array with Javascript?
Jquery
@hakre if anyone believes that, they are still sheep
@NikiC going to reread the manual…
actually, I'm pretty sure your code doesn't work, unless you use "newInstance" rather than "newInstanceArgs"
@ircmaxell and give wool, sure.
the thought that FF is any better or safer or more private than chrome. The thought that DuckDuckGo is any more private... Really shows a lack of... sanity
18:52
@NikiC I had tried with one single parameter, there it doesn't make no difference.
however not relying on proprietary services has a benefit.
@ircmaxell yes, it's a bit of not so well done.
@NikiC I now see that I had used the wrong function…
there was a great post about how DuckDuckGo is no more private than Google, namely because of the detail of "who" is able to track you. All DDG does is remove Google's direct ability, but everyone else in the stack can...
@NikiC But this is still ugly: I need to instantiate an object to instantiate another :o
@ircmaxell I think that startpage is better for that.
18:54
@ircmaxell Did you find out what i did wrong?
no, I didn't even look at it
@bwoebi yeah, I know. new ClassName(func_get_args()...) is how it should look like :)
user895378
@Jimbo yo.
oh, ok
could you
@NikiC Oh if only...
18:56
maybe I should finally implement that...
@NikiC in C you're creating macros like FUNCTION_X_PASSTROUGH for example… looks really nicer in this way
@NikiC please
and let it accept an arbitrary iterator :-D
@ircmaxell That's pretty much the thing that's holding me back ^^
Accepting an arbitrary iterator is hard
18:58
let's refactor until it's easy
@ircmaxell refactoring is hard...
though, if it's only arrays + get_iterator (no std objects), then it wouldn't be that much code
but still, a unified iteration api would be nice ^^

« first day (1011 days earlier)      last day (4163 days later) »