- 1
createCanvas(); // create canvas!
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
Всего: 116
+123
createCanvas(); // create canvas!
Комментарии от Кэпа.
+119
/**
* crane looks like this: ("----" - fork, "ssss" - stand, "xxx" - crane rail)
*
* ----- .pos2 __/0/ ----- | sssss | sssss | xxx | ----- distance between stands .pos1 __|/distance/ ----- sssss
* sssss xxx xxx xxx xxx xxx xxx
*
* so if pos2 defined - it will be the second fork; BUT! if the flag "draw second stand" defined - that will draw or
* not draw the stand for pos1...
*
* if there is just one fork but two TUs to handle is possible:
*
* xxx ________ .pos1 .pos2 ________ sssss sssss xxx xxx xxx
*/
+127
pFirst = new LinePoints;
pFirst->ptPixel.x = ptOrig.x*szStart.cx/15 + ptStart.x;
pFirst->ptPixel.y = (15-ptOrig.y)*szStart.cy/15 + ptStart.y;
pFirst->next = NULL;
if(pFirst != NULL)
{
...
Ну а правда, вдруг NULL?
+132
// Asynchronously load the DXF.
// While we're doing that, the data can change, so we should guard against it.
new WebappResourceLoader().loadResource(ResourceType.DXF, sDxfName + ".dxf",
new ResourceCallback<List<String>>() {
@Override
public void onSuccess(final List<String> result) {
if (!sDxfName.equals(dxfToLoad)) {
// Too slow, dude.
return;
}
+70
if (sAttrName.equalsIgnoreCase("10")) {
+119
if(bCanPut)
{
m_RealTexts[nIndex].txtStartPt.x = ptStandard.x + (szStandard.cx-szTxtDC.cx)/2.0;
m_RealTexts[nIndex].txtStartPt.y = ptStandard.y + (szStandard.cy-szTxtDC.cy)/2.0;
m_RealTexts[nIndex].txtSize = szTxtDC;
m_RealTexts[nIndex].txtMovePt.x = 0.0 - (szStandard.cx-szTxtDC.cx)/2.0;
m_RealTexts[nIndex].txtMovePt.y = 0.0 - (szStandard.cy-szTxtDC.cy)/2.0;
}
else
{
m_RealTexts[nIndex].txtStartPt.x = ptStandard.x + (szStandard.cx-szTxtDC.cx)/2.0;
m_RealTexts[nIndex].txtStartPt.y = ptStandard.y + (szStandard.cy-szTxtDC.cy)/2.0;
m_RealTexts[nIndex].txtSize = szTxtDC;
m_RealTexts[nIndex].txtMovePt.x = 0.0 - (szStandard.cx-szTxtDC.cx)/2.0;
m_RealTexts[nIndex].txtMovePt.y = 0.0 - (szStandard.cy-szTxtDC.cy)/2.0;
}
+110
public abstract class AbstractSegment<P extends Number, V extends IOffsettable<P, V>,
U extends AbstractSegment<P, V, U>> implements IOffsettable<P, U>, Iterable<V>, Serializable {
...
protected final List<V> offsetHelper(final P dx, final P dy) {
return Lists.transform(points, new Function<V, V>() {
@Override
public V apply(final V input) {
return input.offset(dx, dy);
}
});
}
public final class FloatSegment extends AbstractSegment<Float, FloatPoint, FloatSegment> {
...
@Override
public FloatSegment offset(final Float dx, final Float dy) {
return new FloatSegment(offsetHelper(dx, dy));
}
}
+116
return Long.parseLong(content.substring(content.lastIndexOf('/' + 1)));
Пришлось поразмыслить, почему не работает.
+119
ApiException(final ResourceException cause, final Representation repr,
final Class<? extends ErrorResponse> responseClass) {
super(cause);
this.cause = cause;
ErrorResponse response = null;
try {
response = new ObjectMapper().readValue(repr.getText(), responseClass);
} catch (final Exception e) {
log.error("Error attempting to parse the error response", e);
} finally {
this.response = response;
}
}
Возникла ошибка при возникновении ошибки...
+110
<!--
BEGIN RIDICULOUSLY LONG BATIK SECTION
Do not touch. This is fragile stuff. Seriously.
Batik just *wants* to pull xalan and xml-apis, *everywhere*,
even though we do not want this. And Ivy isn't clever enough
to ignore the dependencies everywhere.
In an ideal world we would just explicitly depend on batik-swing
and batik-transcoder and be done with it. Instead we have to do
this atrocity. Apache, take a hint, would you kindly?
-->
<dependency org="org.apache.xmlgraphics" name="batik-xml" rev="[1.7,)">
<exclude org="xalan" module="xalan" />
</dependency>
<dependency org="org.apache.xmlgraphics" name="batik-ext" rev="[1.7,)">
<exclude org="xml-apis" module="xml-apis" />
</dependency>
<dependency org="org.apache.xmlgraphics" name="batik-css" rev="[1.7,)">
<exclude org="xml-apis" module="xml-apis" />
</dependency>
<dependency org="org.apache.xmlgraphics" name="batik-dom" rev="[1.7,)">
<exclude org="xml-apis" module="xml-apis" />
</dependency>
<dependency org="org.apache.xmlgraphics" name="batik-parser" rev="[1.7,)">
<exclude org="xml-apis" module="xml-apis" />
</dependency>
<dependency org="org.apache.xmlgraphics" name="batik-anim" rev="[1.7,)">
<exclude org="org.apache.xmlgraphics" module="batik-svg-dom" />
<exclude org="xml-apis" module="xml-apis" />
</dependency>
<dependency org="org.apache.xmlgraphics" name="batik-svg-dom" rev="[1.7,)">
<exclude org="xml-apis" module="xml-apis" />
</dependency>
<dependency org="org.apache.xmlgraphics" name="batik-bridge" rev="[1.7,)">
<exclude org="org.apache.xmlgraphics" module="batik-script" />
<exclude org="org.apache.xmlgraphics" module="batik-gvt" />
<exclude org="xml-apis" module="xml-apis" />
<exclude org="xalan" module="xalan" />
</dependency>
<dependency org="org.apache.xmlgraphics" name="batik-gvt" rev="[1.7,)">
<exclude org="org.apache.xmlgraphics" module="batik-script" />
<exclude org="xml-apis" module="xml-apis" />
<exclude org="xalan" module="xalan" />
</dependency>
<dependency org="org.apache.xmlgraphics" name="batik-gui-util" rev="[1.7,)">
<exclude org="xalan" module="xalan" />
</dependency>
<dependency org="org.apache.xmlgraphics" name="batik-script" rev="[1.7,)">
<exclude org="xalan" module="xalan" />
</dependency>
<dependency org="org.apache.xmlgraphics" name="batik-swing" rev="[1.7,)" />
<dependency org="org.apache.xmlgraphics" name="batik-transcoder" rev="[1.7,)" />
<!-- END BATIK SECTION -->
Из ivy.xml.