text:
Q: CM abelian varieties and potential good reduction Let $F$ be a number field and $A$ an abelian variety over $F$. It is known that if $A$ has complex multiplication, then it has potentially good reduction everywhere, namely there exists a finite extension $L$ of $F$ such that $A_L$ has good reduction over every prime of $L$.
And what about the inverse: if $A$ is known to be of potential good reduction everywhere, how far is it from having complex multiplication?
As the reduction behavior is determined by the Galois representations of the decompositon groups, one can reformulate the problem as follows: let $A$ be an abelian variety over $F$, $p$ a fixed rational prime, $V$ the p-adic Tate module of $A$; and for $\lambda$ primes of $F$, $\rho_\lambda$ is the $p$-adic representation on $V$ of the decomposition group $G_\lambda$ at $\lambda$. If $\rho_\lambda$ is potentially unramified for $\lambda$ not dividing $p$, and potentially cristalline for $\lambda$ dividing $p$, do we know that the global Galois representation $\rho$ on $V$ is potentially abelian, i.e. when shifting to some open subgroup, the image of $\rho$ is contained in a torus of $GL_{\mathbb{Q}_p}(V)$? What do we know about the Fontaine-Mazur conjecture in this case?
Thanks!

A: No, absolutely not
In fact, the hypotheses you discuss are rather weak. Take $F$ a totally real number field. If $A/F$ is the abelian variety attached to an eigenform $f$ of weight $2$ and level $N$, then the representation $\rho$ attached to the $p$-adic Tate module of $A$ is crystalline at $p$ for $p\nmid N$ . At $\ell≠p$, the representation $\rho$ is potentially unramified if and only if the automorphic representation $\pi(f)_{\ell}$ is principal series of supercuspidal (i.e
not Steinberg). This certainly happens a lot. All such eigenforms do not have potential CM.
I'm not sure I understand your question about the Fontaine-Mazur conjecture but much is known in the set-up that you seem to be interested in. For instance, if $F$ is totally real and $p\geq 7$ then an odd $G_F$-representation in $\operatorname{GL}_{2}(\mathbb F_{p})$ which stays irreducible after restriction to $G_{F(\zeta_{p})}$ comes from the Tate module of an abelian variety $A/F$.

A: Potential good reduction everywhere is quite far from having complex multiplication.
For elliptic curves, the condition is equivalent to the $j$-invariant being an algebraic integer. For $F = \mathbb{Q}$ there are only finitely many $j$-invariants of CM elliptc curves (corresponding to the imaginary quadratic fields of class number $1$) but any element of $\mathbb{Z}$  is of course the $j$-invariant of an elliptic curve over $\mathbb{Q}$.


text:
Q: React + Nodejs with Passport.js authentication I am using react for frontend, nodejs as backend and passport-google-oauth2 for authenticating users with googles oauth api.
When a user logs in, I create a new user or I find an existing user, set a cookie to know that the user is logged in.
The problem is in development I am using webpack development server and a node server. Therefore the cookies arent saved properly. I have tried using proxies in the development server but I haven't got it to work.
What is best practice here? Am I not supposed to use cookies?
Thanks in advance.

redpajama_set_name: RedPajamaStackExchange


text:
Q: Fluent NHibernate : How can i use Int64 as ID? I'm quite new to the whole concept of ORM, NHibernate and FluentNH, and i'm trying to accomplish something that seems so simple...
I'm trying to retrieve an object that has a field defined as Int64 in it's class. This field would be the ID, as defined in the Map file.
When trying to retrieve a record from the DB, NHibernate returns the following error message :  "Provided id of the wrong type. Expected: System.Int32, got System.Int64"
I have a very simple object :
public class Holiday
{
    public virtual Int64 HolidayID { get; set; }
    public virtual string Name { get; set; }
    public virtual int Day { get; set; }
    public virtual int Month { get; set; }
    public virtual bool IsActive { get; set; }
    public virtual HolidayGroup Group { get; set; }

    public Holiday() { }

}

the Mapping file (for FluentNH) is the following :
public class HolidayMap : ClassMap<Holiday>
{
    public HolidayMap()
    {

        Id(x => x.HolidayID);
        Map(x => x.Name);
        Map(x => x.Day);
        Map(x => x.Month);
        Map(x => x.IsActive);
        HasOne(x => x.Group);
    }
}

