« first day (1498 days earlier)      last day (3449 days later) » 
00:00 - 21:0021:00 - 00:00

12:10 AM
Greetings
 
greetings
 
1:05 AM
hi, how about android here?
 
1:32 AM
@si what isthe question?
 
hai
i had a query on a weird syntax of run() method of Runnable class
public void run()
        {
            initSearch( record );
        }
Is it not true that code within run() method should be statements rather than declarations?
my mistake, i guess, it is the calling method syntax.
 
 
5 hours later…
7:10 AM
heya
 
Hiya!
 
ssup?
 
fge
7:32 AM
Oh dear
Some people really have a problem with reading docs
 
7:50 AM
hey
im running into a nullpointerexception
and i was wondering if i could get some hlp
 
can you show the stacktrace?
 
Hi!
 
errr yeah
but i can post a join.me
 
@Unihedron @ItachiUchiha Can you actually create an entry in the database with auto-increment feature and then safely get its db generated id (auto-increment) at the same time?
 
7:56 AM
@LeeJeong "At the same time"?
 
@LeeJeong Yes
Just copy your error and paste it here @Barakados
Nobody is interested to see your screen
 
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at general.Graphical.paintComponent(Graphical.java:168)
at javax.swing.JComponent.paint(JComponent.java:1037)
at javax.swing.JComponent.paintChildren(JComponent.java:870)
error happens here
 
You have a class Graphical in package general, right? What's line 168 of it?
 
        int xba = current.human.location.x > 8 && current.human.location.x < current.map.getWidth() - 1 ? Math.max(Math.min(x + current.human.location.x - 8, current.map.getWidth() - 1), 0) : x;
current exists, however, current.human does not
 
Well there's your problem, within that code this happens:
 
7:59 AM
yepp.. @Unihedron, i created a transaction item, and afterwards want to get its generated DBID..
 
fge
So, you know where the error is yet you wonder why you have an NPE?
 
Yeah, but i don't know how the error is happening
 
fge
head spins
 
lolz
 
EVALUATE current.human.location.x
Take x in location in human in current
Because "human" is not present, "location in human" throws an NPE. Make a new human before you try to get its parameter.
Next!
 
8:00 AM
i did...
 
@Unihedron im next! please! :))
 
@LeeJeong That's not really at the same time, it's how it's supposed to work, so yes...
@Barakados Maybe location is null, or human is null. It's either.
Or map.
 
that's the class, if you could take a look at it... i would be greatful
 
Line 168 is empty?
 
It returns an NPE from time to time @Unihedron, that's why im suspecting the DB is still not finished creating the entry so when i try to access it.. its engkk... NPE
 
8:02 AM
no line 168 was already shown
 
@LeeJeong You're doing it asynchronously?
@Barakados I think you meant to post your "Graphical" class, this is "Level".
 
@Unihedron async meaning, not synchronized?
 
Are you threading?
 
@Unihedron im not threading btw
@Unihedron should i try putting it inside a sync block?
 
8:05 AM
No, it might be somewhere else. Hold on..
 
@Barakados Does your stdout actually print all of "current is good", "human is good" and "location is good"?
 
it prints current is good
and nothing else
 
fge
Heh
@Barakados you're on FreeNode too, aren't you?
 
Then human is null, and therefore you really should do this:
if (null == current || null != current.human || current.human.location!=null)
    continue;
@fge cross posting?
 
fge
8:09 AM
@Unihedron just so... Bah
 
how is it null?
 
fge
Argh, my eyes bleed
if (condition) { aShitLoadOfCode(); } else continue; <-- meh
if (!condition) continue; aShitLoadOfCode(); <-- better
 
continue without a loop?
 
@ItachiUchiha It's within a for loop.
 
fge
@ItachiUchiha given that the code is like this I guess this code is within a loop
 
8:11 AM
@Unihedron ahh k
 
@fge [status-completed]
 
lolz
 
[16:09] == #java Cannot join channel (+i) - you must be invited
LOL, fine
 
create an account
 
fge
@Unihedron you need to have a registered nick
 
8:11 AM
and register it
 
Ah, I forgot my password though. makes new
 
ok
 
/msg NickServ ???
 
so apparently you guys are hellping me
 
fge
@Unihedron /msg nickserv identify yourPasswordHere
 
8:13 AM
4 mins ago, by Unihedron
if (null == current || null != current.human || current.human.location!=null)
    continue;
 
but it's graphics
 
fge
@Unihedron I believe you meant == instead of !=
@Unihedron hmm, you may need to register before... Anyway, /msg nickserv help
 
