strict

Is it worth the development time to output valid HTML?

Developing websites are time-consuming. To improve productivity, I would code a prototype to show to our clients. I don't worry about making the prototype comform to the standard. Most of the time, our clients would approve the prototype and give an unreasonable deadline. I usually end up using the prototype in production (hey, the proto...

How do I break out of a loop in Perl?

Hi, I'm trying to use a break statement in a for loop, but since I'm also using strict subs in my Perl code I'm getting an error saying: Bareword "break" not allowed while "strict subs" in use at ./final.pl line 154. Does anyone know of a workaround for this (besides disabling strict subs)? My code is formatted as follows: f...

Is there a good *strict* date parser for Java?

Is there a good, strict date parser for Java? I have access to Joda-Time but I have yet to see this option. I found the "Is there a good date parser for Java" question, and while this is related it is sort of the opposite. Whereas that question was asking for a lenient, more fuzzy-logic and prone to human error parser, I would like a ...

css background color disappears with doctype

I'm trying to set background colours on a few different elements in an html page, but whenever I apply a doctype declaration the colours get ignored. Other styles seem unaffected. I'm sure I'm being an idiot. It happens on IE7, FF3 and Chrome. With Strict and Transitional html 4 Doctype. Body and Div backgrounds are affected. A minimal ...

How to fix the size of a Java heap

Hello, everyone I know Java VM has "-XMx" and "-XMs" for setting the size of the heap. It also has a feature called "ergonomics", that can intelligently adjust the size of the heap. But, I have a problem at hand requiring the heap with strictly fixed size. Here is the command line arguments: "-Xms2m -Xmx2m -XX:+PrintGCDetails" How...

Summary of ActionScript 3 strict mode

Where can I get a summary of differences between ActionScript 3.0 strict and standard mode? In other words, what are the things I can do in standard mode but not in strict mode? ...

IE strict mode flicker on activex controls

I have a web page containing (amongst other things) several activex controls embedded in it. It's only ever rendered in IE, and it's in strict mode. If I highlight any text in the page (or rollover an image with an onmouseover event to change it's image or whatever), the controls all flicker horribly. If I change the page to quirks mo...

Help needed with DIV-layout for site

Hi I am trying to build a page with the following in it: Already have the following: one div for page to center the whole page with width 809px inside <div class="page"> is the following: <div class="header"> <div class="container"> (container for content stuff) <div class="footer"> What I am struggling with: <div class="contai...

PHP5: Creating default object from empty value

I'm getting an error in my PHP code Strict Standards: Creating default object from empty value. The code I'm using is: $u = new User(); $user->id = $obj['user_id']; The error is appearing on the second line, where I set the id property. The user class has id set as a private property with magic getters and setters defined. Strangely...

PHP 5 disable strict standards error

Hello. I need to setup my PHP script at the top to disable error reporting for strict standards. Can anybody help ? ...

Should one use strict comparison in Strings?

I know that for instance, using: if (in_array('...'), array('.', '..', '...') === true) Over: if (in_array('...'), array('.', '..', '...') == true) Can increase performance and avoid some common mistakes (such as 1 == true), however I'm wondering if there is a reason to use strict comparisons on strings, such as: if ('...' === '.....

Which (javascript) environments support ECMAscript 5 strict mode? (aka "use strict")

ECMAScript 5 is in its final draft as I write this; It is due to include a strict mode which will prevent you from assigning to the global object, using eval, and other restrictions. (John Resig's Article is a good introduction.) This magical sanity-saving mode is triggered by including the string "use strict" at the top of your file (o...

php best practices enforcement

I try to ensure that the code I write is of the best quality possible, so I strive to follow accepted sets of best practices. In perl, I try to follow the guidelines in the popular book "Perl Best Practices" and I use the perlcritic module to enforce the policies recommended in that book. Perlcritic checks my code to ensure that each re...

Why does defined sdf return true in this Perl example?

I tried this example in Perl. Can someone explain why is it true? if (defined sdf) { print "true"; } It prints true. sdf could be any name. In addition, if there is sdf function defined and it returns 0, then it does not print anything. print (sdf); does not print sdf string but if (sdf eq "sdf") { print "true"; } prints ...

Should I worry about "window is not defined" JSLint strict mode error?

This won't pass JSLint in strict mode: "use strict"; (function (w) { w.alert(w); }(window)); The error--from jslint.com--looks like this: Problem at line 4 character 3: 'window' is not defined. }(window)); Implied global: window 4 Do I need to tell JSLint to ignore the error, or am I seriously doing something wrong? ...

Why does Javasript's strict comparison act the way it does?

Possible Duplicate: Is JavaScripts math broken? If the main difference between Javascript's "strict comparison" operators and the traditional ones is type coercion, why does 0.1+0.2===0.3; return false? Riddle me this, Batman. ...

In ECMAScript5, what's the scope of "use strict"?

What scope does the strict mode pragma have in ECMAScript5? "use strict"; I'd like to do this (mainly because JSLint doesn't complain about it): "use strict"; (function () { // my stuff here... }()); But I'm not sure if that would break other code or not. I know that I can do this, which will scope the pragma to the function... ...

Strict Standards: Only variables should be passed by reference

$el = array_shift($instance->find(..)) The above code somehow reports the strict standars warning,but this will not: function get_arr(){ return array(1,2); } $el = array_shift(get_arr()); So when will it report the warning anyway? ...

IE horizontal scroll problem

When scrolling the div the table cells move, but the cell text stays in the same position relative to the page. The cell text should scroll along with the cell even though it's in a relative div. The problem can only be seen in IE (IE7 at least). The sample behaves correctly in Chrome and Firefox. <!DOCTYPE html PUBLIC "-//W3C//DTD ...

Can the rel= attribute contain any string characters and still validate?

I'm wondering because I want to store something other than pre-defined keywords that are typically assigned to rel... and I just wanted to know if this is valid XHTML Strict or not. ...