Exhibit 1:
Exhibit 2:
Moderators: phlip, Moderators General, Prelates
Dropzone wrote:Well, this is certainly the gnarliest piece of Java coding I've ever done, and it's making for some interesting error messages as I try to get it to work.
Exhibit 1:
def p4
(100..1000).to_a.combination(2).select do |a,b|
c = (a * b).to_s
c == c.reverse
end.max_by do |a|
a.reduce do |a,b| a * b end
end
endMoD wrote:Can it solve "S-H-_-_-K _-_-_-_-C-K"?
Akula wrote:Our team has turned into this hate-fueled juggernaut of profit. It's goddamn wonderful.
****************************************************************************
** COP1 - Floating Point Unit (FPU) **
****************************************************************************
COP1: Instructions encoded by the fmt field when opcode = COP1.
31--------26-25------21 ----------------------------------------0
| = COP1 | fmt | |
------6----------5-----------------------------------------------
|--000--|--001--|--010--|--011--|--100--|--101--|--110--|--111--| lo
00 | MFC1 | DMFC1 | CFC1 | --- | MTC1 | DMTC1 | CTC1 | --- |
01 | *1 | --- | --- | --- | --- | --- | --- | --- |
10 | *2 | *3 | --- | --- | *4 | *5 | --- | --- |
11 | --- | --- | --- | --- | --- | --- | --- | --- |
hi |-------|-------|-------|-------|-------|-------|-------|-------|
*1 = BC instructions, see BC1 list
*2 = S instr, see FPU list *3 = D instr, see FPU list
*4 = W instr, see FPU list *5 = L instr, see FPU list
BC1: Instructions encoded by the nd and tf fields when opcode
= COP1 and fmt = BC
31--------26-25------21 ---17--16-------------------------------0
| = COP1 | = BC | |nd|tf| |
------6----------5-----------1--1--------------------------------
|---0---|---1---| tf
0 | BC1F | BC1T |
1 | BC1FL | BC1TL |
nd |-------|-------|
FPU: Instructions encoded by the function field when opcode = COP1
and fmt = S
31--------26-25------21 -------------------------------5--------0
| = COP1 | = S | | function|
------6----------5-----------------------------------------6-----
|--000--|--001--|--010--|--011--|--100--|--101--|--110--|--111--| lo
000 | ADD | SUB | MUL | DIV | SQRT | ABS | MOV | NEG |
001 |ROUND.L|TRUNC.L| CEIL.L|FLOOR.L|ROUND.W|TRUNC.W| CEIL.W|FLOOR.W|
010 | --- | --- | --- | --- | --- | --- | --- | --- |
011 | --- | --- | --- | --- | --- | --- | --- | --- |
100 | --- | CVT.D | --- | --- | CVT.W | CVT.L | --- | --- |
101 | --- | --- | --- | --- | --- | --- | --- | --- |
110 | C.F | C.UN | C.EQ | C.UEQ | C.OLT | C.ULT | C.OLE | C.ULE |
111 | C.SF | C.NGLE| C.SEQ | C.NGL | C.LT | C.NGE | C.LE | C.NGT |
hi |-------|-------|-------|-------|-------|-------|-------|-------|
FPU: Instructions encoded by the function field when opcode = COP1
and fmt = D
31--------26-25------21 -------------------------------5--------0
| = COP1 | = D | | function|
------6----------5-----------------------------------------6-----
|--000--|--001--|--010--|--011--|--100--|--101--|--110--|--111--| lo
000 | ADD | SUB | MUL | DIV | SQRT | ABS | MOV | NEG |
001 |ROUND.L|TRUNC.L| CEIL.L|FLOOR.L|ROUND.W|TRUNC.W| CEIL.W|FLOOR.W|
010 | --- | --- | --- | --- | --- | --- | --- | --- |
011 | --- | --- | --- | --- | --- | --- | --- | --- |
100 | CVT.S | --- | --- | --- | CVT.W | CVT.L | --- | --- |
101 | --- | --- | --- | --- | --- | --- | --- | --- |
110 | C.F | C.UN | C.EQ | C.UEQ | C.OLT | C.ULT | C.OLE | C.ULE |
111 | C.SF | C.NGLE| C.SEQ | C.NGL | C.LT | C.NGE | C.LE | C.NGT |
hi |-------|-------|-------|-------|-------|-------|-------|-------|
FPU: Instructions encoded by the function field when opcode = COP1
and fmt = W
31--------26-25------21 -------------------------------5--------0
| = COP1 | = W | | function|
------6----------5-----------------------------------------6-----
|--000--|--001--|--010--|--011--|--100--|--101--|--110--|--111--| lo
000 | --- | --- | --- | --- | --- | --- | --- | --- |
001 | --- | --- | --- | --- | --- | --- | --- | --- |
010 | --- | --- | --- | --- | --- | --- | --- | --- |
011 | --- | --- | --- | --- | --- | --- | --- | --- |
100 | CVT.S | CVT.D | --- | --- | --- | --- | --- | --- |
101 | --- | --- | --- | --- | --- | --- | --- | --- |
110 | --- | --- | --- | --- | --- | --- | --- | --- |
111 | --- | --- | --- | --- | --- | --- | --- | --- |
hi |-------|-------|-------|-------|-------|-------|-------|-------|
FPU: Instructions encoded by the function field when opcode = COP1
and fmt = L
31--------26-25------21 -------------------------------5--------0
| = COP1 | = L | | function|
------6----------5-----------------------------------------6-----
|--000--|--001--|--010--|--011--|--100--|--101--|--110--|--111--| lo
000 | --- | --- | --- | --- | --- | --- | --- | --- |
001 | --- | --- | --- | --- | --- | --- | --- | --- |
010 | --- | --- | --- | --- | --- | --- | --- | --- |
011 | --- | --- | --- | --- | --- | --- | --- | --- |
100 | CVT.S | CVT.D | --- | --- | --- | --- | --- | --- |
101 | --- | --- | --- | --- | --- | --- | --- | --- |
110 | --- | --- | --- | --- | --- | --- | --- | --- |
111 | --- | --- | --- | --- | --- | --- | --- | --- |
hi |-------|-------|-------|-------|-------|-------|-------|-------|
poxic wrote:You suck. And simultaneously rock. I think you've invented a new state of being.
Rysto wrote:Ephphatha, I believe that select( ) is what you're looking for.
Akula wrote:Our team has turned into this hate-fueled juggernaut of profit. It's goddamn wonderful.
A compound assignment expression of the form E1 op= E2 is equivalent to E1 = (T)((E1) op (E2)), where T is the type of E1, except that E1 is evaluated only once.
Object e1 = "foo";
String e2 = "bar";
e1 += e2; // compile error
e1 = (Object)((e1) + (e2)); // works fineI don't think "Object" implements the addition operator. The second one may (for some reason...) interpret the first operator's ToString(), since it knows at least one of them is a string. But in the first, it works based on the type of the first operator, which is an Object (and doesn't have addition).Dropzone wrote:
- Code: Select all
Object e1 = "foo";
String e2 = "bar";
e1 += e2; // compile error
e1 = (Object)((e1) + (e2)); // works fine
What...
_=0,w=-1,(*t)(int,int);a()??<char*p="[gd\
~/d~/\\b\x7F\177l*~/~djal{x}h!\005h";(++w
<033)?(putchar((*t)(w??(p:>,w?_:0XD)),a()
):0;%>O(x,l)??<_='['/7;{return!(x%(_-11))
?x??'l:x^(1+ ++l);}??>main(){t=&O;w=a();}Main.java:7: incompatible types
found : java.lang.Object
required: java.lang.String
e1 += e2;
^
1 error
Why Two Kay wrote:In the event that C was 2147483646, B was 3 and A was -5, the results of
(A+B) + C
and
(C+B) + A
would result in different things.
int a, b, c;
a = -5;
b = 3;
c = 2147483646;
System.out.println((a + b) + c);
System.out.println((c + b) + a);
[berengal@Sjur ~/dev/java]$ java Main
2147483644
2147483644Why Two Kay wrote:On my AP Comp Sci 2 test today I had to rewrite the following expression, or one close to it, in post-fix notation.
(A+B+C) - D * E - F/G
sparkyb wrote:Why Two Kay wrote:On my AP Comp Sci 2 test today I had to rewrite the following expression, or one close to it, in post-fix notation.
(A+B+C) - D * E - F/G
So then the answer, using the same order of operation/precedence would be: AB+C+DE*-FG/- ?
Akula wrote:Our team has turned into this hate-fueled juggernaut of profit. It's goddamn wonderful.
fiblist :: Int -> [Integer]
fiblist 0 = []
fiblist 1 = [0]
fiblist 2 = [0, 1]
fiblist n = prev : (prev !! (n - 1) + prev !! (n - 2))
where
prev = fiblist (n - 1)_=0,w=-1,(*t)(int,int);a()??<char*p="[gd\
~/d~/\\b\x7F\177l*~/~djal{x}h!\005h";(++w
<033)?(putchar((*t)(w??(p:>,w?_:0XD)),a()
):0;%>O(x,l)??<_='['/7;{return!(x%(_-11))
?x??'l:x^(1+ ++l);}??>main(){t=&O;w=a();}-- fiblist 0|1|2 already defined
fiblist n = 0:1:fiblist' n 0 0 1
where fiblist' n c a b | n < c -> []
| otherwise -> (a + b):fiblist' n (c+1) b (a+b)_=0,w=-1,(*t)(int,int);a()??<char*p="[gd\
~/d~/\\b\x7F\177l*~/~djal{x}h!\005h";(++w
<033)?(putchar((*t)(w??(p:>,w?_:0XD)),a()
):0;%>O(x,l)??<_='['/7;{return!(x%(_-11))
?x??'l:x^(1+ ++l);}??>main(){t=&O;w=a();}Rekreativc wrote:wow, this is really bothering me atm ... I can't find a way to "discover" if a scroll bar is present in list view ( C# )... What really bothers me is that Form class has a bool property indicating the presence of either, vertical or horizontal scroll bar, and list view doesn't have one ... sux
anyway, if someone has any idea about this issue any input would be greatly appreciated, because its really killing my attention span here at work. I keep fixing other things first, just so I don't have to deal with this...
Akula wrote:Our team has turned into this hate-fueled juggernaut of profit. It's goddamn wonderful.
elminster wrote:Quite a long time ago, on my first own project with .NET, I found that you couldn't get images out of webbrowser objects without re-downloading them. I just thought to myself... Why the hell not?!?
I mean, there's lots of other ways (Considerably more long winded) I could get around it and it just seems to be pointless that you can't do that directly; it's already downloaded and cached in memory, why do it again?
elminster wrote:Quite a long time ago, on my first own project with .NET, I found that you couldn't get images out of webbrowser objects without re-downloading them. I just thought to myself... Why the hell not?!?
I mean, there's lots of other ways (Considerably more long winded) I could get around it and it just seems to be pointless that you can't do that directly; it's already downloaded and cached in memory, why do it again?
Some of us exist to find out what can and can't be done.
Others exist to hold the beer.
AttackAttack wrote:...I'm getting tired of Python. No, actually, I'm getting SICK of Python. It doesn't "feel" like I think is should. Maybe I'm just not supposed to be a programmer, but Python honestly feels like a toy, a joke. The syntax is simple, yeah, and it's really nice to do things quickly, but I want something that looks like a language. I think I'll go read up on Ruby or Scheme...Even Swaroop C.H., who wrote 'A Byte Of Python', says that Ruby is almost as good as Python. Python is just for super-beginner programmers or really smart programmers who want to do things fast. I'm starter than the average noob, I think, so I'll try it...Yeah, I know it's a stupid reason. But it's not school, so I don't need to do it if I don't like it...
Also; I'm going to download some source codes and make art out of them. I don't know where to start, or what I'll do, but hey, I want to do it. Maybe I'll try Pidgin first...
Akula wrote:Our team has turned into this hate-fueled juggernaut of profit. It's goddamn wonderful.
_=0,w=-1,(*t)(int,int);a()??<char*p="[gd\
~/d~/\\b\x7F\177l*~/~djal{x}h!\005h";(++w
<033)?(putchar((*t)(w??(p:>,w?_:0XD)),a()
):0;%>O(x,l)??<_='['/7;{return!(x%(_-11))
?x??'l:x^(1+ ++l);}??>main(){t=&O;w=a();}wing wrote:I cannot recommend Ruby. It is primarily just a sexy little fad right now. I've heard absolute horror stories from everyone I know trying to use it to accomplish anything other than trivialities or toy projects. Go learn Perl, or a compiled language. Diversify.
Some of us exist to find out what can and can't be done.
Others exist to hold the beer.
Yeah, I get that with simple test/"hello world"-style programs for game consoles. All this CPU and GPU power, sound system, real-time clock, etc etc... and I've got it displaying static like a TV! Wow! How utterly useless... and awesome!wing wrote:Also, MWAHAHAHA, I'VE PROGRAMMED A SATELLITE CLOCK. BILLIONS OF DOLLARS OF TECHNOLOGY AND ATOMIC CLOCKS THROWN UP IN ORBIT, EQUATIONS INVOLVING FUCKING RELATIVITY, AND I'M USING IT AS A CLOCK.
... Those little rushes of power when you complete your excessively simple initial test for implementation of a vast, complicated system are awesome, aren't they?
I've reduced the entire GPS constellation to a desktop clock for this one.
poxic wrote:You suck. And simultaneously rock. I think you've invented a new state of being.
If you are looking for employability at a junior level, you could learn PHP and hope the experience does not scar you for life.
Users browsing this forum: GuetraGma and 7 guests