问:
VBA not adding elements to a Solver model
I had a problem earlier about solver not adding binary constraints to a model via VBA...I've (mostly) figured that one out.  But now I have a new problem.  First, let me post the relevant section of offending code.  I should note this is running in Excel 2007.

```<code>'build string of ByChange cells and set up cascading constraints
by_change_string = ""
For i = 1 To j - 1

    If Len(by_change_string) > 0 Then                   'there are already some elements in the string, so we might start with a comma
        If Not (Right(by_change_string, 1) = ",") Then  'make sure the last character isn't already a comma
            by_change_string = by_change_string & ","
        End If
    End If

    current_status = Sheets("Buyback Risk Area").Range("C1").Offset(i).Value
    Select Case current_status
        Case "Y"                'risk area is currently yellow, so green transition is available
            by_change_string = by_change_string & "$E$" & i + 1
            solverok setcell:="$B$" & j + 4, MaxMinVal:=2, ValueOf:="0", ByChange:=by_change_string

            'add binary constraints
            solveradd cellref:="$E$" & i + 1, relation:=5, formulatext:="binary"
        Case "O"                'risk area is currently orange, so green and yellow transitions are available
            by_change_string = by_change_string & "$E$" & i + 1 & ",$G$" & i + 1
            solverok setcell:="$B$" & j + 4, MaxMinVal:=2, ValueOf:="0", ByChange:=by_change_string

            'add cascading constraints
            solveradd cellref:="$E$" & i + 1, relation:=1, formulatext:="$G$" & i + 1 'says E <= G, which means you can't select green unless you've already selected yellow

            'add binary constraints
            solveradd cellref:="$E$" & i + 1, relation:=5, formulatext:="binary"'                solveradd cellref:="$G$" & i + 1, relation:=5, formulatext:="binary"
        Case "R"                'risk area is currently red, so green, yellow, and orange transitions are available
            by_change_string = by_change_string & "$E$" & i + 1 & ",$G$" & i + 1 & ",$I$" & i + 1
            'solverok setcell:="$B$" & j + 4, MaxMinVal:=2, ValueOf:="0", ByChange:=by_change_string

            'add cascading constraints
            solveradd cellref:="$E$" & i + 1, relation:=1, formulatext:="$G$" & i + 1 'says E <= G, which means you can't select green unless you've already selected yellow
            solveradd cellref:="$G$" & i + 1, relation:=1, formulatext:="$I$" & i + 1 'says G <= I, which means you can't select yellow unless you've already selected orange

            'add binary constraints
            solveradd cellref:="$E$" & i + 1, relation:=5, formulatext:="binary"
            solveradd cellref:="$G$" & i + 1, relation:=5, formulatext:="binary"
            solveradd cellref:="$I$" & i + 1, relation:=5, formulatext:="binary"
        Case "B"                'risk area is black, so green, yellow, orange and red transitions are avaailable
            by_change_string = by_change_string & "$E$" & i + 1 & ",$G$" & i + 1 & ",$I$" & i + 1 & ",$K$" & i + 1
            solverok setcell:="$B$" & j + 4, MaxMinVal:=2, ValueOf:="0", ByChange:=by_change_string

            'add cascading constraints
            solveradd cellref:="$E$" & i + 1, relation:=1, formulatext:="$G$" & i + 1 'says E <= G, which means you can't select green unless you've already selected yellow
            solveradd cellref:="$G$" & i + 1, relation:=1, formulatext:="$I$" & i + 1 'says G <= I, which means you can't select yellow unless you've already selected orange
            solveradd cellref:="$I$" & i + 1, relation:=1, formulatext:="$K$" & i + 1 'says K <= M, which means you can't select orange unless you've already selected red

            'add binary constraints
            solveradd cellref:="$E$" & i + 1, relation:=5, formulatext:="binary"
            solveradd cellref:="$G$" & i + 1, relation:=5, formulatext:="binary"
            solveradd cellref:="$I$" & i + 1, relation:=5, formulatext:="binary"
            solveradd cellref:="$K$" & i + 1, relation:=5, formulatext:="binary"
    End Select
Next i

'buyback amount constraint
solveradd cellref:="$O$" & j + 1, relation:=1, formulatext:="$B$" & j + 2

'set target cell
solverok setcell:="$B$" & j + 4, MaxMinVal:=2, ValueOf:="0", ByChange:=by_change_string

'set binary constraints
'binary_array = Split(by_change_string, ",")
'For i = 0 To UBound(binary_array)
'    solveradd cellref:=Range(binary_array(i)), relation:=5, formulatext:="binary"
'Next i

Application.ScreenUpdating = True

SolverSolve userFinish:=False
</code>```

The basic idea here is to loop through the sheet and look at the data (which will change from execution to execution) and build the appropriate model.

THe string by_change_string contains the cell addresses of all the changing variables, which are all binary.  So as the code examines each line of the spreadsheet, it determines which cells on that line are available to be considered by the model and appends them to the string.

The multiple calls to solverok with the growing by_change_string are an attempt to solve an earlier problem where the binary constraints weren't being added to the model.  All of the <= constraints were, but not the binary ones.  It seems you can't constrain a variable to be binary until after it has been added to the model.  There used to be just a single solverok statement after the loop that constructs by_change_string was complete, but when I did it that way I got all of the <= constraints and none of the binary ones.

When this code runs on my test sheet, the resulting model should have 136 decision variables (by changing cells).  I've checked, and the by_change_string does in fact have 136 addresses in it.  But when I look in the solver dialog box, there are only the first 41.  I've stepped through the entire execution in debug mode and seen it call solverok after each iteration, but for some reason only the first 41 by change cells are there.  And there's nothing special about the row of data where things go wrong...it's not like it's the first instance of one of the select cases or something...

When solver runs on this abbreviated model, it returns a garbage solution that it says is optimal.  Basically it keeps everything the same, so that the final objective function value is the same as the starting one.

So then I tried something else...you'll notice a commented out block of code at the bottom:

```<code>'set binary constraints
'binary_array = Split(by_change_string, ",")
'For i = 0 To UBound(binary_array)
'    solveradd cellref:=Range(binary_array(i)), relation:=5, formulatext:="binary"
'Next i
</code>```

The idea here was to make things much more efficient by getting all those solverok and solveradd statements out of the select cases.  By waiting until after the final solverok statement, all the variables are now in the model, so you should be ablto just step through the by_change_string and make each of those a binary variable.  That way you only need one solverok statement and you can get rid of all the solveradd's in the select cases.  So I commented out all of those solverok's and solveradd's in the select cases and ran the macro again.  I get no output from solver.  When I look at the solver dialog after running, both the target cell and the by changing cells fields are blank.  It's as if that last solverok statement had never been run.

So then I tried uncommenting all the solverok's, but leaving the solveradd's for the binary variables commented out.  I go back to getting only the first 41 decision variables.  The loop to set the binary constraints did it's job, but the solveradd's aren't getting the variables into the model.

I'm pretty much stumped at this point.  Any ideas?

答: Daniel Cook seems to be right about the cause of the issue. I'd propose a different workaround though. Create a named range that includes all of the non-contiguous ranges, and set by_change_string to a string representing that named range.</p>

Body:
I had a problem earlier about solver not adding binary constraints to a model via VBA...I've (mostly) figured that one out.  But now I have a new problem.  First, let me post the relevant section of offending code.  I should note this is running in Excel 2007.

