« first day (1422 days earlier)      last day (3502 days later) » 

6:41 AM
And i'm using betBeans — MaTaMoR_ 12 hours ago
^ lol
 
7:23 AM
Hiya @kiheru
 
hi
 
Please CV this for debugging reason. From this picture by OP it shows that the error is on class "Eventos". However he posted the other class and we would have no idea what's wrong with the other class until he posts it. stackoverflow.com/q/25825722
also downvote ^
same treatment for his other question which is basically the same pls stackoverflow.com/q/25821027
 
7:36 AM
thanks @kiheru :)
 
yw
 
I have failed to reproduce this behaviour. With the exact same code copied into my event handler, I am able to break two block with a wooden pickaxe. @ChrisMantle please help close this for unreproducible. — Unihedron 3 mins ago
^ this too
 
 
1 hour later…
9:06 AM
hi everyone
 
9:25 AM
hello @humphrey :)
 
Guys I went to HP for an interview . but then I told them I am comfortable with php and mysql . after a month they called me and said to me that I passed the interview and I should come for an assessment test and I should revise Java and dot net .
I would like to know what kind of questions or tasks should I expect.
plse help @Unihedron
 
@humphrey For interview questions?
 
i guess they might give me a test something like coding a simple program . i paseed the interview now am going for assessment
 
Just remember that they're not expecting you to write a fully functional and "the best" program off the bat. Micro-optimization happens after you complete the program. What would make you attractive as an interviewee is to be able to discuss which algorithm you build your program, pros and cons of it, how expansive it is, and insighted comments during the development would be great as well.
And again, despite being overused and is somewhat lame now, don't be nervous.
 
Hello guys, is there any way to simulate websocket concurrent connections ?
 
9:30 AM
@Ahmad What do you mean?
like ajax in java?
 
@Unihedron I developed a chat project with websocket protocol on PHP
I want to make load test to see what my script will do ?
 
@Ahmad I'm no good on PHP.
@humphrey good read:
in The SO Tavern (Free Snacks), Aug 21 at 10:00, by HamZa
hahaha dude. I was doing an internship 2 years ago (or was it 3?). Anyways, for the interview. It started with usual introductions etc... They were amazed that I didn't follow "programming course" at school so they asked me whether what I'm doing there. I told them the story that I'm self taught. So the interviewer wanted to test me:
- Interviewer: you have a website (he started drawing a basic skeleton of it: header, content, footer etc), how are you going to make this?
- I was a bit confused of the meaning, but I guessed that he wanted me to write code to make that skeleton. So I started
 
@Unihedron Nice :D, I thought that I'm in php room.
any way, I tried to make 1000 connection on android app, but i get out of memory exception.
I want any way to make big numbers of connections "wss://"
 
this is java room
 
thanks man
 
9:37 AM
Yes I noticed, but my problem didn't relative to php
 
Good luck on your interview @humphrey.
@Ahmad Maybe 1000 connections aren't a good idea.
 
cool
 
Can't test the reproduction myself, so I'll refrain from voting
 
@Unihedron I know, sorry I didn't mention that i got that exception after 43 connection
 
9:40 AM
@Ahmad I've never really done 3+ connections over websockets.
 
someone know if it exist a google irc channel for google place api questions ?
 
@Aymenworks I'm not sure, but why are you asking it here?
 
Because I'm using google photo api for my mobile app and can't find any high quality photo like we can see in some app using it
 
hey
 
Hiya @TGMCians
 
9:52 AM
whats' up ?
 
@Aymenworks I'm confused, what's the problem?
@TGMCians Great! I'm writing regexes for sam's bot.
 
I can't get any high quality photo using google place api
 
oh I see. great
 
but others app use it and get them
 
height — the maximum height of the image.
width — the maximum width of the image.
 
9:55 AM
I already tried to use it
 
Ok then. You can try googling for an irc channel that might have people to help, but I'm not sure if there is one. I usually google more, give up, or file a ticket on google's services.
 
10:08 AM
heya
@Aymenworks @TGMCians @Unihedron @kiheru
 
Aymenworks left, and hi @ItachiUchiha
 
hi @ItachiUchiha
 
o/ ItachiUchiha
 
ssup guys ?
I am still wondering why has Google has not published any API for its play store..
 
I remember that somebody tried this own by crawling or so. afaik that code is available on github
 
