parameters

C# PInvoke out strings declaration

In C# PInvoke, how do I pass a string buffer so that the C DLL fills it and returns? What will be the PInvoke declaration? The C function declaration is int GetData(char* data, int buflength); In C#, I have declared it as [DllImport(DllName)] static extern Int32 GetData([MarshalAs(UnmanagedType.LPStr)]StringBuilder receiveddata, In...

Extensionless URLs with Parameters, what about 404s?

I'm creating a new url infrastructure for my sites, and came across this problem: If I have an extensionless URL like this "/Products/Beverages/Minty-chocolate-drink/Distributors", I can't distinguish parameters from pages... I can find out which page was called by finding the longest match in my pages and treat the rest as parameters, ...

Pass multiple optional parameters to a C# function

Is there a way to set up a C# function to accept any number of parameters? For example, could you set up a function such that the following all work - x = AddUp(2, 3) x = AddUp(5, 7, 8, 2) x = AddUp(43, 545, 23, 656, 23, 64, 234, 44) ...

Using textbox value as parameter in LINQ dat source/gridview : A value of type 'String' cannot be converted to type 'Double'

Hello all - it's a New Year but you're still left with a thick Mr Dean!! Ok, the scenario - I have a textbox, a two radio buttons, a button and a gridview. <code> <body> <form id="form1" name="form1" runat="server"> <asp:TextBox ID="tbxHowMany" runat="server" style="z-index: 1; left: 245px; top: 105px; position: absolute; hei...

Action Filter ActionParameters

I have an ActionFilterAttribute which I want to accept parameters through but I can't figure out pass them across. So my action filter looks like this; public class PreventAction : ActionFilterAttribute { public override void OnActionExecuting(ActionExecutingContext filterContext) { filterContext.Result = new RedirectRe...

Minimum confidence and minimum support for Apriori

What are appropriate values for minimum confidence and minimum support values for the Apriori algorithm? How could you tweak them? Are they fixed values, or do they change during the running of the algorithm? If you have used this algorithm before, what values did you use? ...

In C++ can you extend a parameterized base class with different parameter value in the child class?

In all the languages that I understand this is not possible but someone was telling me it was possible in C++ but I have a hard time believing it. Essentially when you parameterize a class you are creating a unique class in the compilation stage aren't you? Let me know if I am not being clear with my question. Here is my attempt at ex...

Passing build parameters to .wxs file to dynamicaly build wix installers

Good day I am a student developer and I have built several installers for the company I am working with now. So I am fairly familure with WIX. We recently decided to have a Build server that auto builds our solution. It builds both debug, and release, aswell as Obfuscated(and non obfuscated) projects. And you really don't have to unders...

What is the correct term for referring to a path and filename?

I want to use the correct term to make my API as intuitive as possible, so when a parameter is expected to be a full path and filename (ex "C:\Users\Max\Documents\MyDocument.txt") what is the correct term? filename - that would just be MyDocument.txt, right? path - that would just be C:\Users\Max\Documents, right? What should I use ...

How to pass Multivalued parameters through URL in SSRS 2005

Hi All, I have main matrix report and I want to navigate my sub report from main report by Jump To URL:(Using below JavaScript function) method. ="javascript:void(window.open('http://localhost/ReportServer/Pages/ReportViewer.aspx?%2fKonsolidata_Data_Exporting_Project%2fEXPORT_REPORT_TEST&amp;rs:Command=Render&amp;RP_cntry="+Fields!STD...

How to pass ctor args in Activator.CreateInstance or use IL?

I need a performance enhanced Activator.CreateInstance() and came across this article by Miron Abramson that uses a factory to create the instance in IL and then cache it. (I've included code below from Miron Abramson's site in case it somehow disappears). I'm new to IL Emit code and anything beyond Activator.CreateInstance() for instant...

Python - automating MySQL query: passing parameter

Hello Everybody, The code in the sequence is working fine, but looking to improve the MySQL code to a more efficient format. The first case is about a function that received a parameter and returns the customerID from MySQL db: def clean_table(self,customerName): getCustomerIDMySQL="""SELECT customerID FROM customer WHERE ...

F# - On the parameters passed to C# methods - are they tuples or what?

I've read many times that Assemblies generated from F# or any other .NET language are (almost) indistinguishable. I was then experimenting with F# and C# interop on .NET 4 (beta 2). I created a new solution, and a C# project, with the following class: public class MyClass { public static int Add(int a, int b) { return a + b; }...

How to get more than 1 line in Crystal Report by using DataSet ?

OpenConnect(); OleDbDataAdapter olda = new OleDbDataAdapter("Select * from RECORD where LIC_PLATE='GE 320'", con); DataSet dataset = new DataSet(); olda.Fill(dataset); cr1.SetDataSource(dataset.Tables[0]); crystalReportViewer1.ReportSource = cr1; crystalReportViewer1.Refresh(); ...

Google maps - encoding individual waypoints

I am trying to build up a string which will link directly to the Google maps print view. e.g. http://maps.google.co.uk/maps?f=d&amp;source=s_d&amp;saddr=brixton&amp;daddr=bath+to:bournemouth&amp;hl=en&amp;geocode=FUQ7EQMdyDr-_ym5RCh-QQR2SDGm1XOO93zFHA%3BFbQEEAMdMgfc_ykt4T50pnhxSDEJmm3W0CeLEw%3B&amp;mra=ls&amp;sll=51.75764,-1.241455&amp;...

How to reference ObservableCollection from WPF ListView SelectionChanged event handler?

In WPF app I have a ListView which is connected with ObservableCollection ShQuCollection through databinding: <ListView Name="ShSelList" ItemsSource="{Binding Source={StaticResource myDataSource},Path=ShQuCollection}" SelectionChanged="ShSelList_SelectionChanged"> <ListView.View> <GridView> <GridViewColumn Header="Co...

Python - automating MySQL index: passing parameter

Hi Everybody, I have a function with a new improved version of the code for automatic table indexing: def update_tableIndex(self,tableName): getIndexMySQLQuery = """SELECT numberID FROM %s;""" % (tableName,) updateIndexMySQLQuery = """UPDATE %s SET numberID=%s WHERE numberID=%s;""" % (tableName,) updateIndex=1 ...

explicit copy constructor or implicit parameter by value

I recently read (and unfortunately forgot where), that the best way to write operator= is like this: foo &operator=(foo other) { swap(*this, other); return *this; } instead of this: foo &operator=(const foo &other) { foo copy(other); swap(*this, copy); return *this; } The idea is that if operator= is called with...

(Fluent) NHibernate composite-id problem : MySQL complains that the parameter index is out of bounds

I'm using Fluent NHibernate to create an ASP.NET MVC project, with Submissions and Votes (Up/Down) by Users. Of course, Users can vote submission Up or Down. To record this, I created a middle table, SubmissionVote, which contain the following fields: submissionId (int) userId (int) score (enum: up/down) Here are my mappings: Submis...

how to fulfill a parameter that passed by reference in c++?

Hi, I've created a method which is accept parameter by reference like following : void Func1(QList<int> *a){ (*a) << getDataFromAnotherFunction(); //or (*a).append(getDataFromAnotherFunction()); } QList<int> getDataFromAnotherFunction(){ //we will do something good over here return QList<int> } but the problme is when I want to us...