- 1
IT Оффтоп #111
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
0
IT Оффтоп #111
#81: https://govnokod.ru/27280 https://govnokod.xyz/_27280
#82: https://govnokod.ru/27284 https://govnokod.xyz/_27284
#83: https://govnokod.ru/27296 https://govnokod.xyz/_27296
#84: https://govnokod.ru/27336 https://govnokod.xyz/_27336
#85: https://govnokod.ru/27381 https://govnokod.xyz/_27381
#86: https://govnokod.ru/27405 https://govnokod.xyz/_27405
#87: https://govnokod.ru/27429 https://govnokod.xyz/_27429
#88: https://govnokod.ru/27432 https://govnokod.xyz/_27432
#89: https://govnokod.ru/27435 https://govnokod.xyz/_27435
#90: https://govnokod.ru/27439 https://govnokod.xyz/_27439
#91: https://govnokod.ru/27449 https://govnokod.xyz/_27449
#92: https://govnokod.ru/27460 https://govnokod.xyz/_27460
#93: https://govnokod.ru/27463 https://govnokod.xyz/_27463
#94: https://govnokod.ru/27466 https://govnokod.xyz/_27466
#95: https://govnokod.ru/27473 https://govnokod.xyz/_27473
#96: https://govnokod.ru/27478 https://govnokod.xyz/_27478
#97: https://govnokod.ru/27484 https://govnokod.xyz/_27484
#98: https://govnokod.ru/27495 https://govnokod.xyz/_27495
#99: https://govnokod.ru/27504 https://govnokod.xyz/_27504
#100: https://govnokod.ru/27508 https://govnokod.xyz/_27508
#101: https://govnokod.ru/27511 https://govnokod.xyz/_27511
#102: https://govnokod.ru/27518 https://govnokod.xyz/_27518
#103: https://govnokod.ru/27526 https://govnokod.xyz/_27526
#104: https://govnokod.ru/27534 https://govnokod.xyz/_27534
#105: https://govnokod.ru/27544 https://govnokod.xyz/_27544
#106: https://govnokod.ru/27552 https://govnokod.xyz/_27552
#107: https://govnokod.ru/27554 https://govnokod.xyz/_27554
#108: https://govnokod.ru/27557 https://govnokod.xyz/_27557
#109: https://govnokod.ru/27581 https://govnokod.xyz/_27581
#110: https://govnokod.ru/27610 https://govnokod.xyz/_27610
+1
public class RegLocalityPK
implements Serializable
{
private String countryNo;
private String govNo;
private String localityNo;
public String getGovNo()
{
return this.govNo;
}
…
+1
package com.javarush.task.task10.task1013;
/*
Конструкторы класса Human
*/
public class Solution {
public static void main(String[] args) {
}
public static class Human {
// Напишите тут ваши переменные и конструкторы
private String name;
private int age;
private int height;
private String profession;
private String sex;
private String citizen;
public Human(String name, int huy) {
this.name = name;
huy = huy;
}
public Human(String name, int huy, int pizda) {
this.name = name;
huy = huy;
pizda = pizda;
}
public Human(String name) {
this.name = name;
}
public Human(String name, int age, String sex) {
this.name = name;
this.age = age;
this.sex = sex;
}
public Human(String name, int age, String sex, String profession) {
this.name = name;
this.age = age;
this.sex = sex;
this.profession = profession;
}
public Human(String name, int age, String sex, String profession, String citizen) {
this.name = name;
this.age = age;
this.sex = sex;
this.profession = profession;
this.citizen = citizen;
}
public Human(String name, int age, int height, String sex, String profession, String citizen) {
this.name = name;
this.age = age;
this.height = height;
this.sex = sex;
this.profession = profession;
this.citizen = citizen;
}
public Human(String name, int age, int height, String sex, String profession, String citizen, boolean pidor) {
this.name = name;
this.age = age;
this.height = height;
this.sex = sex;
this.profession = profession;
this.citizen = citizen;
pidor = pidor;
}
public Human(String name, int age, int height, String sex, String profession, String citizen, boolean pidor, boolean govno) {
this.name = name;
this.age = age;
this.height = height;
this.sex = sex;
this.profession = profession;
this.citizen = citizen;
pidor = pidor;
govno = govno;
0
-module(pqueue).
-export([ in/3
, out/1
, new/0
, close/1
]).
-type prio() :: non_neg_integer().
-record(priority_queue,
{ tab :: ets:tid()
}).
-define(size, {size, size}).
-define(seqno(PRIO), {seqno, PRIO}).
-opaque t() :: #priority_queue{}.
-export_type([ prio/0
, t/0
]).
-spec new() -> t().
new() ->
Tab = ets:new(pqueue_tab, [ordered_set]),
ets:insert(Tab, {?size, 0}),
#priority_queue{tab = Tab}.
-spec close(t()) -> ok.
close(#priority_queue{tab = Tab}) ->
true = ets:delete(Tab),
ok.
-spec in(term(), prio(), t()) -> ok.
in(Val, Prio, #priority_queue{tab = Tab}) when Prio >= 0 ->
Key = {get_next_seqno(Tab, Prio), Prio},
true = ets:insert_new(Tab, {Key, Val}),
ets:update_counter(Tab, ?size, {2, 1}, {?size, 0}),
ok.
-spec out(t()) -> {value, term()} | empty.
out(#priority_queue{tab = Tab}) ->
case ets:first(Tab) of
Key = {SeqNo, _Prio} when is_integer(SeqNo) ->
Val = ets:lookup_element(Tab, Key, 2),
ets:update_counter(Tab, ?size, {2, -1}),
ets:delete(Tab, Key),
{value, Val};
_ ->
empty
end.
%% This function generates keys that go in sequence for each
%% individual priority level, but interleave for different priority
%% levels. Keys with lower priority are more sparse, so they are
%% consumed less often in the total sequence
get_next_seqno(Tab, Prio) ->
Delta = Prio + 1,
Key = ?seqno(Prio),
ets:update_counter(Tab, Key, {2, Delta}, {Key, 0}).
Творение безумца или гения.
+1
.chamfer {
display: table;
border-collapse: separate;
empty-cells: show;
background: transparent;
display: inline-block;
margin-bottom: 25px;
margin-right: 25px;
vertical-align: top;}
.chamfer .row {
display: table-row;}
.chamfer .boxcontent {
display: table-cell;
background: #FFFFFF;
font-size: 24px;
vertical-align: middle;
min-width: 200px;
width: 200px;
height: 173px;}
.chamfer .transparentbox {
display: table-cell;
background: transparent;
font-size: 24px;
vertical-align: middle;
min-width: 200px;
width: 200px;}
.chamfer .row .north-west {
display: table-cell;
border: 100px solid transparent;
border-top-width: 0px;
border-right-width: 0px;
border-bottom: 173px solid #FFF;
width: 0px;}
.chamfer .row .north-east {
display: table-cell;
border: 100px solid transparent;
border-top-width: 0px;
border-left-width: 0px;
border-bottom: 173px solid #FFF;
width: 0px;}
.chamfer .row .south-west {
display: table-cell;
border: 100px solid transparent;
border-bottom-width: 0px;
border-right-width: 0px;
border-top: 173px solid #FFF;
width: 0px;}
.chamfer .row .south-east {
display: table-cell;
border: 100px solid transparent;
border-bottom-width: 0px;
border-left-width: 0px;
border-top: 173px solid #FFF;
width: 0px;}
.chamfer .row3 .north-west {
border: 100px solid yellow;
border-top-width: 0px;
border-right-width: 0px;
border-bottom: 173px solid red;}
.chamfer .row3 .north-east {
border: 100px solid yellow;
border-top-width: 0px;
border-left-width: 0px;
border-bottom: 173px solid red;}
.chamfer .row2 .south-west {
border: 100px solid yellow;
border-bottom-width: 0px;
border-right-width: 0px;
border-top: 173px solid #FFF;}
.chamfer .row2 .south-east {
border: 100px solid yellow;
border-bottom-width: 0px;
border-left-width: 0px;
border-top: 173px solid #FFF;}
.chamfer .row4 .south-west {
border: 100px solid transparent;
border-bottom-width: 0px;
border-right-width: 0px;
border-top: 173px solid red;}
.chamfer .row4 .south-east {
border: 100px solid transparent;
border-bottom-width: 0px;
border-left-width: 0px;
border-top: 173px solid red;}
.chamfer .row2 .transparentbox, .chamfer .row3 .transparentbox {
background: yellow;
height: 173px;}
.chamfer .row3 .boxcontent, .chamfer .row4 .boxcontent {
background: red;
height: 173px;}
body {
color: #3B3A37;
background-color: olive;}
Реальный пример шестиугольных блоков (в виде сот) на чистом CSS2.
Страница в действии:
https://output.jsbin.com/xewelufoda/
+1
https://journal.tinkoff.ru/diary-it-zhena-ekb/
Хорошо устроилась
0
Хрюкни #12
._ __,
|\,../'\
,'. . `.
.-- '`.
( `' , ;
,`--' _, ,'\
,`.____ `.
/ `, |
' \, '
| / /`,
`, . ,` ./ |
' `. ,' |;,' ,@
______| | _________,_____jv______
`. `. ,'
,'_,','_,
`' `'
#1: (vanished) https://govnokod.xyz/_26863
#2: (vanished) https://govnokod.xyz/_26868
#3: https://govnokod.ru/26881 https://govnokod.xyz/_26881
#4: https://govnokod.ru/26896 https://govnokod.xyz/_26896
#5: https://govnokod.ru/26928 https://govnokod.xyz/_26928
#6: (vanished) https://govnokod.xyz/_26952
#7: https://govnokod.ru/26955 https://govnokod.xyz/_26955
#8: https://govnokod.ru/27043 https://govnokod.xyz/_27043
#9: https://govnokod.ru/27175 https://govnokod.xyz/_27175
#10: https://govnokod.ru/27472 https://govnokod.xyz/_27472
#11: https://govnokod.ru/27517 https://govnokod.xyz/_27517
+2
// https://wandbox.org/permlink/rAilQ54oYBNsHJ3W
struct blob_p(T,alias t_xmalloc,alias t_free)
{
blob!(T)* bl_p;
size_t
getlen
(
) @trusted
in
{
assert(bl_p != null);
}
do
{
return bl_p.len;
}
T*
getdata
(
) @trusted
in
{
assert(this.bl_p != null);
}
do
{
return cast(T*)bl_p.data;
}
static bool
cmp
(
typeof(this) a,
typeof(this) b
) @trusted
in
{
assert(a.bl_p != null);
assert(b.bl_p != null);
}
do
{
if (a.bl_p.len != b.bl_p.len)
{
return false;
}
if(memcmp(cast(void*)a.bl_p.data, cast(void*)b.bl_p.data, a.bl_p.len * T.sizeof) != 0)
{
return false;
}
return true;
}
bool
cmp
(
typeof(this) a
) @trusted
in
{
assert(a.bl_p != null);
assert(this.bl_p != null);
}
do
{
if (a.bl_p.len != this.bl_p.len)
{
return false;
}
if(memcmp(cast(void*)a.bl_p.data, cast(void*)bl_p.data, a.bl_p.len * T.sizeof) != 0)
{
return false;
}
return true;
}
T opIndex(size_t i)
in
{
assert(bl_p != null);
assert(bl_p.len > i);
}
do
{
return getdata()[i];
}
~this()
/*in
{
assert (cast(void*)bl_p != null);
}
do*/
{
t_free(cast(void*)bl_p);
}
Попробовал написать на "D" своего рода "массив" с известно каким размером
+1
https://benchmarksgame-team.pages.debian.net/benchmarksgame/performance/pidigits.html
1.0 C gcc #6 0.59 2,444 1090 2.37 100% 100% 100% 98%
1.1 C++ g++ #6 0.66 5,152 986 2.63 100% 100% 100% 100%
1.2 Rust #4 0.71 2,672 799 0.73 3% 0% 0% 100%
1.2 Free Pascal #3 0.73 2,268 530 0.73 0% 0% 100% 0%
1.4 F# .NET #6 0.82 34,428 905 0.83 1% 2% 96% 1%
1.4 Haskell GHC #5 0.83 6,056 928 0.84 0% 99% 1% 1%
1.5 Ada 2012 GNAT 0.88 4,704 1130 0.89 0% 0% 100% 1%
1.5 Rust #2 0.88 2,800 1306 0.89 0% 1% 100% 0%
1.5 C++ g++ #4 0.89 4,280 513 0.92 0% 2% 1% 100%
1.5 OCaml #7 0.89 5,968 593 0.90 0% 0% 1% 100%
1.5 Swift #2 0.89 9,256 600 0.91 3% 0% 0% 99%
1.5 PHP #5 0.91 13,196 399 0.96 2% 0% 3% 100%
1.5 C# .NET #5 0.92 35,404 977 0.96 98% 3% 2% 1%
1.6 Java #3 0.93 36,552 764 0.98 2% 3% 1% 99%
However, Java is one of the fastest and most energy-efficient object-oriented language. Interpreted languages like Perl, Python, and Ruby were among the least energy efficient
Using the Computer Benchmarks Game, the team of researchers tested these languages by compiling/executing such programs using the state-of-the-art compilers, virtual machines, interpreters, and libraries.
They then analyzed the performance of the different implementation considering three variables: execution time, memory consumption and energy consumption.
https://jaxenter.com/energy-efficient-programming-languages-137264.html
https://jaxenter.com/wp-content/uploads/2017/09/energy-efficient-languages-768x689.png
https://jaxenter.com/wp-content/uploads/2017/09/energy-efficient-languages-2-768x368.png
+1
Тестовый Оффтоп #4
#1: https://govnokod.ru/26373 https://govnokod.xyz/_26373
#1: https://govnokod.ru/26611 https://govnokod.xyz/_26611
#1: https://govnokod.ru/26824 https://govnokod.xyz/_26824
#1: https://govnokod.ru/26850 https://govnokod.xyz/_26850
#2: https://govnokod.ru/27102 https://govnokod.xyz/_27102
#3: https://govnokod.ru/27523 https://govnokod.xyz/_27523