- 1
- 2
Официальный тред для обсуждения способов высера видеоизображения на телеящик.
Один калмент -- один способ
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
−3
Официальный тред для обсуждения способов высера видеоизображения на телеящик.
Один калмент -- один способ
Официальный тред для обсуждения способов высера видеоизображения на телеящик.
Один калмент -- один способ
−1
// https://cdn.staticaly.com/gh/landawn/abacus-util/master/docs/MutableBoolean_view.html
// https://github.com/landawn/abacus-util/blob/76cb7c712d4ce2d167f9170f8d92fd9857db8f99/src/main/java/com/landawn/abacus/util/MutableBoolean.java
public final class MutableBoolean implements Mutable, Serializable, Comparable<MutableBoolean> {
/**
* Constructs a new MutableBoolean with the default value of false.
*/
MutableBoolean() {
super();
}
/**
* Constructs a new MutableBoolean with the specified value.
*
* @param value the initial value to store
*/
MutableBoolean(final boolean value) {
super();
this.value = value;
}
/**
*
* @param value
* @return
*/
public static MutableBoolean of(final boolean value) {
return new MutableBoolean(value);
}
/**
*
* @return true, if successful
*/
public boolean value() {
return value;
}
/**
* Sets the value.
*
* @param value the value to set
*/
public void setValue(final boolean value) {
this.value = value;
}
}
Тут человек изменяемый булеан сделал, что думаете? Функциональное программирование уже проиграло ООП?
0
void sensor_init_regctl(void)
{
int iVar1;
/* Reading /rom/custom_setting_gm.ini
Setting I2CPortChange val from file */
custom_setting_gm_get_I2C();
/* Checking for I2CPortChange in /rom/custom_setting_gm.ini
(default = 1) */
iVar1 = GET_I2CPortChange_glob();
if (iVar1 != 0) {system("rmmod gpioi2c"); usleep(50000);Regctl_main_function();system("insmod /npc/patch/gpioi2c2.ko");} return;}
void Regctl_main_function(void)
{
uint uVar1; uVar1 = Regctl_set_ioctl5(0x90c00000,0x54);
Regctl_set_2_dwWriteRegVal(-0x6f400000,0x54,uVar1 & 0xfffc3fff | 0x28000);
return;
}
int Regctl_set_ioctl5(ulong param_1,ulong param_2)
{
int __fd; int iVar1; ulong local_20; ulong uStack28; int *local_10; int iStack12;
local_10 = &iStack12;
local_20 = param_1;
uStack28 = param_2;
__fd = pl_open_file("/dev/regctl",2,"dwReadRegVal",0x1b);
if (__fd == 0) {
printf("%s: error: open dev/misc/regctl fail \n","dwReadRegVal");
}
else {
iVar1 = ioctl(__fd,5,&local_20);
if (iVar1 == -1) {
printf("%s: error: regctl ioctl fail \n","dwReadRegVal");
pl_close_file(__fd,"dwReadRegVal",0x26);
__fd = 0;
}
else {
pl_close_file(__fd,"dwReadRegVal",0x2a);
__fd = *local_10;
}
}
return __fd;
}
int Regctl_set_2_dwWriteRegVal(int param_1,int param_2,int param_3)
{
int __fd; int iVar1; int local_24 [2];int local_1c; int local_18;int *local_c; local_c = local_24; local_24[0] = param_3; local_1c = param_1; local_18 = param_2;
__fd = pl_open_file("/dev/regctl",2,"dwWriteRegVal",0x3c);
if (__fd == 0) {
printf("%s: error: open dev/misc/regctl fail \n","dwWriteRegVal");
}
else {
iVar1 = ioctl(__fd,1,&local_1c);
if (iVar1 == -1) {
printf("%s: error: regctl ioctl fail \n","dwWriteRegVal");
pl_close_file(__fd,"dwWriteRegVal",0x49);
__fd = 0;
}
else {
pl_close_file(__fd,"dwWriteRegVal",0x4d);
__fd = 1;
}
}
return __fd;
}
Помогите разреверсить код из прошивки камеры Rubetek RV-3414 (основана на SoC GrainMedia GM8136). Это код из Ghidra. Интересует функция Regctl_main_function.
dump из strace:
open("/dev/regctl", O_RDWR) = 3 <0.000901>
ioctl(3, _IOC(_IOC_NONE, 0, 0x5, 0), 0x7eee2c18) = 0 <0.000308>
close(3) = 0 <0.000256>
open("/dev/regctl", O_RDWR) = 3 <0.000422>
ioctl(3, FIBMAP, 0x7eee2c1c) = 0 <0.000105>
close(3)
local_20 и uStack28 - это struct?
−1
Видели ли Вы демотиватор, где изображены путин и лукашенко?
Встав на табуретку, коротышка очень похожий на путина прёт лукаша в зад.
0
$interval = $interval->m;
switch ($interval){
case 1: brake;
case 3: brake;
}
от предыдущего тимлида
0
<div ng-switch="state">
<div ng-switch-when="NO_QUERY">Введите запрос.</div>
<div ng-switch-when="IN_PROGRESS">Ищем...</div>
<div ng-switch-when="NOT_FOUND">Ничего не найдено.</div>
<div ng-switch-when="FOUND">
<div ng-repeat="comment in result" ng-include="'comment-template-search'"></div>
<div ng-if="!searchComplete">
<button ng-click="loadMoreResults()">Ещё результаты</button>
</div>
<div ng-if="searchComplete">
Поиск завершён.
</div>
</div>
</div>
Какой FSM )))
+3
{{ order.type === '2' && order.orderAddress ?
` ${$store.getters['delivery/points'].find(item => item['a:DeliveryShopId']._text === order.orderAddress) && $store.getters['delivery/points'].find(item => item['a:DeliveryShopId']._text === order.orderAddress)['a:StreetLine']._text ? $store.getters['delivery/points'].find(item => item['a:DeliveryShopId']._text === order.orderAddress)['a:StreetLine']._text : ''} ${$store.getters['delivery/points'].find(item => item['a:DeliveryShopId']._text === order.orderAddress) ? $store.getters['delivery/points'].find(item => item['a:DeliveryShopId']._text === order.orderAddress)['a:House']._text : ''}`
:
order.clientAddress
?
` ${$store.getters['delivery/clientAddresses'].find(item => item['a:ClientAddressId']._text === order.clientAddress)['a:SettlementName'] && $store.getters['delivery/clientAddresses'].find(item => item['a:ClientAddressId']._text === order.clientAddress) && $store.getters['delivery/clientAddresses'].find(item => item['a:ClientAddressId']._text === order.clientAddress)['a:SettlementName']._text ? $store.getters['delivery/clientAddresses'].find(item => item['a:ClientAddressId']._text === order.clientAddress)['a:SettlementName']._text + ',' : ''} ${$store.getters['delivery/clientAddresses'].find(item => item['a:ClientAddressId']._text === order.clientAddress)['a:StreetLine']._text} ${$store.getters['delivery/clientAddresses'].find(item => item['a:ClientAddressId']._text === order.clientAddress)['a:House']._text}`
:
'' }}
именно так профессиональные разработчики мобильных приложений получают строку с адресом магазина или пользователя.
+4
value =
(obj instanceof ParameterAlias)
? "@" + ((ParameterAlias) obj).getAlias()
: (obj instanceof Boolean)
? BooleanUtils.toStringTrueFalse((Boolean) obj)
: (obj instanceof UUID)
? obj.toString()
: (obj instanceof byte[])
? EdmBinary.getInstance().toUriLiteral(Hex.encodeHexString((byte[]) obj))
: (obj instanceof Timestamp)
? timestamp((Timestamp) obj)
: (obj instanceof Calendar)
? calendar((Calendar) obj)
: (obj instanceof Duration)
? duration((Duration) obj)
: (obj instanceof BigDecimal)
? EdmDecimal.getInstance().valueToString(obj, null, null,
Constants.DEFAULT_PRECISION, Constants.DEFAULT_SCALE, null)
: (obj instanceof Double)
? EdmDouble.getInstance().valueToString(obj, null, null,
Constants.DEFAULT_PRECISION, Constants.DEFAULT_SCALE, null)
: (obj instanceof Float)
? EdmSingle.getInstance().valueToString(obj, null, null,
Constants.DEFAULT_PRECISION, Constants.DEFAULT_SCALE, null)
: (obj instanceof Long)
? EdmInt64.getInstance().valueToString(obj, null, null,
Constants.DEFAULT_PRECISION, Constants.DEFAULT_SCALE, null)
: (obj instanceof Geospatial)
? Encoder.encode(EdmPrimitiveTypeFactory.getInstance(
((Geospatial) obj).getEdmPrimitiveTypeKind()).
valueToString(obj, null, null,
Constants.DEFAULT_PRECISION,
Constants.DEFAULT_SCALE, null))
: (obj instanceof String)
? quoteString((String) obj, singleQuoteEscape)
: obj.toString();
Петроградская тюрьма
С поворотом лесенки.
Мы с товарищем сидели –
Распевали песенки
+1
> 10,000 Domino Computer (4-bit Full Adder) Remade in Unreal Engine 4
https://www.youtube.com/watch?v=4KTfH1Gyn9g
Надо запилить компилятор из Verilog в домино
+2
/* ../COBYLA2/cobyla2.f -- translated by f2c (version 20100827) */
...
/* Subroutine */ int cobyla_(integer *n, integer *m, doublereal *x,
doublereal *rhobeg, doublereal *rhoend, integer *iprint, integer *
maxfun, doublereal *w, integer *iact)
{
static integer ia, idx, mpp, icon, isim, isigb, idatm, iveta, isimi,
ivsig, iwork;
extern /* Subroutine */ int cobylb_(integer *, integer *, integer *,
doublereal *, doublereal *, doublereal *, integer *, integer *,
doublereal *, doublereal *, doublereal *, doublereal *,
doublereal *, doublereal *, doublereal *, doublereal *,
doublereal *, doublereal *, integer *);
/* Parameter adjustments */
--iact;
--w;
--x;
/* Function Body */
mpp = *m + 2;
icon = 1;
isim = icon + mpp;
isimi = isim + *n * *n + *n;
idatm = isimi + *n * *n;
ia = idatm + *n * mpp + mpp;
ivsig = ia + *m * *n + *n;
iveta = ivsig + *n;
isigb = iveta + *n;
idx = isigb + *n;
iwork = idx + *n;
cobylb_(n, m, &mpp, &x[1], rhobeg, rhoend, iprint, maxfun, &w[icon], &w[
isim], &w[isimi], &w[idatm], &w[ia], &w[ivsig], &w[iveta], &w[
isigb], &w[idx], &w[iwork], &iact[1]);
return 0;
} /* cobyla_ */
...
/* Subroutine */ int cobylb_(integer *n, integer *m, integer *mpp, doublereal
*x, doublereal *rhobeg, doublereal *rhoend, integer *iprint, integer *
maxfun, doublereal *con, doublereal *sim, doublereal *simi,
doublereal *datmat, doublereal *a, doublereal *vsig, doublereal *veta,
doublereal *sigbar, doublereal *dx, doublereal *w, integer *iact)
{
/* Format strings */
static char fmt_10[] = "(/3x,\002The initial value of RHO is\002,1pe13.6"
",2x,\002and PARMU is set to zero.\002)";
static char fmt_50[] = "(/3x,\002Return from subroutine COBYLA because t"
"he \002,\002MAXFUN limit has been reached.\002)";
static char fmt_70[] = "(/3x,\002NFVALS =\002,i5,3x,\002F =\002,1pe13.6,"
"4x,\002MAXCV =\002,1pe13.6/3x,\002X =\002,1pe13.6,1p4e15.6)";
static char fmt_80[] = "(1pe19.6,1p4e15.6)";
static char fmt_210[] = "(/3x,\002Return from subroutine COBYLA because"
" \002,\002rounding errors are becoming damaging.\002)";
static char fmt_410[] = "(/3x,\002Increase in PARMU to\002,1pe13.6)";
static char fmt_580[] = "(/3x,\002Reduction in RHO to\002,1pe13.6,\002 "
"and PARMU =\002,1pe13.6)";
static char fmt_590[] = "(/3x,\002Normal return from subroutine COBYL"
"A\002)";
/* System generated locals */
integer sim_dim1, sim_offset, simi_dim1, simi_offset, datmat_dim1,
datmat_offset, a_dim1, a_offset, i__1, i__2, i__3;
doublereal d__1, d__2;
/* Builtin functions */
integer s_wsfe(cilist *), do_fio(integer *, char *, ftnlen), e_wsfe(void);
double sqrt(doublereal);
/* Local variables */
static doublereal f;
static integer i__, j, k, l, mp, np, iz;
static doublereal phi, rho, sum, beta, cmin, cmax;
static integer ivmc;
static doublereal weta;
static integer ivmd;
static doublereal temp, wsig, gamma;
static integer iflag;
static doublereal alpha, delta, denom, tempa, barmu;
static integer nbest, ifull, iptem, jdrop;
static doublereal ratio, vmold, parmu, error, vmnew;
extern /* Subroutine */ int calcfc_(integer *, integer *, doublereal *,
doublereal *, doublereal *);
static integer ibrnch;
static doublereal edgmax, pareta, prerec, phimin, parsig;
static integer isdirn, nfvals, izdota;
static doublereal cvmaxm, dxsign, prerem;
static integer iptemp;
static doublereal resmax, cvmaxp;
static integer idxnew;
static doublereal resnew, trured;
extern /* Subroutine */ int trstlp_(integer *, integer *, doublereal *,
doublereal *, doublereal *, doublereal *, integer *, integer *,
doublereal *, doublereal *, doublereal *, doublereal *,
doublereal *, doublereal *);
/* Fortran I/O blocks */
static cilist io___22 = { 0, 6, 0, fmt_10, 0 };
static cilist io___29 = { 0, 6, 0, fmt_50, 0 };
static cilist io___33 = { 0, 6, 0, fmt_70, 0 };
static cilist io___34 = { 0, 6, 0, fmt_80, 0 };
static cilist io___39 = { 0, 6, 0, fmt_210, 0 };
Найдено в зависимостях «SlangTNG». Библиотека «COBYLA», автоматически переведённая с «Фортрана».
/* This subroutine minimizes an objective function F(X) subject to M */
/* inequality constraints on X, where X is a vector of variables that has */
/* N components. The algorithm employs linear approximations to the */
/* objective and constraint functions, the approximations being formed by */
/* linear interpolation at N+1 points in the space of the variables. */
https://tng.tuxfamily.org/index.php?title=Main_Page