« first day (1845 days earlier)      last day (3192 days later) » 
00:00 - 16:0016:00 - 00:00

4:05 PM
meta.superuser.com/questions/9637/… I want to put an answer here saying "quit being a whiney biotch and just edit it out" :-) (I agree it does not belong, but you should hear the string of obscenities some of the nicest people in the world spew out at computers.)
 
Hey @Bob, I wrote a tampermonkey script (basically the same as greasemonkey, but Chrome) that iterates through all DOM elements on the page with $('*'), finds ones with a certain CSS property whose value matches a regex, and sets the property to "none". Works great for the existing elements, but AJAX stuff on the page adds new elements, which inherit the undesired property from their CSS class.
Clearly, what I need to do is iterate the CSS classes, and change them, not the elements themselves.
Any idea how that can be done, though?
 > $('*').each( function(){
   var ll = $(this).css("background-image");
   if(ll != null && ll != "" && ll != "none" && ll.search("sparkle") != -1)
   {
      $(this).css("background-image", "none");
   }
 });
works great for existing elements, but since that code only runs on page load, it doesn't take care of new elements added dynamically at runtime.
 
Bob
@allquixotic Modifying page CSS is a pain in the arse.
@allquixotic You can use a mutation observer! :D
 
@Bob :/
@Bob Ooh. That sounds useful, and will probably work.
 
Bob
@allquixotic I've done it before. You can copy most of it from this userscript: stackapps.com/questions/4943/view-full-image-sizes-on-click
@allquixotic Modifying the CSS once would probably be faster, though.
 
@Bob I tried to do that with the "JSS" library, but it doesn't seem to actually do anything when I modify CSS elements' properties using it. :S
 
Bob
4:17 PM
@allquixotic Problem is you'd need to know the exact selector used, I think
> SecurityError: The operation is insecure.
WELP THEN
@allquixotic Turns out if you want to access external stylesheets, you're SOL in FF...
@allquixotic What you can do is define a new local stylesheet with the same (or more specific selector) and !important the rule you want to change.
oh wait, if you're copying that script use the current version: github.com/Elusive138/SEImageExpander/blob/master/…
was a bugfix I forgot to update on stackapps
 
@Bob Good idea! The existing markup has the following inside <head>:
<style type="text/css" media="screen">
<!--
(((...stuff...))) a.tag-1492412,span.tag-1492412{background-image: url(resources.guild-hosting.net/201508201515/themes/core/images/…);} (((...stuff...)))
-->
</style>
I just need to add a similar <style> element but changing it to a.tag-1492412,span.tag-1492412{background-image: "none" !important;} ?
 
Bob
@allquixotic Pretty much.
Though those IDs can change...
@allquixotic btw, no quotes around none
 
@Bob This means I need to dynamically parse the CSS (I can probably do that using the aforementioned JSS library) to loop through the classes and determine which ones set that property to one of the undesired images.
 
Bob
@allquixotic ahhh, y'see...
Dunno about Chrome but you can't even read the cross-origin stylesheets in FF.
If you could read them, you could probably modify them directly.
 
@Bob This isn't cross-origin, though. In my particular example, the style is coded directly into the main HTTP response from the server.
 
Bob
4:30 PM
@allquixotic Ah. Dunno what you're doing with JSS, then. Could probably work with document.styleSheets directly.
@allquixotic Any chance you can link to the page?
 
@Bob Sure. It's not a secret or anything. It's any page off of pf-enclave.org
(including the homepage)
 
Bob
@allquixotic What does this actually affect?
oh found it
 
@Bob TL;DR, it makes the sparklies on certain peoples' names go away.
 
Bob
@allquixotic Getting close.
[].forEach.call(document.styleSheets, function(sheet) {
  try {
    sheet.cssRules;
  } catch (e) {
    return;
  }

  [].forEach.call(sheet.cssRules, function(rule) {
    if (rule.cssText.match(/sparkle/)) {
      rule.cssText = rule.cssText.replace(/background-image:.*?;/, 'background-image:none;');
      console.log(rule.cssText);
    }
  });
});
That almost does it.
Don't know why it's not actually setting.
It does the work of finding the correct rules.
 
