« first day (1461 days earlier)      last day (3477 days later) » 

12:27 AM
I disappear for 4 hours, and the place just dies!
Anyone alive?
 
 
2 hours later…
2:15 AM
So I'm beating my head against the wall with dealing with java, xml, and namespaces
I have an XML file that has a default namespace. I'm reading it in via documentbuilder, set to namespaceaware. I'm using xpath to get some particular nodes and manipulating them. And then I'm writing the xml document back out using a transformer. I'm inserting a new element within the document, and it's outputting an xmlns:"" in the element I'm adding, which of course breaks my validation. Any ideas why that might be happening?
 
3:00 AM
I'm trying to convert something in ISO8601 format into milliseconds... how do I accomplish this?
 
 
3 hours later…
6:02 AM
Hey Java!
 
Morning Java
 
mornin'
 
Lunchbreak now Uni?
 
6:17 AM
Programming class :)
 
hehe
 
I'm trying to convert something in ISO8601 format into milliseconds... how do I accomplish this?
 
@David code
 
If you use Java 8, you may find this discussion interesting. — PM 77-1 5 hours ago
o.O... uh
why did it convert my link to that.
 
it's called one-boxing
 
6:23 AM
0
Q: How to convert ISO8601 format into milliseconds?

DavidI'm pretty surprised that I haven't yet found a really easy way considering how often ISO8601 is used in JSON. Basically, I'm taking a string that looks like this: 2014-10-23T00:35:14.800Z and converting it into something like 50 minutes ago. First, I have to change 2014-10-23T00:35:14.800Zto 2...

 
6:41 AM
in RegEx, 46 secs ago, by nhahtdh
0
A: Java Regular Expression for detecting class/interface/etc declaration

nhahtdhThis regex is an incomplete specification of Java class and interface declaration. However, it can match declarations like this: abstract class X<B extends Integer,D extends java.io.InputStream,R extends Comparator<? super D>>extends java.util.ArrayList<Integer>implements java.util.Queue<Integer

 
Msn
7:06 AM
Hi, Can we define individual anonymous class in a java pgm?
 
@Msn define individual anonymous classes? I cannot think of grouped anonymous classes
 
Msn
@Unihedron So u mean individual classes are allowed?
 
@Msn What?
 
7:21 AM
Heading home cya :)
 
cya
:)
 
^ in dire demand of closing :O
 
8:22 AM
faced a problem when testing my app on windows (im osx): CMD does not send keypress/stdin to a java process while its printing out to stdout.. Works nicely in the linux world. I guess the problem is within the cmd console itself: any solution to this?
 
@DavidS Try ANSI console
 
Hi guys, could some of you please help me with Java REGEX?
I've done the thread aswell, stackoverflow.com/questions/26439728/… but the answer given does not work
 
if (inputText.matches("[0-9]+\\,[1-9]+[0-9]*[;[0-9]+\\,[1-9]+[0-9]*]{3}"))
{
// do things
}
this is the correct way to do it
 
On an input 0,5;6,9;6,5;15,10 i will get an exception
exception will occur on an input "0,5;6,9;6,5;5,8" aswell
 
Read the tutorial, it will help you
 
8:43 AM
well as i understand [0-9] will take a digit +\\, is to use predefined command then [1-9]+[0-9] takes a value higher than zer but then comes the messy part which i can't understand
why wouldn't he just use +\\; ?
 
8:56 AM
@uni maybe if you ask him nicely, he will help you
 
I didn't ask anything?
@charen What's the problem?
 
I meant if he ask you(@uni), you will maybe help him :)
 
@Unihedron Well i try to take the text from the user input and tried to match it using .matches("insertregexhere") function but i wasn't able to get it to work and i did a workaround in a uglier way which currently works. (Created new method which returns boolean and returns true only if .split("[;\\,]") has a length of 8, .split(",") has a length of 5 and .split(";") has a length of 4).
 
Ah, what exception? Illegal escape sequence or pattern syntax exception?
Or rather, what was the code?
 
Oh no, i've done myself a thrown exception, if the input doesn't fit the value it will throw a new exception i've created.
match*
 
