text:
Q: Is there a rule for forming plural compound nouns? The the Cambridge dictionary demonstrates that compound nouns can be pluralized by adding an s to the first word.

a security (FINANCE, STOCK MARKET): a financial investment such as a
  bond or share that is traded on a financial market
a securities agreement/audit/dealer
a securities business/company/house

We can figure out that a securities dealer who buys and sells many different kinds of securities.
But, we say "gumball machine" (a machine that holds many different kinds of gumballs), but not "gumballs machine".
This website says there is no rule.
I suspect the following.
It seems that technical or business terms such as "a securities agreement/audit/dealer", "systems analyst", "sales clerk", etc., tend to focus on the accuracy, therefore they focus on the exact meaning. We say "a securities dealer" because it is more logical that a dealer buys and sells many kinds of securities.
But for common terms, not technical ones, such as "gumball machine", "beekeepers", etc. The accuracy is not important. People keep them simple for every ordinary person to use.
Is there a rule for pluralizing compound nouns?

A: As Janus Bahs Jacquet notes in the comment section, there is no  'rule' governing the number of a noun used attributively. The topic has been covered various times on this site, including here:
When are attributive nouns plural?
And you will find many online discussions if you run a search on "attributive nouns singular or plural". For example, ThoughtCo's page Attributive Nouns in Grammar contains this quotation from Geoffrey Leech (co-author of A Communicative Grammar of English):

"It is normal that the first or attributive noun of a sequence will be
  singular," says Geoffrey Leech. "Yet studies of recent English . . .
  have noted the apparently increasing variety of formations with a
  plural attributive noun" (Change in Contemporary English: A
  Grammatical Study, 2010).

https://www.thoughtco.com/what-is-attributive-noun-1689012
The following passages from two reference works add confirmation of this trend towards plurality. Practical English Usage by Michael Swan has a section on English variation and change. In the sub-section Some more examples of changes in modern English (p296) he states:

Plural noun modifiers are becoming more common. For example antiques
  shop is now as common as antique shop, and drugs problem is
  replacing drug problem.

Adding my own example: a Google search returns twice as many results for sports teacher as for sport teacher.
Merriam–Webster's Dictionary of English Usage (p145) discusses the issue with reference to the term awards banquet:

It seems that the norm has been to have singular nouns used as
  attributives— billiards, for instance, even lost its -s to give
  us billiard ball and billiard table. What seems to be a fairly
  recent trend toward using plural attributives in contemporary English
  has attracted some attention and raised a few eyebrows.

The entry goes on to list several plural attributives such as weapons system and communications technology. It continues:

Many of these combinations come from specialized fields of endeavor,
  and the plural form seems to be chosen to differentiate the meaning of
  the combination with the plural form from whatever the singular
  attributive might connote. In a more general case, like that of awards
  banquet, perhaps the intent is simply to stress plurality: more than
  one award will be presented.


text:
Q: How is Euclid's 5th Postulate wrong exactly? Why do we think that parallel lines and geodesics are the same? I am wondering about the axiomatic method here and Euclid's 5th often comes up. I don't understand why they said that parallel lines could meet after all in Non-Euclidean Geometry. Surely Euclid did not have this exact definition of a line in mind when he made the axiom, no? I simply don't see how the line we have in Non-Euclidean geometry is what Euclid meant, and therefore why this lead people to reconstruct mathematics (along with many other things in history).
It seems like a just a small terminological conflict that can be resolved by realizing that what we have here in Non-Euclidean geometries are geodesics, not lines.

Some mathematical clarification would be helpful on why exactly what we have in say, hyperbolic space, is considered a line. Why (mathematically) did this shake the groundwork of everything so much? Did we actually for a brief time in history think that it was true of Non-Euclidean spaces, and did anything go seriously wrong in the real world over this?

redpajama_set_name: RedPajamaStackExchange


text:
Q: Inherit Constructors and add additionally I Have one Saver class (derived from QObject) and one, which is derived from this Saver class (Creator). In the Saver class I defined some constructors which I want to use when I initialize the Creator class. But also I have additional constructors in the Creator class. I use:
Saver::Saver

in the Creator class to inherit the constructors and it works well, unless I add additional constructors.
Here are the Headers of the classes:
class Saver : public QObject
{
    Q_OBJECT
public:
    explicit Saver();
    explicit Saver(QVector<QOpenGLVertexArrayObject *> vaos);
    explicit Saver(QVector<QOpenGLTexture *> textures);
};

class Creator : public Saver
{
    Q_OBJECT
public:
    using Saver::Saver;
    //Works well unless I add the following two lines
    Creator(QVector<Creator *> creators);
    Creator(Creator *creator);
};

Do I need to redefine all the constructors (there are many more than in this example) or is there any other solution?

A: Here's a Minimal, Complete, and Verifiable example that duplicates the problem.
struct type_a {};
struct type_b {};

class Saver
{
   public:
      explicit Saver() {}
      explicit Saver(type_a) {}
};

class Creator : public Saver
{
   public:
      using Saver::Saver;
      Creator(type_b) {}
};

int main()
{
   Creator c1;
   Creator c2(type_a{});
   Creator c3(type_b{});
};

One way to solve the problem is to remove the explicit qualifier from the default constructor of the base class and add a default implementaton of the default constructor in the derived class.
struct type_a {};
struct type_b {};

class Saver
{
   public:
      Saver() {}
      explicit Saver(type_a) {}
};

class Creator : public Saver
{
   public:
      using Saver::Saver;
      Creator() = default;
      Creator(type_b) {}
};

int main()
{
   Creator c1;
   Creator c2(type_a{});
   Creator c3(type_b{});
};

Another way to resolve the problem would be to use the default constructor of the base class explicit in the initializer list. You still need to add a default implementation of the default constructor in the derived class.
struct type_a {};
struct type_b {};

class Saver
{
   public:
      explicit Saver() {}
      explicit Saver(type_a) {}
};

class Creator : public Saver
{
   public:
      using Saver::Saver;
      Creator() = default;
      Creator(type_b) : Saver() {}
};

int main()
{
   Creator c1;
   Creator c2(type_a{});
   Creator c3(type_b{});
};


text:
Q: Remove all leading zeroes in a string for first column only I have a pipe delimited file and in order to join it with a corresponding file I need to remove the leading zeroes from the first column but not from any other columns in the file.
The structure looks like this:
GA.01.02.070|GLS Add. GA 1/2/70|Wohl: Wagon d. Kelderära. ||||||
GA.01.02.071|GLS Add. GA 1/2/71|Tsä der Kelderära. Roßlau, 1935. ||||||
GA.01.02.072|GLS Add. GA 1/2/72|Rómni der Kelderära. ||||||
GA.01.02.073|GLS Add. GA 1/2/73|Wagen des Mets. Roßlau/ 1934. ||||||
GA.01.02.074|GLS Add. GA 1/2/74|Kastanja Ansin. ||||||
GA.01.02.075|GLS Add. GA 1/2/75|Raupa Ansin. ||||||

and my desired output would be:
GA.1.2.70|GLS Add. GA 1/2/70|Wohl: Wagon d. Kelderära. ||||||
GA.1.2.71|GLS Add. GA 1/2/71|Tsä der Kelderära. Roßlau, 1935. ||||||
GA.1.2.72|GLS Add. GA 1/2/72|Rómni der Kelderära. ||||||
GA.1.2.73|GLS Add. GA 1/2/73|Wagen des Mets. Roßlau/ 1934. ||||||
GA.1.2.74|GLS Add. GA 1/2/74|Kastanja Ansin. ||||||
GA.1.2.75|GLS Add. GA 1/2/75|Raupa Ansin. ||||||

I've been able to find ways of using sed to remove the first leading zero or all zeroes but I haven't found a way to remove just the leading zeroes before the first pipe.

A: If sed isn't a strict requirement, here's an AWK script which will do the trick:
awk -F\| 'BEGIN { OFS = FS } { gsub("\\.0+", ".", $1); print }'

This splits records on |, using that on output too; for each record, it replaces . followed by one or more 0 by . in the first field, then outputs the full record.


text:
Q: Nested Query With Latest Record I am working on a SQL Server 2008 database. I need to get a specific order for a customer and their latest order ID and latest order data. My challenge here is, I need the data in a single row. Currently, I'm trying the following query:
 SELECT
  o.*,
  c.[FirstName],
  c.[LastName],
  c.[PlayerName],
  (SELECT TOP 1 o2.CreatedDate, o2.ID  FROM [Order] o2 ORDER BY [CreatedOn] DESC)
 FROM
  [Order] o,
  [Customer] c
 WHERE
  o.[ID]=c.[CustomerID]

When I execute this query, I get the following error:
Only one expression can be specified in the select list when the subquery is not introduced with EXISTS.

As you can imagine, there are scenarios where a customer will NOT have a previous order. How do I do this and get the result into a single row?
Thank you!

A:  SELECT
  o.*,
  c.[FirstName],
  c.[LastName],
  c.[PlayerName],
  (SELECT TOP 1 o2.CreatedDate FROM [Order] o2 ORDER BY [CreatedOn] DESC),
  (SELECT TOP 1 o2.ID FROM [Order] o2 ORDER BY [CreatedOn] DESC)
 FROM
  [Order] o,
  [Customer] c
 WHERE
  o.[ID]=c.[CustomerID]

The error is saying you cant select two fields in your sub query.  So you have to do them separately.

A: Slightly different way to do it using a CTE.
WITH LatestOrder AS (SELECT TOP 1 * FROM [Order] ORDER BY [CreatedOn] DESC)
 SELECT
  o.*,
  c.[FirstName],
  c.[LastName],
  c.[PlayerName],
  lo.CreatedDate,
  lo.ID
 FROM [Order] o
 JOIN [Customer] c
    ON o.[ID]=c.[CustomerID]
 CROSS JOIN LatestOrder lo


text:
Q: What exactly is a tensor in theano? What exactly is a Tensor in Theano, and what is the precise connection with Tensors as they are typically understood in Physics or Math?
I went through the Theano at Glance and the Basic Tensor functionality, but I could not find a clear connection.

A: There is a good breakdown of different physics/math ways to think of tensor in Jim Belk's answer to a question on math.stackexchange. After looking over the documentation on tensor and the various operations Theano provides I'd say Theano's notion of tensor corresponds to the first way of thinking of tensor. In Jim's words:

Tensors are sometimes defined as multidimensional arrays, in the same way that a matrix is a two-dimensional array. From this point of view, a matrix is certainly a special case of a tensor.

In any case, I don't see anything myself in the docs indicating that Theano's tensor implementation knows about global properties of manifolds or tensor products in linear algebra beyond defining dot-products and the like.  This would indicate Theano is taking a local point of view in it's implementation as opposed to the global.

A: Tensor = multi-dimensional array
In the machine learning literature, tensors generally refer to multi-dimensional arrays.
In Theano they are specifically numerical arrays:

Theano is a Python library that allows you to define, optimize, and efficiently evaluate mathematical expressions involving multi-dimensional arrays.

But in other libraries they may support a broader range of datatypes:

Tensor
The primary data structure in TensorFlow programs. Tensors are N-dimensional (where N could be very large) data structures, most commonly scalars, vectors, or matrices. The elements of a Tensor can hold integer, floating-point, or string values.

Etymology
Tensor has a more specific meaning in mathematics as an abstraction of a multilinear map between vector spaces, but given a fixed basis such maps can be represented as multidimensional arrays, and it is from this usage that the machine learning term gets its name.

See also:

*

*Cross Validated: Tensors in neural network literature: what's the simplest definition out there?

*Cross Validated: Why the sudden fascination with tensors?


text:
Q: Docker image dotnet-framework 4.7.2-sdk missing SDK files I am seeing weird behavior with docker build image outputs.
When I build a docker image from my dockerfile on Windows 2016 server machine (M1), the output image is fine and as expected. However, if I try the same procedure on a different machine (M2), some crucial files are missing. I don't see any errors of any sort when building images. Both M1 and M2 are same Win2016 Datacenter OS. M2 is domain joined but M1 is not.
My dockerfile is like this:
# escape=`
FROM microsoft/dotnet-framework:4.7.2-sdk
RUN mkdir c:\install
ADD WebDeploy_amd64_en-US.msi c:\install\WebDeploy_amd64_en-US.msi
WORKDIR c:\install
RUN powershell start-Process msiexec.exe -ArgumentList "/i","c:\install\WebDeploy_amd64_en-US.msi","/qn" -Wait
ADD https://aka.ms/vs/15/release/vs_buildtools.exe C:\install\vs_buildtools.exe
SHELL ["cmd", "/S", "/C"]
RUN C:\install\vs_buildtools.exe --quiet --wait --norestart --nocache `
    --installPath C:\BuildTools `
    --add Microsoft.Net.Component.4.7.1.SDK `
 || IF "%ERRORLEVEL%"=="3010" EXIT 0

RUN mkdir c:\install\sxs
ADD microsoft-windows-netfx3-ondemand-package.cab c:\install\sxs\microsoft-windows-netfx3-ondemand-package.cab
WORKDIR c:\install
RUN powershell Install-WindowsFeature -Name NET-Framework-Features -Source C:\install\sxs -Verbose
CMD ["powershell.exe", "-NoLogo", "-ExecutionPolicy", "Bypass"]

Contents of C:\Program Files (x86) from container running on M2:

*

*Common Files

*IIS

*internet explorer

*Microsoft Visual Studio

*Microsoft.NET

*MSBuild

*Reference Assemblies

*Windows Defender

*WindowsPowerShell

Contents of C:\Program Files (x86) from container running on M1:

*

*Common Files

*IIS

*internet explorer

*Microsoft SDKs

*Microsoft Visual Studio

*Microsoft.NET

*MSBuild

*Reference Assemblies

*Windows Defender

*Windows Kits

*WindowsPowerShell

Same command used to build images on M1 and M2:
docker build -t vsbuildtools -m 2GB .

What am I missing here?


text:
Q: Custom connection string EF5, DB first So I've generated the table I need, and I need the ability to change my connection string when my program is started. At the moment my connection is
"metadata=res://*/entityframework.Model1.csdl|res://*/entityframework.Model1.ssdl
|res://*/entityframework.Model1.msl;provider=MySql.Data.MySqlClient;
provider connection string="server=localhost;User Id=myuserid;
password=12345678;database=databasename""

What I have so far
Get.designer.cs file:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.EntityClient;
using Npgsql;
using System.Configuration;
using System.Data.Entity;
using System.Data.Entity.Validation;
using patientlist.entityframework;
using System.Xml;

namespace patientlist
{
    public partial class Get : Form
    {
        Timer update = new Timer();//60000 = 1min
        public Get()
        {
            InitializeComponent();
        } ....

    private void Timer(object sender, EventArgs e)
    {
        string connectionString = "metadata=res://*/entityframework.Model1.csdl|res://*/entityframework.Model1.ssdl|res://*/entityframework.Model1.msl;provider=MySql.Data.MySqlClient;provider connection string="server=localhost;User Id=myuserid;password=12345678;database=databasename"";

        using (var blah = new ltcsystemEntities())
        {
            blah.Database.Connection.ConnectionString = connectionString;
        } .....

I'm using EF5, and it's DB first (I generated some automated code from my entity model)

A: With DB First your derived DbContext would have been auto generated for you as a partial class.
public partial class MyContext : DbContext
{
   public MyContext()
   : base("name=MyContext")
   {
   }

//...
}

Notice how it includes a parameterless constructor which calls the parent constructor of method signature: public DbContext(string nameOrConnectionString); passing the name of the connection string. This is the connection string that should be in your app.config.
If you need to change connection strings you can write a partial class to complement the autogenerated class and provide a constructor that accepts the name of another app.config connection string or a connection string itself and then pass this to the parent constructor.
public partial class MyContext
{
   public MyContext(String nameOrConnectionString)
   : base(nameOrConnectionString)
   {
   }
}

You could then use as follows.
using(MyContext context = new MyContext(nameOrConnectionString))
{
  //Do stuff
}

However if you are switching connection strings based on some runtime value(s) then you may find it useful to create a factory class to handle the instantiation of your DbContext.

A: refer Web.config on the root directory of the project.
Your connection strings are located within  'connectionStrings' tag


text:
Q: Parse HTML to Plain Text I'm trying to use the MLStripper class that I found recommended on several postings to strip out the html from an email in order to get plain text.  The strip_tags function runs into an issue when trying to parse  due to the "@" sign.  I guess this class is not powerful enough to only parse valid html tags, any recommendations on how to fix the below to handle the "@" or another library to remove html from text?  I need to also remove things like & as well.
Python:
from HTMLParser import HTMLParser

class MLStripper(HTMLParser):
            def __init__(self):
                 self.reset()
                 self.fed = []
            def handle_data(self, d):
                 self.fed.append(d)
            def get_data(self):
                 return ''.join(self.fed)

            def strip_tags(self, html):
                 s = MLStripper()
                 s.feed(html)
                 return s.get_data()

 ML = MLStripper()
 test = ML.strip_tags("

On Sep 27, 2012, at 4:11 PM, Mark Smith <marksmith@gmail.com> wrote

")
 print test

Error:
Traceback (most recent call last):
  File "IMAPReader.py", line 49, in <module>
    strippedText = ML.strip_tags("<marksmith@gmail.com>")
  File "IMAPReader.py", line 22, in strip_tags
    s.feed(html)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/HTMLParser.py", line 108, in feed
    self.goahead(0)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/HTMLParser.py", line 148, in goahead
    k = self.parse_starttag(i)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/HTMLParser.py", line 229, in parse_starttag
    endpos = self.check_for_whole_start_tag(i)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/HTMLParser.py", line 304, in check_for_whole_start_tag
    self.error("malformed start tag")
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/HTMLParser.py", line 115, in error
    raise HTMLParseError(message, self.getpos())
HTMLParser.HTMLParseError: malformed start tag, at line 1, column 9

A: If you expect to get invalid markup, you don't want an HTML parser. Check out BeautifulSoup:
http://www.crummy.com/software/BeautifulSoup/
They have a nice example of doing exactly what you want to do:
http://www.crummy.com/software/BeautifulSoup/bs4/doc/
from bs4 import BeautifulSoup

html_doc = """
<title>The Dormouse's story</title>

The Dormouse's story

Once upon a time there were three little sisters; and their names were
Elsie,
Lacie and
Tillie;
and they lived at the bottom of a well.

...

"""

soup = BeautifulSoup(html_doc)

print(soup.get_text())

returns...
# The Dormouse's story
#
# The Dormouse's story
#
# Once upon a time there were three little sisters; and their names were
# Elsie,
# Lacie and
# Tillie;
# and they lived at the bottom of a well.
#
# ...

A: What version of Python are you using?  I ran your code using Python 2.7.2 and I got the same error you did.  Then later I ran it on a computer with Python 2.7.3 and it works perfectly.  This was pretty strange so I looked it up and some documentation I found said the HTML parser included with Python became more lenient in the later version.  Try upgrading to 2.7.3 and it should work.


text:
Q: How can I detect when scrolling has started in a ListView on Windows 10 UWP? I'd like to subscribe to an event which tells me that scrolling has started in a ListView and get the direction of scrolling.
Is there any way to do this in Windows 10 UWP API?
Thanks

A: You should first obtain the ScrollViewer inside the ListView and then subscribe to its DirectManipulationStarted event.
However, to get the direction of the scrolling can be tricky. I'd suggest you to have a look at the new Windows Composition API where there's a way to use ExpressionAnimation to link the ScrollViewer's translation to a value of your choice.
A good start is to have a look at this demo from James Clarke.
private void MainPage_Loaded(object sender, RoutedEventArgs e)
{
    CompositionPropertySet scrollerViewerManipulation = ElementCompositionPreview.GetScrollViewerManipulationPropertySet(myScroller);

    Compositor compositor = scrollerViewerManipulation.Compositor;

    ExpressionAnimation expression = compositor.CreateExpressionAnimation("ScrollManipululation.Translation.Y * ParallaxMultiplier");

    expression.SetScalarParameter("ParallaxMultiplier", 0.3f);
    expression.SetReferenceParameter("ScrollManipululation", scrollerViewerManipulation);

    Visual textVisual = ElementCompositionPreview.GetElementVisual(background);
    textVisual.StartAnimation("Offset.Y", expression);
}

Update
Actually just thought of an easier way to detect the scrolling direction. Just subscribe whenever the VerticalOffset is changed and compare it to its previous values.
private double _previousOffset;

sv.RegisterPropertyChangedCallback(ScrollViewer.VerticalOffsetProperty, (s, dp) =>
{
    if (Math.Abs(sv.VerticalOffset - _previousOffset ) < 3)
    {
        // ignore when offset difference is too small
    }
    else if (sv.VerticalOffset > _previousOffset)
    {
        Debug.WriteLine($"up {sv.VerticalOffset - _previousOffset}");
    }
    else {
        Debug.WriteLine($"down {sv.VerticalOffset - _previousOffset}");
    }

    _previousOffset = sv.VerticalOffset;
});


text:
Q: bootstrap and angular 2 I'm starting a new (my first) angular 2 app.  I want to use bootstrap.  I see there are at least 2 projects that bring 'native' bootstrap into Angular?
What is wrong with just declaring the bootstrap JS/CSS sources in my index.html?

A: Some JS/CSS you can use without "2 projects that bring 'native' bootstrap into Angular". But you don't understand that it's not just simply JS/CSS but a component framework that you can use with Angular 2.

ng2-bootstrap contains all core (and not only) Bootstrap components powered by Angular 2. So you don't need to include original JS components

A: I would recommend you using http://ionicframework.com/, which I begin to learn and it's absolute amazing and has the same functionnality as Bootstrap.


text:
Q: Stack trace method names redacted I have users email me stack traces when my app crashes on their device. Prior to iOS 6 they looked like this:
CRASH: NSInvalidArgumentException (*** -[__NSArrayM insertObject:atIndex:]: object cannot be nil)

TRACE: (
0  CoreFoundation                      0x355e58a7 __exceptionPreprocess + 186
1  libobjc.A.dylib                     0x3798c259 objc_exception_throw + 32
2  CoreFoundation                      0x3553a1d7 -[__NSArrayM insertObject:atIndex:] + 186
3  MYAPP                               0x0006c0f7 MYAPP + 188663
4  MYAPP                               0x000652a3 MYAPP + 160419
5  Foundation                          0x3512ac29 __65-[NSURLConnectionInternal _withConnectionAndDelegate:onlyActive:]_block_invoke_0 + 16
6  Foundation                          0x350826d9 -[NSURLConnectionInternalConnection invokeForDelegate:] + 28
7  Foundation                          0x350826a3 -[NSURLConnectionInternal _withConnectionAndDelegate:onlyActive:] + 198
8  Foundation                          0x350825c5 -[NSURLConnectionInternal _withActiveConnectionAndDelegate:] + 60
9  CFNetwork                           0x34de77f5 _ZN19URLConnectionClient23_clientDidFinishLoadingEPNS_26ClientConnectionEventQueueE + 192
10  CFNetwork                          0x34ddc4a5 _ZN19URLConnectionClient26ClientConnectionEventQueue33processAllEventsAndConsumePayloadEP20XConnectionEventInfoI12XClientEvent18XClientEventParamsEl + 424
11  CFNetwork                          0x34ddc1a3 _ZN19URLConnectionClient13processEventsEv + 106
12  CFNetwork                          0x34ddc0d9 _ZN17MultiplexerSource7performEv + 156
13  CoreFoundation                     0x355b9ad3 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 14
14  CoreFoundation                     0x355b929f __CFRunLoopDoSources0 + 214
15  CoreFoundation                     0x355b8045 __CFRunLoopRun + 652
16  CoreFoundation                     0x3553b4a5 CFRunLoopRunSpecific + 300
17  CoreFoundation                     0x3553b36d CFRunLoopRunInMode + 104
18  GraphicsServices                   0x371d7439 GSEventRunModal + 136
19  UIKit                              0x33047cd5 UIApplicationMain + 1080
20  MYAPP                              0x0003fbcf MYAPP + 7119
21  MYAPP                              0x0003fb84 MYAPP + 7044
)

From the CoreFoundation etc method names and asking the user what happened, I can get a pretty good idea of where the crash happened.
However, since iOS 6 was released, my crash reports all look like this:
CRASH: NSRangeException (*** -[__NSArrayI objectAtIndex:]: index 2147483670 beyond bounds [0 .. 11])

TRACE: (
0  CoreFoundation                     0x3a3872bb <redacted> + 186
1  libobjc.A.dylib                    0x32ca697f objc_exception_throw + 30
2  CoreFoundation                     0x3a2d1e8d <redacted> + 164
3  MYAPP                              0x000ff721 MYAPP + 214817
4  MYAPP                              0x000e8999 MYAPP + 121241
5  UIKit                              0x372f60ad <redacted> + 72
6  UIKit                              0x372f605f <redacted> + 30
7  UIKit                              0x372f603d <redacted> + 44
8  UIKit                              0x372f58f3 <redacted> + 502
9  UIKit                              0x372e1287 <redacted> + 526
10  UIKit                             0x37373f3d <redacted> + 748
11  UIKit                             0x3721e52b <redacted> + 318
12  UIKit                             0x3720b809 <redacted> + 380
13  UIKit                             0x3720b123 <redacted> + 6154
14  GraphicsServices                  0x362085a3 <redacted> + 590
15  GraphicsServices                  0x362081d3 <redacted> + 34
16  CoreFoundation                    0x3a35c173 <redacted> + 34
17  CoreFoundation                    0x3a35c117 <redacted> + 138
18  CoreFoundation                    0x3a35af99 <redacted> + 1384
19  CoreFoundation                    0x3a2cdebd CFRunLoopRunSpecific + 356
20  CoreFoundation                    0x3a2cdd49 CFRunLoopRunInMode + 104
21  GraphicsServices                  0x362072eb GSEventRunModal + 74
22  UIKit                             0x3725f301 UIApplicationMain + 1120
23  MYAPP                             0x000ccbd3 MYAPP + 7123
24  MYAPP                             0x000ccb88 MYAPP + 7048
)

I get the stack trace from here, which the user is prompted to email when the app is re-opened:
void uncaughtExceptionHandler(NSException *exception) {
    //make a file name to write the data to using the documents directory:
    NSString *fileName = [NSString stringWithFormat:@"%@/crashlog.txt", documentsDirectory];
    //create content - four lines of text
    NSString *content = [NSString stringWithFormat:@"CRASH: %@ (%@)\n\nTRACE: %@", [exception name], [exception reason], [exception callStackSymbols]];
    //save content to the documents directory
    [content writeToFile:fileName atomically:NO encoding:NSStringEncodingConversionAllowLossy error:nil];
}

Without the method names, this is worse than useless. Is there any way of getting these method names back into my stack traces? This is a release configuration, not debug.
EDIT:
I have followed the instructions in this answer.
I am extracting the .app and .dSYM files from the .xcarchive package and running atos -arch armv7 -o 'MyApp.app'/'MyApp'
However, I am still not getting method names from atos.

A: Do you have any iOS 6 betas installed, by chance? I ran into this same problem.
This question helped me.

A: The OP mentions the wrong file to use in his EDIT.
This post has all the info required to get this working:
Using atos to determine crashed method name with dSYM
Clear instructions on where to find the correct file to run with atos:
Atos cannot get symbols from dSYM of archived application
Make sure to use the correct architecture; I was trying to use armv7, but I needed to specify arm64


text:
Q: Can hibernate business objects be used as entities in a clean architecture? In our project we use classes generated by eclipse hibernate plugin for persistence.
The generated classes have following structure.
MyClass extends BaseMyClass //POJO's, that are refenced in the hbm
files

MyClassDAO extends BaseMyClassDAO //DAO objects that use hibernate
session objects to provide CRUD API's for working with DB

My question is, would it violate Uncle Bobs clean architecture if we use the POJO classes used in the mapping files as the Entities in the innermost layer.
The hibernate specific DAO classes would belong in this case to the outermost layer and UseCases layer would communicate with this layer via providing an interface to be implemented.

A: Uncle Bob comments on this during a lecture in Norway while presenting this slide:

Uncle Bob says:

There is no Hibernate above the line. If you are using Hibernate it goes below the line. The application does not know that you are using that framework. It goes below the line. And Hibernate is a lovely tool. It's very good for gathering data out of the database and turning it into data structures. Very nice! But you don't want your application to know that you are using it. You put all that stuff below the line.
Robert C Martin - Clean Architecture, NDC 2012 (53:53 - 54:18)

Thus if you are using Hibernate annotations on the entities, you mix your domain objects with details of the database layer.
Some developers argue that annotations are not so strong dependencies, because if they are not available at runtime they just do not exist. That's true, but you also have to consider other principles.
If you put Hibernate annotations on your entities, the entity classes now have two different reasons to change: the domain logic and the database mapping.
This is a violation of the single responsibility principle. Therefore database mappings will affect your domain objects.
I guess there is a lot of confusion, because of the overloaded term entity. When Uncle Bob talks about entities he means domain. In Hibernate entity means database record.
That's why I usually distinguish them by using the term "domain entity" or "database entity".


text:
Q: Is there a way for VBA UDF to "know" what other functions will be run? Assume I have a UDF that will be used in a worksheet 100,000+ times.  Is there a way, within the function, for it to know how many more times it is going to be called in the batch?  Basically what I want to do is have every function create a to-do list of work to do. I want to do something like:
IF remaining functions to be executed after this one = 0 then ...

Is there a way to do this?
Background:
I want to make a UDF that will perform SQL queries with the user just giving parameters(date, hour, node, type). This is pretty easy to make if you're willing to actually execute the SQL query every time the function is run. I know its easy because I did this and it was ridiculously slow. My new idea is to have the function first see if the data it is looking for exists in a global cache variable and if it isn't to add it to a global variable "job-list".
What I want it to do is when the last function is called to then go through the job list and perform the fewest number of SQL queries and fill the global cache variable. Once the cache variable is full it would do a table refresh to make all the other functions get called again since on the subsequent call they'll find the data they need in the cache.

A: Firstly:
VBA UDF performance is extremely sensitive to the way the UDF is coded:
see my series of posts about writing efficient VBA UDFs:
http://fastexcel.wordpress.com/2011/06/13/writing-efficient-vba-udfs-part-3-avoiding-the-vbe-refresh-bug/
http://fastexcel.wordpress.com/2011/05/25/writing-efficient-vba-udfs-part-1/
You should also consider using an Array UDF to return multiple results:
http://fastexcel.wordpress.com/2011/06/20/writing-efiicient-vba-udfs-part5-udf-array-formulas-go-faster/
Secondly:
The 12th post in this series outlines using the AfterCalculate event and a cache
http://fastexcel.wordpress.com/2012/12/05/writing-efficient-udfs-part-12-getting-used-range-fast-using-application-events-and-a-cache/
Basically the approach you would need is for the UDF to check the cache & if not current or available then add a request to the queue.   Then use the after-calculation event to process the queue and if neccessary trigger another recalc.

A: Performing 100,000 SQL queries from an Excel spreadsheet seems like a poor design.  Creating a cache'ing mechanism on top of these seems to compound the problem, making it more complicated than it probably needs to be.  There are some circumstances where this might be appropriate, but I would consider other design approaches instead.
The most obvious is to take the data from the Excel spreadsheet and load it into a table in the database.  Then use the database to do the processing on all the rows as once.  The final step is to read the result back into Excel.
I find that the best way to get large numbers of rows from Excel into a database is to save the Excel file as csv and bulk insert them.
This approach may not work for your problem.  In general, though, set-based approaches running in the database are going to perform much better.
As for the cach'ing mechanism, if you have to go down that route.  I can imagine a function that has the following pseudo-code:
Check if input values are in cache.
If so, read values from cache.
Else do complex processing.
Load values in cache.

This logic could go in the function.  As @Bulat suggests, though, it is probably better to add an additional caching layer around the function.


text:
Q: Angular Material Buttons No Hover color I recently installed Angular Material on my application.  I used the command ng add @angular/material and answered yes to all the questions.  Then I imported import { MatButtonModule } from '@angular/material/button'; and used the following html:
<button mat-button>Submit</button>

The button looks fine until you try to hover over it.  On the Angular Material test site, the button will change to a gray when you hover the mouse.  On my version nothing happens:

A: *

*It might be some other CSS configurations are preventing that from happening. Custom theming?

*Just in case, also pointing it out that hover does not work on touch devices (e.g. mobile).

*Good idea is to restart development server ng serve after installation.

*Also import MatButtonModule, BrowserAnimationsModule to respectful @NgModule.

A: In the end I just had to completely uninstall all of my imports and re-install, then it worked.


text:
Q: ¿Como puedo enviar el resultado de un button desde una clase CardViewDataAdapter al MainActivity? Tengo unos botones dentro del Cardview que se muestran dentro de un ReciclerView y cuando pulso en los botones btnMas y btMenos quiero enviar los datos al MainActivity porque allí tengo una función que los manda a una pagina web en php.
Lo que ocurre es que  pasar valores de clase a una activity no se como se hace, de una activity a otra si que se.
Adjunto código.
public class CardViewDataAdapter extends RecyclerView.Adapter {
private List<ClaseArticulo> stList;

public Integer suma;
public Integer resta;
public Integer intIdArticulo=0;

public CardViewDataAdapter(List<ClaseArticulo> articulos, int cardview_row) {
    this.stList = articulos;

}

public CardViewDataAdapter() {

}

// Create new views
@Override
public CardViewDataAdapter.ViewHolder onCreateViewHolder(ViewGroup parent,
                                                         int viewType) {
    // create a new view
    View itemLayoutView = LayoutInflater.from(parent.getContext()).inflate(
            R.layout.cardview_row, null);

    // create ViewHolder

    ViewHolder viewHolder = new ViewHolder(itemLayoutView);

    return viewHolder;
}

@Override
public void onBindViewHolder(final ViewHolder viewHolder,final int position) {

    final int pos = position;

    viewHolder.tvNombre.setText(stList.get(position).getNombre());

    viewHolder.tvCantidad.setText(stList.get(position).getCantidad());

    //GUARDO LA CANTIDAD EN LA VARIABLE
    final String strCantindad=stList.get(position).getCantidad();

    viewHolder.chkSelected.setChecked(stList.get(position).isCheckArticulo());

    viewHolder.chkSelected.setTag(stList.get(position));

    viewHolder.chkSelected.setOnClickListener(new View.OnClickListener() {
        public void onClick(View v) {
            CheckBox cb = (CheckBox) v;
            ClaseArticulo contact = (ClaseArticulo) cb.getTag();

            contact.setCheckArticulo(cb.isChecked());

            stList.get(pos).setCheckArticulo(cb.isChecked());

            /*
                 Toast.makeText(v.getContext(), "Clicked on Checkbox: " + cb.getText() + " is "
                         + cb.isChecked()+strCantidad2, Toast.LENGTH_LONG).show();

            */

        }
    });

    viewHolder.btnMas.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {

            intIdArticulo=stList.get(position).getIdArticulo();

            //CONVIERTO LA VARIABLE EN INTEGER PARA PODERLO SUMAR
            suma= Integer.valueOf(strCantindad);

            suma=suma+1;

            //QUIERO ENVIAR LOS DATOS A MainActivity

            //EditarDatos(id_articulo.toString(),suma.toString());

           // Toast.makeText(v.getContext(), "cantidad " +suma+"id "+intIdArticulo, Toast.LENGTH_LONG).show();

        }
    });

    viewHolder.btnMenos.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {

            //Integer resta;

            Integer intIdArticulo=stList.get(position).getIdArticulo();

            //CONVIERTO LA VARIABLE EN INTEGER PARA PODERLO SUMAR
            resta= Integer.valueOf(strCantindad);

            resta=resta-1;

            //Toast.makeText(v.getContext(), " " +resta, Toast.LENGTH_LONG).show();
            //EditarDatos(id_articulo.toString(),resta.toString());

        }
    });

}

// Return the size arraylist
@Override
public int getItemCount() {
    return stList.size();
}

public static class ViewHolder extends RecyclerView.ViewHolder {

    public TextView tvNombre;
    public TextView tvCantidad;
    public CheckBox chkSelected;
    public Button btnMas;
    public Button btnMenos;
    public LinearLayout Lnfila;

    public ViewHolder(View itemLayoutView) {
        super(itemLayoutView);

        tvNombre = (TextView) itemLayoutView.findViewById(R.id.text_nombre);

        tvCantidad = (TextView) itemLayoutView.findViewById(R.id.text_cantidad);
        chkSelected = (CheckBox) itemLayoutView.findViewById(R.id.articulo_checkBox);
        btnMas = (Button) itemLayoutView.findViewById(R.id.mas);
        btnMenos = (Button) itemLayoutView.findViewById(R.id.menos);
        btnMenos = (Button) itemLayoutView.findViewById(R.id.menos);
        Lnfila= (LinearLayout) itemLayoutView.findViewById(R.id.articulo_card);

    }

}

// method to access in activity after updating selection
public List<ClaseArticulo> getArticulos() {
    return stList;
}

}

A: Para comunicar un botón de la lista con la Activity, necesitas un callback (interfaz) con el ViewHolder. Traduzco el artículo original: https://stackoverflow.com/questions/32720702/how-to-call-a-mainactivity-method-from-viewholder-in-recyclerview-adapter
Primero crea un callback.  Algunos lo declaran en el fichero del Adapter pero te recomiendo hacerlo en uno nuevo:
public interface OnItemClicklistener {
    void onClick(Int value);
}

Para inicializar el valor del callback puedes hacerlo en el Adapter a través de un setter o por constructor.  Por ejemplo con un setter:
private OnItemClicklistener onItemClicklistener;

private void setOnItemClicklistener(OnItemClicklistener onItemClicklistener) {
    this.onItemClicklistener = onItemClicklistener;
}

En el ViewHolder pasarás el valor cuando el usuario seleccione un botón:
viewHolder.btnMas.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {

            intIdArticulo=stList.get(position).getIdArticulo();

            suma= Integer.valueOf(strCantindad);

            suma=suma+1;

            if (onItemClicklistener != null) {
                onItemClicklistener.onClick(suma);
            }
        }

Por último, en tu Activity, sólo tienes que setear el callback:
 cardViewDataAdapter.setOnItemClicklistener(new OnItemClicklistener() {
         @Override
         public void onClick(Int value) {
               // TODO your logic
         }
  })

Si en el futuro empleas Kotlin en lugar de Java, el callback te va a funcionar pero también puedes investigar sobre las Higher Order Functions (lambdas).


text:
Q: Google analytics tracking page visits or state Code example
$(function () {
  (function (i, s, o, g, r, a, m) {
    i['GoogleAnalyticsObject'] = r;
    i[r] = i[r] || function () {
      (i[r].q = i[r].q || []).push(arguments)
    }, i[r].l = 1 * new Date();
    a = s.createElement(o),
    m = s.getElementsByTagName(o)[0];
    a.async = 1;
    a.src = g;
    m.parentNode.insertBefore(a, m)
  })(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');
  ga('create', 'UA-[Site]-[Nr]', [SiteLabel]);
  ga('set', {
    'dimension1': [State],
    'dimension2': [Title],
    'dimension3': [LocationID],
    'dimension4': [Owner],
    'dimension5': [UserID],
    'dimension6': [Uri],
    'dimension7': [Exception]
  });
  ga('send', 'pageview');
});

Use case example
Use cases where [A, B, C, D] are different pages and S* is the session.
#Use case 1
------------------
S1 : A B A B
S2 : A B A
S3 : B

#Use case 2
------------------
S1 : A B A C A D A

#Use case 3
------------------
S1 : A B C D

#Use case 4
------------------
S1 : A A A A A

Expected results:

Mode 1: Hit – value is applied to the single hit for which it has been set.
Mode 2: Session – value is applied to all hits in a single session.

#Use case 1
  Mode 1:
    A : 4 visits
    B : 4 visits
  Mode 2:
    A : 2 visits
    B : 3 visits
#Use case 2
  Mode 1:
    A : 4 visits
    B : 1 visits
    C : 1 visits
    D : 1 visits
  Mode 2:
    A : 1 visits
    B : 1 visits
    C : 1 visits
    D : 1 visits
#Use case 3
  Mode 1:
    A : 1 visits
    B : 1 visits
    C : 1 visits
    D : 1 visits
  Mode 2:
    A : 1 visits
    B : 1 visits
    C : 1 visits
    D : 1 visits
#Use case 4
  Mode 1:
    A : 5 visits
  Mode 2:
    A : 1 visits

Results I seem to get
Changing the scope does not seem to have any effect.
#Use case 1
  A : 2 (7 page visits)
  B : 1 (1 page visits)
#Use case 2
  A : 1 (7 page visits)
#Use case 3
  A : 1 (4 page visits)
#Use case 4
  A : 1 (5 page visits)

Question
How can I get expected results?

A: First since you are setting custom dimensions I believe [A, B, C, D] should represent different values of custom dimensions, not pages.
When using Hit Level Custom Dimensions you should be looking at pageviews instead of visits/sessions. So what you really should be expecting to see is:
#Use case 1
  Mode 1:
    A : 4 pageviews
    B : 4 pageviews
  Mode 2:
    A : 2 visits
    B : 3 visits
#Use case 2
  Mode 1:
    A : 4 pageviews
    B : 1 pageviews
    C : 1 pageviews
    D : 1 pageviews
  Mode 2:
    A : 1 visits
    B : 1 visits
    C : 1 visits
    D : 1 visits
#Use case 3
  Mode 1:
    A : 1 pageviews
    B : 1 pageviews
    C : 1 pageviews
    D : 1 pageviews
  Mode 2:
    A : 1 visits
    B : 1 visits
    C : 1 visits
    D : 1 visits
#Use case 4
  Mode 1:
    A : 5 pageviews
  Mode 2:
    A : 1 visits

If you redo your tests with this in mind the numbers should match.


text:
Q: how to implement different eventlistener for each row in my table generated through javascript My javascript code pulls out data from a xml file and prepares a data grid using that data. For each row of my table, i want to set the eventlistener property to open a file whose name is actually the "pid" field which is in that row.
The code is below:
//Some code to get the xml file
var x = [];
      xmlhttp=new XMLHttpRequest();

    xmlhttp.open("GET","newdata.xml",false);
    xmlhttp.send();
    xmlDoc=xmlhttp.responseXML;

//Now creating each row from the data which i have pushed into array x

    var file_pid = "";
    for (i=0;i<x.length;i++)
      {
var file_pid = "papers/" + x[i].getElementsByTagName("pid")[0].childNodes[0].nodeValue + ".pdf";

//create each row and corresponding attributes
      tr = document.createElement('tr');
      tr.addEventListener('click',function() {window.open(file_pid)},false);

Now the problem is that the event listener is added but each row opens 1 file, 8.pdf, which is the last record in the xml file. What should i do to make it open only the file name assigned to that perticular row??

A: It's because you are creating a closure in a loop. Have a look at this question for an explanation and solution.
However, depending on the number of rows, I think it would be better to store the pid as data- attribute on the row and only bind one event handler to the table (event delegation), when then retrieves the corresponding pid.  For more information about event handling, I suggest to read the excellent articles on quirksmode.org.
Example:
// table is a reference to the table:

function closest(element, tag) {
    tag = tag.toLowerCase();
    while(element && element.tagName.toLowerCase() !== tag) {
        element = element.parentNode;
    }
    return element;
}

table.addEventListener('click', function(event) {
    var row = closest(event.target, 'tr'), pid;
    if(row && (pid = row.getAttribute('data-pid')) {
        window.open(pid);
    }
});

Keep in mind that event handling is different in W3C-compatible browsers and IE (before IE9). So in IE you have to use attachEvent, the event object is not passed to the handler, etc. If you want to be cross-browser compatible, you could just assign the handler to the onclick property:
table.onclick = function(event) {
    event = event || window.event;
    target = event.target || event.srcElement;
    // proceed similarly as shown above
}

You then append the rows somehow like this:
var file_id, tr;

for (i=0;i<x.length;i++) {
    file_pid = "...";

    tr = document.createElement('tr');
    // or tr = table.insertRow(-1);
    tr.setAttribute('data-pid', pid);
}


text:
Q: How insert a single backslash in a string field - solr In my SOLR collection I have a string field with regular expression, named "regex" for a date.
I need to insert a regular expression for date that contains a single backslash, but I'm unable to insert it using Documents update JSON interface:
if I insert a single backslash in regex field:
{
    "id":"a0091da5-2e6c-41d8-97a4-a19fc3c43002",
    "attribute_name": "ArrivalTime",
    "allowed_values": "Date and Time",
    "regex": "\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d(?:\.\d+)?Z?"
}

in the query response I receive without :
"regex":"d{4}-[01]d-[0-3]dT[0-2]d:[0-5]d:[0-5]d(?:.d+)?Z?"

instead, if I insert 2 backslashes in regex field:
{
    "id":"a0091da5-2e6c-41d8-97a4-a19fc3c43002",
    "attribute_name": "ArrivalTime",
    "allowed_values": "Date and Time",
    "regex": "\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d(?:\\.\\d+)?Z?"
}

I receive 2 backslashes :
"regex":"\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d(?:.\\d+)?Z?"

how insert only one backslash? Thank you

A: The response is just as it should be - since it's JSON, the backslash needs to be escaped in the response as well: otherwise the semantic meaning would be the example you gave (d{4}-[01]d...).
When you parse the response as JSON, the string will be unescaped and the content will be what you expect (unless you escape it further on output again).


text:
Q: I imported a type library ( .tlb ) into Delphi and a function parameter seems incorrect. How should I fix it? I've used midl to convert a .idl file to a .tlb. When I import this .tlb file into Delphi (XE7), it converts this Write function which is part of
interface IWTSVirtualChannel : IUnknown
...

HRESULT Write(
    [in]            ULONG               cbSize,
    [in, size_is(cbSize)] BYTE          *pBuffer,
    [in]            IUnknown            *pReserved          // must be NULL
    );

into this Delphi code in the _TLB.pas file.
function Write(
 cbSize: LongWord;
 var pBuffer: Byte;
 const pReserved: IUnknown): HResult; stdcall;

However the 2nd parameter is clearly incorrect. To my mind it should be something like
 pBuffer : PAnsiChar;

The parameter is a c-type string, passed into the Write to send.
So it seems to me that I should just edit the _TLB.pas file and fix it. There's a couple of other procedures that also have this problem.
But I'm reluctant, as I'd have to redo the edit any time I changed the .idl (hopefully not too often; with the associated hassle of unregistering the .tlb type library before re-importing it) but it doesn't seem right and yet I'm fairly certain that it will not work as is.
What's the best thing I should do? Sticking with C++ is not an option!

A: This is a pointer to an array of bytes whose size is provided in the first argument. The correct translation of the second argument is
pBuffer: PByte


text:
Q: AWS Glue Trigger stuck in Deactivating state I have a trigger in AWS glue that is stuck the DEACTIVATING state.  When in the state, you cannot enable it.  I have tried deleting (both in the console and cli) but get the following error message:
An error occurred (InvalidInputException) when calling the DeleteTrigger operation: The operation is not allowed when trigger is in state: DEACTIVATING

Has anyone come across this before?  Is there a way to force delete?  I cannot see anything in the documentation.


text:
Q: Ubuntu Server Cannot Connect to Internet - Static IP My home server (running Ubuntu Server 20.04) can't connect to the internet randomly. It was fine and then it wasn't (I made no changes to it). I am able to access it locally and through SSH locally. It can ping 8.8.8.8 and is set up with a static ip address. Running any sort of "sudo apt-get update" just returns a failed attempt.
Here is my netplan yaml setup:
network:
  ethernets:
    eno1:
      dhcp4: no
      dhcp6: no
  bridges:
    br0:
      interfaces: [eno1]
      dhcp4: no
      addresses: [192.168.0.119/24]
      gateway4: 192.168.0.1
      nameservers:
        addresses: [192.168.0.1, 8.8.8.8]
  version: 2

Here is the result of "sudo lshw -C network". The bridge is to a virtual machine that's off so that being disabled is normal.
*-network
       description: Ethernet interface
       product: Ethernet Connection I217-V
       vendor: Intel Corporation
       physical id: 19
       bus info: pci@0000:00:19.0
       logical name: eno1
       version: 04
       serial: 94:de:80:b4:8f:0b
       size: 1Gbit/s
       capacity: 1Gbit/s
       width: 32 bits
       clock: 33MHz
       capabilities: pm msi bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=e1000e driverversion=3.2.6-k duplex=full firmware=0.13-4 latency=0 link=yes multicast=yes port=twisted pair speed=1Gbit/s
       resources: irq:28 memory:f0500000-f051ffff memory:f053d000-f053dfff ioport:f080(size=32)
  *-network DISABLED
       description: Ethernet interface
       physical id: 2
       logical name: virbr0-nic
       serial: 52:54:00:e8:cd:68
       size: 10Mbit/s
       capabilities: ethernet physical
       configuration: autonegotiation=off broadcast=yes driver=tun driverversion=1.6 duplex=full link=no multicast=yes port=twisted pair speed=10Mbit/s

Trying to ping google.com:
ping: google.com: Name or service not known

Networ Logs "sudo journalctl -b 0 -u NetworkManager":
Apr 10 11:21:08 homeserver systemd[1]: Starting Network Manager...
Apr 10 11:21:08 homeserver NetworkManager[1061]: <info>  [1649607668.6453] NetworkManager (version 1.22.10) is starting>
Apr 10 11:21:08 homeserver NetworkManager[1061]: <info>  [1649607668.6454] Read config: /etc/NetworkManager/NetworkMana>
Apr 10 11:21:08 homeserver systemd[1]: Started Network Manager.
Apr 10 11:21:08 homeserver NetworkManager[1061]: <info>  [1649607668.6482] bus-manager: acquired D-Bus service "org.fre>
Apr 10 11:21:08 homeserver NetworkManager[1061]: <info>  [1649607668.6699] manager[0x55640f84b040]: monitoring kernel f>
Apr 10 11:21:08 homeserver NetworkManager[1061]: <info>  [1649607668.6699] monitoring ifupdown state file '/run/network>
Apr 10 11:21:08 homeserver NetworkManager[1061]: <info>  [1649607668.8065] hostname: hostname: using hostnamed
Apr 10 11:21:08 homeserver NetworkManager[1061]: <info>  [1649607668.8066] hostname: hostname changed from (none) to "h>
Apr 10 11:21:08 homeserver NetworkManager[1061]: <info>  [1649607668.8068] dns-mgr[0x55640f830290]: init: dns=systemd-r>
Apr 10 11:21:08 homeserver NetworkManager[1061]: <info>  [1649607668.8070] manager[0x55640f84b040]: rfkill: Wi-Fi hardw>
Apr 10 11:21:08 homeserver NetworkManager[1061]: <info>  [1649607668.8070] manager[0x55640f84b040]: rfkill: WWAN hardwa>
Apr 10 11:21:08 homeserver NetworkManager[1061]: <info>  [1649607668.8153] Loaded device plugin: NMWifiFactory (/usr/li>
Apr 10 11:21:08 homeserver NetworkManager[1061]: <info>  [1649607668.8235] Loaded device plugin: NMWwanFactory (/usr/li>
Apr 10 11:21:08 homeserver NetworkManager[1061]: <info>  [1649607668.8294] Loaded device plugin: NMBluezManager (/usr/l>
Apr 10 11:21:08 homeserver NetworkManager[1061]: <info>  [1649607668.8312] Loaded device plugin: NMAtmManager (/usr/lib>
Apr 10 11:21:08 homeserver NetworkManager[1061]: <info>  [1649607668.8356] Loaded device plugin: NMTeamFactory (/usr/li>
Apr 10 11:21:08 homeserver NetworkManager[1061]: <info>  [1649607668.8358] manager: rfkill: Wi-Fi enabled by radio kill>
Apr 10 11:21:08 homeserver NetworkManager[1061]: <info>  [1649607668.8360] manager: rfkill: WWAN enabled by radio kills>
Apr 10 11:21:08 homeserver NetworkManager[1061]: <info>  [1649607668.8361] manager: Networking is enabled by state file
Apr 10 11:21:08 homeserver NetworkManager[1061]: <info>  [1649607668.8362] dhcp-init: Using DHCP client 'internal'
Apr 10 11:21:08 homeserver NetworkManager[1061]: <info>  [1649607668.8385] settings: Loaded settings plugin: ifupdown (>
Apr 10 11:21:08 homeserver NetworkManager[1061]: <info>  [1649607668.8385] settings: Loaded settings plugin: keyfile (i>
Apr 10 11:21:08 homeserver NetworkManager[1061]: <info>  [1649607668.8385] ifupdown: management mode: unmanaged
Apr 10 11:21:08 homeserver NetworkManager[1061]: <warn>  [1649607668.8396] ifupdown: interfaces file /etc/network/inter>
Apr 10 11:21:08 homeserver NetworkManager[1061]: <info>  [1649607668.8428] device (lo): carrier: link connected
Apr 10 11:21:08 homeserver NetworkManager[1061]: <info>  [1649607668.8430] manager: (lo): new Generic device (/org/free>
Apr 10 11:21:08 homeserver NetworkManager[1061]: <info>  [1649607668.8437] device (br0): carrier: link connected
Apr 10 11:21:08 homeserver NetworkManager[1061]: <info>  [1649607668.8439] manager: (br0): new Bridge device (/org/free>
Apr 10 11:21:08 homeserver NetworkManager[1061]: <info>  [1649607668.8446] device (eno1): carrier: link connected
Apr 10 11:21:08 homeserver NetworkManager[1061]: <info>  [1649607668.8448] manager: (eno1): new Ethernet device (/org/f>
Apr 10 11:21:08 homeserver NetworkManager[1061]: <warn>  [1649607668.8541] Error: failed to open /run/network/ifstate
Apr 10 11:21:08 homeserver NetworkManager[1061]: <info>  [1649607668.8606] manager: startup complete
Apr 10 11:21:08 homeserver NetworkManager[1061]: <info>  [1649607668.8662] modem-manager: ModemManager available
Apr 10 11:21:09 homeserver NetworkManager[1061]: <info>  [1649607669.6917] manager: (virbr0): new Bridge device (/org/f>
Apr 10 11:21:09 homeserver NetworkManager[1061]: <info>  [1649607669.6947] manager: (virbr0-nic): new Tun device (/org/>
Apr 10 11:26:27 homeserver systemd[1]: Stopping Network Manager...
Apr 10 11:26:27 homeserver NetworkManager[1061]: <info>  [1649607987.3531] caught SIGTERM, shutting down normally.
Apr 10 11:26:27 homeserver NetworkManager[1061]: <info>  [1649607987.3540] device (eno1): released from master device b>
Apr 10 11:26:27 homeserver NetworkManager[1061]: <info>  [1649607987.3546] device (virbr0-nic): released from master de>
Apr 10 11:26:27 homeserver NetworkManager[1061]: <info>  [1649607987.3898] exiting (success)
Apr 10 11:26:27 homeserver systemd[1]: NetworkManager.service: Succeeded.
Apr 10 11:26:27 homeserver systemd[1]: Stopped Network Manager.
Apr 10 11:26:27 homeserver systemd[1]: Starting Network Manager...
Apr 10 11:26:27 homeserver NetworkManager[6077]: <info>  [1649607987.4146] NetworkManager (version 1.22.10) is starting>
Apr 10 11:26:27 homeserver NetworkManager[6077]: <info>  [1649607987.4147] Read config: /etc/NetworkManager/NetworkMana>
Apr 10 11:26:27 homeserver systemd[1]: Started Network Manager.
Apr 10 11:26:27 homeserver NetworkManager[6077]: <info>  [1649607987.4186] bus-manager: acquired D-Bus service "org.fre>
Apr 10 11:26:27 homeserver NetworkManager[6077]: <info>  [1649607987.4208] manager[0x5633ae7e6030]: monitoring kernel f>
Apr 10 11:26:27 homeserver NetworkManager[6077]: <info>  [1649607987.4209] monitoring ifupdown state file '/run/network>
Apr 10 11:26:27 homeserver NetworkManager[6077]: <info>  [1649607987.5026] hostname: hostname: using hostnamed
Apr 10 11:26:27 homeserver NetworkManager[6077]: <info>  [1649607987.5026] hostname: hostname changed from (none) to "h>
Apr 10 11:26:27 homeserver NetworkManager[6077]: <info>  [1649607987.5030] dns-mgr[0x5633ae7c8290]: init: dns=systemd-r>
Apr 10 11:26:27 homeserver NetworkManager[6077]: <info>  [1649607987.5033] manager[0x5633ae7e6030]: rfkill: Wi-Fi hardw>
Apr 10 11:26:27 homeserver NetworkManager[6077]: <info>  [1649607987.5033] manager[0x5633ae7e6030]: rfkill: WWAN hardwa>
Apr 10 11:26:27 homeserver NetworkManager[6077]: <info>  [1649607987.5045] Loaded device plugin: NMWifiFactory (/usr/li>
Apr 10 11:26:27 homeserver NetworkManager[6077]: <info>  [1649607987.5053] Loaded device plugin: NMWwanFactory (/usr/li>
Apr 10 11:26:27 homeserver NetworkManager[6077]: <info>  [1649607987.5026] hostname: hostname: using hostnamed
Apr 10 11:26:27 homeserver NetworkManager[6077]: <info>  [1649607987.5026] hostname: hostname changed from (none) to "h>
Apr 10 11:26:27 homeserver NetworkManager[6077]: <info>  [1649607987.5030] dns-mgr[0x5633ae7c8290]: init: dns=systemd-r>
Apr 10 11:26:27 homeserver NetworkManager[6077]: <info>  [1649607987.5033] manager[0x5633ae7e6030]: rfkill: Wi-Fi hardw>
Apr 10 11:26:27 homeserver NetworkManager[6077]: <info>  [1649607987.5033] manager[0x5633ae7e6030]: rfkill: WWAN hardwa>
Apr 10 11:26:27 homeserver NetworkManager[6077]: <info>  [1649607987.5045] Loaded device plugin: NMWifiFactory (/usr/li>
Apr 10 11:26:27 homeserver NetworkManager[6077]: <info>  [1649607987.5053] Loaded device plugin: NMWwanFactory (/usr/li>
Apr 10 11:26:27 homeserver NetworkManager[6077]: <info>  [1649607987.5057] Loaded device plugin: NMBluezManager (/usr/l>
Apr 10 11:26:27 homeserver NetworkManager[6077]: <info>  [1649607987.5060] Loaded device plugin: NMAtmManager (/usr/lib>
Apr 10 11:26:27 homeserver NetworkManager[6077]: <info>  [1649607987.5067] Loaded device plugin: NMTeamFactory (/usr/li>
Apr 10 11:26:27 homeserver NetworkManager[6077]: <info>  [1649607987.5070] manager: rfkill: Wi-Fi enabled by radio kill>
Apr 10 11:26:27 homeserver NetworkManager[6077]: <info>  [1649607987.5071] manager: rfkill: WWAN enabled by radio kills>
Apr 10 11:26:27 homeserver NetworkManager[6077]: <info>  [1649607987.5074] manager: Networking is enabled by state file
Apr 10 11:26:27 homeserver NetworkManager[6077]: <info>  [1649607987.5075] dhcp-init: Using DHCP client 'internal'
Apr 10 11:26:27 homeserver NetworkManager[6077]: <info>  [1649607987.5109] settings: Loaded settings plugin: ifupdown (>
Apr 10 11:26:27 homeserver NetworkManager[6077]: <info>  [1649607987.5110] settings: Loaded settings plugin: keyfile (i>
Apr 10 11:26:27 homeserver NetworkManager[6077]: <info>  [1649607987.5110] ifupdown: management mode: unmanaged
Apr 10 11:26:27 homeserver NetworkManager[6077]: <warn>  [1649607987.5110] ifupdown: interfaces file /etc/network/inter>
Apr 10 11:26:27 homeserver NetworkManager[6077]: <info>  [1649607987.5118] device (lo): carrier: link connected
Apr 10 11:26:27 homeserver NetworkManager[6077]: <info>  [1649607987.5121] manager: (lo): new Generic device (/org/free>
Apr 10 11:26:27 homeserver NetworkManager[6077]: <info>  [1649607987.5127] device (br0): carrier: link connected
Apr 10 11:26:27 homeserver NetworkManager[6077]: <info>  [1649607987.5129] manager: (br0): new Bridge device (/org/free>
Apr 10 11:26:27 homeserver NetworkManager[6077]: <info>  [1649607987.5135] device (eno1): carrier: link connected
Apr 10 11:26:27 homeserver NetworkManager[6077]: <info>  [1649607987.5139] manager: (eno1): new Ethernet device (/org/f>
Apr 10 11:26:27 homeserver NetworkManager[6077]: <info>  [1649607987.5145] manager: (virbr0): new Bridge device (/org/f>
Apr 10 11:26:27 homeserver NetworkManager[6077]: <info>  [1649607987.5150] manager: (virbr0-nic): new Tun device (/org/>
Apr 10 11:26:27 homeserver NetworkManager[6077]: <warn>  [1649607987.5153] Error: failed to open /run/network/ifstate
Apr 10 11:26:27 homeserver NetworkManager[6077]: <info>  [1649607987.5172] manager: startup complete
Apr 10 11:26:27 homeserver NetworkManager[6077]: <info>  [1649607987.5236] modem-manager: ModemManager available

I'm not sure where to go from here. It seems to be fine from everything I can see but there's clearly a disconnect somewhere.
Edit: Additional research.
cat /etc/network/interfaces
cat: /etc/network/interfaces: No such file or directory

cat /etc/NetworkManager/NetworkManager.conf
[main]
plugins=ifupdown,keyfile

[ifupdown]
managed=false

[device]
wifi.scan-rand-mac-address=no

ls -al /etc/resolv.conf
lrwxrwxrwx 1 root root 39 Aug 24  2021 /etc/resolv.conf -> ../run/systemd/resolve/stub-resolv.conf

cat /etc/resolv.conf
# This file is managed by man:systemd-resolved(8). Do not edit.
#
# This is a dynamic resolv.conf file for connecting local clients to the
# internal DNS stub resolver of systemd-resolved. This file lists all
# configured search domains.
#
# Run "resolvectl status" to see details about the uplink DNS servers
# currently in use.
#
# Third party programs must not access this file directly, but only through the
# symlink at /etc/resolv.conf. To manage man:resolv.conf(5) in a different way,
# replace this symlink by a static file or a different symlink.
#
# See man:systemd-resolved.service(8) for details about the supported modes of
# operation for /etc/resolv.conf.

nameserver 127.0.0.53
options edns0 trust-ad

resolvectl status
Global
       LLMNR setting: no
MulticastDNS setting: no
  DNSOverTLS setting: no
      DNSSEC setting: no
    DNSSEC supported: no
          DNSSEC NTA: 10.in-addr.arpa
                      16.172.in-addr.arpa
                      168.192.in-addr.arpa
                      17.172.in-addr.arpa
                      18.172.in-addr.arpa
                      19.172.in-addr.arpa
                      20.172.in-addr.arpa
                      21.172.in-addr.arpa
                      22.172.in-addr.arpa
                      23.172.in-addr.arpa
                      24.172.in-addr.arpa
                      25.172.in-addr.arpa
                      26.172.in-addr.arpa
                      27.172.in-addr.arpa
                      28.172.in-addr.arpa
                      29.172.in-addr.arpa
                      30.172.in-addr.arpa
                      31.172.in-addr.arpa
                      corp
                      d.f.ip6.arpa
                      home
                      internal
                      intranet
                      lan
                      local
                      private
                      test

Link 5 (virbr0-nic)
      Current Scopes: none
DefaultRoute setting: no
       LLMNR setting: yes
MulticastDNS setting: no
  DNSOverTLS setting: no
      DNSSEC setting: no
    DNSSEC supported: no
Global
       LLMNR setting: no
MulticastDNS setting: no
  DNSOverTLS setting: no
      DNSSEC setting: no
    DNSSEC supported: no
          DNSSEC NTA: 10.in-addr.arpa
                      16.172.in-addr.arpa
                      168.192.in-addr.arpa
                      17.172.in-addr.arpa
                      18.172.in-addr.arpa
                      19.172.in-addr.arpa
                      20.172.in-addr.arpa
                      21.172.in-addr.arpa
                      22.172.in-addr.arpa
                      23.172.in-addr.arpa
                      24.172.in-addr.arpa
                      25.172.in-addr.arpa
                      26.172.in-addr.arpa
                      27.172.in-addr.arpa
                      28.172.in-addr.arpa
                      29.172.in-addr.arpa
                      30.172.in-addr.arpa
                      31.172.in-addr.arpa
                      corp
                      d.f.ip6.arpa
                      home
                      internal
                      intranet
                      lan
                      local
                      private
                      test

Link 5 (virbr0-nic)
      Current Scopes: none
DefaultRoute setting: no
       LLMNR setting: yes
MulticastDNS setting: no
  DNSOverTLS setting: no
      DNSSEC setting: no
    DNSSEC supported: no

Link 4 (virbr0)
      Current Scopes: none
DefaultRoute setting: no
       LLMNR setting: yes
MulticastDNS setting: no
  DNSOverTLS setting: no
      DNSSEC setting: no
    DNSSEC supported: no

Link 3 (br0)
      Current Scopes: DNS
DefaultRoute setting: yes
       LLMNR setting: yes
MulticastDNS setting: no
  DNSOverTLS setting: no
      DNSSEC setting: no
    DNSSEC supported: no
         DNS Servers: 192.168.0.1
                      8.8.8.8

Link 2 (eno1)
      Current Scopes: none
DefaultRoute setting: no
       LLMNR setting: yes
MulticastDNS setting: no
  DNSOverTLS setting: no
      DNSSEC setting: no
    DNSSEC supported: no

A: Ok, so this isn't an answer per-say but a reinstall of the OS (ubuntu server) fixed the problems. Ended up taking less time setting it up again than I've spent trying to trouble-shoot the actual problem. Nuclear option but with limited knowledge of what exactly went wrong, it was the easiest option.


text:
Q: Managing OpenCV python Cmake Studio Windows Recently ,  I wanted to install OpenCV (in Win10 64 bit ) using Cmake 3.5.0-rc3 and Visual studio 2015 . I have python 3.5 as root and 2.7 as python2 . The issue is while configuring it recognizes python 3.5 as main interpreter but i want  it to be 2.7.Is there a possible way to make cmake recognize 2.7 as my main python while maintaining python 3,5 in my PC . I can probably do it by deleting python 3.5 but i dont want that . Help is very much appreciated.Thanking you ,
P.S. If there is a simpler way to install OpenCV along with extramodules in WIndows ,please do tell me  thanks in advance

A: You should look for Python related variables in the CMake GUI. There may be some variables you could set to force paths to the python2.7 interpreter, libs and include dirs.


text:
Q: CFTHREAD Executing Twice I have a loop that calls a cfcomponent object.
    <cfset queue_list = "1,2,3">
    <cfloop list="#queue_list#" index="z">
                <cfset args = StructNew()>
                <cfset args.group_num = z>
<cfset args.client_id = 1>
                <cfset processdownloads = downloader.ProcessDownload(argumentCollection=args)>
            </cfloop>

The component has the following function:
    <cffunction name="ProcessDownload" access="public" output="false">
        <cfargument name="group_num" type="numeric" required="yes">
        <cfargument name="client_id" type="numeric" required="yes">

        <cfset variables = arguments>

        <cfthread action="RUN" name="download_#variables.client_id#_#variables.group_num#" priority="high">

                    <cffile action="WRITE" file="#expandpath('download\download_in_process\')##variables.group_num#.json" output="#variables.group_num#">

</cfthread>

</cffunction>

When I run it I receive the following error:
Attribute validation error for the cfthread tag. Thread with name DOWNLOAD_4003_3 could not be created. Thread names must be unique within a page. The error occurred on line 29.
I have no idea why but it seems to be running twice. Should it not be generating a new thread with a unique thread name, thus avoiding the tread name conflict?

A: Pass the group_num in as an attribute so you can access it internally without having issues with the variables scope being overwritten.
<cfthread action="RUN" name="download_#arguments.client_id#_#arguments.group_num#" priority="high" group_num="#arguments.group_num#">
    <cffile action="WRITE" file="#expandpath('download\download_in_process\')##attributes.group_num#.json" output="#attributes.group_num#">
</cfthread>

Everyone else is right, the issue is your variables scope.
What is happening is each loop is overwriting the variables scope, so when the thread is being created, it getting the thread name from variable scope, which is already set to 3... so all three threads might try and be set to the same name.
Can you name it using arguments? If not... you could use local. for the name and passing the info into the CFThread Creation.
You are correct about inside a component, you cannot access arguments etc, which behaves very differently from outside of a component.
Ben Nadel wrote a nice post about these issues
http://www.bennadel.com/blog/2215-an-experiment-in-passing-variables-into-a-cfthread-tag-by-reference.htm
Ben for the Win as usual.

A: It's likely because your CFC code is not thread-safe.
This:
<cfset variables = arguments>

Copies your function's arguments into the object's shared scope. If the downloader object is shared across requests, then each request is going to be using the other one's values.
Why are you copying your arguments into the objects variables scope? That seems like an odd thing to do.


text:
Q: How to fetch the result of ngxtop command in a file I need to ferch the result of ngxtop command in a file. But when i m trying to run it from a shell script file  it goes to a running state untill I manually kill or stop it...

A: I do this proccess with the next cli command group:
touch file.log && echo "please press CTRL+C to stop process and save ngxtop file.log" && ngxtop print request status http_referer >> file.log

When you run this code will save the output in file.log the you can show the informacion with next code:

cat file.log

This is an example when the process is complete and we load some sites in nginx while the command is executing screeshoot of ngxtop trace


text:
Q: Al tratar de mostrar un atributo de un objeto en una vista JSP java.lang.NumberFormatException: For input string: "idUsuario" tengo un problema, cuando intento mostrar el atributo de un elemento de una lista de objetos EN MI JSP que he añadido al model en el controlador, me da un error de NumberFormatException. No le veo ningún sentido. He buscado mil soluciones y no encentro nada que me sea de ayuda o que me solucione el problema.
En el POJO tengo todos los métodos getters y setters de todos los atributos. He revisado otros proyectos y todo está puesto de la misma forma, no sé qué podría estar fallando. En otro sitio leí que tal vez en vez de como objetos, el modelo lo está guardando como un String y no reconoce la propiedad, pero si es ese caso no lo veo claro ni tampoco la solución.
Me vendría bien un poco de ayuda. Gracias.
La traza es la siguiente:

GRAVE: El Servlet.service() para servlet [jsp] lanzó una excepción
java.lang.NumberFormatException: For input string: "idUsuario"
 at java.lang.NumberFormatException.forInputString(Unknown Source)
 at java.lang.Integer.parseInt(Unknown Source)
 at java.lang.Integer.parseInt(Unknown Source)
 at javax.el.ArrayELResolver.coerce(ArrayELResolver.java:144)
 at javax.el.ArrayELResolver.getValue(ArrayELResolver.java:61)
 at org.apache.jasper.el.JasperELResolver.getValue(JasperELResolver.java:110)
 at org.apache.el.parser.AstValue.getValue(AstValue.java:169)
 at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:190)
 at org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(PageContextImpl.java:944)
 at org.apache.jsp.WEB_002dINF.web.login_jsp._jspx_meth_c_005fforEach_005f0(login_jsp.java:213)
 at org.apache.jsp.WEB_002dINF.web.login_jsp._jspService(login_jsp.java:135)
 at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
 at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:476)
 at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:386)
 at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:330)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
 at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
 at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:728)
 at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:470)
 at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:395)
 at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:316)
 at org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:168)
 at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:303)
 at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1282)
 at org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1037)
 at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:980)
 at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897)
 at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
 at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:635)
 at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
 at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
 at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493)
 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
 at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:660)
 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
 at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:798)
 at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
 at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:808)
 at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498)
 at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
 at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
 at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
 at java.lang.Thread.run(Unknown Source)

ago 14, 2019 11:57:07 AM org.apache.catalina.core.StandardWrapperValve invoke
GRAVE: El Servlet.service() para el servlet [mvc-dispatcher] en el contexto con ruta [/GestionAlicia] lanzó la excepción [java.lang.NumberFormatException: For input string: "idUsuario"] con causa raíz
java.lang.NumberFormatException: For input string: "idUsuario"
 at java.lang.NumberFormatException.forInputString(Unknown Source)
 at java.lang.Integer.parseInt(Unknown Source)
 at java.lang.Integer.parseInt(Unknown Source)
 at javax.el.ArrayELResolver.coerce(ArrayELResolver.java:144)
 at javax.el.ArrayELResolver.getValue(ArrayELResolver.java:61)
 at org.apache.jasper.el.JasperELResolver.getValue(JasperELResolver.java:110)
 at org.apache.el.parser.AstValue.getValue(AstValue.java:169)
 at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:190)
 at org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(PageContextImpl.java:944)
 at org.apache.jsp.WEB_002dINF.web.login_jsp._jspx_meth_c_005fforEach_005f0(login_jsp.java:213)
 at org.apache.jsp.WEB_002dINF.web.login_jsp._jspService(login_jsp.java:135)
 at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
 at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:476)
 at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:386)
 at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:330)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
 at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
 at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:728)
 at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:470)
 at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:395)
 at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:316)
 at org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:168)
 at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:303)
 at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1282)
 at org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1037)
 at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:980)
 at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897)
 at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
 at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:635)
 at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
 at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
 at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493)
 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
 at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:660)
 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
 at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:798)
 at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
 at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:808)
 at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498)
 at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
 at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
 at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
 at java.lang.Thread.run(Unknown Source)

En mi controlador, añado la lista (que se obtiene correctamente de base de datos) de la siguiente forma:

@RequestMapping(method = RequestMethod.GET)
   public String list(Model model) {
     List<Usuario> usuarios = userFacade.findAll();
     model.addAttribute("usuarios", usuarios);
     return "web/login";
   }

Y en el JSP, que es donde mete el petardazo, lo que tengo es lo siguiente:

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>

 <title>Hola</title>

Lista de usuarios

        <c:forEach var="user" items="${usuarios}">

Codigo: ${user.idUsuario}

        </c:forEach>

EL POJO

@Entity
@Table(name = "usuario")
public class Usuario {
 @Id
 @Column(name="id_usuario")
 private Integer idUsuario;

 @Column(name="codigo_usuario")
 private String codigoUsuario;

 @Column(name="password")
 private String password;

 public Integer getIdUsuario() {
  return idUsuario;
 }

 public void setIdUsuario(Integer idUsuario) {
  this.idUsuario = idUsuario;
 }

 public String getCodigoUsuario() {
  return codigoUsuario;
 }

 public void setCodigoUsuario(String codigoUsuario) {
  this.codigoUsuario = codigoUsuario;
 }

 public String getPassword() {
  return password;
 }

 public void setPassword(String password) {
  this.password = password;
 }

 @Override
 public int hashCode() {
  final int prime = 31;
  int result = 1;
  result = prime * result + ((codigoUsuario == null) ? 0 : codigoUsuario.hashCode());
  result = prime * result + ((idUsuario == null) ? 0 : idUsuario.hashCode());
  return result;
 }

 @Override
 public boolean equals(Object obj) {
  if (this == obj)
   return true;
  if (obj == null)
   return false;
  if (getClass() != obj.getClass())
   return false;
  Usuario other = (Usuario) obj;
  if (codigoUsuario == null) {
   if (other.codigoUsuario != null)
    return false;
  } else if (!codigoUsuario.equals(other.codigoUsuario))
   return false;
  if (idUsuario == null) {
   if (other.idUsuario != null)
    return false;
  } else if (!idUsuario.equals(other.idUsuario))
   return false;
  return true;
 }

 @Override
 public String toString() {
  return "usuario [idUsuario=" + idUsuario + ", codigoUsuario=" + codigoUsuario + "]";
 }

}

A: HE encontardo la solución, quizás le sirva a alguien que tenga el mismo problema. El problema estaba en el DAO. Me di cuenta de que no me estaba trayendo una lista de Usuarios, sino una lista de Objectos, por lo cual no encontraba la propiedad idUsuario (supongo).
Mi dao antes de ser corregido:

public List<Usuario> findAll() {
  Session session = getHibernateTemplate().getSessionFactory().getCurrentSession();
  List<Usuario> lista = (List<Usuario>)session.createSQLQuery("SELECT * FROM usuario").list();
  return lista;
 }

Y mi dao correcto:

public List<Usuario> findAll() {
  Session session = getHibernateTemplate().getSessionFactory().getCurrentSession();
  List<Usuario> lista = (List<Usuario>)session.createQuery("FROM Usuario").list();
  return lista;
 }

Por algún motivo, el SQL no lo estaba haciendo yo bien porque no enlazaba bien con el objeto "Usuario", así que de momento he optado por el HQL y va tirando.


text:
Q: Как реализовать нормальное меню? Есть класс в котором перегружаются операции. В main происходит тестирование перегрузок, т.е. я выбираю из меню какие именно операции нужно протестировать. Не могу сделать нормальное зацикленное меню, то есть тестировать пока пользователь не введет "4" - выход из программы. И как можно сделать вот этот код проверки введенного пользователем значения отдельной функцией:
cin.clear();
while (cin.get() != '\n');
cout << "Ошибка! Повторите попытку: ";

Сама программа:
//Программа тестирует класс "Еда"

#include"Food.h"
#include<iostream>

/*Тестирование перегруженной операции декремента
Входные данные: ссылка на экземпляр класса Food;
Выходные данные: модификация значения срока годности продукта*/
void operation1(Food& object1) {
    cout << "\nОперация <Перегрузка декремента>." << endl;
    cout << "Операнд: " << object1.get_product_shelf_life() << "дней" << endl;
    --object1;
    cout << "Результат операции: " << object1.get_product_shelf_life() << "дней" << endl;
}
/*Тестирование перегруженной операции +=
Входные данные: ссылки на экземпляры класса Food;
Выходные данные: модификация значения имени левого операнда*/
void operation2(Food& object1, Food object2) {
    cout << "\n<Перегрузка операции +=>." << endl;
    cout << "Операнд 1: " << object1.get_name() << "\nОперанд 2: " <<  object2.get_name() << endl;
    object1 += object2;
    cout << "Результат операции: " << object1.get_name() << endl;
}
/*Тестирование перегруженной операции сравнения (>)
Входные данные: ссылки на экземпляры класса Food;
Выходные данные: true - если значение левого операнда больше чем значение правого,
                 false - если значение значение левого операнда меньше чем правого*/
void operation3(Food& ob1, Food& ob2) {
    cout << "\n<Перегрузка операции " << "(>)>." << endl;
    cout << "Операнд 1: " << ob1.get_name() << " - " << ob1.get_calories() << " ккал" << endl;
    cout << "Операнд 2: " << ob2.get_name() << " - " << ob2.get_calories() << " ккал" << endl;
    cout << "Результат операции: ";
    if (ob1 > ob2) cout << "калорийность " << ob1.get_name() << " больше чем " << ob2.get_name() << endl;
    else { cout << "калорийность " << ob2.get_name() << " больше чем " << ob1.get_name() << endl;}
}

int main(){
    setlocale(LC_ALL, "rus");
    int reg;
    bool flag = true;
    Food f1("Шоколад", 500, 30.0, 100);
    Food f2("Кофе", 150, 10.0, 360);
    f1.Print();
    f2.Print();
    do {
        cout << "1.Перегрузка операции --;\n2.Перегрузка операции +=;\n3.Перегрузка операции >;\n4.Выйти из программы.";
        cout << "\nСделайте выбор: ";
        cin >> reg;
        switch (reg) {
        case 1: {operation1(f1); }
        case 2: {operation2(f1, f2); }
        case 3: {operation3(f1, f2); }
        case 4: {exit(0); }
        }
    } while (flag);
    cin.get();
    return 0;
}

A: Можно вот так:
int main(){
    setlocale(LC_ALL, "rus");
    int reg;
    bool flag = true;
    Food f1("Шоколад", 500, 30.0, 100);
    Food f2("Кофе", 150, 10.0, 360);
    f1.Print();
    f2.Print();
    while(true) {
        cout << "1.Перегрузка операции --;\n2.Перегрузка операции +=;\n3.Перегрузка операции >;\n4.Выйти из программы.";
        cout << "\nСделайте выбор: ";
        cin >> reg;
        switch (reg) {
        case 1: {operation1(f1); break;}
        case 2: {operation2(f1, f2); break; }
        case 3: {operation3(f1, f2); break; }
        case 4: {return 0; }
        }
}


text:
Q: What regex will capitalize any letters following whitespace? I'm looking for a Perl regex that will capitalize any character which is preceded by whitespace (or the first char in the string).
I'm pretty sure there is a simple way to do this, but I don't have my Perl book handy and I don't do this often enough that I've memorized it...

A: Depending on your exact problem, this could be more complicated than you think and a simple regex might not work.  Have you thought about capitalization inside the word?  What if the word starts with punctuation like '...Word'?  Are there any exceptions?  What about international characters?
It might be better to use a CPAN module like Text::Autoformat or Text::Capitalize where these problems have already been solved.
use Text::Capitalize 0.2;
print capitalize_title($t), "\n";

use Text::Autoformat;
print autoformat{case => "highlight", right=>length($t)}, $t;

It sounds like Text::Autoformat might be more "standard" and I would try that first.  Its written by Damian.  But Text::Capitalize does a few things that Text::Autoformat doesn't.  Here is a comparison.
You can also check out the Perl Cookbook for recipie 1.14 (page 31) on how to use regexps to properly capitalize a title or headline.

A: Something like this should do the trick -
s!(^|\s)(\w)!$1\U$2!g

This simply splits up the scanned expression into two matches - $1 for the blank/start of string and $2 for the first character of word. We then substitute both $1 and $2 after making the start of the word upper-case.
I would change the \s to \b which makes more sense since we are checking for word-boundaries here.

A: s/(\s\w)/\U$1\E/g;

I originally suggested:
s/\s\w/\U$&\E/g;

but alarm bells were going off at the use of '$&' (even before I read @Manni's comment).  It turns out that they're fully justified - using the $&, $` and $' operations cause an overall inefficiency in regexes.
The \E is not critical for this regex; it turns off the 'case-setting' switch \U in this case or \L for lower-case.

