« first day (670 days earlier)      last day (4294 days later) » 

12:03 AM
I just got the badge. I have 16 now :-)
 
@ShaquinTrifonoff: codepad.viper-7.com/qnmiND
 
@Jocelyn Two evals??
 
yes, twice as much fun
 
word
 
You can never have too much eval
 
12:10 AM
so you can have lots of LittleBobbyTables messing with your code :-)
 
it crashes
 
... prog.php(2) : eval()'d code(1) : eval()'d code on line 1
Exactly.
 
@ShaquinTrifonoff forgot a semi-colon
 
eval()'d eval()'ed code, that's the point...
 
12:16 AM
I posted a question regarding an "incorrect" answer to a mathematical equation in my php/mysql script: (link) stackoverflow.com/questions/11978708/… Can someone tell me what I'm doing wrong?
I tried all suggestions posted, and can't seem to get the correct result
 
@phgdanny: can you add in your question the data in your table? (only the data used by your query, if there is much)
 
sure i'll do that now
 
@ircmaxell @Jocelyn @cspray - Who can decode this first: ideone.com/rW8Jx :-)
 
If I had to guess...not me
 
@cspray - It's 'just' Base64 encoded...
 
12:27 AM
eval(eval(eval(eval(eval(eval(eval(eval(eval(eval(eval(eval(eval(eval(eval(eval(‌​eval(eval(eval(eval('echo "The Twenty Evals of the World!";'))))))))))))))))))));
 
@Jocelyn Well done!
 
found after 5 calls to base64_decode()
 
@Jocelyn just did it!
 
Here is how I made it: ideone.com/uvZom
I'm working on a harder one now... >:D
 
@ShaquinTrifonoff I have a new one but it is over 70MB long...
 
12:34 AM
@Jocelyn Hrm. I would have to download it then :-) Is it Base64?
 
yes
 
I'm making one with US-Government grade encryption :-)
 
:-D
my web browser doesn't like it
 
No. It wouldn't...
 
maybe the text line is too long
 
12:36 AM
Sounds like it. Browsers don't usually handle 70MB data.
 
12:53 AM
Done.
SzJwd1NHeERSMEpIVEZOa01FNW1jMnhNTmxrMlYwbFpXSGx5WW1wckwwZ3hSbVl3YUdGaGNXZzFORVJ6UWxCNVMwbHdMM1k1TmprdlZuRmxlRFpTV2tkNEsyNUtSVWhoTlhScE1uSkVhRVJEY0RCdlVGRTlQUT09
All I can tell you: It involves OpenSSL, my profile, Base64, and blah.
Please, at least try to decode it!
 
Jocelyn-fatal-error: user is too tired now!
 
:) Maybe tomorrow...
@Jocelyn
 
1:10 AM
my text editor is telling me how much it doesn't like to display huge text strings :-D
 
1:21 AM
Use Notepad++ @Jocelyn
 
@ShaquinTrifonoff or sublime
 
even n++ chokes on huge text files
100MB + is a pain
 
1:52 AM
ö
 
2:05 AM
@orourkek what's javascript? also, how to square number in jquery?!
@Jocelyn vim
 
2:29 AM
@Jocelyn I'm downloading your 76.2MB file (so3.php) now. Going at 100KB/sec.
 
@Petah: notepad++ could display the file, but takes lots of CPU and RAM
 
2:45 AM
@Jocelyn I'm attempting to open the file in Notepad++ now...
It's frozen.
Actually, not frozen, it's just not displaying it. I can switch tabs fine.
The DOS command type is still good...
Notepad++ is still working away at the CPU and RAM.
 
morning
 
Good morning, @tereško.
Can you decode the data here?
 
why should i ?
 
You'll get a message...
@Jocelyn Your data is a bit of a problem...
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 79918313 bytes) in C:\Apache24\htdocs\decode.php on line 3
 
3:00 AM
you need to increase the RAM for PHP, in php.ini file
 
@Jocelyn I've only got 1GB ram though, there might not be enough :-)
 
Increase the RAM limit to 512MB
 
That's the problem...
This screenshot is without PHP.
 
