These are chat archives for anderspitman/dice-game

13th
Apr 2016
Nguyen Dao
@ngdao
Apr 13 2016 04:59
@anderspitman I got the GUI build without using NetBeans and using the new RollResult class. All it need is the java (DiceGame, RollResult...) and the picture files. I'm doing it by putting them all in the same package. I notice you're using [import dice.*] for the gradle build. So i'll make a PR to add the java source and the picture files to your RP and you can make changes from there?
Nguyen Dao
@ngdao
Apr 13 2016 05:05
PR-ed
Anders Pitman
@anderspitman
Apr 13 2016 05:16
@hehe876 great work! It looks like the reason your PR is failing is due to some Java 8 syntax. I see 2 solutions:
  1. If there's a way you can force it to use Java 7 (did you do that before?) I think that would be ideal
  2. We can tell Travis to use Java 8. If you want to try that, use these instructions
Anders Pitman
@anderspitman
Apr 13 2016 05:23
Actually it might be something else. I'm trying to build it locally now. I think we're really close
What command are you using to build it?
Nguyen Dao
@ngdao
Apr 13 2016 05:26
i used jgrasp... lol
Anders Pitman
@anderspitman
Apr 13 2016 05:26
k
Anders Pitman
@anderspitman
Apr 13 2016 05:40
Ok really close. I got gradle to build with Java 8. You have some compilation bugs though. Your branch still isn't using the latest shared code
For example on your PR it's trying to call getLastRoll but it doesn't exist in shared
Nguyen Dao
@ngdao
Apr 13 2016 05:51
hmm, i thought i replaced all the getLastRoll, let me check
Anders Pitman
@anderspitman
Apr 13 2016 05:52
I guess I'm not sure how you're able to build it?
you must be doing some dark magic
Nguyen Dao
@ngdao
Apr 13 2016 05:55
lol, the wrong file got to my repo
Nguyen Dao
@ngdao
Apr 13 2016 06:00
Have another try @anderspitman
Anders Pitman
@anderspitman
Apr 13 2016 06:02
You still don't have the latest master included
are you copying the files by hand?
I'm confused what you workflow is right now
your**
Nguyen Dao
@ngdao
Apr 13 2016 06:03
I say the only difference from yours and my is the new file
?
oh wow
what the heck
my master is up to date but my GUI branch is not
Anders Pitman
@anderspitman
Apr 13 2016 06:05
It's like when you build it on your machine it's not actually using the repo
o
yeah
you'll need to do a merge
git merge master
there might be some conflicts that you'll have to fix. It can seem intimidating at first, but it's usually not too bad
Nguyen Dao
@ngdao
Apr 13 2016 06:06
error: Your local changes to the following files would be overwritten by merge:
gui/src/main/java/DiceGameGUI2.java
Please, commit your changes or stash them before you can merge.
how do I fix it then?
Anders Pitman
@anderspitman
Apr 13 2016 06:07
show me the output of git status
Nguyen Dao
@ngdao
Apr 13 2016 06:09
warning: LF will be replaced by CRLF in gui/src/main/java/DiceGameGUI2.java.
The file will have its original line endings in your working directory.
On branch GUI
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
    modified:   gui/src/main/java/DiceGameGUI2.java
