- 1
$listing_split_query = $listing_split_query_pieces[0]." and p.products_sort_order >= $last_sort and p.products_sort_order < $listing_split_limit order by".$listing_split_query_pieces[1]; // crazy hack for cool sort, sorry ;)
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+142
$listing_split_query = $listing_split_query_pieces[0]." and p.products_sort_order >= $last_sort and p.products_sort_order < $listing_split_limit order by".$listing_split_query_pieces[1]; // crazy hack for cool sort, sorry ;)
+144
<a href="javascript:redirect('http://apex.oracle.com/doc41');" title="Click here to learn how to get started" style="text-align:center;font-size:10px;display:block;margin:2px;">Click here to learn how to get started</a>
<script>function redirect(a){location.href=a;return}</script>
Oracle APEX божественен!
+147
private String getNewRowKey() {
Hashtable<String, String> dataFields = new Hashtable<String, String>();
dataFields.put(TCommandConstants.TRANSITIONS_MARKET, Utils.convertMarketFrom("RUS",marketCB.getSelectedItem().toString()));
dataFields.put( TCommandConstants.TRANSITIONS_INITIAL_STATUS, initialStatusCB.getSelectedItem().toString());
dataFields.put( TCommandConstants.TRANSITIONS_TRANS_RULE, transitionRuleCB.getSelectedItem().toString());
dataFields.put(TCommandConstants.TRANSITIONS_TARGET_STATUS, targetStatusCB.getSelectedItem().toString());
return dataFields.get(TCommandConstants.TRANSITIONS_INITIAL_STATUS) + BPGraph.EMPTY_ITEM + dataFields.get(TCommandConstants.TRANSITIONS_TRANS_RULE) + BPGraph.EMPTY_ITEM + dataFields.get(TCommandConstants.TRANSITIONS_TARGET_STATUS);
}
+142
#include <inttypes.h>
#include <stdio.h>
typedef union
{
struct
{
#define BITG(n) uint8_t bit##n : 1
BITG(0);
BITG(1);
BITG(2);
BITG(3);
BITG(4);
BITG(5);
BITG(6);
BITG(7);
#undef BITG
} bits;
uint8_t value;
}getbit;
uint8_t bit_sum(uint8_t, uint8_t);
uint8_t bit_sum(uint8_t a, uint8_t b)
{
getbit op1, op2, opr;
uint8_t carry;
op1.value=a; op2.value=b;
#define OP1(n) op1.bits.bit##n
#define OP2(n) op2.bits.bit##n
#define OPR(n) opr.bits.bit##n
#define XOR(a,b) ((a)^(b))
#define AND(a,b) ((a)&(b))
OPR(0) = XOR(OP1(0), OP2(0));
carry = AND(OP1(0), OP2(0));
#define SETBIT(n) \
OPR(n) = XOR \
( \
carry, \
XOR(OP1(n), OP2(n)) \
);
#define CARRYBIT(n) \
carry = XOR \
( \
AND(OP1(n), OP2(n)), \
AND \
( \
XOR(OP1(n), OP2(n)), \
carry \
) \
);
SETBIT(1);
CARRYBIT(1);
SETBIT(2);
CARRYBIT(2);
SETBIT(3);
CARRYBIT(3);
SETBIT(4);
CARRYBIT(4);
SETBIT(5);
CARRYBIT(5);
SETBIT(6);
CARRYBIT(6);
SETBIT(7);
return opr.value;
#undef SETBIT
#undef CARRYBIT
#undef OP1
#undef OP2
#undef OPR
#undef XOR
#undef AND
}
int main (int argc, char *argv[], char *envp[])
{
uint8_t a, b, c;
scanf ("%"SCNu8"%"SCNu8, &a, &b);
c = bit_sum(a,b);
printf("%"PRIu8"\n", c);
return 0;
}
Побитовое сложение двух 8-битных чисел по схеме двоичного сумматора
+142
echo (yaml_parse_file('schema.yaml')['Article']['fields']['title']);
+105
x = x + exp(ln(2)*i);
Встретил в коде опроса датчика, не сразу понял, что это делает.
Когда понял, понял что лучше бы не понимал.
+143
http://luck.subarctic.org/?gclid=CIbj18GRhcUCFaLUcgodJ5UAOg
+143
http://habrahabr.ru/company/neuronspace/blog/254671/
Захотелось поделится с сообществом.
+142
#include <iostream>
#include <iomanip>
#include <vector>
using namespace std;
int possition[65535] = {0};
int sum[65535] = {0};
int main() {
int i=0;
int j=0;
int N;
cin >> N;
for(i=0; i<N; i++)
cin >> possition[i];
for(i=0; i<N; i++){
for(j=0; j<possition[i]; j++){
if(sum[i]<=possition[i]-j){
sum[i]+=j;}
}
if(possition[i]-sum[i]==1)
cout<<1<<" ";
else cout<<0<<" ";
}
return 0;
}
Забавное это дело - листать новые пасты на pastebin'е.
+143
if (($logons_result > 0) && ($logons_result < 2)) {
шаманство