text:
Q: How cameraposition in plotly works I'm trying to plot 3D graphs with plotly and need to adjust camer position. I found that there's two ways to do it: either with camera attribute of Scene object, or with cameraposition attribute. I have problem with both, but this question is related to cameraposition: I can't figure out what does it mean.
The docs says:
 |      cameraposition [required=False] (value=camera position list or 1d numpy
 |      array):
 |          Sets the camera position with respect to the scene. The first entry
 |          (a list or 1d numpy array of length 4) sets the angular position of
 |          the camera. The second entry (a list or 1d numpy array of length 3)
 |          sets the (x,y,z) translation of the camera. The third entry (a
 |          scalar) sets zoom of the camera.
 |
 |          Examples:
 |              [[0.2, 0.5, 0.1, 0.2], [0.1, 0, -0.1], 3]

What 4 numbers of angular position of the camera mean? Are they angles? In radians? Which angles?

A: Here's an explanation of Plotly's camera controls for 3d plots:
http://nbviewer.jupyter.org/github/etpinard/plotly-misc-nbs/blob/master/3d-camera-controls.ipynb
For the sake of completeness, here is a short summary:
It is possible to use camera instead of cameraposition as it seems to have simpler explanation.
The camera position is determined by three vectors: up, center, eye.
The up vector determines the up direction on the page. The default is (x=0, y=0, z=1), that is, the z-axis points up.
The center vector determines the translation about the center of the scene. By default, there is no translation: the center vector is (x=0, y=0, z=0).
The eye vector determines the camera view point about the origin. The default is (x=1.25, y=1.25, z=1.25).
It is also possible to zooming in by reducing the norm the eye vector.
name = 'eye = (x:0.1, y:0.1, z:1)'
camera = dict(
    up=dict(x=0, y=0, z=1),
    center=dict(x=0, y=0, z=0),
    eye=dict(x=0.1, y=0.1, z=1)
)
fig = make_fig(camera, name)
py.iplot(fig, validate=False, filename=name)


text:
Q: Failed sending bytes array to JAX-WS web service on Axis Hi I have made a small example to show my problem. Here is my web-service:
package service;

import javax.jws.WebMethod;
import javax.jws.WebService;

@WebService
public class BytesService {

 @WebMethod
 public String redirectString(String string){
  return string+" - is what you sended";
 }

 @WebMethod
 public byte[] redirectBytes(byte[] bytes) {
  System.out.println("### redirectBytes");
  System.out.println("### bytes lenght:" + bytes.length);
  System.out.println("### message" + new String(bytes));
  return bytes;
 }

 @WebMethod
 public byte[] genBytes() {
  byte[] bytes = "Hello".getBytes();
  return bytes;
 }

}

I pack it in jar file and store in "axis2-1.5.1/repository/servicejars" folder. Then I generate client Proxy using Eclipse for EE default utils. And use it in my code in the following way:
  BytesService service = new BytesServiceProxy();
  System.out.println("Redirect string");
  System.out.println(service.redirectString("Hello"));
  System.out.println("Redirect bytes");
  byte[] param = { (byte)21, (byte)22, (byte)23 };
  System.out.println(param.length);
  param = service.redirectBytes(param);
  System.out.println(param.length);
  System.out.println("Gen bytes");
  param = service.genBytes();
  System.out.println(param.length);

And here is what my client prints:
Redirect string
Hello - is what you sended
Redirect bytes
3
0
Gen bytes
5

And on server I have:
### redirectBytes
### bytes lenght:0
### message

So byte array can normally be transfered from service, but is not accepted from the client. And it works fine with strings. Now I use Base64Encoder, but I dislike this solution.

A: I suspect the problem is in serializing the byte-array into an XML SOAP message. The XML tag in the originating SOAP message is possibly zero bytes. I'd recommend using the SOAP monitor to take a peek at the message being sent to your web service.
You may dislike the idea of encoding the byte-arry in transit, however, you need to consider it binary data. For example what if someone sent you a SOAP message encoded in something other than UTF-8? You'll want to avoid the possibility of the byte-array data changing (conversion between character sets) when the SOAP message is parsed.

redpajama_set_name: RedPajamaStackExchange