'build string of ByChange cells and set up cascading constraints
by_change_string = ""
For i = 1 To j - 1

    If Len(by_change_string) > 0 Then                   'there are already some elements in the string, so we might start with a comma
        If Not (Right(by_change_string, 1) = ",") Then  'make sure the last character isn't already a comma
            by_change_string = by_change_string & ","
        End If
    End If

    current_status = Sheets("Buyback Risk Area").Range("C1").Offset(i).Value
    Select Case current_status
        Case "Y"                'risk area is currently yellow, so green transition is available
            by_change_string = by_change_string & "$E$" & i + 1
            solverok setcell:="$B$" & j + 4, MaxMinVal:=2, ValueOf:="0", ByChange:=by_change_string

            'add binary constraints
            solveradd cellref:="$E$" & i + 1, relation:=5, formulatext:="binary"
        Case "O"                'risk area is currently orange, so green and yellow transitions are available
            by_change_string = by_change_string & "$E$" & i + 1 & ",$G$" & i + 1
            solverok setcell:="$B$" & j + 4, MaxMinVal:=2, ValueOf:="0", ByChange:=by_change_string

            'add cascading constraints
            solveradd cellref:="$E$" & i + 1, relation:=1, formulatext:="$G$" & i + 1 'says E <= G, which means you can't select green unless you've already selected yellow

            'add binary constraints
            solveradd cellref:="$E$" & i + 1, relation:=5, formulatext:="binary"'                solveradd cellref:="$G$" & i + 1, relation:=5, formulatext:="binary"
        Case "R"                'risk area is currently red, so green, yellow, and orange transitions are available
            by_change_string = by_change_string & "$E$" & i + 1 & ",$G$" & i + 1 & ",$I$" & i + 1
            'solverok setcell:="$B$" & j + 4, MaxMinVal:=2, ValueOf:="0", ByChange:=by_change_string

            'add cascading constraints
            solveradd cellref:="$E$" & i + 1, relation:=1, formulatext:="$G$" & i + 1 'says E <= G, which means you can't select green unless you've already selected yellow
            solveradd cellref:="$G$" & i + 1, relation:=1, formulatext:="$I$" & i + 1 'says G <= I, which means you can't select yellow unless you've already selected orange

            'add binary constraints
            solveradd cellref:="$E$" & i + 1, relation:=5, formulatext:="binary"
            solveradd cellref:="$G$" & i + 1, relation:=5, formulatext:="binary"
            solveradd cellref:="$I$" & i + 1, relation:=5, formulatext:="binary"
        Case "B"                'risk area is black, so green, yellow, orange and red transitions are avaailable
            by_change_string = by_change_string & "$E$" & i + 1 & ",$G$" & i + 1 & ",$I$" & i + 1 & ",$K$" & i + 1
            solverok setcell:="$B$" & j + 4, MaxMinVal:=2, ValueOf:="0", ByChange:=by_change_string

            'add cascading constraints
            solveradd cellref:="$E$" & i + 1, relation:=1, formulatext:="$G$" & i + 1 'says E <= G, which means you can't select green unless you've already selected yellow
            solveradd cellref:="$G$" & i + 1, relation:=1, formulatext:="$I$" & i + 1 'says G <= I, which means you can't select yellow unless you've already selected orange
            solveradd cellref:="$I$" & i + 1, relation:=1, formulatext:="$K$" & i + 1 'says K <= M, which means you can't select orange unless you've already selected red

            'add binary constraints
            solveradd cellref:="$E$" & i + 1, relation:=5, formulatext:="binary"
            solveradd cellref:="$G$" & i + 1, relation:=5, formulatext:="binary"
            solveradd cellref:="$I$" & i + 1, relation:=5, formulatext:="binary"
            solveradd cellref:="$K$" & i + 1, relation:=5, formulatext:="binary"
    End Select
Next i

'buyback amount constraint
solveradd cellref:="$O$" & j + 1, relation:=1, formulatext:="$B$" & j + 2

'set target cell
solverok setcell:="$B$" & j + 4, MaxMinVal:=2, ValueOf:="0", ByChange:=by_change_string

'set binary constraints
'binary_array = Split(by_change_string, ",")
'For i = 0 To UBound(binary_array)
'    solveradd cellref:=Range(binary_array(i)), relation:=5, formulatext:="binary"
'Next i

Application.ScreenUpdating = True

SolverSolve userFinish:=False

The basic idea here is to loop through the sheet and look at the data (which will change from execution to execution) and build the appropriate model.

THe string by_change_string contains the cell addresses of all the changing variables, which are all binary.  So as the code examines each line of the spreadsheet, it determines which cells on that line are available to be considered by the model and appends them to the string.

The multiple calls to solverok with the growing by_change_string are an attempt to solve an earlier problem where the binary constraints weren't being added to the model.  All of the <= constraints were, but not the binary ones.  It seems you can't constrain a variable to be binary until after it has been added to the model.  There used to be just a single solverok statement after the loop that constructs by_change_string was complete, but when I did it that way I got all of the <= constraints and none of the binary ones.

When this code runs on my test sheet, the resulting model should have 136 decision variables (by changing cells).  I've checked, and the by_change_string does in fact have 136 addresses in it.  But when I look in the solver dialog box, there are only the first 41.  I've stepped through the entire execution in debug mode and seen it call solverok after each iteration, but for some reason only the first 41 by change cells are there.  And there's nothing special about the row of data where things go wrong...it's not like it's the first instance of one of the select cases or something...

When solver runs on this abbreviated model, it returns a garbage solution that it says is optimal.  Basically it keeps everything the same, so that the final objective function value is the same as the starting one.

So then I tried something else...you'll notice a commented out block of code at the bottom:

'set binary constraints
'binary_array = Split(by_change_string, ",")
'For i = 0 To UBound(binary_array)
'    solveradd cellref:=Range(binary_array(i)), relation:=5, formulatext:="binary"
'Next i

The idea here was to make things much more efficient by getting all those solverok and solveradd statements out of the select cases.  By waiting until after the final solverok statement, all the variables are now in the model, so you should be ablto just step through the by_change_string and make each of those a binary variable.  That way you only need one solverok statement and you can get rid of all the solveradd's in the select cases.  So I commented out all of those solverok's and solveradd's in the select cases and ran the macro again.  I get no output from solver.  When I look at the solver dialog after running, both the target cell and the by changing cells fields are blank.  It's as if that last solverok statement had never been run.

So then I tried uncommenting all the solverok's, but leaving the solveradd's for the binary variables commented out.  I go back to getting only the first 41 decision variables.  The loop to set the binary constraints did it's job, but the solveradd's aren't getting the variables into the model.

I'm pretty much stumped at this point.  Any ideas?


来源: stackexchange

问:
Display sum of column from table
Hey there I have a table (named vanzari) with a column named totaldeplata
i want to display the sum of all numbers from column nammed totaldeplata from current date, there is a column nammed datainregistrarii where is registered the date by this

format Dec 7, 2017 - 12:51

this is the code, i don't get any errors but it does not display the sum

```<code><?php
$query = "SELECT * FROM vanzari WHERE datainregistrarii >= CURRENT_DATE()";
 $query_run = mysql_query($query);

 $qty= 0;
 while ($num = mysql_fetch_assoc ($query_run)) {
  $qty += $num['totaldeplata'];
 }
 echo $qty;

  ?>
</code>```

Any idea why it doesn't display the sum of column from the current day?

答:
I really apreciate your answear, none of them are not working.
This is what i got.</p>

```<code><?php
 (int)$num['totaldeplata'];

 $query = "SELECT * FROM vanzari WHERE datainregistrarii >= CURRENT_DATE()";

 $query_run = mysql_query($query);
 $qty= 0;
 while ($num = mysql_fetch_assoc ($query_run)) {
  $qty += (int)$num['totaldeplata'];
 }
 echo $qty;

 ?>
</code>```

ContentLicense: CC BY-SA 3.0

Title: Display sum of column from table

Body:
Hey there I have a table (named vanzari) with a column named totaldeplata
i want to display the sum of all numbers from column nammed totaldeplata from current date, there is a column nammed datainregistrarii where is registered the date by this

format Dec 7, 2017 - 12:51

this is the code, i don't get any errors but it does not display the sum

<?php
$query = "SELECT * FROM vanzari WHERE datainregistrarii >= CURRENT_DATE()";
 $query_run = mysql_query($query);

 $qty= 0;
 while ($num = mysql_fetch_assoc ($query_run)) {
  $qty += $num['totaldeplata'];
 }
 echo $qty;

  ?>

Any idea why it doesn't display the sum of column from the current day?

Body:
I really apreciate your answear, none of them are not working.
This is what i got.

<?php
 (int)$num['totaldeplata'];

 $query = "SELECT * FROM vanzari WHERE datainregistrarii >= CURRENT_DATE()";

 $query_run = mysql_query($query);
 $qty= 0;
 while ($num = mysql_fetch_assoc ($query_run)) {
  $qty += (int)$num['totaldeplata'];
 }
 echo $qty;

 ?>


