|
Have you used the very first version?
I posted it again, and that version does work. It should look like this
lucky numbers: (without duplicates)
9 10 38 40 46 48 11 42 45 47 1 19 26 30 31
used numbers:
1 0 0 0 0 0 0 0 9 10 11 0 0 0 0 0 0 0 19 0 0 0 0 0 0 26 0 0 0 30 31 0 0 0 0 0 0 38 0 40 0 42 0 0 45 46 47 48 0
unused numbers:
2 3 4 5 6 7 8 12 13 14 15 16 17 18 20 21 22 23 24 25 27 28 29 32 33 34 35 36 37 39 41 43 44 49
It was this and a few minor {} [] differences I overlooked. I had converted Java code back to javascript and posted it without checking. Sorry.
for (int i=0; i < MAX_DATA; i++) {
duplicates[i]=0;
}
I will send you an email.
modified 13-May-13 10:59am.
|
|
|
|
|
I had a look at your web server code and tried to figure out Random bits.
You do understand these are not finished code? Just "Work in progress", but I'm not getting much response as usual.
function RandomNumber() {
var IsToken = [
[ 9,10,38,40,46,48],
[11,40,42,45,47,48],
[ 1,19,26,30,31,48]
];
var MAX_WEEKS = 3;
var MAX_DATA = 50;
var items = 1;
var items2 = 1;
var scope;
var dups = new Array(MAX_DATA);
var nodups = new Array(MAX_DATA);
var lucky = new Array(MAX_DATA);
var arr = [];
for (var i=0; i < MAX_DATA; i++) {
dups[i]=0;
}
for (var week=0; week < MAX_WEEKS; week++) {
for (var j=0; j < 6; j++) {
var x = IsToken[week][j];
if(dups[x] == 0) {
dups[x] = x;
nodups[items] = x;
items++;
} else {
}
}
}
nodups.sort(function(a,b){return a-b;});
document.write("<br>numbers: (without duplicates)<br>");
for (var i=0; i < items-1; i++) {
document.write(nodups[i] +" ");
}
document.writeln("<br>");
document.write("<br>used numbers: <br>");
for (var i=1; i < 50; i++) {
if (dups[i] == 0) {
arr[items2++] = i;
} else {
arr[items2++] = 0;
}
document.write(dups[i] +" ");
}
document.writeln("<br>");
document.writeln("<br>unused numbers:<br>");
for (var i=1; i < items2; i++) {
document.write(arr[i] +" ");
}
document.writeln("<br><br>");
for (var r=6; r > 0; r--) {
var q = Math.round(48 * Math.random())+1;
document.writeln("q: "+ q +" arr[q]="+ arr[q] +"<br>");
if (dups[arr[q]] != 0) {
lucky[r] = arr[q];
dups[arr[q]] = 0;
} else {
lucky[r] = q;
}
}
document.writeln("<br><br>");
lucky.sort(function(a,b){return a-b;});
for (var i=0; i < 6; i++) {
document.writeln(lucky[i]);
}
}
|
|
|
|
|
Hakan Bulut wrote: Have you previously worked on the first data? Type missmatch syntax error of return line.
I'm not sure what that means. If you meant have I written this in Java? then no. I was waiting for more detail from you.
|
|
|
|
|
As stated before, you have wrote in the language of your javascript if (! taken [arr [q]])
! operator the language of java what can be done instead of ? It is not valid in Java.. I was playing new Tomb Raider the game it is really wonderful game. This is really beyond of programming..
That is no any using the combination of 6/49 tried to write random column.
modified 15-May-13 14:06pm.
|
|
|
|
|
All relative and assignment operators in Java are the same in C/C++ and Javascript.
give me the error messages, code line numbers and current code so that I can see where the problem is.
Did you get the email is sent you? I will send you something very helpful.
I've never played tomb raider, strange huh? But I do like those kind of games.
|
|
|
|
|
Error is: Type missmatch: cannot convert from boolean to int. at this line:
return (nu != arr[j]);
My e-mail address is:
hakanbul@hotmail.com
|
|
|
|
|
Hakan you will get spammed posting your email address like that.
I already know your email (it was on the file combinations.js on your website)
I sent you an email message on Monday. Have you seen it?
|
|
|
|
|
The function is expected to return int
public static int Random(int nu)
Any boolean test (== != > >= < <=) will give true/false answer, not the int.
That is your mismatch.
public static int Random(int nu)
{
int see;
final int MAX_DATA = 49;
nu = (int) Math.round(MAX_DATA * Math.random()+1);
for(int j=0; j<MAX_DATA; j++)
{
int[] arr = new int[MAX_DATA];
see = (int) (MAX_DATA != arr[j]);
}
return 0;
}
|
|
|
|
|
did not resolve to problem.. "Cannot cast from boolean to int." Compiler wrong alert give to message. I am thinking to must have a boolean initializier to int
|
|
|
|
|
check your email.
|
|
|
|
|
Most of that code makes no sense at all. I would suggest you spend some time with your Java reference manual.
Use the best guess
|
|
|
|
|
Yeah bit of a problem free time..
|
|
|
|
|
That is real basic Java; you could work through the online tutorial in an hour or two.
Use the best guess
|
|
|
|
|
Hi,
I want to hide specifically two columns in a table using JQuery. I have the following code to do it:
$(".classname").hide();
But the thing is the same class name is used in all other columns in that table. So all the columns are getting hidden when I execute this JQuery.
Is there any other way to hide only those two columns?
Please Help.!!
Thanks in advance
Ashwini
|
|
|
|
|
One way to do it is create another name on your CSS for the columns you want to hide, such as the one below
.classname, .hidecolumns{
}
Use the .hidecolumns class on the tags you want to hide, instead of using .classname. This way, the existing tags using that class would not be affected.
$(".hidecolumns").hide();
Signature construction in progress. Sorry for the inconvenience.
|
|
|
|
|
Thank you for the reply... !!
But i cant edit the css file or the source code...
I have to use ID or classname and execute the code. The second option is not valid anymore. Can u please provide a solution using the ID. Do we have a way for it?
|
|
|
|
|
So what are you allowed to to then, wave a magic wand?
Cheers!
"I had the right to remain silent, but I didn't have the ability!"
Ron White, Comedian
|
|
|
|
|
Hi Manfred,
I am executing this piece of Javascript on a Content Editor web part of Sharepoint 2010.
modified 9-May-13 6:54am.
|
|
|
|
|
AshwiniRS wrote: I have to use ID or classname and execute the code.
You originally said you can't use the classname so that option is out. Since this is a part of table you can't really use an ID because columns are tied to rows which gives the idea of having an unknown count leading to unknown ID's.
you can maybe do a partial ID name search and hide everything that way.
$('td[id*=partialname]').hide();
Maybe if you give some more example of what your problem looks like using http://jsfiddle.net/[^] we can help further.
Best of luck.
as if the facebook, twitter and message boards weren't enough - blogged
|
|
|
|
|
You absolutely must have a way of identifying the columns to hide though. IF there is no identifying characteristic to allow you to separate the columns to hide from the columns to show, you can't do this. Period.
|
|
|
|
|
One could use the index of the TD, then get all the other TD elements at that index, and hide each of them. Sure, that's not a CSS selector to identify the column, but it's a way to identify the column.
|
|
|
|
|
Sure yeah, ANY method of identifying those columns could work. It doesn't have to be a class, but there has to be something.
|
|
|
|
|
|
Hi Friends,
How can i export a html table into excel by client side script
|
|
|
|
|