the table structure (generated by NH) is the following:
CREATE TABLE [dbo].[Holiday](
 [HolidayID] [bigint] IDENTITY(1,1) NOT NULL,
 [Name] [nvarchar](255) NULL,
 [Day] [int] NULL,
 [Month] [int] NULL,
 [IsActive] [bit] NULL,
 [HolidayGroup_id] [int] NULL,
PRIMARY KEY CLUSTERED
(
 [HolidayID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF,
ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

and finally, i am trying to retrieve the Holiday instance using this:
    public static Holiday Get(Int64 _holidayID)
    {
        Holiday _holiday = new Holiday();

        try
        {
            using (var session = Global.NHibernate_SessionFactory.OpenSession())
            {
                _holiday = session.Get<Holiday>(_holidayID); // EXCEPTION OCCURS HERE
            }
        }
        catch (Exception _ex)
        {
            // TODO : Implement proper logging
        }

        return _holiday;
    }

What am i doing wrong??  What's missing?  When deleting the table and redefining my object using an Int32 for the ID, everything works!  I need use a bigger type!
Many thanks!
EDIT 1 : As Aaronaught mentions, i agree, my need for an Int64 is a bit of overhead for storing holidays...  But for a second, let's forget the "Holidays" concept.  What am i going to do with my logging table (5 to 10 events (rows) per seconds!).  Thanks!
EDIT 2 : @Paco : I'm using NHibernate 2.1.2.4000 and FluentNH 1.0.0.614
EDIT 3 : After rerading Daniel Schilling's solution, rebuilt a (brand new) simple Holiday object that used an Int64 as an ID.  I was able to retrieve a record from the DB successfully.  As soon as i added a relationship to a Group object, when instanciating a Holiday object i received the same error message as earlier...  Here is the HolidayGroup class and mapping, in case you can tell me what i did wrong...
public class HolidayGroup
{
    public virtual int HolidayGroupID { get; set;}
    public virtual string Name { get; set; }
    public virtual string Notes { get; set; }
    public virtual bool IsActive { get; set; }
    public virtual IList<Holiday> Holidays { get; set; }

    public HolidayGroup()
    {
        Holidays = new List<Holiday>();
    }
}

public HolidayGroupMap()
 {
  Id(x => x.HolidayGroupID);
  Map(x => x.Name);
  Map(x => x.Notes);
  Map(x => x.IsActive);
  HasMany(x => x.Holidays)
   .Cascade.All()
 }

A: I know it's not really helpful to just say that it works for me, but ... it works for me.  I use long for my id's all the time with Fluent NHibernate.  My versions:

*

*NHibernate 2.1.0.4000

*Fluent NHibernate 1.0.0.598

As others have commented, it's possible that this could be a problem with NHibernate or Fluent NHibernate.  To figure out where the problem is, use the ExportTo method to find out what *.hbm.xml Fluent NHibernate is generating.  See the "Exporting mappings" section on https://github.com/jagregory/fluent-nhibernate/wiki/Fluent-configuration.
If FluentNHibernate is working correctly, you should see something like ...
<id name="HolidayID" type="System.Int64, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
  <column name="HolidayID" />
  <generator class="identity" />
</id>

... in the *.Holiday.hbm.xml file.  If you see that System.Int64, then the issue must be in NHibernate or in your code.  If the problem is with NHibernate - it must be a problem introduced since 2.1.0 (since it works for me).  Try using the same version I'm using.  If the problem goes away, then it was the new version of NHibernate's fault.
If that doesn't fix the problem, then (unfortunately) the problem most likely lies in your own code.  How is Global.NHibernate_SessionFactory instantiated?  Is it possible that one Configuration object is being used to export the schema and another instance is creating the SessionFactory?
Those are all the ideas I have.  Good luck.
EDIT 1:
Regarding the relationship to HolidayGroup (sorry - didn't notice that before): I think you mean References instead of HasOne - see question 1622007.  Also, you need to mark one side of the relationship Inverse() - typically you would put that on the HasMany side.
EDIT 2:
The incorrectly applied HasOne is surely the source of this error.  One-to-one relationships are mapped by default with two tables that share primary keys in common.  The child's primary key column would typically have a foreign key relationship to the parent's primary key.  By saying "Holiday has-one HolidayGroup", you set Holiday up as the parent and HolidayGroup as the child (which is the reverse of what you wanted).
When NHibernate tries to load the Holiday that is associated with the HolidayGroup, it will take HolidayGroup's Int32 ID and try to retrieve a Holiday that has the same ID.  However, Holiday has a Int64 ID, hence the error.
Make the changes under "EDIT 1", and this problem should go away.

*

*Change the HasOne to References.

*Add Inverse() to HolidayGroup's HasMany.

A: Have you tried this?
public class HolidayMap : ClassMap<Holiday>
{
    public HolidayMap()
    {

        Id(x => x.HolidayID).SetAttribute("type", "Int64");
        Map(x => x.Name);
        Map(x => x.Day);
        Map(x => x.Month);
        Map(x => x.IsActive);
        HasOne(x => x.Group);
    }
}


text:
Q: Updating row in MYSQL from PHP form Outline of what I'm trying to do: I have a table in my db called agents , one of the columns in the table is called activated. I want to be able to enter the agents username (row 1 in the agents table) and then have the row within the column for activated update to a 1 (instead of the default of 0 which identifies the user as not activated). I'm clearly going wrong, can someone point out where?? Thank you all for your time.
<?php
error_reporting(E_ALL & ~E_NOTICE);
session_start();
if (isset($_SESSION['id'])){
$userId = $_SESSION['id'];
$username = $_SESSION['username'];
} else {
header('Location: home.php');
die();
}
?>
<?php
if($_POST['submit']){
include_once("connection.php");
$username = strip_tags($_POST['username']);
$sql = "SELECT username, FROM agents WHERE username = '$username'";
$query = mysqli_query($dbCon, $sql);
if ($query) {
$row = mysqli_fetch_row($query);
$dbUsername = $row[1];
}
?>
<?php
$dbUsername = $row[1];
if ($username == $dbUsername){
$sql2 = "UPDATE agents SET activated ='1' WHERE $username = username";
$query2 = mysqli_query($dbCon, $sql2);
header('Location: userstaff.php');
} else {
echo "Problem detected.";
}
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Activate agent</title>
</head>
<body>
<h1> Activate agent </h1>
<form method="post" action="activateagent.php">
<input type="text" placeholder="Username" name="username" />
<input type="submit" name="submit" value="activate" />
</form>
</body>
</html>

A: you have an extra comma(,) in your select query
$sql = "SELECT username, FROM agents WHERE username = '$username'";


text:
Q: is it possible to pass the message from sp_add_alert to the job? sp_add_alert stored procedure can react to different system messages and execute a job in response. It also can notify a person with the message text by email, pager of net send.
But how do I pass the sysmessage message (corresponding to the event that caused the alert) not to a person but to the job that is executed in response to the alert?
Let's consider this message:
select [description] from sysmessages where msglangid = 1033 and error = 829

This will yeild:

Database ID %d, Page %S_PGID is marked RestorePending, which may
  indicate disk corruption. To recover from this state, perform a
  restore.

I'd like to receive this message in the job, so the job knows what %d and %S_PGID caused a problem.

A: This article gives the answer. Basically the message is accessible by using SQL Server Agent Tokens and Macros.
In particular this Job Step that is calling a stored procedure worked for me nicely:
exec ProcessMyAlert '$(ESCAPE_SQUOTE(A-MSG))'

Note that I had to

right-click SQL Server Agent in Object Explorer, select Properties,
  and on the Alert System page, select Replace tokens for all job
  responses to alerts to enable these tokens.

As per the linked article. In addition I had to restart SQL Server Agent so that this setting come into effect - it did not work until I restarted it, the article does not mention the restart however.


text:
Q: Best Practice for Custom Validations in Angular If I wanted to disable a button if a certain String(s) was detected in a textarea tag within my Template-Drive/Reactive-Driven form in my Angular application, how could I do this? Which resources would be the best to tend to regarding this information?

A: <button [disabled]="isForbiddenStringFound() ? true : null"></button>

A: As a general best practice try not to mix template driven and reactive way. I would rather to use reactive forms. You only need to define you form fields as a group usin for example the form builder and add your validations with for example, a regexp. I think it is the most customizable way to achieve your goal. There are a lot of good examples on internet.


text:
Q: jQuery hash change not firing on mobile I have a menu that is using anchor tags to serve different content depending on which anchor is selected. When the menu item is fired an active class is added to the parent by matching the hash on the link with the hash in the browser url.
Everything works perfectly on desktop but once I go to mobile I it does not fire.
The code is as follows:

$(window).on('hashchange', function(e) {
    if ($('.menu-item').hasClass('active')) {
        $(".menu-item").removeClass("active");
        $('[href$="' + window.location.hash + '"]').parent(this).addClass("active");
    }
});
#artistNavigation {
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
  padding: 0;
  text-align: left;
  width: 100%;
  height: auto;
  margin: 0 auto;
  position: relative;
  font-family: "Oswald", sans-serif;
  box-shadow: 0 1px 0 0 #ddd;
  -webkit-box-shadow: 0 1px 0 0 #ddd;
}
@media (max-width: 1000px) {
  #artistNavigation {
    padding-top: 50px;
    width: calc(100% - 60px);
    position: relative;
  }
  #artistNavigation.open li.menu-item {
    display: block;
  }
}
#artistNavigation li {
  display: inline-block;
  *display: inline;
  zoom: 1;
  text-align: left;
  vertical-align: middle;
  padding-right: 45px;
  position: relative;
  /*active state*/
}
@media (max-width: 1000px) {
  #artistNavigation li {
    display: block;
    text-align: center;
  }
  #artistNavigation li.mobi {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 30px;
    z-index: 99;
  }
  #artistNavigation li.menu-item {
    display: none;
    list-style-type: none;
  }
  #artistNavigation li.active {
    display: block !important;
    position: absolute;
    top: 0;
    left: 0;
    right: 70px;
    height: 30px;
    z-index: 89;
    display: block;
    background: #fff;
  }
  #artistNavigation li.active a {
    -webkit-transform: translateX(35px);
    transform: translateX(35px);
  }
}
#artistNavigation li a {
  -webkit-transition: color 200ms ease;
  -moz-transition: color 200ms ease;
  -o-transition: color 200ms ease;
  -ms-transition: color 200ms ease;
  transition: color 200ms ease;
  display: inline-block;
  *display: inline;
  zoom: 1;
  padding: 17px 0;
  text-align: center;
  font-size: 12px;
  line-height: 15px;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  color: #b2b2b2;
  position: relative;
  border-bottom: solid 2px transparent;
}
@media (max-width: 1000px) {
  #artistNavigation li a {
    padding: 1rem 0;
  }
}
#artistNavigation li a,
#artistNavigation li a:visited,
#artistNavigation li a:active,
#artistNavigation li a:link {
  color: #b2b2b2;
}
#artistNavigation li:hover > a,
#artistNavigation li:focus > a,
#artistNavigation li.active a {
  color: #000;
  border-bottom: solid 2px #25cbd3;
}
#artistNavigation li.pdf {
  position: absolute;
  right: 0;
  top: 12px;
  padding-right: 0;
  text-transform: uppercase;
  font-size: 12px;
  color: #25cbd3;
  padding-bottom: 16px;
  border-bottom: solid 2px transparent;
}
#artistNavigation li.pdf:hover {
  cursor: pointer;
  color: #454545;
}
@media (max-width: 1000px) {
  #artistNavigation:hover,
  #artistNavigation:focus {
    height: auto;
  }
  #artistNavigation li:active {
    position: absolute;
    top: 0;
  }
}

Commercial

Fashion

Lifestyle

Portaits

Places

Animals

Great White Shark

Panoramics

Masai

I'm sure it is something simple I am missing, please excuse the sass generated CSS.

A: You can try to use an addEventListener for detect hash change.
window.addEventListener("hashchange",function(event){
    if ($('.menu-item').hasClass('active')) {
        $(".menu-item").removeClass("active");
        $('[href$="' + window.location.hash + '"]').parent(this).addClass("active");
    }
});

Find more about if browser compatible here

A: It turned out to be a CSS issue - I removed all instances of the :active state and replaced it with my .active class. The :active state would move the item rhough css from a position relative to a position absolute - so when the click was down the menu item would have moved. 2 and half hours for a full stop :/


text:
Q: Why does my content in the canvas in tkinter doesn't gets scrolled? Even tho I have linked scrollbar to it? I have created tkinter window and created a frame and in that frame, I have created a canvas and also linked scrollbar to it. In canvas I have created 3 labels one below other.
Now, when I try to scroll, the slider just moves and the label doesn't move.
Why is this happening? I am a new to python and tkinter can you guys please tell where am I going wrong or am I missing some code?

Here you can see that I am trying to scroll but only the slider is moving but not the label, that is, the content inside it.
So this is my code:
def news_frame():

    my_frame=Frame(mw)
    my_frame.pack()

    my_scrollbar=Scrollbar(my_frame,orient=VERTICAL)
    my_scrollbar.pack(side=RIGHT,fill=Y)

    my_canvas=Canvas(my_frame,width=1980,height=1200,scrollregion=
    (0,0,2000,1500),yscrollcommand=my_scrollbar.set)
    my_canvas.pack()

    label1=Label(my_canvas,text=title)
    label1.place(x=500,y=20)
    my_scrollbar.config(command=my_canvas.yview)

    newslblframe=Label(my_canvas,bg="white",bd=5,relief=RAISED)
    newslblframe.place(x=20,y=45,width=1320,height=245)

    newslblframe2=Label(my_canvas,bg="white",text=title,bd=5,relief=RAISED)
    newslblframe2.place(x=20,y=300,width=1320,height=245)

    newslblframe2=Label(my_canvas,bg="white",text=title,bd=5,relief=RAISED)
    newslblframe2.place(x=20,y=553,width=1320,height=245)


text:
Q: retrieve html from web page with chrome dev tools I need to retrive html using chrome dev tools protocol but I have sum problem and the behaviour is not how expected
I'm using https://chromedevtools.github.io/devtools-protocol/tot/DOM/#method-getOuterHTML and PyChromeDevTools for manage chrome page
from terminal
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222

python script
import PyChromeDevTools

chrome = PyChromeDevTools.ChromeInterface(host='localhost',port=9222)
chrome.Network.enable()
chrome.Page.enable()
chrome.Page.navigate(url="https://stackoverflow.com")
html_code=chrome.DOM.getOuterHTML()
print(html_code)

I'm not sure that DOM.getOuterHTML its the correct command but seems good for the purpose

A: You have to wait until the page is loaded in browser. The library you use has an example for that in README.
chrome.Page.navigate(url="http://www.google.com/")
chrome.wait_event("Page.loadEventFired", timeout=60)

The DOM interface may need chrome.DOM.getDocument() before accessing the elements.


text:
Q: Align window to center of the page after changing width and height in ExtJs 4 I have a window and my requirement is that I have to change the window's height and width during the onchange event of a dropdown.
That works fine but I'm not able to align the window to the center of the browser/page after resize. I had surfed through the net for a while but I'm not able to find a solution.
Can this be done with the resize event of a window? If so, please let me know how to do it. I have not posted any code since I'm not sure where to start with.

