- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
public static bool MegaDispose(this IDisposable thіs)
{
if (thіs != null)
{
thіs.Dispose();
return true;
}
return false;
}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+976
public static bool MegaDispose(this IDisposable thіs)
{
if (thіs != null)
{
thіs.Dispose();
return true;
}
return false;
}
+976
public void OpredelenieKletki(TipiReljefaMiraVelikogo tipKletkiEtt)
{
tipKletki = tipKletkiEtt;
#region огромное назначение координат ректанглам вырезания из разнобоя
if (kameraEtojKletki.sasUvelicenie)
{
switch (tipKletki)
{
case TipiReljefaMiraVelikogo.zelenaRovnaAA:
malOcered = 1; kadrSasVirezanija = new Rectangle(0, kameraEtojKletki.sasKudaSmotrit * 79, 162, 79);
smewenieSasKadra = new Vector2(18f, 98f); animacijaLi = false; nomRaznoboja = 19; break;
case TipiReljefaMiraVelikogo.zelenaRovnaBB:
malOcered = 1; kadrSasVirezanija = new Rectangle(0, 316 + kameraEtojKletki.sasKudaSmotrit * 79, 162, 79);
smewenieSasKadra = new Vector2(18f, 98f); animacijaLi = false; nomRaznoboja = 19; break;
case TipiReljefaMiraVelikogo.zelenaRovnaCC:
malOcered = 1; kadrSasVirezanija = new Rectangle(0, 632 + kameraEtojKletki.sasKudaSmotrit * 79, 162, 79);
smewenieSasKadra = new Vector2(18f, 98f); animacijaLi = false; nomRaznoboja = 19; break;
case TipiReljefaMiraVelikogo.zelenaRovnaDD:
malOcered = 1; kadrSasVirezanija = new Rectangle(0, 948 + kameraEtojKletki.sasKudaSmotrit * 79, 162, 79);
smewenieSasKadra = new Vector2(18f, 98f); animacijaLi = false; nomRaznoboja = 19; break;
case TipiReljefaMiraVelikogo.zelenaRovnaVertPalkaAA:
malOcered = 1; kadrSasVirezanija = new Rectangle(0, 1264 + kameraEtojKletki.sasKudaSmotrit * 79, 162, 79);
smewenieSasKadra = new Vector2(18f, 98f); animacijaLi = false; nomRaznoboja = 19; break;
case TipiReljefaMiraVelikogo.zelenaRovnaVertPalkaAb:
malOcered = 1; kadrSasVirezanija = new Rectangle(0, 1580 + kameraEtojKletki.sasKudaSmotrit * 79, 162, 79);
smewenieSasKadra = new Vector2(18f, 98f); animacijaLi = false; nomRaznoboja = 19; break;
case TipiReljefaMiraVelikogo.zelenaRovnaVertPalkaBB:
malOcered = 1; kadrSasVirezanija = new Rectangle(162, 1264 + kameraEtojKletki.sasKudaSmotrit * 79, 162, 79);
smewenieSasKadra = new Vector2(18f, 98f); animacijaLi = false; nomRaznoboja = 19; break;
case TipiReljefaMiraVelikogo.zelenaRovnaVertPalkaBc:
malOcered = 1; kadrSasVirezanija = new Rectangle(162, 1580 + kameraEtojKletki.sasKudaSmotrit * 79, 162, 79);
smewenieSasKadra = new Vector2(18f, 98f); animacijaLi = false; nomRaznoboja = 19; break;
... ... ...
Класс который достает из спрайтшита нужную текстуру и передает её на отрисовку.
+975
switch (Game1.mus)
{
case false: sb.Draw(disabled, new Vector2(ScrW - 256, 90), Color.White); break;
case true: sb.Draw(enabled, new Vector2(ScrW - 256, 90), Color.White); break;
}
switch (Game1.bloooom)
{
case false: sb.Draw(disabled, new Vector2(ScrW - 256, 180), Color.White); break;
case true: sb.Draw(enabled, new Vector2(ScrW - 256, 180), Color.White); break;
}
switch (Game1.part)
{
case false: sb.Draw(disabled, new Vector2(ScrW - 256, 270), Color.White); break; //420
case true: sb.Draw(enabled, new Vector2(ScrW - 256, 270), Color.White); break;
}
switch (Game1.eff)
{
case false: sb.Draw(disabled, new Vector2(ScrW - 256, 360), Color.White); break; //510
case true: sb.Draw(enabled, new Vector2(ScrW - 256, 360), Color.White); break;
}
switch (Game1.shad)
{
case false: sb.Draw(disabled, new Vector2(ScrW - 256, 450), Color.White); break;
case true: sb.Draw(enabled, new Vector2(ScrW - 256, 450), Color.White); break;
}
Оттуда же, откуда и #5199. Случайно обнаружил...
+974
/*Вариант - вручную*/
#include <iostream>
#include <map>
#include <string>
#include <utility>
int main(int argc, char* argv[]) {
std::map<std::string, std::pair<int, int> > files;
files["0.txt"] = std::make_pair(0, 7);
files["1.txt"] = std::make_pair(8, 41);
files["2.txt"] = std::make_pair(42, 50);
std::map<std::string, std::pair<int, int> >::const_iterator begin = files.begin();
std::map<std::string, std::pair<int, int> >::const_iterator end = files.end();
int num = 21;
for (; begin != end; ++begin) {
if (num >= (*begin).second.first && num <= (*begin).second.second) {
std::cout << "Found in " + (*begin).first + "\n";
break;
}
}
return 0;
}
/*Вариант - STL+BOOST*/
#include <algorithm>
#include <functional>
#include <iostream>
#include <map>
#include <string>
#include <utility>
#include <boost/bind.hpp>
int main(int argc, char* argv[]) {
typedef std::map<std::string, std::pair<int, int> > map_type;
map_type files;
files["0.txt"] = std::make_pair(0, 7);
files["1.txt"] = std::make_pair(8, 41);
files["2.txt"] = std::make_pair(42, 50);
int num = 21;
map_type::const_iterator elem;
elem = std::find_if(
files.begin(),
files.end(),
boost::bind(
std::logical_and<bool>(),
boost::bind(
std::less_equal<int>(),
boost::bind(
&map_type::value_type::second_type::first,
boost::bind(
&map_type::value_type::second,
_1)
),
num),
boost::bind(
std::greater_equal<int>(),
boost::bind(
&map_type::value_type::second_type::second,
boost::bind(
&map_type::value_type::second,
_1)
),
num)));
if (elem != files.end())
std::cout << "Found in " + (*elem).first + "\n";
return 0;
}
Смысл в том, чтобы с данным значением(пример 21) пройтись по таблице и найти в каком элементе данное число(21) находится в диапазоне std::pair<int, int>...
Сначала написал вручную, но т.к. нужно было сделать с помощью STL, получилось сие чудо.
+973
/* */
int fooBar() {
/* do something */
/* - */ return NULL;
/* + */ return 0ULL;
}
> src/foobar.c:42:3: warning: return makes integer from pointer without a cast
> return NULL;
П О Ч И Н Е Н О
#17766
+973
Bool IsNumber (string str) {
return (str.Replace ("0", "").Replace ("1", "").Replace ("2", "").Replace ("3", "").Replace ("4", "").Replace ("5", "").Replace ("6", "").Replace ("7", "").Replace ("8", "").Replace ("9", "").Length == 0);
}
http://bash.org.ru/quote/396194
+972
private static void Main(string[] args)
{
Label_0000:
Console.ForegroundColor = ConsoleColor.Green;
Console.Title = "Inside Attack By XCrackers, Flood And Crash System!!";
Console.Write("*******************************************************************************\nINSIDE ATTACK , CHECK SYSTEM , FLOOD FIREWALL AND SERVER , CRASH THE SYSTEM\nINSIDE ATTACK , CHECK SYSTEM , FLOOD FIREWALL AND SERVER , CRASH THE SYSTEM\nINSIDE ATTACK , CHECK SYSTEM , FLOOD FIREWALL AND SERVER , CRASH THE SYSTEM\n\n\nBY XCR, AND SYSTEMCHECH GLOBALS\nBY XCR, AND SYSTEMCHECH GLOBALS\nBY XCR, AND SYSTEMCHECH GLOBALS\n\n\nFOR CONTACT:\n\nSKYPE: roeeko10\n\nMSN: [email protected]\n\nSimple, Just Add Me For New UPDATE....\n*******************************************************************************\n\n");
Console.Write("\n1) Inside.Attack, Flooding\n2) Exit\n\n");
Console.Write("Your Choise : ");
switch (int.Parse(Console.ReadLine()))
{
case 1:
{
Console.Write("\nEnter IP Address : ");
string ipString = Console.ReadLine();
Console.Write("\nPort : ");
int port = int.Parse(Console.ReadLine());
Console.Write("\nProtocol Tcp/Udp : ");
Console.ReadLine();
Console.Write("\nHow Much Request ? : ");
int num3 = int.Parse(Console.ReadLine());
byte[] bytes = Encoding.ASCII.GetBytes("abcdefghlkmnopzrstws!!$@$545$%2d21df3s");
try
{
for (int i = 0; i < num3; i++)
{
sck = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
IPEndPoint remoteEP = new IPEndPoint(IPAddress.Parse(ipString), port);
sck.SendTimeout = 1;
sck.Connect(remoteEP);
sck.SendTo(bytes, remoteEP);
Console.WriteLine("[*]Inside.Attack, Syn Request : {0} Data Bytes : 1956 BYTE Every 0.3 Sec ", i);
}
}
catch
{
Console.WriteLine("Cannot Connected To The Host ......");
Console.ReadLine();
}
Console.WriteLine("[+]Inside Attack Sucsess.!! All The Syn Request And The Data Byte Was Sent !! <ANT KEY FOR CONTINUE>");
Console.ReadKey();
goto Label_0000;
}
case 2:
return;
}
Console.Clear();
Console.WriteLine("Incorrect Choose!! . Please Choose 1/2.\n\n");
goto Label_0000;
}
Код 13-и летнего кулхацкера. "Это ДДОС посоны".
+972
str3 = "Insert Into orderList(OrderNo,Date,StoreName,TagCode,Size,Colour,TwoSidedEngraving,
EngravingOptions,PetsName,PetsNameTwoSide,Phone1,Phone1TwoSide,Phone2,Phone2TwoSide,
Phone3,Phone3TwoSide,OwnersFirstName,OwnersLastName,StreetAddress,Suburb,State,ZipCode,
Country,MStreetAddress,MSuburb,MState,MZipCode,MCountry,OwnersFirstNameTwoSide,
OwnersLastNameTwoSide,StreetAddressTwoSide,SuburbTwoSide,StateTwoSide,ZipCodeTwoSide,
flag,Other9,idcust,Receiver,demo,databasename,isonline,faxfile) values(N'" + this.Request.Form["Orderno"] +
"',Getdate(),N'" + Strings.Replace(this.Request.Form["storename"],"'", "''", 1, -1, CompareMethod.Binary) +
"',N'" + str + "',N'" + this.Request.Form["tagSize"] + "',N'" + this.Request.Form["tagcolor"] + "',N'" +
this.Request.Form["TwoSide"] + "',N'" + str2 + "',N'" +
Strings.Replace(Strings.Replace(this.Convert(this.Request.Form["PetsName"]), "'", "''", 1, -1,
CompareMethod.Binary), "\"", "\"", 1, -1, CompareMethod.Binary) + "',N'" +
this.Request.Form["chbPetsName"] + "',N'" +
Strings.Replace(Strings.Replace(Strings.UCase(this.Convert(this.Request.Form["Phone1"])), "'", "''",
1, -1, CompareMethod.Binary), "\"", "\"", 1, -1, CompareMethod.Binary) + "',N'" +
this.Request.Form["chbPhone1"] + "',N'" +
Strings.Replace(Strings.Replace(Strings.UCase(this.Convert(this.Request.Form["Phone2"])),
"'", "''", 1, -1, CompareMethod.Binary),
"\"", "\"", 1, -1, CompareMethod.Binary) + "',N'" + this.Request.Form["chbPhone2"] + "',N'" +
Strings.Replace(Strings.Replace(Strings.UCase(this.Convert(this.Request.Form["Phone3"])),
"'", "''", 1, -1, CompareMethod.Binary),
"\"", "\"", 1, -1, CompareMethod.Binary) + "',N'" + this.Request.Form["chbPhone3"] + "',N'" +
Strings.Replace(Strings.Replace(Strings.UCase(this.Convert(this.Request.Form["FirstName"])),
"'", "''", 1, -1, CompareMethod.Binary),
"\"", "\"", 1, -1, CompareMethod.Binary) + "',N'" +
Strings.Replace(Strings.Replace(Strings.UCase(this.Convert(this.Request.Form["LastName"])),
"'", "''", 1, -1, CompareMethod.Binary),
<ну и так далее...>
this.Response.Write(function.ExecuteSql(str3));
+971.8
oi.Status = o.Active && o.ByCondition!=Condition.None && o.Time==DateTime.MinValue
? OrderStatusType.Condition :
o.Active
? OrderStatusType.Active
: o.Cancelled
? OrderStatusType.Cancelled
: o.Matched ? OrderStatusType.Matched : OrderStatusType.Unknown;
Суровый такой, очень суровый код. Спартанец-неформал.
+971.6
string[] dateStringParts = dateString.Split(new [] {DateTimeFormatInfo.CurrentInfo.DateSeparator}, StringSplitOptions.RemoveEmptyEntries);
if (dateStringParts.Count() != 3)
{
dateStringParts = DateTime.Now.ToString("dd MMMM yyyy").Split(' ');
}
string day = dateStringParts[0];
string month = dateStringParts[1];
string year = dateStringParts[2];
string shortYear = dateStringParts[2].Substring(dateStringParts[2].Length - 2, 2);
Учитесь парсить дато! :)