Hmm.
Chrome:
Uncaught TypeError: Array.prototype.forEach called on null or undefined
    at forEach (native)
    at <anonymous>:9:14
    at StyleSheetList.forEach (native)
    at <anonymous>:2:12
    at Object.InjectedScript._evaluateOn (<anonymous>:905:140)
    at Object.InjectedScript._evaluateAndWrap (<anonymous>:838:34)
    at Object.InjectedScript.evaluate (<anonymous>:694:21)
 
Bob
4:44 PM
@allquixotic lemme get this going on FF first :P
@allquixotic Works in FF:
[].forEach.call(document.styleSheets, function(sheet) {
  try {
    sheet.cssRules;
  } catch (e) {
    return;
  }

  [].forEach.call(sheet.cssRules, function(rule) {
    if (rule.style && rule.style.backgroundImage && rule.style.backgroundImage.match(/sparkle/)) {
      rule.style.backgroundImage = 'none';
    }
  });
});
@allquixotic Works in Chrome:
[].forEach.call(document.styleSheets, function(sheet) {
  try {
    if (!sheet.cssRules) {
      return;
    }
  } catch (e) {
    return;
  }

  [].forEach.call(sheet.cssRules, function(rule) {
    if (rule.style && rule.style.backgroundImage && rule.style.backgroundImage.match(/sparkle/)) {
      rule.style.backgroundImage = 'none';
    }
  });
});
Had to do that funny try-catch because FF chucks a SecurityError there :P
Looks like Chrome might just pretend it doesn't exist. So added a null-check.
 
Nice!
 
Bob
Note that this only works as long as the styles remain on the same domain.
 
Got it. Much appreciated. Thanks for your help!
HA! It works when people send new messages in chat!
Mind if I store that in a public gist? I'll give you author credit (without disclosing your email).
 
Bob
np
@allquixotic go ahead
 
I have a lot of gists O_O but they're useful for little mini-projects too small to have a repo for
also I'm not sure exactly why but Firefox is WAY faster and more responsive with Guacamole than anything WebKit/Blink-based
 
Bob
4:55 PM
... o.O
@allquixotic That's actually pretty unexpected.
 
maybe their HTML Canvas is better, or maybe it's the crap GPU on this system that is either being used inefficiently by Chrome, or more efficiently by FF, or FF isn't accelerating it at all and it's actually faster in software. Not sure.
 
Bob
WebKit is usually faster with WebGL.
 
This isn't WebGL (I think...?!)
 
Bob
@allquixotic Is Chrome even using HWAccel on that system?
@allquixotic ...I haven't a clue. I've only tested WebGL.
 
@Bob Nvidia NVS 300 with the Quadro ODE driver from 04/29/2014 (9.18.13.3311 === driver version 333.11). The NVS 300 is the GT218 chipset, from the GeForce 8400 GS rev.3, which is actually an iteration of a cut-down GTX 280 on the 55nm process.
In a word, DX10 hardware, but Windows is saying I have DX11 feature support. Shader Model 4.1.
FF is telling me all the hardware accel stuff is enabled.
 
Bob
5:01 PM
@allquixotic Head to about:gpu on Chrome.
 
Everything except rasterization is hardware accelerated in Chrome.
 
Bob
@allquixotic ...same here :P
Graphics Feature Status
Canvas: Hardware accelerated
Flash: Hardware accelerated
Flash Stage3D: Hardware accelerated
Flash Stage3D Baseline profile: Hardware accelerated
Compositing: Hardware accelerated
Multiple Raster Threads: Enabled
Rasterization: Software only. Hardware acceleration disabled
Threaded Rasterization: Enabled
Video Decode: Hardware accelerated
Video Encode: Hardware accelerated
WebGL: Hardware accelerated
Driver Bug Workarounds
clear_uniforms_before_first_program_use
exit_on_context_lost
...I wonder if some of those bugs are causing the FF leak
 
Could be. I have those same bug workarounds with a driver that's probably a year+ older than yours.
 
Bob
Accelerated rasterization has been disabled, either via about:flags or command line.
Disabled Features: rasterization
 
I believe accelerated rasterization is an experimental feature.
They're planning to turn it on more broadly in Chrome 45, but there'll probably be an explicit driver/GPU whitelist
It breaks or kills performance in a lot of configurations
 
