Take 8 digit no as input i dont know where is the decimel point ,but i have to find the no before decimel point . i know this is My homework but i need answer for interview plz help me
I want to use lua (that internally uses only doubles) to represent a integer that can't have rounding errors between 0 and 2^64-1 or terrible things will happen.
Is it possible to do so?
I have a list, with each element being a character vector, of differing lengths
I would like to bind the data as rows, so that the column names 'line up' and if there is extra data then create column and if there is missing data then create NAs
Below is a mock example of the data I am working with
x <- list()
x[[1]] <- letters[seq(2,20,by=2)]
names(x[[1]]) <- LETTERS[c(1:length(x[[1]]))]
x[[2]] <- letters[seq(3,20, by=3)]
names(x[[2]]) <- LETTERS[seq(3,20, by=3)]
x[[3]] <- letters[seq(4,20, by=4)]
names(x[[3]]) <- LETTERS[seq(4,20, by=4)]
The below line would normally be what I would do if I was sure that the format for each element was the same...
do.call(rbind,x)
I was hoping that someone had come up with a nice little solution that matches up the column names and fills in blanks with NAs whilst adding new columns if in the binding process new columns are found...
Hi,
I am trying to display country codes(+91, +60, +01) in the combobox. Although the dataprovider(array) contains + sign but is removed. I am not getting how to show it with sign.
<mx:Array id="countryArray">
<mx:Object label="India" data="+91" />
<mx:Object label="Malaysia" data="+60" />
<mx:Object label="Usa" data="+01" />
</mx:Array>
Is this the problem with dataprovider? How can I treate them as text not numbers?
Please help.
Thanks in advance.
I want to convert 8 digit value to date time how can I do it for example if user enter 08082010 then it should convert it to 08/08/2010, using C#
hope you understand my question, if you need any further info about it please do tell me thanks in advance ,
I need help on how to find out how many days it has been (seven day weeks, MSTimezone) since May 6th, 2009
[NSDate *m62009 = [NSDate dateWithTimeIntervalSinceReferenceDate:231638400];
[m62009 setTimeZone:[NSTimeZone timeZoneWithAbbreviation:@"MST"]; (to help you - 231638400 seconds from 1/1/2001)
I'm relatively new to utilizing web services. I'm trying to create one that will be accepting data from a ASP.Net form whose input controls are created dynamically at runtime and I don't how many control values will be getting passed.
I'm thinking I'll be using jQuery's serialize() on the form to get the data, but what do I have the web service accept for a parameter? I thought maybe I could use serializeArray(), but still I don't know what type of variable to accept for the JavaScript array.
Finally, I was thinking that I might need to create a simple data transfer object with the data before sending it along to the web service. I just didn't wanna go through with the DTO route if there was a much simpler way or an established best practice that I should follow.
Thanks in advance for any direction you can provide and let me know I wasn't clear enough, or if you have any questions.
Hello,
I am using a PHP file called comments.php that has a query that enters values into a mySQL table called "comment." As the query does this, it auto-generates a field called "commentid", which is set to auto_increment in MySQL. The file also contains a loop what echoes out all comments for a given submission.
It all works fine and dandy, but I want to simultaneously pull this "commentid" and turn it into a hashtag / anchor that when appended to the end of the URL makes that comment at the top of the user's browser.
Someone said on another question that in order to do this one thing I should do is create an anchor on the row where the comment is being printed out. How can I do this?
Thanks in advance,
John
The query that inserts comments into the MySQL table "comment":
$query = sprintf("INSERT INTO comment VALUES (NULL, %d, %d, '%s', NULL)", $uid, $subid, $comment);
mysql_query($query) or die(mysql_error());
The fields in the table "comment":
commentid loginid submissionid comment datecommented
The row in a loop where the comments are echoed out:
echo '<td rowspan="3" class="commentname1">'.stripslashes($row["comment"]).'</td>';
hello,
suppose I have a text list in emacs like this:
a
b
c
...
d
Is there a way to assign numbers to those items in Emacs, by selecting the region? End results should look like:
1. a
2. b
3. c
j. ...
n. d
Thanks.
Best to use an example to describe the problem. Lets say I have a decimal value 100.227273.
100.227273 * X = Y
I need to find the smallest possible integer X that gives integer Y.
We are working on a WebView (not WKWebView, yet) app, are are observing that the app runs extremely slow on iOS 8. The same app runs smooth on lower versions of OS like iOS7 and iOS6. So we tried it in safari on iOS8 and the performance is similar to iOS6 and 7.
The app is filled with images and many are high resolution. While trying to trace the issue (trial and error!) we reduced the sizes and resolutions of the images and the performance improved, but it is still not at par with versions 6 and 7.
We are unable to find any such issues reported elsewhere and are stuck. It would be great if we could get some pointers on this one.
Hi friends,
I am making a book application. To move to the next topic I am using a button. The Button works as it moves to the next topic, but at the end of the file my application gets the message obj_fatal and it crashes. If I knew how many objects there are in my NSArray then the problem will be solved. I am getting the details from a .plist file and storing it in to a array.
So if any one knows how, please let me know.
Thanks in advance.
Viral.
I'm looking to count the dates covered (inclusive) between two DateTimes (not .TotalDays)
For example:
2012-2-1 14:00 to 2012-2-2 23:00 -> 2
2012-2-1 14:00 to 2012-2-2 10:00 -> 2
2012-2-1 14:00 to 2012-2-1 15:00 -> 1
2012-1-1 00:00 to 2012-12-31 23:59 -> 366
I can get this functionality with the code below:
DateTime dt1 = new DateTime(2000,1,2,12,00,00);
DateTime dt2 = new DateTime(2000,1,3,03,00,00);
int count = 0;
for (DateTime date = dt1; date.Date <= dt2.Date; date = date.AddDays(1))
count++;
return count;
Is there a better way?
Using String.Format how can i ensure all numbers have commas after every 3 digits
eg 23000 = "23,000" and that 0 returns "0".
String.Format("{0:n}", 0); //gives 0.00 which i dont want.
I dont want any decimal places, all numbers will be integers.
Hi,
I want to calculate the amount to charge my customers, when they buy licenses of my product.
I sell it in ranges of licenses:
1-10 : $50/user
11-20 : $40/user
21-30 : $30/user
31-50 : $20/user
So when someone purchases 136 licenses, I will charge him:
100 X $20 = $2000
30 X $30 = $900
6 X $50 = $300
How can I do this in plain C# or LINQ?
Thanks in advanced.
I found this resource when looking to commonly format user's phone numbers.... http://www.eyesis.ca/projects/formatphone.html
I was wondering if someone else might have a better solution.
So I have a question.
I have chatting/IM website that I am working on and I was making a user profile page. I wanted to show how many posts that user had.
Another issue I had earlier was that when I called a certain value it would return a 'Resource #1' type string. But I got that working by using
$totalposts=mysql_query("SELECT * FROM `posts` WHERE Username='" . $username . "'");
$totalposts = mysql_fetch_row($totalposts);
$totalposts = $totalposts[0];
But that just returns the last postID of the most recent post. I thought that mysql_num_rows would work. But this code returns an error (example with numbers):
29: $totalposts=mysql_query("SELECT * FROM `posts` WHERE Username='" . $username . "'");
30: $totalposts = mysql_num_rows($totalposts);
31: $totalposts =mysql_fetch_row($totalposts);
32: $totalposts = $totalposts[0];
That returns this error:
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/a9091503/public_html/im/user.php on line 31
Thanks guys. :) I hope you can figure this out. :D
I am trying to find a reference for approximately how many CPU cycles various operations require.
I don't need exact numbers (as this is going to vary between CPUs) but I'd like something relatively credible that gives ballpark figures that I could cite in discussion with friends.
As an example, we all know that floating point division takes more CPU cycles than say doing a bitshift.
I'd guess that the difference is that the division is around 100 cycles, where as a shift is 1 but I'm looking for something to cite to back that up.
Can anyone recommend such a resource?
Hi, I have an array of numbers jumbled up from 0-9.
How do I sort them in ascending order?
Array.Sort doesn't work for me. Is there another way to do it?
Thanks in advance.
EDIT:
Array.Sort gives me this error.
Argument 1: cannot convert from 'string' to 'System.Array'
Right now it gives me this output:
0) VersionInfo.xml
2) luizafroes_singapore2951478702.xml
3) virua837890738.xml
4) darkwizar9102314425644.xml
5) snarterz_584609551.xml
6) alysiayeo594136055.xml
1) z-a-n-n2306499277.xml
7) zhangliyi_memories932668799030.xml
8) andy_tan911368887723.xml
9) config.xml
k are the numbers from 0-9
string[] valnames = rk2.GetValueNames();
foreach (string k in valnames)
{
if (k == "MRUListEx")
{
continue;
}
Byte[] byteValue = (Byte[])rk2.GetValue(k);
UnicodeEncoding unicode = new UnicodeEncoding();
string val = unicode.GetString(byteValue);
Array.Sort(k); //Error here
richTextBoxRecentDoc.AppendText("\n" + k + ") " + val + "\n");
}
Hi,
I have a string that is
$str = "testingSUB1";
How can I strip out SUB* from the string? I assume using preg_replace but I'm not good with matching what I want with regex.
Does anyone know how I can do this?
Thank you
Hi,
I have over 2000 HTML files that are now in Wordpress blog. I have the URL Map of Old_file.html and new wordpress URL.
I want 301 redirect but don't want to add 2000 lines to htaccess. Can you please suggest how to accomplish this using PHP so that when there is a request for old url, the php script should lookup into the database and redirect(301) to the new URL ?
Thanks.
I have a Biztalk project that imports an incoming CSV file and dumps it to a database table. The import works fine, but I only need to keep about 200-300 records from a file with upwards of a million rows. My orchestration discards these rows, but the problem is that the flat file I'm importing is still 250MB, and when converted to XML using a regular flat file pipeline, it takes hours to process and sometimes causes the server to run out memory.
Is there something I can do to have the Custom Pipeline itself discard rows I don't care about? The very first item in each CSV row is one of a few strings, and I only want to keep rows that start with a certain string.
Thanks for any help you're able to provide.
My question is a follow-up to the issue posted here
regarding the Intellisense performance issue when building a large solution in VS2008 that has many partial static classes.
Since Microsoft does not seem to be addressing the issue for VS2008, I would like to know if there are other ways around the problem? Waiting for VS2010 is not an option at this time. The proposed solution in the previous post is not practical as some of the partial classes may be regenerated and this would be a maintenance headache.