« first day (1397 days earlier)      last day (3529 days later) » 

6:14 AM
Good morning Javaa
 
@BlackWhite GM
 
@ItachiUchiha Heya
 
@Unihedron is absent today :P
 
Absent :)
What is absent actually ?
hmm translae
 
absent
adjective
adjective: absent
ˈabs(ə)nt/

1. not present in a place, at an occasion, or as part of something.
"most pupils were absent from school at least once"
synonyms: away, off, out, not present, non-attending, truant; More
not working, not at work, off duty, on holiday, on leave;
gone, missing, lacking, unavailable, non-existent;
in absentia;
informalAWOL;
informalbunking off, skiving;
informalwagging
"she was absent from work"
antonyms: present
 
6:17 AM
Woha :)
Stackoverflow can implement translate button to chat windows i think
It can be really usefull
What you think ?
 
Well, SO is mainly an English Site !
in Java and Android era , Jul 9 at 15:07, by Shog9
Therefore, if a room develops a habit of generating lots of non-English commentary and flags are raised, it will be deleted.
 
6:33 AM
Woh :)
But not right i think
I must not know good english
Eh i hear you say "you can use translater" :)
 
7:34 AM
@Unihedron
i m facing difficulty my jdbc driver not appearing in tools--->adminisititive panel
 
7:45 AM
@Sabಠ_ಠ
 
@ErumHannan That's not how you would spell it, to begin with. Pinging everyone in the room won't help.
 
i have googled a lot
and followed steps as well
but my driver is not appearing in list in administrative tools
 
8:41 AM
List of administrative tools ?
 
9:21 AM
@Erum
HI all :3
 
9:31 AM
Heya
 
10:16 AM
Won a bounty.
 
pastie.org/9488577#1

Can someone tell me why this doesn't give me pi?
btw IBIO is just to help with input and outputs
without System.out..blah
3.140592653839794
This is what it is outputting
 
> Can someone tell me why this doesn't give me pi?
You done goofed? :P
Use a debugger.
 
I mean
I did everything right in terms of logic.. I think
 
You assumed?
 
nvm
I figured it out
 
10:33 AM
;-;
Hi all :D
Hi @Unihedron
 
Heya!
 
Need your help with something
I got a class I need to use and I need to create a polynomial
I can't get it to work though
@Unihedron how to print stuff from a treemap?
 
... ?
 
Wait
Basically I have this
 
for (final Entry<K, V> o : map) {
  System.out.printf("%s, %s;\n", o.getKey(), o.getValue());
}
 
10:40 AM
polynomialTerms = new TreeMap<Integer, Integer>();
Now I want to use this to print my polynomial in the form of 4x^2 + 3x + 2
I'm not sure how to do this :S
I'm trying to create a method with no variable in it to do it
I need it in order of higher exponent
I tried to print my tree map and I got this {3=2, 4=1, etc}
 
11:12 AM
Hi
What's the name of the OOP principle of passing in method parameters directly?
eg doing obj.methodCall(a().b().c()) rather than obj.methodCall(a()) and making obj unwrap b().c()?
 
11:28 AM
Ah found it, the Law of Demeter!
 
11:39 AM
Heya
First time i use this FileInputStream
It can't be hard actually
But below code return exception
Maybe windows rights are block reach to file
try {
            FileInputStream file2 = FileInputStream (new File("D:\\Ornek.xls"));
            HSSFWorkbook workbook;
            workbook = new HSSFWorkbook(file2);
            HSSFSheet sheet = workbook.getSheetAt(0);
            HSSFRow row1 = sheet.getRow(0);
            HSSFCell cellA1 = row1.getCell((short) 0);
            String a1Val = cellA1.getStringCellValue();
            HSSFCell cellB1 = row1.getCell((short) 1);
            String b1Val = cellB1.getStringCellValue();
            HSSFCell cellC1 = row1.getCell((short) 2);
Exception is;
Exception in thread "AWT-EventQueue-0" java.lang.UnsupportedOperationException: Not supported yet.
 
That exception is very self-documenting. :P
 
Ye i know
I investigate FileInputStream using on the net.
I debug my code and exactly FileInputStream line return this error
 
@Unihedron did you try the MoonRise theme in eclipse ?
 
@ItachiUchiha I'm using one that mimics Xcode layout
 
@Unihedron which one ?
 
11:52 AM
in The SO Tavern (Free Snacks), Jul 29 at 16:21, by Wingpad
I've finally found a theme that makes Eclipse look like XCode on my mac... I feel like my life is complete now. (See @Unihedron 's later message)
 
