- 1
- 2
- 3
- 4
- 5
- 6
//Текстовый реквизит
//Событие реквизита формы НП_ТелефонПолучателя (Строка (50)) - очистка
Процедура НП_ТелефонПолучателяОчистка(Элемент, СтандартнаяОбработка)
НП_ТелефонПолучателя = "";
КонецПроцедуры
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+1
//Текстовый реквизит
//Событие реквизита формы НП_ТелефонПолучателя (Строка (50)) - очистка
Процедура НП_ТелефонПолучателяОчистка(Элемент, СтандартнаяОбработка)
НП_ТелефонПолучателя = "";
КонецПроцедуры
Ну чтоб уж точно очистить
+2
Запрос = Новый Запрос;
Запрос.Текст="ВЫБРАТЬ
| ЗаказНаряд.Ссылка КАК Ссылка
|ИЗ
| Документ.ЗаказНаряд КАК ЗаказНаряд
|ГДЕ
| ЗаказНаряд.Проведен = ИСТИНА";
Выборка=Запрос.Выполнить().Выбрать();
Выборка.Следующий();
Если обЗначениеНеЗаполнено(Выборка.Ссылка) Тогда
.......
Чуть упростил запрос для быстроты понимания...
Как проверить запрос ПУСТОЙ() или нет... Вот один из разработчиков нашел метод.....
0
// enum_helper_pre.h
#ifndef delimiter
#define delimiter ,
#endif
#ifndef enumeration_begin
#define enumeration_begin(arg) enum arg {
#endif
#ifndef enumeration_end
#ifdef last_enumerator
#define enumeration_end delimiter last_enumerator }
#else
#define enumeration_end }
#endif
#endif
#ifndef declare_member
#define declare_member(arg) arg
#endif
#ifndef member_value
#define member_value(arg) = arg
#endif
// enum_helper_post.h
#undef delimiter
#undef enumeration_begin
#undef enumeration_end
#undef last_enumerator
#undef declare_member
#undef member_value
// color.h
#include "enum_helper_pre.h"
enumeration_begin(color)
declare_member(RED) member_value(-2) delimiter
declare_member(GREEN) delimiter
declare_member(BLUE) member_value(5) delimiter
declare_member(BRIGHTNESS)
enumeration_end;
#include "enum_helper_post.h"
// main.cpp
#include <iostream>
#include <string>
#include <boost/bimap.hpp>
#include <boost/preprocessor/stringize.hpp>
#include "color.h"
int main(int argc,char* argv[])
{
typedef boost::bimap<color,std::string> map_type;
map_type color_map;
#define declare_member(arg) color_map.insert( map_type::value_type(arg,BOOST_PP_STRINGIZE(arg)) )
#define delimiter ;
#define enumeration_begin(arg)
#define enumeration_end
#define member_value(arg)
#include "color.h"
std::cout<<color_map.left.at(RED)<<std::endl;
std::cout<<color_map.left.at(BLUE)<<std::endl;
std::cout<<color_map.right.at("GREEN")<<std::endl;
std::cout<<color_map.right.at("BRIGHTNESS")<<std::endl;
return 0;
}
// Output
RED
BLUE
-1
6
Нарыл эту хуйню на http://www.quizful.net/post/enum-types-c
0
switch ($city) {
case $city == 'Москва':
$tel['work'] = '+7 (495) www-ww-22';
$tel['entire'] = '8 (800) xxx-xx-49';
break;
case $city == 'Нижний-Новгород':
$tel['work'] = '+7 (495) zzz-zz-02';
$tel['entire'] = '8 (800) zzz-zz-02';
break;
case $city == 'Ростов-на-Дону':
$tel['work'] = '+7 (495) zzz-zz-03';
$tel['entire'] = '8 (800) zzz-zz-03';
break;
case $city == 'Казань':
$tel['work'] = '+7 (495) zzz-zz-04';
$tel['entire'] = '8 (800) zzz-zz-04';
break;
case $city == 'Тюмень':
$tel['work'] = '+7 (495) zzz-zz-05';
$tel['entire'] = '8 (800) zzz-zz-05';
break;
Мало того, что странное использование case, так это ещё повторяется для 28 городов.
Одинаковые части номеров заменил на zzz-zz
0
#include <stdio.h>
int main() {
double x = 0.11111;
printf("%lld\n", x);
double y = 0.11111;
printf("%lld\n", y);
}
https://ideone.com/FHKfA6
УБЭ?
0
-(id)copyWithZone:(NSZone *)zone
{
NSString* str = [self toJSONString];
return [[MyBeautifulClass alloc] initWithJSON:str :NO];
}
0
char bytes[] = {1, 2, 3, 4, 5, 6, 7, 8, 9};
function1(bytes);
(void)(bytes[0] = 10), (void)(bytes[1] = 11), (void)(bytes[2] = 12); //WTF?
function2(bytes);
Вот такую байду требует написать XCode при присвоении элементов массива через запятую, иначе warning.
Гейкорп и их главпидор Кук совсем охренели, мало того что последие хуйкоды крашатся и виснут по фазам луны, мало того что встроенный гуй систем контроля версий работает как говно, так оно еще и ворининги выдает на ровном месте - качество apple - blyad.
+1
public static synchronized Tracker getDefaultTracker() {
Tracker tracker;
synchronized (MainApp.class) {
if (googleAnalTracker == null) {
analytics = GoogleAnalytics.getInstance(app());
GoogleAnalytics googleAnalytics = analytics;
int i = (DEBUG || STAGE) ? R.xml.app_tracker_debug : R.xml.app_tracker;
googleAnalTracker = googleAnalytics.newTracker(i);
googleAnalTracker.enableAutoActivityTracking(false);
}
tracker = googleAnalTracker;
}
return tracker;
}
Тайна гугла раскрыта
+1
решение:
class Twofer {
String twofer(String name) {
if (name.equalsIgnoreCase("Alice")){
return "One for Alice, one for me.";
} else if (name.equalsIgnoreCase("Bob")) {
return "One for Bob, one for me.";
} else {
return "One for you, one for me.";
}
}
}
чтобы эти тесты проходили
задачка:
# Two Fer
`Two-fer` or `2-fer` is short for two for one. One for you and one for me.
```text
"One for X, one for me."
```
When X is a name or "you".
If the given name is "Alice", the result should be "One for Alice, one for me."
If no name is given, the result should be "One for you, one for me."
чувак решил не заморачиваться...
0
#include <stdio.h>
#include <string.h>
#include <math.h>
char *questions[] = {
"Answer these questions please.",
"I am HACTEHbKA. Do you know about me?",
"Do you like my love stories?",
"By the way, what is your name?",
"Do you like C++?",
"Do you like bormand?",
"bormand is cool, isn't he?",
"Do you know what does it mean?",
0,
};
int main () {
char answer[10], **question = questions, z[30] = {0}, Z = questions[0x04][0x10];
while (*++question) {
float x = 1, y = 7;
char* a = answer;
puts(*question);
gets(answer);
while (*a) {
x *= 10;
x += *a / 90;
a ++;
}
y = (9/x - 120)/x/x/x;
if (y > 170/x - 1263 - 437/x/x) {
int U = **questions;
for (U = 1/(x+1); U < ' '; U += 0x10) {
float bormand = 9*y-6*x*sqrt(y)-6*sqrt(y)+1.0*x*x*x*x-5.2*x*x*x+11.14*x*x-6.788*x+6;
z[Z|U] = questions[5-U/5+1/(int)bormand][(int)(Z + questions[0x06][0x10] / 2.6)];
if ((Z|U|7) * (int)question[1] < 30) puts(z + U);
}
Z++;
}
}
return answer == questions[1];
}
https://ideone.com/zDcuG2