I created a custom 'text menu' that should print each String passed to it. This is the class: package com.github.geodox.areacalculator.menu; public class Menu { private static int index = 0; private static String[] menuItems; public void addItem(String menuItem) { menuItems = new String[index+1]; menuItems[index] = menuItem; index++; } public void printMenu() { for(String menuItem : menuItems) { System.out.println(menuItem); } } } This is what is passed. Menu menu = new Menu(); menu.addItem("rectangle"); menu.addItem("square"); menu.addItem("circle"); menu.addItem("triangle"); menu.addItem("trapezoid"); menu.addItem("parallelogram"); menu.printMenu(); However, this is what is printed: null null null null null parallelogram Any ideas on why this is happenning?

Member Avatar
Member Avatar
+0 forum 3

Can anyone tell me how to write each function for ajax loaded elements Ex:Refer the code below $('textarea').each(function () { $(this).attr('maxlength', 150).addClass('characterCount'); }) This code working fine, how to make it work in ajax loaded elments

Member Avatar
Member Avatar
+0 forum 3

I'm not well conversant with java or AJAX, but how can i read each line of a string display each line of question and answers at a time, after a user have answered the question id displays the next question upto the last one. Im using fget () n php to read line by line but dont know how to display one question and its respective answers at a time and be able to keep track of each submitted questions. Kindly assist with this I would highly appreciate. Here are the codes that I have: <?php $openFile = fopen("questionandanswers.txt", "r") …

Member Avatar
Member Avatar
+0 forum 9

I have one problem at the line 20-23. What I need is when the blue box touches the red rectangle, the blue box gets resetted (it goes back to where it starts). However, the problem is, it doesn't touch the red rectangle area properly. Any suggestions? Thanks in advance. float moveX, moveY; float speed = 2; float controlX, controlY; int square = 50; float rectHori = 120; float rectVert = 20; void setup() { size(400, 400); background(255); moveX = width/2; moveY = 50; reset(); } void draw() { background(255); rectMove(); rectControl(); if (dist(controlX, controlY, moveX, moveY) <= rectHori/2 + rectVert/2) …

Member Avatar
Member Avatar
+0 forum 6

Hi how can I print a new document for each datarow in my datagridview?. I have the PrintDocument procedures separately. Thanks in advance

Member Avatar
+0 forum 0

I have a loop in php which echo out these divs: <div class="nyhed"> <p class="nyheds_dato_p" style="color:#900;">'.$pub_date[1].'/'.$pub_date[2].'/'.$pub_date[0].'</p> <p class="nyhed_p">'.substr($teaser, 0, 55).'..</p> <a href="'.$url.'" class="nyheds_link">'.$link_navn.'</a> </div>'; When ever a link is hovered, i am adding an animation to change the background color of the div class="nyhed". As it is now, all the divs are animated..How do i only add the jquery function the specific div class="nyhed" belonging to the link being hovered? This is what i have: $(document).ready(function(){ $(".nyheds_link").hover(function() { $(".nyhed").animate({ backgroundColor: "#DDD" }, 800);},function() { $(".nyhed").animate({ backgroundColor: "#f5f5f5" }, 300); }); }); Do I need to add: .each and then .find …

Member Avatar
Member Avatar
+0 forum 1

So I'm uploading multiple images to a folder and inserting the images information to a database. The upload and insert is working great but the loop is running twice for each file and adding the information into the databse twice. I am unsure as to why this is happening. Please help. Here is my code. Protected Sub btnUploadAll_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnUploadAll.Click If Session("RefNO") = "" Then generateRefNo() End If Dim myConnection As SqlConnection = New SqlConnection(ConfigurationManager.AppSettings("ConnectionString")) Dim myCommand As SqlCommand = New SqlCommand("Insert_Stud_Stock_Images", myConnection) ' Mark the Command as a SPROC myCommand.CommandType = CommandType.StoredProcedure …

Member Avatar
Member Avatar
+0 forum 5

The End.