Tag Archives: methods

Woocommerce update shipping methods in checkout via ajax

Questions: What i’m trying to accomplish: In woocommerce, I need to check a date delivered via a datepicker field when user selects a date, and then update shipping options accordingly via ajax, so that things like free shipping can be taken out when they are not appropriate. What I currently know/have figured out: I currently… Read More »

Java equivalent to C# extension methods

Questions: I am looking to implement a functionality in a list of object as I would in C# using an extension method. Something like this: List<DataObject> list; // … List initialization. list.getData(id); How do I do that in Java? Answers: Java does not support extension methods. Instead, you can make a regular static method, or… Read More »

using web methods with master pages

Questions: I’ve got a function on all pages in my site which is located in my master page and I want it to run from some jQuery Ajax method. I’ve got some code like this at the moment jQuery $(document).ready(function() { $(“#test”).click(function() { $.ajax({ type: “POST”, url: “Default.aspx/GetDate”, data: “{}”, contentType: “application/json; charset=utf-8”, dataType: “json”,… Read More »

Performance of calling delegates vs methods

Questions: Following this question – Pass Method as Parameter using C# and some of my personal experience I’d like to know a little more about the performance of calling a delegate vs just calling a method in C#. Although delegates are extremely convenient, I had an app that did lots of callbacks via delegates and… Read More »

What Advantages of Extension Methods have you found? [closed]

Questions: A “non-believer” of C# was asking me what the purpose to extension methods was. I explained that you could then add new methods to objects that were already defined, especially when you don’t own/control the source to the original object. He brought up “Why not just add a method to your own class?” We’ve… Read More »

Mocking Extension Methods with Moq

Questions: I have a preexisting Interface… public interface ISomeInterface { void SomeMethod(); } and I’ve extended this intreface using a mixin… public static class SomeInterfaceExtensions { public static void AnotherMethod(this ISomeInterface someInterface) { // Implementation here } } I have a class thats calling this which I want to test… public class Caller { private… Read More »

install methods for mod_wsgi and apache

Questions: I plan to deploy a django app on apache. After having set up apache ,python and django on the dev box,i was going through the tutorials for configuring mod_wsgi. I see that there are two methods- Installation into Apache Installation into Python How do they differ?Apart from the obvious difference that file location will… Read More »