« first day (1922 days earlier)      last day (3251 days later) » 

00:05
Hello. I need help.
@SergeyTelshevsky yeah, it's terrifying
@RonniSkansing, @samayo, @Jimbo, @Sean, @AnmolRaghuvanshiVersion1.0 thanks
:)
How do I add 1 to a number in a text file and pull the value into a php file on button click?
Wes
Wes
google "php how to write to a file"
fopen?
@Wes It doesn't work thisistotallynotavirus.com <- Joke website I am making
Wes
Wes
00:25
totallygoingtoclickthat.com
Code I got:

PHP
<?php
$buttonclick = ("viruscounter.txt");
$viruscounter = file($buttonclick);

if(isset($_POST['virus']))
{
$viruscounter[0] ++;
$fp1 = fopen($buttonclick , "w");
fputs($fp1 , "$viruscounter[0]");
fclose($fp1);

echo $viruscounter;
}
?>

HTML

<form action="index.php" method="POST">
<div class="mbr-buttons btn-inverse mbr-buttons--center"><a class="mbr-buttons__btn btn btn-lg btn-warning animated fadeInUp delay" name="virus" href="">DOWNLOAD</a></div>
</form>
I don't know what's going on.
I like your mustache @Wes
01:00
@PeeHaa pong
@Andrea nice =)
Wes
Wes
hey bob :D
just woke up, right? me too... :P
i always think god made me with an internal clock of 25 hours, just to mess with me
@Wes well, mine is closer to 32h
@tereško hmh… I begin to get really tired after 18-19 hours awake…
you're just weak
=)
(or are you sleeping 14 hours? =D)
Wes
Wes
01:07
btw i need to figure out why i write my best code (or at least i'm more productive) when i'm tired
@Wes because you want to achieve something before going to bed and it's usually more quiet in the night…
Wes
Wes
my current theory is that i get too paranoid when i'm not tired, and instead i just get the things done when i'm tired
@tereško do you have some time? If yes, could you please review github.com/amphp/aerys/blob/master/lib/Bootstrapper.php from a design/architecture standpoint?
Wes
Wes
why that AERYS_OPTIONS constant?
01:12
@Wes I dislike it, but I don't know what the better option is.
@tereško this one function is a pur optimization, can be removed, because it's done in another safer place again…
Wes
Wes
just inject the config?
@Wes … and how do you imagine that?
as for the rest of it, IDK ... I am not too familiar with Aerys.
Wes
Wes
oh i don't know, would that be hard for some reason?
well, what would you inject it into?
Wes
Wes
01:16
a struct-ish object?
@Wes and how would you return that object then?
I suspect he's doing it because something else expect that class/interface
Wes
Wes
@bwoebi return?
well, the object I injected it into?
Wes
Wes
do you need to return it? not understanding i suspect i need to read more code
link to a specific line?
01:19
@tereško also, I'm not sure if buildVhost() is in the right place … It's a builder function for Vhost, and at the same time a bootstrapper (calling Bootables)
@Wes I need to pass the Options object into another class after that: github.com/amphp/aerys/blob/master/lib/Bootstrapper.php#L62
Wes
Wes
how does inject the configuration rather than relying on a constant change that?
@Wes Herein lies my dilemma
Wes
Wes
imho you shouldn't ask for partial information and create the actual information internally. why not inject a valid Options directly? boot(Options $options, ....)
@bwoebi how would you even unittest taht whole thing?
=)
@tereško that's part of the issue :-)
@Wes then I have a magically inserted variable
Wes
Wes
01:26
which is?
@Wes well, $options
magically inserted into the included file
so, basically, my assessment boils down to: methods with high CC and I have no idea why you need to wrap it all in a class
@tereško the CC isn't that high though?
@bwoebi it kinda is .. for boot() and buildVHost()
01:29
@tereško what do you consider high?
anything above 4 for a method
oh well.
10+ goes from "high" to "fucking nuke it"
@tereško then you must die when seeing that: github.com/amphp/aerys/blob/master/lib/Http1Driver.php#L163
@Wes !?
Wes
Wes
@bwoebi gave up understanding it :B why are you building that anonobj "new class" ?
01:31
ignore that, I removed it locally
Wes
Wes
just for the declaration "public $whatever" ?
@Wes yes
just a perf thing
but it's redundant as it's already here: github.com/amphp/aerys/blob/master/lib/Server.php#L194
Wes
Wes
it's slower without the declaration? like for to avoid checking if __get is defined or something
@Wes yes, it's going via __get() ;-)
Wes
Wes
it sucks having to do that
01:41
@tereško Also… how would you test something like github.com/amphp/aerys/blob/master/lib/WatcherProcess.php at all … the issue is that it's strongly bound to process managing instructions and other realtime constraints…
@bwoebi you can't
only public method is the constructor
and you cannot unittest constructors
that class has many protected functions called by its superclass (in public funcs)
hm?
nevermind
I wasn't paying my entire attention on that one
sorry
yea, no problem… so what do you suggest?
yeah, looks tricky
I don't think there is a way to nicely mock sockets
01:47
you can mock sockets, but proc_open? :-/
it's a mess
basically you have to do: PDD - prayer driven development
@tereško yes, it is. And I wonder what I've done wrong or whether you just can't test tsuch a thing
the way I would approach would be to pull out functionality in testable classes
then again, I have never like the use of protected method in a code, which you are supposed to unit test
@tereško I can extend a class and call these protected methods, no problem… If it were just that…
yes, you can call them
but you end up with public interface in the superclass
01:52
yes...?
I am having really hard time to articulate this :(
.. I blame Bushmill's on for that
Also, I wish I could split that class out in meaningful ways, but the one part would probably need to call private methods of the other and vice-versa
Wes
Wes
oh btw @tereško 3v4l.org/Q3pYR with php7 testing private stuff is much easier
@Wes you should avoid that whenever possible.
Wes
Wes
in tests??
01:58
yes
Wes
Wes
why :P
you test the public/protected interface, not the private methods
But my issue isn't exactly breaking into the private/protected zone, but rather how to test that at all…
Wes
Wes
well, you can test also privates if you want... depends. more testing is always good
then it probably shouldn't be a private.
@Wes private stuff shouldnt be tested
Wes
Wes
02:00
but that wasn't my point. my point is that you have also that option now and it's better than reflection or extending
@bwoebi you actually shouldn't be testing protected stuff either
@tereško well, it depends. Especially in case where the protected stuff is for consumation by the extending class.
or when it's part of a contract
I know that urge, but in my experience that way be dragons
Wes
Wes
sometimes you can't test just the public interface. sometimes you need to test also the implementation, including private stuff. i realized that when i made an avltree implementation. you can't test if the tree's balancing works correctly by checking the public interface @bwoebi
I agree. But there are places where it's completely sane.
@Wes that's trivial by an information array gathering data about current depth etc. Should be public API…
Wes
Wes
02:09
??? why pollute the api. it does no harm testing internal stuff
@tereško But I'd be happy if you could think about how you'd restructure that WorkerWatcher to make it testable…
@Wes that's not polluting, it might be useful information in general (using __debugInfo() also comes to mind)
well .. here is the problem: I am nursing a glass of whiskey and watching Buffy
3
I don't think I am up to much thinking ATM
Wes
Wes
tempted to make a screenshot
and frame it.
why Buffy??? i thought it was stupid even when i was 16 :D
it's better than you understood it to be when you were 16
@Wes the later seasons are good
the first two are trash
02:16
@tereško I'm not in a hurry, but I'd still like to find a solution in near future … May I ask again tomorrow again then?
okay great :-)
Also now I understand why you have an 31-hour day… doing practically nothing physically or psychically intensive :-/
Wes
Wes
since we are at it, i had a crush for a while for Sex and the city #sigh
naah, that one was terrible
(or maybe I'm just not the target demographic)
Wes
Wes
i started watching it by accident then i wanted to know the end
it's the Lost effect, you get sucked in and you get flushed in a ocean of poop in the last episode
02:27
sounds like dexter
Wes
Wes
that too
@Wes I really tried likeing Lost
never got past mid-second season
Wes
Wes
Lost is fantastic as long you keep thinking it will finish with an extremely brilliant ending where everything will be explained and make sense. but that didn't happen. after the last episode you realize that they threw senseless bullshit at you for 8 seasons. and that's like being insulted
 
1 hour later…
04:02
By the way @Wes you also can check for the balancing with assertions… That's what they are for … ensuring invariants.
Wes
Wes
yeah that would be an option now. at the time i did it assertions weren't very good :P
 
1 hour later…
Wes
Wes
lolfail opencart
06:17
moin
ping @ircmaxell
Wes
Wes
\o joe
I only got as far as "reject as entirely unsalvagable" ... he can reject it all he likes, dude doesn't even have a vote, not sure why you care what he says @ircmaxell
I'm not going to give the guy the air of legitimacy by engaging, nor should you ... you certainly shouldn't base decisions that effect many people on the words of one guy ... unless that guy is me :D
oh it seems he does have a vote, but doesn't really seem to use it ... whatever, it's one guy ..
I'm mostly annoyed because this is going to be presented as evidence of the "toxic kindergarten" (which are also your words) for years to come ... an image I hoped we were shaking off ...
06:38
@ScottArciszewski \0 byte injections aren't a thing in PHP since PHP 5.3 because lxr.php.net/xref/PHP_7_0/Zend/zend_API.h#1140 … PHP is rejecting the path if it contains a zero byte.
Also @ScottArciszewski github.com/amphp/aerys/blob/… should be safe (I hope)
@JoeWatkins well, yes… What's a bit sad is that the behavior of a few people falls back to the internals as a whole…
 can someone check my code if this is how to insert multiple queries in 2 tables with a foreign key of the other? here it is

     public function addhw(){
	 $this->db->trans_start();
     $array=array('hw_name'=>$_POST['hw_name'],'hw_description'=>$_POST['hw_description'], 'hw_type'=>$_POST['hw_type'],
     'hw_serialno'=>$_POST['hw_serialno'],'hw_manufacturer_id'=>$_POST['manufacturer_id']/*,'hw_picture'=>$_POST['hw_picture']*/);
     $this->db->set($array);
     $query=$this->db->insert('hardware');
07:21
@bwoebi Not everywhere IIRC.
 $ php -r 'include "/home/kelunik/foo.php\0/blah.png";'
PHP Warning:  include(): Failed opening '/home/kelunik/foo.php' for inclusion (include_path='.:') in Command line code on line 1
hello
Seems like only the error message is affected.
have you an idea how the constructor is not called when function of that class is exectuted?
@bwoebi You can still inject \0 into exception messages to truncate them.
07:44
is there anyone who is good with codeigniter and may help me with something ?
user924016
Mornings
@RonniSkansing morning :-)
user924016
\o
07:49
solved, it was contructor function name bad spelling, and so it was not called
Yes it is,but instead of adding own complete code urself, it's class based already, you can pass values to it's __constructor and call functions. I build same IMAP based fetching on this and working great.
Best of luck for ur selection (i am just suggesting, i not their agent) :P
@Darius.V __constructor :D
@kelunik only in functions … but if you put an user-influenced string into an include, you really have shot into your own feet…
@Darius.V Static method
Just saw solved, nvm
08:09
Good morning
@bwoebi I need to repeat in a command. What's the best way to go about it? I have a plugin eval which posts code to https://3v4l.org/new which redirects to e.g. https://3v4l.org/9edhk3. I need to poll the latter every second until it returns the end result.
@PeeHaa \Amp\repeat?
Can I just do that. I expected I would get the error message about tick in the reactor again?
very nice humble bundle includes most of xcom and civ: humblebundle.com
you probably want something like:
$deferred = new \Amp\Deferred;
\Amp\repeat(\Amp\resolve((function($watcher) use ($deferred) {
    /* do goddamn check */
    yield $artax_request; // or whatever
    if ($result) {
        \Amp\cancel($watcher);
        $deferred->succeed($result);
    }
}()), 2000 /* two seconds */);
yield $deferred->promise();
08:19
<3
and don't forget to cancel, sec
Yeah I also need cancel. How do I target it?
updated example
probably a primitive to poll wouldn't be bad…
so that you can do:
good meurning!
Yeah was thinking the same thing
Basically write a proper implementation myself right?
@Naruto Monring
08:22
$result = yield \Amp\poll(function() {
    /* do ... */
    return $success;
}, $interval);
something like that wouldn't be bad…
and which repeats until $success is non-null after $interval ms
Yeah that looks useful. Doubt I'm the only person who needs that too
@kelunik any opinion on adding that to Amp?
@PeeHaa:
    do {
    	$result = yield something();
    	$success = !empty($result);

        if (!$success) { yield new Pause(1000); }
    } while(!$success);
this is busy waiting though
but you don't quite want to DoS the target server ;-)
hmm, good point.
totally forgot about Pause.
08:31
much better than adding a new function :-)
@PeeHaa do what @kelunik showed you :-P
Right. Tnx both
do {
    $result = yield something();

    if ($result->success) {
        break;
    }

    yield new Pause(2000);
} while(1);
Morning.
Morning.
hi guys i need some help about transactions in codeigniter: Can you look at my code please if its correct?
yeah i went their already and applied the codes but its not working
Moin
I should trademark it's not working™ and ask for license fees whenever someone says that.
hello guys.. I currently have this code for a search bar on top of my page.
<form class="navbar-form pull-left" action="#">
	<input class="form-control" id="search" type="text" value="<?php echo $this->helper('catalogsearch')->getEscapedQueryText() ?>">
	<input style='display:none' type="submit"/>
	<script type="text/javascript">
		var searchForm = new Varien.searchForm('search_mini_form', 'search', '<?php echo $this->__('Search entire store here...') ?>');
		searchForm.initAutocomplete('<?php echo $this->helper('catalogsearch')->getSuggestUrl() ?>', 'search_autocomplete');
I already have a bootstrap framework on the site. any ideas how to make the div with id search_autocomplete for suggestions to act like pop up under the search bar?
@treblaluch it's not working doesn't tell me anything to diagnose the problem
08:50
I have a code in codeigniter to send tokens to reset password I believe that code is good and im recieveing msg that token is sent to email but there is no mail on mailbox, can someone check my code ??
@Gordon The world would invent a new work for it…
@ChrisKucharzyk check your spam folder and if that is still empty, enable your mail log and/or check the logs of whatever service is delivering the mail
im using gmail smtp
I have the same settings for register function
and email is sent to email and i can recieve it
while registering
@ChrisKucharzyk are you sending with mail()? then enable the mail log
but with the same settings when i want to reset a password
Im using codeigniter with $this->email->send();
08:54
Damn, what's up with SourceTree taking forever and a day
@Gordon it's a trap...
@Gordon ok when I click submit it does not do anything and the console says error server 500 etc..
We need a canon command...
@treblaluch the reasons for 500 errors are usually logged to your server error log. check that.
can u take a look at my code and tell me if its wrong?
09:03
Don't ask to ask, pop it into pastebin or something similar and post the link :)
Uh, I really recommend you use prepared statements
when writing SQL queries ^^
@Sean i want to learn that but i'm using msqli in codeigniter cause more easy for me and more familiar
Oh wow. Now that's a huge hole
2
09:08
@Sean The joys of using a GUI where commit & push is in the same action to cater to older devs who only know SVN.
@PeeHaa Phrasing
@treblaluch ellislab.com/codeigniter/user-guide/database/examples.html What about using the bottom example?
@treblaluch mysqli supports prepared statements, so I don't see what the problem is
Also, CodeIgniter always manages to surprise me again and again with how badly it handles things :D
Anyways, you could stick in a die at the end of that method and see if it s till breaks.
Good ol' basic debugging 101
@Sean that was the method i tried and did not work so i switched to this method
@Sean here this was my last method of doing insert but it does not insert the 2nd query pastebin.com/HSN8MphV
@Sean ooooor he could just check the error log because 500 will be in there
09:17
@Gordon Indeedy
not sure why we would need to look at the code when the error log likely has all the needed info already
2016-01-20 16:28:16 5584 [Note] InnoDB: Completed initialization of buffer pool
2016-01-20 16:28:16 5584 [Note] InnoDB: Highest supported file format is Barracuda.
2016-01-20 16:28:18 5584 [Note] InnoDB: 128 rollback segment(s) are active.
2016-01-20 16:28:18 5584 [Note] InnoDB: Waiting for purge to start
2016-01-20 16:28:18 5584 [Note] InnoDB: Percona XtraDB (http://www.percona.com) 5.6.26-74.0 started; log sequence number 7158112
2016-01-20 16:28:18 5676 [Note] InnoDB: Dumping buffer pool(s) not yet started
my problem was the 2nd query does not insert.. i'm just a newbie thats why im asking here sorry to bother
Anyone else having trouble viewing their own profil on meta.SO?
@Epodax Not me
09:32
I get a error every time I try to load my profile
@Epodax same for me
Ah, Gone now.
Odd, props just a hiccup
I still get the error
They are currently facebookifying profiles so I guess it's related
facebookifying?
What the fridge is that?
09:36
noim
@Epodax yea, I can't access mine either.
I’m using jquery infinite scroll in my magento installation. The page loads quite fine. But when i scroll down, where additional products are supposed to be shown, it shows an error in console. Here is the error description:

Error: Syntax error, unrecognized expression: {“status”:”SUCCESS”,”viewpanel”:”Complete 2nd Page Code here” on jquery.min.js(line 4)
you've got funny quotes
maybe?
o/
I was wondering, is it possible to move files over SSH to a local folder? ( I have to say -> Im a total beginner in Shell etc :)
@Duikboot SCP
Or rsync
09:43
I found those 2 as well :) awesome, is that better than using FTP?
YES!
definitely
Faster?
much faster
and more stable
FTP is ancient crap
We use SCP over here. Definite improvement :p
FTP opens and closes a connection for each file, SCP just keeps the line open
09:44
Its chown tool needs to work with group names though, not just IDs. ):
Can I do much wrong with SCP? ( Ill try it now I have to move a project to a local server )
@Oldskool Didn't know this, thanks
@Duikboot in case you are on windows, download winscp. it has a gui.
Working on OSX.
@Duikboot Well, you can make the mistake of pushing files instead of pulling, so you'll push your local files to the remote. So be sure to put the arguments in the right order :)
09:48
ah, then man scp :)
or just use rsync
@Duikboot The most basic form looks like this from your terminal window: scp [email protected]:/home/user/projects/myProject /Users/localUser/myProject. That would copy the /home/user/projects/myProject folder from the remotehost.com (logging in as 'user') to your local box at /Users/localUser/myProject.
Oh you have to 'login' [email protected], even when logged in via SSH
@Oldskool don't you need -R?
also, rsync > *
@Oldskool You got autocomplete? ( Now logged in via ssh )
09:52
rsync -avzP 4ever
@FlorianMargaine -a ? doesn't that preserve attributes and all, which isn't quite what you want when copying from a remote?
That's fine for backups maybe.
@bwoebi -a does many things
@Oldskool scp [email protected]:foldername /myLocaLServerDrive/Public/Xyz/Folder/ Should work?
        -a, --archive               archive mode; equals -rlptgoD (no -H,-A,-X)