10:17 AM
yeah
 
i m not sure why you are looking to use those api ?
 
that can be achieved via crawler
 
yeah java people know more what I know for this..crawl..bot
Is crawling a website is a legal process ?
 
@TGMCians it's what wayback does
I think as long as you follow robots.txt ethically, crawling is acceptable.
 
sorry i donno know robots.txt what it means. I saw one time at server file location
 
ok thanks
 
Welcome. Servers may specify how they want robots to behave. It is recommended you stick to them. They might look like this:
User-agent: *
Disallow: /cgi-bin/
Disallow: /tmp/
Disallow: /junk/
Clearly, for this server they want all (by asterisk) robots to stay away from those three directories.
 
ah got
for ex www.flipkart.com
people crawl this website to get the data..
 
hehe :)
 
how they do ? fetching the data of products ex information, images etc
 
10:28 AM
http requests? there are many ways to crawl a site
 
yes simple I want to make a bot to crawl
& update it if any changes via same process
at the same time save the data in my database..
& use it anywhere I want that is I am looking
 
A bloom filter might be what you want, but I'm not sure.
 
ok I will research more for this
 
Good luck!
 
it looks very interesting
 
10:31 AM
haha yes. always fun to learn new technology!
 
I never did so far in my exp
yeah
 
10:43 AM
yesterday, by Unihedron
I've created a poll related to which IDE our developers use for coding in Java.
 
jeez
I have to crawl each of the sites :(
 
@Unihedron betBeans ^^ :D
 
:D
 
@TGMCians star the message
@Unihedron
yesterday, by kiheru
I'm too dumb to know the difference between different eclipses. I don't do EE but what's the difference between Standard and Java
Even I wanna know the diff
 
maven... surefire... native interface..
 
10:46 AM
Are they part of Java or Standard ?
 
no, apache
 
i meant eclipse java or eclipse standard
 
eclipse standard does not come with maven, surefire and the native java interface
 
are you kidding me ?
Java EE does come with Maven
 
it's m2e
maven in eclipse java is for surefire
 
10:55 AM
yeah m2e
is it diff from m2e ?
 
 
1 hour later…
12:10 PM
Hallo! It's a beautiful Sunday to code!
 
Yeah!
 
This laptop sucks
I need to buy a new one
 
12:26 PM
Gimme the old one with all your codes on it
@kiheru it doesn't work..
@kiheru no it works :D :D :D
 
@Sabಠ_ಠ That's a rather vague problem description. Anyway, I'm just about to leave for some time, so you need to solve it either yourself, or with someone else's help
ah, ok
 
private JButton sample = new JButton();

private Border impossibleMove = sample.getBorder();
:D
 
if you don't use `sample`, you could do just:
`private Border impossibleMove = new JButton().getBorder();`
 
Oh nice :)
Thanks
 
private Border impossibleMove =  new Border(){};
 
12:39 PM
uhumm
this doesn't work
 
It's what JSON does.
 
I need to add unimplemented methods and use them :S
 
public JSON NULL = nw JSON() {};
 
1:17 PM
Good morning, Java!
 
morning
 
room topic changed to Java: Holy cow! It's Java! [java] [javabeans] [java-ee] [jsp] [servlets] [swing]
Hi @Unihedron
 
hi @Michael
 
Morning @Michael
 
Still working on your chess game, @Sabಠ_ಠ?
 
1:19 PM
@Michael I could say I'm finished :)
But the only problem is I can't force a double jump
It's checkers not chess.
 
Ohh ok.
 
I have the ability to scan the regions to find possible moves
but once I do a jump I can't move again, since the next player turn happens
 
@Sabಠ_ಠ I see.
 
Any idea how I can make the logic?
Basically I have 2 methods
1 to do the jumps/move and 1 to scan the regions
the one that scans the region simply shows the possible moves
the one that does the jump/move does so when the user selects a pawn and click on the target location(which was highlighted by the scan method)
 
So you need to combine the two methods somehow.
 
1:36 PM
hmm
look at this
 
 
4 hours later…
5:18 PM
heya @Unihedron
 
5:36 PM
Hi there @Williams
 
 
1 hour later…
6:38 PM
hi
i have a small question related to references
 
what is your question
 
