Unlike new and delete operators malloc does not call the constructor when an object is created. In that case how must we create an object so that the constructor will also be called.
Working with COM interop, I can call a managed function from within unmanaged code.
But, this only gives me the HRESULT for the exception, in case a managed exception is thrown.
Is there anyway to further inspect the exception from the unmanaged code? For example, to look at the message contained in the exception object.
Thanks!
I have an owner-drawn list control in my Windows program. I use CListCtrl::GetBkColor to get the background color, and for a selected item I use GetSysColor(COLOR_HIGHLIGHT). This matches what Windows uses for non owner drawn list controls, except for the case where the control doesn't have focus - then the background is replaced with gray.
Does Windows use one of the GetSysColor constants for the selected but unfocused background? If so, which one?
I have an xml stored property of some control
<Prop Name="ForeColor" Type="System.Drawing.Color" Value="-16777216" />
I want to convert it back as others
System.Type type = System.Type.GetType(propertyTypeString);
object propertyObj =
TypeDescriptor.GetConverter(type).ConvertFromString(propertyValueString);
System.Type.GetType("System.Drawing.Color") returns null.
The question is how one can correctly get color type from string
(it will be better not to do a special case just for Color properties)
Update
from time to time this xml will be edited by hand
I need to create a use case (using Selenium) in which I send HTTP calls with a Cookie through the browser and capture the return value in a text file.
What do I need to do this, I have run this using CURL in the command line, but we are encountering issues with the same, and hence wish to verify using a real UI browser.
I would like to obtain the list of controls under a given point.
There is a method on System.Windows.Form to obtain a control under a point(GetChildAtPoint) but not point(GetChildsAtPoint).
Is there something similar for the list of controls (if borders intersect one other):
I need this because I select the objects when user clicks on the panel(I use Microsoft.VisualBasic.PowerPacks.RectangleShape as label bellow). In case if labels are superposed, user should be asked what object to select.
Hi,
Just confirming -does VS2010 does not install SQL Server during installation? I'm assuming no.
This being the case I therefore need to download a copy of SQL Express 2005 or something to develop against on my windows XP home PC? Is this correct? Or would the Dev edition of SQL Server 2005 run/install on Windows XP Home?
thanks
How can i implement message security in WCF with custom attributes,
One way of doing this by UserNamePasswordValidator which accepts user name and password
but in my case I have to pass 2 more attribute that is company and region to authenticate the user.
Please suggest the solution for achieving this.
I'm creating a rails 3 application that will be decentralized and I need to use UUID as primary key for my tables, what would be the best gem, plugin for the Job. I also would like to know if it is possible to make in ActiveRecord polymorphic relationships without using the polymorphicable_type column for it, given the case that I'm using UUID.
how do you create a class to read the html body and phase it into a variable?
Example
the page http://domain.com/page1.aspx
display the following plaintext within the html body content
item1=xyz&item2=abc&item3=jkl
how do you read content of the html body and assign them to a variables
in this case
variable1=xyz (value taken from item1=)
variable2=abc (value taken from item2=)
variable3=jkl (value taken from item3=)?
For university, I perform bytecode modifications and analyze their influence on performance of Java programs. Therefore, I need Java programs---in best case used in production---and appropriate benchmarks. For instance, I already got HyperSQL and measure its performance by the benchmark program PolePosition. The Java programs running on a JVM without JIT compiler. Thanks for your help!
P.S.: I cannot use programs to benchmark the performance of the JVM or of the Java language itself (such as Wide Finder).
Is there a way to test, from within an android app, if the device it's running on is actually using the Froyo JIT?
I ask because I know that 2.2 has a JIT, but we've already had a few test builds that seem to lack the JIT. So it's not a case where you can just test for the api version and be assured you've got the JIT.
Ok so i'm executing the following line of code in javascript
RegExp('(http:\/\/t.co\/)[a-zA-Z0-9\-\.]{8}').exec(tcont);
where tcont is equal to some string like 'Test tweet to http://t.co/GXmaUyNL' (the content of a tweet obtained by jquery).
However it is returning, in the case above for example, 'http://t.co/GXmaUyNL,http://t.co/'.
This is frustracting because I want the url without the bit on the end - after and including the comma.
Any ideas why this is appearing? Thanks
Is there a way to have a ToolStripMenuItem not closing when I click a child control (in its DropDrowItems Collection)?
In my case, I have some ToolStripMenuItems that work as a check box. Actually, I implemented a radio behavior in some ToolStripMenuItems using their Check property. But I don't want the menu closing when I click any of them, because they aren't an action, they represent just options in the menu item.
Is that possible?
The authlogic rails gem is doing a LOWER in the sql query.
SELECT * FROM `users` WHERE (LOWER(`users`.email) = '[email protected]') LIMIT 1
I want to get rid of the LOWER part since it seems to be slowing down the query by quite a bit.
I'd prefer to just lower the case in the code since this query seems to be expensive.
I'm not sure where to change this behavior in authlogic.
Thanks!
Hi all,
I was wondering if there is any open-source/free borland together clone to create uml diagrams like class diagrams, use case diagrams, sequence diagrams, etc.
Many thanks
Are there any Intel AVX intrinsics library out? I'm looking for something similar as 'sse2mmx.h' header which fall-backs to MMX intrinsics if SSE2 integer intrinsics are not available on compile time. Thus if I had similar library for AVX I could write optimized code for new hardware which would have almost optimal speed in case AVX extension isn't available. Googling didn't help much so far :(
In the following Groovy snippet, I attempt to replace both the hashCode and toString methods
String.metaClass.toString = {-> "override" }
String.metaClass.hashCode = {-> 22 }
But when I test it out, only the replacement of hashCode works
String s = "foo"
println s.hashCode() // prints 22
println s.toString() // prints "foo"
Is toString somehow a special case (possibly for security reasons)?
Challenge:
Without using the modulus divide operator provided already by your language, write a program that will take two integer inputs from a user and then displays the result of the first number modulus divided number by the second number.
Example:
Input of first number:2
Input of second number:2
Result:0
Who wins:
In case you don't know how Code Golf the winner is the person who writes this program in the least amount of characters.
So, lets say I have a number 123456. 123456 % 97 = 72. How can I determine what two digits need to be added to the end of 123456 such that the new number % 97 = 1? Note--it must always be two digits.
For example, 12345676 % 97 = 1. In this case, I need to add the digits "76" to the end of the number.
(This is for IBAN number calculation.)
Hello,
I have pagination links set-up like this:
http://localhost/?page=2
http://localhost/?page=3
They are wrapped in Anchor links as the HREF attribute. I want to know how can I check first if the HREF attribute for a given ANCHOR contains the query string "page" case sensitive, and if it exists return its number the value after page=
Please give me a straightforward example on this, much appreciated. :)
I need to be able to change the style of a control when a property and data value are true. For example, my bound data has an IsDirty property. I would like to change the background color of my control when IsDirty is true AND the control is selected. I found the MultiTrigger and MultiDataTrigger classes...but in this case I need to somehow trigger on data and property. How can I do this?
I have a multiline textbox which can contain only 500 characters. Now i want to show the user the number of characters left as they are typing into the textbox as is the case when we use twitter.
Kindly help
For what real time scenarios/use cases one should go to Flex Technology ?
What real time problems you have solved using Flex Technology ?
What real time problems have you faced because of using Flex Technology and what was your work around for that use case ?
Hello,
I have nested a repeater control in Gridview. Right now it is showing gridview rows and repeater header for every case(whether data is there or not for that particular grid view row in the repeater control). I want to hide the gridview row and repeater control header when there is no data present for that particular gridview row.
Thanks,
Sunil Parihar