« first day (1792 days earlier)      last day (3373 days later) » 

00:02
We know since the array is sorted and distinct that if we can determine whether the midpoint index (8/2 = 4) is greater than, equal too, or less than it's value we can focus on only the one half of the array
We check index 3 (4-1 because the array is assumed to be starting at 1) to see if it's equal to 4
A[3] = 1 < 4, so we know we can discard the bottom half of the array and only focus on the larger half
So we'll recursively call the algorithm with the new array [4, 6, 9, 14] but in doing this, we lose the index assignment of the original array.. if that makes sense
Originally we had A = [-7, -3, 0, 1, 4, 6, 9, 14]. There is an i that satisifies A[i] = i, it's 6.
I know an array cannot be created inside a loop, but can you initialize it and then specify the size inside the loop? Such as:
Person[] people = null;
while(true){
people = new Person[size];
}
But with our new array [4, 6, 9, 14] there will never be an i that satisfies the equation.
What am I missing here?
00:18
@Tanner I think you want the array created before entering the loop. I'm not sure if you can or not, but I believe if that line is run more than once that might cause problems.
@Tanner This is why we can't have nice things.
@PaulVargas A more important question: What is wrong with that whale's back?
 
2 hours later…
02:54
4 messages moved to bin
 
4 hours later…
 
2 hours later…
08:47
Hey. So I have to have an array of Events of Different sizes (Classes and Objects) like below.

Event[] September = new Event[30];
Event[] October = new Event[31];
Is it possible to produce an output like this

class Event
{
private String TimeofEvent;
private String startingTime;
private int priority;

public Event(String TimeofEvent, String startingTime, int priority)
{

this.TimeofEvent = TimeofEvent;
this.startingTime = startingTime;
this.priority = (int)(Math.random() *3) + 1;
}

public String toString()
Sun Mon Tue Wed Thu Fri Sat
1 2* 3 4 5 6
7 8 9 10 11* 12* 13
14* 15* 16* 17 18 19* 20
21 22 23 24 25* 26* 27
28* 29 30
09:16
Sure it's possible. Hard coding array sizes is not a good idea however, as the number of days is not constant (leap years). Though I guess this is more of an exercise than real code since it can't do more than one event per day. For iterating the days, use the appropriate calendar API (see these answers for example)
@kihe
@kiheru would you be able to help me with some JavaFX?
@cp101020304 Sorry, I haven't used that yet. It's best just to state the question in case someone who can answer happens to be present and reads it
I'm trying to continually rewind a video in MediaPlayer until a button is pressed. However the seek() method only changes back to an earlier time once. Is there any way for me to continually keep rewinding, until a particular button is pressed?
Ah this is just a simple exercise. I just need to create 2 array of events which is September and October. If its all year round. Then hard coding will be a bad idea
was wondering if you can help me to create an output such as that?
 
2 hours later…
11:32
:I
 
2 hours later…
13:23
Morning, Java!
@OakBot?
@Michael Type /help to see all my commands.
14:15
Recursive functions make me brain hurt
fge
fge
14:34
The language I have to parse makes my brain melt
I heard that brain melting is bad for your health.
14:50
@TAsk enjoyed this! nice
Off to lunch. Bye Java!
Bye! Don't eat too much :D
cos; more coffee is yet to drink!
fge
fge
15:07
Seen in the analysis of the language I parse using Sonar: "Method has too many arguments (56 > 10)
56 arguments to a method?? What the...
10 is already bad enough
But 56?
usually I'd say 5 call for a deepgoing refactoring..
fge
fge
15:23
@Vogel612 my thought exactly; but the client wanted 10 so that's 10
(well, the check is configurable)
16:20
Only 56?
fge
fge
16:46
Yes, "only"
The language is crap to begin with but the code of this project far outweighs the crappiness of the language
17:22
Ouch 10 args is a lot, 56 is death
fge
fge
@TalenKylon if the problems were only limited to this that would only be a major inconvenience, but no, there is more :p
^^^ sample
And I see this nearly everywhere
18:15
@fge
Ouch, sucks that youre spending your saturday doing that. What is it exactly that you are doing?
fge, if I did that with my company's code
I think it would explode
Aren't most companies' code exploding in that case? ;P
ewww, those are some scary metrics
Probably haha
fge
fge
18:55
@TalenKylon a SonarQube plugin for a language which didn't have such a plugin to start with
As to today being Saturday, I work only by choice -- I just can't stop working
 
1 hour later…
ASR
ASR
19:59
@fge hi
you know spring mvc?
fge
fge
No
I avoid Spring
I flee from Spring
ASR
ASR
ok

« first day (1792 days earlier)      last day (3373 days later) »