A: The best place to start is always the docs :)
Have you tried the center() method of Ext.window.Window?


text:
Q: jquery show or hide checkbox based on action I'm looking to show or hide a series of checkboxes based on a click of a link. I'm pretty sure this is achievable using jQuery but haven't found a good reference on stackoverflow (yet).
<input type="checkbox" value=someval>

I'm guessing I need to add a class to the input box, then have jquery toggle the show/hide attribute?

A: Add a class to the chckbox
<input type="checkbox" class="myitems" value=someval>

then
jQuery(function($){
    $('mylink').click(function(){
        $('.myitems').toggle();
    })
})


text:
Q: Error when activating a custom plugin on production server I'm currently developing a custom plugin. All works well on my local dev environment (Local by Flywheel), but, on production environment, I'm unable to activate the plugin. I get this error message:
Fatal error: Class 'Activate' not found in /datas/vol3/w4a156338/var/www/my-website/htdocs/wp-content/plugins/ads-toolbox/ads-toolbox.php on line 54
The 'ads-toolbox.php' file it the plugin main php file and it contains the following:
function activate_adstoolbox_plugin() {
    Inc\Base\Activate::activate();
}
register_activation_hook( __FILE__, 'activate_adstoolbox_plugin' );
Line 54 is: Inc\Base\Activate::activate();
The class 'Activate' is inside the 'Activate.php' file located in 'inc/Base/' subdirectory and contains:
namespace Inc\Base;

class Activate
{
    public static function activate()
    {
        //Some code
    }

}
I do not understand why it works locally but not on my hosted site!?
Any idea ?

A: Thanks to @the_hobbes and @Charles, I realized that the file Activate.php was not incorporated. By adding require_once plugin_dir_path( __FILE__ ) . 'inc/Base/Activate.php'; to my code as shown below, it works correctly:
function activate_adstoolbox_plugin() {
    require_once plugin_dir_path( __FILE__ ) . 'inc/Base/Activate.php';
    Inc\Base\Activate::activate();
}
register_activation_hook( __FILE__, 'activate_adstoolbox_plugin' );
Oops! Newbie's error ...


text:
Q: Deduplicate CSS rule in class and media query I currently have a CSS with rules which are duplicates in both .small and the media query for #a, because I want the same behaviour when browser width is smaller than 600px and when a button is clicked.
In my real case, the rules are very long, and I would like to avoid to duplicate them. How to deduplicate such a CSS?

$('#b').click(function(){ $('#a').addClass('small'); });
#a { background-color: green; }
.small { background-color: yellow !important; /* many other rules */ }

@media (max-width: 600px) {
    #a { background-color: yellow !important; /* many other rules */ }
}

Hello

<input id="b" type="button" value="Change" />

A: I don't think there's a way to do this in pure CSS, this is one of the things you can solve with precompilers like SASS where you can inject CSS rules anywhere you want with variables or mixins for example

A: I can think of Javascript solution to your problem.
window.onresize = function(event){
 if(window.innerWidth < 600px){
  // add the class to the element
 }else{
 // remove the class
 }
}

I don't think you can achive what you want in any other way without using precompiler.

A: You'd have to use a CSS pre-processor to do this.
Otherwise you'd have to use jQuery to toggle some other class based on viewport width or assign the .small styles to #a as well, then make a media query to undo it all when you don't want it to look like that.


text:
Q: select2 attribute "data-init-text" I would like to populate a select, but do not have the associated description.
Only have value.
I am using (select2):
$( '#element' ).attr( "data-init-text", "" ).val( value ).change();

but does not work because I have no description
I'm using a hidden input as an ajax call.

A: You need to get the text (which you call the description) for the id (which you call the value). Since you are using ajax for the Select2 data, you could use an ajax call to get the text for an id.
You would supply an initSelection function that makes the ajax call. It might look something like this:
initSelection: function(element, callback) {
    var id= $(element).val();
    if (id) {
        $.ajax('/this/is/the/url/', {
            data: { id: id },
            dataType: 'json',
            success: function(data) { callback(data); } });
    }
}

In this case the ajax call passes the "id" parameter and is expected to return json that looks like this:
{ id: 'the_passed_in_id', text: 'the_text_for_the_id' }

Demo on JSFiddle

A: Just create your normal select:
<select id='myId'>

 <option value='val1'>Option 1<option>

 <option value='val2'>Option 2<option>

</select>

$('#myId').select2();
That how you create a select2.
If you want to select an option:
$('#myId').select2('val', 'val2');
In this case Option 2 is selected.


text:
Q: Using Hibernate .hbm.xml mapping for JPA metamodel generation I am attempting to generate the JPA metamodel from the Hibernate mapping configuration (.hbm.xml) using JDK 8 and Hibernate 5.2.0. From the output I see it is finding the Hibernate Static Metamodel generator, but it does not appear to be detecting my processor options or reading the Hibernate mapping file, as no Metamodel source files are generated.
Here is the command line:
javac -verbose -d "C:\Development\delta\delta\PjmBackend\interim\metamodel"
-classpath "C:\Development\delta\delta\PjmBackend\interim\metamodel;C:\Development\delta\delta\PjmBackend\metamodel;C:\Development\delta\delta\lib\build\jpa-metamodel-generator-2.0\hibernate-jpamodelgen-5.2.0.Final.jar"
-sourcepath "C:\Development\delta\delta\PjmBackend\src"
-proc:only -processor org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor
-Adebug=true -AaddGeneratedAnnotation=true
com\leeriver\trading\pjm\data\ActiveConstraint.java

Here is my META-INF/persistence.xml:
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
         version="2.0">

  <persistence-unit name="com.leeriver.trading.pjm.data.metamodel">
    <description>
      Metamodel generation for Hibernate mappings
    </description>

    <non-jta-data-source>java:app/datasources/MySqlPjmDS</non-jta-data-source>

    <mapping-file>com/leeriver/trading/pjm/data/PjmMarketData.hbm.xml</mapping-file>

    <properties>
      <property name="hibernate.dialect" value="org.hibernate.dialect.MySQL57InnoDBDialect" />
    </properties>
  </persistence-unit>

</persistence>

and META-INF/orm.xml:
<?xml version="1.0" encoding="UTF-8"?>
<entity-mappings
  xmlns="http://java.sun.com/xml/ns/persistence/orm"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm orm_2_0.xsd"
  version="2.0">

  <persistence-unit-metadata>
    <xml-mapping-metadata-complete/>
  </persistence-unit-metadata>

</entity-mappings>

This ouput demonstrates the correct Static Metamodel generator is being used:

Note: Hibernate JPA 2 Static-Metamodel Generator 5.2.0.Final

I get this warning from the output:

warning: The following options were not recognized by any processor: '[debug, addGeneratedAnnotation]'

I've added the -verbose flag to javac and the -Adebug=true does not appear to be detected. Am I missing something for invoking the processor? Is there some way I can debug the processor invocation within javac to see if it is processing the input files?


text:
Q: Inheritance, Copy Constructors and Implicit Typecasting I have a derived class which I want to be able to construct using the copy constructor where the argument is an instance of the base class.
I am sure this should be possible in C++. Here is an example:
#include <string>

class Base
{

public:

    friend
    void swap(Base& l, Base& r)
    {
        using std::swap;

        swap(l.a, r.a);
    }

    Base()
        : a{1}
    {
    }

    Base(const int a)
        : a{a}
    {
    }

    virtual
    ~Base()
    {
    }

    Base(const Base& base)
        : a{base.a}
    {
    }

    Base(Base&& base)
        : Base()
    {
        swap(*this, base);
    }

    Base& operator=(Base base)
    {
        swap(*this, base);

        return *this;
    }

protected:

    int a;

};

class Derived : public Base
{

protected:

    std::string b;

};

int main()
{

    Base base(2);
    Derived derived(base);

}

The error (g++ main.cpp) is:
main.cpp: In function 'int main()':
main.cpp:71:31: error: no matching function for call to 'Derived::Derived(Base&)'
     class Derived derived(base);
                               ^
main.cpp:57:7: note: candidate: Derived::Derived()
 class Derived : public Base
       ^~~~~~~
main.cpp:57:7: note:   candidate expects 0 arguments, 1 provided
main.cpp:57:7: note: candidate: Derived::Derived(const Derived&)
main.cpp:57:7: note:   no known conversion for argument 1 from 'Base' to 'const Derived&'
main.cpp:57:7: note: candidate: Derived::Derived(Derived&&)
main.cpp:57:7: note:   no known conversion for argument 1 from 'Base' to 'Derived&&'

So the compiler doesn't know how to convert from an instance of Base to Derived implicitly.
I thought that this should be legal in C++. Do I require an explicit conversion statement?

A: What are you doing doesn't make much sense by itself because Base is not a sub-type of Derived so it can't be used as its replacement/substitution, however you could attempt to give it sense (same as with initialization from any other type) by writing a converting constructor:
class Derived : public Base
{
public:
Derived(const Base &bs) : Base(bs), b("constructed from base") {}

protected:

    std::string b;

};

This would first initialize Derived Base part from bs and then init the string b with some value (though you can leave it out if you want it to be default-inited to empty string).
https://godbolt.org/z/GMELW_

A: Yes, you need to cast explicitely from Base to Derived. Every Mercedes is a car, but not every car is a Mercedes.

A: There is a simple way of solving this problem: By pulling the Base constructor into the scope of Derived.
This can be done with the using statement:
class Derived : public Base
{
public:
    using Base::Base;  // Pulls in the Base class constructors into the scope of Derived

    ...
};

A: this statement Derived derived(base); or to simplify B b(A()); do an implicit conversion of type A to type B, which is legal only if class B inherit directly or indirectly from Class A.
Why ? Because class B could contains new information, in your case a string b, and a cast don't "append" information.

