Hi,
I have a check out form where number of products can be "n". So how i can know how many input fields are in the form and take input from it?
Thanks
Hi
I am trying to use the following regular expression to check whether a string is a positive number with either zero decimal places, or 2:
^\d+(\.(\d{2}))?$
When I try to match this using preg_match, I get the error:
Warning: preg_match(): No ending delimiter '^' found in /Library/WebServer/Documents/lib/forms.php on line 862
What am I doing wrong?
I want to save and restore the window position of my WPF application. I want to make the code robust to use with multiple monitors who's number and relative location can change (I want to avoid opening my application off-screen when the monitor configuration has changed inbetween invocations).
I know of the Screen class in System.Windows.Forms, but I don't want to take a dependency on that assembly just for this feature.
When one "Fills right in excel" , the Column name updates
eg.
1st cell
is
=A2
If I fill right the next cell will be =B2
But rather than the column incrementing I want to increment the row number
so 1st cell is
=A2
The cell on its right is
=A3
how do i do that?
What is the efficient way to search highest number of cells in big table with numerous colspan (merge cells ** colspan should be ignored so in below example highest number of cells is 4 in first row). Is it js/jquery with reg expression or just the loop with bubble sorting. I got one link as below explainig use of regex is it ideal way ... can someone suggest pseudo code for this.
High cpu consumption due to a jquery regex patch
<table width="156" height="84" border="0" >
<tbody>
<tr style="height:10px">
<td width="10" style="width:10px; height:10px"/>
<td width="10" style="width:10px; height:10px"/>
<td width="10" style="width:10px; height:10px"/>
<td width="10" style="width:10px; height:10px"/>
</tr>
<tr style="height:10px">
<td width="10" style="width:10px; height:10px" colspan="2"/>
<td width="10" style="width:10px; height:10px"/>
<td width="10" style="width:10px; height:10px"/>
</tr>
<tr style="height:10px">
<td width="10" style="width:10px; height:10px"/>
<td width="10" style="width:10px; height:10px"/>
<td width="10" style="width:10px; height:10px" colspan="2"/>
</tr>
<tr style="height:10px">
<td width="10" style="width:10px; height:10px" colspan="2"/>
<td width="10" style="width:10px; height:10px"/>
<td width="10" style="width:10px; height:10px"/>
</tr>
</tbody>
</table>
I have an input field on a webpage that contains a credit-card number. What is the best way of preventing the browser from caching this value?
Any solution needs to work on a large selection of browsers.
I have a number of textboxes that will be displayed with their existing values. I want my servlet to be able to get all their values and then update the database with the the values that have changed.
How do I get the values? Is there some way to put them into a HashMap with the id or name as the key and the value of the textbox as the value for the key?
Hi All,
I am trying to create a console application that reads number from a file all underneath each other like so:
101
9
and then outputs into another file the closest palindrome number. So far what I have is not quite rightm i.e. I don't think I can put the class inside a method which is a bit more Java I was wandering if anyone could help at all?
Thanks :)
namespace PalidromeC
{
class Program
{
static public void Main(string[] args)
{
#region WriteAnswers
try
{
StreamWriter sw = new StreamWriter("C://Temp/PalindromeAnswers.txt");
sw.WriteLine("Answers");
sw.Close();
}//try
catch (Exception e)
{
Console.WriteLine("Exception: " + e.Message);
}//catch
#endregion
#region ReadFile
try
{
string numbers;
StreamReader sr = new StreamReader("C://Temp/Palindrome.txt");
numbers = sr.ReadLine();
while (numbers != null)
{
Console.WriteLine(numbers);
numbers = sr.ReadLine();
}//while
sr.Close();
Console.ReadLine();
}//try
catch (Exception e)
{
Console.WriteLine("Exception: " + e.Message);
}//catch
#endregion
NearPalindromeFinder f = new NearPalindromeFinder();
int palindrome = f.findNearPalindrome(n);
Console.WriteLine("Nearest Palindrome = " + palindrome);
}//main
public static void testFindNearestPalindrome(int n)
{
class NearPalindromeFinder
{
int findNearPalindrome(int start)
{
if (testPalindrome(start))
return start;
else
{
int neg = start;
int pos = start;
for (int i = 0; i < start; i++)
{
if (testPalindrome(start-i))
{
neg = start-i;
break;
}//if
if (testPalindrome(start+i))
{
pos = start+i;
break;
}//if
}//for
return (start == neg) ? pos : neg;
}//else
}//findNearPalindrome
bool testPalindrome(int start)
{
if (start == 0 || start == 1)
return true;
String str = String.valueOf(start);
String rev = new
if (str.equals(rev))
return true;
else
return false;
}//testPalindrome
}//NearPalindromeFinder class
}//testFindNearestPalindrome
}//Program Class
Hi All,
RAID6 is intended to provide fault tolerance in the event 2 disks fail.
What is the minimum number of disks required to implement RAID6?
thanks
I have an unknown number of functions in my python script (well, it is known, but not constant) that start with site_...
I was wondering if there's a way to go through all of these functions in some main function that calls for them.
something like:
foreach function_that_has_site_ as coolfunc
if coolfunc(blabla,yada) == true:
return coolfunc(blabla,yada)
so it would go through them all until it gets something that's true.
thanks!
I have a mysql database which allocate:
iid, name, description, url, namecategory, idcategory, nametopic, idtopic
How can i know the number of entries that has categoryid=1 and topicid=1?
I've try
$result = mysql_query("SELECT COUNT(id) FROM videos WHERE categoryid=1 AND topicid=1")
But it hasn't worked!
Hello,
I've used an array of strings to populate a DataGridView.
How do I go about finding the most frequently occurring number?
Or, even better, order them by most frequently occuring?
Thank You.
Hi ,
I have generated a Google map key by login as a [email protected] . Is there any restriction in generating the number of keys for each user. Since we have 2 different domains and i need to generate key for that too.
Actually i am not sure about of how many keys the person who used this id has created..
And is there any way to find of how many keys had already been created for the same account previously???
Hii...
I want to find out the number of Pocket PC devices(In my Case they are RFID reader's).Is there any way to do thi using RAPI in C#.net?can you please help me out....
Hi,
I have a 2 tex file which I am converting to pdf and then merging the 2 pdf.
My problem is I want to define footer for each pdf without the page numbers.
\thispagestyle{fancy}
\rfoot{text}
but it gives me the page number.
How do I efficiently create a rock-scissors-paper game for n elements,
where n is any odd number =3.
In other words, I want a non-transitive complete ordering of n elements
such that each element is greater than (n-1)/2 other elements and each
element is lesser than (n-1)/2 other elements.
I'm seeking to display a fixed number of items on a web page according to their respective weight (represented by an Integer). The List where these items are found can be of virtually any size.
The first solution that comes to mind is to do a Collections.sort() and to get the items one by one by going through the List. Is there a more elegant solution though that could be used to prepare, say, the top eight items?
Hi Guys,
This is probably a simple one to answer, but im stuck, so here goes
sed '3d' filename (or something like tht)
Im having trouble try to use a $VARIABLE instead of the number
Any1 know how to get this to work , or any alternative options
Regards
Paul
I am trying to count the number of occurance of a given word while ignoring cases.
I have tried
<?php
$string = 'Hello World! EARTh in earth and EARth';//string to look into.
if(stristr($string, 'eartH')) {
echo 'Found';// this just show eartH was found.
}
$timesfound = substr_count($string, stristr($string, 'eartH'));// this count how many times.
echo $timesfound; // this outputs 1 instead of 3.
Can someone provide me a code sample to query Bios Serial number and CPU id using WMI in C++.
I did search for a solution, here but couldn't find a good one.
thanks in advance.
I have database with oracle number type. Could there any possible issues with using java Double when updating table with numeric column. Should i switch BigDecimal or Double is approriate type.
As I fas as I know, BigDecimal is used when arbitrary precision required, when deal with prices for example.
Consider simple API updatePrice(Double d) Should i persist double as is or BigDecimal.valueOf(d) is preferable ?
I want to extend the DataGrid component so that there is a (read-only) column for the row number like you see in spreadsheets. I came across this article http://www.cflex.net/showFileDetails.cfm?ObjectID=735 but it depends on the data being unique for each row so that it can index into the array. If the data is not unique (like for an empty grid) it doesn't work. How can I implement that?
Hey,
I'm trying to find a way to get the total number of child nodes from an XmlNode recursively.
That it is to say I want to count all the children, grand children etc.
I think its something like
node.SelectNodes(<fill in here>).Count
but I don't know what the XPath is.
Thanks
Hi guys,
Is there currently a way to programatically determine from within a Silverlight app the maximum number of concurrent connections that the browser will allow? I know I can do this on the server then pass it as a parameter, but I would like to know if its possible in Silverlight.
This is for all versions of Silverlight including Silverlight 4 RC.