I have only 200MB of RAM available, and I could run my script (it used virtual memory instead)
 
@ShaquinTrifonoff memory is pretty good value, 1GB is probably making the rest of your hardware appear slower due to swapping and using your hard disk instead of memory.
 
3:08 AM
@Jocelyn Okay, I'll give it a go then.
Bear in mind, though, that I only have ~130MB of RAM available...
 
what is your script doing with the data?
 
<?php
$data = file_get_contents('C:/Users/Shaquin/Downloads/so3.php');
file_put_contents('decoded-' . time(), gzuncompress(base64_decode($data)));
?>
@Jocelyn
I increased the memory limit, and now it isn't showing that error :-)
 
OK
 
@Jocelyn Is it encoded in any other way than Base64?
 
no
 
3:18 AM
@Jocelyn Not encrypted?
 
no
errors?
 
First 100 chars:
çUfÓvC%•U†Åetw…ucCEc—u¤E%tÕfÃ5vµ%5cv$D冥Ef¤…c$¤UFƆ„ÕWUf×&Te—•6µeV$v†õEeguee§F4T¦Å&ÆÃUS'
 
why gzuncompress?
 
@Jocelyn I was trying that because it looked like compressed data, but it didn't work.
 
@Shaquin there is a problem in the data
the first character should be "V", you must ignore what is before
(the first 3 characters)
 
3:27 AM
@Jocelyn I initially thought that...
But base64_decode doesn't work when it starts with V.
I've got this:
ÕY´ÁݐÉEåUa±Y]á]XÁÑXÅeÝiI]5Y°Í]­IMXÀÅ]‰9a„Å)QY©áXÉ)Q±¡¡5UÁUYµÁ •eåM­YU‰¡½QYYÝYYiэ)±I±°ÕTÉÑ
When I use this:
<?php
$data = file_get_contents('C:/Users/Shaquin/Downloads/so3.php');
$data = substr($data, 1);
// file_put_contents('decoded-' . time(), gzuncompress(base64_decode($data)));
$result = (base64_decode($data));
echo substr($result, 0, 100);
?>
 
$data = substr($data, 1);
there is not just 1 character to remove
3 characters
I manually removed them from my data file
 