9:09 AM
Huh?
So what do you mean by "it doesn't work"?
 
I had an if/else there:
if (userInput.getText().matches("[0-9]+\\,[1-9]+[0-9]*[;[0-9]+\\,[1-9]+[0-9]*]{3}"){
//do things
}
else{
throw new exception
}
if i entered the correct input in form of: 1,2;2,3;4,5;2,3 i was always thrown an exception
The if clause was never entered
 
Can you use fixed font? The backslashes are escaping from the chat.
 
Umm, i'm new to chat, how?
 
When you type a multiline message this shows up:
 
Unleash the explanation you gave me last night Uni! ;D
 
9:12 AM
Click it.
 
@Unihedron ♥
 
I had an if/else there:
if (userInput.getText().matches("[0-9]+\\,[1-9]+[0-9]*[;[0-9]+\\,[1-9]+[0-9]*]{3}"){
//do things
}
else{
throw new exception
}
if i entered the correct input in form of: 1,2;2,3;4,5;2,3 i was always thrown an exception
The if clause was never entered
Okay
 
Ok, did you write this regex yourself?
Because [;[0-9]+\\,[1-9]+[0-9]*] doesn't do what you expect.
And there's a lot of catastrophic backtracking going on within it that would cause the regex running for weeks when hazardous input is given. @char
 
I actually created a stackoverflow thread and this was posted as an answer
 
... So? :P
I don't get it, where you're at?
 
9:26 AM
If you don't understand the code you're given in an answer, you will not be able to use it properly.
 
Umm, i'm at that point where i don't understand how to create that regex and i created "not so great" workaround to test my other code :D
 
@charen Should I write another regex for you? Gimme the specs. That regex is terrible.
 
Told ya @uni was your man :)
@uni he should also read the tutorial I proposed.
 
I had a comunity document about regex, never got around to finishing it
 
Well i read the tutorial, i've read them before actually, i've tried using visual regex codes but until this point this seems really complex.
 
9:30 AM
So what's the specifications?
 
The user input has to be in form x,x;x,x;x,x;x,x
Four times x,x - x can be any number from 0-infinite. Only integers of course, no double and floating point.
 
Define integers? Of the range 1-2147483647, or starting with no trending zeros?
 
From 0 (zero can also be) to yeah, pretty much infinite. But the highest cap could be set on 1000, because the number will never in real life exceed that point
 
So zero to anything with the exception that non-zero does not start with trending zero?
Try this out @char regex101.com/r/wW0xG6/1
Shorter and more readable version: regex101.com/r/wW0xG6/2
Optimized, slightly more efficient: regex101.com/r/wW0xG6/3
 
Testing it out now.
Third one gives an invalid escape sequence..
 
9:41 AM
All will. Double escape the backslashes, because that's how literals work.
(?:0|[1-9]\\d*+),(?:0|[1-9]\\d*+)(?:;(?:0|[1-9]\\d*+),(?:0|[1-9]\\d*+)){3}
 
Oh, thanks dude
it works :)
 
Great!
@char And for gods' sake, why would you accept a blatantly wrong answer?
 
Just because you get an answer it doesn't mean the person answering actually know what it's telling you.
;P
 
in Tavern on the Meta on Meta Stack Exchange Chat, 5 secs ago, by Unihedron
downvote pls blatantly wrong http://stackoverflow.com/a/26439995/3622940
 
I don't know, i think my mind was broken, was working straight with this project for about 13 hours for that point..
I've come to an understanding that it programming becomes utterly slow after a certain time and the break or sleep is neccessery. Starting next day with a fresh mind gives new ideas..
 
9:50 AM
I like to sleep on it. I code in my dreams ^^
 
How would you suggest to write - first an unclean version with no optimization and just rough and brutal method to get your program to work or are you starting from the beginning and polishing the edges as you code?
 
I've posted an answer to (as well as fixed) your question.
 
I will accept that and downvote the other one.
 
@charen Which language are you working in?
 
Java
and Python
I'd prefer Java
 
