« first day (1018 days earlier)      last day (4156 days later) » 

07:00
Or perhaps that's just what I would want it to do :)
Review audits come at certain intervals, so potentially you could get Steward from just audits and not actually doing anything...
@Jack you're right Jack IntelliJ does something like this but what I want is to create a representation of my whole program but typed. Btw there will be many different possible representations as each single variable would be associated with a set of possible types.
Sounds like fun :)
@DaveChen Audits don't add to the total afaik ;-)
@Jack for the close votes it does
@Jack to me sounds like HELL XD
07:04
@gr4devel If a thesis would be this easy, they would have called it an SO answer instead :)
@Jack so right man so right :)
0
Q: Removing multiple page reload issue

KarimkhanI am trying to fetch the user favourite movies and other details and FB JS SDK. Following works correctly for me. I have tried to use ajax to remove page reload. But I dont find why page gets reloaded twice before Login button appear. And after user enters login credentials and click on login but...

@YogeshSuthar @DaveChen one question $Qry = "SELECT * FROM polq WHERE status = ? AND cate_id IN ( ? ) ORDER BY cate_id";
in execute $a->execute(array(0,$cate_array));
$cate_array is "40,42,43,44,52,53,54,55,56,57,58,59,60" as string
why i am getting 0 row. it shoud be 1 row as result in my table,
@Nileshpatel Is same query showing result in phpmyadmin?
@Nileshpatel have you tried ->bind_param('is', 0, $cate_array)? + ->execute()
07:07
@Nileshpatel It won't work that way.
@YogeshSuthar yes with one row in phpmyadmin @DaveChen no not tried.
@Nileshpatel you might need to implode $cate_array if it's not a string already
@Nileshpatel You have to generate as many ? as there are entries in your array.
@DaveChen No, it won't work because the whole argument will be treated as a single string.
@YogeshSuthar $Qry = "SELECT * FROM polq WHERE status = 0 AND cate_id IN ( 40,42,43,44,52,53,54,55,56,57,58,59,60 ) ORDER BY cate_id"; return one row.
if $cate_array = [40,42,43...], then wouldn't bind fail?
07:09
@DaveChen i already impload array and get string.
oh okay then, does it work (bind/execute)?
No Diggity :L
@Nileshpatel Start with join(',', array_fill(0, count($categories), '?')). Then work onwards from there.
@ircmaxell sorry man I was away from the chat and I just saw your message. Btw I'm honored to know you, I really appreciate all your YouTube videos :)!
@Jack @YogeshSuthar @DaveChen
$Qry = "SELECT * FROM polq WHERE status = ? AND cate_id IN ( 40,42,43,44,52,53,54,55,56,57,58,59,60 ) ORDER BY cate_id";
$a->execute(array(0));
this work fine. problem in IN
PLB
PLB
07:17
Morning.
@Nileshpatel It doesn't seem you're picking up anything I'm saying, so I'll just step away from this problem if you don't mind ;-)
uh, php.net/manual/en/pdostatement.execute.php You cannot bind multiple values to a single parameter; for example, you cannot bind two values to a single named parameter in an IN() clause.
0
Q: php format parsing and changing. Date format is always two characters

senzacionaleThis is my date format: d.m.y but I need it like dd.mm.yy How can with php check format and if is d.m.y then convert it to dd.mm.yy and if is already dd.mm.yy leave it. If is y-m-d conver it to yy-mm-dd How can i do with regex? Why regex. Because my datum is CONSTANT. And for each installa...