I tried 3 but base64_decode didn't work. I don't really know if I'm making progress or not...
ï¿^íÞŸó½ùï—_ïŽ÷uíýí¿^ï×›ç§ù{·^å×yw¶ù{—^íÎ÷åþøï¾^íÎ÷õæýï—^m×{åíÝ{—]×»w§øïW^åÞ½uíÝ{W^íÎ÷ã½ý{—_Ý×{å×Ýy
 
I just checked, it works fine
The expected result is a short sentence (8 words)
 
With $data = substr($data, 3); I get the original, non-decoded text.
 
use trim() too
$data = trim(substr($data, 3));
 
3:42 AM
@Jocelyn I'm still getting this:
Vm0wd2QyUXlVWGxWV0d4V1YwZDRWMVl3WkRSV01WbDNXa1JTVjAxV2JETlhhMUpUVmpBeFYySkVUbGhoTVVwVVZtcEJlRll5U2tW
as the first 100 chars.
 
looks good
you are not finished yet
 
@Jocelyn So it's not Base64??
 
it is
I get the same as you, for the first 100 characters
 
But when I use $data = trim(substr($data, 3)); I get the original, non-decoded version.
Oh. I think I get it now...
 
the first 3 characters was a mistake, there are no more characters to remove after that
 
3:51 AM
@Jocelyn What I mean is when try base64_decode($data); with $data = trim(substr($data, 3));, it returns the original data. When I try it with the original $data or with $data = substr($data, 1);, it returns some binary data.
 
the 100 characters you posted earlier are correct
there is more processing to do
 
@Jocelyn Okay, I'll try to process it more :-)
 
display strlen($data) before and after decoding
 
@Jocelyn I saw the difference earlier, but it didn't click. I wont limit the output to 100 chars then...
Oops. Browser doesn't like 59MB of data. Forgot.
 
just display the strlen()
 
4:00 AM
Before: 79918308
After:  59938729
 
the decoding is not finished
 
@Jocelyn I know, I'm just trying to isolate the changed part first...
@Jocelyn Okay, so it is just base64_encoded again and again like I originally thought, until I saw the first 100 chars were the same :S Still decoding it...
FINISHED!
Result:
79918308
59938729
44954045
33715532
25286648
18964984
14223736
10667800
8000848
6000636
4500476
3375356
2531516
1898636
1423976
1067980
800984
600736
450552
337912
253432
190072
142552
106912
80184
60136
45100
33824
25368
19024
14268
10700
8024
6016
4512
3384
2536
1900
1424
1068
800
600
448
336
252
188
140
104
76
56
42
This is a completely useless line of code!
 
:)
 
With this PHP:
 
it is faster at the end, when the data is getting smaller
 
4:13 AM
<pre><?php
$data = file_get_contents('C:/Users/Shaquin/Downloads/so3.php');
$data = trim(substr($data, 3));
echo strlen($data) . PHP_EOL;
$decoded = base64_decode($data);
unset($data);
echo strlen($decoded) . PHP_EOL;
$decoded = base64_decode($decoded);
echo strlen($decoded) . PHP_EOL;
$decoded = base64_decode($decoded);
echo strlen($decoded) . PHP_EOL;
$decoded = base64_decode($decoded);
echo strlen($decoded) . PHP_EOL;
$decoded = base64_decode($decoded);
echo strlen($decoded) . PHP_EOL;
$decoded = base64_decode($decoded);
@Jocelyn That's true.
 
I strongly suggest using a for or while loop next time
 
Yeah... Next time.
Why didn't I think of that: :0
 
I have another, with a 5GB data string
 
@Jocelyn Have you decoded it yourself? :-)
 
just kidding :p
 
4:17 AM
I optimized my code:
<pre><?php
$data = file_get_contents('C:/Users/Shaquin/Downloads/so3.php');
$data = trim(substr($data, 3));
echo strlen($data) . PHP_EOL;
$decoded = base64_decode($data);
echo strlen($decoded) . PHP_EOL;
unset($data);
for($i = 0; $i < 49; $i++) {
	$decoded = base64_decode($decoded);
	echo strlen($decoded) . PHP_EOL;
}
echo $decoded;
?></pre>
 
I almost crashed my editor, my browser and apache when encoding the data
 
I almost did when de-coding.
 
you can automatically exit the loop when the data gets below a certain size (like 1KB)
 
Aurora (Not Responding)
(Notepad++ just didn't display it)
PHP - made the whole thing slow.
@Jocelyn like this?:
while(strlen($decoded) > 50) {
	$decoded = base64_decode($decoded);
	echo strlen($decoded) . PHP_EOL;
}
 
yes that kind of code
 
4:22 AM
@Jocelyn Okay.
By the way, has anyone attempted to decode my nice, simple, Base64-encoded string?
 
user895378
@LeviMorrison It's looking like a definite Thursday push. It'll probably be most/all of the weekend before everything is fully tested, though. Question: is Client::setMaxHostConcurrency descriptive enough? Or is Client::setMaxConcurrentHostConnections better, though more verbose?
 
user895378
To specify the max number of simultaneously open connections to an individual host?
 
@rdlowrey setMaxConnectionsToHost is shorter.
but maybe not as good.
 
user895378
I considered that, but I thought perhaps it could be misconstrued somehow? Maybe not.
 
@rdlowrey How about setMaxHostConnections?
 
4:25 AM
@ShaquinTrifonoff That implies you can only connect to a certain number of hosts.
That is not correct.
 
user895378
Well, I really wanted there to be something about concurrency/simultaneity
 
user895378
Because it's specifically dealing with concurrent connections to a given host ...
 
It's a limit to the number of connections to the same host at any given time.
 
user895378
(at one time)
 
4:26 AM
So would setMaxConnectionsToHost would be the best then?
 
user895378
I didn't want someone to mistake it for "you can't connect to host X more than this number of times"
 
setHostConcurrencyLimit ?
No matter how we do this it will be verbose.
 
user895378
ooh I like that better than the "max" derivations
 
Naming is so hard.
3
 
Well, there is document.getElementsByTagName in JavaScript, so you could have setConcurrentHostConnectionLimit :-)
 
4:28 AM
@ShaquinTrifonoff I've created longer, particularly in test suites.
 
user895378
Thanks for the help guys. Just what I needed.
 
user895378
Anyone care to approve/disapprove/comment on the other public method names while I'm at it? :)
 
user895378
function sendProxyStyleRequests($boolFlag) (was setProxyStyle($bool) ... not descriptive enough)
 
user895378
/**
 * Whether or not the client should request and decompress encoded entity bodies
 *
 * This option is enabled by default. Note that even if this option is enabled, the client
 * will only request encoded messages if PHP's zlib extension is installed.
 *
 * @param bool $boolFlag
 * @return void
 */
public function allowContentEncoding($boolFlag)
 
Both sound good to me.
 
4:33 AM
What about public function useCompression($boolFlag)?
And requestsLikeProxy?
 
another rocket scientist here: stackoverflow.com/questions/11980740/…
 
user895378
@ShaquinTrifonoff well, useCompression could mean anything, really. The directive is true to the actual HTTP specification in that compressed responses are denoted as such specifically with the Content-Encoding header ...
 
@hakra Meh, doesn't seem like enough changes to move from version 4 => 5. Bad form!
 
encodeContent?
 
user895378
And technically, it's not requesting like a proxy, it's making requests in a form that some proxy servers can better understand.
 
user895378
4:37 AM
The full list of public methods as they are currently:
 
user895378
function send(Request $request);
function sendAsync(Request $request);
function sendMulti($requestArrayOrTraversable);
function sendProxyStyleRequests($boolFlag);
function setConnectTimout($seconds);
function setSslOptions(array $options);
function setMaxRedirects($maxRedirects);
function setHostConcurrencyLimit($maxConnections);
function allowNonStandardRedirects($boolFlag);
function allowContentEncoding($boolFlag);
 
ehh ..
> A good solution for simple persistence requirements is the ActiveRecord pattern: en.wikipedia.org/wiki/Active_record_pattern . This is implemented in Ruby and in Play! framework 1.2, and you can easily implement it in Scala in a stand-alone application
> The only requirement is to have a singleton DB or a singleton service to get a reference to the DB you require.
 
user895378
On second thought, the sendProxyStyleRequests option setter should use a different verb, since the main send methods use send
 
award 100
 
user895378
@tereško nice -- SUPER-UPVOTE.
 
user895378
4:40 AM
It's going to take years to undo all the ActiveRecord vomit that RoR has spewed upon the world.
 
yes , yes it will
 
@tereško: you are probably going to get a comment similar to what webarto got.
0
Q: issue when printing class's variables

Yusuf AliI'm creating a system like MVC. I'm using below class when I want to call view files. Edit: Meantime, He can do this: http://www.youtube.com/watch?feature=player_detailpage&v=Aw28-krO7ZM#t=1166s <?php class Call{ function __construct($fileName) { //$this->db = new Dat...

 
By the way, I am going to stop referring to the pattern of having constructors ask for their dependencies as Dependency Injection and refer to it as the more generic practice of Inversion of Control.
 
@webarto I bet you know anthing about OOP. — Yusuf Ali 5 hours ago
 
:-D
 
4:43 AM
@LeviMorrison , i'm already trying
 
I feel that people are confusing DI with DIC. Secondly, I feel like IoC is not understood by name even though the concept is so simple.
 
user895378
Count me in. All IoC going forward.
 
I'm going to write a blog post on each principle of SOLID aimed at beginning PHP developers.
Not newbies, but people who've been using PHP for a year or so and realized that what they are doing sucks and there must be a better way.
 
@LeviMorrison , thats like explaining calculus to 4-year-old
 
user895378
4:47 AM
"Beginning PHP Developers" is generally synonymous with "Beginning Developers" ... Are you sure they'll be able to handle it?
 
most of PHP "developers" do not even understand how to write simple object oriented code
and you are gonna try to explain the them higher concepts ?
 
@tereško This is true.
I feel like part of the reason PHP developers aren't getting the proper education is because they read something and the examples are in Java/C++ and they get lost.
But if I try to explain things to them in PHP terms maybe we can help bridge the gap.
 
no , they dont
the go to youtube for tutorials : http://youtube.com/results?search_query=learn+php
 
$dev = new Developer();
$dev->setLevel('beginner');
$dev->tryToCreateAmazingWebsite('now'); // CannotCode Exception on line 3
 
@ShaquinTrifonoff Line 2 is unnecessary: new Developer.
 
user895378
4:50 AM
@LeviMorrison I felt like that was the case as I learned things (good concepts were always explained with a "real" language and not PHP)
 
I find it ridiculous to watch youtube in order to learn PHP. There are many better ways, many more reliable sources.
 
I'm not trying to fool myself; there are a lot of PHP developers who refuse to be trained.
 
yes
 
I just want to create a small set of resources to help the ones that are trying to be better but find what they want, or find it but can't understand.
 
11700 videos about "learn php"...what a waste of time, bandwidth and disk space...
 
4:52 AM
I think videos have their place.
After all, who here knows and doesn't like Misko Hevery's Google Tech Talks?
 
I think a web site with examples (php.net/manual) does the job fine
 
user895378
Videos are like Gatorade -- you won't be a good athlete by doing nothing but consuming "sports drinks," but if you're already exercising all the time, Gatorade can help your performance :)
 
@Jocelyn The manual is only there to teach the language. It is not there to teach you how to build large and maintainable applications.
 
@rdlowrey Thats a nice way to put it..
 
user895378
(good) videos can be a great supplement to an already serious learning process
 
4:55 AM
@LeviMorrison: there are lots of other websites, with well-presented examples, code samples...
 
@rdlowrey have you actually seen what is in the "learn php" list of videos ?
 
you have to want to read if you wanna get any better at anything
videos alone won't do the trick
 
user895378
@tereško Oh I imagine those are terrible. When I say "videos," I mean conference talks, clean code talks, uncle bob type stuff
 
You are going to be typing code anyway, so why not read?
Why watch a video when you are going to be typing text?
 
because reading is hard
and it has no moving pictures in it
 
4:57 AM
Hi everyone, my mail() function isn't working. I don't know if there was anything needed to be setup on my colocated personal server. I setup LAMP and some other stuff, tried mail("me@mydomain.com","test","FROM: me@otherdomain.com") and no success.
 
@tereško coding is hard too..
 
@Jocelyn Give me one that focus on SOLID and unit testing that has lovely examples in PHP.
 
until you get an idea of what is going on
 
@ShyamK , what's so hard about copy-paste ?
 
mail("personalemail@email.com","test","FROM: me@mydomain.com")*
is there something that needs to be installed separately from LAMP?
 
4:58 AM
@Darius , you have to configure sendmail
 
@Darius mail("me@mydomain.com","test","testing", "From: me@otherdomain.com" . PHP_EOL);
 
user895378
@LeviMorrison Yeah, I haven't seen that site either.
 
copy-paste? :D
What if Google gets hacked? :P
 
@Jocelyn No, that teaches you how to use PHPUnit. That's different.
 
4:59 AM
@ShaquinTrifonoff Thank you will try that.
 
Important, yes.
 
@tereško Thank you, will look into it.
 
user895378
lol the phpunit manual is the last place I would send someone for an easy-to-follow introduction to good coding practices and testing :)
 
user895378
I lament the phpunit manual on a daily basis.
 
I have never done any research about unit testing in PHP
 
5:00 AM
then why do you paste random link ?
 
user895378
Oh man, it'll change your life. Unit testing FTW. I don't know how anyone can feel good about their code if it's not tested.
 
user895378
Anymore, I'm so stressed out when I have untested code.
 
@tereško I thought it could be useful
 
@tereško also you might have forgotten to copy something small (a single semi-colon maybe) and waste a whole day sorting it out...
 
By the way, @tereško, I'll value your feedback on all my articles. You are a tough critic.
And I am a terrible writer. I'm much better at rewriting.
 
5:01 AM
@ShyamK no , if you paste something without semicolon , you just conclude that it "does no work" , and you either go to SO or copy from different source
 
guess so...
But what is you ain't got internet?
@tereško I get your point.. its what most ppl do
 
github is down for a few minutes.
Scheduled DB maintenance.
:(
By the way, the principle of SOLID that I understand the least is L.
 
thought sure that was the easy one :)
 
I think I understand it but I don't KNOW that I do.
 
LSP
 
5:09 AM
class User extends Table ... the principle tells that this is retarded
 
as in, the definition of "is-a"
 
I just earned the deputy badge :)
 
Okay, let me sum it up in one line and you guys can tell me whether I have it or not.
I should be able to replace a class with any of its subclasses without having to change calling code.
 
user image
3
 
pretty much
that's the outside view of it, anyway
 
5:12 AM
the principle states that all subclasses are just a special cases of same parent class
 
Most of SOLID makes sense if you have worked on the same project for more than 2 years.
 
and that anything guaranteed by the parent class, must also be guaranteed by the subclasses
 
Well i sure as hell don't know how to setup DNS, will have to call my server buddy to setup sendmail -__- Thanks for the info about sendmail though!
Reading the instructions it's like I"m in outterspace haha
 
you have a nice duck in your bathroom, @tereško
 
Honestly, I and D are very similar.
 
5:16 AM
eh...kinda.
maybe.
except....not really
lol
 
They both deal with abstractions.
I says to split them into little chunks.
 
everything in oop deals with abstractions. nosurprise there.
 
@Darius , usually it is better just just use external SMTP server them setting up one locally ..
 
D says to depend on abstractions and decouple high level stuff from low level code.
 
@tereško explain..? So the server that runs my site shouldn't send the emails?
 
5:20 AM
right...D says basically "program to interfaces, not to classes", and I puts constraints on what should be in what interfaces
 
Interestingly, I feel like O happens only when you use the SLID.
 
they all do kinda work together :)
 