Anders Pitman
@anderspitman
Apr 13 2016 06:13
sorry internet is flaky
basically you have changes to DiceGameGUI2.java that haven't been committed yet
you can do git diff to see what they are
Nguyen Dao
@ngdao
Apr 13 2016 06:16
yep
working on it
we can do this man
lol
Anders Pitman
@anderspitman
Apr 13 2016 06:16
don't worry
you've already done the hard work
Nguyen Dao
@ngdao
Apr 13 2016 06:19
alright, checked b4 PR, looks fine, here we go
Anders Pitman
@anderspitman
Apr 13 2016 06:20
looks like you've got some merge stuff in there
take a look at the top of the file
Nguyen Dao
@ngdao
Apr 13 2016 06:21
do I need to remove it?
Anders Pitman
@anderspitman
Apr 13 2016 06:22
part of it. Basically it's show you the 2 different version and saying it's not sure what it's supposed to keep. So look at those lines of code and manually merge them to be correct
Still confused about your workflow though. If you tried to build that locally it should have failed miserably
Are you sure you're building that file?
Nguyen Dao
@ngdao
Apr 13 2016 06:27
What I did is I coppied all the file from shared to the folder that I have my GUI source code (same package)
compiled the GUI code and run it fine
so I guessed the only difference is instead of being in the same package
it just import from dice.* if it is being built by gradle?
Anders Pitman
@anderspitman
Apr 13 2016 06:32
thing is though there's no way what's in the PR is the same thing you're building locally
there's a disconnect somewhere
<<<<<<< HEAD
 +
 +
 +import javax.swing.*;
 +import java.util.*;
 +import dice.*;
 +=======
 +
 +import javax.swing.*;
 +import java.util.*;
 +import dice*;
 +>>>>>>> d0ad09b140e305206dfa7f552b0dbaa41a704811
 +/**
 + *
Nguyen Dao
@ngdao
Apr 13 2016 06:33
yeah
Anders Pitman
@anderspitman
Apr 13 2016 06:33
it's impossible for that to compile
Nguyen Dao
@ngdao
Apr 13 2016 06:33
about that part
that happened after I merge
so do I just remove one of them?
Anders Pitman
@anderspitman
Apr 13 2016 06:33
yeah
Nguyen Dao
@ngdao
Apr 13 2016 06:33
they are the same!
Anders Pitman
@anderspitman
Apr 13 2016 06:33
not quite
typo in the bottom one
dice*;
Nguyen Dao
@ngdao
Apr 13 2016 06:34
ah
so if I delete it, then save
then what do I do after that?
Anders Pitman
@anderspitman
Apr 13 2016 06:34
you need to build it locally
make sure there aren't any other merge breaks
Nguyen Dao
@ngdao
Apr 13 2016 06:35
kay
OMG
A GREEN TICK!
lol
Anders Pitman
@anderspitman
Apr 13 2016 06:41
nailed it
hm. still can't run it locally (AWT exception), but having it compile is a huge step in the right direction
Nguyen Dao
@ngdao
Apr 13 2016 06:43
run it locally?
Anders Pitman
@anderspitman
Apr 13 2016 06:43
yeah like ./gradlew :gui:run
Nguyen Dao
@ngdao
Apr 13 2016 06:44
might have to remove the main class?
Anders Pitman
@anderspitman
Apr 13 2016 06:45
don't think that's it. I changed it to point to DiceGameGUI2
hm the jar doesn't work either
Nguyen Dao
@ngdao
Apr 13 2016 06:46
where is the error? Is it all over the place?
Anders Pitman
@anderspitman
Apr 13 2016 06:47
no just one
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
    at javax.swing.ImageIcon.<init>(ImageIcon.java:217)
    at DiceGameGUI2.initComponents(DiceGameGUI2.java:104)
    at DiceGameGUI2.<init>(DiceGameGUI2.java:20)
    at DiceGameGUI2$5.run(DiceGameGUI2.java:293)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
    at java.awt.EventQueue.access$500(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.awt.EventQueue$3.run(EventQueue.java:703)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
same as a few days ago
I think maybe it can't find the images at runtime
Nguyen Dao
@ngdao
Apr 13 2016 06:47
okay
Anders Pitman
@anderspitman
Apr 13 2016 06:48
ah yeah
Nguyen Dao
@ngdao
Apr 13 2016 06:48
what gitter command do you use for code snippet
Anders Pitman
@anderspitman
Apr 13 2016 06:48
look at line 104
three backticks. it's the key to the left of 1
if you look at line 104 and a few more near by, you're trying to pull the resources in from a place that doesn't exist
Nguyen Dao
@ngdao
Apr 13 2016 06:49
alright, I think I know how to fix it
banana
Anders Pitman
@anderspitman
Apr 13 2016 06:50
you only need 1 backtick if it's all on the same line and you don't need highlighting
I think you just need to move the gifs into the proper resources folder (probably have to make it first)
Nguyen Dao
@ngdao
Apr 13 2016 06:53
there you go
Anders Pitman
@anderspitman
Apr 13 2016 06:54
no dice
literally
Nguyen Dao
@ngdao
Apr 13 2016 06:55
at least it run?
Anders Pitman
@anderspitman
Apr 13 2016 06:55
nope
Nguyen Dao
@ngdao
Apr 13 2016 06:55
oh
lol
Anders Pitman
@anderspitman
Apr 13 2016 06:55
hang on
let me play with it
Nguyen Dao
@ngdao
Apr 13 2016 06:55
same error?
Anders Pitman
@anderspitman
Apr 13 2016 06:56
yeah
Nguyen Dao
@ngdao
Apr 13 2016 07:03
try `/gui/src/main/java/<file name>
Anders Pitman
@anderspitman
Apr 13 2016 07:03
yeah that works
Nguyen Dao
@ngdao
Apr 13 2016 07:03
yeah?
Anders Pitman
@anderspitman
Apr 13 2016 07:03
it also works if you remove the loader
and just do the filename
but I'm still fixing them all
got it
Nguyen Dao
@ngdao
Apr 13 2016 07:04
and?
and???
haha
Anders Pitman
@anderspitman
Apr 13 2016 07:04
ok it's running but no dice
just literally this time
not figuratively
ah ok I get it
remove the class loader fixes the exception, but just using the filename isn't actually working
hang on a minute
gui/src/main isn't working
Nguyen Dao
@ngdao
Apr 13 2016 07:08
does it give numbers?
Anders Pitman
@anderspitman
Apr 13 2016 07:08
eh?
Nguyen Dao
@ngdao
Apr 13 2016 07:10
you said it run, does it mean there's buttons and stuff, just not the picture?
Anders Pitman
@anderspitman
Apr 13 2016 07:10
yeah
exactly
Nguyen Dao
@ngdao
Apr 13 2016 07:11
so if you press the button, does it still work with the number?
Anders Pitman
@anderspitman
Apr 13 2016 07:13
ok got it
Nguyen Dao
@ngdao
Apr 13 2016 07:14
really?
Anders Pitman
@anderspitman
Apr 13 2016 07:14
beautiful; even the jar's working. man I love gradle
yeah
Nguyen Dao
@ngdao
Apr 13 2016 07:14
wooooo
Anders Pitman
@anderspitman
Apr 13 2016 07:14
here's all you need to do
Nguyen Dao
@ngdao
Apr 13 2016 07:14
what did you do with the path?
Anders Pitman
@anderspitman
Apr 13 2016 07:14
create the folder gui/src/main/resources
move all the images in there
Nguyen Dao
@ngdao
Apr 13 2016 07:14
ok, listening
Anders Pitman
@anderspitman
Apr 13 2016 07:14
in the java file just use the filename
that makes it use the standard gradle settings
however you'll need to confirm that it still works with your setup
Nguyen Dao
@ngdao
Apr 13 2016 07:16
if you update your master
i'll pull from it
and I can start working from there
Anders Pitman
@anderspitman
Apr 13 2016 07:16
well
we can't do that until we merge
but that's ok
hm...
actually it would be better if you did it locally
actually it depends on your workflow. if you wanted to add some features right now, what would you need to do?
Nguyen Dao
@ngdao
Apr 13 2016 07:19
basically there is only 2 changes, the import and the file path for the image
the rest is the same with NetBeans
Anders Pitman
@anderspitman
Apr 13 2016 07:19
k
Nguyen Dao
@ngdao
Apr 13 2016 07:19
so I can generate the additional components then change a bit then commit it to gradle
Anders Pitman
@anderspitman
Apr 13 2016 07:19
do you think there's any way we can change gradle to match netbeans?
or the other way around?
Nguyen Dao
@ngdao
Apr 13 2016 07:20
I can try to change netbeans to work like gradle
haha
Anders Pitman
@anderspitman
Apr 13 2016 07:20
gradle is pretty flexible
we don't have to do that now. it doesn't sound too bad to work with for the moment, right?
Nguyen Dao
@ngdao
Apr 13 2016 07:21
yeah
Anders Pitman
@anderspitman
Apr 13 2016 07:22
k. if you don't mind moving the images I think we're almost done
there is one thing to watch out for
it's best to use git mv for the images
otherwise you'll have to re-add them to git
which might bloat our repo just a bit
Nguyen Dao
@ngdao
Apr 13 2016 07:26
ok
Anders Pitman
@anderspitman
Apr 13 2016 07:43
k I'm headed to bed
good work. we've pretty much figured out everything we need to do to integrate it
oh one other thing. if it's not too much trouble can you rename the file to DiceGameGUI.java without the "2"?
Nguyen Dao
@ngdao
Apr 13 2016 07:45
Yeah i had some issue with the name in netbean. Was a hack fix. Will change
Anders Pitman
@anderspitman
Apr 13 2016 07:51
the more I think about it I could just move the images and do a PR on master like you suggested
it would be really quick
then at least we know gradle is working, and you can see if it works on netbeans
anyway, we can figure it out tomorrow
night!
Nguyen Dao
@ngdao
Apr 13 2016 07:56
Night!
Anders Pitman
@anderspitman
Apr 13 2016 15:28
Got our points back
Nguyen Dao
@ngdao
Apr 13 2016 15:29
Sweet!
We got all of them back!
Christiaan Schmid
@chcschmid
Apr 13 2016 17:21
I saw that this morning. Thanks, @anderspitman!
Anders Pitman
@anderspitman
Apr 13 2016 20:43
@hehe876 can you review #51 when you get a chance?
Ok both the GUI and CLI should be runnable using gradle now
Anders Pitman
@anderspitman
Apr 13 2016 20:48
good time for everyone to fetch/merge (pull) master