A: I found what I was looking for (I couldn't remember the name so couldn't google it before). However this technique actually doesn't work due to the fact that I am using inheritance. (Or at least I don't know how to make it work.)
Type conversion operator:
Base::operator Derived()
{
    Derived derived;
    derived.a = a;
    return derived;
}

This doesn't actually compile because the compiler doesn't know what Derived is. (Since Derived inherits from Base.) I don't know if it is possible to make this work by separating the compilation units.


text:
Q: How to debug kernel code without running kernel? I'm reading some kernel books, I want to debug the spinlock_t usage, and prepared the following demo code:
////////////////////////////
// demo/spinlock.c
////////////////////////////

#include <linux/spinlock.h>

struct obj {
    spinlock_t spinlock;
}

int demo0() {
    struct obj o;
    spin_lock_init(o.spinlock);
}

int main(){
    demo0();
}

The Makefile seems like:
######################
# demo/Makefile
######################

demo: spinlock.c
    gcc -o spinlock spinlock.c -I../linux-5.6.9/arch/x86/include -I../linux-5.6.9/include

The file tree seems like this
├── demo
└── linux-5.6.9

While meke, it gave me tones of errors (too many, I can't enumerate them here), It seems like that I missed some GCC CFLAGS or others.
How to debug kernel code line by line? Most of Google results are GDB/Qemu debugging within running kernel. Is there any suggestions to debug the kernel code without running the kernel?


text:
Q: Atata: Unable to locate CheckBox elements I receive an error when I use [VerifyExists] on a CheckBox element, although when I use the XPath that is generated via the framework i can find the element.
Error message:
Message: OpenQA.Selenium.NoSuchElementException : Unable to locate element: By.XPath: .//*[normalize-space(@id) = 'active-checker']/descendant-or-self::input[@type='checkbox']

Implementation:
[VerifyExists]
[FindById("isCommentRequred-checker")]
public CheckBox<_> RequestsWorklogCommentCheckBox { get; private set; }

Manual search for element:

A: I guess that it is because actual <input type="checkbox"> is invisible (or has opacity: 0) on the page. Atata by default for most controls filters elements by visibility during control element search and leaves only visible elements.
Try to set Visibility = Visibility.Any:
[FindById("isCommentRequred-checker", Visibility = Visibility.Any)]

Often checkboxes and radio buttons are made invisible and other element renders it and receives clicks. Just inspect HTML and then try to click it with Atata or with pure WebDriver. If it throws exception, you will probably need to implement custom control for it to click for example span.control-label element.
Here is example of control for Kendo UI CheckBox: https://github.com/atata-framework/atata-kendoui/blob/master/src/Atata.KendoUI/KendoCheckBox%601.cs


text:
Q: Failed to compile apk with Android Studio 3.2 + Windows Recently I had to switch to Android Studio 3.2 Canary to use the new AndroidX components.
My main development environment is Mac/OSX and everything works fine. However, this week I had to switch to Windows and when compiling the apk I'm getting the below exception.
As I'm using AndroidX, had to enable in gradle.properties file:

*

*android.enableJetifier=true

*android.useAndroidX=true

Here's the exception.
Caused by: com.android.builder.dexing.DexArchiveBuilderException: Failed to process C:\Users\rafael.chagas\.gradle\caches\transforms-1\files-1.1\jetified-play-services-basement-15.0.1.aar\a98f8e9d46ed106e8653ab19e7672193\jars\classes.jar
    at com.android.build.gradle.internal.transforms.DexArchiveBuilderTransform.launchProcessing(DexArchiveBuilderTransform.java:877)
    at com.android.build.gradle.internal.transforms.DexArchiveBuilderTransform.lambda$convertToDexArchive$7(DexArchiveBuilderTransform.java:802)
    at java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:1424)
    at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
    at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
    at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
    at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
Caused by: com.android.builder.dexing.DexArchiveBuilderException: Error while dexing.
    at com.android.builder.dexing.D8DexArchiveBuilder.getExceptionToRethrow(D8DexArchiveBuilder.java:124)
    at com.android.builder.dexing.D8DexArchiveBuilder.convert(D8DexArchiveBuilder.java:101)
    at com.android.build.gradle.internal.transforms.DexArchiveBuilderTransform.launchProcessing(DexArchiveBuilderTransform.java:872)
    ... 6 more
Caused by: java.lang.NullPointerException: entry
    at java.util.zip.ZipFile.getInputStream(ZipFile.java:346)
    at com.android.tools.r8.ArchiveClassFileProvider.getProgramResource(ArchiveClassFileProvider.java:91)
    at com.android.builder.dexing.r8.CachingArchiveClassFileProvider.lambda$getProgramResource$0(CachingArchiveClassFileProvider.java:38)
    at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660)
    at com.android.builder.dexing.r8.CachingArchiveClassFileProvider.getProgramResource(CachingArchiveClassFileProvider.java:38)
    at com.android.builder.dexing.r8.ClassFileProviderFactory$OrderedClassFileResourceProvider.getProgramResource(ClassFileProviderFactory.java:78)
    at com.android.tools.r8.utils.ClassProvider$ClassFileResourceReader.collectClass(ClassProvider.java:97)
    at com.android.tools.r8.utils.ClassMap$ConcurrentClassLoader.get(ClassMap.java:241)
    at com.android.tools.r8.utils.ClassMap$ConcurrentClassLoader.get(ClassMap.java:217)
    at com.android.tools.r8.utils.ClassMap.get(ClassMap.java:115)
    at com.android.tools.r8.graph.LazyLoadedDexApplication.definitionFor(LazyLoadedDexApplication.java:47)
    at com.android.tools.r8.graph.AppInfo.definitionFor(AppInfo.java:62)
    at com.android.tools.r8.ir.desugar.InterfaceMethodRewriter.findDefinitionFor(InterfaceMethodRewriter.java:255)
    at com.android.tools.r8.ir.desugar.InterfaceMethodRewriter.rewriteMethodReferences(InterfaceMethodRewriter.java:140)
    at com.android.tools.r8.ir.conversion.IRConverter.rewriteCode(IRConverter.java:675)
    at com.android.tools.r8.ir.conversion.IRConverter.convertMethodToDex(IRConverter.java:346)
    at com.android.tools.r8.graph.DexClass.forEachMethodThrowing(DexClass.java:132)
    at com.android.tools.r8.ir.conversion.IRConverter.lambda$convertClassesToDex$2(IRConverter.java:332)
    at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:117)
    at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:38)
    at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:77)
    at com.google.common.util.concurrent.MoreExecutors$DirectExecutorService.execute(MoreExecutors.java:260)
    at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
    at com.google.common.util.concurrent.AbstractListeningExecutorService.submit(AbstractListeningExecutorService.java:66)
    at com.google.common.util.concurrent.AbstractListeningExecutorService.submit(AbstractListeningExecutorService.java:36)
    at com.android.tools.r8.ir.conversion.IRConverter.convertClassesToDex(IRConverter.java:330)
    at com.android.tools.r8.ir.conversion.IRConverter.convertToDex(IRConverter.java:245)
    at com.android.tools.r8.D8.optimize(D8.java:202)
    at com.android.tools.r8.D8.run(D8.java:162)
    at com.android.tools.r8.D8.lambda$run$1(D8.java:92)
    at com.android.tools.r8.utils.ExceptionUtils.withCompilationHandler(ExceptionUtils.java:56)
    at com.android.tools.r8.utils.ExceptionUtils.withD8CompilationHandler(ExceptionUtils.java:41)
    at com.android.tools.r8.D8.run(D8.java:89)
    at com.android.builder.dexing.D8DexArchiveBuilder.convert(D8DexArchiveBuilder.java:99)

The target .jar file above is random. It may fail with any of the project libraries.
I know that this is a Canary release of Android Studio, but what intrigues me is that this only occurs with Windows OS. Tested in Linux, OSX and had no problems at all.
Thanks!

A: Finally I found the root cause and fix to this issue.
Looking into the error messages, the Android R8 class causing the exception was:
src/main/java/com/android/tools/r8/ArchiveClassFileProvider.java
Digging into R8 source i found the latest logs and a brand new commit that changes the encoding while reading .zip files:
https://r8.googlesource.com/r8/+/a26659a1d07b4dc4ad0c3f8dbafd47d49efbc438
This commit changes the way R8 reads zip archives using UTF-8 encoding and avoid using the platform encoding. That's why only Windows was failing.
I tested the latest R8 release with that commit and it worked! Just need to add these (+) lines to your project build.gradle file.
 repositories {
     google()
     jcenter()
+    maven {
+        url "http://storage.googleapis.com/r8-releases/raw"
+    }
 }
dependencies {
+    classpath 'com.android.tools:r8:1.2.28'
     classpath 'com.android.tools.build:gradle:3.2.0-alpha18'
     classpath 'com.google.gms:google-services:4.0.0'
 }

The "com.android.tools:r8:1.2.28" must be the first one in the dependencies.
According to the BUG 109992855 that new version of R8 will be pushed to Android Studio 3.2 in about two weeks. Meanwhile you must use the above fix.
Hope that helps anyone who stumbled on this error.


text:
Q: Finding $\lim_{x \to 0} \frac {a\sin bx -b\sin ax}{x^2 \sin ax}$ witouth L'Hopital, what is my mistake? I was working on this question.
$\lim_{x \to 0} \dfrac {a\sin bx -b\sin ax}{x^2 \sin ax}$
$\lim_{x \to 0} \dfrac {1}{x^2} \cdot \lim_{x \to 0} \dfrac { \frac {1}{abx}}{\frac {1}{abx}} \cdot \dfrac {a\sin bx -b\sin ax}{\sin ax}$
$\lim_{x \to 0} \dfrac {1}{x^2} \cdot \dfrac {\lim_{x \to 0} \frac {\sin bx}{bx}- \lim_{x \to 0}\frac{\sin ax}{ax}}{\frac 1b \lim_{x \to 0} \frac {\sin ax}{ax}}$
$b \lim_{x \to 0} \dfrac {1}{x^2} \cdot \dfrac {b-a}{a}$
It seems like this limit does not exist, but if you apply L'Hopital's rule you seem to get an answer. What is wrong with what I did?