问:
Get data outside HTML object
I have an HTML page with a couple of divs with data in it:

```<code><div class="event-name">Event x</div>
<div class="event-date">21 november 2017</div>
<div class="event-address">full address here</div>
</code>```

On this page is a form that is loaded into it with:

```<code>jQuery(".tribe-events-tickets.tribe-events-tickets-rsvp").html('<object data="http://www.page-form.com/"/>');
</code>```

On that page (so the external url), I have some scripts to get the values from the divs above. When the form on the external page is submitted, I do this:

```<code>html_name = jQuery('.event-name').html();
$('#mce-SESNAAM').val(html_name);
</code>```

But that doesn't seem to work because the form is in an object/external page.

Does anyone know how to solve this?

答:
Okay I got it to work :-)

The third party added my JS script to the website. That script added variables to the iframe and replaced the current form.

```<code>      jQuery(".tribe-events").html('<iframe src="http://my-form.be/?name='+ html_name +'&place='+ html_place +'&hour='+ html_hour +'&date='+ mc_date +'"></iframe>');
</code>```

In form http://my-form.be/

```<code>       <input type="hidden" name="session_name" id="mce-SESNAAM" value="<?php echo $_GET['name']; ?>" />
</code>```

This works perfectly.

Title: Get data outside HTML object

Body:
I have an HTML page with a couple of divs with data in it:

Event x

21 november 2017

full address here

On this page is a form that is loaded into it with:

jQuery(".tribe-events-tickets.tribe-events-tickets-rsvp").html('<object data="http://www.page-form.com/"/>');

On that page (so the external url), I have some scripts to get the values from the divs above. When the form on the external page is submitted, I do this:

html_name = jQuery('.event-name').html();
$('#mce-SESNAAM').val(html_name);

But that doesn't seem to work because the form is in an object/external page.

Does anyone know how to solve this?

Body:
Okay I got it to work :-)

The third party added my JS script to the website. That script added variables to the iframe and replaced the current form.

      jQuery(".tribe-events").html('<iframe src="http://my-form.be/?name='+ html_name +'&place='+ html_place +'&hour='+ html_hour +'&date='+ mc_date +'"></iframe>');

In form http://my-form.be/

       <input type="hidden" name="session_name" id="mce-SESNAAM" value="<?php echo $_GET['name']; ?>" />

This works perfectly.


问:
get the windows installation drive using python
How to detect the windows installation path or drive using python code ?</p>

答:
You can use the WINDIR enviroment variable.</p>

```<code>os.environ['WINDIR']
</code>```

ContentLicense: CC BY-SA 2.5

Body:
You can use the WINDIR enviroment variable.

os.environ['WINDIR']


问:
Serialize only Date part of DateTime in web api 2
Having this object :

```<code>public class Person {
    public string FirstName { get; set; }
    [DataType(DataType.Date)]
    public DateTime Birthday { get; set; }
}
</code>```

Returning this object as content in Web Api 2 generates this json for Birthday :

"2014-02-20T17:00:32.7114097+00:00"

How can I make it to be : "2014-02-20" without the time part?

答:
By far the simplest method is to subclass the built in IsoDateTimeConverter class and set a different DateTimeFormat.

```<code>public class IsoDateConverter : IsoDateTimeConverter
{
    public IsoDateConverter() =>
        this.DateTimeFormat = Culture.DateTimeFormat.ShortDatePattern;
}

public class Foo
{
    [JsonConverter(typeof(IsoDateConverter))]
    public DateTimeOffset Date { get; set; }
}
</code>```

ContentLicense: CC BY-SA 4.0

Body:
Having this object :

public class Person {
    public string FirstName { get; set; }
    [DataType(DataType.Date)]
    public DateTime Birthday { get; set; }
}

Returning this object as content in Web Api 2 generates this json for Birthday :

"2014-02-20T17:00:32.7114097+00:00"

How can I make it to be : "2014-02-20" without the time part?

Body:
By far the simplest method is to subclass the built in IsoDateTimeConverter class and set a different DateTimeFormat.

public class IsoDateConverter : IsoDateTimeConverter
{
    public IsoDateConverter() =>
        this.DateTimeFormat = Culture.DateTimeFormat.ShortDatePattern;
}

public class Foo
{
    [JsonConverter(typeof(IsoDateConverter))]
    public DateTimeOffset Date { get; set; }
}


问:
How to set "value" to input web element using selenium?
I have element in my code that looks like this:

```<code><input id="invoice_supplier_id" name="invoice[supplier_id]" type="hidden" value="">
</code>```

I want to set its value, so I created a web element with it's xpath:

```<code> val test = driver.findElements(By.xpath("""//*[@id="invoice_supplier_id"]"""))
</code>```

but now I dont see an option to set the value...

答: As Shubham Jain stated, this is working to me: driver.findElement(By.id("invoice_supplier_id")).sendKeys("value", "new value");

Body:
I have element in my code that looks like this:

<input id="invoice_supplier_id" name="invoice[supplier_id]" type="hidden" value="">

I want to set its value, so I created a web element with it's xpath:

 val test = driver.findElements(By.xpath("""//*[@id="invoice_supplier_id"]"""))

but now I dont see an option to set the value...


问:
How to assign 2 variables simultaneously in Rust?
I'm currently teaching myself Rust with a roguelike tutorial, and I'm attempting to get a key press to move a character diagonally which would mean player_x -=1, player_y -= 1 for up left.

No matter which way I try to arrange the code, I keep getting error messages from the compiler. I couldn't find any example of this anywhere in the documentation or on GitHub.

```<code>Key { code: Escape, .. } => return true, // exit game

// movement keys
Key { code: Up, .. } => *player_y -= 1,
Key { code: Down, .. } => *player_y += 1,
Key { code: Left, .. } => *player_x -= 1,
Key { code: Right, .. } => *player_x += 1,
Key { printable: 'k', .. } => *player_y -= 1,
Key { printable: 'k', .. } => *player_x -= 1,

_ => {}
</code>```

You can kind of see what I'm trying to do here, but this throws an error message saying the pattern is unreachable, how would I fix this code?

Here's the full code, it's fairly small, not sure what would be alone necessary to compile:

```<code>extern crate tcod;
extern crate input;

use tcod::console::*;
use tcod::colors;

// actual size of the window
const SCREEN_WIDTH: i32 = 80;
const SCREEN_HEIGHT: i32 = 50;

const LIMIT_FPS: i32 = 20;  // 20 frames-per-second maximum

fn handle_keys(root: &mut Root, player_x: &mut i32, player_y: &mut i32) -> bool {
    use tcod::input::Key;
    use tcod::input::KeyCode::*;

    let key = root.wait_for_keypress(true);
    match key {
        Key { code: Enter, alt: true, .. } => {
            // Alt+Enter: toggle fullscreen
            let fullscreen = root.is_fullscreen();
            root.set_fullscreen(!fullscreen);
        }
        Key { code: Escape, .. } => return true,  // exit game

        // movement keys
        Key { code: Up, .. } => *player_y -= 1,
        Key { code: Down, .. } => *player_y += 1,
        Key { code: Left, .. } => *player_x -= 1,
        Key { code: Right, .. } => *player_x += 1,
        Key { printable: 'k', ..} => *player_y -= 1,
        Key { printable: 'k', ..} => *player_x -= 1,

        _ => {},
    }

    false
}

fn main() {
    let mut root = Root::initializer()
        .font("terminal8x8_gs_tc.png", FontLayout::Tcod)
        .font_type(FontType::Greyscale)
        .size(SCREEN_WIDTH, SCREEN_HEIGHT)
        .title("Rust/libtcod tutorial")
        .init();

    tcod::system::set_fps(LIMIT_FPS);

    let mut player_x = SCREEN_WIDTH / 2;
    let mut player_y = SCREEN_HEIGHT / 2;

    while !root.window_closed() {
        root.set_default_foreground(colors::WHITE);
        root.put_char(player_x, player_y, '@', BackgroundFlag::None);

        root.flush();

        root.put_char(player_x, player_y, ' ', BackgroundFlag::None);

        // handle keys and exit game if needed
        let exit = handle_keys(&mut root, &mut player_x, &mut player_y);
        if exit {
            break
        }
    }
}
</code>```

