My primary indexes are unique reference numbers like 002345 and 000023.
If I format them as integers I loose my zero's. They need to be 6 digits.
Can I use CHAR? I don't need any auto increments.
Hi
OK I need to figure out how to count how many numbers are in the following example.
07000000000,07000000001,07000000002,07000000003,07000000004 etc...
I have tried the following PHP functions.
explode, implode, count, foreach and for.
None of them seemed to have worked and I am really stuck now.
Any help will is appriciated.
Kyle
I have two files
1st file is like this:
www.example.com
www.domain.com
www.otherexample.com
www.other-domain.com
www.other-example.com
www.exa-ample.com
2nd file is like this (numbers after ;;; are between 0-10):
www.example.com;;;2
www.domain.com;;;5
www.other-domain;;;0
www.exa-ample.com;;;4
and i want compare these two files and output to third file like this:
www.otherexample.com www.other-example.com
Both files have large size (over 500mb)
I have a lot of constants in my code that are unsigned numbers, e.g. counters, frequency cutoffs, lengths, etc. I started using std::size_t for all of these, instead of int or unsigned int.
Is that the right thing to do? I started it because the STL containers use it for their sizes, it's used for string position, etc.
I've got a text file, and wish to extract every above the !--- comment ---! into a new file, not based line numbers (but checking for the comment), How would I do this?
test123
bob
ted
mouse
qwerty
!--- comment ---!
123456
098786
I am trying to extract a number from a string. The number might be zero. Numbers appear like this: '+123', '-8' or '0'.
alert( '+123'.match(/[-?|+?]\d+/) );
alerts +123
alert( '-8'.match(/[-?|+?]\d+/) );
alerts -8
alert( '0'.match(/[-?|+?]\d+/) );
alerts null // why oh why?
How do I get '0'.match(/[-?|+?]\d+/) to return 0 instead of null?
I download one program that read file and then parse double values from String to Double. But I get an exception because this file contains numbers with '.' separator, but there is ',' in my culture. How can I set culture explicitly?
I've got an nxk sized matrix, containing k numbers per row. I want to use these k number as indexes to k-dimensional matrix. Is there any compact way of doing so in matlab or must I use a for-loop?
This is what I want to do (in matlab-pseudo code), but in a more matlabish way.
for row=1:1:n
finalTable(row) = kDimensionalMatrix(indexmatrix(row, 1),...
indexmatrix(row, 2),...,indexmatrix(row, k))
end
I have a file with the following expressions:
something[0]
Where instead of 0 there could be different numbers. I want to replace all these occurances with
somethingElse0
Where the number should be the same as in the expression I replaced. How do I do that?
I wrote a .sh file to compile and run a few programs for a homework assignment. I have a "for" loop in the script, but it won't work unless I use only integers:
#!/bin/bash
for (( i=10; i<=100000; i+=100))
do
./hw3_2_2 $i
done
The variable $i is an input for the program hw3_2_2, and I have non-integer values I'd like to use. How could I loop through running the code with a list of decimal numbers?
I'm looking into writing an Android game, tough I don't curerntly own an Android device. For those of you who own a device, how does the performance on the emulator relate to real device performance? I'm especially interested in graphics related tasks.
This obviously depends on both the machine running the emulator, and the specific device in question, but I'm talking rough numbers here.
This question is a duplicate, but since that post is heavily outdated, I figured it's irrelevant by now.
I am currently working on an ASP.NET 3.5 and C# web application which deals with users secure information like credit card numbers. What are some of the security measures which I need to take from an application development stand point so that I can sleep peacefully at night :)
Hi Guys,
Is there a javascript library the can recognize phone numbers in a web page? Just like what skype did on their firefox plugin.
Or do you know a way on how to do it? Websites or any tutorial that do the same would be very helpful.
Your reply is greatly appreciated.
Best,
I have a long string in javascript like
var string = 'abc234832748374asdf7943278934haskhjdasfhjkdfas83421def8923487234897234897';
I am trying to match like
abc234832748374 and def8923487234897 - that is - I have tried like
string.match(\abc[^abc]|\def[^def]|) but that doesnt get me both strings because I need numbers after them ?
Basically I need abc + 8 chars after and def the 8-11 chars after ? How can I do this ?
I am currently writing a JS rules engine which at one point needs to evaluate boolean expressions using the eval() function.
Firstly I construct an equation as such:
var equation = "relation.relatedTrigger.previousValue" + " " + relation.operator +
" " + "relation.value";
relation.relatedTrigger.previousValue is the value I want to compare.
relation.operator is the operator (either "==", "!=", <=, "<", "", =").
relation.value is the value I want to compare with.
I then simply pass this string to the eval function and it returns true or false as such:
return eval(equation);
This works absolutely fine (with words and numbers) or all of the operators except for = and <=. E.g. When evaluating the equation:
relation.relatedTrigger.previousValue <= 100
It returns true when previousValue = 0,1,10,100 & all negative numbers but false for everything in between.
I would greatly appreciate the help of anyone to either answer my question or to help me find an alternative solution.
Regards,
Augier.
P.S. I don't need a speech on the insecurities of the eval() function. Any value given to relation.relatedTrigger.previousValue is predefined.
edit: Here is the full function:
function evaluateRelation(relation)
{
console.log("Evaluating relation")
var currentValue;
//if multiple values
if(relation.value.indexOf(";") != -1)
{
var values = relation.value.split(";");
for (x in values)
{
var equation = "relation.relatedTrigger.previousValue" + " " + relation.operator +
" " + "values[x]";
currentValue = eval(equation);
if (currentValue)
return true;
}
return false;
}
//if single value
else
{
//Evaluate the relation and get boolean
var equation = "relation.relatedTrigger.previousValue" + " " + relation.operator +
" " + "relation.value";
console.log("relation.relatedTrigger.previousValue " + relation.relatedTrigger.previousValue);
console.log(equation);
return eval(equation);
}
}
Answer: Provided by KennyTM below. A string comparison doesn't work. Converting to a numerical was needed.
Is there any way to determine what should be your available bandwidth on EC2? Documentation seems to indicate that it should be based on your instance size, but I'm having a bit of trouble finding any specific numbers.
I want to make a automated call application, which will dial some mobile numbers, and give the response to them, and also record there voice in wave and text format. is it possible in PHP, or there is any buildin function or classes for doing that?
I saw a piece of code which was written like this:
if (from n in numbers select n where n = 5)
However, I tried writing something like this but came across errors (bare in mind the code sample may not be exactly as above as I am typing from memory). How can I write code like the above?
Thanks
I am trying to think of an elegant way of getting a random subset from a set in F#
Any thoughts on this?
Perhaps this would work: say we have a set of 2x elements and we need to pick a subset of y elements. Then if we could generate an x sized bit random number that contains exactly y 2n powers we effectively have a random mask with y holes in it. We could keep generating new random numbers until we get the first one satisfying this constraint but is there a better way?
When I read a sheet into a DataTable using the OleDbDataReader, floating point numbers loose their precision.
I tried forcing OleDb to read the excel data as string, but although the data is now contained in a DataRow with each Column defined as System.String it looses precision (18.125 - 18.124962832).
Any idea how to avoid this behaviour?
Python and Matlab quite often have integer date representations as follows:
733828.0
733829.0
733832.0
733833.0
733834.0
733835.0
733836.0
733839.0
733840.0
733841.0
these numbers correspond to some dates this year. Do you guys know which function can convert them back to YYYYMMDD format?
thanks a million!
My program takes a data.frame and crunches the numbers. At one point, values from j-th column are multiplied by a predefined values that depends on the column name (species name, actually - it's en ecological index). So far, I've been providing these values via a second data.frame by matching column names. What would be an efficient way of integrating fixed variable values within a function? I would like my program to be as portable as possible, without the need for a second data.frame file.
how do you get source ip, username, password, etc... of the client machine that sends a soap request? is there any of these details that one can pull for logging purposes?
I am using Java to handle the incoming SOAP requests. The service simply adds 2 numbers and is working, but I just need to get some client details.
Thanks, Lavanya
Is it possible to create new variable names on the fly?
I'd like to read data frames from a list into new variables with numbers at the end. Something like orca1, orca2, orca3...
If I try something like
paste("orca",i,sep="")=list_name[[i]]
I get this error
target of assignment expands to non-language object
Is there another way around this?
Input : {5, 13, 6, 5, 13, 7, 8, 6, 5}
Output : {5, 5, 5, 13, 13, 6, 6, 7, 8}
Question is to arrange the numbers in the array in decreasing order of their frequency preserving the order of their occurrence.
If their is a tie, for example, here 13 and 6 then the number occurring first in input array would come first in output array.