- 1
- 2
- 3
1С::Функторы::АппликативныйФунктор::Монад 1С::Монада::НаЭкран -> 1С::Монада::Символ,1С::Монада::СимволСлед
| Пустота = Отчёт.Откат()
| 1С::Буква = 1С::МонадаМир::ВводВывод::Печать 1С::Буква
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
−119
1С::Функторы::АппликативныйФунктор::Монад 1С::Монада::НаЭкран -> 1С::Монада::Символ,1С::Монада::СимволСлед
| Пустота = Отчёт.Откат()
| 1С::Буква = 1С::МонадаМир::ВводВывод::Печать 1С::Буква
Многие интересуются, существует ли в 1С метод вывода монады на экран? Оказывается, существует!
Данный аппликативный функтор не требует теор.ката, хотя и не без улыбки, выводит квантовое состояние функциональной монады в виде стрелок и морфизмов.
PS Автор не я, а мой коллега, который, ковыряясь в 1С, обнаружил в нём "Функциональный режим"
+139
<div class="slogan">
<table>
<tbody>
<tr>
<td>В</td>
<td class="r"> </td>
<td>с</td>
<td class="r"> </td>
<td>ё</td>
<td> </td>
<td class="r"> </td>
<td>ч</td>
<td class="r"> </td>
<td>т</td>
<td class="r"> </td>
<td>о</td>
<td> </td>
<td class="r"> </td>
<td>д</td>
<td class="r"> </td>
<td>в</td>
<td class="r"> </td>
<td>и</td>
<td class="r"> </td>
<td>ж</td>
<td class="r"> </td>
<td>е</td>
<td class="r"> </td>
<td>т</td>
<td class="r"> </td>
<td>с</td>
<td class="r"> </td>
<td>я</td>
</tr>
</tbody>
</table>
</div>
Разрядка слогана "ВСЁ ЧТО ДВИЖЕТСЯ" на motor.ru
+157
<SCRIPT language=JavaScript> <!--#### Подпрограммы (скрипты) для вывода фотографий составных частей ПК #### -->
function picture1(){
window.open("P4P800.jpg", "newwindow01", config="width=460, height=515, toolbar=0, location=0, directories=0, status=0, menubar=0, scrollbars=0, resizable=0");
}
function picture2(){
window.open("CPU.jpg", "newwindow02", config="width=355, height=380, toolbar=0, location=0, directories=0, status=0, menubar=0, scrollbars=0, resizable=0");
}
function picture3(){
window.open("Video.jpg", "newwindow03", config="width=475, height=380, toolbar=0, location=0, directories=0, status=0, menubar=0, scrollbars=0, resizable=0");
}
function picture4(){
window.open("Syst.jpg", "newwindow04", config="width=220, height=220, toolbar=0, location=0, directories=0, status=0, menubar=0, scrollbars=0, resizable=0");
}
function picture5(){
window.open("audio.jpg", "newwindow05", config="width=315, height=200, toolbar=0, location=0, directories=0, status=0, menubar=0, scrollbars=0, resizable=0");
}
function picture6(){
window.open("Seti.jpg", "newwindow06", config="width=190, height=120, toolbar=0, location=0, directories=0, status=0, menubar=0, scrollbars=0, resizable=0");
}
function picture7(){
window.open("hdd.jpg", "newwindow07", config="width=725, height=425, toolbar=0, location=0, directories=0, status=0, menubar=0, scrollbars=0, resizable=0");
}
function picture8(){
window.open("dvd.jpg", "newwindow08", config="width=520, height=205, toolbar=0, location=0, directories=0, status=0, menubar=0, scrollbars=0, resizable=0");
}
function picture9(){
window.open("korpus.jpg", "newwindow09", config="width=820, height=435, toolbar=0, location=0, directories=0, status=0, menubar=0, scrollbars=0, resizable=0");
}
function picture10(){
window.open("monitor.jpg", "newwindow10", config="width=320, height=320, toolbar=0, location=0, directories=0, status=0, menubar=0, scrollbars=0, resizable=0");
}
function picture11(){
window.open("Klava.jpg", "newwindow11", config="width=510, height=250, toolbar=0, location=0, directories=0, status=0, menubar=0, scrollbars=0, resizable=0");
}
function picture12(){
window.open("Mouse.jpg", "newwindow12", config="width=340, height=285, toolbar=0, location=0, directories=0, status=0, menubar=0, scrollbars=0, resizable=0");
}
function picture13(){
window.open("print.jpg", "newwindow13", config="width=467, height=295, toolbar=0, location=0, directories=0, status=0, menubar=0, scrollbars=0, resizable=0");
}
function picture14(){
window.open("RAM.jpg", "newwindow14", config="width=530, height=135, toolbar=0, location=0, directories=0, status=0, menubar=0, scrollbars=0, resizable=0");
}
</script> <!--#### Конец скриптов ####-->
−117
Часто проскальзывают темы, что 1С часто отказывает в монадах.
Я вот этого вообще не понимаю, как такое может выглядеть???
Я со своей восьмёрочкой 2 года, в любой момент, когда я захочу монад, он будет.
Если он скажет, нет, я не хочу, я показываю ему С++, показываю что я недоволен и говорю, почему ты не хочешь монаду?
Ты любишь кресты? Когда монады встречаются в 1С, они должны преобразовываться по первому же желанию программиста.
+46
public function custom_result_object($class_name)
{
if (array_key_exists($class_name, $this->custom_result_object))
{
return $this->custom_result_object[$class_name];
}
if ($this->result_id === FALSE OR $this->num_rows() == 0)
{
return array();
}
// add the data to the object
$this->_data_seek(0);
$result_object = array();
while ($row = $this->_fetch_object())
{
$object = new $class_name();
foreach ($row as $key => $value)
{
$object->$key = $value;
}
$result_object[] = $object;
}
// return the array
return $this->custom_result_object[$class_name] = $result_object;
}
// --------------------------------------------------------------------
/**
* Query result. "object" version.
*
* @access public
* @return object
*/
public function result_object()
{
if (count($this->result_object) > 0)
{
return $this->result_object;
}
// In the event that query caching is on the result_id variable
// will return FALSE since there isn't a valid SQL resource so
// we'll simply return an empty array.
if ($this->result_id === FALSE OR $this->num_rows() == 0)
{
return array();
}
$this->_data_seek(0);
while ($row = $this->_fetch_object())
{
$this->result_object[] = $row;
}
return $this->result_object;
}
−125
МояМонада :: МойПарсерТип МойПарсер -> (МойПарсерТип -> МойПарсер МойПарсерТип2) -> МойПарсер МойПарсерТип2
МойСущность МойМонад [] Где
Возврат МойТип = [МойТип]
МойВозвратВозврат >>= МойФункция = МойСклейка (МойВсем МойФункция МойВозвратВозврат)
Коллега выдал - закоммитил в локальный гитхаб 1С парсер хаскелля на 1С.
+141
//void wyslij(int pin, char mode[] = "open") { //было
void wyslij(int pin, int mode) { //стало
if (pin != -1)
{
if (mode == "open")
{
//...
else if ( (mode == "touch") && ( (error != 1) || (olej_error == 1) ) )
Кусок дипломной работы польского студента, код для ардуино. Выцарапано отсюда: http://vimeo.com/47656204, примерно с 1:15.
+24
#define TRUE (1)
#define FALSE (0)
#define internal protected:
#define external public:
#define declareSuper(superClass) protected: typedef superClass super
Оттуда.
+39
<?php
session_start();
include ("system/db.config.php");
if (empty($_SESSION['login']) or empty($_SESSION['id']))
{
header("Location: index.php");
}
else
{
//Выясняем, кто зашел сюда, если админ, удаляем юзера, если нет - перекидываем в список пользователей
$fResult = mysql_query("SELECT user_level FROM users WHERE id=".$_SESSION['id'], $db);
$fRow = mysql_fetch_array($fResult);
if($fRow['user_level'] == 1)
{
$DelTenderId = $_GET['id'];
$DellFiled = mysql_query("SELECT file_link FROM tenders WHERE id=".$DelTenderId);
$isdLnk = mysql_fetch_array($DellFiled);
$delPater = "uploads/".$isdLnk['file_link'];
unlink($delPater);
mysql_query("DELETE FROM tenders WHERE id =".$DelTenderId);
header("Location: tenders_list.php");
}
else
{
header("Location: home.php");
}
}
?>
Ну как то так....
+83
if ((decoded.length() > 40) && (el != null))
el.addMsg("Info: Decoded More Characters Than Is Specified By The Track 2 ANSI/ISO Standards");
else if ((decoded.length() > 107) && (el != null)) {
el.addMsg("Info: Decoded More Characters Than Is Specified By The Track 3 ANSI/ISO Standards");
}
Декодинг содержимого магнитной полосы карты в софте одного банка.