答:
The second printable: 'k' is unreachable, since the first will match instead.  What you want is doing both assignments in the same arm of the match, like this:

```<code>Key { printable: 'k', .. } => {
    *player_y -= 1;
    *player_x -= 1;
}
</code>```

Body:
I'm currently teaching myself Rust with a roguelike tutorial, and I'm attempting to get a key press to move a character diagonally which would mean player_x -=1, player_y -= 1 for up left.

No matter which way I try to arrange the code, I keep getting error messages from the compiler. I couldn't find any example of this anywhere in the documentation or on GitHub.

Key { code: Escape, .. } => return true, // exit game

// movement keys
Key { code: Up, .. } => *player_y -= 1,
Key { code: Down, .. } => *player_y += 1,
Key { code: Left, .. } => *player_x -= 1,
Key { code: Right, .. } => *player_x += 1,
Key { printable: 'k', .. } => *player_y -= 1,
Key { printable: 'k', .. } => *player_x -= 1,

_ => {}

You can kind of see what I'm trying to do here, but this throws an error message saying the pattern is unreachable, how would I fix this code?

Here's the full code, it's fairly small, not sure what would be alone necessary to compile:

extern crate tcod;
extern crate input;

use tcod::console::*;
use tcod::colors;

// actual size of the window
const SCREEN_WIDTH: i32 = 80;
const SCREEN_HEIGHT: i32 = 50;

const LIMIT_FPS: i32 = 20;  // 20 frames-per-second maximum

fn handle_keys(root: &mut Root, player_x: &mut i32, player_y: &mut i32) -> bool {
    use tcod::input::Key;
    use tcod::input::KeyCode::*;

    let key = root.wait_for_keypress(true);
    match key {
        Key { code: Enter, alt: true, .. } => {
            // Alt+Enter: toggle fullscreen
            let fullscreen = root.is_fullscreen();
            root.set_fullscreen(!fullscreen);
        }
        Key { code: Escape, .. } => return true,  // exit game

        // movement keys
        Key { code: Up, .. } => *player_y -= 1,
        Key { code: Down, .. } => *player_y += 1,
        Key { code: Left, .. } => *player_x -= 1,
        Key { code: Right, .. } => *player_x += 1,
        Key { printable: 'k', ..} => *player_y -= 1,
        Key { printable: 'k', ..} => *player_x -= 1,

        _ => {},
    }

    false
}

fn main() {
    let mut root = Root::initializer()
        .font("terminal8x8_gs_tc.png", FontLayout::Tcod)
        .font_type(FontType::Greyscale)
        .size(SCREEN_WIDTH, SCREEN_HEIGHT)
        .title("Rust/libtcod tutorial")
        .init();

    tcod::system::set_fps(LIMIT_FPS);

    let mut player_x = SCREEN_WIDTH / 2;
    let mut player_y = SCREEN_HEIGHT / 2;

    while !root.window_closed() {
        root.set_default_foreground(colors::WHITE);
        root.put_char(player_x, player_y, '@', BackgroundFlag::None);

        root.flush();

        root.put_char(player_x, player_y, ' ', BackgroundFlag::None);

        // handle keys and exit game if needed
        let exit = handle_keys(&mut root, &mut player_x, &mut player_y);
        if exit {
            break
        }
    }
}

Body:
The second printable: 'k' is unreachable, since the first will match instead.  What you want is doing both assignments in the same arm of the match, like this:

Key { printable: 'k', .. } => {
    *player_y -= 1;
    *player_x -= 1;
}


问:
Grails with with spring_security_core ERR_TOO_MANY_REDIRECTS
I'm using Grails 2.3.3 and have configured spring-security-core:2.0-RC5 with it. Where I am employing the RequestMap the dB table to store the web page access control details for the application.

Starting up the application the login/auth page fails to display due to ERR_TOO_MANY_REDIRECTS.

I have searched earlier stackoverflow posts for ideas and found this one which was useful: Redirect Loop with Requestmap with grails spring security core 2.0RC4

This refers to another link to a known bug in spring-security-core:
enter link description here

However, this link no longer exists. I searched further and found a useful site the has information on spring_security_core issues: enter link description here. However, this particular issue is not discussed.

Can someone suggest where this old jira web link may have been moved to?

Alternatively, can someone suggest a workaround? The post states that there were a number of suggestions in the original jira post.

I have tried adjusting the Hibernate version which is mentioned in the Stackoverflow post but that didn't work for me. I would welcome some suggestions?

答:
Spring Security redirects too many times when the User, UserRole and Role table exists but if there is no data.

I would suggest populating these tables with seed data. You can write the seeder code in the Bootstrap.groovy.

Hope this helps.


问:
PHP MySQL insert with $_REQUEST
I am trying to insert this $_REQUEST data into my MySQL database. The code is shown below:

```<code>foreach ($_REQUEST as $value)
{

 $sql = "INSERT INTO beer (b_beer) VALUES ('$value');";

 if(mysqli_query($connection, $sql))
  {
  echo "Records added successfully.";
  }

   else
   {
   echo "ERROR: Could not able to execute $sql. " . mysqli_error($connection);
   }
}
</code>```

The MySQL successfully inserts into my 'beer' table, but also creates 2 empty records. Is there a reason why this is happening?

答:
Because $_REQUEST is associative array that contains $_GET, $_POST and $_COOKIE, some of them may be empty, but are present with keys anyway. That's why you're getting three records.

I would add a condition if ($value!='') { ...insert... }, but obviously you're still vulnerable to what $_GET contains, in case user added anything in the URL.

Title: PHP MySQL insert with $_REQUEST

Body:
I am trying to insert this $_REQUEST data into my MySQL database. The code is shown below:

foreach ($_REQUEST as $value)
{

 $sql = "INSERT INTO beer (b_beer) VALUES ('$value');";

 if(mysqli_query($connection, $sql))
  {
  echo "Records added successfully.";
  }

   else
   {
   echo "ERROR: Could not able to execute $sql. " . mysqli_error($connection);
   }
}

The MySQL successfully inserts into my 'beer' table, but also creates 2 empty records. Is there a reason why this is happening?


问:
Does local method call wait for remote return value in java RMI?
I have a question about how local and remote methods cooperate in Java RMI.
Here's the ideal situation:

```<code>localClass.setValue(server.getValue());
</code>```

Does localClass.setValue(..) awaits for the return value from the server or do I have to make sure of it using some sort of synchronization in local?
What happens if the server needs like 5 seconds to execute getValue()?

答: The client wait the 5 sec, if you would like to set a timeout exception you have to do it by yourself like already suggested in this question.

Body:
I have a question about how local and remote methods cooperate in Java RMI.
Here's the ideal situation:

localClass.setValue(server.getValue());

Does localClass.setValue(..) awaits for the return value from the server or do I have to make sure of it using some sort of synchronization in local?
What happens if the server needs like 5 seconds to execute getValue()?


问:
Why is the Android test runner reporting "Empty test suite"?
I am banging my head against the wall here trying to figure out why IntelliJ/Android is reporting  "Empty test suite". I have a small project with two IntelliJ Modules ("Projects" in Eclipse). The Unit test module has its own AndroidManifest.xml, which I have pasted at the bottom. I am trying to run an ActivityUnitTestCase, since the tests will be dependent upon the Context-object.

The package name of the main module is nilzor.myapp. The pacakge name of the test module is nilzor.myapp.tests

Why is not the test runner detecting the testBlah()-method as a test?

