When I change the assembly information to lets say 1.0.0.1 i thought that i could read the version with $(Version) but it seems that it does not change?
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.
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.
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");
}
I have asked the question before but in a different manner. I am trying taking form data, compiling into a temporary CSV file and trying to send over to a client via FTP over SSL (this is the only route I am interested in hearing solutions for unless there is a workaround to doing this, I cannot make changes). I have tried the following:
ftp_connect - nothing happens, the
page just times out
ftp_ssl_connect - nothing happens,
the page just times out
curl library - same thing, given URL
it also gives error.
I am given the following information:
FTPS Server IP Address
TCP Port (1234)
Username
Password
Data Directory to dump file
FTP Mode: Passive
very, very basic code (which I believe should initiate a connection at minimum):
Code:
<?php
$ftp_server = "00.000.00.000"; //masked for security
$ftp_port = "1234"; // masked but not 990
$ftp_user_name = "username";
$ftp_user_pass = "password";
// set up basic ssl connection
$conn_id = ftp_ssl_connect($ftp_server, $ftp_port, "20");
// login with username and password
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
echo ftp_pwd($conn_id); // /
echo "hello";
// close the ssl connection
ftp_close($conn_id);
?>
When I run this over a SmartFTP client, everything works just fine. I just can't get it to work using PHP (which is a necessity). Has anybody had success doing this in the past? I would be very interested to hear your approach.
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.
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?
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.
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)
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 have a winform application that fires a Stored Procedure which elaborates several records (around 500k). In order to inform the user about how many record have been processed, I would need a SP which returns a value every n records. For example, every 1000 row processed (most are INSERT).
Otherwise I would be able only to inform when ALL record are processed. Any hints how to solve this?
I thought it could be useful to use a trigger or some scheduled task, but I cannot figure out how to implement it.
I am working on an enterprise application where I can have several links present in table or none depending on the data.
The links appear in the table and have following code behind them
<td class="Row"><span id='s_3_2_14_0' ><a href='JavaScript:SWETargetGotoURL("/eservice_enu/start.swe?SWECmd=GotoView&SWEView=Active+PO+Serial+View&SWEPostnApplet=Purchase+Order+List+Applet&SWEPostnRowId=1-KPBLOZ","_self")'>2001103009</a></span></td>
I need to find all the A tags present in the page inside SPAN tag
having following text
SWEView=Active+PO+Serial+View&SWEPostnApplet=Purchase+Order+List+Applet
I tried the following expression but it returns 0
$('a[href*="SWEView=Active+PO+Serial+View&SWEPostnApplet=Purchase+Order+List+Applet"').length;
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.
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.
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
I was wondering how I could plot more tick marks when plotting time on the x-axis.
Basically, a time equivalent to pretty. Pretty obviously doesn't work so well with times, as it uses factors of 1,2,5 and 10. For time one probably wants e.g. hours, half hours, ...
plot(as.POSIXct(x,origin="1960-01-01"),y,type="l",xlab="Time")
gives really too few and widely spaced tickmarks.
zoox<-zoo(y,as.POSIXct(stats$Time,origin="1960-01-01"))
plot(zoox)
gives the same.
Thanks
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.
What is the upper limit of records for MySQL database table. I'm wondering about autoincrement field. What would happen if I add milions of records? How to handle this kind of situations?
Thx!
I'm using this code:
s = line.match( /ABCD(\d{4})/ ).values_at( 1 )[0]
To extract numbers from strings like:
ABCD1234
ABCD1235
ABCD1236
etc.
It works, but I wonder what other alternative I have to to this in Ruby?
I have the following Model:
Entities:
Product (Contains basic data for
products: price, etc)
Attribute (Contains data for all possible optional attributes)
ProductAttribute (Contains data for optional attributes of a product, eg.
Color, Model, Size). ProductAttribute
is essentially a many to many
relationship with payload (ProductId,
AttributeID, Value)
And this piece of code:
private static void ListAttributes(Product p)
{
p.ProductAttributes.Load();
foreach (var att in p.ProductAttributes)
{
att.Attribute.load();
Console.WriteLine("\tAttribute Name:{0} - Value {1}",
att.Attribute.Name,
att.AttributeValue);
}
}
This piece of code will fire a query for each time the att.Attribute.Load() method is called in the foreach loop, only so i can get display the name of the attribute.
I would like to fetch the Attribute.Name together with the query that fetches all attribute values, i.e. join ProductAttribute and Attribute.
Is there any way to achieve this within my method?
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.
Hi all
I have a text file like below
2 1 2
5 10 13 11 12 14
2 0 1
2 99 2
200 2
1 5
5 1 2 3 4 5
1 0
0 0
I want to read file line by line, and read the umbers from each line. I know how to use the stream to read a fixed field line, but what about the non-fixed line?
Best Regards,
I would like to create a color generator based on random numbers, which might differ just slightly, but I need colors to be easily recognizable from each other. I was thinking about generation then in a rgb format which would be probably easiest. I'm afraid simply multiplying given arguments wouldn't do very well. What algorithm do you suggest using? Also, second generated color should not be the same as previous one, but I don't want to store them - nor multiplying with (micro)time would do well since the scripts' parts are usually faster.