Hi,
how to convert a floating point 10 byte Hex string (Extended datatype in Delphi) to a C# datatype?
For example:
00 00 00 00 00 00 00 80 ff 3f is at Delphi 1
I am trying to take database backup. How can I do that when getdate is being appended with file name with format dd/mm/yyyy.
declare @dbName VARCHAR(100)
declare @path VARCHAR(100)
set @dbName='CallMeIndia'
set @path='F:\'+@dbName +'-'+convert(varchar(50),getdate(),103)+'.bak'
BACKUP DATABASE @dbName
TO DISK= @path
Is there an easy way to convert an angle (in degrees) to be between -179 and 180? I'm sure I could use mod (%) and some if statements, but it gets ugly:
//Make angle between 0 and 360
angle%=360;
//Make angle between -179 and 180
if (angle180) angle-=360;
It just seems like there should be a simple math operation that will do both statements at the same time. I may just have to create a static method for the conversion for now.
I am looking for a formula that will give me all of the Vector2 Points within a certain radius given the center.
Essentially what I am trying to do is change the color of each pixel in a 256 x 256 texture that is within a certain radius from a specific pixel (Using the Unity3d Game Engine). Programming Language doesn't really matter, as I can probably convert it to something I can use.
Hi,
How can I take a line like this:
Digital Presentation (10:45), (11:30), 12:00, 12:40, 13:20, 14:00, 14:40, 15:20, 16:00, 16:40, 17:20, 18:00, 18:40, 19:20, 20:00, 20:40, 21:20, 22:00, 22:40, 23:10, 23:40.
And match all the 24 hour times so I can convert to a more human readable format using date()?
Also I want to match times in the 24:00-24:59 range too
Thanks!
Hello: Does anyone have a solution to convert an acts_as_tree model to json that includes all its nodes? I trued using :include=:children, but that only goes down to one single level. Any idea how to iterate the whole tree?
Hi guys
I need to convert a string to a monetary format of {###}.###.###,##
that is
a value of 5461497702600
would become
54.614.977.026,00
The numbers become excessively large.
I am using
return string.Format(string.Format("{0:#" + (val < 1000 ? "" : "\\.") + "##0.00}", val));
which returns for the example
54614977.026,00
(only one dot)
Any help would be appreciated
The existing site in cakephp with flash. We need to convert it into mobile version.
Please suggest me is there any possibilities for making mobile version.
The goal: I want to convert a number from the format "10.234,56" to "10234.56"
Using this simple approach almost gets us there
/([\d\.]+),(\d\d)/ => '\1.\2'
The problem is that the first group of the match (of course) still contains the '.' character.
So questions are:
Is it possible to exclude a character from the group somehow?
How would you solve this with a single regexp
(I know this is a trivial problem when not using a single regexp)
I am trying to take the following number:
423523420987
And convert it to this:
4235 2342 0987
It doesn't necessarily have to be an integer either. In fact, I would prefer it to be a string.
I would like to ask how i should add the minus sign front of a decimal value.
i want the user to add e.g. 100 and behind the scenes to convert it in -100
thank you.
I want to calculate the quarter Hour from the given two datetimes:
Suppose datetime1 and datetime2 , i am doing somewhat like this :
int d = datetime2.Subtract(datetime1).Hours;
double l = Math.Round(Convert.ToDouble(d/4));
but if the QuarterHour is 3 (ie d=3), whats the good way to show the output- should it be zero or the round one :
3/4 = 0.75. so should i round up to 1 or 0 is ok.
And if round up to 1..how should i?
I'm looking for a way to define and send a JSON object array. I've figured out how to define a single JSON object, turn it into a string and send it, but what about an array of this type? Probably something simple I'm overlooking...
var myColumnSetting = { "ColumnName": name,
"ColumnIndex": index
}
convert it to a string
var myJSONText = JSON.stringify(myColumnSetting, false);
I have a string in my database that represents an image. It looks like this:
0x89504E470D0A1A0A0000000D49484452000000F00000014008020000000D8A66040....
<truncated for brevity>
When I load it in from the database it comes in as a byte[]. How can I convert the string value to a byte array myself. (I am trying to remove the db for some testing code.)
Hello,
I have a python program/file that I want to run repeatedly and calculate the averages of some variables over these runs. To do so, I thought it might be convenient to convert this program into a function or a class. One way I can think of is to add a
def Main():
line at the top and indent every line manually within it. Is there an easier way? I am using pydev on eclipse.
Thanks.
How would you convert an arbitrary string into a unique integer, which would be the same across Python sessions and platforms? For example hash('my string') wouldn't work because a different value is returned for each Python session and platform.
Hi, 've got collection:\
List<Car> cars=new List<Car>
Car has many pool, by identity is CarCode
I have tree cars, and two with identical CarCode
How to by linq Convert this collection to Cars with unical carCode??
Hi, I'm looking for an algorithm that given two permutations of a sequence (e.g. [2, 3, 1, 4] and [4, 1, 3, 2]) calculates the cycles that are needed to convert the first into the second (for the example, [[0, 3], [1, 2]]).
The link from mathworld says that Mathematica's ToCycle function does that, but sadly I don't have any Mathematica license at hand... I'd gladly receive any pointer to an implementation of the algorithm in any FOSS language or mathematics package.
Thanks!
Hi,
i have a list with objects. The object has a property 'Sales' which is a string.
Now i want to create a list of doubles with the values of all objects' 'Sales' properties.
I tried this:
var tmp = from n in e.Result select new{ Convert.ToDouble ( n.Sales) };
but this gives me this error:
Error 106 Invalid anonymous type member declarator. Anonymous type members must be declared with a member assignment, simple name or member access.