« first day (773 days earlier)      last day (4189 days later) » 

5:02 PM
mysql command DISTINCT not working for me ..
"SELECT DISTINCT * FROM entrys,entryingredients,ingredients"
how can me ?
 
@ErfanSafarpoor DISTINCT * ... lol (ok, it was more of a "snort out loud")
 
You're selecting everything from 3 tables? Is that really what you want?
 
@ErfanSafarpoor I think you're looking for the JOIN keyword. Right now you're selecting the cartesian product of three tables.
 
tankyou.
i use this command in my project :
$this->db->select("SELECT DISTINCT * FROM entrys,entryingredients,ingredients
									WHERE
									entryingredient_entry_id = entry_id
								AND ingredients_id = entryingredient_ingredient_id
								AND entry_status = 0
								AND entry_id = ". $entryId ."
 
Like Niki said, check out JOIN
 
5:05 PM
and very good work ... But ... is 3 result from 1 result...\
 
And DISTINCT * is kind of a terrible thing to write.
 
GROUP BY?
 
@ShaquinTrifonoff group is good way ?
 
@NikiC well, it teaches you enough to get started. I sure learned a lot from it
 
SELECT * FROM entrys, entryingredients, ingredients ... GROUP BY entryingredient_entry_id, ingredients_id, entry_status, entry_id
 
5:09 PM
@Gordon Yeah sure. I am able to use vim. I just can't do any of the cool stuff
 
@NikiC but it shows you a couple of the cool stuff
 
Like what?
 
like :ce
or :r
 
`!!!$object->Contacts->id`
..is anyone seeing relation to this..
`( ! $object->Contacts->id) ? $object->Staff->id : $object->Contacts->id;`
 
i find those shiny
 
5:11 PM
@NikiC All you need is :%s/ .... /g
 
@NikiC We still require it as training to use the supercomputer.
No emacs on that baby.
 
I still remember the day I found out shift+O was insert above
changed my life
 
@Leigh :D
@LeviMorrison how super is your supercomputer?
 
there was also a command for loading the contents of a file into the current position. that's fancy, too. I forgot the command though
 
No emacs on that baby.
@NikiC On what kind of scale would you like those statistics?
 
5:13 PM
@Levi flops?
 
petaflops!
 
user1125394
it has a known processor?
 
@NikiC Over 90 teraflops, but in a month we'll see a large increase. In process of doing an upgrade.
I saw Leigh write peta and copied it, but it's teraflops.
 
@LeviMorrison :) I had to google, I forgot the name of the benchmark suite.. Linpack
 
@Leigh Yep.
 
5:16 PM
@LeviMorrison Ah okay. So it's not that super ^^
 
which of top500.org/list/2012/11 is it?
 
@Gordon Not on the list. We're a private university. We don't get $250 million dollar grants like TACC does.
This is their profile: top500.org/site/48958
 
@Gordon heh, I actually found that page quite hard to find
 
We're good friends with those guys.
@NikiC Maybe compared to the world, but what about your machine in front of you?
 
@LeviMorrison heh, well Stampede is petaflops :/
 
5:20 PM
@Leigh The facility is spec'd to support 12 megawatts of power.
I should certainly hope so.
@tereško By the way, these are the guys with the Intel Xeon Phi machines I got to play around with.
 
@Gordon What does :ce do? I guess the e is for editing a file, but what is c?
 
5:39 PM
@NikiC try it
 