i am unable to unshuffle a list
here is a small code
if i replace line number 4 in this code by
GlobalSongList.GetInstance( ).backup =new ArrayList<SongDetails>( GlobalSongList.GetInstance( ).GetNowPlayingList( ));
i am able to unshuffle it
but this line creates a new object and hence it consumes memory and i don't want that
 
There's no unshuffle method. To implement one would need to store the original order - and that takes the same amount of memory as a new list
 
can't i use reference ?
 
6:56 PM
Hmm. Unshuffling might be technically doable by using known random sources
 
Hi! I have difficulty using SwingWorker to access values of an function running in other thread stackoverflow.com/questions/25836908/…
 
Is the amount of memory used really that serious concern? It's just n * pointer_size + overhead
 
yes it is
the list is about 2000-3000 long
it is of a custom class and the class has about 7-8 variables
so you can say the list is about 25,000 characters big
 
I have a class with a method run() which performs all operations. Now I am executing this method in GUI using SwingWorker and I can not find a way to retrieve the intermediate values.
Also Java does not support pass by reference.
 
3000 * 8 = 24kB (assuming 64 bit system). The size of the objects you have in the list does not matter. The list has just references
 
7:08 PM
Which I was thinking of using to get values, status from the thread while it is executing separately
 
@kiheru I am exactly doing that
But if you can see the code, I am not extending that class with SwingWorker
I am only using SwingWorker to execute that particular function in a thread
0
Q: How to get values from another running thread?

LifeH2OI am executing itasser.run() in my GUI class. But because it is a complete process itself, publish(itasser.getTimeToFinish()) executes only after itasser.run(). So is there a way I can use itasser.getTimeToFinish() or other values while run() completes? I have many other objects like itasser t...

 
well the app crashes if i create a new object (and if the list is very long)
so i think it is a a concern i guess
 
@LifeH2O Is there a particular reason to have a task that has no way to report its status?
To me that looks like you're specifically avoiding to use the mechanism that allows using interim results
 
I have many similar classes that upload some protein to a specific 3d modeling website, get its by parsing webpages using jsoup
Yes, kind of. I am making a workflow. I have many classes, each does its own task
 
7:14 PM
@AnkitSrivastava an app can crash many ways. Does it die with OutOfMemoryError?
 
the strange part is i don't see anything in the log cat
 
@LifeH2O any particular reason for the tasks to not have a SwingWorker like interface? I mean, they could have their publish() equivalent
 
Translate DNA to protein, use different protein modeling websites etc.. I am trying to remain consistent, with all classes have a same structure, input, run and output
 
@kiheru
here is a better version of the code
which looks a lot cleaner and is easy to understand
 
I just want a class to remain a class, having control on how I can execute it and get what I want anytime. If I make it a swing worker, It will be probably difficult
 
You could, run those in separate thread(s). And then have the methods for getting their time estimates. But that loses most of the advantages of using a SwingWorker
 
So I can not do it this way? I have to make them a SwingWorker themselves to get their values?
 
@AnkitSrivastava does the app run fine if you don't copy the list? (other than the original getting shuffled)
 
If I do that, I will be able to get only one value which is sent by publish()?
 
app runs fine if the list is small
ignore my previous comment
yes app runs fine
 
7:24 PM
If you want to use publish(), the easiest way is to make the tasks SwingWorkers, or have a similar interface
 
Is there anyway to execute process() without publish()?
 
They don't need to extend SwingWorker. You could well make the tasks accept an interface that can accept time estimates (which would at the SwingWorker side wrap publish())
what would that process() call do?
 
process will update the GUI with status or remaining time etc? I may do somthing else later
"You could well make the tasks accept an interface that can accept time estimates (which would at the SwingWorker side wrap publish())" Can you explain a little? With what interface I should extend that task?
 
If you insist on using a task interface with .getTimeToFinish(), I'd just run them in a thread pool, and query them in a swing Timer. (after making sure the relevant methods are thread safe)
I meant making the tasks accept an interface (in constructor or as a method parameter, does not matter). Something like:
   interface TaskObserver {
       void timeEstimate(long time);
   }
 
I was thinking of doing similar. Thats a great idea. I want task to do whatever it is suppose to do, and update the GUI separately.
 
7:36 PM
then at the swing worker side do something like:
   task.setObserver(new TaskObserver() {
      void timeEstimate(long t) {
          publish(t);
      }
   });
Or something like that. Likely far from compiling. But that idea
 
