- 1
- 2
- 3
Вас заметили
капча pa9e
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
−1
Вас заметили
капча pa9e
Part of the challenge of programming (and for some people, the reason why programming is fun in the first place) is looking at the building blocks provided to you and deciding how to assemble them to build something new. After all, if everything you wanted a program to do already existed ready-made, it wouldn't be called programming any more. It would be called shopping.
>> Is there an API or a quick way to find out which window the mouse is in?
I replied, "The LEGO Group does not make a piece for every possible object. Sometimes you just have to take two LEGO blocks and click them together. Here are some interesting blocks: GetCursorPos, WindowFromPoint."
>> Thanks for your reply. But WindowFromPoint gives me the window of the object at the location of the cursor. But I'm looking for the top level window containing the cursor.
Fine, then use a different block.
I wonder how it is these people manage to write programs at all. I get the impression they write code by asking a million tiny questions and cutting and pasting together all the replies.
No wait, pasting together the replies counts as snapping blocks together. Maybe they just ask for completed programs.
0
let randomHexColor = (g = () => (a => (a < 16 ? '0' : '') + a.toString(16))(~~(Math.random() * 255)))() + g() + g();
0
Ворециометр зашкаливает
Охладите трахание.
Как будто вернулся в 2015, когда не понимал о чём тут пишут.
−1
сука блядь ебучий фрорнтенд блядь гори сука в аду, JS, HTML, CSS и прочая хуета, это ебаное исчадь ада
еuо создали настоящие мрази, ебучие серийные программисты, сколько жизней уже отобрала эта хуйня?
ПРЕДСТАВЬТЕ ПРОСТО СКОЛЬКО ЛЮДЕЙ В СУММЕ ПОТРАТИЛИ ВРЕМЕНИ НА ОТЛАДКУ ВСЕЙ ЭТО КРИВОЙ ХУЕТЫ
КОТОРАЯ БЫЛА СОЗДАНА C ОДНОЙ ЕБАНОЙ ЦЕЛЬЮ -- ДЛЯ ТОГО ЧТОБЫ УБИВАТЬ ЛЮДЕЙ, ДЕТЕЙ НА ДОНБАССЕ СУКА, ГИБНУТ!!!
МОЙ АНУС МИРОТОЧИК ПЫЛЬЮ ГАЛАКТИК ДОСТИГНУВШИХ КОЛЛАПСА
0
public static long NextTimestamp()
{
if (initTimestamp == null)
{
lock (syncRoot)
{
if (initTimestamp == null)
{
initTimestamp = false;
var sessionProvider = Locator.GetServiceNotNull<ISessionProvider>();
TimestampService.GetTimestamp();
sessionProvider.CloseSession("");
initTimestamp = true;
}
}
}
return initTimestamp.Value ? TimestampService.GetTimestamp() : 0;
}
Нельзя просто взять и вызвать TimestampService.GetTimestamp() - StackOverflowException получишь. Вот как надо!
+1
private static string GetServerHostFromUrl(string url)
{
char[] delimiterChars = { '/', ':' };
var urlParser = url.Split(delimiterChars);
if (urlParser[0] == "http" || urlParser[0] == "https")
return urlParser[3];
else
return string.Empty;
}
Когда ты умеешь решать все поставленные задачи
−102
Тест.
+1
<?php
function php2js ($var) {
if (is_array($var)) {
$res = "[";
$array = array();
foreach ($var as $a_var) {
$array[] = php2js($a_var);
}
//return "[" . join(",", $array) . "]";
return "" . join(",", $array) . "";
}
elseif (is_bool($var)) {
return $var ? "true" : "false";
}
elseif (is_int($var) || is_integer($var) || is_double($var) || is_float($var)) {
return $var;
}
elseif (is_string($var)) {
//return "\"" . addslashes(stripslashes($var)) . "\"";
return "" . addslashes(stripslashes($var)) . "";
}
return FALSE;
}
+3
namespace
{
struct list {
type pole1;
list *pole2;
}
stack;
}
Пример описания стека
0
#include<math.h>
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<ctype.h>
#define MAX 300
struct stack {
char alpha;
struct stack *nxtPTR;
};
typedef struct stack Stack;
typedef Stack *node;
void message(void);
char out_print(char word[]);
int precedence_power(int res_1, int res_2);
int pop(node *topPtr);
void push_stack(node *topPTR, char value);
int pop(node *topPTR);
char check_stack(node data);
int isOperator(char c);
int precedence(char data_1, char data_2, int(intro_precedence_power)(int res_1, int res_2));
void converting(char *in, char *out, node *PTR, char (checking_stack)(node), void (push)(node *topPTR, char value), int (pop)(node *fix), int (isOper)(char c), int (precedence_intro)(char data_1, char data_2, int(intro_precedence_power)(int res_1, int res_2)), int(intro_precedence_power)(int res_1, int res_2));
void please_enter(void );
int main(void) {
char infix[MAX];
char postfix[MAX];
node topPTR = NULL;
fgets(infix, sizeof(infix), stdin);
int m = strlen(infix);
infix[m] = ')';
memset(postfix, 0, MAX);
converting( infix, postfix, &topPTR, check_stack, push_stack, pop, isOperator, precedence, precedence_power);
out_print(postfix);
puts(" ");
return 0;
}
char out_print(char word[]) {
if( word[0] != '\0' ){
printf( "%c " , word[0] ) ;
return out_print(word + 1 ) ;
}
}
void push_stack(node *topPTR, char value) {
node newPTR = malloc(sizeof(Stack));
if (newPTR != NULL) {
newPTR->alpha = value;
newPTR->nxtPTR = *topPTR;
*topPTR = newPTR;
}
else {
puts("error");
}
}
int pop(node *fix) {
int value = (*fix)->alpha;
node temp = *fix;
*fix = (*fix)->nxtPTR;
free(temp);
return value;
}
char check_stack(node data) {
return data->alpha;
}
int isOperator(char c) {
return c == '/' || c == '*' || c == '-' || c == '+' || c == '^' ;
}
вычисляет обратною польскою нотацию номер раз