text:
Q: To catch the start of a sequence from a file I have a text file which goes like this :
      125
      126
      127    {
      566
      567
      568
      569       # blah blah
      570    {  #blah blah
      700
      701    {

The numbers are left aligned and the pattern is always the same in the sense increasing and a curly braces at the end .I need to catch just the starting number .The braces are always found and  limited to the sequence end .The start of the file is as shown starting with '125'.
In short I need :
      125
      566
      700

What I have come up with :
      grep -A1 '{' | grep -v '{' | grep -oE '(^[0-9]+?)'

but this omits '125' but I overcame by appending a newline at the head and inserting a { .
I hope to reduce this into a single regex.
Suggestions and better algorithms are welcome

A: awk 'BEGIN {p=1} p==1 {print $1;p=0} $0~/{/ {p=1}'

Output:
125
566
700

Given the file format above, you could use awk and a variable/flag to keep track on when you find an opening {

A: sed -n '1p;/{/{
N
s/.*\n\([0-9]\+\).*/\1/p
}' input_file

A: You may need to tweak the regex, but:
awk '!k; { k = !/^ *[0-9]* *{/ }'

This will print the first line and any line following a line that matches the regex ^ *[0-9]* *{
You could probably simplify things and do:
awk '!k;{k=$2!="{"}'

Which will print the first line and any line following a line in which the second field is a single open brace.

A: I would use awk and a flag to capture the existence of a curly brace and print the next line. Set the flag in the beginning and you'll get the first line.
Untested, but something like:
BEGIN {hasCurly = 1}
{
    if(hasCurly)
        print $1;

    hasCurly = match($2,"^\{");
}

A: Here is a pure bash solution:
start=1
while read n rest; do
    if (( start )); then
        printf '%d\n' $n
        start=0
    elif [[ $rest = \{* ]]; then
        start=1
    fi
done < input

A: sed will win in code golf competition =) :
sed -n '1p;/{/{n;p}' file

To remove everything after the number use:
sed -n '1{s/\s*\([0-9]\+\).*/\1/;p};/{/{n;s/\s*\([0-9]\+\).*/\1/;p}' file


text:
Q: What is the difference between cor and cor.test in R I have a data frame that its columns are different samples of an experiment. I wanted to find the correlation between these samples. So the correlation between sample v2 and v3, between sample v2 and v4, ....
This is the data frame:
> head(t1)
      V2          V3          V4         V5         V6
1 0.12725011 0.051021886 0.106049328 0.09378767 0.17799444
2 0.86096784 1.263327211 3.073650624 0.75607466 0.92244361
3 0.45791031 0.520207274 1.526476608 0.67499102 0.49817761
4 0.00000000 0.001139721 0.003158557 0.00000000 0.00000000
5 0.13383965 0.098943019 0.099922146 0.13871867 0.09750611
6 0.01016334 0.010187671 0.025410170 0.00000000 0.02369374
> nrow(t1)
[1] 23367

if I run the cor function for this data frame to get the correlation between samples(columns) I get NA for all the samples:
> cor(t1, method= "spearman")
V2 V3 V4 V5 V6
V2  1 NA NA NA NA
V3 NA  1 NA NA NA
V4 NA NA  1 NA NA
V5 NA NA NA  1 NA
V6 NA NA NA NA  1

but if I run this :
> cor.test(t1[,1],t1[,2], method="spearman")$estimate
rho
0.92394

it is different. Why is this so? What is the correct way of getting correlation between these samples?
Thank you in advance.

A: Your data contains NA values.
From ?cor:

If use is "everything", NAs will propagate conceptually, i.e., a
  resulting value will be NA whenever one of its contributing
  observations is NA.

From ?cor.test

na.action  a function which indicates what should happen when the data
  contain NAs. Defaults to getOption("na.action").

On my system:
getOption("na.action")
[1] "na.omit"

Use which(!is.finite(t1)) to search for problematic values and which(is.na(t1)) to search for NA values. cor returns NaN if you have Inf values in your data.


text:
Q: Angular 2 interface and LocalStorage Service I'm trying to use localstorage as a service to save some datas, so I created an interface and a component to call both (LocalStorage Service and interface).
Interface:
export interface Items {
    id: number;
    title: string;
    message: string;
    done: boolean;
}

Service:
@Injectable()
export class LocalStorageService {

    saved: string = localStorage.getItem('currentItem');
    currentItem: string = (localStorage.getItem('currentItem') !== null) ? JSON.parse(this.saved) : [  ];
    todos: any = this.currentItem;

    save(id, title, message, done) {
        this.todos.push({
            id: id,
            title: title,
            message: message,
            done: false
        });

        localStorage.setItem('currentItem', JSON.stringify(this.todos));
    }

}

Component:
export class AddComponent implements OnInit {

    todoForm: FormGroup;

    currentItem: string;
    todos: any;

    constructor(fb: FormBuilder,
                private router: Router,
                private storageService: LocalStorageService,
                private items: Items) {
        this.currentItem = (localStorage.getItem('currentItem') !== null) ? JSON.parse(localStorage.getItem('currentItem')) : [  ];
        this.todos = this.currentItem;

        this.todoForm = fb.group({
            id: '',
            title: '',
            message: '',
            done: ''
        });
    }

    addTodo(event) {
        console.log(this.todoForm.value);
        this.storageService.save(this.items.id, this.items.title, this.items.message, this.items.done)
        this.router.navigate(['./list']);
    }

   ngOnInit() {}

}

HTML:

    <form (submit)="addTodo($event)">

            Id:
            <input [(ngModel)]="id" class="textfield form-control" name="id" />

            Titulo:
            <input [(ngModel)]="title" class="textfield form-control" name="title">

            Mensagem:
            <input [(ngModel)]="message" class="textfield form-control" name="message">

        <button type="submit" class="btn btn-success">Salvar</button>
    </form>

I have a lot of erros when I try to access the html file.
I'm doing a proof of concepts to testing Angular 2 and I would like to use localStorage as a service and an interface. I know that I don't need localStorage as a service to do it works, but in a big project I think I'll need to use it as a service.
The project I'll develop must be works offline, so instead to call localStoragein all components I'm create this localStorage Service.
Does anyone know how I fix this problems?
Using interface and LocalStorage as a service is the best way to develop a big project?

A: You have quite a few errors in your code. I can start first off that skip localStorage altogether. You can just use the service as is, without needing to mix in the local storage there. In a real life app you would make http calls to retrieve data, like something like this:
addTodo(todo) {
  //make api request, handle response, return result to component
}

getTodos() {
  //make api request, handle response, return result to component
}

You can do exactly the same with your app, but have a local array, e.g todos, so your service could look like this:
@Injectable()
export class LocalStorageService {

  todos: Item[];

  constructor() {
    // lets add one item by default
    this.todos = [{id:1,title:'title1',message:'message1',done:false}]
  }

  getTodos() {
    return this.todos;
  }

  addTodo(todo) {
    this.todos.push(todo)
  }
}

These todos are available for you during your offline session! :)

Then off to your Component, errors you have:

*

*Do not inject items to your constructor, constructor are for providers only

*You are mixing template-driven forms with reactive forms

*In your addTodo function you are referring to e.g this.items.id, but nowhere in your component there is an item
Okay, let's look at your form, here I changed your form to template driven, so remove FormGroup altogether. You also do not need two way binding. You can construct your form so that the object you get from your form is in the correct format, so that can be pushed to the todos as is. This you achieve in your form by using name attribute together with ngModel, which binds your form. The name attribute will become the key in the object, and of course the value you enter in your form, will become the corresponding value to your key. So your form would look like this:
<form #myForm="ngForm" (ngSubmit)="addTodo(myForm.value)">
  Id:
  <input name="id" ngModel />
  Titulo:
  <input name="title" ngModel />
  Mensagem:
  <input name="message" ngModel />
  <button type="submit">Salvar</button>
</form>

This produces (myForm.value) an object like:
{
  "id": "",
  "title": "",
  "message": ""
}

...when it's empty. Here you also have one more property done in your object, so upon submit, before pushing this new todo in your array, let's add that property key:
addTodo(value) {
  // push the missing value to object
  value.done = false;
  // call method in service to save the new todo
  this.storageService.save(value)
  // update the list of todos
  this.todos = this.storageService.getTodos();
}

Please do read about Angular from the official docs, they have quite good tutorials. Based on the code you have here, please look at Services, which uses local mockdata, just as you want to do. Also look at Forms, difference between template-driven and model-driven forms!
Just as a bonus, here is a Plunker to play with :)


text:
Q: Play 2.5.X: method current in object Play is deprecated: This is a static reference to application, use DI instead I'm new to PlayFramework.
Please give me a sample how to access Configuration parameters from my view. I'm using PlayFramework 2.5.3
Old way (@current is deprecated):
@current.configuration.getString("environment.param")

New way (as far as I understand, Configuration should be injected):
I know how to access it from controller.
@Inject() (val messagesApi: MessagesApi, configuration: Configuration)

How do I use it from my view?

A: Sadly there isn't much you can do about it. It is just how it is when DI was introduced to Play, not much was discussed in regard to templates. One possible solution could be:

*

*Inject Configuration in controller

*Send it as implicit to your view/template
class Application @Inject() (implicit val config: Configuration) extends Controller {

    def index = Action {
        Ok(views.html.index("foo"))
    }
}

And your template will look like:
@(myParam1: Any)(implicit config: Configuration)

Some HTML here @myParam1 @config.getString("environment.param")

I am totally aware that this somehow defeats the purpose of DI but this is just how it is right now.

A: Looks like there might be changes in 2.6.x or twirl 1.2.0
https://github.com/playframework/twirl/pull/100
https://www.playframework.com/documentation/2.6.x/ScalaTemplates#Template-constructor

A: In java, to read from application.conf in play 2.5, you should inject configuration in your controller as below:
public class HomeController extends Controller {
private Configuration configuration;

@Inject
public HomeController(Configuration configuration) {
    this.configuration = configuration;
}

public Result index() {
    String value = configuration.getString("key");
    System.out.println("value of key is " + key);
    return ok(value);
}

}
Because Configuration is a concrete class, binding it in Module class is not needed.
see also this discussion:
DI for java in play 2.5


text:
Q: The best way to assert pre-condition and post-condition of arguments and values in .NET? I have been thinking about design by contract lately and I was wondering what people think is the best way to assert pre-condition and post-condition of values in .NET?
i.e. validating argument values to a method.
Some people recommend Debug.Assert while others talk about using an if statement plus throwing an exception. What are the pros and cons of each?
What frameworks are available that you recommend?

A: Another option is Spec#.
Spec# is an extension of the object-oriented language C#.  It extends the type system to include non-null types and checked exceptions.  It provides method contracts in the form of pre- and postconditions as well as object invariants.

A: We'll eventually use Code Contracts when .NET 4.0 ships. However, in our production code right now we have had great success with a "Guard" class along with common way to generate exceptions.
For more details, see my post about this.

A: I prefer exceptions over asserts because if it's supposed to be that way and isn't, I want to know about it so I can fix it, and the coverage we get in debug mode is nowhere near real-life usage or coverage, so just using Debug.Assert doesn't do enough.
Using asserts means that you won't add bloat to your release code, but it means you only get to see when and why these contracts get broken if you catch them at it in a debug build.
Using exceptions means you get to see the contract breaking whenever it happens, debug or release, but it also means your release build contains more checks and code.
You could go with an inbetween approach and use Trace to trace out your pre and post conditions to some kind of application log, which you could use to debug problems. However, you'd need a way of harvesting these logs to learn what issues your users are encountering. THere is also the possibility of combing this with exceptions so you get exceptions for the more severe problems.
The way I see it though, is that if the contract is worth enforcing then its worth throwing an exception when it breaks. I think that's somewhat down to opinion and target application though. If you do throw exceptions, you probably want some form of incident reporting system that provides crash reports when raised exceptions are left unhandled.

A: You could have a look at the fluent framework at http://conditions.codeplex.com/
Its open source and free.

A: Spec# is the way to do it, which is a superset of C#. Now you have "Code Contracts", which is the language-agnostic version of Spec#, so now you can have code contracts in VB.NET, for example.


text:
Q: Getting input from URL using node.js I was given the following task:
define the route
GET /api/restaurants
This route must accept the numeric query parameters "page" and "perPage" as well as the string parameter "borough", ie: /api/restaurants?page=1&perPage=5&borough=Bronx.  It will use these values to return all "Restaurant" objects for a specific "page" to the client as well as optionally filtering by "borough", if provided.
my code is as follows
app.get('/api/restaurants/:page/:perPage/:borough', (req, res) =>{
  console.log("worked")
  console.log(req.params.page)
  console.log(req.params.perPage)
  console.log(req.params.borough)
})

now here is the issue i m encountering, the route works fine if i enter the url in the following format
http://localhost:8000/api/restaurants/1/5/Bronx
however it doesn't work when using the format the instructor requires
http://localhost:8000/api/restaurants?page=1&perPage=5&borough=Bronx
I get "Cannot GET /api/restaurants", if anyone could please shed some light on what i m doing wrong i would appreciate it.

A: I think you're confusing route parameters and query parameters. (They are not the same.)
You can access query parameters on req.query:
app.get('/api/restaurants', (req, res) => {
  console.log(req.query.page);
  console.log(req.query.perPage);
  console.log(req.query.borough);
});


text:
Q: How to find an element in a specified range in std::map? Is there an equivalent version of std::find(first, last) but for a std::map? I.e., is there a version of std::map's find method that searches for an element in a map, but restricting the search only to a specified [first, last) range? Ideally, the solution should be logarithmic in the size of [first, last).
From what I've seen, std::map::find itself doesn't support this functionality (it always searches the whole map).

A: You can use std::lower_bound, std::upper_bound or std::equal_range for that as std::map iterators and data in the map satisfy the requirement for those functions, though you should be aware that it will be less efficient than std::map::find() due to linear iterator increments.
From std::lower_bound documentation

The number of comparisons performed is logarithmic in the distance between first and last (At most log
  2(last - first) + O(1) comparisons). However, for non-LegacyRandomAccessIterators, the number of iterator increments is linear.

emphasis is mine.

A: If I understood the question correctly, std::map::lower_bound is exactly what you are looking for - it gives you the element which is not less than the key. And there is upper_bound as well for the other end.


text:
Q: Match system path with awk in if statement I am trying to catch if the file system was mounted on a directory tree with:
mount | awk '{ if ( $3 == /mnt/pxe ) print mounted }'
But the string is not catched even though mount exists. The mount command output is:
/home/olegs/infra/isos/test/archlinux-2020.02.01-x86_64.iso on /mnt/pxe type iso9660 (ro,relatime,nojoliet,check=s,map=n,blocksize=2048)

Regual expression match is also unsuccessful:
mount | grep pxe | awk '{ if ( $3 ~ /mnt/pxe ) print $3 }'

no match
mount | grep pxe | awk '{ if ( $3 ~ .mnt.pxe ) print $3 }'
awk: cmd. line:1: { if ( $3 ~ .mnt.pxe ) print $3 }
awk: cmd. line:1:             ^ syntax error

mount | grep pxe | awk '{ if ( $3 ~ \/mnt\/pxe ) print $3 }'
awk: cmd. line:1: { if ( $3 ~ \/mnt\/pxe ) print $3 }
awk: cmd. line:1:             ^ backslash not last character on line
awk: cmd. line:1: { if ( $3 ~ \/mnt\/pxe ) print $3 }
awk: cmd. line:1:             ^ syntax error

Please suggest the right syntax to match only /mnt/pxe path to the $3 field.

A: You almost got it right, just use quotes for string comparisons:
mount | awk '{ if ( $3 == "/mnt/pxe" ) print "mounted" }'

Please note that "mounted" is also enclosed in quotes.
However, if you prefer to use regular expressions, just remember to  start and end them with a slash:
mount | awk '{ if ( $3 ~ /.mnt.pxe/ ) print "mounted" }'
mount | awk '{ if ( $3 ~ /\/mnt\/pxe/ ) print "mounted" }'
mount | awk '{ if ( $3 ~ /^\/mnt\/pxe$/ ) print "mounted" }' #For exact match


text:
Q: Detect SMB1 version via powershell for all OSes My workflow:

*

*check if server is pingable

*find if they are domain connected or not and perform a task accordingly. if Operating system 2012 and/or R2 ,2016 or 2019 newer OSes then I will run Get-SmbServerConfiguration cmdlet.  if machine is not a part of default domain then else block will run.

*if Operating system 2003 or 2008 oldest OSes then I will run Get-Wmi cmdlet.  if machine is not a part of default domain then else block will run.

Finally , I will concentanate $results variable.
My question is :
1- How can we get remotely regedit value for 2003 or 2008 oldest OSes IS NOT a part of default domain insie else block?
Also ,  Condition will be like below.
 if SMB1 value is "0" then result will be `false`
 if SMB1 value is "1" then result will be `true`
 if SMB1 value is not exist then result will be `not exist value`

2-  How can I create object properties $SMBAudit variable ? because , I will concentanate all outputs inside $results variable.
$reg = [wmiclass]"\\$computer\root\default:StdRegProv"
$SMBAudit = $reg.GetStringValue($basekey, $subkey, $value).sValue

My desired output :
Computername,SMB1Enabled
Host01,True
Host02,False

I will write so far a script like below. but I am stucking somethings.
Script :
# Computer List
$allComputers = Get-Content .\path\to\computers.txt

read-host -assecurestring | convertfrom-securestring | out-file C:\mysecurestring_domain.txt

read-host -assecurestring | convertfrom-securestring | out-file C:\mysecurestring_local.txt

# Create empty array of results
$Results = @()

# Loop through computers
foreach($computer in $allComputers) {

        # check if server is pingable before running the query on the server
        if (Test-Connection $computer -Count 1 -Quiet) {

            Write-Host "`n`n$computer is online!" -BackgroundColor Green -ForegroundColor Black

        }
        if(Get-ADComputer -Filter {Name -eq $computer -and OperatingSystem -notlike '*Windows*Server*2003*' -and OperatingSystem -notlike '*Windows*Server*2008*'})
            {
        #"machine $_ is a part of default domain"
            # The command we want to run

            $username = "domain01\admin01"
$password = Get-Content 'C:\mysecurestring_domain.txt' | ConvertTo-SecureString
$cred = new-object -typename System.Management.Automation.PSCredential -argumentlist $username, $password
    $SMB = Invoke-Command -ComputerName $computer -Credential $cred -ScriptBlock {Get-SmbServerConfiguration | Select EnableSMB1Protocol }

    # Create properties
    $Properties = @{
        # Populate the properties "Computername" and "SMB1Enabled" with variables
        Computername = $Computer
        SMB1Enabled = $SMB.EnableSMB1Protocol

    }
    # Add the properties to the result for each object
    $Results += New-Object psobject -Property $Properties

        }
        else
        {
        #"machine $_ IS NOT a part of default domain"

                    $username = "localadmin01"
$password = Get-Content 'C:\mysecurestring_local.txt' | ConvertTo-SecureString
$cred = new-object -typename System.Management.Automation.PSCredential -argumentlist $username, $password
            $SMB = Invoke-Command -ComputerName $computer -Credential $cred -ScriptBlock {Get-SmbServerConfiguration | Select EnableSMB1Protocol }

    # Create properties
    $Properties = @{
        # Populate the properties "Computername" and "SMB1Enabled" with variables
        Computername = $Computer
        SMB1Enabled = $SMB.EnableSMB1Protocol

    }
    # Add the properties to the result for each object
    $Results += New-Object psobject -Property $Properties

        }

        # Oldest OSes

        if(Get-ADComputer -Filter {Name -eq $computer -and OperatingSystem -notlike '*Windows*Server*2012*' -and OperatingSystem -notlike '*Windows*Server*2016*' -and OperatingSystem -notlike '*Windows*Server*2019*'})
            {
        #"machine $_ is a part of default domain"
            # The command we want to run
          <# HKEY_CLASSES_ROOT (2147483648 (0x80000000))
 HKEY_CURRENT_USER (2147483649 (0x80000001))
 HKEY_LOCAL_MACHINE (2147483650 (0x80000002))
 HKEY_USERS (2147483651 (0x80000003))
 HKEY_CURRENT_CONFIG (2147483653 (0x80000005))
 #>

        $basekey  = [uint32]'0x80000002'
$subkey   = 'SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters'
$value    = 'SMB1'

$reg = [wmiclass]"\\$computer\root\default:StdRegProv"
$SMBAudit = $reg.GetStringValue($basekey, $subkey, $value).sValue

        }
        else
        {
        #"machine $_ IS NOT a part of default domain"

}

# Output
$Results | Select-Object Computername, SMB1Enabled | Out-File -Filepath c:\temp\smb1-computers.txt

A: I think you are over complicating this and although not tested by me, you could try this:
# Computer List
$allComputers = Get-Content '.\path\to\computers.txt'

# get credentials for domain-joined machines and for local machines
$domainCred = Get-Credential -UserName "domain01\admin01" -Message "Please enter the DOMAIN password"
$localCred  = Get-Credential -UserName "localadmin01" -Message "Please enter the LOCAL password"

# loop through the list of computers and collect output in variable $Results
$Results = foreach($computer in $allComputers) {
    # check if server is pingable before running the query on the server
    if (Test-Connection -ComputerName $computer -Count 1 -Quiet) {
        Write-Host "$computer is online!" -BackgroundColor Green -ForegroundColor Black

        $server = Get-ADComputer -Filter "Name -eq '$computer'" -Properties OperatingSystem -ErrorAction SilentlyContinue
        # if domain joined, use $domainCred, otherwise $localCred
        if ($server) {
            $cred    = $domainCred
            $version = ([regex]'Windows Server (\d+)').Match($server.OperatingSystem).Groups[1].Value
        }
        else {
            $cred    = $localCred
            $info    = Get-WmiObject -ComputerName $computer -Credential $cred -Class Win32_OperatingSystem
            $version = ([regex]'Windows Server (\d+)').Match($info.Caption).Groups[1].Value
        }
        if ($version -eq '2003') {
            # try reading the registry
            try {
                $RegBase = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('LocalMachine', $Computer)
                $RegKey  = $RegBase.OpenSubKey("SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters")
                $SMB     = $RegKey.GetValue("SMB1")
                [PsCustomObject]@{ ComputerName = $computer; SMB1Enabled = ($null -eq $SMB -or [int]$SMB -eq 1) }
            }
            catch {
                [PsCustomObject]@{ ComputerName = $computer; SMB1Enabled = 'Could not read Remote Registry' }
            }
            finally {
                if ($RegBase) { $RegBase.Close() }
                if ($RegKey)  { $RegKey.Close() }
            }
        }
        elseif ($version -eq '2008') {
            # Older OS
            try {
                # try via WinRM
                $SMB = Invoke-Command -ComputerName $computer -Credential $cred -ScriptBlock {
                            Get-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters' -Name SMB1
                       } -ErrorAction Stop
                # output an object
                [PsCustomObject]@{ ComputerName = $computer; SMB1Enabled = ($null -eq $SMB -or [int]$SMB -eq 1) }
            }
            catch {
                # try reading the registry
                try {
                    $RegBase = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('LocalMachine', $Computer)
                    $RegKey  = $RegBase.OpenSubKey("SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters")
                    $SMB     = $RegKey.GetValue("SMB1")
                    [PsCustomObject]@{ ComputerName = $computer; SMB1Enabled = ($null -eq $SMB -or [int]$SMB -eq 1) }
                }
                catch {
                    [PsCustomObject]@{ ComputerName = $computer; SMB1Enabled = 'Could not read Remote Registry' }
                }
                finally {
                    if ($RegBase) { $RegBase.Close() }
                    if ($RegKey)  { $RegKey.Close() }
                }
            }
        }
        else {
            # Newer OS
            $SMB = Invoke-Command -ComputerName $computer -Credential $cred -ScriptBlock { Get-SmbServerConfiguration | Select-Object EnableSMB1Protocol }
            # output an object
            [PsCustomObject]@{ ComputerName = $computer; SMB1Enabled = $SMB.EnableSMB1Protocol }
        }
    }
    else {
        Write-Warning "Computer $computer is off-line"
        # output an object anyway, so that in the CSV it is known that the computer didn't ping
        [PsCustomObject]@{ ComputerName = $computer; SMB1Enabled = 'Off-Line' }
    }
}

# Output on screen
$Results | Format-Table -AutoSize

# Output to CSV file
$Results | Export-Csv -Path 'c:\temp\smb1-computers.csv' -NoTypeInformation -UseCulture


text:
Q: python os.system: syntax error near unexpected token `(' - nested parentheses I've read that I can put bash parentheses in quotes when submitting the command from python.  In this case, I'm trying to create key and csr for openssl using a command that works on the shell, but not when executed from python.  I've tried several combinations, but keep running into additional issues.
The following python command fails:
import os

os.system('openssl req -nodes -newkey rsa:2048 -sha256 -keyout mynode.key -out mynode.csr -subj "/C=US/ST=Florida/L=St Petersburg/O=MyCompany/OU=MyOU/CN=mynode/emailAddress=administrators@my.com" -reqexts OPTS -config <(cat /etc/pki/tls/openssl.cnf <(printf "[OPTS]\  basicConstraints = CA:FALSE  subjectAltName = DNS:mynode,DNS:myf5  keyUsage = digitalSignature, keyEncipherment  extendedKeyUsage = serverAuth, clientAuth"))')

The underlying openssl command succeeds:
openssl req -nodes -newkey rsa:2048 -sha256 -keyout mynode.key -out mynode.csr -subj "/C=US/ST=Florida/L=St Petersburg/O=MyCompany/OU=MyOU/CN=mynode/emailAddress=administrators@my.com" -reqexts OPTS -config <(cat /etc/pki/tls/openssl.cnf <(printf "[OPTS]\  basicConstraints = CA:FALSE  subjectAltName = DNS:mynode,DNS:myf5  keyUsage = digitalSignature, keyEncipherment  extendedKeyUsage = serverAuth, clientAuth"))

This must be something simple, but the answer eludes me.

A: <(…) is process substitution, which exists in bash (and ksh and zsh) but not in plain sh. The system function invokes sh, not bash.
You can use a pipe instead of the process substitution onto openssl, and simplify the nested process substitution into a simple sequence of commands.
{ cat /etc/pki/tls/openssl.cnf;
  printf "[OPTS]\  basicConstraints = CA:FALSE  subjectAltName = DNS:mynode,DNS:myf5  keyUsage = digitalSignature, keyEncipherment  extendedKeyUsage = serverAuth, clientAuth";
} | openssl req -nodes -newkey rsa:2048 -sha256 -keyout mynode.key -out mynode.csr -subj "/C=US/ST=Florida/L=St Petersburg/O=MyCompany/OU=MyOU/CN=mynode/emailAddress=administrators@my.com" -reqexts OPTS -config -

(line breaks optional)

A: Thanks for the responses.  I thought about it a bit and decided to look for a python-native way to do it.  There was enough information at the python cryptography cheatsheet website and others that I was able to put together the python code to generate the CSR.
requires pyOpenSSL

from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import serialization
from cryptography.hazmat.primitives.asymmetric import rsa
key = rsa.generate_private_key(
public_exponent=65537,
key_size=2048,
backend=default_backend())

with open('mycert.key', 'wb') as f:
     f.write(key.private_bytes(
     encoding=serialization.Encoding.PEM,
     format=serialization.PrivateFormat.TraditionalOpenSSL,
     encryption_algorithm=serialization.NoEncryption()))

from OpenSSL import crypto

# load private key
ftype = crypto.FILETYPE_PEM
with open('mycert.key', 'rb') as f: key = f.read()
key = crypto.load_privatekey(ftype, key)
req    = crypto.X509Req()

alt_name  = [ b"DNS:mynode",
              b"DNS:myF5",
              b"email:administratore@email.com" ]
key_usage = [ b"Digital Signature",
              b"Key Encipherment" ]
key_usage = [ b"digitalSignature",
              b"keyEncipherment" ]
ext_key_usage = [ b"serverAuth",
                  b"clientAuth" ]

# country (countryName, C)
# state or province name (stateOrProvinceName, ST)
# locality (locality, L)
# organization (organizationName, O)
# organizational unit (organizationalUnitName, OU)
# common name (commonName, CN)

req.get_subject().C  = "US"
req.get_subject().ST = "Florida"
req.get_subject().L  = "St Petersburg"
req.get_subject().O  = "myCompany"
req.get_subject().OU = "MyOU"
req.get_subject().CN = "mynode"
req.add_extensions([
    crypto.X509Extension( b"basicConstraints",
                          False,
                          b"CA:FALSE"),
    crypto.X509Extension( b"keyUsage",
                          False,
                          b",".join(key_usage)),
    crypto.X509Extension( b"subjectAltName",
                          False,
                          b",".join(alt_name))
])

req.set_pubkey(key)
req.sign(key, "sha256")

csr = crypto.dump_certificate_request(ftype, req)
with open("mycert.csr", 'wb') as f: f.write(csr)


text:
Q: Can I review pending edits?
Possible Duplicate:
How do suggested edits work?

Is there an area to review pending suggested edits from users with less than 2k reputation? As far as I know, I have to visit a question directly to even confirm that it has a pending edit.
Sometimes when using the Review site, I want to review edits, but there is no edit review tool; consequentially, I would have to resort to clicking every link on the main page until I came across pending edits if I were that determined.
This seems like it should be a common question, but I can't seem to find a similar question. In my missing privileges, I see Moderator Tools, attainable at 10k reputation, but from the description on that page, whether an edit review tool is included seems ambiguous. And I doubt that a list of suggested edits would be restricted to 10k users when approval votes are given to 2k users.

A: as Paŭlo said:

Look here: https://stackoverflow.com/review/suggested-edits . If this works for you, you are allowed, otherwise you will have to wait until 10k reputation.

Reviewing all pending suggested edits is one of the 10k user rep privileges.

A: Yes, there is a way (although somewhat tedious) to review pending edits even with less than 10,000 reputation points or when not having the Heart of Gold nearby.

*

*Find the end of the edit queue. Use https://stackoverflow.com/suggested-edits/X, where X is an integer. If X is past the end, the result will be "Page Not Found" and if not, "Suggested Edit". Do a binary search to find it. On 2011-06-14 the end of the queue was https://stackoverflow.com/suggested-edits/60511 and on 2011-07-04T02:09:00+02 it was https://stackoverflow.com/suggested-edits/70489.

*Find suggested edits not approved or rejected (pending) by lowering the ID number, for example, 70488, 70487, 70486, etc. When one is found, click the link on the top of the page to open the post and take part in the approval process.


text:
Q: Compound events: pick cards at random Every card holds one of these letters: M,A,T,H,E,M,A,T,I,C,S.
What is the probability of picking an M card at random, without replacement, and then an A card,at random, without looking?

*

*My answer is $2/55$, but I want to know how you solve it from your own perspective?

*What could the phrase "without replacement" mean ($2$ events can not exchange their order,...)?

Thanks a lot!

A: Phrase "without replacement" means the card that's been picked is not going back into the pile. Probability of picking M first is $2 \over 11$ and probability to pick A afterwards is $2 \over 10$ (only $10$ cards left) so your answer is correct. If it was "with replacement", the probability to pick A would have been $2 \over 11$.


text:
Q: Spring MVC - A way to dump unknown parameters of RequestBody into Map variable? I have the set up like below.
public class TestController {
  @RequestMapping(method = RequestMethod.POST, value = "/test")
  public void readQuery(@RequestBody Query query) {
  }
}

public class Query {
  private String foo;
  private String bar;
  private Map<String,String> other;
}

I'd like to be able to post a json object like:
{
  "foo":"1",
  "bar":"2",
  "x":"3",
  "y":"4"
}

And have spring automatically populate foo and bar into the query's foo and bar variables, and any undefined parameters into the other mapping (so in this case other would contain x-->3 and y-->4). Is such a thing configurable? My current temp work around is to replace @RequestBody Query query with @RequestBody Map<String,String> mapping and iterate over the mapping and read the variables into my Query object. I'd love to be able to get rid of a tedious step like this.

A: As I commented earlier, here is an example to do what you want.
Create a custom deserializer:
public class QueryDeserializer extends JsonDeserializer<Query> {

    @Override
    public Query deserialize(JsonParser jp, DeserializationContext ctxt)
            throws IOException {

        JsonNode node = jp.getCodec().readTree(jp);

        Iterator<Entry<String, JsonNode>> nodeIterator = node.fields();

        Query query = new Query();
        Map<String, String> other = new HashMap<>();

        while (nodeIterator.hasNext()) {
            Map.Entry<String, JsonNode> entry = nodeIterator.next();
            Field field = getField(entry.getKey());

            if (field != null) {
                try {
                    field.set(query, entry.getValue().textValue());
                } catch (IllegalAccessException e) {
                    e.printStackTrace();
                }
            } else {
                other.put(entry.getKey(), entry.getValue().textValue());
            }
        }

        if (other.size() != 0) {
            query.setOther(other);
        }

        return query;
    }

    public static Field getField(String entryName) {
        for (Field field : Query.class.getDeclaredFields()) {
            field.setAccessible(true);
            String fieldName;
            if (field.isAnnotationPresent(JsonProperty.class)) {
                fieldName = field.getAnnotation(JsonProperty.class).value();
            } else {
                fieldName = field.getName();
            }
            if (entryName.equalsIgnoreCase(fieldName)) {
                return field;
            }
        }
        return null;
    }
}

Register the deserializer:
@JsonDeserialize(using = QueryDeserializer.class)
public class Query {
...
}

Now when you use it in a controller like below, Spring will automatically use your deserializer to build the object as you want:
@RequestMapping(value = "/test", method = RequestMethod.PUT)
public String test(@RequestBody Query query) {}

A: Partial mapping won't work. There may be a workaround, but the much easier way would be to introduce a wrapper Object and change your json object:
{
 "foo":"1",
 "bar":"2",
 "other":{
   "x":"3",
   "y":"4"
 }
}


text:
Q: Java syntax error on token.... Identifier expected after this token I am getting Java

Syntax error on token "callMe", Identifier expected after this token

on below line of my program:
c1.callMe();

class Class2 {
    Class1 c1 = new Class1();
    c1.callMe();
}

public class Class1 {
    public void callMe() {
        System.out.println("I am called!!");
    }
}

A: Here is how you write classes correctly in Java :)
class Class2 {
    Class1 c1 = new Class1();
    public void callMe(){
        c1.callMe();
     }
}
public class Class1 {
    public void callMe() {
        System.out.println("I am called!!");
    }
}

A: Class1 c1 = new Class1();
c1.callMe();

Must be moved to a method, it can't be at the class definition level, else it makes no sense (when would your code be executed??):
public class Class2 {
    public void doSomething() {
        Class1 c1 = new Class1();
        c1.callMe();
    }
}

A: Add Main method and re-arrange your code:
public class Class2 {
    public static void main(String[] args) {
        Class1 c1 = new Class1();
        c1.callMe();
    }
}
class Class1 {
    void callMe(){
    System.out.println("I am called!!");
   }
}


text:
Q: aggregating columns based on commas I have the following dataframe and I'm trying to separate the commas and turn that particular name(s) into their own individual columns and specify if that particular column names exist (which are separated by commas) for that particular ID. (1 = Yes, 0 = No) Any help would be appreciated! Thanks!
ID<- c(1,2,3,4,5,6)
Details<- c("V1,V2", "V1,V3", "V1", "V2", "V3,V4", "V2,V3" )

data.frame <- data.frame(ID, Details, stringsAsFactors=FALSE)

DESIRED OUTPUT:
ID<-c(1,2,3,4,5,6)
V1<-c(1,1,1,0,0,0)
V2<-c(1,0,0,1,0,1)
V3<-c(0,1,0,0,1,1)
V4<-c(0,0,0,0,1,0)

data.frame1<-data.frame(ID, V1, V2, V3, V4, stringsAsFactors=FALSE)

A: A solution using the tidyverse package. dat is your example data frame. dat2 is the final data frame.
library(tidyverse)

dat2 <- dat %>%
  separate_rows(Details) %>%
  mutate(Value = 1L) %>%
  spread(Details, Value, fill = 0L)
dat2
#   ID V1 V2 V3 V4
# 1  1  1  1  0  0
# 2  2  1  0  1  0
# 3  3  1  0  0  0
# 4  4  0  1  0  0
# 5  5  0  0  1  1
# 6  6  0  1  1  0

A: One option with mtabulate from qdapTools
library(qdapTools)
cbind.data.frame(ID, # or data.frame$ID
                 mtabulate(strsplit(as.character(data.frame$Details), ",")))
# output
  ID V1 V2 V3 V4
1  1  1  1  0  0
2  2  1  0  1  0
3  3  1  0  0  0
4  4  0  1  0  0
5  5  0  0  1  1
6  6  0  1  1  0

A: Here is a base R solution. I have renamed your data.frames data1 and data2.
data1 <- data.frame(ID, Details, stringsAsFactors=FALSE)
data2 <- data.frame(ID, V1, V2, V3, V4, stringsAsFactors=FALSE)

nms <- unique(unlist(strsplit(data1$Details, ",")))
data3 <- cbind.data.frame(ID, sapply(nms, grepl, data1$Details))
data3[-1] <- lapply(data3[-1], as.integer)

Now compare data3 with your expected result data2.
all.equal(data2, data3)
#[1] TRUE

Note, however, that
identical(data2, data3)
#[1] FALSE

This is because I have used as.integer and the values in data2 are of class "numeric". If this makes a difference, you can change the lapply instruction above to use as.numeric.

A: using base R:
 xtabs(val~.,cbind.data.frame(ID=rep(ID,lengths(s<-strsplit(Details,","))),Details=unlist(s),val=1))
   Details
ID  V1 V2 V3 V4
  1  1  1  0  0
  2  1  0  1  0
  3  1  0  0  0
  4  0  1  0  0
  5  0  0  1  1
  6  0  1  1  0

A: The most straightforward way I see is to would be to build a data.frame for each of these vectors hidden in strings and bind them. purrr can help to make it quite compact. Note that column ID isn't needed, I'll work on Details directly.
library(purrr)
df <- map_dfr(strsplit(Details, ","),
              ~data.frame(t(setNames(rep(1, length(.x)), .x))))
df[is.na(df)] <- 0

#   V1 V2 V3 V4
# 1  1  1  0  0
# 2  1  0  1  0
# 3  1  0  0  0
# 4  0  1  0  0
# 5  0  0  1  1
# 6  0  1  1  0

You could also split and unlist to get distinct values, and then look them up in the original vector:
unique_v <- unique(unlist(strsplit(Details, ",")))
map_dfc(unique_v, ~as.numeric(grepl(.x, Details)))
# # A tibble: 6 x 4
#      V1    V2    V3    V4
#   <dbl> <dbl> <dbl> <dbl>
# 1     1     1     0     0
# 2     1     0     1     0
# 3     1     0     0     0
# 4     0     1     0     0
# 5     0     0     1     1
# 6     0     1     1     0

We could do some dirty string evaluation also if you know the number of columns:
m <- as.data.frame(matrix(0,ncol=4,nrow=6))
eval(parse(text=paste0("m[",ID,", c(",gsub("V","",Details),")] <- 1")))
#   V1 V2 V3 V4
# 1  1  1  0  0
# 2  1  0  1  0
# 3  1  0  0  0
# 4  0  1  0  0
# 5  0  0  1  1
# 6  0  1  1  0


text:
Q: Putting sheaves to work for algebraic topology? This is cross-posted from math.se after receiving points and no answers. I apologise if this question is too basic for MathOverflow.
I'm refreshing my memory of covering space theory, and this time around, I know some sheaf theory. It feels like arguments are used to prove results about covering spaces, such as uniqueness of lifts, having something "sheafy" about them.
For example, to prove uniqueness of lifts, we argue by trying to extend "equality at a point" to "equality over a neighbourhood" to "equality over the entire domain". It seems like the language of sheaves may make this clearer?
Similarly, when it comes to covering spaces, there is something "etale-like" about them. Is there a reference that expands on this perspective?

A: For sufficiently nice topological spaces $X$ (e.g., locally connected for the last two categories to be equivalent, and semilocally simply connected and locally path-connected for all three to be equivalent), the following three categories are equivalent:

*

*Functors from the fundamental groupoid of $X$ to the category of sets;

*Covering spaces over $X$;

*Locally constant sheaves of sets on $X$.
This is an extremely primitive baby version of the Riemann–Hilbert correspondence.
References specifically for this elementary case are sparse,
but there is an extensive discussion on locally constant sheaves at the nCafé.


text:
Q: R - RStudio hangs/crashes creating double-precision large numeric vector I have a numeric vector of 500 values that I'm trying to load into R to do some graphical calculations and displays, and every time I try my client hangs/crashes (RStudio). The system doesn't immediately crash, but hangs indefinitely with a plus sign "+" in the console following the closing parenthesis of my assign statement, like this:
..., 108.00968, 27.14654, 80.60948)
+

Normally you can recover from this kind of "waiting for more info" state by hitting the escape key, which drops the console back into input mode with a cursor. However, with in this situation it produces a crash (Windows "X program has stopped working" message). No error messages are displayed in the R console. I checked to make sure I'm closing the final parentheses and am actually copy-pasting the first part of the code between lines that work and don't work so they should be syntactically identical, which hopefully eliminates any potential for this to be caused by typo errors (exact code at end of post). This leads me to believe that the behavior I'm seeing is caused by the size/quantity/type of the numbers.
From what I understand and can find online relating to vector sizes there isn't a "max size" in R, but if I try to even do something as simple as create the vector then I get a crash. I can load a limited number of them (like 160), but 500 is apparently too many.
Some example values I'm trying to load:
outvals <- c(0.794933476174234, 3.5128642241260697, 10.28598660205886, 31.027889828462865)

These numbers are double-precision values outputted from another program in Java and so they have a large number of digits after the decimal and sometimes they output with E notation, which I'm not sure if R accepts, so at first I thought this could be a potential cause, even though I hadn't seen any E's in my quick scan of the data. My first attempt to solve this was to convert my output to have only 5 digits after the decimal, which still caused the same hang/crash behavior when I had 500 elements. Example values:
outvals <- c(.60791, 1.41808, 2.67098, 64.52197, 75.09749, 140.1268, 187.34739, 52.6446)

Eventually, I got this to successfully load with no hanging/crashing when I reduced the post-decimal significant digits to 2 (or when I reduced the number of elements in the vector) but I'm losing a great deal of precision and I don't think splitting my vector into 4 or 5 parts is an acceptable solution. Thankfully, the loss of precision is not an absolute deal breaker at this point, but I'm wondering what the best way is to use values with a large number of decimal places. I don't think 500 is that large of a vector and 5 decimal places isn't that many places, so there should be a way to do this. Do I need to read the input from a file instead of directly putting the values in the .R file? Is R just not able to handle large numbers of significant digits? Or is this just an RStudio problem and I need to go into command-line R (assuming this is possible) or use a different client?
Exact lines that I'm running when I get these errors (note, these are looooong):
#these two work
outvals <- c(.79, .74, 1.82, 52.2, 8.28, 19.81, 152.19, 27.57, 8.58, 8.94, 253.48, 132.49, 46.95, 258.61, 290.66, 149.3, 130.05, 355.48, 574.56, 382.83, 482.18, 218.08, 335.23, 290.66, 382.83, 498.58, 402.39, 482.18, 193.75, 417.4, 218.08, 402.39, 141.74, 402.39, 402.39, 315.86, 498.58, 290.66, 218.08, 498.58, 417.4, 355.48, 166.87, 218.08, 54.74, 258.61, 376.89, 258.61, 376.89, 166.87, 66.88, 475.09, 218.08, 168.18, 55.84, 382.83, 355.48, 482.18, 218.08, 382.83, 376.89, 245.65, 498.58, 355.48, 253.48, 355.48, 335.23, 290.66, 335.23, 335.23, 308.35, 245.65, 144.95, 253.48, 355.48, 355.48, 376.89, 498.58, 128.06, 166.87, 482.18, 498.58, 335.23, 355.48, 308.35, 376.89, 382.83, 355.48, 258.61, 258.61, 218.08, 258.61, 218.08, 144.95, 258.61, 206.9, 53.3, 218.08, 355.48, 42.07, 258.61, 106.65, 193.75, 376.89, 376.89, 258.61, 417.4, 355.48, 56.6, 258.61, 498.58, 100.65, 193.75, 131.62, 138.27, 24.88, 131.62, 315.86, 148.55, 417.4, 382.83, 77.4, 206.9, 218.08, 308.35, 112.75, 355.48, 376.89, 417.4, 475.09, 66.88, 132.49, 482.18, 126.63, 144.95, 475.09, 382.83, 218.08, 308.35, 138.27, 303.44, 245.65, 355.48, 355.48, 355.48, 179.4, 315.86, 350.74, 498.58, 482.18, 417.4, 482.18, 141.74, 417.4, 417.4, 482.18, 206.9, 382.83, 498.58, 141.74, 482.18, 382.83, 290.66, 417.4, 498.58, 18.72, 290.66, 222.31, 475.09, 193.76, 144.95, 209.94, 132.49, 193.75, 141.74, 382.83, 144.95, 179.4, 141.74, 112.75, 185.55, 212.05, 498.58, 138.27, 290.66, 218.08, 482.18, 355.48, 482.18, 303.44, 482.18, 40.71, 144.95, 417.4, 350.74, 258.61, 218.08, 290.66, 140.8, 355.48, 382.83, 382.83, 303.44, 417.4, 149.3, 335.23, 131.62, 482.18, 335.23, 117.68, 475.09, 236.95, 95.89, 94.67, 193.75, 355.48, 355.48, 355.48, 209.94, 308.35, 100.65, 417.4, 382.83, 222.31, 253.48, 193.75, 482.18, 132.49, 112.75, 315.86, 498.58, 417.4, 290.66, 209.94, 376.89, 315.86, 402.39, 335.23, 253.48, 130.05, 130.05, 308.35, 315.86, 149.3, 417.4, 141.74, 475.09, 402.39, 149.3, 482.18, 152.19, 498.58, 117.68, 417.4, 209.94, 355.48, 193.76, 498.58, 258.61, 236.95, 308.35, 382.83, 498.58, 402.39, 417.4, 382.83, 209.94, 290.66, 104.92, 149.3, 209.94, 382.83, 102.12, 417.4, 218.08, 417.4, 149.3, 382.83, 185.55, 258.61, 218.08, 382.83, 166.87, 290.66, 382.83, 417.4, 355.48, 350.74, 308.35, 123.19, 308.35, 417.4, 335.23, 482.18, 258.61, 258.61, 193.75, 402.39, 206.9, 290.66, 402.39, 475.09, 132.49, 303.44, 382.83, 100.65, 382.83, 355.48, 56.95, 355.48, 482.18, 193.76, 218.08, 218.08, 290.66, 402.39, 131.62, 290.66, 141.74, 382.83, 149.3, 193.75, 74.45, 258.61, 209.94, 355.48, 179.4, 417.4, 315.86, 168.18, 218.08, 144.95, 382.83, 258.61, 308.35, 482.18, 56.6, 482.18, 245.65, 36.24, 209.94, 253.48, 206.9, 209.94, 382.83, 290.66, 303.44, 417.4, 482.18, 417.4, 193.76, 140.8, 179.4, 308.35, 498.58, 402.39, 482.18, 236.95, 290.66, 179.4, 47.97, 355.48, 382.83, 141.74, 355.48, 402.39, 355.48, 417.4, 350.74, 498.58, 218.08, 376.89, 218.08, 258.61, 141.74, 141.74, 417.4, 54.43, 212.05, 382.83, 206.9, 290.66, 417.4, 498.58, 350.74, 475.09, 152.19, 218.08, 417.4, 350.74, 222.31, 107.62, 236.95, 475.09, 382.83, 335.23, 121.63, 482.18, 245.65, 97, 355.48, 482.18, 144.95, 355.48, 193.75, 498.58, 107.62, 149.3, 402.39, 212.05, 350.74, 193.75, 218.08, 498.58, 355.48, 382.83, 382.83, 475.09, 158.05, 417.4, 417.4, 482.18, 417.4, 308.35, 308.35, 475.09, 417.4, 498.58, 315.86, 138.49, 258.61, 417.4, 245.65, 290.66, 88.81, 106.65, 350.74, 355.48, 54.43, 417.4, 475.09, 402.39, 290.66, 417.4, 132.49, 315.86, 498.58, 258.61, 193.75, 104.92, 382.83, 355.48, 253.48, 498.58, 206.9, 144.95, 475.09, 132.49, 335.23, 335.23, 144.95, 123.61, 308.35, 258.61, 355.48, 245.65, 148.55, 402.39, 290.66, 475.09, 83.26, 355.48, 315.86, 482.18, 402.39, 498.58, 355.48, 382.83, 245.65, 498.58, 475.09, 382.83, 132.49, 149.3, 88.81, 97, 179.4, 253.48, 290.66, 402.39, 131.62, 258.61, 350.74, 303.44, 290.66, 417.4, 144.95, 258.61, 218.08, 417.4)
#outvals2 <- c(0.794933476174234, 3.5128642241260697, 10.28598660205886, 1.2600302126171676, 31.027889828462865, 23.15000712709929, 58.729154521223705, 215.20432675441222, 579.464993879136, 63.513880162215074, 28.959698405287885, 209.63516732070275, 30.04782600303195, 227.43869446888698, 248.36596491018696, 104.73409955976528, 198.6342145598211, 209.63516732070275, 57.94793264204458, 19.270899100358694, 75.48241317584373, 57.24657127591748, 215.20432675441222, 63.513880162215074, 129.49784893861533, 129.49784893861533, 84.17040085625115, 76.70797460822122, 91.82036558044324, 129.49784893861533, 35.07397649759432, 236.36650346927524, 215.20432675441222, 209.63516732070275, 66.73838207163915, 91.82036558044324, 209.63516732070275, 319.3443889268936, 272.8438185545791, 198.6342145598211, 76.70797460822122, 227.43869446888698, 319.3443889268936, 50.68629607409348, 69.9802325820079, 292.3597033095136, 352.4353730767199, 154.26895025584872, 90.79642288841237, 209.63516732070275, 579.464993879136, 70.90044394183283, 67.67827698750271, 80.3650258687956, 35.2778346576937, 63.477432984723634, 129.49784893861533, 226.64891288273682, 56.78530609937027, 76.70797460822122, 66.06221851141238, 130.5794634173596, 482.3668721692566, 158.1826251421317, 319.3443889268936, 220.30424892054754, 72.01360115410559, 158.1826251421317, 47.664694805008445, 55.7433846988939, 226.64891288273682, 307.0681488517892, 72.01360115410559, 198.6342145598211, 248.36596491018696, 121.89181544023398, 495.3154941026644, 158.1826251421317, 227.43869446888698, 84.17040085625115, 248.36596491018696, 579.4649938791359, 209.63516732070275, 76.70797460822122, 130.5794634173596, 198.6342145598211, 190.64187081796223, 227.43869446888698, 236.36650346927524, 209.63516732070275, 126.66295614580373, 209.63516732070275, 292.3597033095136, 154.26895025584872, 209.63516732070275, 198.6342145598211, 307.0681488517892, 126.66295614580373, 226.64891288273682, 122.02855436204793, 227.43869446888698, 209.63516732070275, 482.3668721692566, 129.49784893861533, 111.00370932068954, 319.3443889268936, 41.037381109315845, 190.64187081796223, 272.8438185545791, 80.3650258687956, 40.936887639122496, 100.09035288521471, 154.26895025584872, 65.31566090651495, 75.48241317584373, 579.4649938791359, 168.39771099808507, 220.30424892054754, 190.64187081796223, 215.20432675441222, 495.3154941026644, 70.90044394183283, 90.79642288841237, 126.66295614580373, 168.39771099808507, 53.82899843425185, 236.36650346927524, 292.3597033095136, 319.3443889268936, 122.02855436204793, 31.210156250385943, 307.0681488517892, 579.4649938791359, 227.43869446888698, 579.4649938791359, 154.26895025584872, 111.00370932068954, 352.4353730767199, 319.3443889268936, 495.3154941026644, 352.4353730767199, 85.56443246095841, 69.9802325820079, 85.56443246095841, 65.31566090651495, 129.43115354241297, 154.26895025584872, 67.67827698750271, 198.6342145598211, 85.56443246095841, 226.64891288273682, 104.73409955976528, 236.36650346927524, 50.65492008278703, 272.8438185545791, 130.5794634173596, 38.54396326738687, 29.812250453066387, 220.30424892054754, 111.00370932068954)

#These ones don't
#outvals3 <- c(.60791, .44997, .79496, .90661, 1.41808, 2.67098, 3.94923, 75.09749, 75.09749, 40.59529, 64.52197, 64.52197, 75.09749, 140.1268, 187.34739, 110.56475, 179.12011, 111.78596, 131.68193, 146.97732, 52.6446, 28.93388, 165.7578, 140.1268, 186.67669, 131.68193, 185.64969, 224.62772, 137.45174, 224.62772, 130.69029, 117.98915, 56.91589, 95.70941, 118.18941, 229.36556, 117.98915, 187.34739, 175.21006, 187.34739, 224.62772, 175.21006, 75.09749, 172.9537, 185.64969, 165.7578, 186.67669, 146.34013, 115.12518, 95.70941, 66.03041, 172.9537, 235.59637, 157.02953, 94.07931, 143.56451, 167.97113, 143.30155, 146.34013, 108.00968, 224.62772, 374.0517, 255.67384, 88.4808, 195.44411, 191.25343, 185.64969, 130.69029, 374.0517, 167.97113, 179.12011, 429.30365, 106.67926, 151.07274, 117.98915, 143.56451, 111.78596, 382.77066, 130.69029, 50.83587, 172.9537, 143.30155, 286.65833, 172.9537, 256.44452, 198.71409, 255.67384, 235.59637, 179.12011, 167.97113, 187.34739, 140.1268, 40.59529, 58.9625, 374.0517, 224.62772, 255.67384, 80.60948, 166.80923, 166.80923, 118.88632, 93.83426, 68.8146, 256.44452, 255.67384, 118.88632, 67.68099, 560.65039, 453.68289, 382.77066, 198.71409, 154.11321, 185.51567, 327.81446, 327.81446, 374.0517, 224.62772, 117.98915, 453.68289, 140.1268, 327.81446, 198.71409, 185.64969, 110.56475, 453.68289, 151.07274, 382.77066, 93.83426, 187.34739, 167.97113, 51.39773, 453.68289, 560.65039, 42.86032, 327.81446, 186.67669, 255.67384, 187.34739, 185.64969, 382.77066, 166.80923, 185.64969, 286.65833, 187.34739, 560.65039, 120.29011, 165.7578, 274.4352, 104.55168, 185.51567, 274.4352, 327.81446, 185.64969, 89.11919, 195.44411, 198.71409, 191.25343, 69.95528, 195.44411, 256.44452, 185.64969, 140.1268, 110.56475, 382.77066, 327.81446, 198.71409, 117.98915, 93.83426, 70.55312, 157.02953, 198.71409, 186.67669, 98.36025, 198.71409, 327.81446, 224.62772, 115.12518, 382.77066, 186.67669, 164.3344, 118.88632, 224.62772, 30.92701, 185.51567, 327.81446, 186.67669, 151.07274, 374.0517, 198.71409, 54.92275, 255.67384, 151.07274, 185.51567, 185.51567, 374.0517, 224.62772, 106.67926, 255.67384, 186.67669, 185.64969, 453.68289, 406.21377, 382.77066, 256.44452, 151.07274, 110.56475, 69.72398, 120.29011, 198.71409, 382.77066, 560.65039, 143.56451, 274.4352, 50.05464, 40.59529, 104.55168, 164.3344, 172.9537, 172.9537, 143.56451, 374.0517, 198.71409, 67.68099, 94.07931, 255.67384, 453.68289, 82.03707, 198.71409, 50.05464, 327.81446, 166.80923, 198.71409, 130.69029, 106.67926, 382.77066, 167.97113, 120.29011, 157.02953, 165.99886, 453.68289, 382.77066, 224.62772, 374.0517, 88.4808, 327.81446, 327.81446, 72.37382, 88.4808, 406.21377, 77.09608, 224.62772, 374.0517, 179.12011, 327.81446, 120.29011, 143.56451, 256.44452, 195.44411, 88.01403, 186.67669, 187.34739, 143.30155, 406.21377, 560.65039, 256.44452, 77.09608, 115.12518, 164.3344, 54.06305, 185.64969, 166.80923, 235.59637, 172.9537, 198.71409, 165.7578, 191.25343, 165.7578, 164.3344, 255.67384, 77.09608, 72.95142, 382.77066, 67.16891, 172.9537, 64.52197, 560.65039, 327.81446, 77.38478, 429.30365, 198.71409, 120.29011, 560.65039, 186.67669, 255.67384, 560.65039, 179.12011, 88.4808, 255.67384, 560.65039, 286.65833, 165.99886, 157.02953, 256.44452, 274.4352, 286.65833, 47.97041, 97.24981, 151.07274, 157.02953, 80.60948, 69.72398, 255.67384, 58.9625, 165.99886, 75.19083, 198.71409, 224.62772, 453.68289, 453.68289, 154.11321, 560.65039, 93.83426, 117.98915, 286.65833, 185.64969, 165.99886, 54.06305, 429.30365, 122.23162, 94.07931, 187.34739, 429.30365, 382.77066, 140.1268, 179.12011, 120.29011, 235.59637, 374.0517, 255.67384, 164.3344, 195.44411, 327.81446, 256.44452, 185.51567, 82.03707, 185.51567, 560.65039, 191.25343, 166.80923, 560.65039, 186.67669, 95.95364, 120.29011, 191.25343, 327.81446, 185.51567, 191.25343, 224.62772, 51.39773, 151.07274, 172.9537, 255.67384, 406.21377, 406.21377, 235.59637, 166.80923, 235.59637, 187.34739, 111.78596, 93.83426, 256.44452, 186.67669, 286.65833, 235.59637, 274.4352, 172.9537, 143.56451, 154.11321, 255.67384, 255.67384, 166.80923, 255.67384, 187.34739, 165.99886, 88.4808, 453.68289, 198.71409, 235.59637, 286.65833, 560.65039, 69.95528, 191.25343, 110.56475, 59.89974, 327.81446, 187.34739, 185.64969, 172.9537, 560.65039, 235.59637, 195.44411, 286.65833, 256.44452, 224.62772, 274.4352, 429.30365, 122.23162, 185.64969, 143.30155, 96.39451, 185.51567, 195.44411, 274.4352, 274.4352, 286.65833, 157.02953, 374.0517, 374.0517, 167.97113, 256.44452, 57.85034, 82.03707, 286.65833, 186.67669, 172.9537, 255.67384, 143.56451, 75.19083, 185.51567, 453.68289, 151.07274, 167.97113, 143.30155, 115.12518, 256.44452, 286.65833, 429.30365, 256.44452, 255.67384, 130.69029, 255.67384, 374.0517, 256.44452, 79.08417, 111.78596, 382.77066, 185.51567, 111.78596, 80.60948, 406.21377, 165.7578, 255.67384, 96.39451, 7.34742, 382.77066, 191.25343, 166.80923, 98.36025, 167.97113, 429.30365, 179.12011, 224.62772, 69.15261, 186.67669, 172.9537, 43.36202, 57.0059, 88.01403, 68.8146, 382.77066, 140.1268, 286.65833, 88.01403, 198.71409, 186.67669, 115.12518, 274.4352, 165.99886, 453.68289, 166.80923, 164.3344, 191.25343, 429.30365, 172.9537, 224.62772, 143.56451, 88.01403, 104.55168, 151.07274, 453.68289, 115.12518, 130.69029, 198.71409, 255.67384, 166.80923, 374.0517, 255.67384, 108.00968, 27.14654, 80.60948)
#outvals4 <- c(0.794933476174234, 3.5128642241260697, 10.28598660205886, 1.2600302126171676, 31.027889828462865, 23.15000712709929, 58.729154521223705, 215.20432675441222, 579.464993879136, 63.513880162215074, 28.959698405287885, 209.63516732070275, 30.04782600303195, 227.43869446888698, 248.36596491018696, 104.73409955976528, 198.6342145598211, 209.63516732070275, 57.94793264204458, 19.270899100358694, 75.48241317584373, 57.24657127591748, 215.20432675441222, 63.513880162215074, 129.49784893861533, 129.49784893861533, 84.17040085625115, 76.70797460822122, 91.82036558044324, 129.49784893861533, 35.07397649759432, 236.36650346927524, 215.20432675441222, 209.63516732070275, 66.73838207163915, 91.82036558044324, 209.63516732070275, 319.3443889268936, 272.8438185545791, 198.6342145598211, 76.70797460822122, 227.43869446888698, 319.3443889268936, 50.68629607409348, 69.9802325820079, 292.3597033095136, 352.4353730767199, 154.26895025584872, 90.79642288841237, 209.63516732070275, 579.464993879136, 70.90044394183283, 67.67827698750271, 80.3650258687956, 35.2778346576937, 63.477432984723634, 129.49784893861533, 226.64891288273682, 56.78530609937027, 76.70797460822122, 66.06221851141238, 130.5794634173596, 482.3668721692566, 158.1826251421317, 319.3443889268936, 220.30424892054754, 72.01360115410559, 158.1826251421317, 47.664694805008445, 55.7433846988939, 226.64891288273682, 307.0681488517892, 72.01360115410559, 198.6342145598211, 248.36596491018696, 121.89181544023398, 495.3154941026644, 158.1826251421317, 227.43869446888698, 84.17040085625115, 248.36596491018696, 579.4649938791359, 209.63516732070275, 76.70797460822122, 130.5794634173596, 198.6342145598211, 190.64187081796223, 227.43869446888698, 236.36650346927524, 209.63516732070275, 126.66295614580373, 209.63516732070275, 292.3597033095136, 154.26895025584872, 209.63516732070275, 198.6342145598211, 307.0681488517892, 126.66295614580373, 226.64891288273682, 122.02855436204793, 227.43869446888698, 209.63516732070275, 482.3668721692566, 129.49784893861533, 111.00370932068954, 319.3443889268936, 41.037381109315845, 190.64187081796223, 272.8438185545791, 80.3650258687956, 40.936887639122496, 100.09035288521471, 154.26895025584872, 65.31566090651495, 75.48241317584373, 579.4649938791359, 168.39771099808507, 220.30424892054754, 190.64187081796223, 215.20432675441222, 495.3154941026644, 70.90044394183283, 90.79642288841237, 126.66295614580373, 168.39771099808507, 53.82899843425185, 236.36650346927524, 292.3597033095136, 319.3443889268936, 122.02855436204793, 31.210156250385943, 307.0681488517892, 579.4649938791359, 227.43869446888698, 579.4649938791359, 154.26895025584872, 111.00370932068954, 352.4353730767199, 319.3443889268936, 495.3154941026644, 352.4353730767199, 85.56443246095841, 69.9802325820079, 85.56443246095841, 65.31566090651495, 129.43115354241297, 154.26895025584872, 67.67827698750271, 198.6342145598211, 85.56443246095841, 226.64891288273682, 104.73409955976528, 236.36650346927524, 50.65492008278703, 272.8438185545791, 130.5794634173596, 38.54396326738687, 29.812250453066387, 220.30424892054754, 111.00370932068954)
#outvals5 <- c(0.794933476174234, 3.5128642241260697, 10.28598660205886, 1.2600302126171676, 31.027889828462865, 23.15000712709929, 58.729154521223705, 215.20432675441222, 579.464993879136, 63.513880162215074, 28.959698405287885, 209.63516732070275, 30.04782600303195, 227.43869446888698, 248.36596491018696, 104.73409955976528, 198.6342145598211, 209.63516732070275, 57.94793264204458, 19.270899100358694, 75.48241317584373, 57.24657127591748, 215.20432675441222, 63.513880162215074, 129.49784893861533, 129.49784893861533, 84.17040085625115, 76.70797460822122, 91.82036558044324, 129.49784893861533, 35.07397649759432, 236.36650346927524, 215.20432675441222, 209.63516732070275, 66.73838207163915, 91.82036558044324, 209.63516732070275, 319.3443889268936, 272.8438185545791, 198.6342145598211, 76.70797460822122, 227.43869446888698, 319.3443889268936, 50.68629607409348, 69.9802325820079, 292.3597033095136, 352.4353730767199, 154.26895025584872, 90.79642288841237, 209.63516732070275, 579.464993879136, 70.90044394183283, 67.67827698750271, 80.3650258687956, 35.2778346576937, 63.477432984723634, 129.49784893861533, 226.64891288273682, 56.78530609937027, 76.70797460822122, 66.06221851141238, 130.5794634173596, 482.3668721692566, 158.1826251421317, 319.3443889268936, 220.30424892054754, 72.01360115410559, 158.1826251421317, 47.664694805008445, 55.7433846988939, 226.64891288273682, 307.0681488517892, 72.01360115410559, 198.6342145598211, 248.36596491018696, 121.89181544023398, 495.3154941026644, 158.1826251421317, 227.43869446888698, 84.17040085625115, 248.36596491018696, 579.4649938791359, 209.63516732070275, 76.70797460822122, 130.5794634173596, 198.6342145598211, 190.64187081796223, 227.43869446888698, 236.36650346927524, 209.63516732070275, 126.66295614580373, 209.63516732070275, 292.3597033095136, 154.26895025584872, 209.63516732070275, 198.6342145598211, 307.0681488517892, 126.66295614580373, 226.64891288273682, 122.02855436204793, 227.43869446888698, 209.63516732070275, 482.3668721692566, 129.49784893861533, 111.00370932068954, 319.3443889268936, 41.037381109315845, 190.64187081796223, 272.8438185545791, 80.3650258687956, 40.936887639122496, 100.09035288521471, 154.26895025584872, 65.31566090651495, 75.48241317584373, 579.4649938791359, 168.39771099808507, 220.30424892054754, 190.64187081796223, 215.20432675441222, 495.3154941026644, 70.90044394183283, 90.79642288841237, 126.66295614580373, 168.39771099808507, 53.82899843425185, 236.36650346927524, 292.3597033095136, 319.3443889268936, 122.02855436204793, 31.210156250385943, 307.0681488517892, 579.4649938791359, 227.43869446888698, 579.4649938791359, 154.26895025584872, 111.00370932068954, 352.4353730767199, 319.3443889268936, 495.3154941026644, 352.4353730767199, 85.56443246095841, 69.9802325820079, 85.56443246095841, 65.31566090651495, 129.43115354241297, 154.26895025584872, 67.67827698750271, 198.6342145598211, 85.56443246095841, 226.64891288273682, 104.73409955976528, 236.36650346927524, 50.65492008278703, 272.8438185545791, 130.5794634173596, 38.54396326738687, 29.812250453066387, 220.30424892054754, 111.00370932068954, 579.4649938791359, 307.0681488517892, 121.89181544023398, 129.43115354241297, 236.36650346927524, 111.00370932068954, 292.3597033095136, 482.3668721692566, 70.90044394183283, 84.17040085625115, 209.63516732070275, 107.93708121135573, 220.30424892054754, 215.20432675441222, 154.26895025584872, 209.63516732070275, 220.30424892054754, 495.3154941026644, 111.00370932068954, 52.13578764785762, 158.1826251421317, 236.36650346927524, 44.27137951523684, 55.7433846988939, 129.49784893861533, 198.6342145598211, 236.36650346927524, 40.936887639122496, 130.5794634173596, 579.4649938791359, 102.36716674204195, 226.64891288273682, 209.63516732070275, 579.4649938791359, 272.8438185545791, 129.49784893861533, 24.176331515541015, 272.8438185545791, 21.65521216355967, 126.66295614580373, 80.3650258687956, 227.43869446888698, 190.64187081796223, 198.6342145598211, 226.64891288273682, 102.36716674204195, 319.3443889268936, 121.89181544023398, 53.82899843425185, 495.3154941026644, 227.43869446888698, 129.49784893861533, 69.9802325820079, 307.0681488517892, 198.6342145598211, 579.4649938791359, 319.3443889268936, 307.0681488517892, 24.176331515541015, 53.82899843425185, 248.36596491018696, 20.430141561245247, 307.0681488517892, 90.79642288841237, 579.4649938791359, 236.36650346927524, 198.6342145598211, 47.664694805008445, 126.66295614580373, 55.7433846988939, 168.39771099808507, 190.64187081796223, 129.43115354241297, 482.3668721692566, 307.0681488517892, 91.82036558044324, 75.48241317584373, 319.3443889268936, 91.82036558044324, 168.39771099808507, 65.31566090651495, 272.8438185545791, 154.26895025584872, 248.36596491018696, 45.34858148728487, 190.64187081796223, 35.25533585442108, 319.3443889268936, 168.39771099808507, 209.63516732070275, 495.3154941026644, 190.64187081796223, 66.06221851141238, 23.15000712709929, 129.49784893861533, 129.43115354241297, 579.4649938791359, 41.037381109315845, 227.43869446888698, 84.17040085625115, 63.477432984723634, 220.30424892054754, 292.3597033095136, 154.26895025584872, 70.90044394183283, 352.4353730767199, 579.4649938791359, 215.20432675441222, 76.70797460822122, 53.82899843425185, 84.17040085625115, 50.68629607409348, 495.3154941026644, 100.09035288521471, 65.31566090651495, 90.79642288841237, 75.48241317584373, 226.64891288273682, 190.64187081796223, 76.70797460822122, 154.26895025584872, 111.00370932068954, 45.34858148728487, 41.77956139467641, 352.4353730767199, 352.4353730767199, 319.3443889268936, 579.4649938791359, 220.30424892054754, 307.0681488517892, 74.31084452009584, 154.26895025584872, 236.36650346927524, 352.4353730767199, 292.3597033095136, 482.3668721692566, 130.5794634173596, 482.3668721692566, 226.64891288273682, 307.0681488517892, 319.3443889268936, 220.30424892054754, 272.8438185545791, 38.54396326738687, 116.14008922774948, 482.3668721692566, 482.3668721692566, 20.52255662588617, 154.26895025584872, 482.3668721692566, 80.3650258687956, 107.93708121135573, 579.4649938791359, 352.4353730767199, 236.36650346927524, 130.5794634173596, 579.4649938791359, 482.3668721692566, 248.36596491018696, 248.36596491018696, 70.90044394183283, 63.477432984723634, 495.3154941026644, 65.31566090651495, 482.3668721692566, 74.31084452009584, 236.36650346927524, 56.78530609937027, 129.49784893861533, 352.4353730767199, 129.43115354241297, 154.26895025584872, 91.82036558044324, 227.43869446888698, 227.43869446888698, 220.30424892054754, 220.30424892054754, 226.64891288273682, 47.29935033194551, 52.13578764785762, 292.3597033095136, 352.4353730767199, 319.3443889268936, 579.4649938791359, 38.54396326738687, 90.79642288841237, 352.4353730767199, 319.3443889268936, 482.3668721692566, 352.4353730767199, 198.6342145598211, 352.4353730767199, 63.513880162215074, 50.65492008278703, 319.3443889268936, 248.36596491018696, 215.20432675441222, 76.70797460822122, 292.3597033095136, 482.3668721692566, 56.78530609937027, 67.67827698750271, 90.79642288841237, 495.3154941026644, 248.36596491018696, 129.49784893861533, 80.3650258687956, 130.5794634173596, 190.64187081796223, 66.06221851141238, 236.36650346927524, 104.73409955976528, 319.3443889268936, 482.3668721692566, 272.8438185545791, 220.30424892054754, 292.3597033095136, 130.5794634173596, 198.6342145598211, 272.8438185545791, 57.24657127591748, 90.79642288841237, 272.8438185545791, 352.4353730767199, 168.39771099808507, 248.36596491018696, 209.63516732070275, 66.73838207163915, 129.43115354241297, 129.49784893861533, 272.8438185545791, 579.4649938791359, 100.09035288521471, 220.30424892054754, 319.3443889268936, 13.94683840755955, 272.8438185545791, 154.26895025584872, 104.73409955976528, 130.5794634173596, 307.0681488517892, 107.93708121135573, 36.61031136872027, 36.61031136872027, 84.17040085625115, 31.210156250385943, 72.01360115410559, 126.66295614580373, 190.64187081796223, 90.79642288841237, 209.63516732070275, 158.1826251421317, 236.36650346927524, 579.4649938791359, 292.3597033095136, 36.825079570584506, 116.14008922774948, 168.39771099808507, 129.49784893861533, 482.3668721692566, 126.66295614580373, 168.39771099808507, 272.8438185545791, 107.93708121135573, 158.1826251421317, 168.39771099808507, 198.6342145598211, 220.30424892054754, 70.90044394183283, 579.4649938791359, 57.94793264204458, 56.78530609937027, 319.3443889268936, 319.3443889268936, 292.3597033095136, 154.26895025584872, 190.64187081796223, 209.63516732070275, 579.4649938791359, 65.31566090651495, 70.90044394183283, 198.6342145598211, 319.3443889268936, 129.49784893861533, 158.1826251421317, 220.30424892054754, 248.36596491018696, 227.43869446888698, 57.24657127591748, 307.0681488517892, 85.56443246095841, 36.61031136872027, 158.1826251421317, 130.5794634173596, 129.49784893861533, 154.26895025584872, 198.6342145598211, 55.7433846988939, 100.09035288521471, 227.43869446888698, 220.30424892054754, 579.4649938791359, 44.27137951523684, 90.79642288841237, 129.43115354241297, 154.26895025584872, 226.64891288273682, 69.19008543950986, 130.5794634173596, 307.0681488517892, 209.63516732070275, 272.8438185545791, 215.20432675441222, 272.8438185545791, 129.43115354241297, 107.93708121135573, 236.36650346927524, 319.3443889268936, 272.8438185545791, 579.4649938791359, 126.66295614580373, 70.90044394183283, 63.477432984723634, 227.43869446888698, 352.4353730767199, 236.36650346927524, 292.3597033095136, 495.3154941026644, 198.6342145598211, 17.660120057543903, 158.1826251421317, 190.64187081796223, 209.63516732070275, 45.80777034221213, 307.0681488517892, 198.6342145598211, 32.76209974792738, 84.17040085625115, 58.729154521223705, 482.3668721692566)

Also, version info is:
platform       x86_64-w64-mingw32
arch           x86_64
os             mingw32
system         x86_64, mingw32
status
major          3
minor          1.2
year           2014
month          10
day            31
svn rev        66913
language       R
version.string R version 3.1.2 (2014-10-31)
nickname       Pumpkin Helmet


text:
Q: IIS 10 Application Pool Memory Management I have a requirement to configure several settings in my IIS application pools away from their defaults, but I am not finding great guidance nor am I having much luck with trial-and-error experimentation.
I have two application pools in use.  One hosts a single application, the other hosts two.  These applications are used to support day-to-day work in our office, being a local instance of TFS that users access either via a website or a local Visual Studio client.  The machine is a virtual Windows Host with 16GB maximum RAM, with regular usage hovering around 10.5GB.
The values in question are Recycling Request Limit, Private Memory Limit, and Virtual Memory Limit.
The default value for all three of these is "0", which indicates "Unlimited".  This isn't allowed.
So far, it appears that whenever I set basically any value in the fields in question, performance of TFS degrades.  It's still accessible, but noticeably way slower.
For the memory limits, I had found some guidance online that the applications should only normally use something like 1.6GB, so I began my trial with a 2GB limit on both pools.  This didn't work well, so I kept increasing it until I was offering both pools the maximum limit of 16GB (expressed in kb, so 16777216kb).  The quantities used in both the Private Memory Limit and Virtual Memory Limit were kept the same, since nothing seemed to indicate they should be separate.
Request Limits for recycling, another value that can't be "0" anymore, was set to 35000 - which was an IIS 6.5 "best practice", apparently.
I am uncertain why performance has degraded.  It would seem to me that these configuration changes are preventing IIS applications from getting all the memory they need, causing them to bog down.  However, I am, apparently, permitting the applications in question to use 16GB - which for sure would be the same as "0", since that is the most memory they'd be able to take from an "Unlimited" setting on a 16GB RAM hosting VM.
Setting the memory limits back to "0" boosts performance, and setting the Request Limit back improves it just a bit more.
Curiously, regardless of what these settings are at, machine memory usage doesn't seem to deviate.
Unfortunately I am at a loss as to how to configure this correctly, as the requirements in question make no proscriptions.  Beyond just finding advice on what quantity to set it, I was also unable to find a concrete resource on how to figure it out on my own - that is, I can hand-jam in someone else's values, but it's not clear on how I should be able to look at my own applications and derive a result based on some known value.  I do know that the w3wp process is an IIS worker process that manages application pools - but it only seems to want a peak of ~228,000K - according to Task Manager, anyways.
How should I configure these memory-handling settings, and on what should I base that decision?  I am unsure why if I am offering it the maximum amount of memory on the system (16GB) it would perform less well than if I was offering it an unlimited amount (which itself would be bound by the system's memory limit of 16GB anyways).

A: It appears to be best to leave these settings alone unless there is a major issue that needs to be addressed - see this:
https://techcommunity.microsoft.com/t5/core-infrastructure-and-security/iis-best-practices/ba-p/1241577

A: Setting the virtual memory limit to anything other than 0 seems to cause major issues on iis 10 64bit.  To comply with rules that require a value other than 0, I found setting the limit to the maximum allowed value of 4294967295 seems to work just as well as setting it to 0 (unlimited)


text:
Q: Button under ListView in AlertDialog is hidden I want to show a list with a button under it in an AlertDialog. The Button is to close the Dialog itself. I extended AlertDialog and added some LayoutParams to the Window to extend the Dialog of the whole screen width:
    //Grab the window of the dialog, and change the width
    WindowManager.LayoutParams lp = new WindowManager.LayoutParams();
    Window window = getWindow();
    lp.copyFrom(window.getAttributes());
    //This makes the dialog take up the full width
    lp.width = WindowManager.LayoutParams.MATCH_PARENT;
    lp.height = WindowManager.LayoutParams.WRAP_CONTENT;
    window.setAttributes(lp);

ok. But if the list is long (display is full of it), I can scroll the ListView but the button is not shown under it. Here's the ContentView of the Dialog:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">

<ListView
    android:id="@+id/choose_equipment_list"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" />

<Button
    android:layout_below="@+id/choose_equipment_list"
    android:id="@+id/btn_choose_equipment_close"
    style="@style/custom_button"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="close" />

</RelativeLayout>

What can I do to show the button ALWAYS under the list, no matter how long it is? (I read a lot warnings to put a ListView inside a ScrollView, tried it anyway and failed...)

A: Try it:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

    <ListView
        android:id="@+id/choose_equipment_list"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1" />

    <Button
        android:id="@+id/btn_choose_equipment_close"
        style="@style/custom_button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="close" />

</LinearLayout>

If not work, remove the style="@style/custom_button" line. Some style configuration could change the view style and hide the button.

A:
I want to show a list with a button under it in an AlertDialog.

So What you have to do is :
Remove this from from your Button:
android:layout_below="@+id/choose_equipment_list"

Then put this in Button:
android:layout_alignParentBottom="true"

And Put this in ListView:
android:layout_above="@+id/btn_choose_equipment_close"

You are Done.

A: Hmm. Maybe try to use Fragments. I coded sample for you. Tell me if it is what you are looking for:)
MainActivity.java
public class MainActivity extends ActionBarActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main_activity);
        findViewById(R.id.open_dialog_button).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                SampleDialogFragment dialogFragment = new SampleDialogFragment();
                dialogFragment.show(getSupportFragmentManager(), "dialogFragment");
            }
        });
    }
}

main_activity.xml
<FrameLayout
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    xmlns:android="http://schemas.android.com/apk/res/android">

    <Button
        android:id="@+id/open_dialog_button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Open dialog"
        android:layout_gravity="center" />
</FrameLayout>

SampleDialogFragment.java
public class SampleDialogFragment extends DialogFragment {

    @Override
    public Dialog onCreateDialog(Bundle savedInstanceState) {
        AlertDialog.Builder alert = new AlertDialog.Builder(getActivity());
        alert.setTitle("Timer");
        alert.setPositiveButton("OK", null);

        View view = View.inflate(getActivity(), R.layout.dialog, null);

        String[] array = {"Hello", "Hello", "Hello", "Hello", "Hello", "Hello", "Hello", "Hello", "Hello", "Hello", "Hello", "Hello", "Hello", "Hello", "Hello"};

        ArrayAdapter<String> adapter = new ArrayAdapter<String>(getActivity(), android.R.layout.simple_list_item_1, array);
        ((ListView) view.findViewById(R.id.listView)).setAdapter(adapter);

        alert.setView(view);

        return alert.create();
    }
}

dialog.xml
<ListView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/listView"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" />

A: I think it could be possible to get what you need declaring in the XML your button first located in the bottom and then the listview above it with height set to fill_parent

A: This is should be what you want...
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">

<ListView
    android:id="@+id/choose_equipment_list"
    android:layout_above="@+id/btn_choose_equipment_close"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" />

<Button
    android:id="@+id/btn_choose_equipment_close"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:layout_centerHorizontal="true"
    android:text="close" />

</RelativeLayout>


text:
Q: Java Reflection Utility Is there a utility to get a property which isnt prefixed by get from an object using reflection similar to BeanUtils? e.g. if I specify "hashCode" and I want to get the object.hashCode() value.
Thanks.

A: You can call hashCode() on every Object. You don't need reflection for this.
Otherwise, you can use the standard reflection classes - java.lang.Class and its method getMethod(..) which returns java.lang.reflect.Method.

A: The java reflection API allows you to access any property on a given instance of a class, including private variables.
Reflection is a powerful tool that allows you to do many things, including instantiating objects with private constructors.
Here is a decent tutorial for reflection that a quick google search turned up.
http://tutorials.jenkov.com/java-reflection/index.html

A: org.apache.commons.beanutils.MethodUtils was what I was looking for.

A: Finding Out About Class Fields: It's possible to find out which data fields are defined in a class. To do this, the following code can be used:
   import java.lang.reflect.*;

   public class field1 {
      private double d;
      public static final int i = 37;
      String s = "testing";

      public static void main(String args[])
      {
         try {
            Class cls = Class.forName("field1");

            Field fieldlist[]
              = cls.getDeclaredFields();
            for (int i
              = 0; i < fieldlist.length; i++) {
               Field fld = fieldlist[i];
               System.out.println("name
                  = " + fld.getName());
               System.out.println("decl class = " +
                           fld.getDeclaringClass());
               System.out.println("type
                  = " + fld.getType());
               int mod = fld.getModifiers();
               System.out.println("modifiers = " +
                          Modifier.toString(mod));
               System.out.println("-----");
            }
          }
          catch (Throwable e) {
             System.err.println(e);
          }
       }
   }

source: http://java.sun.com/developer/technicalArticles/ALT/Reflection/

A:
Is there a utility to get a property which isn't prefixed by get from an object using reflection similar to BeanUtils?

There are the standard reflection APIs, but what you are asking for is problematic.  The Bean convention is that a method starting with get or is (and certain other characteristics) is a property.  Without this convention, it is not possible to know which of the methods of a class are property getters (or setters) and which are methods that have an entirely different purpose.  For example, you would NOT want to call File.delete() in the mistaken belief that it was a getter for some boolean property!!


text:
Q: text-overflow: ellipsis in table-cell without width I'm trying to achieve a responsive table width text-overflow: ellipsis; in the middle cell that looks like this:
| Button 1 | A one-lined text that is too long and has to be... | Button 2 |
The whole table should have width: 100%; to be as large as the device. I can't set a fixed width on Button 1 nor Button 2 since the application is multilingual (a max-width should be possible though).
I can try whatever I want, the ... only appears when I set a fixed width. How can I tell the middle cell to "use the space available" without the help of JavaScript?

A: This is not really a clean solution, but it uses no JS and works in every browser I've tested.
My solution consists in wrapping the cell's contents inside a table with table-layout: fixed and width: 100%.
See the demo.
Here's the full solution:

        Button 1

                    Lorem ipsum dolor sit amet, consectetur adipisicing elit. Delectus doloremque magni illo reprehenderit consequuntur quia dicta labore veniam distinctio quod iure vitae porro nesciunt. Minus ipsam facilis! Velit sapiente numquam.

        Button 2

.main-table {
    width: 100%;
}

.fixed-table {
    /* magic */
    width: 100%;
    table-layout: fixed;

    /*not really necessary, removes extra white space */
    border-collapse: collapse;
    border-spacing: 0;
    border: 0;
}
.fixed-table td {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nowrap {
    /* used to keep buttons' text in a single line,
     * remove this class to allow natural line-breaking.
     */
    white-space: nowrap;
}

It's not really clear what's the intent for the side buttons, hence I've used white-space: nowrap to keep them in the same line. Depending on the use case, you may prefer to apply a min-width and let them line-break naturally.

A: A cleaner way would be to simply set a max-width on the td.
Based on @Fabrício Matté's reply,
http://jsfiddle.net/V83Ae/89/

    Button 1

        Lorem ipsum dolor sit amet, consectetur adipisicing elit. Delectus doloremque magni illo reprehenderit consequuntur quia dicta labore veniam distinctio quod iure vitae porro nesciunt. Minus ipsam facilis! Velit sapiente numquam.
    Button 2

And
body { margin: 0; }

.main-table {
    width: 100%;
}

.truncate {
    text-overflow: ellipsis;
    white-space  : nowrap;
    overflow     : hidden;
    max-width    : 100px; /* Can be any size, just small enough */
}

.nowrap {
    white-space: nowrap;
}

I have no idea why this works, but it does, so if someone can figure how why applying a max-width works then please let me know as I did it by accident.

A: After banging my head for hours, with no solution that worked, finally found it.
The element you want for the base of the overflow nees a min/max width, where the max is inferior to the min width. You can then overflow the lement or a child of it, where you can set the with whatever way you choose: %, px, auto.
I tried it in more than one tricky situation and it works on all.
I'll try to post a fiidle with my examples but this should help you going.
/* Apply on base element for proper overflow */
max-width: 1px;
min-width: 10000px;

/* Apply on self or child, according to need */
width: 100%;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;

A: Set your 100% width on the table and specify a fixed table-layout:
table {
    width: 100%;
    table-layout: fixed;
}

Then, set the following for whichever table cell should have the ellipsis:
td:nth-child(2) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

Voila! Responsive table with an ellipsis overflow!
Demo: http://jsfiddle.net/VyxES/

A: HTML

         A very looooooooooooooooooooooooooooooong string

CSS
td {
    position: relative;
}

.ellipsis {
    /*Here is the trick:*/
    position: absolute;
    width: 100%;
    /*End of the trick*/

    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

A: Here you go

    Button 1

      A one-lined text that is too long and has to be...

    Button 2

The trick is to set up a table layout with a cell that takes up leftover space first (css tables, mind you!).
.container {
  display: table;
  width: 100%;
}

.container > div {
  display: table-cell;
  white-space: nowrap;
  position : relative;
  width : auto;

  /*make it easier to see what's going on*/
  padding : 2px;
  border : 1px solid gray;
}

.container > .fill {
  width : 100%;
}

Then add your text that constrains itself within.
.lockText {
  position : absolute;
  left : 0;
  right : 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

A: [update]
My apologies, does not seem to work 'just like that': http://jsfiddle.net/kQKfc/1/
Will leave it here though, because it certain situations it does the trick for us.
[/update]
We have this css in our project, give it a shot:
.nowr
{
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


text:
Q: Excel - Need a report out of a key and value list Posting my first question so pardon me for any silly mistakes. Question:
I have data in excel in this format:
Input list

First-column: List of fruits
Second-column: Available numbers
Third-column: Whether to sell or not
What I need is to have a list out of this which gives me list of fruits which are available to sell which means rows with following setting needs to be selected:
First-column: All unique values (in result list, values should not be repeating as we see in original list)
Second-column: It should add all the values for all unique values from first column, see below screenshot for example.
Third-column: It should ignore the rows with this value populated. It should only consider the rows with null values for this column
Which means we should have following result list for above example:
Result list

Any idea will be highly appreciated.
[Note: I can understand we need 2 formula for both column in result list but not sure how can we achieve this.]

A: If you have the newest version of Excel you can do something like the below (I assume your existing table runs from A1:C100, and your results table starts in E1):

*

*get the unique fruits with =UNIQUE($A$2:$A$100)

*get the count with =SUM(FILTER($B$2:$B$100, (($A$2:$A$100=$E1)*($C$2:$C$100<>"No"))))


text:
Q: MySQL select multiple distinct values I have columns email,city, address, state, country in a MySQL database.
some of the emails have multiple addresses.(multiple addresses and states)- different rows for different addresses with same email.
I want my result set to display count of distinct email and state and group the the count based on state.
I tried stuff like-
select count(distinct(email), state from A group by state

but due to multiple addresses the same email shows up in multiple states.
How do make the email show up only on any one state only?
Can anybody help out here?

A: DISTINCT cannot contain two operands. You can use GROUP BY.
select email, state from A group by email, state

If you need a COUNT from of the above, you can put it in a subquery.
SELECT COUNT(*) FROM
    (select email, state from A group by email, state) TBL

A: select f.email, f.state, f.id from(
select email, max(id) as maxid
from addresses where country= 'US'
group by email) as x inner join addresses as f on f.email=x.email and f.id=x.maxid;

Thank you for the help. This query answered my question.