```<code><?xml version="1.0" encoding="utf-8"?>
<!-- package name must be unique so suffix with "tests" so package loader doesn't ignore us -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="nilzor.myapp.tests"
          android:versionCode="1"
          android:versionName="1.0">
    <!-- We add an application tag here just so that we can indicate that
         this package needs to link against the android.test library,
         which is needed when building test cases. -->
    <application>
        <uses-library android:name="android.test.runner"/>
    </application>
    <!--
    This declares that this application uses the instrumentation test runner targeting
    the package of nilzor.myapp.  To run the tests use the command:
    "adb shell am instrument -w nilzor.myapp.tests/android.test.InstrumentationTestRunner"
    -->
    <instrumentation android:name="android.test.InstrumentationTestRunner"
                     android:targetPackage="nilzor.myapp"
                     android:label="Tests for nilzor.myapp"/>
</manifest>
</code>```

And here is my test class:;

```<code>package nilzor.myapp.tests;

public class NilzorSomeTest<T extends Activity> extends ActivityUnitTestCase<T>{
    public NilzorSomeTest(Class<T> activityClass){
        super(activityClass);
    }

    @SmallTest
    public void testBlah(){
        assertEquals(1,1);
    }
}
</code>```

I have read the testing fundamentals, the activity testing document, and tried following this Hello world test blog, even though it is for Eclipse. I cannot get the test runner to find and run my test. What am I doing wrong?

Some of the questions I still feel unsure about are:

Do I need an Annotation above the Unit test method?

Do I need to prefix the method with "test", or is that just for JUnit tests?

Can I have tests in sub-packages of nilzor.myapp.tests?

But the main question of this post is why does not the test runner detect my test?

答:
I was doing some insertions in a db in the @BeforeClass method.
I realised I had an object/database mapping problem. This data mapping problem was the cause of this issue for me.</p>

Body:
I am banging my head against the wall here trying to figure out why IntelliJ/Android is reporting  "Empty test suite". I have a small project with two IntelliJ Modules ("Projects" in Eclipse). The Unit test module has its own AndroidManifest.xml, which I have pasted at the bottom. I am trying to run an ActivityUnitTestCase, since the tests will be dependent upon the Context-object.

The package name of the main module is nilzor.myapp. The pacakge name of the test module is nilzor.myapp.tests

Why is not the test runner detecting the testBlah()-method as a test?

<?xml version="1.0" encoding="utf-8"?>

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="nilzor.myapp.tests"
          android:versionCode="1"
          android:versionName="1.0">

    <application>
        <uses-library android:name="android.test.runner"/>
    </application>

    <instrumentation android:name="android.test.InstrumentationTestRunner"
                     android:targetPackage="nilzor.myapp"
                     android:label="Tests for nilzor.myapp"/>
</manifest>

And here is my test class:;

package nilzor.myapp.tests;

public class NilzorSomeTest<T extends Activity> extends ActivityUnitTestCase<T>{
    public NilzorSomeTest(Class<T> activityClass){
        super(activityClass);
    }

    @SmallTest
    public void testBlah(){
        assertEquals(1,1);
    }
}

I have read the testing fundamentals, the activity testing document, and tried following this Hello world test blog, even though it is for Eclipse. I cannot get the test runner to find and run my test. What am I doing wrong?

Some of the questions I still feel unsure about are:

Do I need an Annotation above the Unit test method?

Do I need to prefix the method with "test", or is that just for JUnit tests?

Can I have tests in sub-packages of nilzor.myapp.tests?

But the main question of this post is why does not the test runner detect my test?


问:
How to copy CSV file with 50000 rows and a header to another CSV,with some conditions?
I want to copy a huge csv file to another csv file but skip starting 100 lines first file and retainheader, at a same time I want to ignore unwanted commas which are in-between some names which are in quotes, like- "Hey, Roger"

Input data:

```<code>    Header------>
EPINASTINE HCL 0.05% EYE DROPS,51991083675,7.75853,03/23/2016,ML
EPINASTINE HCL 0.05% EYE DROPS,51991083675,7.75853,03/23/2016,ML
EPINASTINE HCL 0.05% EYE DROPS,51991083675,7.75853,03/23/2016,ML
HYDROMORPHONE 2 MG TABLET,68084042301,0.08511,03/23/2016,EA
"BICILLIN L-A 2,400,000 UNITS",60793070210,54.03213,01/01/2016,ML
EPINASTINE HCL 0.05% EYE DROPS,51991083675,7.75853,03/23/2016,ML
</code>```

In fifth row "BICILLIN L-A 2,400,000 UNITS" is one element and contains comma in-between , which I want to either ignore or replace by space and also want to ignore top 3 rows. so output.csv will look like:

```<code>Header------>
    HYDROMORPHONE 2 MG TABLET,68084042301,0.08511,03/23/2016,EA
    "BICILLIN L-A 2 400 000 UNITS",60793070210,54.03213,01/01/2016,ML
    EPINASTINE HCL 0.05% EYE DROPS,51991083675,7.75853,03/23/2016,ML
</code>```

please help me on this.
Below is my snippet:

```<code>       with open(filename , 'rb') as infile:
            data_in = infile.readlines()

        with open ('temp.csv', 'wb') as outfile:
            outfile.writelines(data_in[0])
            outfile.writelines(data_in[3:])
        os.remove(filename)
        os.rename('temp.csv',filename)
</code>```

I am not getting a way to replace unwanted commas in this.

答:
You're going to need to access the file line by line since you have an interesting requirement of keeping the first row (the header) but then a gap and also do some regex work on the various lines. Your code should look something like this:</p>

```<code>import os
filename = "name_of_file.csv"
with open(filename , 'rb') as infile:
  with open ('temp.csv', 'wb') as outfile:
    start_row = 3;
    row_count = 0;
    for line in infile.readlines():
      if row_count >= start_row:
        # find all matches for commas inside double quotes
        regex = b"\".*?,.*?\""
        matches = re.findall(regex, line)
        for match in matches:
          # for each match found, remove unwanted commas and replace them
          new_cell = match.replace(b',', b' ')
          line = re.sub(match, new_cell, line)
        # write line to file
        outfile.write(line)
      elif row_count == 0:
        # header row, copy it
        outfile.write(line)
      row_count += 1
os.remove(filename)
os.rename('temp.csv',filename)
</code>```

Body:
I want to copy a huge csv file to another csv file but skip starting 100 lines first file and retainheader, at a same time I want to ignore unwanted commas which are in-between some names which are in quotes, like- "Hey, Roger"

Input data:

    Header------>
EPINASTINE HCL 0.05% EYE DROPS,51991083675,7.75853,03/23/2016,ML
EPINASTINE HCL 0.05% EYE DROPS,51991083675,7.75853,03/23/2016,ML
EPINASTINE HCL 0.05% EYE DROPS,51991083675,7.75853,03/23/2016,ML
HYDROMORPHONE 2 MG TABLET,68084042301,0.08511,03/23/2016,EA
"BICILLIN L-A 2,400,000 UNITS",60793070210,54.03213,01/01/2016,ML
EPINASTINE HCL 0.05% EYE DROPS,51991083675,7.75853,03/23/2016,ML

In fifth row "BICILLIN L-A 2,400,000 UNITS" is one element and contains comma in-between , which I want to either ignore or replace by space and also want to ignore top 3 rows. so output.csv will look like:

Header------>
    HYDROMORPHONE 2 MG TABLET,68084042301,0.08511,03/23/2016,EA
    "BICILLIN L-A 2 400 000 UNITS",60793070210,54.03213,01/01/2016,ML
    EPINASTINE HCL 0.05% EYE DROPS,51991083675,7.75853,03/23/2016,ML

please help me on this.
Below is my snippet:

       with open(filename , 'rb') as infile:
            data_in = infile.readlines()

        with open ('temp.csv', 'wb') as outfile:
            outfile.writelines(data_in[0])
            outfile.writelines(data_in[3:])
        os.remove(filename)
        os.rename('temp.csv',filename)

I am not getting a way to replace unwanted commas in this.

Body:
You're going to need to access the file line by line since you have an interesting requirement of keeping the first row (the header) but then a gap and also do some regex work on the various lines. Your code should look something like this:

import os
filename = "name_of_file.csv"
with open(filename , 'rb') as infile:
  with open ('temp.csv', 'wb') as outfile:
    start_row = 3;
    row_count = 0;
    for line in infile.readlines():
      if row_count >= start_row:
        # find all matches for commas inside double quotes
        regex = b"\".*?,.*?\""
        matches = re.findall(regex, line)
        for match in matches:
          # for each match found, remove unwanted commas and replace them
          new_cell = match.replace(b',', b' ')
          line = re.sub(match, new_cell, line)
        # write line to file
        outfile.write(line)
      elif row_count == 0:
        # header row, copy it
        outfile.write(line)
      row_count += 1
