- 1
- 2
- 3
- 4
- 5
- 6
- 7
/**
* Change the zoom level to the specified value. Specify 0.0 to reset the
* zoom level.
*
* @param zoomLevel The zoom level to be set.
*/
public void setZoomLevel(double zoomLevel);
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+2
/**
* Change the zoom level to the specified value. Specify 0.0 to reset the
* zoom level.
*
* @param zoomLevel The zoom level to be set.
*/
public void setZoomLevel(double zoomLevel);
Когда-то я думал, что zoom 100% это 1.0. И что на zoom нужно умножать. Но оказалось, что я анскильный.
0
<?php
function get_post_id($comment_list_id) {
$rawdata = file_get_contents("https://govnokod.ru/comments/$comment_list_id/post");
$rawdata='<?xml encoding="UTF-8">'.$rawdata;
$old_libxml_error = libxml_use_internal_errors(true);
$dom = new DOMDocument;
$dom->loadHTML($rawdata);
libxml_use_internal_errors($old_libxml_error);
$xpath = new DOMXPath($dom);
$entries = $xpath->query('//*[@id="content"]/ol[@class="posts hatom"]/li[@class="hentry"]/h2/a');
foreach($entries as $entry) {
$href = $entry->getAttribute('href');
if(preg_match('#https://govnokod.ru/(\d+)#', $href, $matches)) {
$post_id = $matches[1];
break;
}
}
return $post_id;
}
$outf = fopen('postids.csv', 'w');
fputcsv($outf, array('post_id','comment_list_id'));
for($i = 1; $i <= 26663; $i++) {
fputcsv($outf, array(get_post_id($i), $i));
}
fclose($outf);
Получение списка всех говнокодов, комментарии к которым можно восстановить.
0
<div class="choose_payment">
<div class="title"><span>2</span>Выберите способы оплаты (все без комиссии)</div>
<!-- all terminals -->
<div class="all_terminals">
<!-- fike: конечно же тут были все терминалы, а вы как думали? -->
</div>
<!-- payments. no commisson -->
<div class="no_commission"><label>
<div class="title_no_commission"><i>Подсказка:</i></div>
<div class="we_recommend_2">
<div class="title_we_recommend_2">
Оплачиваете первый раз?<br>
наши специалисты ответят на все вопросы <br>
<!--?phpphp echo preg_replace("/([0-9]{1})([0-9]{3})([0-9]{3})([0-9]{2})([0-9]{2})/", "+$1 ($2) $3-$4-$5", SUPPORT_PHONE); ?--> ежедневно с 10:00 до 19:00
</div>
</div>
</label>
</div>
</div>
А впрочем нет, не ответят
0
// GostServer is the type that contains all of the relevant information to set
// up the GOST HTTP Server
type GostServer struct {
host string // Hostname for example "localhost" or "192.168.1.14"
port int // Port number where you want to run your http server on
api *models.API // SensorThings api to interact with from the HttpServer
https bool
httpsCert string
httpsKey string
httpServer *http.Server
}
// CreateServer initialises a new GOST HTTPServer based on the given parameters
func CreateServer(host string, port int, api *models.API, https bool, httpsCert, httpsKey string) Server {
setupLogger()
a := *api
router := CreateRouter(api)
return &GostServer{
host: host,
port: port,
api: api,
https: https,
httpsCert: httpsCert,
httpsKey: httpsKey,
httpServer: &http.Server{
Addr: fmt.Sprintf("%s:%s", host, strconv.Itoa(port)),
Handler: PostProcessHandler(RequestErrorHandler(LowerCaseURI(router)), a.GetConfig().Server.ExternalURI),
ReadTimeout: 30 * time.Second,
WriteTimeout: 30 * time.Second,
},
}
}
// Start command to start the GOST HTTPServer
func (s *GostServer) Start() {
t := "HTTP"
if s.https {
t = "HTTPS"
}
logger.Infof("Started GOST %v Server on %v:%v", t, s.host, s.port)
var err error
if s.https {
err = s.httpServer.ListenAndServeTLS(s.httpsCert, s.httpsKey)
} else {
err = s.httpServer.ListenAndServe()
}
if err != nil {
logger.Panicf("GOST server not properly stopped: %v", err)
}
}
// Stop command to stop the GOST HTTP server
func (s *GostServer) Stop() {
if s.httpServer != nil {
logger.Info("Stopping HTTP(S) Server")
s.httpServer.Shutdown(context.Background())
}
}
Нашёл ГостСервер го
https://github.com/gost/server/blob/master/http/gostserver.go
+3
/**
* Four state boolean.
*/
enum Bool {
/** */
FALSE,
/** */
TRUE,
/** */
READY,
/** */
DONE
}
0
set -e
myfunc() {
echo "START"
v=$(asdasdsd 1 2 3)
echo "FINISH"
}
myfunc && echo "OK"
Выводит:
START
./b.sh: line 5: asdasdsd: command not found
FINISH
OKset -e
myfunc() {
echo "START"
v=$(asdasdsd 1 2 3)
echo "FINISH"
}
myfuncSTART
./a.sh: line 5: asdasdsd: command not found−2
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
//типа explode в php;
{
int i=0;
//char s=';';
char s=argv[2][0];
i=100;
//char** data;
//data=(char**)malloc(i+1);
char data[1000][1000];
char* str;
str=malloc(i+1);
str=argv[1];
printf("%s\n",str );
int n=0;
int m=0;
while (*str) {
if (*str==s)
{m++;n=0;str++;continue;};
data[m][n]=*str;
str++;n++;
};
printf("%s\n",data[0] );
}
Типа explode в php
Кто-нить знает как это заставить работать с
//char** data;
//data=(char**)malloc(i+1);
??
0
ВЫБРАТЬ РАЗЛИЧНЫЕ
ВЫРАЗИТЬ(Работы.Ссылка КАК Документ.ЗаказНаряд) КАК СсылкаЗН,
ДЦ.Ссылка КАК ДилерскийЦентр
ИЗ
Документ.ЗаказНаряд.Работы КАК Работы
ЛЕВОЕ СОЕДИНЕНИЕ Справочник.CRM_ДилерскиеЦентры КАК ДЦ
ПО (ЛОЖЬ)
ГДЕ
Работы.Ссылка.ДатаЗакрытия >= &ДатаНачала
И Работы.Ссылка.ДатаЗакрытия < &ДатаОкончания
И ДЦ.Ссылка.ПометкаУдаления = ЛОЖЬ
;
Язык запросов 1С. При таком соединение запрос запрос всегда будет пустым.
0
$products = $this->cart->getProducts();
foreach ($products as $product) {
$product_total = 0;
foreach ($products as $product_2) {
if ($product_2['product_id'] == $product['product_id']) {
$product_total += $product_2['quantity'];
}
}
....
}
Поечему опенкарт так странно вычисляет количество товаров в корзине? неужели нет способа изящней?
0
$id=$id-1;
$id++;
$id=(int)$id;
Дальше в sql запрос ее конкотенируют.
ОМГ, я даже представить не могу для чего нужны первые 3 строки в совокупности в 3-й..