Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Janitor Prime
Jan 22, 2004

PC LOAD LETTER

What da fuck does that mean

Fun Shoe

Shaggar posted:

also theres cool stuff like jcl-over-slf4j or whatever which basically hijacks commons-logging bindings and redirects them to slf4j.

I love that thing and the log4j one. I redirect all my stuff to logback, even the glassfish logs.

Using Maven's parent POM really helps with making sure that all your project are using the same versions of libraries. It also makes upgrading to newer versions only require editing one file. And any child project can overwrite the parent POM if it really needs that specific version, but doing that can cause more headaches down the road when you forget about it.

Janitor Prime fucked around with this message at 00:54 on Nov 6, 2012

Adbot
ADBOT LOVES YOU

Shaggar
Apr 26, 2006
yep. maven rules.

tef
May 30, 2004

-> some l-system crap ->
i wrote an osgi wrapper for jython once, true story

trex eaterofcadrs
Jun 17, 2005
My lack of understanding is only exceeded by my lack of concern.

Shaggar posted:

slf4j is fine. also dealing w/ multiple classloaders in a single module sounds horrific.

the classloaders are abstracted away

you specify, group, artifact and version of each library to import, and the osgi container does the resolution automagically,

you can have like v1 v2 and v3 of some lovely library installed and any module can import any of those and run correctly without worrying about classloader nonsense, as long as you aren't a moron with your pom files

Max Facetime
Apr 18, 2009

tef posted:

i wrote an osgi wrapper for jython once, true story

ehhehe, was there any chance that wouldn't have ended up being a total waste of time?

incidentally, I've usually liked python's api design in the few random snippets I've seen, would jython's implementation be helpful in making 100% pure java versions of them?

Max Facetime
Apr 18, 2009

trex eaterofcadrs posted:

the classloaders are abstracted away

you specify, group, artifact and version of each library to import, and the osgi container does the resolution automagically,

you can have like v1 v2 and v3 of some lovely library installed and any module can import any of those and run correctly without worrying about classloader nonsense, as long as you aren't a moron with your pom files

wasn't the deal there that two modules both using the same v2 of the same library would use the exact same classes and memory which would open a whole host of concurrency bug opportunities, if the modules don't know of each other?

trex eaterofcadrs
Jun 17, 2005
My lack of understanding is only exceeded by my lack of concern.

Win8 Hetro Experie posted:

wasn't the deal there that two modules both using the same v2 of the same library would use the exact same classes and memory which would open a whole host of concurrency bug opportunities, if the modules don't know of each other?

maybe in a lovely version but at least in v4+ each "bundle collaboration" or whatever it's called gets it's own class space, meaning you could theoretically start with v1 of a module, upgrade it to v2 and remove v1 and your poo poo will keep on running as long as the classes were loaded prior to uninstallation.

tef
May 30, 2004

-> some l-system crap ->
well, it wasn't more or less of a waste of time than the other java programs I wrote.

the problem with trying to make java apis nicer, is that python features like default values, named arguments, and with statements make a bunch of stuff quite neat. decorators, and descriptors too.


with java on the other hand, you will need to find java ways to do it. there are a bunch of nice java libraries out there that make use of 1.6 that I never got the chance to use - including project lombok

Sapozhnik
Jan 2, 2005

Nap Ghost
how does maven interact with osgi because the intersection of those two things sounds like a train wreck

usbchat: Windows has this thing where the only kind of USB device that's accessible from user-space is HID, so all sorts of random poo poo gets turned into a "HID device" to make poo poo install reasonably. Nowadays there's WinUSB and UMDF (not sure how these two are related exactly) which installs an MS-signed shim driver that forwards everything to userland, but you're still installing a driver, which means that you still get to deal with the screaming horror that is INF files and SetupAPI. Then there are those people who try to force their lovely thing to look like a UART using the USB modem device class, even though the designers of USB specifically went out of their way to prevent people from trying to do that sort of thing, but those people are beyond help

USB itself is actually surprisingly nice for something that was co-designed by MS and Intel, the only real problem with it is they basically randomly permuted their glossary. So "transactions" are not atomic at all and they actually comprise "transfers" which are your basic request/response pair, and an endpoint whose buffer temporarily underruns sends a NAK whereas an endpoint which is in an errored state sends a STALL.

