Fun Stuff > CLIKC
A programming thread!
cesium133:
Oh God, UML.
I just had a bad flashback to college, before I dropped my CS major.
celticgeek:
--- Quote from: snalin on 26 May 2014, 16:25 ---But the fucking standard is just such unhelpful pile of shit
--- End quote ---
You are being FAR TOO KIND to UML.
ankhtahr:
Yeah, this exercise sheet has four tasks which are basically "Here you have a text, make a UML Diagram from it". The texts are extremely underspecified, and as I'm a perfectionist and want to do things the right way it just stops me from getting anywhere with these tasks. So far I finished one of these four. Sidenote: the four tasks give 5 points each, and the programming task, which will take me a few hours as well, gives 13 points…
And as I didn't get too many points in the last exercise sheet I need those points…
(the last exercise sheet had UML too, and my diagram had far too few classes for these object orientation extremists. Apparently they believe that the more classes you have, the better it is. I had about four. They wanted eleven.)
Masterpiece:
So.
I'm learing JavaFX.
I'm writing a UI with two labels whose CSS text-fill attribute I want to turn from grey to white when I hover over them with a mouse.
It's basically album title and song title for a music player I'm writing.
They are on a black background, and I want them to be grey when unneeded, so the album cover in the middle pops more.
And when I mouse over the info, I want them to turn white, so you can see them better.
At first, I tried using the :hover modifier class in my CSS, but quickly noticed that that would only work on one label, not both at the same time.
So I removed the :hover property, and added a style in runtime during every "mouseEntered" and "mouseExited" event.
Then I wanted transitions between the two states.
I wanted to use Keyframe animation, since I'm used to keyframing from AfterEffects.
I thought I could bind a SimpleStringProperty to the StyleProperties of the labels and wrote the style attributes into the SimpleStringProperty.
That wouldn't create transitions though, it would just blip from one state to another at the relevant keyframe.
I was getting annoyed.
SO. Instead, I didn't change the SimpleStringProperty value during the keyframe animation, but I changed a SimpleObjectProperty<Color> object.
I added a change listener to that Object, that fired a method that would change the SimpleStringProperty which contained my styling.
The styling was still bound to the StyleProperty of the labels.
EUREKA! Working transitions.
...that broke if I fired them again before the previous animation finished.
Since I had a "fadeIn" and a "fadeOut" animation, firing the fadeIn before the fadeOut ended broke fadeIn and vice versa.
So I wrote a while-loop that waited for the fadeIn animation to finish before fadeOut could play.
That created a while-loop that would never finish, freezing the application.
The Timeline-Animation API revealed that the animations had a "setDelay", a "getCycleDuration" and a "getCurrentTime" -method.
Through these, I could see how much time was remaining in one animation, and could set that as the animation delay on the other.
FadeOut would now wait until fadeIn was finished.
That made sense, since fadeOut would wait five seconds and then turn the labels gray again.
FadeIn should work instantly, so I told it to stop whatever fadeOut was doing and play fadeIn immediately.
...and now it works! Yay!
This is how I program, everybody!
Sorflakne:
This post technically isn't programming-related, but it relates to program testing :P
So I set up a Filezilla server and client on my computer to test php with, but after loading up the necessary files, to include a html, php, css and jpg, to the client directory, I open the html file up, and it's just a raw webpage; the css rules aren't being applied and the image is a broken link. When I enter some data and tell it to run (it's basically an email form), I get taken to a 'server not found' page. Php is installed for the browser and all the files are in the same directory, but not sure what I'm missing when trying to open it from Filezilla.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version