« first day (1409 days earlier)      last day (3517 days later) » 
01:00 - 13:0013:00 - 23:00

1:20 AM
@Lucio servlets are used both in production and for educational purposes..
even today
 
 
1 hour later…
2:31 AM
My question was more like.. Hey, Me!
I mean, if someone does, ping me :-)
 
 
2 hours later…
4:59 AM
@Mateon1 Get to 3k rep and help me defend the tags [bukkit] [minecraft] [minecraftforge] from bad questions by closing them. ;)
I might have to post a few quality Q&As sometime to improve the overall tag score...
 
5:14 AM
@ItachiUchiha hey
u thr today
 
Oops, [minecraft-forge] **, but the message is too old to edit.
I created the [minecraft-forge] tag, btw.
 
5:29 AM
in Tavern on the Meta on Meta Stack Exchange Chat, 1 min ago, by Unihedron
It seems that we have many new, unexperienced wanna-be programmers on the [bukkit] [minecraft] [minecraft-forge] tags.
^ cc @Mateon1
 
5:42 AM
@priya hey.. looking fr me ?
 
6:07 AM
@Uni how was yur school ?
 
@ItachiUchiha very... school-ish
 
6:23 AM
haha
do you play any outdoor games at skool ?
 
Nope, not a sports fan. :)
If I have time, I'd rather code or surf SO.
 
@ItachiUchiha yes
 
in how many yrz will you be moving to high school ??
 
Me? I'm studying high school.
 
@priya did you resolve the issue ??
 
6:27 AM
actually i tried working on your suggestion :developers.google.com/webmasters/ajax-crawling/docs/… on this. But i am facing problem in creating html snapshot
 
then how many years for collage ?
@priya I can only look into your issue only after a couple of hrz..
 
oops..
okk i am waiting
as i tried a lot
hope ur research could help
 
to be frank i have neva wrked on it myself
 
i knw
 
but it sud be achievable ..
 
6:32 AM
but still something
hmm.. it is
 
Is there a lightweight solution to check if a Class is loaded in the runtime environment? I'm mostly looking for a lighter method than Class.forName(), since it throws an exception when the class is not found, and under my usage I expect the target Class may not be there most of the time, and generating an exception stacktrace to catch and ignore seems performance-bad
 
oracle docs uses the # and they are still able to pull it off on google
 
Or is it true that when your catch() Exception type is not used, the exception is caught but never thrown? I read that somewhere, but I'm superstitious..
 
actually we are using a headless browser HTML unit for creating HTML snapshot but its not working
either our servlet filter mapping is wrong or some other issue
can't get
 
@uni when you catch an exception, its totally on the dev whether you want to throw it back to the caller or consume it inside the catch
 
6:37 AM
as soon as u get tym look something for me..
 
@ItachiUchiha That's true, par program design; What I'm asking is that is it true that if your catch block catches an unused Exception object like this:
 
well, i ll try..
 
it would be a grd help for me as well as my team
 
