Follow Slashdot stories on Twitter

 



Forgot your password?
typodupeerror
Check out the new SourceForge HTML5 internet speed test! No Flash necessary and runs on all devices. ×

Comment Re:A real Java compiler? (Score 0) 59

This is about "ahead of time" compilation, otherwise known as "compilation", which third-party tools [stackoverflow.com] have done forever. Linking to C in Java is its own world, and I don't know how practical C++ is.

The stack overflow you link to has nothing to do with AOT. They all use a standard JVM and JARs, just all packaged into a single exe file. Its still JIT for the ones that include the JRE bits, the others just download and install a JRE for you. Using C and C++ code from Java is non-trivial but easy enough.

It's dead easy to bridge between C++ and C# at runtime using Managed C++ (or whatever they call it these days). The C# marshaller, the built-in way to get C objects from C# code, is slow painful garbage that no one should use, but it's easy to do the conversion in C++ and either object conversion or using objects directly is very fast that way.

Its just as easy in Java, except better hidden, cause you're not supposed to do it, in order to keep the 'cross platform' nature of Java at its core. Microsoft wants you to bind your C# apps to the Windows platform so they encourage the use of P/Invoke to work around unimplemented features of the framework. Its handy, but goes against one of the core tenets of Java.

You can compile C# to a proper EXE or DLLs easily enough and it will happily load C/C++ DLLs. The reverse is a bitch though - I've heard it's possible (the .NET runtime is also just DLLs), but I never got it to work properly.

Technically, what you compile C# (and all .NET) to isn't actually executable either. Its byte code as well, that can be easily and quickly turned into cached binaries that are essentially AOT compiled ... but thats stored in a different director on the machine and isn't the exe you run, mono will do actual full AOT with the right options, but by default doesn't either. Full AOT takes away several features of the .NET framework, just like it would with the JRE. They'd be implemented in an entirely different way. .NET dlls are just OLE components at their hearts, you've probably heard of OLE as one of the other names it goes by: DDE, OLE2, ActiveX, COM, DCOM. These are ALL THE SAME THING in different revisions, with more features in the later ones. .NET being the latest. Loading and running .NET assemblies is only slightly more difficult than loading an ActiveX in C or C++. Its non-trivial, and you won't find a ton of examples, but its not black magic. Its no more difficult than getting an XPCOM or Corba object to load, and Mozilla can even do that properly so lets not act like its rocket science.

You can (awkwardly) run C code from Java, including loading DLLs, but I've never heard it's possible to do the reverse. What can C code do with a JAR?

You would embed the JVM in your application or a plugin for your application and execute the JAR from there, the same way you do with .NET runtime objects. Not really rocket science here either, though again it is non-trivial.

Its the same as loading pretty much any interpreted language from C or C++, just different libraries and function calls. You do realize that the 'java' command is a C application that loads a bunch of Java libraries and execute JAR files right?

Linking all three would be a bragworthy project, but I think Java is just missing the key concept here.

Its been done: https://www.ikvm.net/

Run .NET code in java, run Java code in .net. Its big, its bulky, it works pretty well, but I don't recommend doing it for weekend fun.

Comment Re:Toys (Score 2) 145

these are fucking hobby drones that weight less than 1lbs. Do you see a giant fucking camera rig slung underneath it? No? Then it's not taking pictures of your fucking hairy ass.

My son has a drone that weighs 200g. It has a 4M pixel camera.

I think the registration program is stupid government overreach for the opposite reason: privacy is a real concern, but registration doesn't really solve the problem. Plenty of drones below the limit (500g) have high res-cameras, and soon there will be 499.5g drones available.

Comment Re:One of the points of having a survival bunker. (Score 1) 317

How much ammunition do you have, and in relation to the number of stray cats, chickens, poor fuckers who I've taken as slaves or even just thrown rocks which I can get hold of.

The slaves will work. Avoiding shooting at all that other stuff is easy with existing image processing algorithms.

Comment SBU is exactly what they think it is (Score 1) 121

Doesn't sound like headphone power-level or analog to me.

Well, son, maybe you should try the specification.

A DFP [Downstream Facing Port] that supports analog audio adapters shall detect the presence of an analog audio adapter by detecting a resistance to GND of less than Ra on both A5 (CC) and B5 (VCONN).

That summary lied to you. HTH, HAND!

Comment Re:Simple Solution (Score 4, Informative) 167

The company claimed on official government forms for multiple years that the drug is a generic.

The drug, epinephrine, is generic. It is adrenaline, which your body produces naturally. There is no patent stopping generic injectors, but so far none have been approved by the FDA. Teva submitted an injector, but the FDA denied approval for reasons that are not clear.

Comment Re:If only we could stop the creation of smog... (Score 1) 164

it would give you enough power that hills wouldn't be a problem.

Having "enough power" is NOT the problem. DC motors produce plenty of power and plenty of torque at low speeds. The problem is that at those low speeds there is little back-EMF, so the only thing impeding the current is the resistance of the coils. So the motor gets you up the hill, but when you reach the top, the coils are hot, and the battery is empty. The problem is not power, but efficiency.

Comment Re:If only we could stop the creation of smog... (Score 1) 164

I'm not going to say for certain if you can design a motor to give you high enough torque at low speeds and also have high efficiency at high speeds, but you probably can.

Of course you can. That is trivial. All DC motors give high torque at low speeds and high efficiency at high speeds. In fact, they give the highest torque at zero speed. That is why a Tesla can go from 0 to 60 in 3.5 seconds. The problem is doing the opposite: high efficiency at low speed. DC motors are terrible at that.

Comment Re:If only we could stop the creation of smog... (Score 1) 164

They are? Even inverter drive motors?

Inverter drives are used with AC power supplies. Scooters use DC batteries and DC motors. So this doesn't even apply to the situation.

AC motors work best in fixed speed, fixed load situations, such as a fan, or a pump with a constant head. If run outside their spec, they will usually just stall (try sticking your finger in a fan, and it will just stop rather than pushing harder). An inverter can make an AC system more efficient under variable load and variable speed. But it will still be relatively inefficient if used far outside of its nominal range. If you ride an electric scooter up long and steep hills, you will soon have a hot motor and a dead battery.

Slashdot Top Deals

Computers are not intelligent. They only think they are.

Working...