A: $\lim_{x \to a} f(x) g(x) = \lim_{x \to a} f(x) \lim_{x \to a} g(x)$ if both the limits exist and are finite. So there is an error in the 2nd line of your proof where you have separated $\frac{1}{x^2}$.

A: One error is that
$\lim_{x \to 0} \frac{\sin cx}{cx}
= 1$, not $c$,
so your fraction is
$\frac1{x^2}\frac{1-1}{1/b}$
which is still indeterminate.

A: Note that $\lim_{x\to0}\dfrac{\sin bx}{bx}=1$. So the numerator in your last limit is $1-1=0$, and this means that you wrote your limit as a product "$\frac10\times0"$, from where you cannot get information.

A: A good way is to use Taylor expansion. You know what is Taylor series for $sin(x)$. So, develop accordingly the different terms.
For the numerator, you will have $\frac{1}{6} x^3 \left(a^3 b-a b^3\right)+O\left(x^4\right)$ and for the denominator $a x^3+O\left(x^4\right)$. So, the result should be $$\frac{1}{6} \left(a^2 b-b^3\right)$$ you can still simplify to $$\frac{1}{6} b (a-b) (a+b)$$


text:
Q: Excel - if statement based on a list of conditions I'm trying to set up an if statement containing conditions that I've written out in a list. When the user selects options from a dropdown, I'd like the "total cost" cell to be populated.

For example, if the user selects:
Product 1: Brand A
Product 2: Brand B
Total cost: 200

Is there a better way to do this, than write out 9 nested if statements?

A: You can use an Index/Match formula.
Cell F4 formula:
=INDEX(C2:C10,MATCH(1,(F2=A2:A10)*(F3=B2:B10),0))

After entering the formula, press CTRL-SHFT-ENTR to make this an array formula (to get the curly brackets).

A: You may also use Sumproduct function.
Such as in F4, enter formula, =SUMPRODUCT((A2:A10=F2)*(B2:B10=F3)*(C2:C10)).


text:
Q: pixbuf.subpixbuf alternative in Gtk3 I have a GTK+ 2 application I am porting to GTK+ 3.
I have a function to cut out some part of an image -
scaled_pb = pb.scale_simple(w,h, GdkPixbuf.InterpType.BILINEAR)
scaled_pb = scaled_pb.subpixbuf(abs((width-w)/2),abs((height-h)/2), width, height)

pb is a pixbuf passed to the function. scaled_pb is returned.
So my question is what is the alternative to pb.subpixbuf in GTK3? My app isn't running now and it's telling that Pixbuf object has no subpixbuf property.
Thank you in advance.

A: What you want is GdkPixbuf.Pixbuf.new_subpixbuf().


text:
Q: TypeError: scalar() got multiple values for argument 'name' ---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-14-af22e6723577> in <module>()
     19         with tf.name_scope("summaries"):
     20             avg=tf.div(update_total,tf.cast(increment_step,tf.float32),name="average")
---> 21             tf.summary.scalar(b'Output',output,name="output_summary")
     22             tf.summary.scalar(b'Sum of outputs over time',update_total,name="total_summary")
     23             tf.summary.scalar(b'Average of outputs over time',avg,name="average_summary")

TypeError: scalar() got multiple values for argument 'name'

A: See the docs: https://www.tensorflow.org/api_docs/python/tf/summary/scalar

scalar(
      name,
      tensor,
      collections=None,
      family=None )

The first argument is the name argument, hence the call tf.summary.scalar(b'Output', output, name="output_summary") assigns both b'Output' and 'output_summary' to name.
You have the exact issue with the next 2 calls to scalar.


text:
Q: Atomic swap map pointer cause program stuck package main

import (
   "fmt"
   "sync/atomic"
   "unsafe"
)

func main(){
   old := make(map[string]string)
   new := make(map[string]string)
   new["hello"] = "apple"
   fmt.Println("start swap")
   atomic.SwapPointer((*unsafe.Pointer)(unsafe.Pointer(&old)), unsafe.Pointer(&new))
   fmt.Println("end swap")

   // pending here, don't stop
   fmt.Println(old)
   fmt.Println("end print old")

}

I want a lock-free way to update old map with new map because of the old map will be concurrent read at the most of the time.
if I use a rwlock, there will have serious performance penalty.
so I choose Golang atomic package to implement this, but the line
fmt.Println(old), the program is stuck here, could somebody give some advice.

A: The function atomic.SwapPointer does not do what you want / need.  As the documentation says, this is roughly equivalent to:
old = *addr
*addr = new
return old

(except that the write to *addr and read-back from *addr are done atomically).  What you wanted was, I think, the atomic equivalent of:
*old, *new = *new, *old

(and no useful return value).  This operation simply does not exist in the sync package.  If it did, you could swap the two internal map pointers, but you'd still be treading in dangerous (might-break-in-future-compilers) waters, as multiple commenters noted.
Consider using sync.Map instead.  It provides a somewhat-concurrency-safe map with internal (per entry) locking that is optimized for two use cases, as described in the linked package documentation.  If your use case is one of these two, it may provide what you need.

Just for illustration (don't do this! it's silly, you could just write *old, *new = *new, *old in swap)... A non-atomic swap of old and new can be achieved using atomic.SwapPointer:
package main

import (
    "fmt"
    "sync/atomic"
    "unsafe"
)

func read(p unsafe.Pointer) unsafe.Pointer {
    return *(*unsafe.Pointer)(p)
}

func swap(old *map[string]string, new *map[string]string) {
    p := atomic.SwapPointer((*unsafe.Pointer)(unsafe.Pointer(old)), read(unsafe.Pointer(new)))
    _ = atomic.SwapPointer((*unsafe.Pointer)(unsafe.Pointer(new)), p)
}

func main() {
    old := map[string]string{"old": "old"}
    new := map[string]string{"hello": "apple", "new": "new"}
    fmt.Println("before: old =", old, "new =", new)
    // fmt.Println("before: old:", read(unsafe.Pointer(&old)), "new:", read(unsafe.Pointer(&new)))
    swap(&old, &new)
    // fmt.Println("after: old:", read(unsafe.Pointer(&old)), "new:", read(unsafe.Pointer(&new)))
    fmt.Println("after: old =", old, "new =", new)
}