Both of them are quite similar :P
 
12:30 PM
Is there a way to track when a method has been invoked without access to modifying the source code of it?
Preferably by doing something hacky with thread monitoring or reflection.
 
Do you need it during runtime ?
 
Yes.
I want to log information when this specific method, which is visible during runtime, is invoked. I am aware I can use reflection to get the thread stack, but it has to take that information while the method is being invoked. I don't own the code that built that object and it's not viable to decompile it.
Java 7 btw.
 
"I want to log information when this specific method"
 
I'll simplify.
 
Can't you log it just from the location where the method is getting invoked ?
 
12:40 PM
I can't change the method at compile time, but if it's possible to change it at runtime, that will be viable as well. Is there a reflection method that lets you implement a method into an object?
Given there's a set of Worlds, in which World is an object, but the server is going to update blocks with World.setBlock(Block, x, y, z). I can't change a World at compile time since it's not loaded by the world loader.
 
World.setBlock(Block, x, y, z)
its a static method
 
I'm considering constructing a new WorldWrapper class which extends World, and with the World as a field, with all the methods invoking the object World within the field, except the specific method I need, which I'll add my special logging code, then invoke the object world.setBlock(Block, x, y, z).
No, it's instanced. Bukkit.getServer().getWorld("world-nether").setBlock(new Block(Material.STONE), 1, 2, 3)
I have access to the objects at runtime, they are constructed at runtime, and I have a session when the class loader kicks up where I can hack the objects where necessary, which is what I'm considering doing.
 
@Unihedron I don't think, this is the correct way of doing it ! WorldWrapper class which extends World, and with the World as a field
 
I might be unclear. I'll try to sketch what I think I would do.
 
@Unihedron You need to quite coding
@Unihedron You are REALLY an artist
 
12:55 PM
@Unihedron lolz, Nice pic !
I am still perplexed as to why you want to store world object inside WorldWrapper ?
 
So when the outside class wants to call the World methods, the Wrapper can invoke them by sourcing them to the World in the Wrapper field, except for the specific method which I could change some things, then invoke the original method.
I just need to get the signal that the specific method in an object is being invoked. Anything would work !
 
except for the specific method which I could change some things, then invoke the original method.
:)
 
 new MyWorld() { //class MyWorld extends World
      @Override void setBlock(){
          myCoolTrackingMethod™();
          super.setBlock()
      }
 }
 
Is there anything I could do to perhaps watch the thread trace?
 
1:00 PM
Now I get your point ! :)
brb
need to leave
 
kk
cu i 1sec
@Karl I'll take that as a complement :p
 
Node JS vs Java as a back end service to mobile and web applications ... which is better iyo?
 
1:17 PM
Good morning
 
Mornin'
 
Good evening!
 
Evenin'
 
yep
 
Javaa
 
1:24 PM
gaga ohlala, ja ja ja javajava
 
Still i cant use this basic FileInputStream :(
Why dont woooooork :)
 
How is all today?
 
Terrible. I broke my leg.
 
Jumping to a conclusion?
What happened?
 
I lost a game of Chess.
I'm also in a chess tournament right now.
 
1:46 PM
Winning or losing?
Anyone here use Windows on their PCs?
 
