Jump to content

All Activity

This stream auto-updates     

  1. Past hour
  2. I don't agree with you. E.g. you want "0" or "1" as random numbers. According to the example at the reference page it should work like this: console.log(Math.floor(Math.random()*1+0)); But the result is always "0". This code gives "0" or "1": console.log(Math.round(Math.random()*1+0)); I'm not clear if console.log(Math.floor(Math.random()*2+0)); gives a better "randomnes" for 0 oder 1? Any Mathematicians here?
  3. Today
  4. i mean when i put into the database 10.00 it only displayed the 10 and no i didnt had the option of doing that in the database
  5. Is it possible to add Drop Down links from a Horizontal Scroll Menu? https://www.w3schools.com/howto/howto_css_menu_horizontal_scroll.asp For example, the Horizontal Scroll Menu will have the websites Categories and when clicking on a Category, will show a vertical dropdown list of Pages of that Category within the website Thanks
  6. Hi, I searched w3schools but found nothing about Jekyll, will the tutorial be built? New project for Jekyll https://github.com/rjopek/jekyll-list 384 projects in one place It may be useful to someone – Rafał
  7. It was my first time in this forum, Thank you.
  8. some_user

    Survey

    Good day! We are conducting an online survey about creating parental control applications for our school project. May we ask you programmers to partake in our survey. [It is not necessarily required to have experience in developing a parental-control application] https://docs.google.com/forms/d/1OhcU7RVRSssjfOZPhExTeyIJ1MVLVcmLPaxgNLIKs4Y/edit#responses Please follow this link to the survey website and we humbly ask for your cooperation, thank you
  9. You can click on the "Report error" button at the bottom of the page to let the W3Schools staff know that that page has an error.
  10. Dear Madam or Sir, I was reading your Python tutorial and I found something that I think is a grammatical error: In the link below, please search for this text in your browser "if you have an objects" https://www.w3schools.com/python/python_booleans.asp I think it should be changed to "if you have objects" With best wishes, Amir
  11. You only need to make one topic for your question. There are answers in your other topic. I'm closing this one.
  12. It's built using HTML, CSS and Javascript.
  13. DATE_ADD(CURDATE(),INTERVAL 1 MONTH) OR CURDATE()+INTERVAL 1 MONTH
  14. the dump, mor precisely, the print is AcctNameA Array[1] Array[2] Array[3] ... Array[12] AcctNameB Array[1] Array[2] Array[3] ... Array[12] etc for each account name entry. Obviously my $amts[$cntr][1 to 12] doesn't work. But what should it be?
  15. The "+1" makes it as likely as the other numbers. If you use Math.round(), what you get is that numbers on both ends have only half the probability as the numbers in the middle, and in your example 11 would be the number at the end.
  16. CSS wouldn't be able to do it. You will need to do some math and write a Javascript program to determine where to place the image. It takes some work so there's no short code snippet that could be provided.
  17. Re #1: Actually, $acnm is not a numeric array. It's an array that contains the account names. $cntr is numeric. So I don't see a problem with $acnm[$cntr] and it does work. Re #2: I agree the print does not need the curly brackets, but I would think that they don't cause a problem. Anyway, thanks for spotting it and I'm removing them. Re #3: I expect that I have one of these "$amts[$cntr]=Array(0,0,0,0,0,0,0,0,0,0,0,0,0);" for each account as created by my earlier code: $cntr=0; while($cntr<$numacts) {$cntr=$cntr+1; $amts[$cntr]=Array(0,0,0,0,0,0,0,0,0,0,0,0,0); } Then with $amts[$cntr][1] to $amts[$cntr][12] I am trying to extract the 12 months in each account's array.
  18. They don't. There's a "report error" link at the bottom of each page if it has something incorrect or incomplete.
  19. Yesterday
  20. $acnm[$cntr] makes sense assuming its a numeric array. {print($acnm[$cntr])}; produces a parse error - print() enclosed with curly brackets $amts[$cntr][11] what are you trying to accomplish with [11]? EDIT: Seems to me you might be trying to describe a multidimensional array https://www.w3schools.com/php/php_arrays_multidimensional.asp If so, what does the dump of $amts look like?
  21. Please tell me where all the errors and warnings are. All of it seems to work except for the last part which is the printing. // PRINT ACCOUNT FROM ACCOUNTS TABLE & // MONTHLY AMOUNTS FROM AMOUNTS TABLES // THIS IS THE PROBLEM - IT DOESN'T WORK! <------------- $cntr=0; while($cntr<$numacts) {$cntr=$cntr+1; {print("$acnm[$cntr] $amts[$cntr][1] $amts[$cntr][2] $amts[$cntr][3] $amts[$cntr][4] $amts[$cntr][5] $amts[$cntr][6] $amts[$cntr][7] $amts[$cntr][8] $amts[$cntr][9] $amts[$cntr][10] $amts[$cntr][11] $amts[$cntr][12] <br>"); } } // PRINTING RESULTS: accountA Array[1] Array[2] Array[3] ... accountB Array[1] Array[2] Array[3] ... etc for each account name entry.
  22. First off, I am a newbie. I'm try to make the first accordion tab and heading tab open by default, but keep coming up short. Any and all help would be greatly appreciated! Sample url: https://www.iciwireless.com/industry-solutions-mat/construction.htm So, the "Two-way Radio" accordion and header tab should be open when entering the page. I'm using a DW template with repeatable regions to populate the accordions on a number of pages, which is working, but need the 1st accordion tab open. The last code that I tried was the following: <script> $(document).onload(function(){ $("#accordion1Collapse1").collapse('show'); }); }); </script> No luck there.
  23. Your script has many errors and warnings. Can you focus on a specific snippet that's not working for you?
  24. I don't know if an SQL query would help. For the moment, can you look at my code and see if you can identify errors. I've used this code approach in another report and it works but here, I can't make it work. Tks $acnm=array(); $acmo=0; $numacts = $AffectedRows; // LOAD ACCOUNT NAMES FROM ACCOUNTS DB TABLE // INTO ACCOUNT NAME TABLE // WORKS OK - PROVEN BY A TEST PRINT. // $row[2] is the account name index. // $row[1] is the account name. while ($row = mysql_fetch_row($Results)) {$acnm[$row[2]]=$row[1]; } //------------------------------------------- // CREATE & INITIALIZE AMOUNTS TABLES // COVERING 12 MONTHS FOR EACH ACCOUNT NAME $cntr=0; while($cntr<$numacts) {$cntr=$cntr+1; $amts[$cntr]=Array(0,0,0,0,0,0,0,0,0,0,0,0,0); } //------------------------------------------- // LOAD AMOUNTS FROM TRANSACTIONS INTO TABLES // $row[4] and $row[5] are account indexes // $row[3] is the ammount $cntr=0; while ($row = mysql_fetch_row($Results)) {$cntr=$cntr+1; $effmo = substr($row[1],5,2); //extract month from date field. $amts[$row[4]][$effmo]=$amts[$row[4]][$effmo] - $row[3]; //* $amts[$row[5]][$effmo]=$amts[$row[5]][$effmo] + $row[3]; //* } // * Should be OK as I've used this in other reports and it worked. //------------------------------------------- // PRINT ACCOUNT FROM ACCOUNTS TABLE & // MONTHLY AMOUNTS FROM AMOUNTS TABLES // THIS IS THE PROBLEM - IT DOESN'T WORK! $cntr=0; while($cntr<$numacts) {$cntr=$cntr+1; {print("$acnm[$cntr] &#160;$amts[$cntr][1] &#160;$amts[$cntr][2] &#160;$amts[$cntr][3] &#160;$amts[$cntr][4] &#160;$amts[$cntr][5] &#160;$amts[$cntr][6] &#160;$amts[$cntr][7] &#160;$amts[$cntr][8] &#160;$amts[$cntr][9] &#160;$amts[$cntr][10] &#160;$amts[$cntr][11] &#160;$amts[$cntr][12] <br>"); } } // PRINTING RESULTS: accountA Array[1] Array[2] Array[3] ... accountB Array[1] Array[2] Array[3] ... etc for each account name entry.
  25. https://www.w3schools.com/jsref/jsref_random.asp There it says: But with .floor() the result "10" is very unlikely, isn't it? I would prefer .round() Math.round(Math.random()*10+1);
  26. Hello all, I'm after some help. I have a moderate length one page design website. I have an image background from a poster that I would like to fit the width of the page, but then scroll as a % of the height of page. ie the page loads and the background image is say 20% of its height visible, as the user starts to scroll, and reaches the bottom of the web page, the background image is then fixed at the bottom. However, the web page and the background image are not the same size. The only requisites are that the background image fits full width of the web page, and that when at the top of the page, the background image is at the top and when the page is scrolled to the bottom, the image is at the bottom of its scroll. So for instance a 1200x800 image on a desktop page that is 1200x1600 would need to scroll at a 50% speed so that it fits the above requirement. These are made up dimensions.
  1. Load more activity
×
×
  • Create New...