As noted in the comments, matching the first character of the string requires:
s/((?:^|\s)\w)/\U$1\E/g;

Corrected position of second close parenthesis - thanks, Blixtor.

A: This isn't something I'd normally use a regex for, but my solution isn't exactly what you would call "beautiful":
$string = join("", map(ucfirst, split(/(\s+)/, $string)));

That split()s the string by whitespace and captures all the whitespace, then goes through each element of the list and does ucfirst on them (making the first character uppercase), then join()s them back together as a single string. Not awful, but perhaps you'll like a regex more. I personally just don't like \Q or \U or other semi-awkward regex constructs.
EDIT: Someone else mentioned that punctuation might be a potential issue. If, say, you want this:
...string

changed to this:
...String

i.e. you want words capitalized even if there is punctuation before them, try something more like this:
$string = join("", map(ucfirst, split(/(\w+)/, $string)));

Same thing, but it split()s on words (\w+) so that the captured elements of the list are word-only. Same overall effect, but will capitalize words that may not start with a word character. Change \w to [a-zA-Z] to eliminate trying to capitalize numbers. And just generally tweak it however you like.

A: If you mean character after space, use regular expressions using \s. If you really mean first character in word you should use \b instead of all above attempts with \s which is error prone.
s/\b(\w)/\U$1/g;

