« first day (1915 days earlier)      last day (3250 days later) » 
08:00 - 19:0019:00 - 00:00

user4196492
08:24
anyone on?
user4196492
I am trying to draw an image on my JPanel from a folder INSIDE of the jar file. When I export my jar file from eclipse, I include a folder with some png files that I want it to draw. I know how to draw a png file from just your average directory.
user4196492
nvm
user4196492
I can never solve this issue. I am so pissed about my inabilities right now. I can't figure out these simple issues because google search sucks.
Is the png not being built into your jar?
user4196492
It is
user4196492
08:36
but I don't know how to reference it
user4196492
via code
user4196492
Sorry, I am really stressed right now XD
Maybe it's just in the wrong folder?
user4196492
nonono. Lemme try to explain this
user4196492
so lets say there is the jar file and a folder called images with a whole bunch of png in them. I now how to refence thos because it is outside the jar file.
user4196492
08:38
When people extract my games, they would have to extract the folder with all those graphics
user4196492
btw I am just using these images like g.drawImage();
Ah. Maybe it's in the wrong folder inside the JAR then?
How do you read the file?
user4196492
in a try statement, I initialize a BufferedImage as ImageIO.read(new File("urlstuff/"));
user4196492
is there a way I can tag code btw?
I don't know actually, I'm new around here.
08:41
What it takes to create a new chat rooms and who is eligible to create it?
If you post a lot of code I'd put it on pastebin or a github gist, though.\
user4196492
Thanks for listening to my problem anyway though
I'd expect there to be a resources folder under main though, with stuff like images in there.
(looks like code can be tagged by surrounding it with backticks)
@pebble225 maybe you try to read it wrong... have you tries something along these lines: stackoverflow.com/questions/3369794/…
user4196492
lemme try that real quick
user4196492
08:44
is inputStream like a URL?
no, it's a stream
but there is a ImageIO.read(Inputstream)
so that just stays the way it is
user4196492
here is what I am trying to do btw
`BufferedImage graphics = ImageIO.read(new File(new InputStream(getClass().getResourceAsStream("url"))));`
user4196492
that no work though
yeah, I can see that
user4196492
Nicktar lemme try your method now
08:46
@pebble225 InputStream is an abstract class.
You can't new it.
BufferedImage graphics = ImageIO.read(getClass().getResourceAsStream("url"));
with something "real" for url
@MadaraUchiha well, you can if you implement the abstract methods ;)
user4196492
no error! :D
user4196492
lemme test if it draws the graphics
user4196492
I got an runtime error when initializing it that way.

java.lang.IllegalArgumentException: input == null!
at javax.imageio.ImageIO.read(Unknown Source)
at Player.<init>(Player.java:20)
at first.<init>(first.java:28)
at first.main(first.java:113)
08:49
what's your "url"?
user4196492
lemme check that
@pebble225 You should use the debugger
user4196492
where does getResourceAsStream(); start in the jar directory?
src/main/resources usually
for a maven based build
morn
user4196492
08:52
I will get an image of my project
user4196492
here is the package view of my project: goo.gl/IdZrwL
user4196492
so if I used getResourceAsStream(); , how could I access player.png?
where's the folder called resources ?
user4196492
I don't think there is one, I thought seeing src folder would help clear up where it is
I'm not fully versed in this stuff but I think you have to create a folder called resources that contains your pngs and such
user4196492
08:58
where?
user4196492
in src?
src/main/resources
user4196492
I have to go to bed, but I guess I will just stick to having the folder outside the jar file until I figure it out
user4196492
and I tries referencing them through src/main/resources but I got the same error.
10:12
@ballBreaker My phone is off, invite me into a room for a debriefing about yesterday evening
@pebble225 Have you added your resources folder like this?
hi @wonderb0lt
I need one help buddy
are u there @wonderb0lt?
Sure, let's see if I can help you :)
yup
package com.treselle;
import java.io.*;
import java.util.*;