9:54 AM
Well if you're coding Java you'll virtually never have to worry about micr-optimization, that's performed by JIT.
And coding in Python usually doesn't necessarily mean you should wrench the thing to get it run better - Good Python programs are supposed to be like pseudocode; You write it the way even someone who doesn't code can understand it.
 
Well i'm studying IT in university and i'm taking an course called "Algorithms" which focuses mainly on sorting algorithms
 
Welcome to Java. Meet TreeSets and Collections.sort().
 
Yes, but what if you don't use the .sort()?
Can you calculate which method has the best average time performance and best worst case performance?
Or simply just watching 10 different methods and say, hey, this is more efficient than other ones
 
The best way to sort is to place in items into a collection sequentially on every dump.
Then no sorting has to be done, it's already in a sequence with virtually no effort spent.
@charen That's hard and almost impossible to benchmark because JIT optimizes away most of it and, in runtime, has about the same efficiency after ~10 runs.
I guess the optimal way to code in Java would be:
1. Use standard libraries instead of reinventing the wheel; or
2. Design a good algorithm and stick with it.
 
Oh, about sorting i have a great question about it.
If i have a class called Process which has two private integers inside - arrivalTime & burstTime. I've set class Process objects into ArrayList, four object to be exact. I have the ArrayList sorted according to their burstTimes (lowest first in growing order). Is there a simple way now to reorder them if el[0] in ArrayList has the same burstTime as el[1] in ArrayList but el[1]has lower arrival time, so i will swap their places?
So basically if i have two or more elements with same burst time i would rearrange my list beginning/middle or whatever position that they would be sorted according to arrival time?
 
10:04 AM
Yeah, of course. Can you write the Process class for me? In fixed font with a bit of indentation of course. Thanks ;)
Just need to figure out the accessors so I can sort accordingly.
 
Would you like the whole class?
 
Just the necessary stuff, fields and getters if any.
 
But this thing has to be done in other class, not in Proccess right?
Since process class doesen't know if he has brothers or sisters from the same class..
and elements with values are created in other class
 
Classy family :')
 
And yeah, the thing to remember is that i've figured out how to sort them once already, so there are these processes (4 of them) in an arraylist, sorted according to bt and waiting to be worked again according to at.
 
10:20 AM
Yeah right, gotta start the bot for that, I'll use ideone for now..
 
I miss Junior. Is he gonna come out and play today?
 
He might if Java 8 installs properly on my environment. :)
 
:D
 
Will this work @charen? ideone.com/GWPyAT
 
So this expects that list is already sorted according to BT right?
and now it resorts?
 
10:28 AM
It doesn't. The first check in the comparator sorts them, the second does nothing practical, it may well not be there.
 
okay
will try
 
Wait, actually I made a mistake.
 
You never rearrange them in list?
Or that's what 1 : -1 does?
 
We don't want to sort where the second field is not the same, so just do this:
    Collections.sort(list, new Comparator<Protsess>(){
      @Override
      public int compare(Protsess a, Protsess b) {
        if (a.getBT() != b.getBT())
          return 0;
        if (a.getAT() != b.getAT())
          return a.getAT() > b.getAT() ? 1 : -1;
        return 0;
      }
    });
 
will try
okay, seems to work, thank you :)
appreciate your help
 
10:36 AM
Great, well done! :)
Oh, you're welcome!
 
Hi everybody. Simple question. String something= "blabla sadsa bla fkjasdh blabla"; What´s the best way to count blabla in this string without use any library?
 
@Goldbones Oops, was just about to recommend Groovy. :)
Try regex?
 
yes. it´s the best option for this case?
 
Here you go:
String something = "blabla sadsa bla fkjasdh blabla";
Matcher matcher = Pattern.compile("blabla", Pattern.LITERAL).matcher(something);
int count = 0;
while (matcher.find())
  count++;
System.out.println(count);
 
Nice, Thanks
 
10:45 AM
brb, file system cleanup, only 3 GBs out of 74.5 GBs left on my OS drive
 
10:56 AM
Morning folks!
 
mornin
 
morn
 
11:33 AM
@ita sleeping ? :)
 
