- 1
https://pikabu.ru/story/bez_lokha_i_zhizn_plokha_6096016
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
−1
https://pikabu.ru/story/bez_lokha_i_zhizn_plokha_6096016
0
http://codeforces.com/blog/entry/61248
−1
#include <stdio.h>
#include <inttypes.h>
int main(void) {
float a = 0;
float b = -9.8 * 0;
uint32_t* pa = (void*)&a;
uint32_t* pb = (void*)&b;
printf("%li %li %i %f %f\n",pa[0] , pb[0], pb[0]>>31, b+0, b);
return 0;
}
Нолик со взведенным знаковым битом. Вот зачем он нужен?
+4
def lookup(self, code):
"""
Looks up code in Redis
Returns None on failure
"""
url = self.redis.get(code)
try:
pass
except:
url = None
return url
Вот такое на полном серьезе получили как кусочек домашнего задания для соискателя на Senior Python Engineer
+2
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the ActiveQt framework of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** BSD License Usage
** Alternatively, you may use this file under the terms of the BSD license
** as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
** * Neither the name of The Qt Company Ltd nor the names of its
** contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
** $QT_END_LICENSE$
**
****************************************************************************/
Вот блин, почти в любом проекте в начале каждого файла такая вот куча . Я блядь открываю файл, чтобы посмотреть, что это, хотя бы одну строчку написали: этот класс занимается тем-то и тем-то, так нет, а вот всю эту бурду "ASS PISS" LSD LICENCE - пожалуйста.
0
// AFJSONRPCClient.m
//
// Created by [email protected]
// Copyright (c) 2013 JustCommunication
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#import "AFHTTPRequestOperationManager.h"
/**
AFJSONRPCClient objects communicate with web services using the JSON-RPC 2.0 protocol.
@see http://www.jsonrpc.org/specification
*/
@interface AFJSONRPCClient : AFHTTPRequestOperationManager
/**
The endpoint URL for the webservice.
*/
@property (readonly, nonatomic, strong) NSURL *endpointURL;
/**
Creates and initializes a JSON-RPC client with the specified endpoint.
@param URL The endpoint URL.
@return An initialized JSON-RPC client.
*/
+ (instancetype)clientWithEndpointURL:(NSURL *)URL;
/**
Initializes a JSON-RPC client with the specified endpoint.
@param URL The endpoint URL.
@return An initialized JSON-RPC client.
*/
- (id)initWithEndpointURL:(NSURL *)URL;
/**
Creates a request with the specified HTTP method, parameters, and request ID.
@param method The HTTP method. Must not be `nil`.
@param parameters The parameters to encode into the request. Must be either an `NSDictionary` or `NSArray`.
@param requestId The ID of the request.
@return A JSON-RPC-encoded request.
*/
- (NSMutableURLRequest *)requestWithMethod:(NSString *)method
parameters:(id)parameters
requestId:(id)requestId;
/**
Creates a request with the specified method, and enqueues a request operation for it.
@param method The HTTP method. Must not be `nil`.
@param success A block object to be executed when the request operation finishes successfully. This block has no return value and takes two arguments: the request operation, and the response object created by the client response serializer.
@param failure A block object to be executed when the request operation finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the request operation and the error describing the network or parsing error that occurred.
*/
- (void)invokeMethod:(NSString *)method
success:(void (^)(AFHTTPRequestOperation *operation, id responseObject))success
failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error))failure;
/**
Creates a request with the specified method and parameters, and enqueues a request operation for it.
@param method The HTTP method. Must not be `nil`.
@param parameters The parameters to encode into the request. Must be either an `NSDictionary` or `NSArray`.
@param success A block object to be executed when the request operation finishes successfully. This block has no return value and takes two arguments: the request operation, and the response object created by the client response serializer.
@param failure A block object to be executed when the request operation finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the request operation and the error describing the network or parsing error that occurred.
*/
- (void)invokeMethod:(NSString *)method
withParameters:(id)parameters
success:(void (^)(AFHTTPRequestOperation *operation, id responseObject))success
failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error))failure;
/**
Creates a request with the specified method and parameters, and enqueues a request operation for it.
@param method The HTTP method. Must not be `nil`.
@param parameters The parameters to encode into the request. Must be either an `NSDictionary` or `NSArray`.
@param requestId The ID of the request.
@param success A block object to be executed when the request operation finishes successfully. This block has no return value and takes two arguments: the request operation, and the response object created by the client response serializer.
@param failure A block object to be executed when the request operation finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the request operation and the error describing the network or parsing error that occurred.
*/
- (void)invokeMethod:(NSString *)method
0
Ну как вы тут, потомки? Борманд еще живой?
−1
Red [ needs: 'view ]
empty: 4x4
grid: random do [
res: copy[]
repeat i 15 [append res to string! i]
res
]
loop 15 [grid: next insert grid 't]
grid: head grid
loop 3 [grid: insert skip grid 8 'return]
grid: head insert [empty-cell: base 50x50 silver ] head grid
view head insert grid [
title "15 game"
backdrop silver
style t: button 50x50 [
tmp: face/offset
i: tmp/y / face/size/y + 1
j: tmp/x / face/size/x + 1
if (absolute empty/1 - i) + (absolute empty/2 - j) = 1 [
face/offset: empty-cell/offset
empty-cell/offset: tmp
empty: as-pair i j
]
]
across
]
Пятнашки на RED.
0
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SoloLearn
{
class Program
{
/**
* Extension to simplify code writing
*/
static string Read()
{
return Console.ReadLine();
}
static void Print(string val, bool newline)
{
if(newline)
{
Console.WriteLine(val);
}
else
{
Console.Write(val);
}
}
static void Print(double val, bool newline)
{
if(newline)
{
Console.WriteLine(val.ToString());
}
else
{
Console.Write(val.ToString());
}
}
static void Print(bool val, bool newline)
{
if(newline)
{
Console.WriteLine(val.ToString());
}
else
{
Console.Write(val.ToString());
}
}
static void Print(int val, bool newline)
{
if(newline)
{
Console.WriteLine(val.ToString());
}
else
{
Console.Write(val.ToString());
}
}
/**
* End of extension
*/
static int ToBase(int number, int nbase = 2)
{
int converted = 0;
if(number == 0)
{
return 0;
}
else
{
while(number > 0)
{
converted = converted * 10 + (number % nbase);
number /= nbase;
}
}
return converted.ToString().Reverse().Aggregate(0, (b, x) => 10 * b + x - '0');
}
/** Use:
* The first number is the convertable
* The second is the base
*/
static void Main(string[] args)
{
int num = int.Parse(Read());
int nnbase = int.Parse(Read());
Print("The number is: ", false);
Print(num, true);
Print("The base is: ", false);
Print(nnbase, true);
Print("The conv. number is: ", false);
Print(ToBase(num, nnbase), true);
}
}
}
Говно ли это? Конвертит числа
−2
Давайте ругать torch7