Uncomment the commented-out lines to see more details.   Of course, calling two separate atomic.SwapPointer operations is not atomic: there is a moment when both map variables view the new map, until the second swap makes the old variable view the old map.  I think the unsafe.Pointer variable p preserves the old map against GC until we get it stored back into old, but I am not at all sure about this (that's one of the darker corners of Go).
Again: don't do this.  If measurement suggests it helps, try sync.Map instead.

A: Since go 1.17, there is a atomic.Value.Swap method that I believe does what you want.
package main

import (
    "fmt"
    "sync/atomic"
)

func main() {
    var old atomic.Value
    old.Store(make(map[string]string))
    new := make(map[string]string)
    new["hello"] = "apple"
    fmt.Println("start swap")
    new = old.Swap(new).(map[string]string)
    fmt.Println("end swap")

    fmt.Println(old)
    fmt.Println("end print old")
    fmt.Println(new)
}

That being said, it's not clear from your use case that you actually need access to the old values, and if not, you can just use atomic.Value.Store to update the pointer instead. In fact, there is a very similar example in the documentation.
That being said, I agree with the sentiment that you should measure the impact of using RWLock and sync.Map before reaching for atomic.Value.


text:
Q: Databases synchronisation with duplicated PK/FK I am trying to design a database structure. It will be installed into a few instances of sql servers. I need to merge these databases periodically.
Problem is in server_A (PK)id=222 user=Tom, but in server_B (PK)id=222 user=Peter.
So, in server_A for Tom, (FK)userid=222, Address=1 abc street..., but same (FK)userid=222 in server_B address table has a different meaning.
All I can think of is this cheap approach. If I have 3 servers, I seed the id in 1st server to start at 1000000001, 2nd server at 2000000001, 3rd at 3000000001 .... so they will not repeat themselves, that might work for a small time project? And I don't need to use a Guid/uniqueidentifier to further complicate the problem?
What is a common/correct approach to this situation?

A: You can add a server_id as a foreign key that's now part of a compound primary key together with the original primary key. Each server has its own id.

A: Use the merge replication feature of SQL Server, it will handle this for you.

A: Use GUIDs instead of ints as your primary keys. They are unique even when generated on different systems.
I'm no expert on SQL Server Merge Replication, but according to this post, it cannot resolve conflicting PKs automatically, so it's better to avoid conflicting PKs in the first place.


text:
Q: A lot of intellisense errors after angular 6 upgrade I have about 80ish errors in my visual studio 2017 error list window after upgrading to angular 6. Those errors only appear in VS as ng serve in command line compiles fine and the application works fine.
Severity    Code    Description Project File    Line    Suppression State
Error   TS2339  (TS) Property 'length' does not exist on type '{}'. C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\src\app\components\pollution\pollution.component.ts   101 Active
Error   TS2415  (TS) Class 'FocusKeyManager<T>' incorrectly extends base class 'ListKeyManager<FocusableOption & T>'.
  Types of property 'setActiveItem' are incompatible.
    Type '(index: number) => void' is not assignable to type '{ (index: number): void; (item: FocusableOption & T): void; }'.
      Types of parameters 'index' and 'item' are incompatible.
        Type 'FocusableOption & T' is not assignable to type 'number'.  C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\node_modules\@angular\cdk\a11y\typings\key-manager\focus-key-manager.d.ts 19  Active
Error   TS2305  (TS) Module '"C:/Users/anon/Documents/Projects/EEA.Projects/DEP/MassAir/Web/node_modules/rxjs/Observable"' has no exported member 'Observable'. C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\node_modules\@angular\cdk\collections\typings\data-source.d.ts    8   Active
Error   TS2305  (TS) Module '"C:/Users/anon/Documents/Projects/EEA.Projects/DEP/MassAir/Web/node_modules/rxjs/Subject"' has no exported member 'Subject'.   C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\node_modules\@angular\cdk\collections\typings\selection.d.ts  8   Active
Error   TS2305  (TS) Module '"C:/Users/anon/Documents/Projects/EEA.Projects/DEP/MassAir/Web/node_modules/rxjs/Observable"' has no exported member 'Observable'. C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\node_modules\@angular\cdk\layout\typings\breakpoints-observer.d.ts    10  Active
Error   TS2305  (TS) Module '"C:/Users/anon/Documents/Projects/EEA.Projects/DEP/MassAir/Web/node_modules/rxjs/Observable"' has no exported member 'Observable'. C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\node_modules\@angular\cdk\overlay\typings\overlay-ref.d.ts    11  Active
Error   TS2305  (TS) Module '"C:/Users/anon/Documents/Projects/EEA.Projects/DEP/MassAir/Web/node_modules/rxjs/Subject"' has no exported member 'Subject'.   C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\node_modules\@angular\cdk\overlay\typings\overlay-ref.d.ts    12  Active
Error   TS2305  (TS) Module '"C:/Users/anon/Documents/Projects/EEA.Projects/DEP/MassAir/Web/node_modules/rxjs/Observable"' has no exported member 'Observable'. C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\node_modules\@angular\cdk\overlay\typings\position\connected-position-strategy.d.ts   12  Active
Error   TS2305  (TS) Module '"C:/Users/anon/Documents/Projects/EEA.Projects/DEP/MassAir/Web/node_modules/rxjs/Subscription"' has no exported member 'Subscription'. C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\node_modules\@angular\cdk\scrolling\typings\scroll-dispatcher.d.ts    10  Active
Error   TS2305  (TS) Module '"C:/Users/anon/Documents/Projects/EEA.Projects/DEP/MassAir/Web/node_modules/rxjs/Observable"' has no exported member 'Observable'. C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\node_modules\@angular\cdk\scrolling\typings\scroll-dispatcher.d.ts    11  Active
Error   TS2305  (TS) Module '"C:/Users/anon/Documents/Projects/EEA.Projects/DEP/MassAir/Web/node_modules/rxjs/Observable"' has no exported member 'Observable'. C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\node_modules\@angular\cdk\scrolling\typings\scrollable.d.ts   9   Active
Error   TS2305  (TS) Module '"C:/Users/anon/Documents/Projects/EEA.Projects/DEP/MassAir/Web/node_modules/rxjs/Observable"' has no exported member 'Observable'. C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\node_modules\@angular\cdk\scrolling\typings\viewport-ruler.d.ts   10  Active
Error   TS2305  (TS) Module '"C:/Users/anon/Documents/Projects/EEA.Projects/DEP/MassAir/Web/node_modules/rxjs/Subject"' has no exported member 'Subject'.   C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\node_modules\@angular\cdk\stepper\typings\stepper.d.ts    12  Active
Error   TS2474  (TS) In 'const' enum declarations member initializer must be constant expression.   C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\node_modules\@angular\compiler\src\output\output_ast.d.ts 600 Active
Error   TS2474  (TS) In 'const' enum declarations member initializer must be constant expression.   C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\node_modules\@angular\compiler\src\output\output_ast.d.ts 601 Active
Error   TS2474  (TS) In 'const' enum declarations member initializer must be constant expression.   C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\node_modules\@angular\compiler\src\output\output_ast.d.ts 602 Active
Error   TS1169  (TS) A computed property name in an interface must directly refer to a built-in symbol. C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\node_modules\@angular\core\src\render3\interfaces\container.d.ts  35  Active
Error   TS1169  (TS) A computed property name in an interface must directly refer to a built-in symbol. C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\node_modules\@angular\core\src\render3\interfaces\container.d.ts  40  Active
Error   TS1169  (TS) A computed property name in an interface must directly refer to a built-in symbol. C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\node_modules\@angular\core\src\render3\interfaces\container.d.ts  45  Active
Error   TS1169  (TS) A computed property name in an interface must directly refer to a built-in symbol. C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\node_modules\@angular\core\src\render3\interfaces\container.d.ts  50  Active
Error   TS1169  (TS) A computed property name in an interface must directly refer to a built-in symbol. C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\node_modules\@angular\core\src\render3\interfaces\container.d.ts  58  Active
Error   TS1169  (TS) A computed property name in an interface must directly refer to a built-in symbol. C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\node_modules\@angular\core\src\render3\interfaces\container.d.ts  79  Active
Error   TS1169  (TS) A computed property name in an interface must directly refer to a built-in symbol. C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\node_modules\@angular\core\src\render3\interfaces\view.d.ts   50  Active
Error   TS1169  (TS) A computed property name in an interface must directly refer to a built-in symbol. C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\node_modules\@angular\core\src\render3\interfaces\view.d.ts   56  Active
Error   TS1169  (TS) A computed property name in an interface must directly refer to a built-in symbol. C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\node_modules\@angular\core\src\render3\interfaces\view.d.ts   66  Active
Error   TS1169  (TS) A computed property name in an interface must directly refer to a built-in symbol. C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\node_modules\@angular\core\src\render3\interfaces\view.d.ts   68  Active
Error   TS1169  (TS) A computed property name in an interface must directly refer to a built-in symbol. C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\node_modules\@angular\core\src\render3\interfaces\view.d.ts   70  Active
Error   TS1169  (TS) A computed property name in an interface must directly refer to a built-in symbol. C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\node_modules\@angular\core\src\render3\interfaces\view.d.ts   79  Active
Error   TS1169  (TS) A computed property name in an interface must directly refer to a built-in symbol. C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\node_modules\@angular\core\src\render3\interfaces\view.d.ts   87  Active
Error   TS1169  (TS) A computed property name in an interface must directly refer to a built-in symbol. C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\node_modules\@angular\core\src\render3\interfaces\view.d.ts   94  Active
Error   TS1169  (TS) A computed property name in an interface must directly refer to a built-in symbol. C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\node_modules\@angular\core\src\render3\interfaces\view.d.ts   103 Active
Error   TS1169  (TS) A computed property name in an interface must directly refer to a built-in symbol. C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\node_modules\@angular\core\src\render3\interfaces\view.d.ts   109 Active
Error   TS1169  (TS) A computed property name in an interface must directly refer to a built-in symbol. C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\node_modules\@angular\core\src\render3\interfaces\view.d.ts   111 Active
Error   TS1169  (TS) A computed property name in an interface must directly refer to a built-in symbol. C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\node_modules\@angular\core\src\render3\interfaces\view.d.ts   113 Active
Error   TS1169  (TS) A computed property name in an interface must directly refer to a built-in symbol. C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\node_modules\@angular\core\src\render3\interfaces\view.d.ts   115 Active
Error   TS1169  (TS) A computed property name in an interface must directly refer to a built-in symbol. C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\node_modules\@angular\core\src\render3\interfaces\view.d.ts   122 Active
Error   TS1169  (TS) A computed property name in an interface must directly refer to a built-in symbol. C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\node_modules\@angular\core\src\render3\interfaces\view.d.ts   131 Active
Error   TS1169  (TS) A computed property name in an interface must directly refer to a built-in symbol. C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\node_modules\@angular\core\src\render3\interfaces\view.d.ts   137 Active
Error   TS2474  (TS) In 'const' enum declarations member initializer must be constant expression.   C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\node_modules\@angular\core\src\sanitization\bypass.d.ts   10  Active
Error   TS2474  (TS) In 'const' enum declarations member initializer must be constant expression.   C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\node_modules\@angular\core\src\sanitization\bypass.d.ts   11  Active
Error   TS2474  (TS) In 'const' enum declarations member initializer must be constant expression.   C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\node_modules\@angular\core\src\sanitization\bypass.d.ts   12  Active
Error   TS2474  (TS) In 'const' enum declarations member initializer must be constant expression.   C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\node_modules\@angular\core\src\sanitization\bypass.d.ts   13  Active
Error   TS2474  (TS) In 'const' enum declarations member initializer must be constant expression.   C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\node_modules\@angular\core\src\sanitization\bypass.d.ts   14  Active
Error   TS1169  (TS) A computed property name in an interface must directly refer to a built-in symbol. C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\node_modules\@angular\core\src\sanitization\bypass.d.ts   23  Active
Error   TS1169  (TS) A computed property name in an interface must directly refer to a built-in symbol. C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\node_modules\@angular\core\src\sanitization\bypass.d.ts   31  Active
Error   TS2535  (TS) Enum type 'BypassType' has members with initializers that are not literals.    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\node_modules\@angular\core\src\sanitization\bypass.d.ts   31  Active
Error   TS1169  (TS) A computed property name in an interface must directly refer to a built-in symbol. C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\node_modules\@angular\core\src\sanitization\bypass.d.ts   39  Active
Error   TS2535  (TS) Enum type 'BypassType' has members with initializers that are not literals.    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\node_modules\@angular\core\src\sanitization\bypass.d.ts   39  Active
Error   TS1169  (TS) A computed property name in an interface must directly refer to a built-in symbol. C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\node_modules\@angular\core\src\sanitization\bypass.d.ts   47  Active
Error   TS2535  (TS) Enum type 'BypassType' has members with initializers that are not literals.    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\node_modules\@angular\core\src\sanitization\bypass.d.ts   47  Active
Error   TS1169  (TS) A computed property name in an interface must directly refer to a built-in symbol. C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\node_modules\@angular\core\src\sanitization\bypass.d.ts   55  Active
Error   TS2535  (TS) Enum type 'BypassType' has members with initializers that are not literals.    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\node_modules\@angular\core\src\sanitization\bypass.d.ts   55  Active
Error   TS1169  (TS) A computed property name in an interface must directly refer to a built-in symbol. C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\node_modules\@angular\core\src\sanitization\bypass.d.ts   63  Active
Error   TS2535  (TS) Enum type 'BypassType' has members with initializers that are not literals.    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\node_modules\@angular\core\src\sanitization\bypass.d.ts   63  Active
Error   TS2305  (TS) Module '"C:/Users/anon/Documents/Projects/EEA.Projects/DEP/MassAir/Web/node_modules/rxjs/Observable"' has no exported member 'Observable'. C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\node_modules\@angular\material\autocomplete\typings\autocomplete-trigger.d.ts 14  Active
Error   TS2305  (TS) Module '"C:/Users/anon/Documents/Projects/EEA.Projects/DEP/MassAir/Web/node_modules/rxjs/Observable"' has no exported member 'Observable'. C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\node_modules\@angular\material\chips\typings\chip-list.d.ts   15  Active
Error   TS2305  (TS) Module '"C:/Users/anon/Documents/Projects/EEA.Projects/DEP/MassAir/Web/node_modules/rxjs/Subject"' has no exported member 'Subject'.   C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\node_modules\@angular\material\chips\typings\chip.d.ts    11  Active
Error   TS2305  (TS) Module '"C:/Users/anon/Documents/Projects/EEA.Projects/DEP/MassAir/Web/node_modules/rxjs/Subject"' has no exported member 'Subject'.   C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\node_modules\@angular\material\core\typings\common-behaviors\error-state.d.ts 11  Active
Error   TS2305  (TS) Module '"C:/Users/anon/Documents/Projects/EEA.Projects/DEP/MassAir/Web/node_modules/rxjs/Observable"' has no exported member 'Observable'. C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\node_modules\@angular\material\core\typings\common-behaviors\initialized.d.ts 9   Active
Error   TS2305  (TS) Module '"C:/Users/anon/Documents/Projects/EEA.Projects/DEP/MassAir/Web/node_modules/rxjs/Observable"' has no exported member 'Observable'. C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\node_modules\@angular\material\core\typings\datetime\date-adapter.d.ts    9   Active
Error   TS2305  (TS) Module '"C:/Users/anon/Documents/Projects/EEA.Projects/DEP/MassAir/Web/node_modules/rxjs/Subject"' has no exported member 'Subject'.   C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\node_modules\@angular\material\core\typings\datetime\date-adapter.d.ts    10  Active
Error   TS2305  (TS) Module '"C:/Users/anon/Documents/Projects/EEA.Projects/DEP/MassAir/Web/node_modules/rxjs/Subject"' has no exported member 'Subject'.   C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\node_modules\@angular\material\core\typings\option\option.d.ts    1   Active
Error   TS2305  (TS) Module '"C:/Users/anon/Documents/Projects/EEA.Projects/DEP/MassAir/Web/node_modules/rxjs/Subject"' has no exported member 'Subject'.   C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\node_modules\@angular\material\datepicker\typings\datepicker-intl.d.ts    1   Active
Error   TS2305  (TS) Module '"C:/Users/anon/Documents/Projects/EEA.Projects/DEP/MassAir/Web/node_modules/rxjs/Observable"' has no exported member 'Observable'. C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\node_modules\@angular\material\dialog\typings\dialog-ref.d.ts 11  Active
Error   TS2305  (TS) Module '"C:/Users/anon/Documents/Projects/EEA.Projects/DEP/MassAir/Web/node_modules/rxjs/Observable"' has no exported member 'Observable'. C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\node_modules\@angular\material\dialog\typings\dialog.d.ts 5   Active
Error   TS2305  (TS) Module '"C:/Users/anon/Documents/Projects/EEA.Projects/DEP/MassAir/Web/node_modules/rxjs/Subject"' has no exported member 'Subject'.   C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\node_modules\@angular\material\dialog\typings\dialog.d.ts 6   Active
Error   TS2305  (TS) Module '"C:/Users/anon/Documents/Projects/EEA.Projects/DEP/MassAir/Web/node_modules/rxjs/Subject"' has no exported member 'Subject'.   C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\node_modules\@angular\material\expansion\typings\expansion-panel.d.ts 13  Active
Error   TS2305  (TS) Module '"C:/Users/anon/Documents/Projects/EEA.Projects/DEP/MassAir/Web/node_modules/rxjs/Observable"' has no exported member 'Observable'. C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\node_modules\@angular\material\form-field\typings\form-field-control.d.ts 8   Active
Error   TS2305  (TS) Module '"C:/Users/anon/Documents/Projects/EEA.Projects/DEP/MassAir/Web/node_modules/rxjs/Observable"' has no exported member 'Observable'. C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\node_modules\@angular\material\icon\typings\icon-registry.d.ts    4   Active
Error   TS2305  (TS) Module '"C:/Users/anon/Documents/Projects/EEA.Projects/DEP/MassAir/Web/node_modules/rxjs/Subject"' has no exported member 'Subject'.   C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\node_modules\@angular\material\sort\typings\sort-header-intl.d.ts 9   Active
Error   TS2305  (TS) Module '"C:/Users/anon/Documents/Projects/EEA.Projects/DEP/MassAir/Web/node_modules/rxjs/Subject"' has no exported member 'Subject'.   C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)