@FlorianMargaine yeah, hence, it's just find for backups… not for most use cases.
09:55
@bwoebi it's fine for most use cases, really
well, as long most use cases is backups ;-)
I don't remember the last time I had an issue
I use it for many things other than backups
well, but then you tend to get permission errors on the remote
1 min ago, by Florian Margaine
I don't remember the last time I had an issue
I got asked for a password when using SCP.
10:00
@FlorianMargaine then you maybe just happen to have the same user id than required on the remote…
or have liberal permissions like world-readability
@Duikboot Then you don't have a matching key for the remote username you're trying to access.
It says: paste.ee/p/9xNOY the first time. When I check that I got: /etc/ssh/ssh_host_ecdsa_key.pub: No such file or directory on my computer.
10:17
@Duikboot Sorry missed the -r flag for recursively copying a dir. :)
If you add that it should be fine.
10:28
127
Q: The Developer Story Part 2: We didn't explain that very well

bluefeetRecently, we presented the community with our idea for the Developer Story to get your thoughts and feedback; and feedback we got! We appreciate all the comments and answers on the original post. In hindsight, we realize that we missed the boat, didn't follow our own advice, and failed to inclu...

Also see the clusterfuck that is part I
@Wes WTF...
10:50
Wouldn't it be easier to sell the site to LinkedIn, instead of morphing into it step by step? — Norma Jan 4 at 18:06
Gave me a good chuckle.
Also SO mods failing to properly use meme images :p
any wordpress developer here?
@GovindKumar What's up?
need help in wordpress .
-1
Q: Reset Wordpress password using mobile number?

Govind Kumaris there any plugin available in wordpress which can reset users password through SMS ? ?

10:56
@GovindKumar and you need help closing that question?
@GovindKumar We are a Q&A for solving programming questions
Finding plugins is not what we do
For more info please see our help
I imagine you should take a look at wordpress.org/plugins/wp-sms and build a custom plugin to do it yourself. Doesn't look like there's anything out of the box that can help you past that.
@sean you are right
10:58
hmm thanks
it sound hard
@PeeHaa I haven't been following that, but I really like the SO timeline-style thing
...

« first day (1922 days earlier)      last day (3251 days later) »