Yay help ftw
 
fge
(nicks are case insensitive on FreeNode)
@Unihedron warning, the regulars on this channel are a harsh bunch :p But they are extremely knowledgeable (I don't count myself as a regular in this regard)
 
wait whoa
What just happened
now it's telling me location is good, and yet im getting more errors
 
8:20 AM
Then... something else is wrong.
Have you ran a debugger yet?
 
no
you don't get it
level is doing something weird with the human class
 
I assume you wrote all the code?
 
yes
 
In that case, have you ran a debugger?
 
no
how do i do thar
 
8:23 AM
Which IDE do you use?
 
intellij idea ce
ill look it up
lol i have no idea how to debug
 
fge
@Barakados IDEA has excellent help; and of course, google will help you
 
8:39 AM
so what's the general idea?
 
fge
9:19 AM
@Barakados read the help/google around; basically, the process is always set breakpoints/select what to run/debug it
 
9:42 AM
I have no idea what that asks for, but it sure isn't a proper question ^
 
10:31 AM
@Unihedron if i wanted an object to be destroyed and replaced again after sometime but then i want a centralized global location for that object... Singleton is not the fit solution right? coz your are destroying and re-instatatiating right?
 
fge
@LeeJeong you can use a publicly accessible static volatile variable
 
Maybe you need a centralized SoftReference, but tbh I have no clue why you need it destroied on the first place.
Maybe this:
class CentralizedReference {
  static SoftReference<Thing> thing;
  static syncronized Thing get() {
    if (null == thing || null == thing.get())
      thing = new SoftReference<Thing>(new Thing());
    return thing;
  }
}
 
COnsider this situation, i wanted a BuyingCart object to be the only instance present available in the entire run.. but after a successful sale, that BuyingCart should be destroyed and replaced with a new one, but still there is just one instance of that class..
 
Instead of destroying it and replacing it with a new one, why not define .clear() instead?
 
RIGHT!
thanks @Unihedron, the clear() method i think is what i need... let me run it on my UCs.
 
10:41 AM
Or add a level of indirection. If creating a new one is not expensive, you could have a singleton that holds a reference to the shopping cart, instead of making the shopping cart itself a singleton. Then when changing carts, you can simply change the reference and let the GC deal with the old one
 
@LeeJeong There is no .clear() method. I'm stating that you could instruct a cleanup instead of getting rid of the object to make a new one in place.
 
hello all :P
 
That's to assume if you're avoiding construction, otherwise @kiheru's idea is spot on.
Hey there @Mario
 
@Unihedron yep, im going to make that methohd THAT DOES the cleanup. :D
 
it's a me, mario!
 
10:43 AM
Adding a level of indirection can usually solve all problems, except the problem of having too many levels of indirection.
 
@kiheru thanks for the suggestions! :D
 
11:02 AM
@Unihedron lolz
 
Why won't eclipse replace with regex?
 
fge
Can someone on Windows give me the result of Paths.get("c:\\foo").getRoot()?
I'll bet for "c:", I just want to be sure
 
11:21 AM
c:\
lol my test class is messy, I dump too much code
 
fge
@Unihedron OK, another test please... Paths.get("c:").getParent()?
My guess is null
 
Surprise: null
 
fge
OK, good, I was not mistaken
(writing a generic Path/FileSystem/FileStore package; I want to do that FileSystem over DropBox)
 
:)
 
fge
11:40 AM
Hmmm
Another test, please? :p
Paths.get("c:\\foo").subpath(0, 2)
 
Guess what? :D
Exception in thread "main" java.lang.IllegalArgumentException
	at sun.nio.fs.WindowsPath.subpath(WindowsPath.java:632)
	at sun.nio.fs.WindowsPath.subpath(WindowsPath.java:44)
	at com.gmail.inverseconduit.test.TestClass.main(TestClass.java:50)
 
fge
Hooo
I wonder whether this is a bug...
Paths.get("/a/b").subpath(0, 2) gives "a/b" here
Which version of the JDK?
 
jdk1.8.0_25 Windows 7
 
fge
Hmm, actually it may not be a bug
I take it that Paths.get("foo\\bar").subpath(0, 2) works?
 
11:57 AM
Yep, foo\bar prints
 
fge
OK
/me needs to rethink some stuff
Uhwait
Another test, please... Paths.get("c:\\foo").forEach(System.out::println);
What is printed out? foo only, or c: and foo?
0
Q: Can there be a (Java 7) FileSystem for which a Path .isAbsolute() but has a null root?