public class CsvFile extends File1{

public void show(){
try {
File input = new File("D:/NewCsvFile.csv");
File output = new File("C:/sample.csv");
Scanner sc = new Scanner(input);
//PrintWriter printer = new PrintWriter(output);
while(sc.hasNextLine()) {
String s = sc.nextLine();
//printer.write(s);
System.out.println(s);
}
//System.out.println("File Written Successfully");
}
catch(FileNotFoundException e) {
System.out.println("File not found. Please scan a new file.");
this code I am using for .csv file read and write converstion
its showing file currption
whenever I open the file its shoing file curroption wrror
@wonderb0lt
dou have any idea?
Can you copy your code into gist.github.com or pastebin.com? It'll be easier to read then
First time showing file currption
sure
10:23
@Apple_Ajay please don't paste code in the the chat like that, if it's more than a line or two, use a pasting service like pastebin.com
ok sure
sorry
@wonderb0lt just this time plz help me. from next time i will upload there bcz i cant access pasthi
can you access gist.github.com ?
no sorry friend here more secure
What is the exact error you receive?
yep
this file 'sample.csv' is corrupted and therefore cannot be opened . open office can try to repair the file.
the corruption could be the result of document manipulation or of strctural doc damage due to data tranmission
for first time opening
for next time opening general error and general error out put
@Crummy
10:31
Can you diff both CSVs?
how can I check thata data's without opening that file
You have two files on your disk after running your program, right?
file easily converted but the problem is whenever I tried to open that error showing
yes
sizes changing before 70 bytes file size then after 0 KB
It looks like you're reading data but never writing it?
btw I am not changing any text also
yes I am not eriting anything just chaning name
newcsv file to sample.csv file
@Crummy
understood ? @Crummy
10:36
Can you explain in plain english what you expect your program to do?
I have one .CSV file with 70 bytes data, Now I am trying to read that and wihout writting just changing the name (new file.csv to sample.csv) then stop into local path
thats it
@Crummy
You want to rename a file?
yes
just now thats enough
and need to transfer data to this file to that file
same time when i open It should open that file
Here are some ways to rename (AKA move) a file: stackoverflow.com/questions/1158777/rename-a-file-using-java
I have one .csv file I need to read that data and write into another .csv file
10:44
That's not renaming.
You create your output File object in your code, but it looks to me like you never write to it
ho
could u please update my code ?
No, sorry, I don't have time to do that.
ok give me an idea for that
You've got some data from the input. You print it to screen. What you need to do is write it to your output. Do you know how to write data to a file?
yes I got it
but into file I cant write it
10:47
524
Q: How to create a file and write to a file in Java?

Drew JohnsonWhat's the simplest way to create and write to a (text) file in Java?

read old file data same data need to write new file both are same extenstion
I don't understand your statement
I have one .csv file with 70 bytes data need to read and write that data into another csv
OK. How do you write data to a file?
11:01
Hello java.
Hello
Who is using apache ant?
for example, for an old project
11:27
I have used, but I haven't written any scripts
@CrazyNinja How old is your project where are you use ant?
quick disclaimer guys, In a middle of game development I created Framework class which holds public static instances of frameworks and necessary utilities to start the game overall functionality such as Window, Audio, Files, Physics, Batch.. Most of those instances are necessary almost everywhere during the overall development
it was made public at first because it was the easiest way, but i'm thinking about getting rid of those public instances and pretty much handle it as a subject from now on
or i should leave it be
11:43
hey
I need some help
have time?
Rude: Saying you can help someone and then go to lunch
but then again this is not my job :P
ha
but sure i'll try to help
@some
I already posted the question, should I give you the link?
11:44
nah it's good
yeah but my project is kinda big so there is lotta code ill give you the link just in case
@someFolk this may sound stupid but you just have to weigh the advantages and disadvantages. unit tests will probably be easier if you compartmentalize but a lot of games don't have em anyway. are you running into problems now?
@Apple_Ajay make sure to close your file after writing
@Crummy I have not but, i thought it would make good practice overall
I precisely need help to implement some code into mine
11:48
@someFolk it is Best Practice :) if you can without too much trouble I would. I believe most games end up sharing a fair bit of global state.
@DomagojSabolic what exactly is your question?
yes
@someFolk thanks
I you want to compile it I can give you the code.
I can try compile it )
can anyone help me out!! I need to remove duplicates from array object. let me explain, I have an object A it may have some duplicates and I need to remove the duplicates from object A.
11:58
@DomagojSabolic Your question does not have a clear description what the problem is. Your comment helps, but you should write down explicitly what's expected and what's happening in your question. Plus, your code is way too long for anyone to find the problem. Try to reduce the code to the relevant parts (i.e. the rendering of the circles)
@SravanKumarPadala, kind of a hack but you could just put each in a Set, then rebuild your array from every value in the set
What do you mean by whats happening?
@sra
@SravanKumarPadala What kind of stuff is in array?
@Crummy Actually that's a pretty sensible thing to do.
@DomagojSabolic object has just three strings lets say A, B, C. A must be unique. Need to remove duplicates from A
12:02
@Crummy How can I use Set for an Object!
Sets can hold whatever you like them to
Set<TheClassThatIMade> thisWon'tHaveDupes = new HashSet<>();
@wonderb0lt would I help if I comment like every thing in the code so you can know exactly what's everything for?
@DomagojSabolic It would still be a lot of code
@Crummy I'll try that.. tq
@someFolk I'll be looking into that, Tq
12:05
I don't know then how can I help you help me solve my problem xD
You're just dumping code on us, saying the program has "unusual behaviour". That's not much to help you with
Step 1. Identify what it's doing or not doing that you don't want.
You don't show any signs of trying to solve the problem yourself by debugging, logging statements, etc. which will deter people who might be able to help you on the main site
@wonderb0lt Rude: asking a question and than go to lunch
39 mins ago, by some Folk
quick disclaimer guys, In a middle of game development I created Framework class which holds public static instances of frameworks and necessary utilities to start the game overall functionality such as Window, Audio, Files, Physics, Batch.. Most of those instances are necessary almost everywhere during the overall development
@wonderb0lt you saying to me?
12:17
Yup, that's me.
@DomagojSabolic Yes, I am
(I'm making enemies I think)
If you do, I was doing that just by now and I think i found the problem
hahahaha
rekt
so It enters the the part where it should the the warning state
on time
and all that stuff
but looks like it doesn't render it
correctly
@DomagojSabolic You see, what a little debugging can do. "I'm changinng this value and calling this method with it but it actually renders xyz" and just the code that does that is much easier to troubleshoot than "my program behaves unusually"
but now I'm stuck. xD
@wonderb0lt here?
13:00
@DomagojSabolic How are you stuck?
So i figured out in tick method everything works but in render method something not right
okay. it is fairly complex as well. I'd recommend putting braces around the if-statements in the inner loop. Stuff like that always causes problems
okay I'll try
Nope still not right
maybe I fked something up with the warning array
I don't know. :|
Okay so I was debugging a little and I found out it doesn't enter statement when I should do warning and I think i figured it out
13:14
yay!
Thanks for all the help
Glad you got it fixed
morn
@Hans1984 Guten Tag Hans
Guten Tag!
13:25
Guten Tag!
@Joe'sMorgue HALLO HERR LEICHENHALLE
13:39
tomorrow i will finally watch star wars :O
13:50
It's a good movie :)
@wonderb0lt have any ideas how could I check if im standing on invisible stone. I was experimenting something, I created currentStone which tracks my current stone but when I try  if(visible[currentStone]) system.out.printn("I die") I get some error
and ideas why
@DomagojSabolic I always model my game logic outside of the rendering/output code
<- not a game developer :P
haha
but still have any ideas how to perform this in my way :P
nope :P
13:56
What's the error?
Wow no errors all of a sudden xD
I fixed it. :)
Yeah I know
Exception in thread "Thread-3" java.lang.ArrayIndexOutOfBoundsException: 5
that's the error
something's wrong in this code:
if(visible[ Player.currentStone ] == false) {
How many elements should visible[] contain?
14:01
You're looking up the sixth element, though.
ohh
I get it
thanks
No worries, off-by-one errors can be surprisingly elusive
@DomagojSabolic Step 0: Developers don't start counting from 1
@MadaraUchiha Haha i totally forgot about that :P
Btw I'm great fan of you madara
How's it to perform infinite tsukuyomi
is it hard
I think it isn't when you're ten tails jinchuriki
Sorry, that's all the german I know
14:07
I just greeted you with "Hallo Mister Morgue"
wie geht es dir? = how are you doing?
now you know more
@wonderb0lt Will do! Just going to have my usual coffee, cigarette and poop first.. lol you're in for a funny story
Can I use environment variable in glassfish-web.xml file?
Morning, Java!
How can I generate a properties file using maven?
14:24
Good morning @Michael
Hi brothers, how are you?
Hi guys!
Can I have some help from you?
I have a general Java problem to solve
ask away
14:52
^
There is a library in Java to run in parallel a list of jobs?
or I have to implement the entire process
I'm a newbie in this
sorry
On multiple threads or multiple processes?
multiple threads
thanks @wonderb0lt
14:55
You can give ThreadPools any amount of tasks to perform which will be executed with some parallelism and in some order, depending on which pool implementation you choose and how you configure it
Morning
^ yes wonderb0lt is right, I agree
it may related to synchronized(atomic operation) stuff & thread joining
Hey Vogel
thanks to all, I'll read this and in case I'll ask to you :D
alright
15:46
I'm going through some old code and found this line:
`for (Foo foo : new LinkedList<Foo>(foos)) ...`
foos is a `List<Foo>`. Can you think of any reason why foos is wrapped in a linkedlist? i.e. why not just `for (Foo foo : foos)`?
I don't see one.
what the hell were these people thinking >_>
I could only imagine that the implementation of List<Foo> is some type they wrote themselves and want to get around some mistake they made concerning iteration
but that's like super unrealistic
Anonymous
16:03
If you love IntelliJ IDEA, please consider giving an upvote!
@FrancescoMenzani not sure if spam or spam
Anonymous
@Vogel612 Would you care to elaborate in a comment?
Hey guys- I have question regarding creating new objects with different, automatically generated names in a for loop. Anyone here think they might be able to help?
@FrancescoMenzani I didn't check the link, but that looks like upvote-begging which is ... spam
@DRich why would you do that?
this sounds completely stupid. What problem are you actually trying tosolve?
@Vogel612 how do I explain this briefly...
I'm pulling data out of SQL Server.
Each row that comes back may represent a hierarchy of the data, or actual data components
Does that make sense?
16:09
not sure what you mean by hierarchy of the data
but okay carry on
Maybe "Node in a hierarchy of data" would be more accurate
For example- image my data represents an organization as well as the people in it.
Each row in the data may correspond to a person or a group in the organization
soo... you're basically building a tree....
yes
I have a class to represent the actual data elements/leaves of the tree
and a separate class to represent the nodes of the tree
that sounds like the root cause of your problem...
but then your Names are not dynamic are they?
you just need to choose the right type for the current record
You should consider using a Factory
A "Factory" - what is a factory?
16:13
You instantiate different objects of the same type from given data
okay, so it's not as if there's a factory library...
public class CarFactory {
    public static enum CarVendor {
         AUDI, VOLKSWAGEN, ...
    }
    public static Car createCar(CarVendor vendor) {
        switch (vendor) {
              case AUDI: return new Audi();
              case VOLKSWAGEN: return new Volkswagen();
              // ...
        }
    }
}
^^something like that
Okay, but I don't know how big my metaphorical organization is
nor do I know how many nodes or people there are in it
doesn't matter
you just have to make sure People and Groups both inherit from a common type
public abstract class Node {
    protected Set<Node> children = new HashSet<>();
    public Set<Node> getChildren() {
        return children;
    }
    public abstract void addChild(Node Child);
}
^ this is the common class
I'm trying to follow all this, I'm a bit of a newbie though
Thanks for your help by the way
16:18
public class Person extends Node {
    @Override
    public void addChild(Node child) {
         throw new UnsupportedOperationException();
    }
}
^ a Person is a Leaf. It can't have children
put the common things into Node
then make your factory check the record and instantiate your Person or Group depending on the record
okay, so if I'm following this correctly...
Everything is a node
but some things are "node-person"'s
okay, so I build out this hierarchy as you describe- how do I then trace the hierarchy from the top down to some specific node or person?
... that's probably going to require a recursive method, right?
you can do it recursively, but there's also derecursed versions...
with the recursive ones easier to implement
"easier to implement" - I like the sound of that
To be honest, I don't yet see how exactly this implementation will get around my issue of having to name my objects things like, "Node1", "Node2", "Node3..." if all the nodes are under a single node of their own
BUT
Let me work with what you've given me and see if it doesn't become clear as I work through it
Thanks a lot @Vogel612 !!
@DRich COLLECTIONS!!!!
Collections?
16:32
^ read this...
please..
all of it
Awesome
exactly what I needed
That is a huge help. Thanks for giving me a push in the right direction.
16:50
Java Collections - Is it something new?
Hello Guys!
What is " o/ " ?
that is me waving "hi"
17:00
@Mikhail - thanks
@ItachiUchiha - also, thanks.
Sometimes I have free 2-3 hours in day. I'd like to work in this time, but i can't find work on the short time. Special service is maybe. Where am I can find it?
Where am I can find it? is that english-russian or?
@DomagojSabolic yes. I am Russian. My english is bad )
Just kidding
What is your level of programming in java?
Btw I'm Slaven too(Croatia)
If I knew where I am mistaken, I would have written correctly.
17:16
it's not Where am I can find it it's Where can I find it
and If I knew where I mistook, I would've written correctly
but nevermind that
I can understand you
@DomagojSabolic thanks )
anyway what is your level of java programming
I have been programming Java for more than 3 years
We do not have levels of "Junior", "Middle" or "Senior"
mkay, you want pay right?
if you don't know what this means it means:
Вы хотите платить(google translate)
I would say I'm middle. I am understand.
No. I'd like to make
)
17:30
try overflow careers
stack overflow careers*
you can also try codeplex.com but i'm not sure if they give you any pay
@DomagojSabolic thanks. Can I thank you in here (to increase the reputation or something like that)?
)
No need for that no problem
 
1 hour later…
18:58
Anyone know how to rotate a vector2 around another vector2?
Math.
more specifically?
08:00 - 19:0019:00 - 00:00

« first day (1915 days earlier)      last day (3250 days later) »