C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\node_modules\@angular\material\sort\typings\sort.d.ts 11  Active
    Error   TS2305  (TS) Module '"C:/Users/anon/Documents/Projects/EEA.Projects/DEP/MassAir/Web/node_modules/rxjs/Subject"' has no exported member 'Subject'.   C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\node_modules\@angular\material\stepper\typings\stepper-intl.d.ts  1   Active
    Error   TS2307  (TS) Cannot find module 'rxjs-compat/Observable'.   C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\node_modules\rxjs\Observable.d.ts 1   Active
    Error   TS2307  (TS) Cannot find module 'rxjs-compat/Subject'.  C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\node_modules\rxjs\Subject.d.ts    1   Active
    Error   TS2307  (TS) Cannot find module 'rxjs-compat/Subscription'. C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\node_modules\rxjs\Subscription.d.ts   1   Active
    Error   TS2345  (TS) Argument of type '{}' is not assignable to parameter of type 'string'. C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\src\app\components\lookup\lookup.component.ts 68  Active
    Error   TS2345  (TS) Argument of type '{}' is not assignable to parameter of type 'string'. C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\src\app\components\monitor\monitor.component.ts   76  Active
    Error   TS2345  (TS) Argument of type '{}' is not assignable to parameter of type 'string'. C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\src\app\components\parameter\parameter.component.ts   76  Active
    Error   TS2339  (TS) Property 'length' does not exist on type '{}'. C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\src\app\components\pollution\pollution.component.ts   110 Active
    Error   TS2345  (TS) Argument of type '{

}' is not assignable to parameter of type 'string'. C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\src\app\components\rule\rule.component.ts 89  Active
Error   TS2345  (TS) Argument of type '{}' is not assignable to parameter of type 'string'. C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\src\app\components\rule\rule.component.ts 99  Active
Error   TS2345  (TS) Argument of type '{}' is not assignable to parameter of type 'string'. C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project)    C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\src\app\components\site\site.component.ts 125 Active

A: It is a typescript versioning issue, you may resolve it by changing Typescript version in project properties. Install Typescript 3.0.1.
Right click on the project node in Solution Explorer
Click Properties
Go to the TypeScript Build tab
Change TypeScript version to the desired version or "use latest available" to always default to the newest version installed.

A: Use:
"typescript": "3.0.1"

And select: Use latest available into TypeScriptBuild.
I work on VS2017.