He's not in the room :)
 
I know ;)
 
How to use jsgf grammar?
anyone know?
How to use I mean how to write a grammar file that can recognize all english word
?
 
@Trevi I have read all the the documents, But could not understand, thats why I am asking here
my grammar file is working
 
@Tushar What's your specific problem? We aren't going to write a book in the chat room.
I've done that once, never again.
 
Haha :P
 
@Unihedron I have made a voice reconizer in java. I am using a grammar file in that project. Now what ever I say it reconize only few words which is contains by the grammar file. Its not possible for me to add all the english word in that grammar file,,,
 
@Tushar well look for a database/dictionary and hook it up to that?
 
11:57 AM
@Trevi Yes I have tried it. But grammar file have some rules. adding dictionary is not a solution
 
@Tushar well what are those rules, could you show me the grammar file?
 
sure
give me a moment
@Trevi
public <basicCmd> = <startPolite> <command> <endPolite>;
<command> = <action> <object>;
<action> = /10/ open |/2/ close |/1/ delete |/1/ move;
<object> = [the | a] (window | file | menu);
<startPolite> = (please | kindly | could you | oh mighty computer) *;
<endPolite> = [ please | thanks | thank you ];
this is just an example
 
So I assume the rules are the way that they are formatted?
 
yes
 
Well then its not impossible to pull it form a database
All you will have to do is convert the database input into your object
 
12:04 PM
this will be very difficult for me. How the voice command works which is made by google or microsoft? they can recognize all the word what ever I say!! also the accuracy is fantastic
 
@Tushar take a look at this question stackoverflow.com/questions/22058219/…
 
@Trevi cool!!! I am also using cmu spnihx.
 
12:34 PM
Anyone have any suggestion to making this algorithm more efficient?