user1125394
can you all vote to delete one of my stupid question stackoverflow.com/questions/9699639/json-valid-but-unparsable (the json is actually good (except the single quotes around added), that's just my question which is very poor)
 
user1125394
trying to clean some of my retarded things
 
@cyril You're supposed to use for delete votes.
 
user1125394
o right
 
5:49 PM
@cyril somebody linked it as a dupe I was warned while wanting to delete it for you. - ignore, just seen it was a merge attempt. you want both out of the way, right?
 
@hakre Is that some new feature?
And ugly it looks (plain browser dialog)
 
@NikiC At least for me that was new. Probably because a of the merge.
 
the merge?
 
user1125394
yes the question was stupid, but I managed to post it twice :D
 
@NikiC The question has a dupe that merges into the one we pressed the delete button.
Is there a way to filter away questions asked by users because of their reputation?
 
5:54 PM
@hakre not officially
but I have this bookmarklet
javascript:$('.question-summary').each(function( summary, elements ){  var score = $(this).find('.reputation-score').html();  if( score < 100 ) this.parentNode.removeChild(this); });
doesn't work on front page, because that rep that is shown is of the last editor
so use it on a tag page
 
I give it a try, thx.
 
@KyleTrauberman javascript:$('.question-summary').each(function() { if ( $(this).find('.reputation-score').html() < 100 ) $(this).remove(); }); there, way shorter, yet still readable :p
 
good point, i didn't write it - just dragged it to my bookmark bar
 
haha, 50 question listing condensed to three questions.
 
PHP Fatal error: Out of memory (allocated -1212153856) (tried to allocate 5 bytes)
One of the little-known features of PHP is that it uses negative memory :p
 
6:07 PM
@MikeB Let me guess, you are on a 32bit system?
 
@hakre If he was on 64 bit the memory would be a lot more negative ^^
 
Yeah, one of my VM's puked, that was the last error message - just thought it was funny
 
Heh, indentation really sucks when it comes to code processing
 
user895378
Framework ORM query builders are so ugly. Gag. — rdlowrey 54 secs ago
 
Or rather the fact that some people still think that tabs are an acceptable form of indentation :/
 
6:11 PM
@NikiC Doing static analysis?
 
I'm using 2 spaces now... Kind of hooked to it.
 
@MikeB For static analysis it does not matter. For code changes it does
 
\s*
 
user895378
@webarto you and Drupal. I used to use 2 spaces but now it all looks squished together. Everyone knows that 4 spaces is the one true indentation. All others are heretics and must be smashed for great justice.
 
@NikiC they are
 
6:13 PM
@MikeB And now try to unindent that :D
 
@NikiC ctrl+z
 
E.g. if you have some awesome mixed-tab-spaces indentation that looks something like | \t\t\t | and you try to do anything on it, everything becomes unnecessarily complicated
 
@rdlowrey I used 4 forever, but application was written with 2 spaces indent... when I first saw it, it was literally wall of code. I used \t = 4 :\
 
> 2.4. Indenting
> Code MUST use an indent of 4 spaces, and MUST NOT use tabs for indenting.
> N.b.: Using only spaces, and not mixing spaces with tabs, helps to avoid problems with diffs, patches, history, and annotations. The use of spaces also makes it easy to insert fine-grained sub-indentation for inter-line alignment.
 
6:16 PM
@FlorianMargaine ehm, no.
 
@NikiC Hem, yes.
 
Tabs are in fact better in most cases ;)
 
I'm bad at quoting
 
@MikeB Don't use \t @NikiC will hear you :P
Markdown is broken for me today too.
 
Pardon my naivete... I had no idea that there was a standard for indentation. What are the pros/cons to using 4 spaces/2 spaces/tabs?
 
6:18 PM
mostly it chaulks up to readability and personal preference.
if you are working in a team of 6 and 5 of the guys use tabs, you'd best use tabs. if they use two spaces, use two spaces.
 
Thanks guys. Will do.
 
Oct 2 at 14:08, by NikiC
God, people, just shut the fuck up and use 4 spaces
 
why hit space four times when I can hit tab once!
productivity FTW!
 
@rlemon Oh, I didn't know people were still programming in Notepad
I mean, it's not like every single editor (apart from Notepad!) can expand tabs to spaces ^^
 
user1125394
6:20 PM
@rlemon why does he conclude with "That said, only a moron would use tabs to format their code."
 
so your main argument is now turning to: the editor can convert your tabs to space, so use spaces (no other supporting arguments)
 
@CodyMoncur There's a standard for everything. I hand new guys a phpcs ruleset file and tell them "This completes your code-standards training" and I sleep well knowing that our codebase is consistent
 
@cyril he is a space guy I suppose, the rest of the article supports both in fact and leads to the conclusion that: guess what? it doesn't fucking matter so long as it is readable and consistent.
 
and as long as it isn't tabs ^^
 
user1125394
yes this is the end joke maybe
 
user895378
6:22 PM
@NikiC +1
 
anyone advocating four bytes over one is trolling. I am a tab user, but I don't tell space people they are wrong, I just let my editor convert their redundant spaces into a single tab.
space people act like religious nutjobs who just heard someone knocking their beliefs.
 