fgeThe javadoc for .isAbsolute() says: Tells whether or not this path is absolute. An absolute path is complete in that it doesn't need to be combined with other path information in order to locate a file. Returns: true if, and only if, this path is absolute The javadoc for .getRoot() says:...

 
12:35 PM
foo
 
fge
OK, a last test ;)
Paths.get("\\foo\\bar").isAbsolute()
 
false
:P
 
fge
Hmmm
OK, so I need an answer to my question above to do things "fully correct"
 
1:02 PM
0
Q: what encoding made these characters when accompanied with caron into something different

VivoI have some croatian strings that has caron with some of the characters in my mysql db. I call a API which is written using Node.js and which in turn it calls the Java based API and which in turn fetches the data from mysql db. I'd like to find out what encoding in API layers made these(left) i...

Any help is appreciated
 
fge
1:26 PM
@Vivo using MySQL to store text data is already asking for trouble -- I do hope the encoding of your database is correct
 
1:50 PM
How's the website now look? mawersoft.co.uk/clients/Unihedron/about
 
@Unihedron Better than previous version.
 
lol
 
@Unihedron What for?
 
Good morning, Java!
 
2:09 PM
morning
 
Hey @Gemtastic.
 
Morning @Michael!
 
Hey @Uni :D
 
'sup?
 
Not much. You?
 
fge
2:12 PM
And they sold it all! Unbelievable
 
@fge Wow, holy lords, people must be drunk.
 
fge
30k boxes of sh*, literally
Mamma mia
 
Insanity
Market anything the right way and it will sell. "Hate Black Friday? Prove your point by buying this bullshit!"
 
Dang wifi xD
 
 
1 hour later…
4:01 PM
o_O
 
O_o
 
So quiet, it never was :(
 
This room used to be pretty dead when I newly joined... Only about ~2 sessions of chats per day
 
Thanks God, there is no down rating here :P
Thanks @Uni ;)
 
me theoretically downvotes you for repeat typo; you theoretically just lost rep
 
4:04 PM
/me facepalms
@Uni have you played SAMP RP?
 
What's that?
Sounds like some true roleplaying games.
 
Yes, it's San Andreas Multiplayer and there are many role playing servers
The best one were LS-RP & PR-RP
I used were because i meant when I used to play that
 
Not a big fan of role-playing, so not really. ;)
 
Aaah, I thought may be you will give it a try sometime as you have nothing to do already :P
 
But I'm trying to solve a calcudoku. :P
It's healthier anyway.
 
4:08 PM
Let me google calcudoku :D
 
Is it a siser of sudoku? :D
 
Every cage has an operation and a product: If it's a +, then the number is the sum of numbers in the cages. Each column / row only has one of each of range(1..n).
 
4:20 PM
Wait, I have an idea! I should build a programming language!
 
@Unihedron Really? What is it?
 
4:40 PM
hello! Can you include fonts in your JAR to be used by default by your Swing application?
 
@LeeJeong I think you have to load them to be used.
 
BTW, when i was developing VB6/Net apps, there was this creating of installer thingy... in Java what is the equivalent of this ( i guess its creating a executable Jar?)
@Mr.777 can you expand on what you mean with "Load them"?
thanks BTW @Mr.777 ^^
 
@LeeJeong You want to create a installer to download a jar?
 
@Unihedron nope. How do you deploy java swing apps on other machine?
 
Copy the JAR?
 
4:44 PM
Although, creating exe is not we should do for a jar but there is aprogram jar2exe that can convert your jar to executable file.
 
Sorry guys for being so noob...
when building your Project jar, it must include the complete list of all imported jars as well right?
@Mr.777 what did you mean by loading the font? Install it on the machine right
 
@LeeJeong Ofcourse, how else you think your application will load and use those dependencies?
 
weeew.. i guess ill have to use an existing font for most of the machines that ill be using
 
@LeeJeong Only installing isn't enough. You have to load the font resource into your application to be used.
 
@Mr.777 i thought the referenced Jars would be built automatically with my project before. xD
@Mr.777 im sorry i dont quite get it. 1. I have to make sure, the font exist on the machine, 2. I have to load that font on the application..
well of course, this is on the assumption that i am using the font explicitly on the Jcomponents
 
4:50 PM
Some programs downloads the dependency jars with the launcher.
 
You need to install the font on machine and use InputStream is = MyClass.class.getResourceAsStream("CustomFont.ttf");
 
@Unihedron how do they know where to get those jars? :O please bear in mind that i really have no idea about building and deploying swing apps... T.T
 