^^ confusing question
@Nileshpatel follow Jack's approach, he pads the IN with ? which is the correct way
07:19
@jack you are right thanks.
wow. +1 for explaining :P, you should also mention preparing/escaping
Cool, didn't realize you could use SELECT inside VALUES( ...) like that :)
@Jack you have 400+ in mysql ...
@DaveChen Included. :)
07:24
@DaveChen Sure, but I would personally use SELECT INTO or INSERT INTO SELECT instead :)
Also, I'm not sure how portable that query is.
@Jack Actually I even didn't knew that. :D
prob gonna run a bench on that :D
@YogeshSuthar haha did you find your answer on SO?
hi dragon112
@DaveChen Nah, First I see that OP used single quote around column_name, so I replied for that and after that I thought may be () not included for inner query so I included that as well. :)
07:28
sometimes I forget sql is indeed a language :P
It's the L in SQL :)
DBMS lang.
@Jack html isn't a language, neither is xml, but I never treat sql like one :(
@DaveChen HTML is not a language?
@DaveChen In HTML L stands for Lang.
07:29
it's too loose xD, I would consider it more of a datatype, like json or serialized pickle
Lol, I think you should widen your definition of language :)
extensible markup Language
like I would consider css more of a language than html imho
Even CSS could be considered a language.
They're both declarative in their nature.
because of pseudo mainly
07:32
they are just languages without verbs
well I guess if you have properties such as onclick that call javascript, html could be a wrapper language
onclick is just an element attribute as far as HTML goes.
oh, well anyways, considering html is a language is like saying ColdFusion is a language
A DOM implementation is required to actually use it in any sensible way.
ColdFusion is a myth, we all know that ;-)
My source code digging paid off somewhat :)
if you're on windows you can't even observe this :( (32bit)
07:39
Windows XP?
:)
guys a quick question...if I declare two subsequent namespaces (e.g namespace A; namespace B;) does it means that B is in A?
In the same file?
Nope
yesterday i installed win8. its good
07:39
The parenthood comes with backslashes.
ok then I was thinking right :D
@Jack right right ;) thnx man
@DaveChen Oh right, lol.
@YogeshSuthar did you disable metro?
07:40
@DaveChen disable metro means?
that silly startup screen
@ircmaxell grats for drupalcon! :)
PLB
PLB
@YogeshSuthar Yes, it's faster and uses less RAM but not stable enough (i.e. not stable as win 7. Crashed few times for me). Also random restarts is really annoying.
@DaveChen Nah, it looks good, after 1 month I will remove it. :)
@PLB Actually I was going to install win7 in my new laptop, but most of drivers are not installing because they require dotnet framework 4 OR higher. But dotnet framework is also not installing in my system.
@PLB So my last option was to install win8 in it.
why don't software developers just make all their programs with Visual Basic 6? Then we don't need to download .net frameworks!
07:46
VB6 doesn't look fancy.
I've used it back in 2008, and even now, if I run it on Win7 it uses the theme (areo/transparency thingy), it's a fun language xD
good mornings
morning.
@DaveChen I disagree, I dislike VB in any and every form :p
07:55
no way! please explain :c
I don't know I just like C# much more than VB
what about visual C#? hahahah
Don't even joke about that points gun at Dave Chen
xD
or objective c
@DaveChen in visual C# we can visualise while coding. :P
07:59
I love Objective-C
C# and Objective-C are in my top 3 of programming languages
@YogeshSuthar I can't C#, but I think I visualize things still well enuff <_<
user2543022
hiiiiiiiiiiiiiii
- (void) didCommitSuicide {
    [NSSuicideWithOverUseOfSquareBrackets [[[[[[]]]]][[[][][][][][][][][][][][][][]]]][][];
}
^ it hapens
08:01
Just like Lisp ;-)
Too much em(brace)ing will choke.
I don't know why, it just feels more natural to me than many other languages (Objective-C that is)
@dragon112 it-hypens
do you think that's why PHP doesn't allow nesting of certain stuff? I mean, if php did allow, I'd be doing stuff like:

file_get_contents(json_decode($obj)['hello']->world+array_map($this->getArray()[0]->{$welcome}[2], function(&array) {});
good mornings :D
Till theee independenceeee dayyyyyyyyyyyyyyyyy
08:03
Not saying it's perfect in any way, It's just an irrational love :p
I don't mind obj-C actually :)
I like the runtime message passing paradigm
I don't mind compiled languages doing what they want :P
Mornings
lolcaps
ningmor
PLB
PLB
08:08
Has garbage collection added to obj-C?
@DaveRandom don't worry! sign up for ALL CAPS DAY
@DaveRandom Morning
mornmronrinrgi
@PLB If you garbage collected obj-C the whole language would cease to exist
7
/runs
I can't figure out why this doesn't work codepad.org/9BLh5Geq
08:11
someone needs to forward that message to NSChat :P
Even tried referencing the value by using &
@asprin have you tried unset($qids[$index])?
PLB
PLB
@DaveRandom Reason(s)?
@DaveChen That did it
Could I know why? It's better to know why it worked, right?
@PLB Main reason is that I couldn't resist. There are worse languages to work with, but I find it syntactically a bit horrible [too many square brackets]
tbh my main problem with it is readability, you can get used to writing any syntax but some will never be easy to read
08:15
I would recommend an array_map on it...

and the reason is because `$index=>$qid` $index is the index of the array (0, 1, 2, 3) where $qid is the value of said index, 0=>"submitdate", 1=>"ipaddr", etc
@asprin Because when you unset $index all you are doing is destroying a copy of the value of the key, not the array element
Also you can't do that kind of thing with references, because when you unset a reference you only destroy the reference, not the thing it points to
@DaveChen array_map() ?!..
@DaveRandom that makes sense
@DaveChen Thanks for clearing that up
08:16
or array_reduce
@DaveChen or array_filter()
hooray for php's array_* functions
cluttering the manual since 1995
Why the hell filesize() is returning me some warning filesize stat blah blah
@Mr.Alien it doesn't like you
08:26
lol I cleared the cache using clearstatcache() no luck :p
PHP hates you, just accept it
Good all
@Mr.Alien set read/write on the file/directory :P
@Jimbo Happy
Wait what ^
08:28
I'm off work today, and it's sunny outside. So, of course, I'm sat in front of my computer writing PHP.
@Jimbo inside, with the curtains closed?..
@salathe of course! the sun can hurt your computer screen, and there's glare too!
@salathe One half-open ;)
@Mr.Alien I'm sure php doesn't say blah blah unless explicitly instructed to do so :)
08:30
it does if you recompile it with the blah flag, --blah --ignore_sanity
@Jack I read your answer too ;) anyways am using file[name][size]
now
E_BLAHBLAH
./configure --disable-blah
E_ITDOESNTWORKING
E_INDIAN
9
08:31
lol, did you mean E_ENDIAN? :)
T_PAAMAYIM_NEKUDOTAYIM D:
PLB
PLB
E_POTENTIAL_HELP_VAMPIRE
That's too long, I would shorten that to simply E_NOOB.
just one character longer than an actual error :P
PLB
PLB
Not all noobs are help vampires. It would be unfair.
08:34
@Jack I don't like those errors, they're always either too big or too little.
@DaveRandom Spot on hehe
E_TOO_MUCH_NUISANCE
@Mr.Alien You should use error_reporting(0); ... it solves all :)
or error_reporting(32767 ^ 8 ^ 2 ^ 2048 ^ 8192) :D
@Jack ya right, and the next thing is the log on the server will just get bigger and bigger
PLB
PLB
08:38
@Mr.Alien Delete it periodically and it won't.
@rdlowrey any progress with hhvm?
You want to boostrap yoself
@PLB unless you only have 5gb of space, you don't really need to delete it imo
come on guys, instead of helping, you are creating more problems for me :p
@Mr.Alien You have yet to show us the actual error message ;-)
08:40
@DaveRandom somebody should replace the sword with a microphone in that meme
@Ocramius If you tell that to @webarto he'll do it in a second
I'm not impressed with his lack of attendance recently. It's almost as if he had a real life or something.
@DaveRandom really annoying indeed :P
@DaveRandom that was all I was getting :p encountered that for first time
18 mins ago, by Mr. Alien
Why the hell filesize() is returning me some warning filesize stat blah blah
^^ not debuggable
@DaveRandom this
08:48
Hey, an answer by yours truly that doesn't work? wud? =(
That's a weird problem. I wonder when the translit happens between fs and PHP to cause this issue in the first place?
File name encoding issues are a pita
btw, cant we use something like filesize($_FILES['blah'])?
@rdlowrey Sorry I'd just missed you - fix worked! Just one or two things I'm not sure about :)
Usually strings in PHP are just binary literals
@Mr.Alien No point. The filesize reported in $_FILES['controlname']['size'] is the actual size of the data received, not just the client-reported size
Actually they have to be the same thing anyway otherwise either the upload will fail or the file will be corrupted
08:53
$_FILES['controlname']['error'] would be UPLOAD_ERR_PARTIAL if it were the wrong size.
Ahaaa noob mistake, yes, I used ['size'], actually wanted to try with the filesize
@Mr.Alien Wait .. you tried to use filesize() on something that's not a file name and you wonder why you get a notice?
lolol
lol yes
PLB
PLB
@Mr.Alien I guess, you need some sleep (at least coffee).
08:59
I am working on 7 projects right now, clients have fired 25 emails, now you can see what I am doing here
It's just like how doctors make the worst patients ;-)
@Mr.Alien sleep(28800000);
Lots do on my day off. Must stop: procrastinating, procrastinating by googling "how to stop procrastinating", and also tweeting about it.
zzzzz
Okay. Now I am procrastinating -.-
PLB
PLB
09:01
@Mr.Alien Probably, not my business, but why don't you refuse some projects?
Am working in a company :D
PLB
PLB
So what? I'd better quit than working on 7 projects at the same time because none will get done (at least properly).
Also you should be able to say that you are too busy and you can't work on more projects.
It depends on many people you have to assist you
It's same everywhere here, even if I switch to other company here, they make us work thrice
Indians have a way of pushing three working days into 24 hours for efficiency :)
PLB
PLB
09:05
When do you learn/play with new stuff?
@PLB Probably on Fridays :)
@PLB I hardly get tym, actually I need some capital to start my own stuff, so am rubbing my ass as of now
@PLB at night
Yea, am often awake till 2am-3am..
A nice GPG Subkeys resource you should be aware of as a developer/coder: wiki.debian.org/subkeys
PLB
PLB
09:10
@Ocramius Most of us do so but after working on 7 projects and responding 23 e-mails, I will find it hard to read anything at night. :)
@Mr.Alien I hope you will create better work-place. ;)
@PLB and the worst part is that they need at that right moment
@PLB I currently have way more than that ;)
we have presentation in an hour, we need this right now, wtf, come on, now they gave me 3 forms with 20 fields, 3 attachments, and they want it in 20 mins, I told NO straight way
hello everyone
PLB
PLB
I guess problematic is deadlines there.
09:13
yes ^^^
@Mr.Alien who wants to fill a form with 20 fields anyway?
quick question as this driving me up the wall and I am very near finishing my project and this is the last bug... but I have a php page that has a shell_exec(./script.sh var1 var2) and the script is fired when a button is clicked. The script works when running direct from terminal, but only gets through the first few sections of code... not the whole thing... is there a limit or timeout i should be aware of? my script can take hour or 2 to complete
Any Opencart Guru here
?
?
#opencart
when run from webpage... no sorry alex
09:16
@Ocramius these are less...
@Peter Yes there is a timeout on HTTP requests, but if it takes an hour or two to complete you should detach it from the caller, use exec('./script.sh var1 var2 > /dev/null 2>&1 &');
ok brilliant DaveRandom thank you very much for the info i'll look into this now :)
But be careful with exposing that to the interwebs, it would be far too easy for an attacker to do that a few times a second and very quickly fill up your PID list with pointless processes
@DaveRandom You and your Obj-C hatred!!
09:18
It sounds like it might be worth you queuing jobs and having a dedicated queue processing system, like a cron job or daemon
@Peter What on earth is you script doing that takes an hour or two?
@dragon112 I couldn't resist, the setup was too good :-P
I just posted it in NSChat... Rest in peace Muhahaha
@daverandom the page should be on a page the user has to be logged in and each click of the button will cost them money so that should discourage spamming the button, but ok yes I will look at making a queue of jobs
my script build the source code for a custom clone of bitcoin and then mines the genesis block.. so really the code could possibly be split off into a few sections as well... just trying to get working proto type for client
@Peter Holy crap, that's a lot of CPU time you're giving away. Has your server got a GPU in it? Actually I'd probably look at having a dedicated GPU-miner box there to deal with the premining
I received this IV value from our client. I must use it in our encrypt algorithm. — Aron Elias Herrera Ponte 1 min ago
Ummmm... wat?
yeah client is setting that up as we speak.... yeah server gets hit pretty hard, so it not ideal atm but only my test server atm so not the end of the world
in NSChat, 56 secs ago, by borrrden
I wonder if DaveRandom realizes that Obj-C was garbage collected for a period of time
09:26
morning
@Peter Yeh fair enough if you just need to get it working. To answer the original question directly: PHP is time limited when running via a web SAPI, the default is 30 seconds but it's configurable in php.ini. But you can detach the child process from the parent by appending >/dev/null 2>&1 & to the command, with redirect STDOUT and STDERR to /dev/null and detaches the child.
You could also do $pid = (int) exec('/path/to/cmd >/dev/null 2>&1 & echo $!'); and the PID of the child process will be available in $pid
Also worth noting that this doesn't work under Windows
@dragon112 Gallery?? Unacceptable.
ok on linux box so i did good there :P ... now it not firing my script..
@Peter So you can't see it in the ps list?
ignore that link, it's not relevant
no it does not fire
Using FastCGI you can let the script continue running while the client sees a completed page :)
09:33
Yeh but for two hours? I'd rather let the redundant parent PHP process expire...
Ehhh, no, not that long :)
That just cries for decoupled process.
@DaveRandom You have been Gallery'd
my actual shell_exec looks like this now shell_exec( '/script.sh "'.$coinName.'" "'.$coinAbb.'" > /dev/null 2>&1 & '); is that wrong syntax ??
@Peter Looks alright, what's the full command when you echo the string out? (with args replaced)
erm as in i have $output = shell_exec('/script.sh ......')
and echo $output
?
that returns nothing
09:42
@Peter No I mean $cmd = '/script.sh "'.$coinName.'" "'.$coinAbb.'" > /dev/null 2>&1 & echo $!'; $pid = (int) exec($cmd); var_dump($cmd, $pid);
oh ok ty will run now
@Peter Slightly edited
Afternoon.
Is there any
mysql connection pool
for PHP application.
hmmm server error...
@Peter As in a 500? Error message?
09:50
nope as in chrome comes up with its new fance Server error page.. firefox is just blank page
ok it didn't like $pid = (int);
Well, it wouldn't, that's not valid and it's not what I wrote ;-)
oh lol i see read the new line
hi can anyone help me?
i have 100 000+ products
string(76) "./CoinCreationBashFile.sh "" "coinNameAbreviation" > /dev/null 2>&1 &echo $!" int(29099)
in database and i want to perform count of it for each category
09:54
@Peter Right, and PID 29099 doesn't exist after the call?
should i make count in another query, bcs loading all 100k in memory and then counting it would be overload, or there are beter ways?
Also your first arg seems to be empty, is that intentional?
hmm yeah coinName should be filled
@ccd580ac6753941c6f84fe2e19f229 well yes, COUNT(*)
string(83) "./CoinCreationBashFile.sh "FooCoin" "coinNameAbreviation" > /dev/null 2>&1 &echo $!" int(29111) that better output
09:56
@dragon112 thanks, i know that, i mean in which way implement count?
@dragon112 can it be done in 1 query somehow?
@dragon112 but limit on taking only 50 products?
@ccd580ac6753941c6f84fe2e19f229 Anything is possible, I have no idea what your database looks like so you might want to give some information and stop pinging me with every message
@dragon112 well product table is quite large it has catefory_id in it
this is being fired after my code tries to run my bash script
so lets say i have products: id name category_id
and categories is nested table with id name parent_id
posted on July 29, 2013 by Alan Knowles

Article originally from rooJSolutions blog It can't be that difficult can it?...... Background As part of our implementation for Xtuple, one of the key requirements was to value the stock using FIFO rather than the methods offered by default in Xtuple. After migrating from Netsuite, this became the next major task in our implementation. It took almost a year to develop

09:59
and i passing parameter 1 as category id, how can you put that in 1 query
if current query look like

« first day (1018 days earlier)      last day (4156 days later) »