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.
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.
I have a function which takes in two parameters, and returns one or the other 50% of the time.
The unit test for this should determine that both parameters could be returned. Luckily, I don't need to prove that the probability for each is 50% but I do need to show that both parameters are possible to be returned.
How do I write a test case for this function?
I'm trying to put together a static html website with full navigation. In other words, I want the user to click some links and images and actually be taken to another page. I'm a developer so I know how to do this in frameworks like ASP.Net MVC and grails. However, for this particular case, I just want to quickly mock up the UI and provide simple navigation so I can do some user testing. Can anyone advice on how to do this?
Thanks,
Bottle can use several webservers:
Build-in HTTP development server and support for paste, fapws3, flup, cherrypy or any other WSGI capable server.
I am using bottle for a desktop-app and I guess that the development server is enough in this case.
I would like to know if some of you have experience with one of the alternative server.
Which server for which purpose?
Thanks in advance
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.
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?
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.
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.
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)?
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?
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!
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=)?
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.
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).
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.)
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!
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 :(
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. :)
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.
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
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 ?
Hi,
I have a simple gateway listener which generates a log at the screen output via printf. I would like to record it so I can insert it in a mysql table.
printf("\nPacket received!! Decoding...");
I wonder if there is any fast way to do this is C.
In case there is, could I get both outputs at the same time?
Thanks
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