Bob
5:04 PM
> On a related note, please, for the love of whatever you care about most, DO NOT APPLY THE SAME WORKAROUNDS TO MESA/RADEON AND CATALYST. Those are two completely different beasts, with two different sets of bugs, and even two possible courses of action (Catalyst: workaround; Mesa: file a bug upstream and workaround, keeping track of the workaround because the bug may be fixed)
lol
 
I wonder if the performance improvement in Firefox is due to the networking stack? Eh. I kinda doubt it.
 
Bob
That... would be weird.
 
Switching tabs from something like SE Chat to that guild website in Chrome latest and nw.js takes upwards of 1.5 seconds. In FF, visually it appears to be there immediately upon the next screen repaint (no more than a small handful of frames).
 
Bob
@allquixotic Takes what
 
@Bob I mean in Guacamole
 
Bob
5:06 PM
oh
that makes more sense :P
 
Granted, I'm on a ~150 Mbps downlink, but I think FF is caching the textures better or something, and it's able to swap the cached version right in instead of re-downloading the entire page
Chrome is like... uhhhh... lemme go ask the server
and this is with Chrome as my web browser on Windows Server 2012 R2 (in kvm on my dedi) on the server, for both "local" browsers.
Using between about 10 KBps and 175 KBps, the responsiveness of Guacamole when web browsing feels almost indistinguishable from native, and probably uses no more bandwidth than you would streaming music from Spotify (though I don't do that at work).
Those sparkles were driving bandwidth usage way up, though.
 
Bob
@allquixotic O_O
 
 
2 hours later…
7:07 PM
Anyone know good Wordpress Designers? I have 2 projects I need themes for
 
@CanadianLuke *deletes the last part of the URL* :P just kidding
 
It's fun, but needs more people on
 
 
3 hours later…
10:40 PM
Just a thought:
28
A: Why are foods often packaged in weird measurements

David RicherbyQuite often, it's because a manufacturer prefers to decrease the size of a packet than to increase its price. Customers notice when the price goes up but don't tend to notice the product getting smaller. For example, jam in the UK used to be sold in jars containing one pound, which became the e...

Is it economically feasible to not shrink food packages but increase the price instead?
I know this will hurt sales.
But can smart marketing offset this effect?
Price per box at the time of the change was $3.49.
If the box did not shrink, but the price was increased to $4.49 or even $4.99 (the price that would be needed today after accounting for inflation), would consumers be willing to buy the product?
 
10:58 PM
1980s typical box size for Frosted Flakes was 18 oz.
Now it's 12 oz.
Keeping it at 18 oz. would lead to untenably high prices ($5.99 or even $6.49 would not be unrealistic).
This is not a price most consumers can pay.
Some places do have it cheaper ($3 for 15 oz.).
Guess I've answered my own question.
Keeping an old, large package size and raising the price instead of shrinking it and keeping the same price (as is common practice) would eventually lead to very high prices that would turn all but the wealthiest consumers away ($10 cereal box, anyone?).
It's just not economically viable. Period.
Not tricking consumers about unit cost is not a solution, and I doubt any amount of marketing can change that.
With mass-market products like this, you cannot price your product out of the range of what most consumers will pay.
Raising the price is not an option. It doesn't matter how you market it.
You cannot price yourself into a niche.
As much as I hate deceptive practices, but I'm not willing to pay $6 for a box of cereal.
It's the same reason AAA games have stuck at $60 and microtransactions are appearing in full-priced games.
If you throw out the microtransactions (MTX) and low-value DLC (major DLC expansions are okay), a typical AAA game today would cost $80 to $100, and likely closer to $100 considering how much money game developers and publishers currently make from MTX.
$100 for a video game. Just not possible.
Full-scale DLC expansions would need to cost $30 to $40, rather than the more typical $10 to $20 today.
The economy isn't great. As much as I would prefer the honest solution, shoving rising costs in the face of consumers is not a viable solution when usable income and hence spending is lower than ever.
---End of rant----
 
11:34 PM
Morning
Looks like we're having a general election here in singapore on sept 11
Yay, yet another long weekend
 
00:00 - 16:0016:00 - 00:00

« first day (1845 days earlier)      last day (3192 days later) »