parameters

Prolog lists and parameters and return values

Hi everyone, I'm new to prolog and I just can't figure it out. I'm trying to build a simple program that receives a list of predicates, searchs for a specific predicate in the list, and applies a function to that predicate parameters. something along these lines: ?- program([pred1(a,b,p), pred2(d,b,p), pred2 (a,c,p)]). program (lis...

Pass parameter one time, but use more times

I'm trying to do this: commands = { 'py': 'python %s', 'md': 'markdown "%s" > "%s.html"; gnome-open "%s.html"', } commands['md'] % 'file.md' But like you see, the commmands['md'] uses the parameter 3 times, but the commands['py'] just use once. How can I repeat the parameter without changing the last line (so, just passing the...

Working with files

I hope I formatted the code correctly this time. Let me say first that the code works as is; it's in understanding some parts and modifying others that I run into trouble. I'm going to delete my numerous comments and limit myself to a few questions on it. 1. Is FILE a keyword in Obj-C? What is its function? Why all caps? 2....

easy way to change a dict data to url Parameter ..

(1) a={'b':'bbbb','c':'ccc',....} (2) self.redirect('/tribes/view?b=' + a['b'] + '&c=' + a['c']) so i want to get b=' + a['b'] + '&c=' + a['c'] ... from dict a hae any easy way to do this ? thanks ...

How do I assign by "reference" to a class field in c#?

I am trying to understand how to assign by "reference" to a class field in c#. I have the following example to consider: public class X { public X() { string example = "X"; new Y( ref example ); new Z( ref example ); System.Diagnostics.Debug.WriteLine( example ); } } public class Y { public Y( ref stri...

A problem of a repeated parameter in the pagination links?

The problem is that when I load page 2 for example the URL becomes: http://domain.com/index.php?restaurant-id=45&currentpage=2 And that's fine but when I get to page 3 it becomes: http://domain.com/index.php?restaurant-id=45&currentpage=2&currentpage=3 And so on, it adds one more currentpage parameter everytime a new page...

how to get http get request params in jsf 2.0 bakcing bean?

Hi all, I having trouble with passing http get parameters to jsf 2.0 backing bean. User will invoke URl with some params containing id of some entity, which is later used to persist some other entity in db. whole process can be summarized by fallowing: 1. user open page http://www.somhost.com/JsfApp/step-one.xhtml?sid=1 2. user fills s...

Can I populate multiple DropDownLists from one SqlDataSource using parameters?

Basically, I have four asp:DropDownLists and I wish to populate all of them from the same table, with certain conditions. For example, I have this data source: <asp:SqlDataSource ID="ReferenceDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:mrapConnectionString1 %> SelectCommand="SELECT * FROM [reference_dat...

common parameters in iphone

How can I define common parameters in iPhone to use everywhere in different classes. ...

Render a Form from an XSLT file

I've generated the following XSLT file, and have created a Form that will post to an ASP.Net MVC action called Home/ProcessRequest: <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl" > <xsl:outp...

How to use a value from one stored procedure in another?

I have the following statement in a Stored Procedure: DECLARE @Count INT EXEC @Count = GetItemCount 123 SELECT @Count Which calls another stored procedure with the following statement inside: SELECT COUNT(Item) FROM tblItem WHERE ID = @ID However when I test the call the EXEC outputs the value correctly but it is not assigned to th...

Can i use a parameter multiple times in the qame query?

Hey guys, i was wondering, can a parameter be used more then once in the same query, like this : MySqlParameter oPar0 = new MySqlParameter("e164", MySqlDbType.String); oPar0.Value = user.E164; string sSQL0 = "Delete from callmone.call where (caller=?e164 or called=?e164);"; clsDatabase.ExecuteSQL(sSQL0, oPar0); Is this possible or ...

C# Func delegate with params type

How, in C#, do I have a Func parameter representing a method with this signature? XmlNode createSection(XmlDocument doc, params XmlNode[] childNodes) I tried having a parameter of type Func<XmlDocument, params XmlNode[], XmlNode> but, ooh, ReSharper/Visual Studio 2008 go crazy highlighting that in red. Update: okay, Googling for 'c#...

pass ...rest to a NetConnection call

I want to pass a rest in a netconnection call, something like this: public function requestData(service : String, ...params) : void { nc.call(service, params); } this doesn't work since the call is expecting each parameter to be separated by commas, like: nc.call(service, params[0], params[1], params[2]); I've read some posts abou...

C# out parameter value passing..

I am using contactsreader.dll to import my gmail contacts... One of my method has out parameter... I am doing this, Gmail gm = new Gmail(); DataTable dt = new DataTable(); string strerr; gm.GetContacts("[email protected]", "******", true, dt,strerr); // It gives invalid arguments error.. and my gmail class has, public void Ge...

C# Dynamically reference objects in loop

I don't know whether this is possible or not. What I want to do is to reference a DataTable (and other objects, but getting it working for one will make the rest easy) and use it as a paramater, but I want to do this in a loop, so that I can perform the function with each DataTable dt1, dt2, dt3 etc. Something like this (although this ob...

ActionScript Parameter Filtering

i'm setting up a custom class that accepts some Number parameters, but i need to limit those parameters and would like to know the best way of doing so. currently, i'm simply calling if statements, and throwing an error if the number is above or below what's accepted. for example, there is a parameter that accepts and angle, but only b...

Parameters with braces in python

If you look at the following line of python code: bpy.ops.object.particle_system_add({"object":bpy.data.objects[2]}) you see that in the parameters there is something enclosed in braces. Can anyone tell me what the braces are for (generically anyway)? I haven't really seen this type of syntax in python and I can't find any documenta...

Parametrize the WHERE clause?

I'm need to write a stored procedure for SQL Server 2008 for performing a large select query and I need it to filter results with specifying filtering type via procedure's parameters. I found some solutions like this: create table Foo( id bigint, code char, name nvarchar(max)) go insert into Foo values (1,'a','aaa'), (2,'b','bbb')...

Pattern or best practice to handle multi parameter queries in C#

The approach i always had in programming a winforms or wpf application to perform queries on a database is the following: Design an interface with several controls to pass parameters to my query classes Build a "DataAccess" class with fields, properties and methods for the queries, based on Linq or Entity Framework as data source. Mana...