- 1
- 2
- 3
- 4
- 5
- 6
var::var (double initial) {
(*this) = initial;
}
var::var (char *initial) {
(*this) = initial;
}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+144
var::var (double initial) {
(*this) = initial;
}
var::var (char *initial) {
(*this) = initial;
}
С воландесайта.http://habrahabr.ru/post/261351
+142
foreach($_REQUEST as $key => &$val) {
$val = htmlspecialchars(stripslashes(trim($val)));
}
$officeId = intval($_REQUEST["office-id"]);
$date = $_REQUEST["date"];
// [...]
Эпик вин, однозначно
+145
#define pb push_back
#define ll long long#define forit(it, r) for (auto it = r.begin(); it != r.end(); it++)
#define forn(i, n) for (int i = 0; i < n; ++i)
#define forn1(i, n) for (int i = 1; i < n; ++i)
#define FOR(i, m, n) for (int i = m; i < n; ++i)
#define ROF(i, m, n) for (int i = m; i >= n; --i)
#define fori(n) for (int i = 0; i < n; ++i)
#define forj(n) for (int j = 0; j < n; ++j)
// ...
string s;
int k;
while (i >= base)
k = i % base,
s.pb(k > 9 ? k + 'A' - 10 : k + 48),
i /= base;
k = i % base;
s.pb(k > 9 ? k + 'A' - 10 : k + 48);
// ...
fori(s.size())
if (i < s.size() - 1 && s[i] == '\\' && (s[i + 1] == 'n' || s[i + 1] == -47))
{
ret.append("%0A");
i += 1 + (s[i + 1] == -47);//-47 -- russian t, because has the same place with n (\n == \t_russian)
}
else
ret.append("%" + itoa((s[i] + 256) % 256, 16));
Олимпиадники... Олимпиадники повсюду...
+145
protected virtual void OnDisconnected()
{
DispatcherHelper.CheckBeginInvokeOnUI(() =>
{
...
Cameras.ToList().Clear();
Meltings.ToList().Clear();
Spans.ToList().Clear();
...
});
}
Очищаем коллекции с данными, привязанные на списковые контролы UI. Доступ к свойствам Cameras, Meltings, Spans только через IEnumerable<>. Как же их очистить?
+144
public String tommorowCalendarCountry(String date, String country){
String tommorowCountry = null;
if(date.equals(getTommorow())){
tommorowCountry = country;
}
return tommorowCountry;
}
public String tommorowCalendarIndicator(String date, String indicator){
String tommorowIndicator = null;
if(date.equals(getTommorow())){
tommorowIndicator = indicator;
}
return tommorowIndicator;
}
public String tommorowCalendarImportance(String date, String importance){
String tommorowImportance = null;
if(date.equals(getTommorow())){
tommorowImportance = importance;
}
return tommorowImportance;
}
public String tommorowCalendarForecast(String date, String forecast){
String tommorowForecast = null;
if(date.equals(getTommorow())){
tommorowForecast = forecast;
}
return tommorowForecast;
}
public String tommorowCalendarPrevious(String date, String previous){
String tommorowPrevious = null;
if(date.equals(getTommorow())){
tommorowPrevious = previous;
}
return tommorowPrevious;
}
public String tommorowCalendarActual(String date, String actual){
String tommorowActual = null;
if(date.equals(getTommorow())){
tommorowActual = actual;
}
return tommorowActual;
}
public String tommorowCalendarDescription(String date, String description){
String tommorowDescription = null;
if(date.equals(getTommorow())){
tommorowDescription = description;
}
return tommorowDescription;
}
public String tommorowCalendarPeriod(String date, String period){
String tommorowPeriod = null;
if(date.equals(getTommorow())){
tommorowPeriod = period;
}
return tommorowPeriod;
}
public String tommorowCalendarLocation(String date, String location){
String tommorowLocation = null;
if(date.equals(getTommorow())){
tommorowLocation = location;
}
return tommorowLocation;
}
пришло с аутсорса. Такого в проекте очень много)
+143
int i = 132,
*ii = &i,
**iii = &ii,
***iiii = &iii,
****iiiii = &iiii,
*****iiiiii = &iiiii,
******iiiiiii = &iiiiii;
printf("%d", ******iiiiiii);
Забавно
−390
openUTButton.frame = CGRectMake(SCREEN_WIDTH - (IS_IPAD ? 225. : 120.) - (IS_IPAD ? 40. : 20),
IS_IPAD ? 40. : 20.,
IS_IPAD ? 225 : 120.,
IS_IPAD ? 60. : 35.);
И так для каждого элемента интерфейса и каждый раз при смене ориентации - просто тернарный фетишизм.
−129
except Exception:
raise
+142
<?php
$file1 = 'D:\file.txt';
$fo1 = fopen($file1,"r");
$array = array(1=>'б',2=>'в',3=>'г',4=>'д',5=>'ж',6=>'з',7=>'й',8=>'к',9=>'л',10=>'м',11=>'н',12=>'п',
13=>'р',14=>'с',15=>'т',16=>'ф',17=>'х',18=>'ц',19=>'ч',20=>'ш',21=>'щ');
$shetchik = 0;
$t=0;
while (!feof($fo1))
{
$line2 = fgets($fo1);
$line = strtolower($line2);
for ($j=0;$j<strlen($line);$j++)
{
$char = $line[$j];
if(in_array($line[$j],$array))
{
$index = array_keys($array,$line[$j]);
$int = $index[0];
if ($int-$t>=1)
{
$shetchik++;
$t = $int;
}
else
{
$t=0;
$shetchic=0;
}
if ($shetchik==4) echo "$line2<br>";
}
}
}
?>
шедевр
+145
if (count($stores) == 1) {
foreach ($stores as $store) {
$storeId = $store->id;
}
}