Jump to content

hisoka

Members
  • Posts

    569
  • Joined

  • Last visited

Everything posted by hisoka

  1. hisoka

    for loop

    The first problem has the loop body reassign the variable 'a' to a number. Given it's initial value of a.length as 2, and the initial value of 'i' as 0, 'a' will always be greater since the value of i is continuously added to it. So the loop never ends. Thank you . However the loop looped endlessly not because of the because of this i<a.length but because of this a=a+i; this is wrong and as a consequence of this error the loop looped endlessly it must be like that a=a[i+1] ;a=a[i+2] until 4 // this to change the position of the element in the array a=a+1; until 1000000000000.... // this to add the first element of the array to the any number you want a=a+i; it works too and is true var a = ["10","2"]; this was an error : I do not use a debugger . I debug from my brain . So that it is sometime , difficult to notice such errors thank you very much for the link and keep correcting me .
  2. hisoka

    sql

    In the context of mysql server database or sql , what does the RECEIVE STATEMENT means ?? for example RECEIVE telephone number and email address of the user .
  3. hisoka

    for loop

    the second statement in for loop tells how many times the loop will execute a piece of code : var a = new Array("10","2");for(i=0 ; i<a.length ; i++){a=a+i;} here in script the code is excuted endlessly although the second statement of the for loop is i<a.length . the length of the array is 2 so i<2 should loop one time . I do not understand why it loops endlessly??? Statement 2Often statement 2 is used to evaluate the condition of the initial variable. This is not always the case, JavaScript doesn't care. Statement 2 is also optional. If statement 2 returns true, the loop will start over again, if it returns false, the loop will end. what does this means :"If statement 2 returns true, the loop will start over again, if it returns false, the loop will end"??
  4. hisoka

    math2

    I think the best solution is to write a brute force program in javascript that does the work for me . However , as I am not good in programming and a newbie , I thought about an easier solution : the algorithm to solve this problem will be like this : 1) generate all the possible addition operations with their result to see all the possible addens that gives 1286 2) once find multiply them together mod 65537 and see which combination of addends when multiplied together mod 65537 gives 16628 the first step is the hard step for me . the second is easy . the first step var a = new Array (97 , 98, 99 , 100 , 101 , 102,103,104,105,106 , 107,108,109,110,111,112,113,114,115,116,117,118) now I need help on how to iterate through them using for loop and add the addends in all possible cominations and to see all the possible combinations of these numbers that can provoke 1286 the rest is easy . So any help would be appreciated
  5. hisoka

    programming

    yes you are right . It depends on the context
  6. hisoka

    function

    if we have two arrays: var a = new Array(1); var b = new Array(2); how to combine them using join() function not concat()?
  7. hisoka

    programming

    "Reversing the order of execution would mean writing the lines of code in reverse order" Interesting . but what do you mean in reverse order ? you means from the bottom to the top ? Can you please give me a clear and short example on how to write the lines of the code in the reverse order as you wrote ? execution from the top to the bottom a+b=c; c+d=e; e+f=g; when you reverse it it becomes like this : execution from the bottom to the top e+f=g; c+d=e; a+b=c; is this what you mean?
  8. hisoka

    loop context

    in this link : http://stackoverflow.com/questions/3684923/javascript-variables-declare-outside-or-inside-loop someone answered : There is absolutely no difference in meaning or performance, in JavaScript or ActionScript. var is a directive for the parser, and not a command executed at run-time. If a particular identifier has been declared var once or more anywhere in a function body(*), then all use of that identifier in the block will be referring to the local variable. It makes no difference whether value is declared to be var inside the loop, outside the loop, or both. "There is absolutely no difference in meaning or performance" "It makes no difference whether value is declared to be var inside the loop, outside the loop, or both" I see that he is totally wrong because if there is no difference in meaning or performance how comes that : var hunter = 0; for(i=0; i<4;i++){hunter = hunter+i;}document.write(hunter); gives 6 as output meanwhile this : for(i=0; i<4;i++){var hunter = 0;hunter = hunter+i;}document.write(hunter); gives 3 as an output ???
  9. hisoka

    programming

    both functions are not related in anyway and the same for their output . I put them only to make my question more clear. Generally and in the context of programming, what does it mean to reverse a code or a script ? does it mean that the execution begins from the bottom to the top ? or that the operators are reversed 1+1 = 2 becomes 1-1=0 ? or that the result of the execution of the code is reversed like 01001000 binary becomes 10110111 or false becomes true ? or 150 becomes -150?
  10. hisoka

    programming

    if we have this little code function sum (){var a = 135;var d = a << (150 - a % 32);var c = d << (160 % 53 + 3*2 +7);var y = 78945666 - d ;var b = a+d+c+y ;return b ;} what does it mean to reverse it that is what does it mean to reverse a code?? does it mean that we should reverse the operators of the code like this : function reverse sum(){var a = 135 ;var d = a >> (150 + a % 32);var c = d >> (160 % 53 - (3/2)-7);var y = 78945666 + d ;var b = a+d+c+y ;return b;} or it means that we should begin the code from the bottom to the top like this function reverse sum() { var b = a+d+c+y ; var y = 78945666 - d ; var c = d << (160 % 53 + 3*2 +7); var d = a << (150 - a % 32); var a = 135; } ???
  11. hisoka

    math2

    the MATLAB program is a huge program and environment , it needs a knowledge of the MATLAB programming language , a great computer resources ( like 1g of Ram) which I do not have and it will not serve me if I ignore the algorithm or the trick by which my mathematical problem will be solved . Besides , to be sincere , I do not want to lose my time in learning about MATLAB (which is a secondary thing for me )meanwhile ignoring(the important thing which is my problem). There is a trick if I know it I will be able to find the solution. The problem is that I cannot find it this trick. I noticed that , by all respect to your answers which I appreciated and thanks , you give me links to follow instead of you trying to give me your own solution or version or vision to the problem. This is why I would like to make something clear : Before I even post any message in this thread to ask for help , I always exhaust all the resources , data , information , articles and videos in Google . Once I find nothing that can help me and I feel that I am stuck and confused , then and only then , I post my message in this forum . I am a newbie and I never learned computer programming in any school or university and I have no one to show me or teach me . I am alone like a little ship in the immense ocean . I count on myself but sometime, I reach a level that I cannot surpass without some forum help this is why I am here . So you no need to give me links . It would be useful if you give me your own knowledge instead of giving me other links that I already exhausted and already know
  12. hisoka

    math2

    I tried to find the solution for this problem : a+b+c+d+e+f+g+h+i+j+k....=1286 (a*b*c*d*e*g*h*i*j*k....) mod 65537 = 16628 the same numbers used to find 1286 should be used to find 16628 numbers used can be from 97 to 122 when I added 97+101+102+105+106+107+108+109+110+112+114+115=1286 but (97*101*102*105*106*107*108*109*110*112*114*115) mod 65537 = 6825 2262746359185661109376000 mod 65537 = 6825 which is wrong because it is not 16628 2262746359185661109385803 mod 65537 = 16628 but I could not find what are the numbers that when added give 1286 and when multiplied together mod 65537 give 16628 Moreover there are many possibilities to get 1286 and many possibilities to get 16628 but I cannot find the possibility that give 1286 and 16628 so any help would be appreciated on how to find this possibility.
  13. hisoka

    definition

    thank you for the link after I read it , what I understood is that a formatted code is a code writing in a specific stylistic , esthetic and visual form . Formatting comes from the form a text or a code or a script takes which differ from language to language and from an application to another for example a binary format is different from a text format. In text itself there are many format like the italic or bold and so on .. This what I understood . Please correct me if I am wrong
  14. hisoka

    definition

    I noticed that the position of the brackets and parenthesis changed . In the second script , they become vertically straight . Is this what you mean by a formatted code ??? or am I wrong ?
  15. "I would like to know if it is possible in javascript to pass an if condition as a parameter function" generally , is it possible or it is not possible this is what I wanted to know . Nothing more nothing less
  16. hisoka

    definition

    In programming context
  17. I would like to know if it is possible in javascript to pass an if condition as a parameter function for example : function sum (alert(if(a==5) ? "good" : "wrong")) { var c = 3 ; var b = 2; var a = c+b; return a ; }
  18. hisoka

    definition

    what is the definition of a "formatted code" or what is a "formatted code" ??? I cannot find the definition in google
  19. hisoka

    math

    thank you very much
  20. hisoka

    math

    ok is there a way to know what are the different numbers mod 7 that give 3 ? like for example knowing the first 10000 prime numbers or the divisors of number or the factors of a number
  21. hisoka

    value

    I have a doubt concerning my understanding to this piece of script function sum() { document.write(function check(document.firstname.participator.value )) ? "it all right" : "the firstname is wrong" ; } does it mean that if the value that evaluates the expression document.firstname.participator.value , when javascript is executed, is true then echo "it is all right" otherwise or else echo "firstname is wrong" ???????
  22. hisoka

    math

    I post my message here as it does not belong to any programming language section if I have : a % 7 = 3 how can I get the value of a ?
×
×
  • Create New...