Zaxxon
Feb 14, 2004

Wir Tanzen Mekanik

I think the reason most people do the CDC serial thing is because it's the only reasonably well supported cross platform solution. And even if your device is HID compliant on windows you still have to gently caress with SetupAPI stuff if you want your code to handle hot-plugging at all gracefully.

I just don't understand why USB is so much more complicated from a user-space perspective than ethernet or serial ports. I mean basically you plug a device in and you should have a file for each endpoint.

Nomnom Cookie
Aug 30, 2009



Probably because USB devices do things that files don't

Sniep
Mar 28, 2004

All I needed was that fatty blunt...



King of Breakfast
everything is a file in unix

tef
May 30, 2004

-> some l-system crap ->

Sniep posted:

everything is a file in unix

most of the time, except when it isn't. it's ok, most of them are file descriptors

Sniep
Mar 28, 2004

All I needed was that fatty blunt...



King of Breakfast
i loving hate windows btw

today had some edge case where a windows server was involved and i was completely lost

turns out there are like 2 people in the entire company that know how it works

they will be in tomorrow, sorry customer, your sales team sold you some poo poo we dont really support

Max Facetime
Apr 18, 2009

tef posted:

the problem with trying to make java apis nicer, is that python features like default values, named arguments, and with statements make a bunch of stuff quite neat. decorators, and descriptors too.


with java on the other hand, you will need to find java ways to do it. there are a bunch of nice java libraries out there that make use of 1.6 that I never got the chance to use - including project lombok

see, I don't think that's generally true, maybe in some specific cases that syntax-sugar makes all the difference

but for a simple case like this:

code:
import httplib, json

body = json.dumps({
  'key' : '<YOUR API KEY>',
  'image' : 'http://example.com/kitten.jpg',
  'operations' : [{
    'operation' : 'convert',
    'args' : { 'to' : 'png' }
  }]
})

req = httplib.HTTPConnection('api.imageflyapp.com')
req.request('POST', '/v2', body, { 'Content-Type' : 'application/json' })
response = req.getresponse()

print response.status, response.reason, response.read()
I could see a java version of those apis that allows:

Java code:
package simple;

import simple.httplib.HTTPLib;
import simple.httplib.Request;
import simple.httplib.Response;
import simple.json.Json;

public class Example {
  public static void main(String[] arguments) {
    @SuppressWarnings("unused") String body = Json.dumps(new Object() {
      String key = "<YOUR API KEY>";
      String image = "http://example.com/kitten.jpg";
      Object[] operations = { new Object() {
        String operation = "convert";
        Object args = new Object() {
          String to = "png";
        };
      } };
    });

    Request req = HTTPLib.newHTTPConnection("api.imageflyapp.com");
    req.request("POST", "/v2", body, "Content-Type", "application/json");
    Response response = req.getResponse();

    System.out.println(response.status + " " + response.reason + " "
      + response.read());
  }
}
so i'm wondering if jython has those apis already mostly implemented

Shaggar
Apr 26, 2006
ugh thats gross. just use cxf and jackson 2 post the object directly. json is bad enough but doing it by hand is even worse

vapid cutlery
Apr 17, 2007

php:
<?
"it's george costanza" ?>

tef posted:

well, it wasn't more or less of a waste of time than the other java programs I wrote.

the problem with trying to make java apis nicer, is that python features like default values, named arguments, and with statements make a bunch of stuff quite neat. decorators, and descriptors too.


with java on the other hand, you will need to find java ways to do it. there are a bunch of nice java libraries out there that make use of 1.6 that I never got the chance to use - including project lombok

java is mega barebones

rotor
Jun 11, 2001

classic case of pineapple derangement syndrome

Lysidas posted:

those backups on the flash drive on my keychain are in addition to the main central repositories that i use, just as extra backups in case my office is hit by a meteor and my laptop drive dies at the same time

it's a best-effort thing like 'oh i havent copied stuff to my usb drive in a while, should probably do that today'

point is, having multiple remote repositories is really useful

lmao, yeah, that's awesome. just freeballin it, who the gently caress knows what the gently caress repo that last release came from, hell yeah

Mr Dog posted:

svn seems like a good source control system to use if you're forced to manage bad programmers, yes

