|
What is going on with com.sun.security.auth.module.NTSystem? It's not in my rt.jar, and it's not in a fresh JRE download from Sun. Edit: ughhhhh OK, they don't give it out on their Linux distributions. What a mess, even if it won't run on Linux they should at least let me compile the byte code on Linux. yatagan fucked around with this message at 09:31 on Jan 29, 2010 |
# ? Jan 29, 2010 09:22 |
|
|
# ? Jun 13, 2024 06:47 |
|
yatagan posted:OK, they don't give it out on their Linux distributions. What a mess, even if it won't run on Linux they should at least let me compile the byte code on Linux.
|
# ? Jan 29, 2010 09:41 |
|
zootm posted:You should not be writing code depending on com.sun._ packages, it's not supported and they vary between versions and distributions. Of course it's temptong since there's extra capabilities in there. What are you trying to do? I need to verify the user is logged into a particular Windows domain. An internal JRE is provided with the app, so versioning isn't a user issue.
|
# ? Jan 29, 2010 10:56 |
|
yatagan posted:I need to verify the user is logged into a particular Windows domain. An internal JRE is provided with the app, so versioning isn't a user issue.
|
# ? Jan 29, 2010 11:10 |
|
zootm posted:Ack. Well I guess the problem is you're writing Windows-specific code using internal APIs. You'll probably need to compile on Windows. Since tests wouldn't run properly outside of Windows maybe that's for the best. Yeah, I tried hacking the NT class files into the jar to get it to compile, but it was easy to see early on that was going to be more trouble than running a svn checkout and installing eclipse on a windows box. Up and running now, good thing only our developers have linux boxes I suppose.
|
# ? Jan 29, 2010 11:18 |
|
yatagan posted:Yeah, I tried hacking the NT class files into the jar to get it to compile, but it was easy to see early on that was going to be more trouble than running a svn checkout and installing eclipse on a windows box. Up and running now, good thing only our developers have linux boxes I suppose.
|
# ? Jan 29, 2010 13:10 |
|
zootm posted:I suppose so. I guess if you're writing platform-specific code, though, the devs are just gonna have to have that platform. Interesting that there isn't an obvious way to do this generically, I guess domains maybe don't generalise all that well. There are definitely cross-platform LDAP connectors, but I don't know of any in Java (the one my company uses is C). A little bit of native library + JNI could solve the problem.
|
# ? Jan 29, 2010 14:19 |
|
csammis posted:There are definitely cross-platform LDAP connectors, but I don't know of any in Java (the one my company uses is C). A little bit of native library + JNI could solve the problem.
|
# ? Jan 29, 2010 14:27 |
|
Actually I just realized I read his problem incorrectly...LDAP can tell you if a user exists in a domain (as long as it is based on Active Directory, I think) but I don't believe it can tell you if the user is logged in. Oh well
|
# ? Jan 29, 2010 14:55 |
|
Edit: Double Post
maskenfreiheit fucked around with this message at 21:31 on Mar 13, 2017 |
# ? Jan 30, 2010 03:10 |
|
Several ways to do it I guess. I would probably do a nextInt() mod 2. If 0 multiply the random double by -1, else just leave it positive
|
# ? Jan 30, 2010 03:16 |
|
At first I was rather confused by OBD's suggestion, but I think I understand what he's getting at. The simple way is to do ((Math.random() * 2) -1).
|
# ? Jan 30, 2010 03:41 |
|
There's this perfectly reasonable nextBoolean() sitting right there, which you can use instead of nextInt() % 2. But you shouldn't use it for this! Instead, you should think about how you can use simple math to transform one range of numbers into another. For example, nextDouble() gives you something in the range [0,1]. How can you use that to get a number in the range [1,2]? or [100,101]? or [-100,-101]? Similarly, how can you turn a random number in the range [0,1] into a random number in the range [0,2]? or [0,100]? or [0, 10000]? Now put those two ideas together. EDIT: beaten with the solution, but still, this should be helpful
|
# ? Jan 30, 2010 03:46 |
|
Internet Janitor posted:The simple way is to do ((Math.random() * 2) -1). yea, this is much better, don't answer in this thread while on the phone... fake edit: if you think about it this would be less random then Random is already is because the least significant digit will always be even, theoretically (in my mind) at least.
|
# ? Jan 30, 2010 03:59 |
|
I was thinking the reason you were doing it your way was because my way just stretches and shifts the output range of Math.random()- since ultimately we're dealing with floating point numbers (approximations), the granularity of the output will be lowered. If my approach distributes n possible values from -1 to 1, yours distributes 2n possible values over the same space, right? edit: yeah, thinking about it more this is pretty much exactly what you meant about the least significant digit. so, elegantly: Random randy = new Random(); double value = ((randy.nextBoolean() ? 1 : -1) * (randy.nextDouble())); Internet Janitor fucked around with this message at 04:23 on Jan 30, 2010 |
# ? Jan 30, 2010 04:17 |
|
This is pretty specific question but has anyone figured out a way to remote deploy to a Weblogic server using Netbeans? I've fallen in love with the simplicity of Netbeans over jDeveloper but the lack of Weblogic remote deploy is going to be a dealbreaker for using it at work.
|
# ? Jan 30, 2010 16:43 |
|
Edit: Double Post
maskenfreiheit fucked around with this message at 21:31 on Mar 13, 2017 |
# ? Jan 30, 2010 19:17 |
|
I have no loving clue how that helps you.... that just simulates rolling a dice. Use this InternetJanitor posted:Random randy = new Random(); Or this which is probably what he would expect. InternetJanitor posted:double value = ((Math.random() * 2) -1); e: I just remembered I had this exact same assignment but it was on problem on our test and no one had a clue how to solve it.
|
# ? Jan 30, 2010 19:28 |
|
Edit: Double Post
maskenfreiheit fucked around with this message at 21:31 on Mar 13, 2017 |
# ? Jan 30, 2010 20:04 |
|
GregNorc: For the record, the Javadoc specifies thatcode:
code:
|
# ? Jan 30, 2010 21:11 |
|
osama bin diesel posted:fake edit: if you think about it this would be less random then Random is already is because the least significant digit will always be even, theoretically (in my mind) at least. This is not how floating-point works; multiplying by two will adjust the exponent without losing any precision from the significand. Subtracting by 1 could, in theory, lose precision on numbers close to 0; I don't remember whether nextDouble() makes an effort to give you extra precision there. At any rate, it should not affect the overall distribution.
|
# ? Jan 30, 2010 22:25 |
|
rjmccall: you aren't losing any precision in a numerical sense, but you are spreading a fixed number of possible values over a greater range. When you multiply by two, the exponent won't "grow" another random bit- it will shift in a zero.
|
# ? Jan 30, 2010 22:30 |
|
Internet Janitor posted:rjmccall: you aren't losing any precision in a numerical sense, but you are spreading a fixed number of possible values over a greater range. When you multiply by two, the exponent won't "grow" another random bit- it will shift in a zero. I agree that the randomly-negate method has 2^54 possible values whereas the scale-and-shift method only has 2^53. I just want to note that (1) this is not because precision is lost by scaling or shifting, which previous posts had implied, and (2) it does have the disadvantage of doubling the likelihood of 0. These differences are also totally irrelevant because the first thing GregNorc is going to do with this number is square it, i.e. he really doesn't need to adjust the output of nextDouble() at all.
|
# ? Feb 1, 2010 01:21 |
|
Edit: Double Post
maskenfreiheit fucked around with this message at 21:31 on Mar 13, 2017 |
# ? Feb 1, 2010 16:46 |
|
So just to clarify, your program is only given e as input, yes?
|
# ? Feb 1, 2010 17:47 |
|
...
maskenfreiheit fucked around with this message at 03:44 on Sep 29, 2010 |
# ? Feb 1, 2010 18:54 |
|
I'm not sure i understand. Why do you need to verify if a^5 + b^5 + c^5 + d^5 = e^5 ? I mean...you can calculate e. lets take a,b,c,d=1, you then have: 4=e^5 e=Math.pow(4,0.2) and so on and so forth(for different a,b,c and d values). But, you still need to have a lower and an upper limit. And that limit is going to determine how long it will take.
|
# ? Feb 1, 2010 22:41 |
|
Maybe the values he needs to find must all be integers.
|
# ? Feb 1, 2010 23:06 |
I'm trying to find a good tutorial on using the org.w3c.dom stuff to output HTML. Is this not the correct tool for what I want to do? Or is there a template engine I should look at? edit: I found StringTemplate, looks like it should do just fine. fletcher fucked around with this message at 23:57 on Feb 1, 2010 |
|
# ? Feb 1, 2010 23:46 |
|
...
maskenfreiheit fucked around with this message at 03:44 on Sep 29, 2010 |
# ? Feb 2, 2010 00:30 |
|
Edit: Double Post
maskenfreiheit fucked around with this message at 21:32 on Mar 13, 2017 |
# ? Feb 2, 2010 02:44 |
|
GregNorc: well, the simple answer is what the compiler is telling you- "a" isn't a statement, right?code:
code:
edit: Y'know, I looked over your code again, and I don't think you're doing what you think you're doing. You mean to do a brute-force search, right? Reread what rhag was telling you about upper limits and step through those loops by hand. Internet Janitor fucked around with this message at 03:15 on Feb 2, 2010 |
# ? Feb 2, 2010 03:03 |
|
I've got an applet embedded in a webpage that works perfectly on Windows machines, but absolutely nothing shows up on Linux machines, just a blank page. Any idea what could be causing this?
|
# ? Feb 2, 2010 05:47 |
|
Azerban posted:I've got an applet embedded in a webpage that works perfectly on Windows machines, but absolutely nothing shows up on Linux machines, just a blank page. Any idea what could be causing this? Did you set up Firefox or whatever to use the Java plugin? about :plugins to check You have to do it manually in linux
|
# ? Feb 2, 2010 05:53 |
|
GregNorc posted:yeah the prof said to use integers for all the variables At the very first glance if you are talking about positive integers except nil the answer is empty set. Looks really close to http://en.wikipedia.org/wiki/Fermat%27s_Last_Theorem. The only difference is number of summands. Grab someone really good in math he should know the answer)
|
# ? Feb 2, 2010 12:56 |
|
GregNorc posted:... skipped fixed. take a look.I did nothing to your program flow daresay it sucks as hell.
|
# ? Feb 2, 2010 13:10 |
|
Azerban posted:I've got an applet embedded in a webpage that works perfectly on Windows machines, but absolutely nothing shows up on Linux machines, just a blank page. Any idea what could be causing this? Maybe your browser on linux machine just doesn't support java applets? Just like for windows you have to install that jre/jdk and checkbox browsers you've got. Otherwise you are out of luck.
|
# ? Feb 2, 2010 13:15 |
|
DotSlayer posted:At the very first glance if you are talking about positive integers except nil the answer is empty set. Looks really close to http://en.wikipedia.org/wiki/Fermat%27s_Last_Theorem. The only difference is number of summands. Grab someone really good in math he should know the answer) You can't take Fermat's last theorem and generalise it for all numbers of summands. 27^5 + 84^5 + 110^5 + 133^5 = 144^5 is proof enough.
|
# ? Feb 2, 2010 13:29 |
|
lewi posted:You can't take Fermat's last theorem and generalise it for all numbers of summands. that was just a wild guess. thanks.
|
# ? Feb 2, 2010 16:20 |
|
|
# ? Jun 13, 2024 06:47 |
|
GregNorc, keep in mind that (6209 ^ 5) - ((2 ^ 63) - 1) = 4643121256274242 while (6208 ^ 5) - ((2 ^ 63) - 1) = -2785645994967039 You don't want to loop to Long.MAX_VALUE.
|
# ? Feb 2, 2010 17:03 |