try {
  sleep(10);
catch (Throwable ex) {
  // Ignore
}
^ Will the JIT's end neglect the exception altogether, so that it's never thrown to generate the Throwable object?
(That was actually something about catch (final Exception e), but exception types in catch blocks are explicitly final anyway)
 
why is JIT suppossed to ignore the exception ?
 
6:42 AM
Because it's not used. See:
try {
  incrementOrFail();
} catch (final OutOfMemoryException ex) { // !!
  // Ignore
}

void incrementOrFail() {
  if (buffer.length > 100)
    throw new OutOfMemoryException(); // thread stops here and realizes the nearest scope to catch, `try` block in this class upstairs, doesn't need the exception?
  // ...
}
 
Nope.. this is not what happens...
 
oh? enlighten me?
 
though I am not pretty sure. I will clarify it.
but ideally the thread sud come back to the caller
as the calling method is unaware of whats in store inside the catch block of the caller
the caller might be having a catch or it could be just throwing the exception without catching it..
in either of the case the call must come back..
though i will have to clarify about JIT's behaviour in such scenario..
 
@ItachiUchiha From what I've read when I come to the final keyword, final Exceptions are are designed to escape quickly - if the catch block remains untouched when the try block was implemented, it will be altogether ignored; and if the exception object is not used within the catch block and it was not marked with volatile, it will be JIT'd away, in name of optimization.
See here:
try {
  crashButReThrowAndNotHandle(); // !!
} catch (final Ball ball) {
  // Exception
}

void crashButReThrowAndNotHandle() throws Ball{
  try {
    crash();
  } catch (Crashing crash) {
    throw new Ball(); // 2. same here.
  }
}
void crash() throws Crashing {
  throws new Crashing(); // 1. thread comes here and realizes this object is junk and not used the nearest scope, so the thread pointer moves back to the other method, but doesn't actually `new` an object.
}
I'm superstitious though, I'm not sure if the initialization of the exception will be optimized away within pass scopes, so I'm scared to do this:
boolean isClassPresent;
try {
  isClassPresent = Class.forName(mahClassName);
} cath (ClassDefNotFoundEx ex) {
  // Ignore
}
 
7:05 AM
Interesting..
 
I know! I'll do a test!
 
7:40 AM
Hiya @Rahar17, welcome to Stack Overflow!
 
 
1 hour later…
8:46 AM
@Unihedron told ya :P
 
@ItachiUchiha
hey
got
smthng
???
 
I just landed !
going through the url
 
okk..
ping me as u gt smthng
thanku
 
btw, where have you got stuck ?
 
when we wrote our url on facebook debugger its still not reading the further inner content of website
it only fetches the initial content and are not changing with change of url
 
8:52 AM
can you show me a sample url ?
 
www.example.com/#postquestion/1406271843591
its original
now we want to reach the particular ques
but because of hash its not going further nd stops before it only
you want the code?
 
@priya google says, an ajax request can only be made crawlable with #!
 
right
i have now placed ! mark with hash but till no result as we want
you have used fb debugger
 
nope, never worked with fb api
 
okay just access it with ur id and write there any website
 
9:02 AM
www.example.com/ajax.html#!key=value

to temporarily become

www.example.com/ajax.html?_escaped_fragment_=key=value
Your server, on the other hand, needs to know that it has to return an HTML snapshot, rather than the normal page sent to the browser
 
yes thats the prob we are not knowing about the creation of htmlsnapshot
let me show the code i'm working
package com.server;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.annotation.WebFilter;
import javax.servlet.http.HttpServletRequest;
import com.gargoylesoftware.htmlunit.WebClient;
import com.gargoylesoftware.htmlunit.html.HtmlPage;

//@WebFilter("myservlet")
the servlet i'm working on
got from google only
 
You are using a Servlet-Filter over here..
Whats the problem here ?
you are just check if the url has _escaped_fragment_
If it has, you are returning the snapshot as a xml -> http://www.enggheads.in/filter/#!question
out.println(page.asXml());
@Unihedron der ?
 
9:42 AM
if i write that p;articular url on fb debugger i shows there
it shows
 
9:57 AM
sorry ?
 
for what
its ok
 
I didn't get what you said here - if i write that p;articular url on fb debugger i shows there
 
oh i m saying that when i put the url:enggheads.in/filter/#!question on fb debugger it will show the fetched url of escaped_fragment
 
well i guess either I am or you are mistaken here
the code that you wrote, will filter only the url's with escaped_fragment string in it !
 
hello guys : ]
how you doin all here?
 
10:02 AM
hey Ivan !
great.. hbu ?
 
basically i got a problem over here.... more on programmers side
im fine... but theres this thing that boggles me
 
shoot..
 
i came from a c#, .net background,, and been coding in java a few days earlier
my experience with java is,, like,, its fine,, its the same as c#
the problem is,, our professor ask us to create a project... basically just a dekstop application...
and so...
 
@priya do you get what I am trying to say here ?
 
we are 3 members in a team,, and our professor wants us to use a 3 tier approach
@ItachiUchiha are you familiar with 3 tier approach?
 
10:04 AM
@IvanMatala ok ! thats great !
 
basically, my friend A is assigned with the presentation layer,, me,, im assigned at business logic,, and my friend B is assigned with the data access layer
friend A finish creating the Java GUI Swing stuff...
and friend B is finished creating the database, the schema,, in mysql...
so Im the only one not yet doing anything...
i have no idea where to start
i know the logic in the program.
 
haha
 
but the problem is,,, ive done quite research... like the 3 tier approach, ive read about Java EE and stuff
 
you need to connect the presentation layer with the data access layer, filtering data !
 
but all research ive done is geared towards web applications, ours is just using Java GUI, swing approach
 
10:06 AM
its the same thing !
 
so the question is.. how do we do the business layer?
the first thig that came in my mind, is,, just insert the logic inside Friend A swing gui..
 
Business Layer is the nothing but consider it as a filter !
 
but i think its not correct,, since the presentation layer and business layer will be interwtined..
 
where you can apply logic
 
and I cant find samplejava desktop swing applications that is 3 tier
 
10:07 AM
consider a simple scenario where there is a textfield, in which you can enter the name of a student
 