@LeeJeong The launchers were set to check for presence of jars, download them from hardcoded sources if they're absent, then launch the Jar. I don't think that's a feasible solution for your app, so just go with bundling them within your program and have a fat jar.
 
@Mr.777 and why is loading it necessary? Im asking out of pure ignorance, its the first time i saw that code in java too. :(
 
@LeeJeong How else you assume it to use that font?
Have you registered the font in your application?
 
4:55 PM
I just use it like this:
lstSummaryLabel.setFont(new Font("Corbel", Font.PLAIN, 15));
 
@LeeJeong Does this work?
 
yes it works...
 
@LeeJeong Now export a jar & deploy it to some other machine and without installing font, try it
 
My worry is what if the font i used in my app doesnt exist in the other machine...
 
@LeeJeong Exactly, that's the point I am trying to tell you. You need to load it (deploy the font *.ttf file with your application)
 
4:59 PM
@Mr.777 using the code that you said: InputStream is = MyClass.class.getResourceAsStream("CustomFont.ttf");
this would load the font in the machine?
 
Or you can as well also register the font in the OS where this font is not already present
@LeeJeong This will load font in application, not machine
Loading on OS is different than loading into your app
 
@Mr.777 using that method you told me, i need to include on my resources the preferred FONT i would like to load in my app when i compile my jar, correct?
 
@LeeJeong Ofcourse
 
fge
/me hates when the JDK javadoc is incomplete
 
@Mr.777 of course i dont know that too. ahaha
 
5:02 PM
@fge Incomplete?
 
fge
@Mr.777 specifically the javadoc of java.nio.file with regards to resolving/relativizing Paths
 
@Mr.777 using that method you mentioned, i would be able to make the font of my app consistent on wherever machine i run my app right?
 
@fge Yes, i saw your question on SO, no one answered yet?
Yes @Lee
 
fge
@Mr.777 nope... But what I am struggling with at the moment is another problem
 
@fge Although my knowledge is not as much as yours but if you tell what actually is the problem, may be I can try to help
 
5:05 PM
Guys what are the ways of running your Swing app on another machine? Exporting your code into a Jar right?
Im just curious why on java, we just make a Jar file to be able to run our program, but in Vb.net/6 we need to make an installer thingy...
 
@Lee `GraphicsEnvironment obj =
GraphicsEnvironment.getLocalGraphicsEnvironment();
obj.registerFont(Font.createFont(Font.TRUETYPE_FONT, new File("CustomFont.ttf"));`

This is how you can register it for the machine
 
@Mr.777 cool stuff! :D
 
jar is java executable which means it can be deployed and executed on any OS, while exe is OS specific
 
fge
@Mr.777 here goes: paste.ubuntu.com/9301897
 
WHAT?? all my life, i thought exe's are run on any OS. dafuq. dafuq. dafuqq
@Unihedron what does a FAT jar mean?
Is ok to look dumb here. I learn. T.T
 
5:08 PM
ಠಿ_ಠ
 
fge
@Mr.777 that's not entirely true, you can generate a jar which is not executable at all
It all depends on how you configured your manifest
 
@fge I know, you have to make jar executable
 
@LeeJeong It means your jar has the compiled classes of your dependencies. So they are present on the file path.
 
fge
@Mr.777 no...
This is not a shell script!
 
How do i deal with my project when it uses some other Jars? Does eclipse automatically include them in my exported Jar?
 
5:10 PM
no
 
fge
Making your jar executable will not work; you have to have a Main-Class entry in your manifest, and the desktop shell must link jar files to launch "java -jar the.jar"
 
@fge Adding Main-Class in Manifest will make the jar executable, no?
 
fge
@Mr.777 no, not without the JRE
You can't ./the.jar
 
@Unihedron then how do i include the JARs i referenced with the exported JAR?
 
@fge But double clicking this jar will execute it (atleast I have done it so many times) :P
 
5:14 PM
25
Q: Embed a JRE in a Windows executable?

perpSuppose I want to distribute a Java application. Suppose I want to distribute it as a single executable. I could easily build a .jar with both the application and all its external dependencies in a single file (with some Ant hacking). Now suppose I want to distribute it as an .exe file on Windo...

 
fge
@Mr.777 because your desktop shell has been configured for it
 
@Mr.777 ive done it also many time..
 
=> you can, but with external tools
 
@fge Yep, thanks @fge I got your point & understood
 
fge
Good :p
 
5:18 PM
@fge, so what are the basics of deploying your Swing app on another machine?
 
@LeeJeong Maven or gradle has tools for this...
 
fge
@LeeJeong don't ask me, I don't do GUIs at all, only server-side libraries
 
ok thanks guys... im looking at maven and gradle now thanks @Unihedron
 
But I think you can just decompile the source jars of your dependencies and add them to your project path
and specify it when compiling, but that's more work
 
... so that i can skip all this ALIEN (as of now) stuff ? hahaha.. ill consider that.
 
fge
6:04 PM
I need a name
 
can anyone pls tell me about this method onGetsStatsCompleted
 
fge
A project which aims at defining helper classes for implementing FileSystems (as in java.nio.file.FileSystem)
How would you name that?
 
FSWrapper
 
fge
Those are not wrappers
Right now it's java7-fs-helpers but I dislike "helpers"
 
CustomFS :D
FSRevealer
FSDirective
 
6:18 PM
@fge what about java7-fs-providers?
 
fge
6:36 PM
Hmmno, this sounds too much like FileSystemProvider which is a class I have to implement
Ohwell, I guess java7-fs-base
 
Not bad
I was going through the problem and have read the java docs for java.nio.file
They really don't have anything for two different file systems
 
fge
Well, the thing is, you can create "sub filesystems"
 
@fge Have you got answer from their side?
 
fge
With a default Unix filesystem for instance you can create a FileSystem for / and another for /home, or whatever -- without taking mount points into account
@Mr.777 none so far for either question
I feel like I'm the only one in the world having tackled this problem... That can't be true
 
@fge Well, may be others just have designed it differently and never faced any such problem?
OK, so, I am at a loss here; are there any filesystems out there for which a path may be absolute without a root at all? @fge , what about / ?
 
fge
6:52 PM
@Mr.777 I have googled around endlessly; the only pages I saw about were people explaining (sometimes badly) the usage of the API, never the implementations, and the only other fs implementation I saw, apart from my FTP fs, was Google's jimfs
As to "/", well, it has a root, which is /; however the Path API does not require/mandate that this path be absolute
Of course, in currently defined filesystems by Oracle, this is the case
Oracle has defined providers for two things: native filesystems on platform the JDK runs on, and an API for zip files (which is very convenient)
But since a provider is defined by a URI scheme, they had to work around it and the "jar" scheme has been chosen
Still, you can open and manipulate ZIP files with it
It is soooo much better than having to deal with ZipEntry and whatnot
 
/me nodes "shows as he understands all the stuff" xD
 
fge
Well, basically, if you want to extract an entire zip somewhere on your filesystem, you can do it easily
 
Yes, we can.
 
fge
Create a FileSystem for your zip file, then zipfs.getPath("/"), copy that path recursively somewhere on your disk
Done
You can very easily create a zip file this way as well
 
fge
7:24 PM
OK, gold medal for the worst big name company when writing docs: Oracle
Fortunately, this doesn't apply to Java's Sun "imports"
 
lol @fge
 
fge
7:39 PM
gist.github.com/fge/396ee8153f92fce8bbd5 <-- TestNG + IDEA + assertj
I love this combination
Add mockito into the mix and you have a winner
 
 
1 hour later…
8:48 PM
Tip tip @fge, include "smart" in the library name
Like SmartFileSystems
 
OakBot Online.
 
=about
 
Oak Bot v0.0.1 by Michael | source code | Built: 2014-11-29 20:50 +0000
 
So is TestNG better than JUnit?
 
fge
@Unihedron I wouldn't even dare
For one, even though I test it like crazy I have only a vague idea of how useful it will be to develop custom FileSystem implementations (although of course I intend to be a user for it)
@OlegKuznetsov imnsho, definitely so
@OlegKuznetsov its @DataProviders are a godsend for unit testing, for starters
 
8:56 PM
I'm considering what to pick for my project
 
fge
To achieve a similar effect, JUnit 4 requires an insane amount of boilerplate, and you are limited to one data provider per test class
Well, go for TestNG
You can't lose
 
Yeah, will do
 
fge
And don't forget assertj and mockito
And don't forget either that test classes are classes like any other; strangely enough, a lot of people seem to forget that and put a lot of code in @Before* which is more natural to put into a constructor
This also means of course that you can have abstract test classes...
A fact which is also very often overlooked
 
I don't see the benefit from AssertJ [yet]
 
OakBot Online.
 
8:59 PM
Plus I wanna try out PIT: pitest.org
 
00:00 - 21:0021:00 - 00:00

« first day (1498 days earlier)      last day (3449 days later) »