« first day (1490 days earlier)      last day (3675 days later) » 

14:02
##javadoc:Optional
Sorry, I never heard of that class. :(
shame on you!
##javadoc:Integer
Sorry, I never heard of that class. :(
is there any way to get Double.parseDouble to not add an extra zero to a normal int?
@miniHessel ... wat?
@Mr.777 don't use double...
if you have int q =7
and you do Double.parseDouble(q);

You get 7.0 in return..
It's not suited for calculating important decimal numbers..
@miniHessel not quite true,....
14:27
@miniHessel 7 == 7.0. The amount of decimals just depends on the formatting
@Vogel612 It's mentioned to use double as amount
ditch the requirements if someone tells you to do that for real
slap people in the face for that..
you can't calculate monetary stuff in doubles..
@Vogel612 Okay, and what should I say to defend this statement?
1.0 + 1.0 != 2.0
##eval:1.0+1.0
2.0
Java should have generic number variable that takes both double and integers..
14:29
@miniHessel no it shouldn't
because if you can't properly decide the type of a variable you probably shouldn't use Java at all..
@miniHessel NO
C doesn't have that. C++ doesn't have that. Haskell doesn't have that. Only JavaScript has that. And we all know what happened after they did.
but I want to :P
double is imprecise for decent reasons and doesn't hold as wide of a number range of int, there's nothing worthy of doing that.
javascript only has floats. still not a model that anyone should copy
If the language came with interchangeable ints and doubles, you'd switch to another language because that's silly.
14:31
##load:public class Example { public double addingDoubles(double arg0, double arg1) { return arg0+arg1; }}
Thanks, I'll remember that
##eval:new Example().addingDoubles(0.9, 0.9);
unable to resolve class Example
##eval:1.0*2.0
2.00
##eval:1.0.getClass();
class java.math.BigDecimal
damn you groovy
##eval:double x = 1.0; return x+x;
2.0
##eval:double x = 1.0; return x.getClass();
class java.lang.Double
1.0 is precise in float, so you can expect 2.0
@kiheru you should be able to call commands..
Shouldn't this work? Kolonne is column btw
@miniHessel that's the friggin first time ever I heard someone call a Column "Kolonne".. Tables have "Reihen" and "Spalten"....
Haha :P
14:41
Kolonne -> platoon, parade, ...
Any tips to make this pice of code quicker?
Yes. Shut down all the other programs including your browser.
I love your grumpy humour :*
Look, you don't optimize code, the JIT does. Focus on your algorithm.
I am focusing on my algorithm, and how to make it quicker ;)
14:45
-.-
no you don't..
because?
aside... maybe you should write this up from another approach..
One does not simply make an algorithm faster.
don't reinvent the wheel..
Okay, nvm then
14:47
@miniHessel this smells like you're trying to write your own SQLConnection..
don't do that..
smarter people than all of us have done it already...
use what they have already done..
I use JDBC.
then you seem to be using it wrong..
also the pastie code doesn't compile and you're violating LoD
14:48
<= also looks fishy to me..
but eh, it's SQL they are 1-based..
going back to coding
you just seem to be overcomplicating things..
if (type == Types.DOUBLE) {
                kol = new Kolonne(kolonneNavn, i, tbl, true);
            } else {

                kol = new Kolonne(kolonneNavn, i, tbl, false);
            }
so, why is it?
can be shortened to: kol = new Kolonne(kolonneNavn, i, tbl, type==Types.DOUBLE);
but that's not the root issue..
the root issue is that you're actually manually iterating over this..
which is completely unnecessary if you're not doing low-level stuff..
I do it because I need to create my own column and tables.
for my purpose.
14:52
that also sounds like an XY Problem..
yeye, but nvm. That wasn't the question asked :)
usually you don't have to do that manually.... and if you have to, it's easier to get some SQL and run that against the Databases face
15:48
anyone of you have used Mac Widgets for java?
16:08
~JavaBot, at your service
##javadoc: System
Sorry, I never heard of that class. :(
Sorry, I never heard of that class. :(
are you all guys workin on that same bot? including @Mr.777
##eval:"##eval:\"Hello World\""
16:09
##eval:"Hello World"
##eval:"Hello World"
Hello World
Hello World
Talk about circular computation...
lol, things are pretty weird...
16:09
Test
staaahp..
wat are you doing???
I'm still up here...
@Mr.777 you got the unsummon command active?
@Uni & @Vog Why are we hitting "engine.adzerk.net" host?
I think @Vogel612 and @Mr.777 is echoing everthing that is said in the cat. xD
@Mr.777 that's the ad provider for the site..
@LeeJeong not correct..
test
~response
uhhh... ok.
16:11
~response
aaargh
same codebase..
@Mr.777 ads
stahp that..
##unsummon
16:11
This is so funny
##summon: stackoverflow 1
~bye, bye
##summon stackoverflow 2
2 is frozen anyways!
##unsummon
##summon: stackoverflow 2
~JavaBot, at your service
##summon: stackfail 1
16:13
##summon: stackoverflow 139
Cool bot! :D
##eval:"hello world"
hello world
##eval:1+1
##eval: '123'+456
16:14
123456
@Vogel612 Wait, it's not 3? :O
Why did it concatenate instead of sum?
@Mr.777 Because '123' is a string literal in Groovy.
@Mr.777 since you provided any of the arguments as string, the other got made one too..
Only a single character between the single quotes makes it a primitive char.
16:15
##eval: int('123') + 456
Never used Groovy before, just trying out something.
uh...
##eval: 'A'+4
Does it reply if there's an error?
@ProgramFOX not yet: UserScript: 1: Primitive type literal: int cannot be used as a method name at line: 1 column: 2. File: UserScript @ line 1, column 2.
int('123') + 456
!!eval:wourghraguhsfotzd
16:16
##eval:Integer.parseInt('123')+456
579
##eval:lol
##eval: a = 5
5
since it's groovy you can use standard Java features..
##eval:a(b)
##eval: a + 2
16:17
I thought we used to have the bot post the exception in chat?
##shutdown
Nov 7 at 18:07, by JavaBot
startup failed:
UserScript: 1: unexpected char: 0xFFFF @ line 1, column 87.
   stem.out::println??) will work
                                 ^

1 error
##eval:System.exit(0);
@Unihedron nope.. it's just falling through the executor uncaught...
@Unihedron he was down before that..
16:18
aww :(
and yes It'd probably shut him down..
I hope the bot is protected against file operations, is it?
in Sandbox, 43 secs ago, by Vogel612
~going down
@ProgramFOX I can't even load a class by it's fully qualified name...
@Vogel612 oh, ok
@ProgramFOX Anything that the Java Security API wants to check with our security manager, we deny the use of it.
Such as reflection.
16:19
Nice work!
Thanks, Vog's been doing most of the bot code lately, while I'm working on JCE :D Thanks Vog!
the praise for that goes to Uni anyways..
stuff is still somewhat .. brittle, though..
16:41
Hi
I am having some problem with log files. Can anyone help?
@Mr37037 What's the problem?
I am using log4j to log different packages into different files. So basically I am using multiple appenders in my log4j.properties file.
~JavaBot, at your service
##javadocs: string
Its not giving any error and its not writing to even single log file.
##javadocs string
@Mr37037 Need more details
##javadocs: java.lang.String
16:44
Like? log4j file?
May be
##help
##eval: 1+1
@Mr.777 I am JavaBot, maintained by Uni, Vogel, and a few others. You can find me on github.com/Vincentyification/JavaBot
You can find over here
##javadoc: string
Sorry, I never heard of that class. :(
##javadoc: java.lang.String
Sorry, I never heard of that class. :(
Which class?
That is a link. Please open it and you can find log4j file over there
@Mr37037 That's the bot.
16:49
I am loading this as:
String resourceName = "log4j.properties";
ClassLoader loader = Thread.currentThread().getContextClassLoader();
Properties props = new Properties();
try(InputStream resourceStream = loader.getResourceAsStream(resourceName)) {
props.load(resourceStream);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
PropertyConfigurator.configure(props);
@Unihedron Thanks
@Mr37037 What path does this refer to? ${log}
Actually I was trying to follow this examplesofjava.com/log4j/multiple-log-files.html article
##javadoc:String
@Mr.777 no whitespace..
Its first line in log4j file and its /usr/local/logs
Can anyone help me with some small doubts services and drivers?
16:51
@Vogel612 I am trying to debug it now
@Mr.777 the command doesn't parse the classname correctly..
you should add a trim() in there.
~JavaBot, at your service
##javadoc:string
##javadoc:String
The `String` class represents character strings. All string literals in Java programs, such as `"abc"`, are implemented as instances of this class.
Strings are constant; their values cannot be changed after they are created. String buffers support mutable strings. Because String objects are immutable they can be shared. For example:
:D
@Mr37037 Please have a look @ this: stackoverflow.com/questions/16564159/… may be this will help
@Vogel It's string not String
eeehh?? I don't understand?
##javadoc:Integer
16:55
Sorry, I never heard of that class. :(
@Vogel612 Don't have Integer in zip :)
##javadoc:java.lang.String
The `String` class represents character strings. All string literals in Java programs, such as `"abc"`, are implemented as instances of this class.
Strings are constant; their values cannot be changed after they are created. String buffers support mutable strings. Because String objects are immutable they can be shared. For example:
Is it just me or is the connection to chat flakey?
@Vogel612 Connection is flaky as I am running the bot in debug mode, so it pauses
I just ran into about... 4 Status 503's
Anonymous
hi, need help
Anonymous
can i ask here ?
16:58
@Joiner with what?
Anonymous
i have a project in eclipse with the x error icon
Anonymous
but, when i expand, i do not see any other x error icons
Anonymous
so how can i access a "report manager" to see where errors are exactly ?
@Mr37037 Your root logger is configured to log4j.rootLogger = DEBUG, CA but you are trying to write for ERROR
@Joiner Window->ShowView->Problems
alternatively Markers.
there you get more stuff..
17:01
@Mr.777 It was mentioned in example :
So should i change it?
@Mr37037 Did you run that example? And did that work?
No i did not
@Mr37037 :P
Anonymous
@Mr.777 it says: could not find class files
if i browse to the project path, i see "bin" empty
someone know what could make that ?
@Joiner just maybe.. but really just maybe. they were deleted?
17:06
@Mr.777 Yeah its done now. :-)
I just changed Error to DEBUG and everything worked
Anonymous
@Vogel612 if so, why aren't they re-created ?
Its logging to different log files depending upon the package
:-)
@Joiner umm why should they??
@Mr.777 Thanks
what are you doing? how's your setup?
are you even building?
Anonymous
17:08
@Vogel612 because i recompile
and how do you do that??
Anonymous
right click --> export
@Mr37037 Great
Anonymous
jar file
17:09
@Joiner First Clean & Build your application, Right Click on the project -> Clean & Build then right click Export -> As jar or war or whatever is desired
Anonymous
where's clean and build ?
@Joiner Project-> Clean and Project->Build Project
@Mr.777 didn't you ask the very same question earlier??
@Vogel612 Yep, i deleted that because of real bad design problem suggested by someone :P
Anonymous
thank you
17:11
@Mr.777 might be interesting if you had responded to that comment..
especially since there may already be someone who did start writing a review..
I saw the comments btw..
@Vogel612 I had responded to that comment but as per CR's rules, can't edit the code once posted unless there is some exception
that's true ;)
i didn't see a comment, though...
@Vogel612 I responded, yes it's my bad and then asked for suggested solution ;)
hmm.. right.. that one..
listen up, I have some stuff coming up and won't be available until tomorrow, so...
@Vogel612 Aaah, okay no problem.
17:14
I wasn't trying to corner you in any way with what I said..
can anybody help me with android ?
@harvey_slash yes sure..
but not me ;)
@harvey_slash Android? :O
yea , but i guess its related to java
i want to live play an audio
anyways g2g, cy'all around
17:15
that i will be recording
::poof::
@harvey what's it? shoot your question and someone might be able to help
See ya @vog
I want to record an audio from the mic, and play it live. In android
So, what's the problem?
i dont know buffering concepts
can you help me out?
17:17
@harvey_slash So, read about them
i am using this:
AudioRecord audioRecord = new AudioRecord(MediaRecorder.AudioSource.MIC,
sampleFreq,
AudioFormat.CHANNEL_CONFIGURATION_MONO,
AudioFormat.ENCODING_PCM_16BIT,
minBufferSize);
Which lib are you using?
no library
mediaLibrary
audioRecord.startRecording();

while(recording){
int numberOfShort = audioRecord.read(audioData, 0, minBufferSize);
for(int i = 0; i < numberOfShort; i++){
dataOutputStream.writeShort(audioData[i]);
}
and to record, i am using AudioRecord
thats basically how I am recording to a file
called xyz.pcm
would you like the full code?
Is it recording?
yes , it is recording
i actually found this snippet online
it works
i can record the data, and play it back
but i would like to play it real time
17:20
@harvey I don't understand, what's the problem you want help with?
Aaah okay
i want you to know how to play the audio as soon as it starts recording
Although, I am not much expert with realtime audio buffering but found something on SO, may be this will help? stackoverflow.com/questions/5728454/…
i have read it
but could you get me something that works ?
i just want to run and see if it works. then ill read and learn about it
Can I post some questions here?
@korima Go on
@harvey_slash Let me have look
17:26
thanks
The services and controller classes, require to be a name or can be also a verb?
I mean xxx+verb+Service.java
Or xxx+verb+Controller.java
@harvey_slash Have look @ SourceDataLine codejava.net/coding/…
but I would like you to modify the other tutorial
this one is for playing something that is already recorded
how do I get it done WHILE recording is going on ?
@har sourcedataline is something that plays while it's being recorded
oh
okay , thanks, ill take a look at that
17:33
@Korima If you ask my opinion, yes, it can be a verb+Service/Controller
@har Use a SourceDataLine (javax.sound.sampled.SourceDataLine) when you want to play a long sound file which cannot be pre-loaded into memory or to stream real-time sound data such as playing sound back as it’s being captured.
ill give it a look
thanks :D
@korima e.g. TravelService & PersonController
@Mr.777 Ok, thanks for answer. Maybe can be transformed to TravellingService no?
@korima Yes
Ok
I have other thing. A service could act with things that aren the data model of my app? For example. Can I have a service that deals with a connection with an URL?
17:37
@korima What's the scenario?
A service that retrieves me a resource from network as a bitmap, as string, xmldocument, .rar...
I select the ooutput result
You can write a service that can fetch resource.
As it's said the business logic should be written in services, so may be you can write helper service than can fetch you the resource and stuff
Ok
I have otrher doubts, can I ask you?
But there are few other better techniques too. Like, business logic is always divided into Domain logic & application logic
That things are what I dont understand
17:44
So, it varies from the design pattern, some patterns strictly follow that all business logic should be in services, but some really suggest that domain logic must reside in services while application logic can be written in controllers
I hope you understand the difference between domain & app logic
Yes, but now you said me that, that there are some other techniques and now I'm
hesitating
Why are you hesitating and what for?
Because I'm not really sure if I'm doing. I can tell you in short words my scenario
if I'm doing well
btw mr.777
do you mind my asking what you do for a living ?
i am working as java developer in IBM
web developer
17:47
okay :)
One requirement of my app is download "something": Plain text, a image or other file. I have the view of my app, a window where I put the URL of the resource.
im just a middle school student , wrote my first app a few weeks back
That class is on the folder /views
So I decided to create a service that retrieves me the resource I want to download
First thing, folder /views should only have views (no logic @ all)
Do you know MVC pattern?
Yes, in my /views i havent any logic
All are design things
The logic of my view is located in the folder /controllers
There I have a class name ResourceDownloaderController.java
Maybe I haven't choice a good name
And for the last I have in /services, the service that only search on a URL, the resource
By now, that scenario is well designed?
17:52
I think ResourceController is enough
And inside put the method download()?
Well, your controller should never have the logic, the controller should be concerned with accepting the request, asking the correct services to process requests and handing off the response to the correct view.
Like a bridge I guess. Ok. That part I think that I have understand better
*How would I call
Ok, and what happend if tomorrow, the service is growing so fast and the class is BIG? I would like to split in small classes to follow SRP. How would I call that subservices that bbelong to the big service?
What's SRP?
Single Responsability Principle
17:57
& what do you mean by class goes BIG?
It has too many methods, with longs code per one of them
Exactly, so you need to design better before implementing anything.
There will never be too many methods if you plan correctly.
How long have you been doing Java?
Let's say a service TravellingService should only deal with the logic of travelling, not with reservation etc stuff
That's single class principal, yeah.
17:59
@Unihedron 2 years at school level. Not working.
@korima School level means?...

« first day (1490 days earlier)      last day (3675 days later) »