Why is this disallowed in C#?
Actually I'd like to be able to write
alias Y<A, B> : X<A, B>, X<B, A>
The unification is actually desired here; if the A = B then just one method should be defined.
Below in a query which inserts records to SimpleDictationProfileMapping table after reading it from a XML string. Now this query inserts a single record in which DictationCaptureProfileID is @dictationCaptureProfileId . Now i want to insert multiple rows in which @dictationCaptureProfileId is different and other 2 values are same.
What i want to achieve by this is in case parent changes all child values should also change.
INSERT INTO SimpleDictationProfileMapping
(
DictationCaptureProfileID,
DictationProfileMappingAttributeID,
DictationProfileMappingAttributeValue
)
SELECT @dictationCaptureProfileId,
row.value('@attrId','varchar(max)'),
row.value('@value', 'varchar(max)')
FROM @simpleDictationCaptureProfileMappings.nodes('/simpleMappingAtribute/attribute')
AS d ( row ) ;
I want
INSERT INTO SimpleDictationProfileMapping
(
DictationCaptureProfileID OR (SELECT DictationCaptureProfileID
FROM DictationCaptureProfile
WHERE SystemDictationCaptureProfileID = @systemDictationCaptureProfileID),
DictationProfileMappingAttributeID,
DictationProfileMappingAttributeValue
)
SELECT @dictationCaptureProfileId ,
row.value('@attrId','varchar(max)'),
row.value('@value', 'varchar(max)')
FROM @simpleDictationCaptureProfileMappings.nodes ('/simpleMappingAtribute/attribute')
AS d ( row ) ;
Please tell how to achieve this.
I'm working with MS SQL SERVER 2003. I want to change a column in one of my tables to have fewer characters in the entries. This is identical to this question: http://stackoverflow.com/questions/2281336/altering-a-table-column-to-accept-more-characters except for the fact that I want fewer characters instead of more.
I have a column in one of my tables that holds nine-digit entries. A developer previously working on the table mistakenly set the column to hold ten-digit entries. I need to change the type from CHAR(10) to CHAR(9).
Following the instructions from the discussion linked above, I wrote the statement
ALTER TABLE [MY_TABLE] ALTER COLUMN [MY_COLUMN] CHAR(9);
This returns the error message "String or binary data would be truncated". I see that my nine-digit strings have a space appended to make them ten digits.
How do I tell SQL Server to discard the extra space and convert my column to a CHAR(9) type?
I have a template class like here (in a header) with a inner class and a static member of type pointer to inner class
template <class t> class outer {
class inner {
int a;
};
static inner *m;
};
template <class t> outer <t>::inner *outer <t>::m;
when i want to define that static member i says "error: expected constructor, destructor, or type conversion before '*' token" on the last line (mingw32-g++ 3.4.5)
I am working on incorporating CruiseControl into my teams build process. What we need is a way to pass a Clearcase view name into the ant script so it knows what view to use when building. Sometimes a developer needs to create a build that is used for their testing only and not on the main integration branch. Is there a way to do this?
Hi all,
I'm tryng to build a stored procedure that makes use of another stored proceudre. Taking its result and using it as part of its where clause, from some reason I receive an error:
Invalid object name 'dbo.GetSuitableCategories'.
Here is a copy of the code:
select distinct top 6 * from
(
SELECT TOP 100 *
FROM [dbo].[products] products
where products.categoryId in
(select top 10 categories.categoryid from
[dbo].[GetSuitableCategories]
(
-- @Age
-- ,@Sex
-- ,@Event
1,
1,
1
) categories
ORDER BY NEWID()
)
--and products.Price <=@priceRange
ORDER BY NEWID()
)as d
union
select * from
(
select TOP 1 * FROM [dbo].[products] competingproducts
where competingproducts.categoryId =-2
--and competingproducts.Price <=@priceRange
ORDER BY NEWID()
) as d
and here is [dbo].[GetSuitableCategories] :
if (@gender =0)
begin
select * from categoryTable categories
where categories.gender =3
end
else
begin
select * from categoryTable categories
where categories.gender = @gender
or categories.gender =3
end
Thank you very much!~
Why does this script return a pair of nulls? I'm using SQL Server 2008, script run in MSSMS.
CREATE PROCEDURE proc_Test
(
@Input int,
@Out1 int OUTPUT,
@Out2 varchar(10) OUTPUT
)
AS
BEGIN
SET NOCOUNT OFF
SET @Out1 = 100 + @Input
SET @Out2 = 'result=' + CONVERT(varchar,@Out1)
RETURN
END
GO
DECLARE @Out1 int, @Out2 varchar(10)
exec proc_Test @Input=1, @Out1=@Out1, @Out2=@Out2
select @Out1, @Out2
Does "Value Restriction" mean that there is no higher order functional programming?
I have a problem that each time I try to do a bit of HOP I get caught by a VR error. Example:
let simple (s:string)= fun rq->1
let oops= simple ""
type 'a SimpleType= F of (int ->'a-> 'a)
let get a = F(fun req -> id)
let oops2= get ""
and I would like to know whether it is a problem of a prticular implementation of VR or it is a general problem that has no solution in a mutable type-infered language that doesn't include mutation in the type system.
I'm trying to create a deck of cards for my homework. Code is posted below. I need to create
four sets of cards (the four suits) and am create a multidimensional array. When I print the results instead of trying to pass the array, I can see that the data in the array is as expected. However, when I try to pass the array card, I get an error cannot find symbol. I've got this modeled after texbook and Java tutorial examples, and I need some help figuring out what I'm missing. I've over-documented to give an idea of how I'm thinking this SHOULD work...please let me know where I've gone horribly wrong in my understanding.
import java.util.*;
import java.lang.*;
//
public class CardGame
{
public static int[][] main(String[] args)
{
int[][] startDeck = deckOfCards(); /* cast new deck as int[][], calling method deckOfCards
System.out.println(" /// from array: " + Arrays.deepToString(startDeck));
}
public static int[][] deckOfCards() /* method to return a multi-dimensional array */
{
int rank;
int suit;
for(rank=1;rank<14;rank++) /* cards 1 - 13 .... */
{
for(suit=1;suit<5;suit++) /* suits 1 - 4 .... */
{
int[][] card = new int[][] /* define a new card... */
{
{rank,suit} /* with rank/suit from for... loops */
};
System.out.println(" /// from array: " + Arrays.deepToString(card));
}
}
return card; /* Error: cannot find symbol
}
}
I have a datagridview that I would like all values on a specific row passed to a new form. I can extract the values, but how would you recommend passing these into the new form (each will be assigned to a specific textbox)?
Regular expressions have always been my pet peeves. Every time I think that I finally got it I have a new problem !
I want to catch url like this :
http://www.mydomain.com/boutique/blabla-1/bla-bla2/99/104
http://www.mydomain.com/boutique/blabla1/99
and eventually :
http://www.mydomain.com/boutique/blabla-1/bla-bla2/product1/99/104/55/
after a lot of tries and errors I came up with this which seems to work with http://www.gskinner.com/RegExr/ but not in apache
^.*/boutique/([a-zA-Z-]*)(/?[a-zA-Z-]*)/?([0-9]*)/?([0-9]*)/?$ boutique.php?c1=$3&c2=$4
(I was only working with the first two url so far)
MY apache rewrite log debug files are helpless :
pass through /Users/iko/Sites/mysite/boutique.php
I'm only interrested in getting the ids. Any help we'll be welcomed !
Thank you.
I have a WSDL with various portTypes. Some of the contain only output
<operation name="getServerTimeZone">
<output message="s0:getServerTimeZoneSoapOut"/>
</operation>
I would expect that the correct should be:
<operation name="getServerTimeZone">
<input message="s0:getServerTimeZoneSoapIn"/>
<output message="s0:getServerTimeZoneSoapOut"/>
</operation>
The problem is that when I am trying to create stubs from the WSDL using gsoap wsdl2h parser I got the following error:
No wsdl:definitions/portType/operation/input
I haven't tested with other tools (ie WSDL2Java). My question: Is it valid to have a portType with no input? I am using AltovaXML Spy and this WSDL passes the validation....
Is there any meaning having WSDL operation with no input? (I am not talking about One-Way Message Passing, where you can have input but no output - this is valid).
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
#include <vector>
#define IE 40
#define JE 40
#define KE 40
#define ia 7
#define ja 7
#define ka 7
#define NFREQS 3
using namespace std;
main()
float l,m,n,i,j,k,ic,jc,kc,nsteps,n_pml;
float ddx,dt,T,epsz,muz,pi,eaf,npml;
int ib,jb,kb;
.
.
.
.
ic=IE*0.5 ;
jc=JE*0.5 ;
....'ic'dose not name a type.
....'jc'dose not name a type.
@WebMethod(operationName = "SearchOR")
public SearchOR getSearchOR (@WebParam(name = "comp")
String comp, @WebParam(name = "name")
String name) {
//TODO write your implementation code here:
SearchOR ack = null;
try{
String simpleProc = "{ call getuser_info_or(?,?)}";
CallableStatement cs = con.prepareCall(simpleProc);
cs.setString(1, comp);
cs.setString(2, name);
ResultSet rs = cs.executeQuery();
System.out.print("2");
/* int i = 0,
j = 0;
if (rs.last()) {
i = rs.getRow();
ack = new SearchOR[i];
rs.beforeFirst();
}*/
while (rs.next()) {
// ack[j] = new SearchOR(rs.getString(1), rs.getString(2));
// j++;
ve.add(rs.getString(1));
ve.add(rs.getString(2));
}}catch ( Exception e) {
e.printStackTrace();
System.out.print(e);
}
return ack;
}
I am getting error at portion i have made bold.It is pointing to that location.My Query is
here:
DELIMITER $$
DROP PROCEDURE IF EXISTS discoverdb.getuser_info_or$$
MySQL returned an empty result set (i.e. zero rows).
CREATE PROCEDURE discoverdb.getuser_info_or
(
IN comp VARCHAR(100),
IN name VARCHAR(100),
OUT Login VARCHAR(100),
OUT email VARCHAR(100)
)
BEGIN
SELECT sLogin, sEmail
INTO Login, email
FROM ad_user
WHERE company = comp OR sName=name;
END $$
MySQL returned an empty result set (i.e. zero rows).
DELIMITER ;
I tried to modify a type using the following code and it gave me the error code: 'ORA-02303'. I don't know much about Oracle or PL/SQL but I need to solve this; so I'd appreciate any further help with this.
Thanks in advance. The code is just an example. But then again, I need to check its dependents first.
create or replace type A as object (
x_ number,
y_ varchar2(10),
member procedure to_upper
);
/
I'm using Visual Studio 2008 with Feature Pack 1.
I have a typedef like this typedef std::tr1::tuple<std::string, std::string, int> tileInfo
with a function like this const tileInfo& GetTile( int x, int y ) const.
In the implementation file the function has the exact same signature (with the added class name qualifier) and I am getting a redefinition: different type modifiers error. It seems to be looking for an int& instead of a tileInfo&
When I mouse over the type of the function in the header, i.e. tileInfo& it brings up a little bar saying static const int tileInfo. I think this may be the problem, but I'm not sure what to do.
Any help is appreciated, thanks.
Hi, I have the following scenario: a table of projects and a table of persons, working on one or serveral projects. Also, I have a project id column (of type int), in the first table, which is a primary key there and I have a vector of project ids, as a column of type int, in my second table (persons), that references primary keys from the first table.
What is the correct syntax for referencing multiple primary keys, from a vector foreign key.
This is the way I am trying to create the table, but I am not sure what to place at the indicated line:
CREATE TABLE Persons(
Person_Id int,
...,
ProjectsList int[],
FOREIGN KEY (ProjectsList) REFERENCES Projects(Project_id) -- not sure what how to define the link here
);
I hope my explanations are not over-complicated. Thank you in advance for helping!
I try to find out why the call Ø in scalaz.ListW.<^> works
def <^>[B: Zero](f: NonEmptyList[A] => B): B = value match {
case Nil => Ø
case h :: t => f(Scalaz.nel(h, t))
}
My minimal theory is:
trait X[T]{
def y : T
}
object X{
implicit object IntX extends X[Int]{
def y = 42
}
implicit object StringX extends X[String]{
def y = "y"
}
}
trait Xs{
def ys[T](implicit x : X[T]) = x.y
}
class A extends Xs{
def z[B](implicit x : X[B]) : B = ys //the call Ø
}
Which produces:
import X._
scala> new A().z[Int]
res0: Int = 42
scala> new A().z[String]
res1: String = y
Is this valid? Can I achieve the same result with fewer steps?
when we receive a SOAP message,
then we Resolve it,
then we have a TEXT like:
1
how can i validate the para: xx .
to check it's value is accord to the WSDL of the web service
I want to upload a file on my aspx page.
I am using
<form id="frmId" method="post" enctype="Multipart/form-data">
<input type="file" id="file1"/>
<input type="submit" id="btnsubmit"/>
</form>
and in code behind I am trying to get this file. Its not letting me to get the file until I use server side input file control. I don't want to use runat="server" attribute with my file control.
Do anyone know how to do this.
Hello, I want to do a class thats accepts anything ordered and prints greater. (I'm just learning so I know it's a bit useless)
class PrinterOfGreater[T extends Ordered](val a:T, val b:T){println(a > b)}
I know that it can't be written by this style in scala, but I don't know how to write it properly... Do anybody know?