this is v true because all programmers are bad.

gucci void main posted:

I like when git wipes out your local repo

i think it's great that git encourages a workflow that assumes developers have a robust backup solution on their dev boxes

Shaggar
Apr 26, 2006
i backup my repo inside itself

Sniep
Mar 28, 2004

All I needed was that fatty blunt...



King of Breakfast

Shaggar posted:

i backup my repo inside itself

i believe it

Shaggar
Apr 26, 2006
its distributed so that means its backed up on everyone elses repo

vapid cutlery
Apr 17, 2007

php:
<?
"it's george costanza" ?>

rotor posted:

i think it's great that git encourages a workflow that assumes developers have a robust backup solution on their dev boxes

i never thought about this but it's really funny

Shaggar
Apr 26, 2006
the freedom from source control comes at a price...

tef
May 30, 2004

-> some l-system crap ->

Win8 Hetro Experie posted:

see, I don't think that's generally true, maybe in some specific cases that syntax-sugar makes all the difference

but for a simple case like this:

code:
import httplib, json
I could see a java version of those apis that allows:

Java code:
package simple;
so i'm wondering if jython has those apis already mostly implemented

A really slow way of doing it, probably. You would probably have to write a bunch of interfaces or crud to expose the objects you like. http://wiki.python.org/jython/PythonTypesInJava

There is probably nicer java specific libraries out there for this task. Every big project has a library like you propose, but it is usually called SomethingUtil instead of 'simple'.

Nomnom Cookie
Aug 30, 2009



rotor posted:

lmao, yeah, that's awesome. just freeballin it, who the gently caress knows what the gently caress repo that last release came from, hell yeah

idk is this sarcasm? checkout the tag and build the release...git repos are all mirrors except some have working copies...i feel bad for u if u cant use whatever repo and build artifacts identical to the released ones

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
anything with atomic multi-file commits is cool man, version skew is a soul killer

homercles
Feb 14, 2010

Win8 Hetro Experie posted:

see, I don't think that's generally true, maybe in some specific cases that syntax-sugar makes all the difference
...
I could see a java version of those apis that allows:
...
that sugar only goes one way, you can't deserialise those anonymous objects into anything meaningful

Zaxxon
Feb 14, 2004

Wir Tanzen Mekanik

Nomnom Cookie posted:

Probably because USB devices do things that files don't

well a single USB device would have to be multiple files, one for each endpoint.

At the level basically every program is written at they just take data in and spit data out. Maybe you would have to do something slightly different for isochronous endpoints, but you could still use a file as the data transfer abstraction.

trex eaterofcadrs
Jun 17, 2005
My lack of understanding is only exceeded by my lack of concern.

Mr Dog posted:

how does maven interact with osgi because the intersection of those two things sounds like a train wreck


believe it or not it's actually really nice, unless you're sloppy with your dependencies, both osgi frameworks i've worked with can pull right from a maven nexus, and actually can wrap non-osgi modules so you don't have to worry if the author didn't give a gently caress

Sapozhnik
Jan 2, 2005

Nap Ghost

Zaxxon posted:

I think the reason most people do the CDC serial thing is because it's the only reasonably well supported cross platform solution. And even if your device is HID compliant on windows you still have to gently caress with SetupAPI stuff if you want your code to handle hot-plugging at all gracefully.

I just don't understand why USB is so much more complicated from a user-space perspective than ethernet or serial ports. I mean basically you plug a device in and you should have a file for each endpoint.

USB is indeed no less complicated from user space if you're interacting with a standardised device class than a TCP/IP socket is, in fact it's probably a lot less complicated, depending on what kind of device you're dealing with (inputdev in win32 is just aggressively poo poo)

If you want to actually send raw ethernet frames though then lol

CDC seems to me like a huge abstraction inversion, though. USB has a lot of really nice things in it like out-of-band control messages with a consistent structure, as well as the fact that USB is datagram-oriented instead of byte-oriented in general. CDC also isn't supported well under Windows at all, Linux gives you a /dev/ttyACM easy as pie, but then who gives a gently caress about Linux (also libusb under not-Windows is even more straightforward than a tty, do a libusb_open_device_with_vid_pid, maybe acquire the interface you're working with to disconnect the OS class drivers and you're good to go).

