how to get count of '#' in a string ?
something like int RowFormat = drr[3].ToString("#").Length;
example string "grtkj####mfr "
RowFormat must return 4
Hei everyone!
I have this variable in shell containing paths separated by
a space:
LINE="/path/to/manipulate1 /path/to/manipulate2"
I want to add additional path string in the beginning of the string and as well right after the space so that the variable will have the result something like this:
LINE="/additional/path1/to/path/to/manipulate1 additional/path2/to/path/to/manipulate2"
Any help appreciated
Thanks in advance
I have controller with action new, and I want it to create ActiveRecord::Base descendant object, and write it into database (without showing it to user).
def new
active_order = current_user.orders.find {|o| o.status > 0 }
active_order = Order.new if active_order.nil?
(...)
end
Order.new creates local object, but my question is -- how to make Rails to fill it with default values and write to database?
I've already known that there is an interface in UIWebView for object c to call javascript.
And now I have a problem:
After the javascript is finished, there are some result in the javascript, and I want to get it out and use it with object c. Is it possible to get the result from javascript?
I need to use a function on a vector that does not take a ts object. I'm trying to convert it to a plain old vector but I just can't seem to figure it out. I googled around but mostly people are trying to convert data types into ts object. I want to go the other way. Any help would be appreciated.
Hi,
Can we use foreach loop for Iqueryable object?
I'd like to do something as follow:
query = Iqueryable<Myclass> = objDataContext.Myclass; // objDataContext is an object of LINQ datacontext class
int[] arr1 = new int[] { 3, 4, 5 };
foreach (int i in arr1)
{
query = query.Where(q => (q.f_id1 == i || q.f_id2 == i || q.f_id3 == i));
}
It gives me wrong output as each time value if i is changed.
i make a textbox,enter some data, store it into string format,there are some values as numbers,can i change these string numbers into integer format
the problrm is for visual c++ in visual studio in the windows form
Compiling my program I have this error:
/usr/include/xercesc/util/Compilers/GCCDefs.hpp:133:60: error: declaration of ‘int strcasecmp(const char*, const char*)’ has a different exception specifier
/usr/include/string.h:536:12: error: from previous declaration ‘int strcasecmp(const char*, const char*) throw ()’
make: *** [src/test/VFTImageMaterial.o] Error 1
Any idea about this conflict with string.h?
All,
Has anyone figured out how to return the sql for an object that is in Webi using the rebean api? I have got the ReportExpression of the column but, from there I am having a difficult time retrieving the SQL of the object.
Thanks
Anyone have a suggestion for a good utility class that maps values from one objectto another? I want a utility class that uses reflection and takes two objects and copies values from the 1st objectto the second if there is a public property with the same name.
I have two entities that are generated from a web service proxy, so I can't change the parent class or impliment an interface or anything like that. But I know that the two objects have the same public properties.
I need to create a database column which will store a string encrypted using Triple DES. How do I determine the length of the encrypted string column?
(Answers for algorithms other than Triple DES are also welcome.)
Hi all,
How do I convert a stringto a date object in python?
The string would be: "24052010" (corresponding to the format: "%d%m%Y")
I DON'T want a datetime object.
I suspect that I'm asking a trivial question but I searched and couldn't find it neither on stackoverflow nor on google.
Thank you,
Elif
Hello,
how could I remove all charakters from a string that aren't a-z/A-Z and 0-9 and _ with PHP?
I tried that but it has no effect, it returns the same string back:
preg_replace('[^a-zA-Z0-9_]', '', 'Testdo123_-:=)§%&');
I am new to c# programming and I want to ask a question.
How can I get the value in () and store it in another string. example:
I have string
s1="here there (hi)";
How can I get
s2="hi";
the () will always be at the end of the sentence (never at first or in between).
Hi there
I want to convert a stringto a generic type
I have this:
string inputValue = myTxtBox.Text;
PropertyInfo propInfo = typeof(MyClass).GetProperty(myPropertyName);
Type propType = propInfo.PropertyType;
object propValue = ?????
I want to convert 'inputString' to the type of that property, to check if it's compatible
how can I do that?
tks
Hi,
I need to access the X,Y values of a vertex object after Ive rotated it (with glRotate3f). How is it possible? I need em to solve an object collision problem where collisions will be sending objects in an angle related direction based upon objects rotation degrees.
Thanks
Need to get a value of an enumeration of a given string literal like "xlCenter" (these values are cut and pasted from Excel Macro).
I would like to retrieve the actual constant value (int) -4108="xLCenter" via com marshaling is this possible ? if so how ?
Ideally I am looking for function like this
public int ExcelConstant(string constantName)
{ ...}
Thanks
I have a buffer open in emacs. I want a function that will return t if the current buffer contains the string, otherwise it returns nil.
(defun buffer-contains-substring (string)
...
)
I have a need to load an entire LINQ-to-SQL object graph from a certain point downwards, loading all child collections and the objects within them etc. This is going to be used to dump out the object structure and data to XML.
Is there a way to do this without generating a large hard coded set of DataLoadOptions to 'shape' my data?
I am trying to parse a list of operating system instances with their unique identifiers. I am looking for a solution to parse a text string, and pass the values into two variables. The stringto be parsed is as followed:
"Ubuntu 9.10" {40f2324d-a6b2-44e4-90c3-0c5fa82c987d}
I want to copy a record with all his relations.
I'm trying with:
$o = Doctrine::getTable('Table')->Find(x);
$copy = $object->copy();
$relations = $o->getRelations();
foreach ($relations as $name => $relation) {
$copy->$relation = $object->$relation->copy();
}
$copy->save();
This code doesn't works, but I think it's on the way.
i need to trim a stringto its first 100 characters using jquery/javascript.
also is it possible to scan a string and look for a particular combination of keywords such as #key?
thanks a lot for the help.
I have a javascript variable that basically looks like this:
my_svg_image = '<circle cx="227.58331298828125" cy="102" r="3" style="fill:black;stroke-width:0" />';
It was loaded from my database. Is there a way I can parse that string and add it to the DOM with Javascript? I have svgweb set up, but don't see how I can get it to parse this string. Are there other libraries that might help?