In my asp.net page i have java script calendar,on which i want the selected date & then that date has to passed to the code behind's method. How should it be done???
Do the following two lines of code behave in exactly the same way despite slightly different implementations
values.map{ |k,v| __send__('%s=' % k.to_s, v) }
values.map{ |k,v| __send__("#{k.to_s}=", v) }
The second line would be a more common ruby idiom so I was wondering why the other method was used when this was in the Rails Core which I would expect to use idiomatic ruby.
So I get a set of form elements that I want to extract the values from, by using
var inputs = $("input.row_2");
inputs[0].val()
When I run this, I get told that val is not a valid method.
What am I doing wrong?
Should be an easy one..
Thanks!
I've just noticed that GDI+ doesn't like the Graphics.FromImage() method to be called with an image that is 1bpp, 4bpp, or 8bpp. Is there any way of resizing an 8bpp image without changing from 8bpp to 24bpp, resizing, and then changing it back to 8bpp?
I have to projects in my .net windows forms, in one form(1st Project) i have timer control already running.
On some request i want to start that timer from the form1 of (second project).
If we are creating new object in second project for the 1st project(Which is currently in running thread) we will not be able to start the timer for the current instance.
How can we access the current running instance from my 2nd project.
Please suggest me some method
Lets assume that a rule (or rule of thumb, anyway), has been imposed in my coding environment that any method on a class that doesn't use, modify, or otherwise need any instance variables to do its work, be made static. Is there any inherent compile time, runtime, or any other disadvantage to doing this?
I have a form as
<form action="" method="post">
<input name="Descripcion" type="hidden" value="" id="Descripcion" runat="server" />
<input id="Submit1" type="submit" value="Comprar" />
Instead of clicking on submit button i want that the form should be posted without clicking submit button with hidden fields
My goal is to set up a jetty test server and inject a custom servlet to test some REST classes in my project. I was able to launch the server with spring xml and run tests against that server. The issue I'm having is sometimes after the server started, the process stopped at the point before running the tests. It seems jetty didn't go to background. It works every time on my computer. But when I deployed to my CI server, it doesn't work. It also doesn't work when I'm on VPN. (Strange.)
The server should be completed initialized as when the tests stuck, I was able to access the server using a browser.
Here is my spring context xml:
....
<bean id="servletHolder" class="org.eclipse.jetty.servlet.ServletHolder">
<constructor-arg ref="courseApiServlet"/>
</bean>
<bean id="servletHandler" class="org.eclipse.jetty.servlet.ServletContextHandler"/>
<!-- Adding the servlet holders to the handlers -->
<bean id="servletHandlerSetter" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
<property name="targetObject" ref="servletHandler"/>
<property name="targetMethod" value="addServlet"/>
<property name="arguments">
<list>
<ref bean="servletHolder"/>
<value>/*</value>
</list>
</property>
</bean>
<bean id="httpTestServer" class="org.eclipse.jetty.server.Server" init-method="start" destroy-method="stop" depends-on="servletHandlerSetter">
<property name="connectors">
<list>
<bean class="org.eclipse.jetty.server.nio.SelectChannelConnector">
<property name="port" value="#{settings['webservice.server.port']}" />
</bean>
</list>
</property>
<property name="handler">
<ref bean="servletHandler" />
</property>
</bean>
Running latest Jetty 8.1.8 server and Spring 3.1.3. Any idea?
Is there a portable C library to access .zip archives? "gzip" or "zlib" (the closest I could find) only handle compressed data, I need to be able to list the files inside the archive, and access each one individually, and if they're compressed using the 'deflate' method, I can use zlib on it.
Hi,
Could you please help in the following? Is there an acceptable design guideline to implement WS Notification Messaging in java? My scenario is the following: a web service client makes a web service call to a web service.
After that, the web service should be able to send asynchronous notifications to the web client (as a result of the first web method call). What approach should be used?
Thank you,
Regards
Hi,
I am developing an application for iPhone.I am using some objective c++ classes with .h and .mm extensions.My problem is that when i am trying to access a method in .mm file from .m file i am geting a warning that "No '-methodname' found".how can i resolve this warnings
Thanks in advance
On the iPhone, how could I achieve the same tiled background effect?
For example, I have an pattern image which I want to repeat only horizontally. Would I have to go the route in -drawRect: by myself and loop over to draw the pattern, or is there a convenient method to do that?
Hey,
I want to include a file to be accessible to any method/function in a PHP class. The file just contains a base-64 encoded variable. How do I do this?
Thanks.
I'm trying to write a little SQL Helper. I have a query like this stored in a string:
DECLARE @V1 INT
--ignore
DECLARE @V11 INT
DECLARE @V12 INT
--endignore
DECLARE @V2 INT
--ignore
SELECT * FROM SampleTable
INNER JOIN AnotherSampleTable
......
--endignore
SELECT * From Employee ORDER BY LastName
My helper method should cut everything what's between
--ignore
and
--endignore
The result string should look like:
DECLARE @V1 INT
DECLARE @V2 INT
SELECT * From Employee ORDER BY LastName
How can achieve my result with RegEx?
I have a method that takes a List<int>, which is a list of IDs. The source of my data is a Dictionary<int, string> where the integers are what I want a list of. Is there a better way to get this than the following code?
var list = new List<int>();
foreach (var kvp in myDictionary)
{
list.Add(pair.Key);
}
ExecuteMyMethod(list);
Hi I'd like to inquire on how i can load a WPF Xaml into code so that I can change the values of the attributes of some XAML elements and output it by creating another XAML files. This is so that I can output the same file with values dynamically input by the user.
the XamlReader.Load() method cannot be used; it will throw an exception (because they are unable to recognise Window as the root element). I'm using VS2013 and C#.
I always though that
float var_a = 9.99;
int var_b = (int)var_a;
was they way to typecast in c++... But here it said that its not the proper C++ way, its the old C way.
So I ask, What is the proper C++ way, and more importantly, how do they differ? the C method should still work though shouldn't it.
What's the main point behind putting variables and method signatures inside ApplicationDelegate.h in Objective-C ? By doing this, all those methods and variables are seen by another view controller classes? Is that the point?
And also: is there only one application delegate class inside each project?
I need encrypt data using exactly the PKCS#1 V2.0 encryption method (defined in item 7.2.1 of the PKCS#1V2 specification).
Is it already implemented for Java?
I'm thinking in something like just pass a parameter to javax.crypto.Cipher specifying "PKCS#1V2", I wonder if there is something like this?
So I can do Post.delete_all to delete all my posts, but what if I want to delete all posts, comments, blogs, etc. I.e., how do I iterate over all my models and run the delete_all method?
I have problem with getting the content. I don't know the names of the post variables so I can't do this using
= $_Post['name']
because I don't know the "name". I want to catch all of the variables send by POST method.
How can I get keys of the $_Post[] array and the values related with them?
I'm building a simple calendar for holiday cottages to show when they are booked or available.
What would be the fastest mysql table design for this, bearing in mind when users mark dates as available/booked they will do so via a start date and an end date.
i can see 2 obvious options
Store 'booked' data for every day [more rows]
or, store 'booked' data with 2 columns a start_date and end_date [more processing?]
Which is best or is there another method i'm missing?
What happens in my service method if I use a WebOperationContext, when the endpoint is not REST?
Justification: I have a service that I'm exposing as both REST and SOAP.
I know that you can get a reference to a static method like this:
typedef void (*pointer)();
pointer p = &MyClass::MyMethod;
But is there a way to get a reference to the class itself?