hello
i have an char** arr which is an array of strings and i want to erase the 2 last cell of the array or maybe to create a new char** but without those last 2 cells
thank you very much.
I have a c++ project being developed in QT. The problem I'm running in to is I am wanting to have a single base class that all my property classes inherit from so that I can store them all together. Right now I have:
class AbstractProperty
{
public:
AbstractProperty(QString propertyName);
virtual QString toString() const = 0;
virtual QString getName() = 0;
virtual void fromString(QString str) = 0;
virtual int toInteger() = 0;
virtual bool operator==(const AbstractProperty &rightHand) = 0;
virtual bool operator!=(const AbstractProperty &rightHand) = 0;
virtual bool operator<(const AbstractProperty &rightHand) = 0;
virtual bool operator>(const AbstractProperty &rightHand) = 0;
virtual bool operator>=(const AbstractProperty &rightHand) = 0;
virtual bool operator<=(const AbstractProperty &rightHand) = 0;
protected:
QString name;
};
then I am implementing classes such as PropertyFloat and PropertyString and providing implementation for the comparator operators based on the assumption that only strings are being compared with strings and so on. However the problem with this is there would be no compiletime error thrown if i did
if(propertyfloat a < propertystring b)
however my implementation of the operators for each derived class relies on them both being the same derived class. So my problem is I cant figure out how to implement a property structure so that I can have them all inherit from some base type but code like what I have above would throw a compile time error.
Any ideas on how this can be done? For those familiar with QT I tried using also a implementation with QVariant however QVariant doesn't have operators < and defined in itself only in some of its derived classes so it didn't work out.
What my end goal is, is to be able to generically refer to properties. I have an element class that holds a hashmap of properties with string 'name' as key and the AbstractProperty as value. I want to be able to generically operate on the properties. i.e. if I want to get the max and min values of a property given its string name I have methods that are completely generic that will pull out the associated AbstactProperty from each element and find the max/min no matter what the type is. so properties although initially declared as PropertyFloat/PropertyString they will be held generically.
"([\"'])(?:\\\\?+.)*?\\1"
I came up to this regexp to match all quoted strings..
It seems to work great...
The problem is how to match the text that isnt inside quotes..
The inverse -negative somehow...
I read the documentation and
(?!(([\"'])(?:\\\\?+.)*?\\1))
doesnt work
I am trying to parse the MySQL data types returned by "DESCRIBE [TABLE]".
It returns strings like:
int(11)
float
varchar(200)
int(11) unsigned
float(6,2)
I've tried to do the job using regular expressions but it's not working.
PHP CODE:
$string = "int(11) numeric";
$regex = '/(\w+)\s*(\w+)/';
var_dump( preg_split($regex, $string) );
Web pages are, by nature, state-less objects. When you click from page to page in an ASP.net application, each request for a page is treated as a brand-new request. We use things like cookies, session-variables, and query strings to maintain state from page to page.
When you log in to an ASP.net web application using Windows Authentication, how does IIS persist your identity between pages?
I was playing around with the rx function for generating regular expressions from sexps in ELISP but couldn't figure out how to generate the regular expression "\\documentclass" for use in org-export-latex-classes:
(rx "\\documentclass")
(rx "\\" "documentclass")
(rx (char "\\") "documentclass")
Which when evaluated give respectively the following outputs:
"\\\\documentclass"
"\\\\documentclass"
"[\\]documentclass"
Is "\\documentclass" equivalent to "[\\]documentclass"?---I think it is, but am not sure. Can I generate the former using rx?
Edit: Whilst the question was valid I realize my motivation was not; because org-export-latex-classes use strings not regular expressions.
My project currently contains two largish property lists. One is currently 20KB; another is 8KB. So far, I have been maintaining them with xCode's property list editor. This is manageable but also a bit clunky. I am wondering if other people have better ways of doing this?
So far, my lists consist of nested arrays of strings. The depth is not uniform.
Hi
I am Serialing an object using
GetObjectData(SerializationInfo info, StreamingContext context)
{
info.AddValue("string1",subobject1);
info.AddValue("string2",subobject2);
}
what will be stored in stream? do the strings also store?
Hi, i am seriously struggling to get my head around regex.
I have a sring with "iPhone: 52.973053,-0.021447"
i want to extract the two numbers after the colon into two seperate strings so delimited by the comma.
Can anyone help me? Cheers
I have a Flex/Actionscript 3 application that displays RSS feeds in a Text element. It strips out any HTML formatting present, but it's not handling HTML special entity codes properly -- it's rendering &mdash as the literal string instead of replacing it with an em-dash, etc. Is there any systematic way I can make it handle those codes properly, or am I going to need to manually replace those strings regex style?
Is there a faster way to do this in python?
[f for f in list_1 if not f in list_2]
list_1 and list_2 both consist of about 120.000 strings. It takes about 4 minutes to generate the new list.
I know jQuery has a helper method for parsing unit strings into numbers. What is the jQuery method to do this?
var a = "20px";
var b = 20;
var c = $.parseMethod(a) + b;
I am using Firefox's native JSON.parse() to parse some JSON strings that include regular expressions as values, for example:
var test = JSON.parse('{"regex":"/\\d+/"}');
The '\d' in the above throws an exception with JSON.parse(), but works fine when I use eval (which is what I'm trying to avoid).
What I want is to preserve the '\' in the regex - is there some other JSON-friendly way to escape it?
Following is the problem statement.
There are n numbers of match strings, If event A occurs and then in certain period of time event B occurs then I do not raise alarm. but if B do not occurs then i have to raise alarm.
There can be multiple chain of events which defines whether to raise alarm or not.
Hello!
I have IEnumerable - that i recieved(converted) from dattabase.
i need to select from this collection only unique strings.
i suppose that i need to use linq group by string...
please help.
Suppose I want to add minor syntactic sugars to Java. Just little things like adding regex pattern literals, or perhaps base-2 literals, or multiline strings, etc. Nothing major grammatically (at least for now).
How would one go about doing this?
Do I need to extend the bytecode compiler? (Is that possible?)
Can I write Eclipse plugins to do simple source code transforms before feeding it to the standard Java compiler?
I'm wondering if it is possible to create a separate APK file which contains only language specific strings and somehow persuade my program to try to read the string resources first from that package's resource and then from the program's own resources... I would like to have a main program with 2-3 mayor laguages and the rest of the languages would go into a separate language pack. (This is to keep the main program size small as I have already 12 translations)
Given a multimap<A,B> M what's a neat way to create a vector<B> of all values in M with a specific key.
e.g given a multimap how can I get a vector of all strings mapped to the value 123?
An answer is easy, looping from lower-upper bound, but is there a neat loop-free method?
Hi
I have been trying to localize my iPhone app in two languages - english and german
I have created two folders en.lproj and de.lproj each containing Localizable.strings file for respective language. I have included these files in my resources folder, changed the encoding of these files to UTF-16.
I have tried cleaning the project and building it again, deleting folder at path: Library/Application Support/iPhone Simulator/User
But the problem is still there. Anybody having an idea please help.
What is meant by String Pool ?
What is difference between the following declarations :
String s="hello";
String s=new String("hello");
Is there any difference between the Storing of this two strings by JVM ?
How can I encode strings on UTF-16BE format in PHP? For "Demo Message!!!" the encoded string should be '00440065006D006F0020004D00650073007300610067006'. Also, I need to encode Arabic characters to this format.
if I have 4 variables
startTime;
endTime;
startMerid;
endMerid;
startMarid and endMarid are either going to be 'AM' or 'PM'.
but startTime and endTime are going to be strings like 'dd:dd'
so it may be start:12:30 PM and end:5:30 PM
How can I validate that the end time is not before the start time?
Thanks!!
Say I have http://www.mysite.com/I-Like-Cheeseburgers and I want that to point to Item with id 3. Sometime later, I change the name of the item, and now its http://www.mysite.com/I-Like-Hamburgers (and perhaps many more times). I want all these URLs to remain pointing to Item 3. Is it efficient to simply keep a table of [strings,item_ids] and do a lookup on this? Is there a better way?
How can I find the dimensions of a matrix in Python. Len(A) returns only one variable.
Edit:
Hi Thanks.
close = dataobj.get_data(timestamps, symbols, closefield)
Is (I assume) generating a matrix of integers (less likely strings). I need to find the size of that matrix, so I can run some tests without having to iterate through all of the elements. As far as the data type goes, I assume it's an array of arrays (or list of lists).
Hi, im traversing through the registry, taking the values of the keys and storing them as strings. I have discovered there are many different types. Some of these types are causing my filestream writer to fail. Is it possible to convert all of the below into a string form. The actual data value is not important, just the ability to differentiate between different values.
DWORD
ExpandString
Binary (is this just the same as byte[] ?)
MultiString