void filter() {

DateTest dateTest = new DateTest();
filteredItems.setPredicate(li -> {

for (int i = 0; i < li.size(); i++) {

try {
dateTest.isValidDate(li.get(i));
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Date date1 = sdf.parse(li.get(i));
Date date2 = sdf.parse(listOfTxtFields.get(i).getText().replace("a", "").replace("b", ""));
if (listOfTxtFields.get(i).getText().contains("a")) {
if (date1.after(date2)) {
I made a check if the textField is date before the try loop, that helped
 
 
2 hours later…
2:28 PM
:O
 
Music?
 
^ He sang it :)
 
Not bad, can't say I like it tho
 
I want to have a nice microphone
 
I want to have a nice car
 
3:01 PM
I have a car, that's good enough for me
I'm a soprano so I need a high-quality mic so it can record me properly
 
I want a proper job.
Btw, smartphones actually have decent audio recording.
 
with a proper job I can get a proper mic :P
 
There are some apps out there that allow you to use your smartphone as microphone
 
Hey guys, ran into trouble here. I'm trying to implement round robin algorithm but i'm in different situation than this stackoverflow.com/questions/21803545/… example here. I'm working with ArrayLists and classes for processes and now i'm thinking what's the best alternative for linkedlist commands? For example .peek(), .remove() and .pop(). How could i use them on ArrayList
As for my example i have an ArrayList which contains elements from my created class, Process which already has arrivaltime and burst time, so i do not need to use linkedlist myself.
 
Hmm, I can't really understand that though.
 
3:07 PM
@Unihedron What do you mean, the algorithm or LinkedLists?
 
The algorithm. I googled it.
 
Umm, algorithm as i understand is pretty simple - it has a quantum time, for example 3, then every proccess is handled for 3 seconds, after 3rd second and the program hasn't finished then the process is placed in the queue
But my trouble is finding the similarities between ArrayList and LinkedList, since it's using some of the elements not defined for the ArrayList. For example .pop(). I know that .pop() removes the last element from the list?? (Pythonskills) but other things as .peek() and so on are difficult to understand..
 
Then there's Vector, more insanity :)
 
As i googled, i understood that .peek() returns the first element, so this should be defined for ArrayList lst.get(0)?
 
and Stack...
If you're looking for FIFO, you'll need stack
 
3:10 PM
ohh...
 
stack implements vector and maintains a standardized push pop structure.
 
Actually i think that this example's motoring i could use in my own program
But i don't understand LinkedList commands :D
 
I actually am not sure how you could implement that algorithm on an arraylist or a linked list, but it's just me, I'm not good with building algorithms :)
 
Well, the basics are same.. LinkedList is used here as i use my class Process (you worked on it earlier on actually)
 
@charen Oh I see
 
3:13 PM
I have a homework in a operating systems subject and this requires us to create a program which implements four methods
For the last one, where you helped me to compare, you solved my ending for shortest job first.
 
oh?
 
:D
Yeah, wanna see the whole app ? If you're running eclipse with JavaFX you should be able to open it :D
#codeismessy
 
Nah, I don't need the codez ;)
:status-need-mcve:
 
:D
Okay
 
Someone sent me money for a regex I wrote for them once. Crazy. Stack Overflow is about helping some other people. Helping is great learning.
 
3:18 PM
Nice
 
Haha, I would pay some money for some proper levels for my game..
 
Doing the Iron Will track in the kitten game is slow >_<
 
I just don't have the creativity
 
Okay, now my whole world collapsed..
I've created my gantt chart to create four rectangles as i assumed it did not need any more
 
@Trevi Oh? :)
@charen :o
 
3:20 PM
and now i need more rectangles
 
Holy rectangles
 
@Unihedron github.com/Dalthow/Etaron , you will need maven to run it. levels are drawn in paint
 
I'll see what I can do tomorrow, it's too late for me to write non-gibberish code :)
23:21
 
@Unihedron sure, will be here pretty much all day
 
It's hard work being a regex ninja
 
3:22 PM
I'm also learning C# as well, and C++ contest on first of november, I love bithacking :)
 
I wish you luck in that competition.
 
I'll ace it anyway.
 
:D
 
The competitions here are boring because it's about array manipulation and simple strings, and 80% of the contestants can't write code.
If I really want something nice I'd fly for hackathons or something.
 
why do they compete when they can't write code? XD
"Just so you know, I seriously flopped in 10 programming competitions!"
Not exactly something to put on you CV/resume :P
 
3:25 PM
certificate of participation
my friend joined just to get that :)
I glared at him afterwards, but oh well
 
Sounds like the stuff you give to kids; "since you participated, you're all winners, wee!"
I wanna draw something like the avatar for the bot...
Something I can do in <30 min
or maybe something like this:
 
:D
sumo from deviant art?
 
Well, from my DA
the syringe didn't take less than 30 min to make, but it was kinda fast
Unlike this one:
That one took half an eternity to make and the bubbles still aren't that nice
But practice makes perfect :)
(I won't post any more pics, I promise)
 
Instagram: Java version
 
I don't even have Instagram :')
I'll work on some pretty code to show you instead
 
3:44 PM
 
hehë
 
First time working with layout managers. Any tips for using CardLayout and a BorderLayout on each card?
 
 
2 hours later…
5:32 PM
Night!
 
Night uni
 
:)
 
My app is using an external jar. When I delete the jar, my app can still find it. Can an yone tell me why?
 
5:51 PM
It's looking somewhere you don't expect
 
I've been looking for ages and cant find it
i even deleted my app jar and my app still runs
 
How are you running it?
 
 
4 hours later…
10:11 PM
Yo
Anyone alive?
 
@Joe'sMorgue ping
 
10:36 PM
yo yo yo
self.awake = just.now();
int self.happiness = 0;
if (whoElseIsAwake() != null) {
    for (int i : whoElseIsAwake.length()) {
        self.happiness++;
    }
}
 
11:22 PM
@mlwn Whoa! Never knew variable names could include periods :)
 
nobody knows everything... :p
 
Actually, never mind, variable names couldn't include periods. I just tested it. :(
 
hehehehehehehe
i didn't include a period in a variable name... those are classes..
:___)
 
Semantically bad... :P Class types should be in PascalCase
 
jaja
:)
 
11:49 PM
Bye!
 

« first day (1461 days earlier)      last day (3477 days later) »