-
+134
- 1
- 2
- 3
- 4
//#if UNITY_IPHONE && !(UNITY_3_0 || UNITY_3_1 || UNITY_3_2 || UNITY_3_3 || UNITY_3_4 || UNITY_3_5 || UNITY_3_6 || UNITY_3_7 || UNITY_3_8 || UNITY_3_9 || UNITY_4_0 || UNITY_4_1 || UNITY_4_2 || UNITY_4_3 || UNITY_4_4 || UNITY_4_5 || UNITY_4_6 || UNITY_4_7 || UNITY_4_8 || UNITY_4_9)
if (Selection.activeGameObject != null)
control = (IControl)Selection.activeGameObject.GetComponent("IControl");
//#endif
принял код от юнити юниора
sladkijBubaleh,
23 Октября 2014
-
+153
- 1
document.body.innerHTML = document.body.innerHTML.replace(/guest/g, '');<
DesmondHume,
23 Октября 2014
-
+135
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
bool result = false;
if (xmlString != null)
{
result = reportService.SaveQ360Report(questionnaireId, xmlString, publishReport);
UpdateCurrentReportModel(questionnaireId, reportService);
}
// string errorMessage;
if (result == false)
result = true; //because model is not changed
return Json(new { Success = result, ErrorMessage = DisplayLabels.InvalidModelError });
sharpman,
23 Октября 2014
-
+53
- 1
- 2
- 3
- 4
- 5
- 6
- 7
/* set _god=true temporarily, safely */
class GodScope {
bool _prev;
public:
GodScope();
~GodScope();
};
mongo/db/client.h
Почувствуй простор божий
roman-kashitsyn,
23 Октября 2014
-
+121
- 1
- 2
- 3
- 4
- 5
if (Ints.contains(new int[] { 4, 5 }, statusCode / 100)) {
// error response
} else {
// success response
}
Насколько я знаю, Apache HTTP Client не содержит "официального" метода для определения категории кода состояния. Приходится так.
someone,
23 Октября 2014
-
+156
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
if (varform)
{
switch (response.variants.length % 10)
{
case 1:
varform=1;
break;
case 2:
case 3:
case 4:
varform=2;
break;
case 0:
case 5:
case 6:
case 7:
case 8:
case 9:
varform=3;
break;
}
}
if (response.variants.length>=11 && response.variants.length<=14)
varform=3;
switch (varform)
{
case 0:
caption.innerHTML="<b>Адрес распознан удачно</b>";
break;
case 1:
caption.innerHTML="<b>Плохой адрес. Найден " + response.variants.length.toString()+" вариант</b>";
break;
case 2:
caption.innerHTML="<b>Плохой адрес. Найдено " + response.variants.length.toString()+" варианта</b>";
break;
case 3:
caption.innerHTML="<b>Плохой адрес. Найдено " + response.variants.length.toString()+" вариантов</b>";
break;
}
Постыдство с сайта http://strela-ru.ucoz.ru/pa_query.html
grobotron,
23 Октября 2014
-
+117
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
@Override
public void afterPersistenceInit() {
val conn = emProvider.get().unwrap(Connection.class);
try {
log.info("Transaction isolation level: {}", getLevelString(conn.getTransactionIsolation()));
} catch (final SQLException e) {
log.error("Error getting transaction isolation level", e);
}
}
private String getLevelString(final int isolationLevel) {
// Poor man's enums. Use reflection to find a constant with the given value
try {
for (val maybeLevelConstant: Connection.class.getDeclaredFields()) {
if (maybeLevelConstant.getType() == int.class && maybeLevelConstant.getName().startsWith("TRANSACTION_")
&& maybeLevelConstant.getInt(null) == isolationLevel) {
return maybeLevelConstant.getName();
}
}
} catch (final IllegalArgumentException | IllegalAccessException e) {
return "UNKNOWN";
}
return "UNKNOWN";
}
Ищем рефлексией константу с нужным значением. И всё для того, чтобы напечатать её в логе. Вот что крест животворящий отсутствие энумов в legacy API делает.
someone,
23 Октября 2014
-
+159
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
<script>
$(function() {
$('#current').load('current.php');
}
</script>
// Тем временем в current.php :
<?
$result = ... ; // данные как-то вытаскиваются из базы
ob_start();?>
<table><?
foreach($result as $res) {?>
<tr><td><?=$res[0]?></td><td><?=$res[1]?></td><td><?=$res[2]?></td></tr>
<?}?>
</table>
<?$table = ob_get_clean();?>
<script>
$('#current').empty();
$('#current').append('<?=str_replace(array("\r","\n"),"",$table)?>');
</script>
Извиняюсь за возможные опечатки: сократил, чтобы оставить только самую мякотку.
clauclauclau,
23 Октября 2014
-
+170
- 1
- 2
$time_now=date('d');
$tomorrow =date('d')+'1';
Кого-то ожидает 32 декабря.
alxkolm,
23 Октября 2014
-
+159
- 1
- 2
- 3
- 4
- 5
- 6
foreach (array(167, 163) as $low_rise_apartment_id)
{
$arParams["SEARCH_DATA"]["articletype"][] = $low_rise_apartment_id;
}
$arParams["SEARCH_DATA"]["articletype"] = array_unique($arParams["SEARCH_DATA"]["articletype"]);
solnatus,
22 Октября 2014