:allears: USB. I like making USB devices, they're pretty cool.

Zaxxon
Feb 14, 2004

Wir Tanzen Mekanik

Mr Dog posted:

USB is indeed no less complicated from user space if you're interacting with a standardised device class than a TCP/IP socket is, in fact it's probably a lot less complicated, depending on what kind of device you're dealing with (inputdev in win32 is just aggressively poo poo)

If you want to actually send raw ethernet frames though then lol

CDC seems to me like a huge abstraction inversion, though. USB has a lot of really nice things in it like out-of-band control messages with a consistent structure, as well as the fact that USB is datagram-oriented instead of byte-oriented in general. CDC also isn't supported well under Windows at all, Linux gives you a /dev/ttyACM easy as pie, but then who gives a gently caress about Linux (also libusb under not-Windows is even more straightforward than a tty, do a libusb_open_device_with_vid_pid, maybe acquire the interface you're working with to disconnect the OS class drivers and you're good to go).

:allears: USB. I like making USB devices, they're pretty cool.

I've never had much of a problem with CDC under windows. Just pops up as COM whatever. HID also does ok, and you can register hooks which notify your program on plugin/removal.but yeah I wish libusb didn't suck on windows.

USB devices are pretty fun to make though.

syntaxrigger
Jul 7, 2011

Actually you owe me 6! But who's countin?

Shaggar posted:

like i said, these problems dont affect open sores cause their time isnt valuable.

literally the best example of the 'shaggar gimmick'

Meiwaku
Jan 10, 2011

Fun for the whole family!

syntaxrigger posted:

literally the best example of the 'shaggar gimmick'

Shaggar is really Linux Torvalds online alter ego (like evil Kirk).

Jonny 290
May 5, 2005



[ASK] me about OS/2 Warp
http://www.csse.monash.edu.au/~damian/papers/HTML/Perligata.html


:stare:


e: :stare: :stare: :stare:

code:
       #! /usr/local/bin/perl -w
        use Lingua::Romana::Perligata;
        maximum inquementum tum biguttam egresso scribe.
        meo maximo vestibulo perlegamentum da.
        da duo tum maximum conscribementa meis listis.
        dum listis decapitamentum damentum nexto
            fac sic
                nextum tum novumversum scribe egresso.
                lista sic hoc recidementum nextum cis vannementa da listis.
            cis.

jony neuemonic
Nov 13, 2009

it makes sense, code should be ~beautiful~

Posting Principle
Dec 10, 2011

by Ralp

Jonny 290 posted:

http://www.csse.monash.edu.au/~damian/papers/HTML/Perligata.html


:stare:


e: :stare: :stare: :stare:

code:
       #! /usr/local/bin/perl -w
        use Lingua::Romana::Perligata;
        maximum inquementum tum biguttam egresso scribe.
        meo maximo vestibulo perlegamentum da.
        da duo tum maximum conscribementa meis listis.
        dum listis decapitamentum damentum nexto
            fac sic
                nextum tum novumversum scribe egresso.
                lista sic hoc recidementum nextum cis vannementa da listis.
            cis.

the two worst things i did in school, finally together!

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice

Jerry SanDisky posted:

the two worst things i did in school, finally together!

but that doesn't look like your sisters??

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice
then again learning latin < keeping it in the family i guess. poast withdrawn

rotor
Jun 11, 2001

classic case of pineapple derangement syndrome

Jonny 290 posted:

http://www.csse.monash.edu.au/~damian/papers/HTML/Perligata.html


:stare:


e: :stare: :stare: :stare:

code:
       #! /usr/local/bin/perl -w
        use Lingua::Romana::Perligata;
        maximum inquementum tum biguttam egresso scribe.
        meo maximo vestibulo perlegamentum da.
        da duo tum maximum conscribementa meis listis.
        dum listis decapitamentum damentum nexto
            fac sic
                nextum tum novumversum scribe egresso.
                lista sic hoc recidementum nextum cis vannementa da listis.
            cis.

I think that LOLCODE thing was just a different version of this

Adbot
ADBOT LOVES YOU

Workaday Wizard
Oct 23, 2009

by Pragmatica

Jonny 290 posted:

code:
[b]cis[/b]

gonna report this to the tumblr justice police

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply