I'm writing a PHP library that has a Number class that uses the bcmath extension for arbitrary precision.
I have two questions:
How much slower is bcmath compared to using the built-in int and float types?
bcmath has an optional scale argument (that defaults to 3 digits). For an general purpose Number class that anyone could use, wha...
I am getting an SqlException in the logs of .NET 3.5 app, I am looking for the corresponding number (value of the property SqlException.Number).
System.Data.SqlClient.SqlException: A transport-level error has occurred
when receiving results from the server. (provider: TCP Provider, error: 0
- The specified network name is no longer av...
I'm looking for a good way to generate a unique order ID. Can you see any problems with the code below?
int customerId = 10000000;
long ticks = DateTime.UtcNow.Ticks;
long orderId = customerId + ticks;
int orderNumber = orderId.GetHashCode();
I'm going to check that the number is unique in the database before creating the order.
...
For http://macintosh.local/clientname/102
I can get the numeric reference (3 digits) like this:
RewriteRule ^[^/]+/([0-9]{3}+)/?$ album.php?ref=$1 [L]
Now I want to get my reference in my SEO URL:
http://macintosh.local/clientname/102-some-keywords
...
I've got a problem in Crystal Reports that's been bugging me for years, and I wondered if anybody might have a solution. I've got a few fields (data fields and formulae, numeric and string) all aligning to the left in design mode.
When I move to preview mode, the numeric fields never line up with the other fields, and they are slightly...
Has anyone tried exporting data to Numbers in iWork? I want to generate a spreadsheet programmatically but I'm not having much success.
I've tried unzipping a .numbers document and analysing the XML to see if I could interpret it but it's far too complicated. Also, I couldn't find the DTDs used by Apple.
Judging by what's out there thi...
Hi,
I am writing up my thesis in Latex and have a template. It works nicely for every thing else except one. Chapter numbers are correctly incremented on the first page of each chapter but for consecutive pages of each chapter, the header saying "Chapter x - This is a chapter title" have 1 always as chapter number.
Following is the cod...
If I have a string '1+1' is there a way, other than eval(string) to get the numerical value of it i.e. I want to turn '1+1' into 2.
...
How do you generate a random number when a button is clicked, and depending on that number, different actions take place.
I probably only need a random number from 1-10.
-(IBACTION)buttonClicked{
"generate the random number"
if(number == 1){
something happens
}
else if(number == 2){
somethine else happens
}
etc
}
...
I want to add number dynamically and aiming the outputs as follows.
<li data-id="id-1".. > ...</li>
<li data-id="id-2".. > ...</li>
<li data-id="id-3".. > ...</li>
<li data-id="id-4".. > ...</li>
<li data-id="id-5".. > ...</li>
<li data-id="id-6".. > ...</li>
I tried this, but it does not work.
Views
for($i=1; $i<=$image_num; $i++){
...
Hello!
This is strange to me:
when I run in Java
byte[] data = new byte[] { 50, -106, 40, -22, -94, -119, -52, 8 };
ByteBuffer bb = ByteBuffer.wrap( data );
System.out.println( bb.getLong() );
result is 3645145936617393160
when I run in C#
//unsigned values (signed&0xff)
byte[] bytes = new byte[] { 50, 150, 40, 234, 162, 137, 204,...
Hello,
i need to validate currency field with formcheck plugin for mootools.
It has number validation type, and number accepts regex to personalize validation.
I need sample to validate:
1.000,01 --> ok
1,000.02 --> not ok
1000,12 --> ok
1000.13 --> not ok
10.000 --> ok
100.00 --> not ok
and so on.
Can you help me p...
Hello
Messaging APP:
Is it possible to use port numbers(to Send SMS) in Android App like we use in J2ME. So that only those App which have the same Port Number
can listen.
Problem Faced:
There is an Application X in Both Users A & B.
When we tried sending SMS from A to B using our X Messaging Application, The message will go to our...
I have a codegear C++ builder project and added the JCL library to get a stackdump when an exception occurs. I get the stackdump, but the most important thing is missing, the line number where the exception actually happened. I get the function name, but if the function is 30 lines long it's not easy to guess where the problem is.
Am I ...
Hey,
I am trying to get jQuery to generate a random background on my site body absed off a number. So I'm trying to get it to generate either main1.jpg or main2.jpg and throw it into the body as a background.
For some reason it is only generating main2.jpg. Here is my code:
$(document).ready(function(){
$("body").css({'background...
Hey guys,
Basically I've been trying to make a working hours calculator and I've run into a problem. When the start time's value is greater than the finish time (eg. start is 23 and finish is 19), the result comes up as a negative. So what I want it to do in that scenario is to then multiply the negative number by -1 to make it positi...
Hey guys, I basically have a working hours calculator in the works and I was wondering how I can disable certain numbers from being put into a field. For example, for the minutes field, I would like to prevent 61-99 being inputted. What sort of code would I need to make that work?
...
Right, basically I want to add two numbers together. It's for a working hours calculator and I've included parameters for a night shift scenario as an if statement. However, it now mucks up the day shift pattern. So I want to sort out that if the start time is below 12, then it'll revert to the original equation shown in the code instead...
We have to transform some XML that contain numbers in exponent (aka scientific) notation
eg.
<Value>12.34e12</Value>
<Value>-12.34e-12</Value>
rather irritatingly, we cannot use the sum() function and the like because the XSLT parser expects numbers to be in decimal format.
[We are using the .Net XslCompiledTransform class...
First off, let me say that this is not homework (I am an A-Level student, this is nothing close to what we problem solve (this is way harder)), but more of a problem I'm trying to suss out to improve my programming logic.
I thought of a scenario where there is an array of random integers, let's for example say 10 integers. The user will...