@rlemon Are you one of those people who commits a crap-ton of spacing changes in addition to whatever task you were working on? :p
 
it's a freaking indentation character, it should be stripped on minification anyways.
 
@rlemon Dude, get out of here
This is a PHP room, not JS
We don't care how many bytes our code has
 
@MikeB he's one of those people using spaces on spaces project, and tabs on tabs project. Plus, tabs on personal projects.
 
6:25 PM
"Fixed casing error in help-text" - 29 files changed, 2418 insertions(+), 2714 deletions(-)
^ WTF
 
@MikeB hehe no i'm not one of them
 
@NikiC normalize first.
 
@hakre Yeah, that's what I'll be doing
 
often, i'm the only one working on my projects ;) but when I do see someone elses code I respect their indentation
 
@hakre It's a bit unfortune though, because I was hoping to retain the exact formatting, but I don't really want to deal with this
 
user895378
6:26 PM
@rlemon, I will now hoist you by your own petard:
 
user895378
 
@NikiC Replace with tokens.
 
user1125394
@rlemon do you imagine the huge refactorings :P, that's an idea for a commit where code mix them
 
@hakre tokens?
 
@rdlowrey Just pushed to DNS lib, hope fully now a bit saner/more usable and has some readable examples (we'll gloss over the server script for new RE: good practice/readability). Also now supports compression of outgoing messages. I have started writing a zone file reader/writer implementation as well, might end up in a separate repo though, haven't decided yet.
 
6:28 PM
@cyril should I be able to follow this comment??? I tried. I failed
 
user895378
@DaveRandom cool.
 
@NikiC turn indentation into indentation tokens, operate on the lines, change indentation by the tokens as needed, then you can restore later on. Just an idea.
 
@hakre In that case I could just keep the indentation in the first place ^^
 
hi hakre
thanks for your solution
 
@NikiC Didn't you just wrote you want to retain the exact formatting?
 
6:30 PM
Simply brilliant! Thanks you very much! — Lucas Veiga 6 mins ago
I feel brilliant ^_^
 
Hi @Gaz_Edge!
 
@hakre I would have liked to do so, but now I won't to not deal with the indentation issues ;)
 
user1125394
@rlemon o nvm I'm tired and misread
 
@NikiC This is some older code which might be crappy, but it works well (never released the whole tool):
 
6:32 PM
gist.github.com/f6089a4d070075637cba - made with mixed indentation styles in the same file in mind.
 
@webarto no sound in mi office :-(
 
Oh, right, I forgot that people work from office...
 
6:47 PM
jo bitches
 
@PeeHaa what?
 
Do they speak English in What? @Neal
 
@PeeHaa I am very confused...
 
@PeeHaa again... no sound
 
6:52 PM
You cannot tell me you need sound to know what is being said...
 
WHAT
 
Shame on you :P
 
I (x2)DARE YOU
 
There you go
 
Neal brought shame to our tribe.
 
6:54 PM
I'm not sure whether someone who doesn't know that belongs to my tribe ;)
 
/votekick
 
/kickban
 
user895378
array_unique(array_flip($arr));
 
user895378
Oh wait, didn't read the whole question :)
 
user895378
array_unique(array_map(function($a) { return $a->name; }, $arr));
 
7:02 PM
my colleagues freak out at such code
and I do to, though
destructive functions + functional ones... meh, php
 
user895378
I'm not saying I'd do it that way, but if the standard library gives you the opportunity to do it semantically with a native function, why bother with a loop.
 
oh yeah sure, I'd use the same too, it's just that I'd prefer $arr = array_unique(array_map(function ($a) { return $a->name; }, $arr));
(note the non-destructive part of array_unique)
 
user895378
Oh, in that case I totally agree :)
 
and a consistent API too. That'd be nice.
array_filter takes the array as first argument, array_map does the opposite. Really? Yeah.
 
user895378
7:06 PM
lol I gave up on that a long time ago.
 
user895378
array_filter vs array_map drives me nuts
 
oh talking about that, I've had issues with phpcs not liking array_filter inside array_map, am I the only one?
like, it says it needs 46 spaces of indentation instead of 4.
 
@webarto what?
 
@Neal @Peehaa started it.
 
@webarto which?
 
