I have an object which is a composite of several other objects. When i use the getObjectSize() method in the Instrumentation package, does it include the size of the composite objects also?
I want to be able to detect (using regular expressions) if a string contains hebrew characters both utf8 and iso8859-8 in the php programming language. thanks!
Hi!
I have excel file with such contents:
A1: SomeString
A2: 2
All fields are set toString format.
When I read file in java using poi it tells that B1 is numeric cell format.
The problem is that the value in A1 can be 2 or 2.0 so I can't just use .toString().
Can anyone help please?
how do we pass a string Mr.X & Mr.Y in the URL.
I have tried this but this one does all the chars but ampersand.
[urlString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]
Thanks for the help.
take this string as an example: "will see you in London tomorrow and Kent the day after tomorrow".
How would I convert this to an associative array that contains the keywords as keys, whilst preferably missing out the common words, like this:
Array ( [tomorrow] = 2 [London] = 1 [Kent] = 1)
Any help greatly appreciated.
I'm attempting to upload a file like this:
import pycurl
c = pycurl.Curl()
values = [
("name", "tom"),
("image", (pycurl.FORM_FILE, "tom.png"))
]
c.setopt(c.URL, "http://upload.com/submit")
c.setopt(c.HTTPPOST, values)
c.perform()
c.close()
This works fine. However, this only works if the file is local. If I was to fetch the image such that:
import urllib2
resp = urllib2.urlopen("http://upload.com/people/tom.png")
How would I pass resp.fp as a file object instead of writing it to a file and passing the filename? Is this possible?
How can I tell the linker that statically link libfoo.a while building the shared object sharedobj.so using gcc/make.
I have tried to pass the LDFLAG options
LDFLAGS += -W1 --whole-archive -L/path/to/libfoo -lfoo
I have also tried to pass LDFLAGS the options
LDFLAGS += -W1, static -L/path/to/libfoo -lfoo
I have also tried to pass LDFLAGS the options
LDFLAGS += -W1, Bstatic -L/path/to/libfoo -lfoo
and
I have also tried to pass LDFLAGS the options
LDFLAGS += -W1, statically_linked -L/path/to/libfoo -lfoo
I have read through a number of links that tell me how to do it but none have worked so far.
Hi,
I have this code written in .NET 4.0 using VS2010 Ultimate Beta 2:
smtpClient.Send(mailMsg);
smtpClient is a reference to SmtpClient (I have the relevant references added), and likewise for mailMsg (is MailMessage) - there are no errors stating anything like check for missing assemblies.
However, I keep getting an error saying that I have the incorrect no of overloads, when SmtpClient takes either a MailMessage object or the To address, From address, Subject, etc.
Why doesn't this code work? Totally confused.
Thanks
Hello i need to know there my flash application is running.
in object src my domain. but flash running on others domains.
and i want to know where. and send it with request on my server.
Thanks.
sorry for y bad grammar.
I want to use a variable in a regex, like this:
variables = ['variableA','variableB']
for i in range(len(variables)):
regex = r"'('+variables[i]+')[:|=|\(](-?\d+(?:\.\d+)?)(?:\))?'"
pattern_variable = re.compile(regex)
match = re.search(pattern_variable, line)
The problem is that python adds an extra backslash character for each backslash character in my regex string (ipython), and makes my regex invalid:
In [76]: regex
Out[76]: "'('+variables[i]+')[:|=|\\(](-?\\d+(?:\\.\\d+)?)(?:\\))?'"
Any tips on how I can avoid this?
How convert a string into a ActiveSupport::TimeWithZone? My dilemma is this. I need to update a field (called updated_at). The field in mysql is datetime, and the class is ActiveSupport::TimeWithZone. But the dates are strings like "10/17/2008". I used "10/17/2008".to_date (And I intend .to_time and to_datetime), and even if in console the ActiveRecord class save succesfully, the field in the database still is the current date...
Thanks in advanced.
I am looking for a regex to validate a string. I want to allow numbers, alpha characters, spaces and any of the following characters in any order:
+ - ( ) ,
Thanks.
I am trying to get logging via the application.ini file going and I am getting stuck with an error.
resources.log.db.writerName = "Db"
resources.log.db.writerParams.db.adapter = "PDO_SQLITE"
resources.log.db.writerParams.db.dbname = ROOT "/data/tmp.db3"
resources.log.db.writerParams.db.table = "logs"
resources.log.db.writerParams.db.columnMap.priority = "priority"
resources.log.db.writerParams.db.columnMap.message = "message"
Fatal error: Call to a member function insert() on a non-object in /var/www/libs/zend/library/Zend/Log/Writer/Db.php on line 137
According to the ActionScript 3.0 documentation, the TextField classes "size" property is an Object. Why is this? Clearly this is a number! When I check its type (using typeOf()), it returns "Number". So whats the deal?
Hi, I've looked through other questions but i don't think this has been asked before:
I have an email client i'm building in the .NET framework, and would like to automatically create google calendar events (just like in gmail). Is there a way to feed an email message (i.e. a string) and automatically identify if there is a possible event or not in that?
Any ideas?
Thanks, Erika
I want to do a database-side string concatenation in a Rails query, and do it in database-independent way.
SQL-92 specifies double-bar (||) as the concatenation operator. Unfortunately it looks like MS SQL Server doesn't support it; it uses + instead.
I'm guessing that Rails' SQL grammar abstraction has solved the db-specific operator problem already. If it does exist, how do I use it?
Python says I need 4 bytes for a format code of "BH":
struct.error: unpack requires a string argument of length 4
Here is the code, I am putting in 3 bytes as I think is needed:
major, minor = struct.unpack("BH", self.fp.read(3))
"B" = Unsigned char (1 byte) + "H" unsigned short (2 bytes) = 3 bytes (!?)
struct.calcsize("BH") says 4 bytes.
Hi, I am working on a project and I need to save user configuration. The configuration is a set of Jchechboxes I need to store their state (true, false). Which do you think is the better way of saving it, in a file and if yes in what (ini, cfg, txt), or it is better to serialize the object with the states?? Or if there is another way, please tell me :)
Cheers
I want a class property to be reference to another class, not its object and then use this property to call the class's static methods.
class Database {
private static $log;
public static function addLog($LogClass) {
self::$log = $LogClass;
}
public static function log() {
self::$log::write(); // seems not possible to write it like this
}
}
any suggestions how i can accomplish this?
cause i have no reason making them objects, i want to use the classes for it.
I am loading an html page into a WebBrowser object in a VB.NET Windows Forms application. The user may make changes to textboxes, dropdowns, etc. on the HTML page displayed in the browser. I want the ability to save the current context to a .pdf file on the local HD. I am able to print using WebBrowser.Print(), which shows the current context, but what ways are possible to get this saved as a PDF file locally?
I have a Java Map (out of Strings and Ints) object that I want to save to a database.
Is there a standard way to go about this task?
Is there a way to compress the Map to take less space on the harddrive?
Hi, does anyone know if it is possible to cast a generic type with a certain type parameter (e.g. Bar) to the same generic type with the type parameter being a base type of Bar (such as object in my case). And, if it is possible, how would it be done?
What I want to do is have a collection of Foo but be able to add Foos with more specific type arguments.
Thanks
Hi,
For winforms applications I'm wondering what setup code should go in:
MainForm()
as opposed to
MainForm_Load(object sender, EventArgs e)
Are there any best practise guidelines here?