:(
ok....
 
and on pressing a button you can view his percentage
 
ok....
 
now, the database has individual marks for the student X
 
ok.
 
10:09 AM
so your business layer passes the name of the student from the textfield to the data acesss layer
now this layer return the business layer 10 different marks for 10 different subjects
the role of the business layer here is to calculate the % for the student and return just one single aggregate X% for the student, instead of 10 different marks
@IvanMatala makes sense ?
 
yeah makes sense
problem is
how do i implement it
like,, should i use java ee
confusing stuff
or glassfish
or just create a new class???
 
why should you use javaEE ????
just a new class
that is it !
 
coz i search 3 tier in google
3 tier java
and a bunch of java ee displays
do u have any experience with java ee???
 
3 tier means that your each tier can be replaced without having any effect on the other tiers
Have you used eclipse ?
 
umm, how do i interface my business layer to the presentation layer and to data access layer
i Used netbeans
my friend A passed me already the project files,, those are just Swing GUI forms
im stuck on how do i create a business layer on it.
and how to interface
I know the logic,, but like im stuck in the proper way of doing it
like java design patterns for 3 tier apps
 
10:13 AM
how do i interface my business layer to the presentation layer and to data access layer - Presentation layer will call your business layer ! In-turn business layer will call data access !
 
we are told to use netbeans
 
this mean that your presenattion layer will have an object of the business layer class to consume the methods written in it
 
Ohh, so I create a business layer class
 
similarly, the business layers will have the objects of the data access layer
 
but isnt it right to instantiate business layer objects in the swing form?
and fill it with methods right
 
10:15 AM
business layer objects in the swing form ??
 
ok w8, im currently screenshoting something.
ill show it to you
 
post it here picyou.com
as other links are blocked by the firewall
 
@ItachiUchiha can you see this
are you familiar with swing Itachi
?
that is my friends A work
basically, what he did is just drag and drop controls.
but there is no logic,, im assigned with the business logic
 
@IvanMatala I can't see the pic, and yes I am familiar with swing
 
ok im uploaidng it to picyou
so lets say I created a businesslayer.java
where exactly,, or where is the proper way to insert that object in the presentation layer
 
10:26 AM
onClick action of Add and Delete
 
oh...
hmmmm
yeah i think its too common sense
but there is something thats telling me something is wrong if i do that
i dont know why. just my gut feeling
 
There is nothing wrong in it !
 
@Itachi,, how about how do we interface the business layer with data access layer
what exacgtly is data access layer
my friend B just created database
how does one create a data access layer on it
?
 
you just need to create the object as a class level variable of the UI class and instantiate in the Constructor !
All these layer are nothing but logical separation of logic !
mostly done by using separate class for each one of them
 
i see
how about the data access layer
what exactly is it?
is it just database
so business logic will create the sql statements????
to conenct to the jdbc
or is it wrong way?
 
10:30 AM
business logic will create the sql statements - No !
this is wrong
consider my example which I just gave you !
business logic will just pass the name of the student to the data access layer
 
ahhh
i c
so the data access layer,, is also another class
 
there will be some method in the DAO layer
 
?
DAO?
 
public List<Integer> fetchMarks(String studentName) method be there in your DAO class
DAO -> Data Access Object
 
i see
so what exactly doies the data access layer contains
the string conenctions / jdbc drivers?
 
10:35 AM
@IvanMatala yes, both connections and drivers will be initiated in this layer
 
im confused between data access and business layer
regarding the fetchMarks
isnt it there is replication?
of methods
?
coz,, presentation will pass name of student to business
and then, business will pass name again... to data access layer object
 
in business layer the method would be
public Integer fetchMarks(String studentName)
coz it will not send the List of marks
instead it will perform operations on it and just return one aggregate %
 
fetchMarks belongs to which class?
business or data
i see
i now understand it.
i think something is wrong
if fetchMarks belongs to Data access layer
then , why is performing operations on it,, like returning a single aggregate/..
isnt it,, performing operations is the duty of business
?
 
10:51 AM
fetchMarks is a method that is present in both the classes
you can rename them depending on your wish
fetchMarksDataAccess/fetchMarksPresentation
just to make you comfortable
 
11:12 AM
Itachi
have u used java ee
 
yes
I work on JavaEE
 
is it hard?
i want to use java ee with this 3 tier project
 
Why do you want to use JavaEE ?
 
because it sounds impressive?
i think its advanced Java
 
yes it is !
 
11:17 AM
it sounds impressive?
 
but, for this project, I would advice you to KISS it
 
i see ^^
how hard is java EE
like,, is it similar also, like I should create classes?
 
How do i use Java EE with swing apps
 
it is similar
just a simple twist with the architecture
you will be using most of it to create webservers to host website
 
11:19 AM
twitch?
i think twitch is for web apps
how do I use java ee if i only use swing forms/desktop gui
 
its twist**
 
223 new messages..
 
11:35 AM
majority of my search ,,, java ee is for web apps, how can I connect my swing app to it ? :(
 
11:57 AM
hi all
anybody having experience in spring security
 
@IvanMatala back
 
i think ill spend more time if ill use java ee
 
@IvanMatala yes
and you dont need it in the project that your professor has given ya
 
Hi all
Im getting some problems with inheritance
Example:
public class Vehicle {
    private int numPassengers;
    private String colour;

    Vehicle(int passengers, String colour) {
        this.numPassengers = passengers;
        this.colour = colour;
    }

    public String toString() {
        return colour + " " + numPassengers + " passengers";
    }
}
I have my vehicle class
now I want to make a Car class which extends the vehicle class, but then I want to add anoher parameter to my Car class
it doesn't seem to work
Here's my Car class:

public class Car extends Vehicle{

	Car(String colour, int passengers) {
		super(passengers, colour);

	}

}
How do I add nother parameter to my Car?
 
public class Car extends Vehicle{

   private int noOfDoors;
	Car(String colour, int passengers, int noOfDoors) {
             this.noOfDoors = noOfDoors;
		super(passengers, colour);

	}

}
 
12:09 PM
okay
That I know,but let's say I want something like this
public class Car extends Vehicle{

	Car(String colour, int passengers, int numberOfDoors) {
		super(passengers, colour);

	}

}
see number of doors
it's a new parameter
 
You can add any parameters you want, but you need to call a super class constuctor that exists.
Vehicle does not know anything about numberOfDoors, so it's used only in Car()
 
exactly
so I can add a parameter in Car but the I just need super for the 2 parameters I need?
 
2 mins ago, by ItachiUchiha
public class Car extends Vehicle{

   private int noOfDoors;
	Car(String colour, int passengers, int noOfDoors) {
             this.noOfDoors = noOfDoors;
		super(passengers, colour);

	}

}
@Sabಠ_ಠ
 
so whatever you need to do with numberOfDoors, must be done in Car
 
Aha
I got it. Thanks @ItachiUchiha @kiheru :)
 
12:11 PM
public class ClassName {
  // Class fields
  boolean isJoyeousClass;
  // Constructor
  ClassName() {
    isJoyeousClass = true;
  }
}
 
How? I don't understand the question. the super() call above looks correct
 
@Sabಠ_ಠ super should be the first statement inside the constructor
 
Yeah
 
@ItachiUchiha That's not right, super() call must be the first statement in the constructor!
Oh, so you did realize. :P whatever
 
@Unihedron :P :P
 
12:14 PM
:P
but what about the private ints in my Vehicle class
I get an error in my Car class, I'm supposed to change it to Protected. :S
 
You can access them if they are visible.
 
yeah
 
You can also create fields that are already in Vehicle class, in the Car class
 
but if they are private, can I make private int numPassengers in my Car class?
 
No matter the visibility level, you can create fields with duplicate names than that of parent classes; see here
 
12:23 PM
You probably want to access numPassengers in some way in Car. (Otherwise there's little point in deriving from Vehicle). For that there are two choices: 1. relax the protection level of the fields (package private would be enough, assuming the classes are in the same package), or 2. adding accessors with relaxed enough protection level
 
how
?
 
which?
I mean, those are two different approaches
 
I mean relax the protection level
I just changed my private to protected in my vehicle class and works like a charm
 
relaxing the protection level would work like this:
currently they're private:
    private int numPassengers;
making that package private would be simply:
    int numPassengers;
(for some reason people tend to use "protected" there, despite the default access is often loose enough )
yes, that's the way it works
 
@kiheru default access is lovely. Did you know that when the compiler needs to grant access to private inner static classes, private methods are converted to "accessor methods" which are of default access?
 
12:30 PM
Yes, I knew that. I think I originally found it out because of some efficiency warning in FindBugs or PMD
 
class MyClass {
  static class Stone {
    private void throw() {}
    // compiler generates:
    // void throw() {
    //   throw();
    // }
  }
  {
    new Stone().throw();
  }
}
 
I consider it a bit of a design flaw in the language that the private members of inner classes are nominally accessible.
If they weren't the above effect would be obvious
I didn't even expect them to be visible, until I saw some code that used that property
 
exactly
this assignment is weird
I need to edit the lecturers code to get it right
the parameters are swapped, so it's a problem at times
now I'm trying to make a plane class
and eclipse gives an error I need to change color to Static
wtf
 
static? don't do that. All vehicles would be of the same color in that case
 
aha
getting an error with my plane though
public class Plane extends Vehicle{
	private int planeNumber;
	private String planeName;

	Plane(String Colour, int passengers, String planeName, int planeNumber) {
		super(passengers, colour);
		this.planeNumber = planeNumber;
		this.planeName = planeName;
	}

	public String toString() {
        return colour + " " + numPassengers + " passengers " + planeName + " " + planeNumber;
    }
}
super(passengers, colour)
Here colour gives a syntax error
 
12:44 PM
Colour =/= colour
check your dummy variables
 
you have both Colour and colour
 
agag
I just realized it before u told me xD
 
haha ufunny
 
01:00 - 13:0013:00 - 23:00

« first day (1409 days earlier)      last day (3517 days later) »