If you use I, then you probably aren't violating S.
 
you very well can be
easily, even
public class Widget implements DataSource, ViewManager, Frobnicator...
 
@cHao To me that seems to violate S.
 
5:23 AM
exactly.
but not I.
that's my point.
 
Oh, this goes back to the fact that I'm a terrible writer.
 
lol
 
Let me try again.
Maybe: S is to implementations as I is to interfaces.
 
semi
 
I think it's just too late. I'm not thinking clearly and my writing is even worse :)
 
5:31 AM
I says basically, make your interfaces as focused as possible. don't make one big interface that exposes the whole class -- in fact, try not to give the interface anything clients don't absolutely need to do the job the interface is made for
 
@KarmicDice You shouldn't be worried about the performance of a PHP site. It doesn't matter. — meagar 46 mins ago
what a retard
 
I argued several times with him about that
2 users agreed about his comment.
it is 7:45 AM
good night!
 
5:45pm (UTC+12:00)
 
5:47 AM
Some day I will visit New Zealand...
 
6:18 AM
The chat room has gone quiet, but everyone is still online...
 
i really don't get how someone could not care at all about performance.
i mean, the ricers are pretty dumb too...but there's a happy medium in there somewhere.
 
Sem
Good morning
 
bummer...
@PeeHaa I just saw your display pic as a blonde girl.... whats up with that?
 
Reading around $_SERVER['HTTP_REFERER'] is bad practice because it's unreliable. So they say to use sessions, but I see some drawbacks and rendering it unusable. Is there a way to get the url of the page that's sending out the request any other way
hypothetically, i click a link and it sends out a $_GET request to one of my controller_actions, that page sends it to the model and sends a response, the controller now has to send the user either back to where they came from (can be dynamic link) or to another page.
The issue i see with holding requested-uri in the session is if the person has multiple tabs open and gets a return that sends the user back to their latest uri. Then it would send them to the wrong pge
I've seen this https://www.google.com/accounts/ServiceLogin? ...
continue=http%3A%2F%2Fmail.google.com%2Fmail%2F%3F ui%3Dhtml%26zy%3Dl

where google adds the url to go when done by adding it in the get request
 

« first day (670 days earlier)      last day (4294 days later) »