user895378
7:09 PM
I generally use Iterators and not arrays so it's not often I have occasion to worry too much with array_* ...
 
he started what? :D
 
@webarto when?
 
lol
 
@PeeHaa why?
 
@Neal you are asking when did he started what and why which is what we... melted
 
7:11 PM
I'm installing some packages with composer on a linux vm that has a Mac as a host. when I do that, a php -l <filename> fails. opening the file in Sublime and saving causes this to disappear. thoughts?
 
@gms8994 Define "fails"
 
php -l /mnt/hgfs/forms-new/app/vendor/zendframework/zend-db/Zend/Db/Adapter/Driver/Pdo/Pdo.php
PHP Parse error:  syntax error, unexpected '*' in /mnt/hgfs/forms-new/app/vendor/zendframework/zend-db/Zend/Db/Adapter/Driver/Pdo/Pdo.php on line 276

Parse error: syntax error, unexpected '*' in /mnt/hgfs/forms-new/app/vendor/zendframework/zend-db/Zend/Db/Adapter/Driver/Pdo/Pdo.php on line 276

Errors parsing /mnt/hgfs/forms-new/app/vendor/zendframework/zend-db/Zend/Db/Adapter/Driver/Pdo/Pdo.php
but if I open the file with Sublime, and save it (without making changes), the error goes away
 
Perhaps Sublime fixes.... quotes or something?
 
hello. is it possible to do a opacity on this ? (css)
background: -webkit-linear-gradient(top, rgba(255,255,255,1) 0%,rgba(246,246,246,1) 47%,rgba(237,237,237,1) 100%);
 
@PeeHaa it happens on about 10-20 files, but only things that I pull in with Composer
 
7:14 PM
@ycelik why don't you try it?
 
I dont know how xD
 
@ycelik change ,1 to e.g. ,0.5
@gms8994 what exactly is on line 276, it must have been something...
 
ehhh Is that from Zend FW 1?
 
@webarto 276 is the end of the file
@PeeHaa ZF2
 
@gms8994 then EOL is broken
 
7:17 PM
@webarto in what way?
 
Inspect the file with a decent text editor to see what characters are at the end of the file
 
@gms8994 en.wikipedia.org/wiki/Newline There are Windows, Mac and Unix newlines, probably there is mismatch somewhere...
 
@webarto thx man that worked gr8 !!! ty so much#
 
You're welcome.
 
@webarto vim suggests it's all correct. No windows lines, and Mac and Unix share newlines nowadays
 
7:19 PM
@PeeHaa can you approve my edit for that question
0
Q: Pass variable to different php file

John HarbertI am currently using Drupal 7. I have pages that include php files that run a mysql query in them. On the individual pages I have set variables unique to the pages so the mysql query will run based on what page is(variable assigned that page). So far I have been unsuccessful to get the mys...

 
user895378
@gms8994 There may be some stray null bytes in there
 
@webarto how?
 
@hanleyhansen done
 
thanks
 
@gms8994 Run a diff between old and new file and you will see what is the problem, all we can do is guess.
@Neal Unable to comply. Building in progress.
 
user895378
7:21 PM
@webarto lol that would make wayyyyy too much sense. I prefer to rub my crystal ball and read palms and throw out guesses.
 
@webarto diff shows nothing. Unless there's some parameter to diff that I can't see
 
@rdlowrey Too much sense doesn't make sense. We shall do it like our ancestors did!
 
@webarto lemons.
 
user1125394
@gms8994 try meld oldfile newfile
 
And can more people downvote this misleading dude
 
7:23 PM
why would anyone ever suggest this? stackoverflow.com/review/suggested-edits/1086251
 
@gms8994 If diff isn't showing anything, then you don't have a problem.
 
-1
A: Pass variable to different php file

primoIncluded files inherit the scope from which they were called. file1.php <?php $var = "I'm a var."; include('file2.php'); ?> file2.php <?php echo $var; ?> Note that if you are placing the include inside a function, you will need to delare the variable as global in or...

 
user895378
@gms8994 dude, open it in a decent text editor and tell the editor to display control characters and whatnot. Also, if you do it correctly, diff will work.
 
@webarto but I do. because I can't run tests with those files, and I can't even lint them
 
I accidentally downvoted question, on closer inspection it seemed like it was legit.
 
