Mistři v programování na #hovnokod

Narazili jste na zprasený kód? Nahrajte ho sem.


Filozofický koutek: rovná se pravda pravdě? A je rovnost pravdy pravdě rovná pravdě?
if (msd.getFinalData().equals(Boolean.TRUE)) {

Anonymous,


PHP, jádro Magento
return (boolean) (int) $salable;

Anonymous,


Foooooooo .... Jak efektivně setstavit select s optgroupy ve twigu :D
					<select name='okres' id='okres' class="form-control">
						{% set foo = '' %}
						{% for okres in okresy %}
							{% if loop.index == 0 or foo != okres.kraj_nazev %}
								{% set foo = okres.kraj_nazev %}
								{% if loop.index != 0%}
									</optgroup>
								
								{% endif %}
								<optgroup label='{{ okres.kraj_nazev }}'>
							{% endif %}
							<option value='{{ okres.PK_iddok }}'>{{ okres.nazev }}</option>
						{% endfor %}
						</optgroup>
					</select>

Anonymous,


Treba ludom pomahat. :)
   - Unfortunately, Microsoft has added a clever new
   - "feature" to Internet Explorer. If the text of
   - an error's message is "too small", specifically
   - less than 512 bytes, Internet Explorer returns
   - its own error message. You can turn that off,
   - but it's pretty tricky to find switch called
   - "smart error messages". That means, of course,
   - that short error messages are censored by default.
   - IIS always returns error messages that are long
   - enough to make Internet Explorer happy. The
   - workaround is pretty simple: pad the error
   - message with a big comment like this to push it
   - over the five hundred and twelve bytes minimum.
   - Of course, that's exactly what you're reading
   - right now.

Henry Mickiewitz,


/**
 * Removes all namespace information as JAXB hates them.
 * 
 * @param source
 * @return
 */
private String removeNamespaces(String source) {
	return source;
}

/**
 * Removes all useless attributes which cause problems to marshaller
 * 
 * @param source
 * @return
 */
private String removeUnmarshallableAttributes(String source) {
	return source;
}

Anonymous,