- 1
- 2
//str will destroy
char* strdup_(char* str){
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
Всего: 223
+133
//str will destroy
char* strdup_(char* str){
wat?
+131
if (SceneTextureIndex == 0) return float4(CalcSceneColor(UV), 0);
else if (SceneTextureIndex == 1) return ScreenSpaceData.GBuffer.Depth;
else if (SceneTextureIndex == 2) return float4(ScreenSpaceData.GBuffer.DiffuseColor, 0);
else if (SceneTextureIndex == 3) return float4(ScreenSpaceData.GBuffer.SpecularColor, 0);
else if (SceneTextureIndex == 4) return float4(ScreenSpaceData.GBuffer.SubsurfaceColor, 0);
else if (SceneTextureIndex == 5) return float4(ScreenSpaceData.GBuffer.BaseColor, 0);
else if (SceneTextureIndex == 6) return ScreenSpaceData.GBuffer.Specular;
else if (SceneTextureIndex == 7) return ScreenSpaceData.GBuffer.Metallic;
else if (SceneTextureIndex == 8) return float4(ScreenSpaceData.GBuffer.WorldNormal, 0);
else if (SceneTextureIndex == 9) return 1; // todo
else if (SceneTextureIndex == 10) return ScreenSpaceData.GBuffer.Opacity;
else if (SceneTextureIndex == 11) return ScreenSpaceData.GBuffer.Roughness;
else if (SceneTextureIndex == 12) return ScreenSpaceData.GBuffer.GBufferAO;
else if (SceneTextureIndex == 13) return ScreenSpaceData.GBuffer.CustomDepth;
else if (SceneTextureIndex == 14) return Texture2DSample(PostprocessInput0, PostprocessInput0Sampler, UV);
else if (SceneTextureIndex == 15) return Texture2DSample(PostprocessInput1, PostprocessInput1Sampler, UV);
else if (SceneTextureIndex == 16) return Texture2DSample(PostprocessInput2, PostprocessInput2Sampler, UV);
else if (SceneTextureIndex == 17) return Texture2DSample(PostprocessInput3, PostprocessInput3Sampler, UV);
else if (SceneTextureIndex == 18) return Texture2DSample(PostprocessInput4, PostprocessInput4Sampler, UV);
else if (SceneTextureIndex == 19) return Texture2DSample(PostprocessInput5, PostprocessInput5Sampler, UV);
else if (SceneTextureIndex == 20) return Texture2DSample(PostprocessInput6, PostprocessInput6Sampler, UV);
else if (SceneTextureIndex == 21) return ScreenSpaceData.GBuffer.DecalMask;
else if (SceneTextureIndex == 22) return float4(GetLightingModelColor(ScreenSpaceData.GBuffer), 1);
else if (SceneTextureIndex == 23) return ScreenSpaceData.AmbientOcclusion;
+89
(1 until n) flatMap (i => (1 until i) filter (j => isPrime(i+j)) map (j => (i, j)))
Скала говна.
+8
if(!(a - b))
+8
# ifndef BOOST_NO_PARTIAL_SPECIALIZATION
, check<Model>
# else
, check<failed ************ Model::************>
# endif
+17
~Guard(){
if(std::uncaught_exception())
try{
}catch(...){
error_output<<"prevented exception!!!"<<endl;
};
}
−95
Ждем нового раздела под язык Swift. Ожидается наплыв.
https://developer.apple.com/swift/
http://habrastorage.org/getpro/habr/comment_images/f80/9bd/f07/f809bdf079e06818109355db44e9430b.png
http://habrastorage.org/getpro/habr/comment_images/45a/feb/cfe/45afebcfe01065e7bdb2b618ea045f18.png
http://habrastorage.org/getpro/habr/comment_images/32e/c47/ae5/32ec47ae5be2bb4f540e318764c8f2ab.png
http://habrastorage.org/getpro/habr/comment_images/d21/480/e59/d21480e59827fc1c6b93150c91fdcf90.png
http://habrastorage.org/getpro/habr/comment_images/b30/513/b4f/b30513b4f3345b51b18565a235b6ab6a.png
+5
#include <iostream>
using namespace std;
struct ko{
int r;
} f;
const ko& taras=f;
int main() {
cout<<
is_same<decltype(taras.r), int>::value
<<" "<<
is_same<decltype((taras.r)), const int &>::value
<<endl;
return 0;
}
What is output you expect? You should answer without looking at ideone link and without using compiler.
http://ideone.com/5O9vtZ
+6
const int cx = 5;
int main() {
auto lam = [cx]() mutable {cx=40;};
return 0;
}
Will it compile or not? Why?
http://ideone.com/gtlXKb
+129
mixin(iota(3).map!(i => format("v[%1$d]+=rhs.v[%1$d];", i)).join());