7:25 PM
@rdlowrey suggest one for linux, and I'll be glad to
 
@webarto the one i posted?
 
user1125394
@gms8994 vi, else try meld to check the diffs
 
No, above your message.
 
user895378
@gms8994 Since you said you're using vi/vim ... chrispian.com/quick-vi-tip-show-hidden-characters
 
7:27 PM
@rdlowrey You think diff would work?
 
Someone read the answer the guy posted. i didn't know that about PHP. Is it true?
 
Hey all I have a HTACCESS question I was hoping someone could help me with
 
ok. vim shows a $ at the end of the file (implying newline), opendiff shows 0 differences.
 
user895378
how about vimdiff a b
 
@hanleyhansen What is true?
 
7:28 PM
-1
A: Pass variable to different php file

primoIncluded files inherit the scope from which they were called. file1.php <?php $var = "I'm a var."; include('file2.php'); ?> file2.php <?php echo $var; ?> Note that if you are placing the include inside a function, you will need to delare the variable as global in or...

@webarto That ^^
 
user895378
@webarto I think so ...
 
Read my comment.
 
@hanleyhansen You are wrong.
 
@rdlowrey nothing listed there either. this is why I'm confused
 
7:31 PM
maybe I can write a script that will read in the file and parse it all, and see what that thinks
 
Maybe you are wasting time.
 
@webarto His way works?!?!?
 
<?php
    $var = "I'm a var.";
    function func() {
        global $var;
        echo $var;
    }

    func();
 
@webarto maybe. but it's a problem that someone else in the office is having as well, so it's worth it in my opinion
 
@hanleyhansen It evaluates to this... and this works... although it is wrong...
 
7:35 PM
his argument is that if he includes file2 in file1 then he can echo vars from file1 in file2
 
@gms8994 run a CRC32 or anything else, byte by byte comparison, and see what is wrong (different)...
 
@webarto Can't be.
 
@hanleyhansen forget about file1 and file2... it is the same thing like you written it in one file...
@hanleyhansen I don't care.
 
@webarto md5sum before and after suggests the file is the same
 
@webarto Oh i see what you mean. But if you run file2.php you get an error.
 
7:38 PM
but it throws errors in a lint test
 
user895378
@gms8994 I still think it's likely that you have a stray null byte in the file that's confusing php.
 
@gms8994 Send me the files, I've had it... or be silent, forever.
 
user895378
and I believe vim stores a null byte as a line feed in memory, which would make it look like an LF character.
 
here's the most interesting part
php -l Adapter.php; cp Adapter.php Adapter.php.orig; cp Adapter.php.orig Adapter.php; php -l Adapter.php
PHP Parse error:  syntax error, unexpected $end in Adapter.php on line 286

Parse error: syntax error, unexpected $end in Adapter.php on line 286

Errors parsing Adapter.php
No syntax errors detected in Adapter.php
 
user895378
which is why I think it's a null byte
 
7:42 PM
so I highly doubt sending the files to you would make a difference
 
\0
NUL
 
user895378
0x00
 
wouldn't that cause an md5sum to report different files though?
 
@gms8994 0 * x = 0
 
ok; using xxd. what should I look for to see a null byte?
 
user895378
7:43 PM
I'm giving up. I've done all I can do without access to the files and I don't care enough to look at the raw files because someone's terrible text editor added a weird control character in outdated ZF code.
 
@rdlowrey it happens in every package I install via composer. and only via composer
 
user895378
@gms8994 lol that is kind of funny
 
user895378
Have you tried updating your composer version?
 
user895378
Because that doesn't happen to me ...
 
user895378
(I don't like Composer, FWIW)
 
7:45 PM
 
it's happening in the same way to another coworker as well
 
user895378
@gms8994 Then perhaps you should file a bug report with the composer people on their github page
 
guess I will. was hoping to be able to give some direction to them though
 
user895378
I would just mention that you suspect composer is adding a control character somewhere that's causing a parse error.
 
7:47 PM
They'll ask for your super secret already publicly available files, probably...
 
user895378
If the problem does indeed manifest for every file generated from composer it should be a relatively straight-forward issue to reproduce.
 
user895378
^ I voted "Not a real question" because it's basically saying, "I don't understand OOP, give me advice," but I'm not 100% sure it should be closed.
 
user895378
 
@rdlowrey lol i just saw that
what the hell is this guy talking about?
-1
Q: can't convert this from PHP to C#

CoboldI need this to be converted to c# if it's possible: $uri = "http://www.dictionaryapi.com/api/v1/references/" . urlencode($ref) . "/xml/" . urlencode($word) . "?key=" . urlencode($key); return file_get_contents($uri); I suppose it's like this: WebClient client = new WebClient(); S...

 
7:53 PM
thanks for the assistance guys. it's definitely a start
 
github.com/composer/composer/issues/1365 if you care to follow along
 
Hello Mr Cv Pls :)
 