2:06 PM
FileInputStream file2 = FileInputStream (new File("D:\\Ornek.xls"));
//must be
FileInputStream file2 = new FileInputStream (new File("D:\\Ornek.xls"));
Solved.
@Unihedronif you read the code you can say it to me :(
 
It was simple question anyway no problem.
 
What do you mean?
FileInputStream() is a constructor, you must call it with new.
 
you can say it when i ask i think
i create question for it
 
hey, is String = "" the same as String = null ?
 
2:23 PM
No
null = "nothing", "" = "empty string" - it's not null, it's a valid String literal, and is of length zero, with no characters
 
See you later tomorrow Java
 
Bye!
 
Fev
helo @Unihedron
how are yo
 
Hiya @Fev
Typical, you?
 
Fev
where are others ?
 
2:31 PM
Busy? :o
 
Fev
lol
any good news on this earth ?
 
I'm still alive!
 
Fev
helo Karl
 
Wait...You said good....
Nevermind...
:P
 
Fev
that's not good news
XD
 
2:36 PM
How you?
 
Fev
i'm fine and alive too
 
I won a bounty! Good news!
 
I need a faster computer...
 
Fev
@Unihedron , good on you
 
Yeah, good job
 
2:39 PM
Not sure if I really need that bounty though...
 
Can I have some...
 
You have an exemplary answer I can throw you +50 rep for?
 
No! <---<<< Does this count?
 
Fev
I didn't realize that .replaceAll() accept RegEx as it's parameter until yesterday stackoverflow.com/questions/25392999/…
 
@Fev ......
Meanwhile, Unihedron's profile
 
Fev
2:43 PM
woah , your regex is high
@ItachiUchiha, hello are you here ??
why so quit
 
The guy misspelled Wikipedia.
 
Fev
@Unihedron, stackoverflow.com/questions/25365667/… good question & answer
 
@Fev Thanks. I composed it the moment the question was there. Talk about Jon Skeet style ninja ing!
Try me with a regex challenge. :P
 
Fev
@Unihedron, are you doin' some PHP too ?
 
@fev A bit
I'm not a web dev, but I know the basics around PHP, especially the part about regex
 
Fev
2:50 PM
do we express RegEx with same style in PHP ?
 
Fev
I mean the rules still same with PHP ?
 
Evidently no, in every language the engine changes a little bit.
 
Fev
uh.
ok
 
In Perl we have Perl regex, PCRE and PHP regex in PHP, Java regex is its own challenge, and the regex engine in Go is the worst.
 
Fev
2:52 PM
I haven't doin' some ReGexs other than in Java
for web i use JS
 
Java RegExp is not the best because there are no conditionals.
 
Fev
are there some alternatives ?? classic filtering/pattern matching will be painful
 
I don't understand. You mean building a finite state machine to match a string without regex?
 
Fev
no just like using string.charAt () or other string method
I use that before knowing some Regex
 
The .java.util.regex.Pattern uses that mechanic, actually.
 
Fev
2:55 PM
but it will fail on complex pattern XD
 
Regex 101: There are two pointers, one for matching the pattern, one for matching the char sequence.
I'll give you a graphical example, since a picture > a million words...
 
Fev
Regex is cool !
 
Fev
@Uni
@Uni
hedron, what language is that ?
 
PCRE regexp.
Here's a more colorful one:
^ That's what regex does behind the machine.
 
Fev
3:02 PM
so it's manipulated internally ?
 
Regex = write as few lines of code as possible, sacrifice efficiency!
 
Fev
my gosh, I thought it's manipulated using some string/char's methods. LOL
 
Regex is the programmer's notation for String arrangement. It's also a regular language.
#\S+ = hash, then all non-whitespace characters.
<[^>]+> = everything within <> s. <br />
 
Fev
why are some characters using '\\' and some are not ?
 
Because in Java, the literals has to be compiled.
 
Fev
3:06 PM
Oh ok
 
You write \n, and the compiler turns that into a new line.
 
Fev
and what is the difference between '\\.' and just plain '.'
 
By writing \\., you compile the literal string into \., which in regex means a literal period, same as \Q.\E.
 
Fev
uh I see
 
In regex, . is a metacharacter meaning "any character except newline".
 
Fev
3:08 PM
@unihedron , how do we replace something like '\n' then ? like i eat\nfood
 
What do you mean by filtering?
 
Fev
that '\n' are simply characters('\' and 'n'), not new line , i meant like eat\nfood to eatfood
like this "\\n" ??
 
To replace "i eat\\nfood" to i eatfood, scrap with "i eat\\nfood".replaceAll("\\\\n", "");
 
Fev
woah , that's what i mean ! good
i found this book amazon.com/s/… on library yesterday , i will stole oh i meant borrow that for futher learning
 
lol
This is good too
 
Fev
3:20 PM
ok i've saved and read the page
 
Fev
3:30 PM
@Unihedron, are you a game developer?
 
I used to, but now I develop a Minecraft server as part time.
 
3:59 PM
hopefully a really quick java question... whats the difference between an array with [][] and [] after the name?
I think google uses [ and ] as modifiers, cos i'm not getting anything on earching
 
Two dimensional array vs one dimensional array
 
Ok, that should help me find a solution to my issue, thanks! :D
 
String[][] 2darr = new String[10][]; 2dayarr[2]=new String[3];
 
4:14 PM
hello Unihedron remember me? :D
I have 1 more question to ask... Im doing a project and I will need something like a biforqued linkedlist
I have already done it but I'm not too happy with it. My point is to have a LinkedList of Points
The last element from the LinkedList should be a speciall point with 2 linked lists
Is there something in java that already does that?
 
4:45 PM
2day is a bad day xP
 
Fev
5:00 PM
why?
 
not much people around
 
 
1 hour later…
6:04 PM
0
Q: Thymeleaf <select> tag generating options (numbers)

sdsd ssegvbrhI have a <select> tag in HTML and need to generate options from 1 to 53 and then pick one I'm sending with the doPost method. I tried to use the solution I found here: http://forum.thymeleaf.org/generating-content-for-select-programatically-td4024742.html, <select name="week_scroll" styl...

take a look please
 
@BrunoTavares Not really, what do you need though?
 
imagine that im doing connections between points
0-1-2-3-4-5-6
|
7
|
8
dammit
0-1-2-3-4-5-6
|
7
|
8
0-1-2-3-4-5-6
       |
       7
       |
       8
holy crap... I just can't do it. Do you get the point?
 
... I don't, I'm sorry. Can you draw it in MS Paint?
 
Ok, just give me a minute
How can I upload img here?
 
you need rep milestone for that, upload it on imgur
 
6:11 PM
ok
I was wondering if there is a List in java that keeps this structure
The red circles are points that hold 2 lists, like 2 paths that the connection can take
Like a biforcation
 
1 - 2 - 3 - 4 - 5 - 6
         |      |
         7      10
         |      |
         8      11
         |
         9
 
I already did my own implementation, but I don't like it too much. If there was something like this already done in the libraries it would be nice (: I have already searched for it but can't get any results.
 
Don't believe so.
 
6:40 PM
Anyone done integration testing w/ Maven?
 
7:12 PM
Testing? Maven is for typing... :P
 
Seems no easy solution to what I'm trying to do. :/
 
7:31 PM
hi everyone
can someone help me in JSP web application
i m hitting url
HTTP Status 404 - /LoginApplication/LoginFile.jsp

--------------------------------------------------------------------------------

type Status report

message /LoginApplication/LoginFile.jsp

description The requested resource is not available.


--------------------------------------------------------------------------------

Apache Tomcat/7.0.42
and getting this error why this problem is happening ?
 
Do you have the JSP servlet configured in web.xml?
 
@ErumHannan What do you have in your web.xml
 
g
<web-app>

<servlet>
<!-- <servlet-name>sonoojaiswal</servlet-name> -->

<servlet-name>login</servlet-name>
<servlet-class>com.loginapplication.LoginServlet</servlet-class>
</servlet>

<servlet-mapping>
<!-- <servlet-name>Login</servlet-name> -->
<url-pattern>/LoginServlet</url-pattern>
</servlet-mapping>
<jsp-file>/LoginFile.jsp</jsp-file>
</web-app>
this is web.xml
i m pulling my hairs from 5 hoours but its nt resolving issue its my first jsp
application
 
same issue
HTTP Status 404 - /Loginservlet/LoginFile.jsp

--------------------------------------------------------------------------------

type Status report

message /Loginservlet/LoginFile.jsp

description The requested resource is not available.


--------------------------------------------------------------------------------

Apache Tomcat/7.0.42
 
7:38 PM
with capital S for Servlet
 
yes also tried
not working
HTTP Status 404 - /LoginServlet/LoginFile.jsp

--------------------------------------------------------------------------------

type Status report

message /LoginServlet/LoginFile.jsp

description The requested resource is not available.


--------------------------------------------------------------------------------

Apache Tomcat/7.0.42
same issue
 
it depends on many things... how do you build your applicaiton? I guess you have a war deployed in your tomcat ?
 
i have not use war actually its my first app
thats why i am using eclipse
and running my app from edipse
eclipse*
can u pls help me
 
ok, you use the tomcat embedded in eclipse?
 
yes i added servlet-api.jar in libraries folder of my project
 
7:43 PM
it s not a problem of libraries but a configuration path probably
 
i am also getting some red text in console
 
and it depends as well where are your jsp deployed
 
my jsp inside WebContent folder of my projec
t
 
is there any ERROR text in red ? or just WARN or INFO ?
 
this is in console.log
org.apache.catalina.startup.ContextConfig parseWebXml
SEVERE: Occurred at line 13 column 19
Aug 21, 2014 12:28:46 AM org.apache.catalina.startup.ContextConfig configureStart
SEVERE: Marking this application unavailable due to previous error(s)
catalina
 
7:45 PM
SEVERE: Parse error in application web.xml file at jndi:/localhost/LoginApplication/WEB-INF/web.xml
that is one problem
 
ok what is the issue in web.xml i already pasted my web.xml
 
i do not see like this... did you write it by hand?
 
web.xml
<web-app>

<servlet>
<!-- <servlet-name>sonoojaiswal</servlet-name> -->

<servlet-name>login</servlet-name>
<servlet-class>com.loginapplication.LoginServlet</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>/Loginservlet</servlet-name>
<url-pattern>/LoginServlet</url-pattern>
</servlet-mapping>
<jsp-file>/LoginFile.jsp</jsp-file>
</web-app>
i guess there is some issues in my web.xml
?
can u pls check this ?
@ruffp
 
i should have an eclipse because i did not made jsp /servlet since long time
how did you start your project ?
 
i first made web application project
then i add jsp file inside it
and then i add package in src folder and then add LoginServlets.java there were some errors in file then i import servlet-api.jar file and all errors vanished
then i made bean class and then DAO class to access database
and one thing more may i need to register all my java class files inside web.xml
i have followed this tutorial but they did not mention web.xml
@ruffp
 
8:00 PM
on this page, step 8 they mention the web.xml
 
ok now my login page appearing
but action="LoginServlet" is not being called
may i need to register my Servlet class in web.xml
?
 
yes you must
 
@Uni der ?
 
ok the issue is i am adding servlets in web.xml in an incorrect way thats why problem appearing
@ruffp
can u just help me how to add servlets in web.xml
 
@ErumHannan the servlet-class element must contains the full qualified name of the Servlet... if you put it in a package name org.example.servlet you have to put <servlet-class>org.example.servlet.LoginServlet</servlet-class>
 
8:09 PM
yes i ahve added servlet-class full qualified name
this is web.xml
<web-app>

<servlet>
<!-- <servlet-name>sonoojaiswal</servlet-name> -->

<servlet-name>login</servlet-name>
<servlet-class>com.loginapplication.LoginServlet</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>Loginservlet</servlet-name>
<url-pattern>/LoginServlet</url-pattern>
</servlet-mapping>
<!-- <jsp-file>/LoginFile.jsp</jsp-file> -->
<display-name>LoginApplication</display-name>
<welcome-file-list>
<welcome-file>LoginFile.jsp</welcome-file>
</welcome-file-list>
</web-app>
now again there is an issue in web.xml thats why tomcat failed to start
The servlets named [Loginservlet] and [com.loginapplication.LoginServlet] are both mapped to the url-pattern [/LoginServlet] which is not permitted
at org.apache.catalina.deploy.WebXml.addServletMapping(WebXml.java:335)
@ruffp
 
the second <servlet-name>Loginservlet</servlet-name> should be the same as define in the first <servlet-name>login</servlet-name>
try like this:
<web-app>
<servlet>

<servlet-name>login</servlet-name>
<servlet-class>com.loginapplication.LoginServlet</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>login</servlet-name>
<url-pattern>/LoginServlet</url-pattern>
</servlet-mapping>
<display-name>LoginApplication</display-name>

<welcome-file-list>
<welcome-file>LoginFile.jsp</welcome-file>
</welcome-file-list>
</web-app>
 
no when writing small
<url-pattern>/loginServlet</url-pattern>
its working while in <url-pattern>/LoginServlet</url-pattern> its not working
and again its not calling servlet class in onAction method of form
@ruffp
@BrunoTavares
 
 
2 hours later…
10:42 PM
Does anyone know how to answer this question?
0
Q: Is it possible to get the content of a HTML textarea inside a WebView in JavaFX?

Imagine StudiosIs it possible to get the content of a HTML textarea inside a WebView in JavaFX? Example: package javafxapplication7; import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.layout.StackPane; import javafx.scene.web.WebEngine; import javafx.scene.web.WebView; impor...

It was marked as a duplicate, but the other answers do not help me much.
Here is the code that i got after fiddling with the others answers code:
package javafxapplication7;


import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.StackPane;
import javafx.scene.web.WebEngine;
import javafx.scene.web.WebView;
import javafx.stage.Stage;
import org.w3c.dom.Document;
import org.w3c.dom.Element;

public class Demo extends Application {

    private WebView view;
    private WebEngine engine;

    @Override
As my question says, it doesn't print out the text of the textarea. Any ideas how to do this?
 
10:58 PM
I have the answer! it is a bit of a hack, but it works! @jewelsea Can you reopen the question so i can answer it myself? It might be useful to other people who have the same question.
 
11:15 PM
See the updated section.
0
Q: Is it possible to get the content of a HTML textarea inside a WebView in JavaFX?

Imagine StudiosIs it possible to get the content of a HTML textarea inside a WebView in JavaFX? Example: package javafxapplication7; import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.layout.StackPane; import javafx.scene.web.WebEngine; import javafx.scene.web.WebView; impor...

Is this the right way to do it? if it is, can you reopen the question so i can post it as a answer and people are more likely to it? Thanks! =)
 

« first day (1397 days earlier)      last day (3529 days later) »