A: You want to match letters behind whitespace, or at the start of a string.
Perl can't do variable length lookbehind. If it did, you could have used this:
s/(?<=\s|^)(\w)/\u$1/g;    # this does not work!

Perl complains:
Variable length lookbehind not implemented in regex;

You can use double negative lookbehind to get around that: the thing on the left of it must not be anything that is not whitespace. That means it'll match at the start of the string, but if there is anything in front of it, it must be whitespace.
s/(?<!\S)(\w)/\u$1/g;

The simpler approach in this exact case will probably be to just match the whitespace; the variable length restriction falls away, then, and include that in the replacement.
s/(\s|^)(\w)/$1\u$2/g;

Occasionally you can't use this approach in repeated substitutions because that what precedes the actual match has already been eaten by the regex, and it's good to have a way around that.

A: Capitalize ANY character preceded by whitespace or at beginning of string:
s/(^|\s)./\u$1/g

Maybe a very sloppy way of doing it because it's also uppercasing the whitespace now. :P
The advantage is that it works with letters with all possible accents (and also with special Danish/Swedish/Norwegian letters), which are problematic when you use \w and \b in your regex. Can I expect that all non-letters are untouched by the uppercase modifier?


text:
Q: Passing Routerlink to child component I create a component in my shared module, it is header component so in all of my components I want to call this.
In my shared component, let call it app-header component, I want to accept input Title: string, buttonName: string and buttonLink: any (since I am confused)
my component:
import { Component, OnInit, Input } from '@angular/core';
import { RouterLink } from '@angular/router';