Good Morning o/
 
8:00 PM
So true every comment Jocelyn makes is followed by 3 cv-pls
 
:-)
 
@webarto @Nick blame the people who post the bad questions on Stackoverflow
 
@Jocelyn Not blaming, keep up the good work :P
 
I know, webarto. Thanks
and now is Mr Delv-pls in action (aka @PeeHaa) ;-)
 
8:07 PM
2
Q: PHP. Extension. Call existing PHP function

nkammSo I decided to write an extension for php. Everything seems to be fine except I'm stuck on a tiny problem. I have php-5.4.9 source codes. There is file ext/standard/mail.c with awesome function PHPAPI int php_mail(char *to, char *subject, char *message, char *headers, char *extra_cmd TSRMLS_D...

we should support extension writer
 
Where is @NikiC when you need em?
 
evening
 
look who woke up in 22h or 10PM
 
22, actually, here
 
@tereško Morning
 
8:20 PM
 
@PeeHaa Mid-day
 
Hi all
 
@Baba Shalom
 
8:28 PM
@Neal helloo .. how was your day ?
 
@Baba good. and yours?
 
@Neal ... hate business meetings .. presentation all day instead of coding .. i wonder how this business guys survive by showing slides all day
 
People like slides.
 
@webarto WEEEEEEEEEEEEEEEEEEEEEEEEEEEEE!!
 
8:41 PM
A kitten dies everytime a rep whore answers a question like that
7
 
@PeeHaa There are no girls on the internet.
 
user895378
I have a question regarding garbage collection and object life-cycles ...
 
user895378
Say I have this class:
 
@rdlowrey 42
 
user895378
@Neal :)
 
8:43 PM
yes
 
user895378
(my example class is changing)
 
user895378
Dah. Okay, forget the example code. Let's just say you use an injected factory to generate an object inside of a class.
 
user895378
Say that factory has to create several different objects during the life of the exterior class.
 
user895378
The outer class that was injected with the factory has a life-cycle that lasts a really long time.
 
8:49 PM
I would defiantly check out symfony2. symfony.com It's most watched on github and is setting the new industry standard. — Tim Lieberman 3 hours ago
OW. OW. OW. If any framework is the industry standard, then my oh my how the might have fallen.
 
user895378
Is there any benefit to destroying the objects created inside the long-lived object once you're finished with them? Or does the garbage collector clean those up even though the exterior class stays alive for a long time after the internal objects are no longer needed?
 
@rdlowrey If you have many unused objects, which would last long after they're used (i.e. their scope is unterminated), manually unset them to free memory.
 
user895378
@MadaraUchiha So is it correct to say that there's no way for them to be garbage-collected if they exist inside the scope of another class that is long-lived?
 
Even worse @Lusitanian
1
A: Cake PHP registration form

Tim LiebermanYou have to follow the coding standards with CakePHP. In this case the class "Users" will not work. You have to use class "User" and refactor the code to look for User.

Cake has coding standards now?
 
@Lusitanian zOMFG
 
8:54 PM
Correct. Since the scope hasn't been terminated, these object "may" be used again later during runtime, so they're kept in memory
 
@PeeHaa He means naming convention - User vs Users is not a standard
 
If you know they won't be used, destroy them to free up memory.
 
user895378
@MadaraUchiha Cool -- that's what I thought but I wasn't sure if somehow the garbage collector was automagically really smart :)
 
Now if you don't mind.
 
8:55 PM
@PeeHaa lol
 
Scribblenauts Unlimited calls!
 
@PeeHaa kill?
 
Yes. Kill it
Like burninate only with moar drama
 
@PeeHaa AUGH MY EYES
 

« first day (773 days earlier)      last day (4189 days later) »