« first day (770 days earlier)      last day (3246 days later) » 

3:00 PM
Ops, vault time!
 
Kerbal Space Program. Really fun game. It's like the Space game that actually follows the laws of Physics, e.g, gravity and orbits.
Plus, it's really easy to mod.
 
@QPaysTaxes I think there is, but the best us to do .indexOf('sub-str')===0
 
That seems like an odd way to do that.
JS is so fucking wierd.
 
@QPaysTaxes Netscape, since ever.
 
Hey, did you guys know that the inital version of JS was designed in 10 days?
That's why it's type system is a huge pile of shit.
Hello @bazola
 
3:02 PM
@EthanBierlein Try PHP...
Honestly.
 
hey @EthanBierlein
 
We all know that PHP sucks too, but we're comparing two different languages with completely different purposes.
PHP is for server-side scripting, and JS is client-side.
 
Anyone want to weigh in on this?
0
Q: What are the cons to excluding somce code from coverage analysis?

RubberDuckI've recently become very interested in improving my project's test coverage. At this point, I have a submodule pretty thoroughly tested, but it's coverage is still pretty low because the tool is picking up all of my views as entirely uncovered. (I'm using MVP, so these views are really "dumb", t...

 
Yeah, but nothing beats echo '1000000000000000000000000000000000000000000000000' == '1.0E+48'; outputting 1 (true)
Besides, I'm the author ot the .
And yes, both questions are mine, and both run in Js and PHP without any change.
@QPaysTaxes What error?
Let me guess the error:
SyntaxError: Expecting ',' got expression
Or
SyntaxError: Unexpected End of File
That would be if you had something like a(b;
 
or you got bitten by semicolon insertion
 
3:10 PM
That happens a lot to me.
Specially on my polyglots
GODDINGUS!
I died on Tera!
Your if has a space.
You can't have / on URLs to run with javascript:.
Well, / is the directory separator.
I would encode it.
after you have your code up and running, you just shove it in a string and run urlEncode() in your console.
I think that's the function
Actually, it is encodeURI().
 
0
Q: Is this the best way to write this SQL select Statement

canyon289I'd like to Select columns from Table 1 with a Row Filter, Select columns from Table 2 and join. This works but it's a bit verbose. Was wondering if there is a cleaner way to write this. SELECT * FROM ((SELECT JOB_NUM, ITEM_NUMBER, DATE_COMPLETED, QTY_COMPLETED, STD_USAGE, ACTUAL_USAGE FROM ...

 
Example: encodeURI('alert("Encode the Javascript and /")');
Which returns alert(%22Encode%20the%20Javascript%20and%20/%22)
Exactly
Actually, they are
But
Weird
What are you trying to check?
 
I would be surprised if they weren't different
always use === and !==, never == and !=
 
Actually
They are different
!a[0] is the same as saying not a[0]
 
you mean a[0] is guaranteed to be a string?
if so, then they are equivalent
 
3:25 PM
Which means that if a[0] is not true, it will be true now
 
what if the array is empty?
 
If you negate something empty, it becomes true
 
you mean falsy
"empty" can mean a lot of things
 
Yes, falsy
 
"" is the only falsy string though
so one of your preconditions must be off
 
3:27 PM
Let a[0] be an empty string
`!a[0]` -> `true`
`a[0] != ''` -> `false`
GODDAMN
Weird formatting system
 
oh lol
 
But now you know a drop more
 
I generally prefer an explicit !== '' since that makes it slightly easier (for me at least) to avoid those off-by-one-negation errors
golfing?
 
lol, javascript
 
@QPaysTaxes why not use an actual obfuscator minifier?
 
3:30 PM
If you want tips on reducing your code in size, I can help
 
a minimizer is nothing more than stripping all whitespace and renaming all variables to as few characters as possible
 
@JeroenVannevel Wrong
You couldn't be more wrong
 
Hello @nicael
Nevermind
Hello @JaDogg
 
Hi !
 
@IsmaelMiguel in what way?
 
3:31 PM
How about this: if( a != false ){ alert('A is not false') }
That is 'regular' code.
 
Hmm nicael must have gotten his account unbanned.
 
Minified: a&&alert('A is not false')
And yes, minifiers do that
 
Fine, it also does some other changes that minimize the code
renaming variables and removing whitespace is the main function though
 
@QPaysTaxes Can I reduce it?
@QPaysTaxes Instead of (function(){...})(), use !function(){...}()
Which reduces 1 byte
 
happy trolly day
 
3:34 PM
@IsmaelMiguel why the "!"?
 
@Ixrec I have no idea, but it works
Try this: !function(){alert('hi!')}()
 
I mean I think it should work without the !
 
It gives SyntaxError
SyntaxError: Expected identifier
 
hm, I get syntax error in the console just for function(){}
I think this might be something that's valid in real code but not in a repl
huh, it allows function x(){} but not function x(){}()
nvm I have no idea what's going on here
 
function x() isn't an anonymous function
 
3:39 PM
@IsmaelMiguel a&&alert('A is not false') , does that mean the compiler wont bother to process alert command when a is false ?
 
@Agawa001 Exactly
 
i just want to get some basics thanks
 
You're welcome.
That is the benefict of lazy evaluation
 
(golfing) im amateur of these tricks ( actually member of code golf)
 
You will learn a lot by minifying code
@QPaysTaxes Here, for you: !function(a){location="http://codereview.stackexchange.com/search?tab=votes&q="‌​+(a.length?a.reduce(function(b,c){return b+(~c.indexOf("-")?"-%5B"+c.substring(1):"%5B"+c)+"%5D+"},''):a)+"created%3A..60‌​d+answers%3A0+closed%3Ano"}(prompt("Tags: (leave blank for none)").split(/\s+/))
That was minified by me, you can try a minifier after
But if you put a space and then a tag, it will fail
(space)a will fail
Don't use it. But there is
 
3:58 PM
what's wrong with .trim()?
 
.replace(/^\s*(.*)\s*$/,'$1')
 
assuming we aren't worried about anything funky like unicode whitespace
 
:/
trim support is a joke
 
oh, compatibility
sorry, I work in ES5 strict mode all day so I forget that stuff easily
 
@QPaysTaxes I was thinking about Firefox
Just go ahead and use .trim()
Firefox must be on version 37.0.5
Or 39
!function(a){location="http://codereview.stackexchange.com/search?tab=votes&q="‌​+(a[0]?a.reduce(function(b,c){return b+(~c.indexOf("-")?"-%5B"+c.substring(1):"%5B"+c)+"%5D+"},''):a)+"created%3A..60‌​d+answers%3A0+closed%3Ano"}(prompt("Tags: (leave blank for none)").trim().split(/\s+/))
Try this
 
I'm looking at it
 
0
Q: Is this a good way to handle PHP view controllers?

Mo FriedrichI am currently rewriting a legacy PHP4 application to a MVC-style object-oriented one. As the most complex part is the models, I came up with the following controller-view scheme. I wanted to use only variables in my views, using only <? if ($foo === 'bar'): ?>-like blocks if necessary. The contr...

 
@QPaysTaxes !function(a){location="http://codereview.stackexchange.com/search?tab=votes&q="‌​+(a[0]?a.reduce(function(b,c){return b+(~c.indexOf("-")?"-%5B"+c.substring(1):"%5B"+c)+"%5D+"},''):a)+"created%3A60d+‌​answers%3A0+closed%3Ano"}(prompt("Tags: (leave blank for none)").trim().split(/\s+/))
Some weird chars that got in the way
It works fine here...
What error do you get?
:/
There, an hex dump
It works fine on IE
It works fine on my chrome
Not even a singlke change
Everything is the same, except that instead of a you have e
What n?
Well spotted
No, you wrote it
I just made it ugly
 
4:19 PM
MONKING!
That's neat, how does it work?
 
Run in the console, write the tags separated by space and done
Or no tag at all
javascript:!function(a){location="http://codereview.stackexchange.com/search?ta‌​b=votes&q="+(a[0]?a.reduce(function(b,c){return b+(~c.indexOf("-")?"-%5B"+c.substring(1):"%5B"+c)+"%5D+"},''):a)+"created%3A60d+‌​answers%3A0+closed%3Ano"}(prompt("Tags: (leave blank for none)").trim().split(/\s+/))
There, a link
What's the markdown here?
How?
 
...?
 
I recommend encoding the "
Look at the q
Don't use chrome for that, use firefox or IE
 
Can I just paste the JS in the console there? ^^
 
?
Yeah
 
4:34 PM
SWEET
 
@QPaysTaxes javascript:!function(a)%7Blocation=%22http://codereview.stackexchange.com/searc‌​h?tab=votes&q=%22+(a%5B0%5D?a.reduce(function(b,c)%7Breturn%20b+(~c.indexOf(%22-%‌​22)?%22-%255B%22+c.substring(1):%22%255B%22+c)+%22%255D+%22%7D,%22%22):a)+%22crea‌​ted%253A60d+answers%253A0+closed%253Ano%22%7D(prompt(%22Tags:%20(leave%20blank%20‌​for%20none)%22).trim().split(/s+/))
 
I'm not sure your script is working correctly
 
[bleeping] IE!!!!
 
so what do you want, code review? — Chaitanya Gadkari 43 secs ago
 
Using Chrome, I ran the script in the console and typed in python for tags and only got one result
> 143 results
Yeah that looks better ;)
Now, how do I save this as a bookmarklet...
 
4:42 PM
Monking, again
@QPaysTaxes Reverse dereference monk to you as well :D
I think you mean monksplat.
splatmonk would be *monk
 
@rolfl lol
 
this answer is to migrate to code reviewAgawa001 29 secs ago
 
4:48 PM
^ im on tv
 
@Agawa001 Lol
 
Oh, right.
 
@Agawa001 Broken code is off-topic for Code Review. — QPaysTaxes 38 secs ago
 
lol
let me do my trolling job in peace
 
Look, I don't understand why you have to be a troll @Agawa001. This is a great community and we don't need you undermining it.
 
4:51 PM
hi
 
Hi.
I got this, @Jamal ;-)
 
walks away
 
Well, he's a troll. I think he's a little deserving of the nasties.
Like the old phrase says, "A taste of your own medicine."
 
Is the civil war over?
 
4:55 PM
We're talking about an internet troll @Agawa001. Specifically, you.
 
lets meditate who s the real troll who offend people here
 
In Internet slang, a troll (/ˈtroʊl/, /ˈtrɒl/) is a person who sows discord on the Internet by starting arguments or upsetting people, by posting inflammatory, extraneous, or off-topic messages in an online community (such as a newsgroup, forum, chat room, or blog) with the deliberate intent of provoking readers into an emotional response or of otherwise disrupting normal on-topic discussion. This sense of the word troll and its associated verb trolling are associated with Internet discourse, but have been used more widely. Media attention in recent years has equated trolling with online harassment...
 
Step back from the edge, everyone.
 
rolfl has frozen this room.
rolfl has unfrozen this room.
 

« first day (770 days earlier)      last day (3246 days later) »