@Component({
  selector: 'app-app-header',
  templateUrl: './app-header.component.html',
  styleUrls: ['./app-header.component.less']
})
export class AppHeaderComponent implements OnInit {
    @Input() title: string;
    @Input() buttonName: string;
    @Input() buttonLink: any;

  constructor() { }

  ngOnInit() {
  }

}

my app.header.html

 {{title}}

      <button class="btn btn-primary pull-right" [routerLink]={{buttonLink}}>{{buttonName}}</button>

I pass use this component in my other component :

my shared module:
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { SharedComponent } from './shared.component';
import { AppHeaderComponent } from './app-header/app-header.component';

@NgModule({
  imports: [
    CommonModule,
  ],
  providers: [],
  declarations: [
      SharedComponent,
    AppHeaderComponent],
  exports:[
      AppHeaderComponent,
  ]
})
export class SharedModule { }

My problem is I don't know how to pass the link so the routerlink will work.
Any idea how to pass the link / router link in proper way ? the routes belong to the component's module who call it.
I have many lazy loaded modules which will use this shared component. So I guess the route should be able to redirect/call link from its caller component module.
Edited: add more information
Shared Module : AppHeaderComponent  (this has no Routes)
AdminModule: AdminComponent -> call AppHeaderComponent inside (AdminModule has Routes)
UserMoudule: UserComponent -> call AppHeaderComponent inside (UserModule has Routes)
I need AppHeaderComponent to link to correct routeLink.
Example:
in UserComponent:
<app-app-header
    [title]= "'Users'"
    [buttonName]="'Create New'"
    [buttonLink]="['/user/create']"
></app-app-header>

A: To make routing work in your SharedModule, you'll also have to add the RouterModule to your imports array.
...
import { RouterModule } from '@angular/router';

@NgModule({
  imports: [
    CommonModule,
    RouterModule
  ],
  ...
})
export class SharedModule {}

Also, in your HeaderComponent, you'll need to fix the routerLink assignment:
...
<button
  class="btn btn-primary pull-right"
  [routerLink]="buttonLink">
  {{buttonName}}
</button>
...

And you should be using this component like this(WITHOUT []):
<app-app-header
  [title]="'Organisations'"
  [buttonName]="'Create New'"
  [buttonLink]="'/admin/user/create'">
</app-app-header>

A: I think you need a little bit change your code. You need to pass your link by using another construction.  [routerLink]="buttonLink".
More about template expression and interpolation you can read on official documentation of angular