greptilian logo

IRC log for #friendlyjava, 2017-12-15

##friendlyjava on freenode

| Channels | #friendlyjava index | Today | | Search | Google Search | Plain-Text | plain, newest first | summary

All times shown according to UTC.

Time S Nick Message
05:52 mr_lou Classic #java.
05:52 mr_lou <G3nka1> is it required that I have else after else if in java?
05:52 mr_lou <surial> G3nka1: No. You should generally just try this stuff, and not ask here.
05:52 mr_lou <G3nka1> right sorry surial
05:52 mr_lou <mr_lou> surial, THat's not how you respond to a question like that.
05:52 mr_lou This is:
05:52 mr_lou <mr_lou> G3nka1, If you use if you can have else after if, or else you can have else if after if, but if you want you can also have else after else if.
05:52 mr_lou <surial> mr_lou: Ever heard the maxim 'teach a person to fish'?
05:52 mr_lou <surial> mr_lou: THere's such a thing as didactics. Don't presume you're smarter than I am or that you get to tell me what to do, jackass.
05:53 mr_lou <mr_lou> surial, Ever heard of having a little fun?
05:53 mr_lou Could do you good, it appears.
05:53 mr_lou <surial> Your humor is deplorably bad. I suggest you stick to your day job.
05:53 mr_lou <mr_lou> But my mood is great. ;-)
05:53 mr_lou Must suck being in a shitty mood all the time.
06:04 aditsu mr_lou: yeah.. I try not to think about that stuff too much, and stay positive
06:05 mr_lou Yea... but we really ought to be in ##java and tell people about ##friendlyjava
06:06 aditsu sad thing is.. I was becoming like them before I left
06:06 mr_lou One can lose interest in Java all together just from a single visit in that shithole.
06:06 mr_lou People in ##java has completely lost the passion for Java I'm sure.
06:08 mr_lou This channel could grow. Be full of friendly people.
06:08 aditsu I don't know about that, there's just this culture that reinforces certain strict rules and putting down people who "break" them
06:09 aditsu I kinda decided to never go back in there, but you might be able to change my mind :p
06:09 mr_lou I did too.;-)
06:13 aditsu btw, "I don't know about that" was referring to people losing the passion for java, not about this channel being full of friendly people :)
06:15 mr_lou I know people. If someone gets an interest for something, but it met with nothing but resistance from people like that, one will lose interest again. Or at least many will.
06:15 mr_lou Java should be a fun and interesting experience.
06:15 aditsu oh, if you mean newcomers, then yeah that's possible
06:16 mr_lou Well yes.
06:16 mr_lou When I experienced the attitude in ##java I already had other experiences with JAva, so
06:17 mr_lou while it was very discouraging, it didn't knock me out.
06:17 mr_lou But I'm sure it knocks out others.
06:17 mr_lou And that's a shame.
06:17 mr_lou These guys prevent good people from joining the Java ranks.
06:17 mr_lou ...in my view.
06:17 aditsu one guy I used to work for had a theory that the community follows the style/strictness of the language
06:18 mr_lou That way the majority of JAva dudes will always be arrogant pricks.
06:18 aditsu he found that people in a python channel were much more laid back :p
06:18 mr_lou haha
06:18 mr_lou I've never had a chance to look into Python. But I don't seek to learn new languages either.
06:19 mr_lou I don't have the brain capacity to keep track of more than one or two languages. ;-)
06:19 aditsu really? python is a nice language, just a bit too dynamic maybe
06:19 mr_lou Java was chosen for me by the school I attended.
06:19 mr_lou Coming from BASIC, I didn't like Java at all at first.
06:19 mr_lou But I've grown to love it.
06:20 mr_lou Would wish I could use Java for everything.
06:20 mr_lou I do know PHP too, but I don't really like it.
06:20 mr_lou I think it's an ugly language. Its only advantage is that you can do almost anything with it.
06:22 mr_lou I had a brief interest in Python at one time - because I found out it existed for the Amiga too. :->
06:24 aditsu I like trying different languages, e.g. at the google code jam
06:25 mr_lou I just don't have the surplus for it.
06:25 mr_lou Whenever I have some free time I'd rather work on some project using languages I know, rather than spending the valuable time learning a new language.
06:28 mr_lou My language is JAva - but I like to try different PLATFORMS that runs JAva. :-)
06:28 mr_lou Like cellphones and Blu-ray :-D
06:28 mr_lou Would also like to try office equipment
06:28 mr_lou and see an example of JAvacard code.
06:29 mr_lou Ironically I haven't done a whole lot of desktop java yet. It's just not that interesting.
06:30 aditsu heh, I guess I'm the opposite :p
06:33 mr_lou Yea....   I wanna explore Java development on different platforms. You wanna explore desktop development with different languages? ;-)
06:33 mr_lou Or.... web?
06:33 * mr_lou don't like web much
06:35 aditsu I'm mainly interested in web, desktop and client/server stuff, including databases, networking, GUIs, etc.
06:35 CatButts web is bloated behemot
06:35 CatButts h
06:36 aditsu all running on computers, and maybe a little interest in android, where web stuff is not good enough
06:37 aditsu don't really care about other platforms
06:38 aditsu also I'm not actively using other languages (except CJam for small tasks), but I like trying out some of them
06:39 aditsu and I know a few relatively well
06:39 mr_lou Morning CatWomanButts.
06:40 mr_lou I know BASIC on the Amstrad CPC! \o/
06:40 mr_lou And GW-Basic and QBasic. Even tried a little Amiga Basic! :->
06:40 aditsu I recently learned a little Smalltalk
06:41 mr_lou I also have a little C experience, but only ever used it for Amstrad CPC retro game development. :-)
06:41 mr_lou Then of course HTML, CSS and Javascript.
06:42 mr_lou Genereally speaking I think people are WAY too busy inventing new languages.
06:44 aditsu I get that feeling in the code golf community :p but not in general
06:44 mr_lou My brother loves new stuff in programming languages.
06:44 mr_lou I don't.
06:45 mr_lou I never use new stuff - because I know with certainty that I'll dig up some old device somewhere and just get hooked on trying to run a Java app on it - and there's no chance it'll ever run any NEW Java app...   so I always stick with older API's.
06:45 CatButts minimalism!
06:45 mr_lou Like the time I found an IRC client made in Java. I had to edit it to make it run on Java 1.3 to that it ran on my Ericsson MC218 pocket computer. :-)
06:46 mr_lou Now THAT's geeky!
06:46 aditsu new stuff can be much more concise and pleasant
06:46 mr_lou Embrace the old devices I say!
06:46 mr_lou aditsu, Not when it doesn't run where you want it to run. Then it just becomes annoying.
06:47 mr_lou Unless of course it compiles to older versions..... and thus produces bytecode that is compatible with old API's.
06:47 * CatButts cautiously embraces the AWT
06:47 mr_lou I still have my Ericsson MC218, and there still hasn't been produced a device ever since that beats it. HP tried with their Journada devices, but no.
06:47 CatButts what OS is that?
06:48 CatButts for the Ericsson
06:48 aditsu I don't have that problem though :) except when people adopt the latest java version too quickly, before I switch to it on my machines
06:48 mr_lou Ericsson MC218 is just like the Psion 5MX
06:48 mr_lou It runs Epoc
06:48 mr_lou The predecessor to Symbian
06:48 mr_lou And someone made a JVM for it. :->
06:49 mr_lou Awesome.
06:49 mr_lou This was when I joined ##java to ask for help when I needed to port back the IRC client to something that worked.
06:49 mr_lou Big mistake.
06:49 aditsu haha
06:50 mr_lou Like 17 years ago now or so.....   funny that nothing has changed.
06:50 mr_lou "funny"
06:51 aditsu mr_lou: so what do you do for work?
06:51 mr_lou I'm a system developer.
06:51 mr_lou Mainly doing webstuff.
06:51 mr_lou Doesn't mean I like it. ;-)
06:51 mr_lou Would much rather have worked with Java, but no such luck.
06:52 aditsu what language?
06:52 mr_lou PHP
06:52 aditsu oh, sorry to hear that
06:52 mr_lou Well I do create a few Java apps, but just very small ones.
06:52 mr_lou yea
06:52 mr_lou Well it could be worse.
06:52 mr_lou At least I get to decide a lot myself.
06:55 mr_lou And I've gotten to create 2 bigger systems that I always wanted to.
06:55 mr_lou First a CMS the create websites in. Still being used for our customers websites.
06:56 mr_lou Next, I got to create the whole system we use at work to maintain customers, tasks, time-registration, shopping etc etc etc.... everything.
06:56 mr_lou Can spew out any kind of statistics.
07:00 mr_lou Meanwhile I'm Mr.Flu on day 7. I can't believe how long this is taking. :-(
07:26 CatButts hey guys, if I have array of int
07:27 CatButts int[] or int[][]
07:27 CatButts how would I go about outputting its data to display in AWT
07:27 CatButts maybe int arrays are not the type appropiate here
07:27 aditsu if you want to convert to string, you can use Arrays.toString for int[]
07:27 CatButts but it's the one I'd work with
07:28 CatButts no, no
07:28 aditsu or do you want a table?
07:28 CatButts not string
07:28 CatButts sorry
07:28 aditsu or list
07:28 CatButts output as image
07:28 aditsu oh, are they pixels? use BufferedImage
07:28 CatButts that is, the array contains ARGB values
07:29 CatButts does BufferedImage type expose arrays I can manipulate directly?
07:29 CatButts say, arrays of ints
07:29 aditsu not directly, but there are some ways, let me check
07:30 CatButts basically, I want the shortest path from int[] to computer's display :p
07:31 aditsu check out this answer: https://stackoverflow.com/a/9396487/179864
07:32 CatButts hmmm
07:32 aditsu so it looks like you can get an array you can manipulate directly, you just need to make sure you use the right image type and data representation
07:33 CatButts so the array I get, is a reference to BufferedImage's guts?
07:33 CatButts or is it a copy of the data
07:34 aditsu I think it's the guts
07:34 CatButts BIG GUTS
07:34 CatButts RIP AND TEAR
07:35 CatButts good then
07:36 aditsu well, internally, it might be a copy of the data that actually resides in video memory, but then it should track any changes you make, so that it's transparent to you
07:38 CatButts so if this were C, I'd get a pointer to BufferedImage and work directly on the array of ints
07:38 CatButts errr
07:38 CatButts *I'd get a pointer to BufferedImage's data[]
07:39 aditsu in java you get a reference, almost the same thing :p
07:40 aditsu BufferedImage can use different data representations depending on the image type you select
07:40 CatButts so as long as I don't have to copy shitloads of data back and forth, I'm good to go
07:41 aditsu well, try it out
07:41 * CatButts gets off his bum
07:55 mr_lou Isn't the a drawRGB?
07:57 mr_lou *there
07:57 mr_lou Sounds to me like the simplest way of manipulating an array, and simply drawing all of it afterwards.
08:04 aditsu mr_lou: drawRGB? where?
08:05 mr_lou AWT?
08:05 mr_lou Canvas
08:06 aditsu I don't think so
08:06 mr_lou Aah no, that's just for MIDP apparently.
08:06 mr_lou But I got another one!
08:06 mr_lou CatButts,
08:07 mr_lou java.awt.image.MemoryImageSource
08:07 mr_lou "This class is an implementation of the ImageProducer interface which uses an array to produce pixel values for an Image."
08:08 CatButts so before I pick one and stick with it, I also need to consider speed
08:09 mr_lou Lemme show you a jar I made for fun, using MemoryImageSource
08:13 mr_lou http://www.dewfall.dk/Colours3.jar
08:13 mr_lou ALT+F4 to close.
08:14 CatButts cute
08:14 CatButts plasma
08:15 CatButts my Remote Desktop session didn't enjoy it as much, though
08:15 mr_lou :-)
08:15 CatButts it's quite heavy on the CPU
08:15 mr_lou Yes
08:16 * CatButts picks it apart with a decompiler
08:16 mr_lou Of course you do.
08:17 mr_lou It also uses color-cycle via IndexColorModel
08:17 mr_lou Now IndexColorModel would have been NICE to have for MIDP.
08:20 CatButts damnit, I need to organize my tools
08:20 CatButts they are all over the place
08:26 CatButts I assume Colours() is ran once a frame, yes?
08:30 CatButts I'd move any instantiations outside loops, and even outside Colours()
08:31 mr_lou It's been quite some time since I made it, I can't remember.
08:31 kirua joined ##friendlyjava
08:43 CatButts doing some reading, BufferedImage is prefered
08:44 CatButts to MemoryImageSource
08:44 CatButts oh, but here's the thing
08:45 mr_lou Faster?
08:45 CatButts yes
08:45 mr_lou mkay
08:46 CatButts 1. the area containing the image data won't be the same as the one being drawn to
08:46 CatButts 2. layers, and zoom levels
08:47 CatButts the int[] approach I have in mind would have me write all the mixing code
08:48 CatButts mixing/render
08:55 CatButts my head is full of fuck trying to put it all together
08:57 CatButts I mean, I could well do my manual, itterative mixing of things
08:58 CatButts but it probably would be slow
08:58 CatButts compared to say, using java API to do things for you
08:59 CatButts let's say a scenario of what gets mixed
09:00 CatButts you have canvas with multiple layers
09:00 CatButts rgba
09:00 CatButts each layer has a mode and an alpha
09:00 CatButts mode can be normal, multiply, etc.
09:01 CatButts alpha is the layer's global transparency
09:02 CatButts then you have zooms by fixed factors
09:02 CatButts zoom in involves duplicating pixels
09:02 CatButts zoom out interpolates pixels
09:11 CatButts I can think of two ways of doing this
09:12 CatButts 1. mix layers at native res and resize final image
09:13 CatButts 2. resize each layer to a buffer and mix at resized res
09:33 mr_lou I'm too tired in my head to understand any of what you just wrote.
09:33 mr_lou Should probably rest.
09:47 CatButts https://cdn.discordapp.com/attachments/348544204072288257/391164162018902017/image.png
11:15 CatButts https://gamedev.stackexchange.com/a/75667
11:15 CatButts this post presents some interesting points regarding BufferedImage
11:16 CatButts especially the "managed" vs "unmanaged"
11:16 * CatButts tries the thing on his phone
11:18 aditsu CatButts: also see https://stackoverflow.com/questions/1260625/java-swing-graphics-color-blending
11:25 CatButts hmmmm
11:41 CatButts hey aditsu, there's something odd about that managed vs unmanaged code example
11:41 CatButts the results are the opposite of what he's showing
11:42 CatButts Managed being slower
12:18 aditsu CatButts: you mean managed images? I don't know much about that
12:18 CatButts I'll have to look at it when I get home
12:19 aditsu http://www.jhlabs.com/ip/managed_images.html
12:19 * mr_lou just watched "I don't feelo at home in the world anymore".
12:19 mr_lou I could relate.
12:22 CatButts sounds like fun!
12:22 CatButts at this point, I would go in ##java and yell JAVAAAAAAAAAAAAAAAAAAAAAAAA~! and get banned
12:22 CatButts to vent frustrations
12:23 CatButts but I already did that and am already banned :P
12:29 CatButts everyone says that unmanaged is slower that managed, yet I happen to get opposite results
12:29 CatButts *than
12:29 CatButts I'll have to check out the test's innards
12:48 pdurbin mr_lou: I had an Amiga too.
12:50 mr_lou :-)  Had?  I still have one. :-)
12:51 mr_lou No doubt some would say we have too many retro computers.
13:09 pdurbin Last I checked, it's still in my parents' basement. I wrote a little about it (and Disney Animation Studio) at http://wiki.greptilian.com/krita
13:46 CatButts cat
14:47 CatButts http://cat.butt.care:3434/priv/BufferedImageTest.java
14:47 CatButts I updated the test
14:48 * CatButts throws test at phone
14:53 CatButts lol
14:53 CatButts this is hilarious
14:56 CatButts let me check again
14:58 CatButts right
14:59 CatButts so, managed is faster than umanaged when hardware acceleration is available
14:59 CatButts and viceversa
15:00 CatButts on phone
15:01 CatButts managed: 1100ms
15:01 CatButts unmanaged: 2ms
15:01 CatButts smaller res too
15:01 CatButts on PC:
15:02 CatButts managed: 0.5ms
15:02 CatButts unmanaged: 329ms
15:02 CatButts the same reversal occurs on PC with Remote Desktop
15:03 CatButts solution? test unmanaged vs managed
15:05 CatButts test at 60 iterations
15:09 abba joined ##friendlyjava
15:52 CatButts https://media.giphy.com/media/MibYWcCyIxIT6/giphy.gif I propose adding a faux-amiga decrunching screen to all Java applications for the sole purpose of testing BufferedImage in managed and unmanaged mode :P
15:52 CatButts epileptics beware
16:07 thane_ragnar joined ##friendlyjava
16:08 thane_ragnar left ##friendlyjava
16:10 pulsar powerpacker ftw
16:54 abba joined ##friendlyjava
17:43 mr_lou joined ##friendlyjava
18:28 mr_lou joined ##friendlyjava
19:05 abba joined ##friendlyjava
21:21 abba joined ##friendlyjava
23:42 abba joined ##friendlyjava
23:46 CatButts how does one embedd an applet in a html with only class file?
23:46 CatButts no jar
23:47 CatButts hmmm, optionally
23:47 CatButts https://docs.oracle.com/javase/8/docs/technotes/tools/windows/appletviewer.html
23:48 CatButts ah no, this is an external tool
23:48 CatButts no use to me here
23:50 CatButts <applet code="DrawingLines" width="200" height="200"/>
23:50 CatButts java.lang.reflect.InvocationTargetException
23:51 * CatButts removes subclass
23:52 CatButts nope, same thing
23:54 CatButts I guess I should ask ##java :P
23:54 CatButts I am aiming to do a dual applet+desktop class
23:54 CatButts *desktop app
23:55 CatButts because why not
23:58 CatButts ah no, I'd get ClassNotFound exception should I embedd poorly
23:59 aditsu one doesn't use applets

| Channels | #friendlyjava index | Today | | Search | Google Search | Plain-Text | plain, newest first | summary

##friendlyjava on freenode