guys
by the way
do you make apps ?
or what do you do and where r u from?
 
apps as in android app? no (not yet at least)
 
okay and what do you do ?
 
maintain a swing program atm, mainly
 
This looks clean enough. How is this setObserver() supposed to work? Are passing it a SwingWorker?
You are passing it an interface object, and that interface is extended by SwingWorker, right?
 
7:41 PM
Probably addObserver() would be better, if you ever want to have more than one observer for single task. The usual observer pattern implementation.
For the code snippet above, I was thinking passing an anonymous internal class of the swing worker (which calls the publish() of the said worker)
 
I have to study obeserver pattern then. If addObserver is the only thing I have to add to the task then it is good to go
 
well, then the task should obviously call the timeEstimate() of the observer(s), whenever it want to update the estimate
(I suppose it's best to let the tasks decide when to update the estimate. They know it best when the status has changed)
 
Yes, it is. I want the task remain un touched as much as possible so that I can use them anywhere, anyway I like. Thank you for help :)
 
you're welcome
Somehow guessed from the reluctance to make them SwingWorkers :-) Luckily it's possible to create one's own interfaces to abstract such things away
 
8:00 PM
I am working first time in Java (for my MS research). SwingWorker is easier than using Runnable. Using Java I feel stupid because C# let us do many things freely, while Java enforces to do things in particular way.
 
C# certainly has a lot of convenience syntax for many common things
That observer pattern among the things :-D Events are builtin in the language
 
Hi any one can help with starting Isqlplus oracle please ? I have this problem

http://stackoverflow.com/questions/25817967/oracle-isqlplus-wont-start-and-stay-on-starting-status
 
8:25 PM
How can there be instance of interface TaskObeserver as you have shown
task.setObserver(new TaskObserver() {
      void timeEstimate(long t) {
          publish(t);
      }
});
I am having difficulty implementing as you suggested. Can you add a small snippet as answer on the question?
 
Any particular problem? That's just an anonymous implementation (you likely have several already since you have a swing program). I'm about to go to sleep, so I'm not going to write much code now
basically, something you'd do before itasser.run()
 
All Task classes implements an interface IProcess. You are saying that task should have a method setObserver, which takes an anonomoys TaskObserver as parameter.
 interface TaskObserver {
     void timeEstimate(long time);
 }
 
yes (or addObserver(), if you want to prepare for having more than one observer)
that the TaskObserver I used just happened to be anonymous. The method called does not know that
 
in implementation of TaskObserver, you are using publish(). In java when I try to extend an interface with SwingWorker, it is syntax error
 
8:40 PM
In IProcess, a method
`void addObserver(TaskObserver observer)`
(or something similar)
I did not extend an interface with SwingWorker
 
Than how it will make use of publish() ?
without extending it with SwingWorker?
 
Take a look at the code you have in your question. If you add the setObserver() snippet inside the swingworker, it should work (except for missing definitions you don't yet have) - the publish() belongs to the enclosing SwingWorker
That is, add it inside a method (doInBackground)
 
Ohh!! I got it
I thought you are asking me to add it in the task implementation. That's fine, going to try that. Thank you
 
Just an adapter between what SwingWorker expects, and what IProcess can handle (a TaskObserver) :-)
the task implementation will need the method for adding observers, and calling the said observers when it needs to
 
8:56 PM
(I took a look at some observer tutorials. Many use Observable and such; I'd say don't bother - that is not type safe, uses up the only super class you can have, and you may have better use for it. Also if you want fancy thread safe adding and removing observers, don't bother with manual synchronization unless your requirements are really weird: CopyOnWriteArrayList exists for that exact purpose. Thou shall not reinvent the standard library)
now I'd really better go to sleep
 
in Itasser.java

public void addObserver(IObserver observer){
this.observer = observer;
}

interface IObserver.java

public interface IObserver {
public void timeEstimate(int time);
}

in doInBackground() in GUI

itasser.addObserver(new IObserver() {
@Override
public void timeEstimate(int t) {
publish(t);
}
});
OK! You should sleep. I have also looked at Observer pattern examples, they are complex. I'll try to make it work the way you explained
 
9:17 PM
@kiheru That's working perfectly. You saved my day.
 
 
2 hours later…
11:21 PM
Hello
 
boo
is there a simple java function to check if an int is in an array?
 

« first day (1422 days earlier)      last day (3502 days later) »