text:
Q: I need to get past my permissions to recover data Due to some mishaps, I am unable to boot into Kubuntu at all. However, my data is still on the hard drive.
I managed to get one of the other two computers to which I have access to read the disk by booting into a liveCD session of kubuntu. The only storage medium to which I have access is a 30 GB data stick.
Here's where the trouble starts: In music alone, I have to back up about 60 GB. Obviously this is going to have to be split into chunks and moved over to the second spare PC until I can reinstall Kubuntu on my laptop. All of the data that needs backed up is behind a permissions wall, so while I can view it, I can't interact with it directly.
I know copying and moving through the terminal can get around this with sudo cp or sudo mv, but is there a way to first compress multiple folders in a single archive, then move it? (While we're on the subject, what compression method would be best for large volumes of music in MP3, WAV, and OGG format?)

A: MP3 and OGG are already well compressed, so I would just use the STORE level (no compression at all). WAV - go for maximum.
And, in making archives, all you need to do to archive is to read it the original meda file, no other permissiones needed IIRC, but
To change all the directories to 777 (-rwxrwxrwx):
find /home/yourname/music -type d -exec chmod 777 {} \;

To change all the files to 666 (-rw-rw-rw-):
find /home/yourname/music -type f -exec chmod 644 {} \;


text:
Q: Missing header: (\rhead not shown) I want to create a document with both header and footer. So far the footer has been working fine but not the header, which is missing for some reason. Do anyone have a clue as to why it happens?
%!TEX TS-program = xelatex
\documentclass[12pt]{article}

%opening
\title{Example}

\usepackage[margin = 1.0in]{geometry}
\usepackage{fancyhdr}
\usepackage{amsmath, amsfonts, amssymb}
\usepackage{braket}
\usepackage{fontspec}

\pagestyle{fancy}
\fancyhf{}
\rhead{Not working}
\rfoot{\thepage}
\setmainfont{Times New Roman}
\newcommand{\bd}{\textbf}

\begin{document}
\maketitle

\bibliographystyle{APA}
\bibliography{bibliography.bib}

\end{document}

A:
\documentclass[12pt]{article}

%opening
\title{Example}

\usepackage[margin = 1.0in]{geometry}
\usepackage{fancyhdr}
\usepackage{amsmath, amsfonts, amssymb}
\usepackage{braket}
%\usepackage{fontspec}
\renewcommand{\headrulewidth}{0pt}
\fancypagestyle{firststyle}
{
    \fancyhf{}
    \fancyfoot[R]{\footnotesize Page \thepage}
        \fancyhead[R]{\footnotesize Not Working}
}
\begin{document}
    \maketitle
\thispagestyle{firststyle}
%   \bibliographystyle{APA}
%   \bibliography{bibliography.bib}

\end{document}


text:
Q: Why are there clj and cljs folders in my lein re-frame template? Why are there clj and cljs folders in my lein re-frame template as below? And why do they both include files called .core that appear to use the same namespaces? I've been told this is the place to start when learning re-frame, but I cannot find any explanations of why the templates are setup the way they are or created including the content they include.
There is no explanation for any of the boilerplate or code that comes with any lein template which make them very hard to use for beginners.
Thanks in advance.

A: One answer:
As the comments point out, some projects develop the backend code (Clojure) and the frontend code (ClojureScript) in the same project repo.  I think this is a mistake as it can easily lead to confusion and entanglement (esp. if using lein to start both projects simultaneously).  IMHO it is better to keep both front- and back-end parts in separate repositories.  I would also strongly recommend using figwheel-main and the Clojure deps build tool for the CLJS code.
Another answer:
For CLJS code, any macros have to be defined in an "earlier" compilation stage.  Thus, for namespaces defining macros, you often see files like either util.clj or util.cljc to define the macro, and then a file like util.cljs where the macro is used.
You can find more information below, but it is subtle & confusing:

*

*https://clojurescript.org/guides/ns-forms

*https://clojurescript.org/about/differences

*https://blog.fikesfarm.com/posts/2018-08-12-two-file-clojurescript-namespace-pattern.html

A: This setup is used to separate Clojure Backend code from the ClojureScript frontend. It isn't actually necessary and I don't particularly recommend it but I can explain its history and why you'd want to do it.
For the ClojureScript side it really doesn't matter at all.
When builing a Clojure Backend you will often deploy in some "uberjar" or "uberwar" setup. This means that all source files and dependencies are packed into one single .jar file (basically just a zip file). This is typically done by including all files from a specified set of directories, so it would include src/clj but not src/cljs. If everything is in one directory it would add the .cljs files as well although they are never used by the Clojure backend. So in essence it just makes your "uberjar" bigger. It is not an important optimizations but some people prefer to keep things lean and clean.
In addition some developers just prefer to separate the code this way. In this case the template authors did.


text:
Q: How to restyle code generated by ReSharper 8 If I ask ReSharper to implement INotyfyPropertyChanged interface for me it creates below code
[NotifyPropertyChangedInvocator]
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
{
    PropertyChangedEventHandler handler = PropertyChanged;
    if (handler != null) handler(this, new PropertyChangedEventArgs(propertyName));
}

Is it possible (and if yes then where should I look for it) to restyle this snippet and to make ReSharper generate the changed one e.g. replace PropertyChangedEventHandler with var keyword and move condition body to the next line?

A: Both those options are in "code clean up" options:
Go to Resharper->Options...
Then go to Code Editing->Code Cleanup

*

*Set the use 'var' in declaration option.

*Check/tick Reformat code.

*Save the profile and set the "Profile to use with silent clean-up:" to it.

This has set up the silent clean-up, but to explicitly clean up at anytime, there is a key shourtcut which is usually Ctrl+E, F
If this doesn't resolve the new line after the if, then look under Code Editing->C#->Formatting Style. This is where the rules of "Reformat code" are defined.


text:
Q: Subequations inside a table I am trying to insert a subequation system inside a table.
This is the idea of what I want:
\begin{table*}[tb]
\centering
\caption{Device Modelling Specifications.}
\label{tab:deviceModelling}
%\begin{tabular}{p{2.4cm} p{1.4cm} p{1.4cm} p{1.4cm}}
\begin{tabular}{l c c c}

.....

 \hline
\textbf{Fist model} &
\begin{subequations}
\begin{equation}
a = b
\end{equation}
\begin{equation}
a2 = b2
\end{equation}
\end{subequations}
&
....

How can I do it?

A: Here is a possible solution:
\documentclass[10pt,a4paper]{article}

\usepackage{amsmath}
\usepackage{array}

\begin{document}
    \begin{table*}[tb]
        \centering
        \caption{Device Modelling Specifications.}
        \label{tab:deviceModelling}
        \begin{tabular}{|m{2.4cm}|m{1.4cm}|m{1.4cm}|m{1.4cm}|}
            \hline
            \textbf{Fist model} &
            {\begin{align*}
                a &= b\\
                a2 &= b2
            \end{align*}} &
            another cell & last cell\\
            \hline
            dummy & text & I & entered\\
            \hline
        \end{tabular}
    \end{table*}
\end{document}

As David Carlisle put it in his comment, you will need a paragraph type of cell, so l, r or c columns won't do. I assumed you would like to have things centered vertically, so I chose type m (note that this option requires the array package). If you have other preferences, instead of m you can use p (top) or b (bottom).
The amsmath package will give you the possibility to use the align environment, as I did in the example. You can also choose from a wide variety of environments described in the amsmath documentation.
One last thing: The entire align environment is put between curly braces, because otherwise LaTeX will try to expand it at the wrong moment and the document will not compile. This comes from the fact that align uses & to set the alignment points and the same character is used as a cell separator in tabular. Of course in an environment without ampersand (e.g. multline) there is no need for these braces.


text:
Q: Correct way to access Yii2 components in your modules? I have created and configured a module fooModule. I need to create a component inside the module.
This is my configuration for my module in main.php
'modules'=>array(
    'fooModule'=>array(
         'class' => 'app\modules\fooModule\Module',
         'components'=>array(
            'testComponent'=>array(
                'class'=>'app\modules\fooModule\components\testComponent',
            ),
        ),
    ),
),

In the folder module fooModule i have created a folder components with  a file testComponent.php
TestComponet.php has a class test which extend \yii\base\Component. See below
namespace app\modules\fooModule\component;

class test extends \yii\base\Component {

        public function __construct() {
                private $bar;
        }

        public function exampleFunction() {
                echo 'am alive, come and look for me please!!';
        }

}

How do i access test class in fooModule Controller ?

A: The most elegant way to access module component from module controller without hardcoding module's ID is as follows:
$this->module->testComponent->exampleFunction();

A: Use Yii::$app->getModule('fooModule')->testComponent->exampleFunction(); for access module component.

A: This looks very elegant
Module::getInstance()->testComponent


text:
Q: Предложение, которое читается одинаково в обоих направлениях (слева направо и наоборот), при этом игнорируя регистр, пробелы и знаки препинания function isWerewolf(target) {
  let direct = '';
  let reverced = '';

  for(let i = 0; i < target.length; i++ ){
    let add = target.replace(/[^a-zа-яё]/gi, '');
      direct += add;
      reverced += add;

      let direct1 = direct.toLowerCase();
      let reverced1 = reverced.toLocaleLowerCase();

      if(direct1 === reverced1){
        return true
      }else{
        return false
      }
  }
}

Не пойму как мне добавлять текущий элемент в reversed в конец строки, так что бы он стазу стал перевёртышем. А потом уже проводить сравнение.

A: Алгоритм очень прост:

*

*Оставляем в строке только буквы и цифры

*Делим строку посимвольно

*Разворачиваем

*Проходимся по получившемуся массиву и смотрим совпадает ли каждый символ в нижнем регистре с символом в строке

const isWerewolf = (str) => {
  const newStr = str.replace(/[^\wа-яё]+/gi, '').toLowerCase();

  return newStr.split('').reverse().every((x, i) => x === newStr[i]);
}

console.log(isWerewolf('abBA'));
console.log(isWerewolf('abBAc'));
console.log(isWerewolf('abcdeffedcba!'));
console.log(isWerewolf('абвгдеё ЁЕДГВБА!'));

P.S. Надо понимать что в развёрнутом массиве 0-ой элемент - это послдений элемент в строке, 1-ый - это предпоследний элемент и т.д. Потому, когда мы сравниваем 0-ой элменет в развёрнутом массиве с 0-ым элементом в строке, мы сравниваем 0-ой и последний элемент в строке

A: *

*Получаем очищенную от всего лишнего строку в нижнем регистре.

*Посимвольно сравниваем первую половину строки со второй половиной.

Код не самый компактный, но эффективный:

const isPalindrome = (str) => {
  const cleaned = str.replace(/[^a-zа-яё]/gi, '').toLowerCase();
  let i = ~~(cleaned.length / 2);

  while (--i > 0) {
    if (cleaned[i] !== cleaned[cleaned.length - i - 1]) return false;
  }

  return true;
}

console.log(
  isPalindrome("Он — верба, но / Она — бревно"),
  isPalindrome("Семиногий пятирук играет в гольф")
);

A: Функция будет называться isPalindrome, извините. Сперва опустим строке регистр. Затем выделим числа (\d) и буквы любых алфавитов на любых языках (\p{L}). То что осталось соберём в первую строку. Массив перевернём и соберём во вторую строку. Строки сравним:

const isPalindrome = s => {
    const arr = s.toLowerCase().match(/[\d\p{L}]/gu);
    const s1 = arr.join('');
    arr.reverse();
    const s2 = arr.join('');
    return s1 === s2;
};

[
    'abBA',
    'abBAc',
    'abcdeffedcba!',
    'абвгдеё ЁЕДГВБА!',
    "Он — верба, но / Она — бревно",
    "Семиногий пятирук играет в гольф",
    "А роза упала на лапу Азора.",
    "12321",
    "123"
].forEach(s => console.log(isPalindrome(s), s));