os.remove(filename)
os.rename('temp.csv',filename)


问:
Not integers values for line width in R
I am trying to make plots using not integers values for lwd. However, I have realised that, using values such as 1.5 or 0.5, gives me the same plot as using lwd=1.

How can I adjust the line width to intermediate values?

答:
If you check ?par it says that lwd represents:

The line width, a positive number, defaulting to 1. The interpretation is device-specific, and some devices do not implement line widths less than one. (See the help on the device for details of the interpretation.)

So for example if you are outputting the plot to pdf check ?pdf and see that line width is interpreted as multiples of 1/96th of an inch and that 1 is the minimum. It is not possible then to make use of a "0.5" linewidth.

Consider what you are trying to show in your plot and perhaps scale the values up to a range of integers that make sense.

Title: Not integers values for line width in R


问:
C++ unrecognizable template declaration when using 2 libraries in the same project (Cork+VTK)
I want to use cork library (https://github.com/gilbo/cork) to perform boolean operations on meshes, and the library compiles and runs fine in a seperate project in MSVC2015 visual C++ on windows7 64x.

When I include cork into my current project which is using other libraries I get these errors:

```1>------ Rebuild All started: Project: QtGuiApplication2, Configuration: Release x64 ------
1>  Moc'ing QtGuiApplication2.h...
1>  Uic'ing QtGuiApplication2.ui...
1>  Rcc'ing QtGuiApplication2.qrc...
1>RCC : warning : No resources in 'E:\C++\VS2013 projects\QtGuiApplication32015\QtGuiApplication2\QtGuiApplication2.qrc'.
1>
1>  cork.cpp
1>C:\cork\src\math\vec.h(98): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(98): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(98): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(98): error C2923: 'Vec2': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(98): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(100): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(100): error C2923: 'Vec2': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(100): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(100): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(100): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(123): warning C4003: not enough actual parameters for macro 'max'
1>C:\cork\src\math\vec.h(123): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(123): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(123): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(125): warning C4003: not enough actual parameters for macro 'min'
1>C:\cork\src\math\vec.h(125): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(125): error C2923: 'Vec2': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(125): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(125): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(203): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(203): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(203): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(203): error C2923: 'Vec3': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(203): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(205): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(205): error C2923: 'Vec3': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(205): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(205): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(205): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(230): warning C4003: not enough actual parameters for macro 'max'
1>C:\cork\src\math\vec.h(230): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(230): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(230): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(232): warning C4003: not enough actual parameters for macro 'min'
1>C:\cork\src\math\vec.h(232): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(232): error C2923: 'Vec3': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(232): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(232): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(313): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(313): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(313): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(313): error C2923: 'Vec4': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(313): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(315): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(315): error C2923: 'Vec4': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(315): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(315): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(315): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(339): warning C4003: not enough actual parameters for macro 'max'
1>C:\cork\src\math\vec.h(339): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(339): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(339): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(341): warning C4003: not enough actual parameters for macro 'min'
1>C:\cork\src\math\vec.h(341): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(341): error C2923: 'Vec4': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(341): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(341): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(481): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(481): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(481): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(481): error C2923: 'Vec2': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(481): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(486): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(486): error C2923: 'Vec2': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(486): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(486): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(486): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(486): error C2143: syntax error: missing ';' before '{'
1>C:\cork\src\math\vec.h(486): error C2447: '{': missing function header (old-style formal list?)
1>C:\cork\src\math\vec.h(526): warning C4003: not enough actual parameters for macro 'max'
1>C:\cork\src\math\vec.h(526): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(526): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(526): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(530): warning C4003: not enough actual parameters for macro 'min'
1>C:\cork\src\math\vec.h(530): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(530): error C2923: 'Vec2': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(530): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(530): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(530): error C2143: syntax error: missing ';' before '{'
1>C:\cork\src\math\vec.h(530): error C2447: '{': missing function header (old-style formal list?)
1>C:\cork\src\math\vec.h(629): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(629): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(629): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(629): error C2923: 'Vec3': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(629): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(635): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(635): error C2923: 'Vec3': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(635): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(635): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(635): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(635): error C2143: syntax error: missing ';' before '{'
1>C:\cork\src\math\vec.h(635): error C2447: '{': missing function header (old-style formal list?)
1>C:\cork\src\math\vec.h(687): warning C4003: not enough actual parameters for macro 'max'
1>C:\cork\src\math\vec.h(687): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(687): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(687): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(691): warning C4003: not enough actual parameters for macro 'min'
1>C:\cork\src\math\vec.h(691): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(691): error C2923: 'Vec3': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(691): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(691): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(691): error C2143: syntax error: missing ';' before '{'
1>C:\cork\src\math\vec.h(691): error C2447: '{': missing function header (old-style formal list?)
1>C:\cork\src\math\vec.h(795): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(795): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(795): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(795): error C2923: 'Vec4': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(795): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(802): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(802): error C2923: 'Vec4': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(802): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(802): fatal error C1003: error count exceeds 100; stopping compilation
1>  files.cpp
1>C:\cork\src\math\vec.h(98): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(98): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(98): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(98): error C2923: 'Vec2': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(98): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(100): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(100): error C2923: 'Vec2': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(100): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(100): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(100): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(123): warning C4003: not enough actual parameters for macro 'max'
1>C:\cork\src\math\vec.h(123): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(123): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(123): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(125): warning C4003: not enough actual parameters for macro 'min'
1>C:\cork\src\math\vec.h(125): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(125): error C2923: 'Vec2': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(125): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(125): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(203): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(203): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(203): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(203): error C2923: 'Vec3': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(203): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(205): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(205): error C2923: 'Vec3': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(205): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(205): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(205): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(230): warning C4003: not enough actual parameters for macro 'max'
1>C:\cork\src\math\vec.h(230): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(230): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(230): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(232): warning C4003: not enough actual parameters for macro 'min'
1>C:\cork\src\math\vec.h(232): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(232): error C2923: 'Vec3': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(232): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(232): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(313): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(313): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(313): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(313): error C2923: 'Vec4': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(313): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(315): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(315): error C2923: 'Vec4': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(315): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(315): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(315): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(339): warning C4003: not enough actual parameters for macro 'max'
1>C:\cork\src\math\vec.h(339): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(339): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(339): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(341): warning C4003: not enough actual parameters for macro 'min'
1>C:\cork\src\math\vec.h(341): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(341): error C2923: 'Vec4': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(341): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(341): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(481): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(481): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(481): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(481): error C2923: 'Vec2': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(481): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(486): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(486): error C2923: 'Vec2': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(486): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(486): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(486): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(486): error C2143: syntax error: missing ';' before '{'
1>C:\cork\src\math\vec.h(486): error C2447: '{': missing function header (old-style formal list?)
1>C:\cork\src\math\vec.h(526): warning C4003: not enough actual parameters for macro 'max'
1>C:\cork\src\math\vec.h(526): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(526): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(526): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(530): warning C4003: not enough actual parameters for macro 'min'
1>C:\cork\src\math\vec.h(530): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(530): error C2923: 'Vec2': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(530): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(530): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(530): error C2143: syntax error: missing ';' before '{'
1>C:\cork\src\math\vec.h(530): error C2447: '{': missing function header (old-style formal list?)
1>C:\cork\src\math\vec.h(629): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(629): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(629): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(629): error C2923: 'Vec3': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(629): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(635): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(635): error C2923: 'Vec3': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(635): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(635): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(635): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(635): error C2143: syntax error: missing ';' before '{'
1>C:\cork\src\math\vec.h(635): error C2447: '{': missing function header (old-style formal list?)
1>C:\cork\src\math\vec.h(687): warning C4003: not enough actual parameters for macro 'max'
1>C:\cork\src\math\vec.h(687): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(687): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(687): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(691): warning C4003: not enough actual parameters for macro 'min'
1>C:\cork\src\math\vec.h(691): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(691): error C2923: 'Vec3': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(691): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(691): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(691): error C2143: syntax error: missing ';' before '{'
1>C:\cork\src\math\vec.h(691): error C2447: '{': missing function header (old-style formal list?)
1>C:\cork\src\math\vec.h(795): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(795): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(795): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(795): error C2923: 'Vec4': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(795): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(802): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(802): error C2923: 'Vec4': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(802): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(802): fatal error C1003: error count exceeds 100; stopping compilation
1>  ifs.cpp
1>C:\cork\src\math\vec.h(98): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(98): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(98): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(98): error C2923: 'Vec2': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(98): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(100): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(100): error C2923: 'Vec2': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(100): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(100): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(100): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(123): warning C4003: not enough actual parameters for macro 'max'
1>C:\cork\src\math\vec.h(123): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(123): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(123): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(125): warning C4003: not enough actual parameters for macro 'min'
1>C:\cork\src\math\vec.h(125): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(125): error C2923: 'Vec2': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(125): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(125): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(203): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(203): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(203): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(203): error C2923: 'Vec3': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(203): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(205): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(205): error C2923: 'Vec3': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(205): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(205): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(205): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(230): warning C4003: not enough actual parameters for macro 'max'
1>C:\cork\src\math\vec.h(230): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(230): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(230): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(232): warning C4003: not enough actual parameters for macro 'min'
1>C:\cork\src\math\vec.h(232): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(232): error C2923: 'Vec3': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(232): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(232): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(313): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(313): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(313): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(313): error C2923: 'Vec4': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(313): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(315): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(315): error C2923: 'Vec4': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(315): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(315): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(315): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(339): warning C4003: not enough actual parameters for macro 'max'
1>C:\cork\src\math\vec.h(339): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(339): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(339): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(341): warning C4003: not enough actual parameters for macro 'min'
1>C:\cork\src\math\vec.h(341): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(341): error C2923: 'Vec4': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(341): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(341): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(481): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(481): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(481): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(481): error C2923: 'Vec2': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(481): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(486): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(486): error C2923: 'Vec2': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(486): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(486): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(486): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(486): error C2143: syntax error: missing ';' before '{'
1>C:\cork\src\math\vec.h(486): error C2447: '{': missing function header (old-style formal list?)
1>C:\cork\src\math\vec.h(526): warning C4003: not enough actual parameters for macro 'max'
1>C:\cork\src\math\vec.h(526): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(526): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(526): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(530): warning C4003: not enough actual parameters for macro 'min'
1>C:\cork\src\math\vec.h(530): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(530): error C2923: 'Vec2': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(530): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(530): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(530): error C2143: syntax error: missing ';' before '{'
1>C:\cork\src\math\vec.h(530): error C2447: '{': missing function header (old-style formal list?)
1>C:\cork\src\math\vec.h(629): error C2988: unrecognizable template declaration/definition
1>  quantization.cpp
1>  log.cpp
1>  timer.cpp
1>  moc_QtGuiApplication2.cpp
1>  main.cpp
1>  mldivide_Cxx.cpp
1>  mldivide_Cxx_initialize.cpp
1>  mldivide_Cxx_terminate.cpp
1>  QtGuiApplication2.cpp
1>  rtGetInf.cpp
1>  rtGetNaN.cpp
1>  rt_nonfinite.cpp
1>  Test_Move.cpp
1>  Generating Code...
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
```

<p>The code at which the error appears is as:</p>

```template<class N>
inline Vec2<N> min(const Vec2<N> &lhs, const Vec2<N> &rhs);
```

Any idea why there is a coflict between templates and how I can solve this?

答: The problem was not importing properties  in MSVC under C++ -> Processor.</p>

Body:
I want to use cork library (https://github.com/gilbo/cork) to perform boolean operations on meshes, and the library compiles and runs fine in a seperate project in MSVC2015 visual C++ on windows7 64x.

When I include cork into my current project which is using other libraries I get these errors:

1>------ Rebuild All started: Project: QtGuiApplication2, Configuration: Release x64 ------
1>  Moc'ing QtGuiApplication2.h...
1>  Uic'ing QtGuiApplication2.ui...
1>  Rcc'ing QtGuiApplication2.qrc...
1>RCC : warning : No resources in 'E:\C++\VS2013 projects\QtGuiApplication32015\QtGuiApplication2\QtGuiApplication2.qrc'.
1>
1>  cork.cpp
1>C:\cork\src\math\vec.h(98): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(98): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(98): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(98): error C2923: 'Vec2': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(98): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(100): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(100): error C2923: 'Vec2': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(100): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(100): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(100): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(123): warning C4003: not enough actual parameters for macro 'max'
1>C:\cork\src\math\vec.h(123): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(123): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(123): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(125): warning C4003: not enough actual parameters for macro 'min'
1>C:\cork\src\math\vec.h(125): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(125): error C2923: 'Vec2': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(125): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(125): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(203): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(203): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(203): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(203): error C2923: 'Vec3': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(203): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(205): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(205): error C2923: 'Vec3': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(205): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(205): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(205): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(230): warning C4003: not enough actual parameters for macro 'max'
1>C:\cork\src\math\vec.h(230): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(230): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(230): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(232): warning C4003: not enough actual parameters for macro 'min'
1>C:\cork\src\math\vec.h(232): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(232): error C2923: 'Vec3': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(232): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(232): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(313): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(313): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(313): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(313): error C2923: 'Vec4': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(313): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(315): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(315): error C2923: 'Vec4': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(315): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(315): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(315): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(339): warning C4003: not enough actual parameters for macro 'max'
1>C:\cork\src\math\vec.h(339): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(339): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(339): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(341): warning C4003: not enough actual parameters for macro 'min'
1>C:\cork\src\math\vec.h(341): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(341): error C2923: 'Vec4': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(341): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(341): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(481): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(481): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(481): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(481): error C2923: 'Vec2': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(481): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(486): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(486): error C2923: 'Vec2': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(486): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(486): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(486): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(486): error C2143: syntax error: missing ';' before '{'
1>C:\cork\src\math\vec.h(486): error C2447: '{': missing function header (old-style formal list?)
1>C:\cork\src\math\vec.h(526): warning C4003: not enough actual parameters for macro 'max'
1>C:\cork\src\math\vec.h(526): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(526): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(526): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(530): warning C4003: not enough actual parameters for macro 'min'
1>C:\cork\src\math\vec.h(530): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(530): error C2923: 'Vec2': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(530): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(530): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(530): error C2143: syntax error: missing ';' before '{'
1>C:\cork\src\math\vec.h(530): error C2447: '{': missing function header (old-style formal list?)
1>C:\cork\src\math\vec.h(629): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(629): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(629): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(629): error C2923: 'Vec3': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(629): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(635): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(635): error C2923: 'Vec3': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(635): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(635): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(635): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(635): error C2143: syntax error: missing ';' before '{'
1>C:\cork\src\math\vec.h(635): error C2447: '{': missing function header (old-style formal list?)
1>C:\cork\src\math\vec.h(687): warning C4003: not enough actual parameters for macro 'max'
1>C:\cork\src\math\vec.h(687): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(687): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(687): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(691): warning C4003: not enough actual parameters for macro 'min'
1>C:\cork\src\math\vec.h(691): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(691): error C2923: 'Vec3': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(691): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(691): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(691): error C2143: syntax error: missing ';' before '{'
1>C:\cork\src\math\vec.h(691): error C2447: '{': missing function header (old-style formal list?)
1>C:\cork\src\math\vec.h(795): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(795): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(795): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(795): error C2923: 'Vec4': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(795): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(802): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(802): error C2923: 'Vec4': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(802): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(802): fatal error C1003: error count exceeds 100; stopping compilation
1>  files.cpp
1>C:\cork\src\math\vec.h(98): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(98): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(98): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(98): error C2923: 'Vec2': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(98): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(100): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(100): error C2923: 'Vec2': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(100): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(100): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(100): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(123): warning C4003: not enough actual parameters for macro 'max'
1>C:\cork\src\math\vec.h(123): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(123): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(123): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(125): warning C4003: not enough actual parameters for macro 'min'
1>C:\cork\src\math\vec.h(125): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(125): error C2923: 'Vec2': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(125): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(125): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(203): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(203): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(203): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(203): error C2923: 'Vec3': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(203): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(205): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(205): error C2923: 'Vec3': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(205): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(205): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(205): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(230): warning C4003: not enough actual parameters for macro 'max'
1>C:\cork\src\math\vec.h(230): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(230): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(230): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(232): warning C4003: not enough actual parameters for macro 'min'
1>C:\cork\src\math\vec.h(232): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(232): error C2923: 'Vec3': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(232): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(232): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(313): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(313): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(313): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(313): error C2923: 'Vec4': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(313): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(315): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(315): error C2923: 'Vec4': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(315): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(315): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(315): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(339): warning C4003: not enough actual parameters for macro 'max'
1>C:\cork\src\math\vec.h(339): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(339): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(339): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(341): warning C4003: not enough actual parameters for macro 'min'
1>C:\cork\src\math\vec.h(341): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(341): error C2923: 'Vec4': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(341): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(341): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(481): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(481): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(481): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(481): error C2923: 'Vec2': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(481): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(486): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(486): error C2923: 'Vec2': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(486): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(486): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(486): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(486): error C2143: syntax error: missing ';' before '{'
1>C:\cork\src\math\vec.h(486): error C2447: '{': missing function header (old-style formal list?)
1>C:\cork\src\math\vec.h(526): warning C4003: not enough actual parameters for macro 'max'
1>C:\cork\src\math\vec.h(526): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(526): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(526): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(530): warning C4003: not enough actual parameters for macro 'min'
1>C:\cork\src\math\vec.h(530): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(530): error C2923: 'Vec2': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(530): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(530): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(530): error C2143: syntax error: missing ';' before '{'
1>C:\cork\src\math\vec.h(530): error C2447: '{': missing function header (old-style formal list?)
1>C:\cork\src\math\vec.h(629): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(629): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(629): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(629): error C2923: 'Vec3': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(629): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(635): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(635): error C2923: 'Vec3': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(635): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(635): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(635): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(635): error C2143: syntax error: missing ';' before '{'
1>C:\cork\src\math\vec.h(635): error C2447: '{': missing function header (old-style formal list?)
1>C:\cork\src\math\vec.h(687): warning C4003: not enough actual parameters for macro 'max'
1>C:\cork\src\math\vec.h(687): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(687): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(687): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(691): warning C4003: not enough actual parameters for macro 'min'
1>C:\cork\src\math\vec.h(691): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(691): error C2923: 'Vec3': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(691): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(691): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(691): error C2143: syntax error: missing ';' before '{'
1>C:\cork\src\math\vec.h(691): error C2447: '{': missing function header (old-style formal list?)
1>C:\cork\src\math\vec.h(795): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(795): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(795): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(795): error C2923: 'Vec4': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(795): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(802): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(802): error C2923: 'Vec4': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(802): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(802): fatal error C1003: error count exceeds 100; stopping compilation
1>  ifs.cpp
1>C:\cork\src\math\vec.h(98): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(98): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(98): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(98): error C2923: 'Vec2': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(98): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(100): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(100): error C2923: 'Vec2': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(100): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(100): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(100): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(123): warning C4003: not enough actual parameters for macro 'max'
1>C:\cork\src\math\vec.h(123): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(123): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(123): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(125): warning C4003: not enough actual parameters for macro 'min'
1>C:\cork\src\math\vec.h(125): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(125): error C2923: 'Vec2': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(125): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(125): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(203): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(203): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(203): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(203): error C2923: 'Vec3': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(203): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(205): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(205): error C2923: 'Vec3': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(205): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(205): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(205): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(230): warning C4003: not enough actual parameters for macro 'max'
1>C:\cork\src\math\vec.h(230): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(230): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(230): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(232): warning C4003: not enough actual parameters for macro 'min'
1>C:\cork\src\math\vec.h(232): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(232): error C2923: 'Vec3': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(232): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(232): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(313): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(313): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(313): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(313): error C2923: 'Vec4': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(313): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(315): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(315): error C2923: 'Vec4': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(315): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(315): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(315): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(339): warning C4003: not enough actual parameters for macro 'max'
1>C:\cork\src\math\vec.h(339): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(339): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(339): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(341): warning C4003: not enough actual parameters for macro 'min'
1>C:\cork\src\math\vec.h(341): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(341): error C2923: 'Vec4': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(341): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(341): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(481): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(481): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(481): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(481): error C2923: 'Vec2': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(481): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(486): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(486): error C2923: 'Vec2': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(486): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(486): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(486): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(486): error C2143: syntax error: missing ';' before '{'
1>C:\cork\src\math\vec.h(486): error C2447: '{': missing function header (old-style formal list?)
1>C:\cork\src\math\vec.h(526): warning C4003: not enough actual parameters for macro 'max'
1>C:\cork\src\math\vec.h(526): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(526): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(526): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(530): warning C4003: not enough actual parameters for macro 'min'
1>C:\cork\src\math\vec.h(530): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(530): error C2923: 'Vec2': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(530): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(530): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(530): error C2143: syntax error: missing ';' before '{'
1>C:\cork\src\math\vec.h(530): error C2447: '{': missing function header (old-style formal list?)
1>C:\cork\src\math\vec.h(629): error C2988: unrecognizable template declaration/definition
1>  quantization.cpp
1>  log.cpp
1>  timer.cpp
1>  moc_QtGuiApplication2.cpp
1>  main.cpp
1>  mldivide_Cxx.cpp
1>  mldivide_Cxx_initialize.cpp
1>  mldivide_Cxx_terminate.cpp
1>  QtGuiApplication2.cpp
1>  rtGetInf.cpp
1>  rtGetNaN.cpp
1>  rt_nonfinite.cpp
1>  Test_Move.cpp
1>  Generating Code...
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

The code at which the error appears is as:

template<class N>
inline Vec2<N> min(const Vec2<N> &lhs, const Vec2<N> &rhs);

Any idea why there is a coflict between templates and how I can solve this?


答:
How to assign 2 variables simultaneously in Rust?

You cannot. You can bind two variables at once:

```<code>let (a, b) = (1, 2);
</code>```

If you aren't trying to create new bindings, you need to have two assignment statements:

```<code>let mut a = 1;
let mut b = 2;

a = 3;
b = 4;
</code>```

In your case, for a match statement, you need to introduce a block:

```<code>let key = 42;
let mut a = 1;
let mut b = 2;

match key {
    0 => {
        a += 1;
        b -= 1;
    }
    _ => {
        a -= 10;
        b *= 100;
    }
}
</code>```

You could also have the match expression evaluate to a tuple, which you then create new bindings for and apply them afterwards:

```<code>let key = 42;
let mut x = 1;
let mut y = 2;

let (d_x, d_y) = match key {
    0 => (1, -1),
    _ => (10, 10),
};

x += d_x;
y += d_y;
</code>```

I strongly recommend reading The Rust Programming Language instead of trying to learn Rust by intuition or trial and error. It has an entire chapter on the match statement.

See also:

How to swap two variables?

Body:
How to assign 2 variables simultaneously in Rust?

You cannot. You can bind two variables at once:

let (a, b) = (1, 2);

If you aren't trying to create new bindings, you need to have two assignment statements:

let mut a = 1;
let mut b = 2;

a = 3;
b = 4;

In your case, for a match statement, you need to introduce a block:

let key = 42;
let mut a = 1;
let mut b = 2;

match key {
    0 => {
        a += 1;
        b -= 1;
    }
    _ => {
        a -= 10;
        b *= 100;
    }
}

You could also have the match expression evaluate to a tuple, which you then create new bindings for and apply them afterwards:

let key = 42;
let mut x = 1;
let mut y = 2;

let (d_x, d_y) = match key {
    0 => (1, -1),
    _ => (10, 10),
};

x += d_x;
y += d_y;

I strongly recommend reading The Rust Programming Language instead of trying to learn Rust by intuition or trial and error. It has an entire chapter on the match statement.

See also:

How to swap two variables?