Click here to Skip to main content
15,889,116 members
Home / Discussions / Java
   

Java

 
GeneralRe: How to correctly use the interceptor encrypt all address Pin
Richard MacCutchan29-Nov-14 0:54
mveRichard MacCutchan29-Nov-14 0:54 
QuestionHow to set the result variable of a javascript of one div to another div tag Pin
Member 1126811126-Nov-14 22:27
Member 1126811126-Nov-14 22:27 
AnswerRe: How to set the result variable of a javascript of one div to another div tag Pin
Richard MacCutchan26-Nov-14 22:57
mveRichard MacCutchan26-Nov-14 22:57 
GeneralRe: How to set the result variable of a javascript of one div to another div tag Pin
Member 1126811126-Nov-14 23:03
Member 1126811126-Nov-14 23:03 
Questionmd5 encription Pin
Trupti00125-Nov-14 20:23
Trupti00125-Nov-14 20:23 
AnswerRe: md5 encription Pin
Richard MacCutchan25-Nov-14 22:27
mveRichard MacCutchan25-Nov-14 22:27 
AnswerRe: md5 encription Pin
Richard Deeming26-Nov-14 1:49
mveRichard Deeming26-Nov-14 1:49 
QuestionHandling Unsigned Integers for Compatability Pin
Dominick Marciano24-Nov-14 15:50
professionalDominick Marciano24-Nov-14 15:50 
I am currently working on an Android application (my first) and I am trying to add the licensing code that I use for all my other applications. The issue I have run into is that all my other programs were written in VB.NET and there is a hashing function that uses UInteger. I recently discovered that Java doesn't have unsigned integers so my hash function in Android is failing to give the same results as my .NET equivalent. Unfortunately I've used this code in too many projects to go change the hashing routine in all my other applications. The issue is occurring in this piece of code:
Java
for(byte b : uniBytes){
      hash += b;
      hash += (hash << 10);  <--This returns negative numbers
      hash ^= (hash >>> 6);
}


I tried implementing some logic so that after every operation the code would check if the hash variable was negative and if so convert it to a long such as long lngHash = 0xFFFFFFFFL & hash;, and I understand why it must be converted to a long. However, after a few more operations the hash would start to become incorrect again. I am assuming this is because if the number reaches a range that can fit into an integer, I must convert the number back to an integer in the same way when it grew I needed to convert it to an long.

I have even tried some open source libraries but they didn't support the shift operators. Any suggestions or insights into this? Am I at least on the right track with having to convert the hash back and forth between an integer and long as need? Any help or guidance of how to get this method to work is greatly appreciated. Thanks.
A black hole is where God tried to divide by zero.

There are 10 kinds of people in the world; those who understand binary and those who don't.

Questionwhats wrong with it? Pin
Member 1125103123-Nov-14 21:21
Member 1125103123-Nov-14 21:21 
AnswerRe: whats wrong with it? Pin
den2k8823-Nov-14 21:38
professionalden2k8823-Nov-14 21:38 
AnswerRe: whats wrong with it? Pin
Richard MacCutchan23-Nov-14 22:28
mveRichard MacCutchan23-Nov-14 22:28 
Question15 puzzle Pin
Member 1125103120-Nov-14 9:08
Member 1125103120-Nov-14 9:08 
GeneralRe: 15 puzzle Pin
PIEBALDconsult20-Nov-14 9:26
mvePIEBALDconsult20-Nov-14 9:26 
AnswerRe: 15 puzzle Pin
Richard MacCutchan20-Nov-14 21:53
mveRichard MacCutchan20-Nov-14 21:53 
SuggestionRe: 15 puzzle Pin
ZurdoDev21-Nov-14 2:24
professionalZurdoDev21-Nov-14 2:24 
QuestionGUI for many runs Pin
Roozmand Omid18-Nov-14 19:11
Roozmand Omid18-Nov-14 19:11 
QuestionRe: GUI for many runs Pin
Richard MacCutchan18-Nov-14 21:21
mveRichard MacCutchan18-Nov-14 21:21 
AnswerRe: GUI for many runs Pin
ZurdoDev21-Nov-14 2:25
professionalZurdoDev21-Nov-14 2:25 
QuestionCan we use kNN and k-mean at a same time? Pin
rushiraj_1118-Nov-14 7:32
rushiraj_1118-Nov-14 7:32 
GeneralRe: Can we use kNN and k-mean at a same time? Pin
PIEBALDconsult18-Nov-14 7:37
mvePIEBALDconsult18-Nov-14 7:37 
QuestionWhy the record cannot insert into MS access Pin
jdzgray14-Nov-14 5:50
jdzgray14-Nov-14 5:50 
AnswerRe: Why the record cannot insert into MS access Pin
PIEBALDconsult14-Nov-14 5:55
mvePIEBALDconsult14-Nov-14 5:55 
GeneralRe: Why the record cannot insert into MS access Pin
jdzgray14-Nov-14 6:13
jdzgray14-Nov-14 6:13 
AnswerRe: Why the record cannot insert into MS access Pin
jschell14-Nov-14 12:18
jschell14-Nov-14 12:18 
AnswerRe: Why the record cannot insert into MS access Pin
Member 1074002029-Nov-14 23:45
Member 1074002029-Nov-14 23:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.