text:
Q: Could not find a version that matches pathspec There was a problem downloading awsebcli to deploy the Django project on AWS.
pipenv install awsebcli

enter image description here
this is my pipfile
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true

[dev-packages]
flake8 = "*"
black = "*"

[packages]
pathspec = "== 0.5.9"
django = "==3.0.3"

[requires]
python_version = "3.7"

[pipenv]
allow_prereleases = true

A: Remove the Pipfile and re-install project dependencies and generate a new Pipfile:
pipenv --rm
rm Pipfile
rm Pipfile.lock
pipenv install pathspec django

related issues:
https://github.com/pypa/pipenv/issues/3549
https://github.com/pypa/pipenv/issues/3705


text:
Q: How to load demonstration data after database creation ODOO i have created the database without checking Load demonstration data.
Now my code is failing to obtain demo_user on my tests :: As expected
user_demo = self.env.ref('base.user_demo')

ValueError: External ID not found in the system: base.user_demo

Now how can i load demonstration data

A: Depending on the Odoo version, at least since Odoo 12 it is possible to load demo data later:

*

*Go to "Settings" -> "General Settings", scroll to the very bottom.

*Click "Activate the developer mode".

*Click on the little bug icon (top right) to open the developer's menu.

*Click "Become Superuser".

*Now in "Settings" -> "General Settings", scroll to the very bottom
again

*Click "Load demo data".
Screenshot: Odoo settings, load demo data link

A: Well the answer is in your question, demonstration data is loaded only when a database is created with that "Load demonstration data" option.

redpajama_set_name: RedPajamaStackExchange


text:
Q: Are there any NoSQL standards emerging? As with most new technologies after a while a standard emerges.
Is there anything cooking for NoSQL?

A: There is no single standard NoSQL solution, as Jörg explained (+1). The term NoSQL covers a wide array of database types, each tailored for a specific data domain.
Ayende's That No SQL Thing series takes a look at some of the mainstream NoSQL solutions and highlights the strengths and weaknesses of each type. He discusses the following:

*

*Key/value stores

*Column-family stores

*Document databases

*Graph databases

You can think of these different types as standards within NoSQL. Just remember that each of them is specialized for certain data storage problems. There's no "one size fits all" solution: all of them will continue to exist.

A: A query language for JSON, semi-structured and document databases called UnQL is being developed:
http://www.unqlspec.org/display/UnQL/Home

A: The whole point of NoSQL is that there are no standard solutions. Every data storage problem is different, and you need to choose the data storage technology that is appropriate for your specific problem and not the one that is "the standard".
That's the whole premise of "Not Only SQL".
Take ACID (here's a pieve of advice you never thought you'd get on StackOverflow, or really anywhere after 1987 :-) ), for example. There is a wide array of problems which don't need ACID guarantees. For those problems, ACID is overkill. Overkill that translates into wasted I/O, wasted CPU cycles, wasted performance. Which means wasted heat and wasted energy, which in turn means wasted money on electrical and utility bills.
Some problems only need weaker forms of those guarantees. For example, for a wide array of web applications the so-called eventual consistency is plenty enough. Other problems need higher guarantees than what SQL-style ACID provides.
So, some NoSQL databases don't have ACID guarantees or only have them in a weaker form. Some can turn them on and off on a per-DB basis. Some can turn A, C, I and D on and off individually on a per-DB basis. Some can not only turn A, C, I and D on and off individually, they can finetune them on a sliding scale. Some can even do that on a per-query basis.
If you have hierarchical data, store it in a hierarchical database. If you have graph data, store it in a graph database. If you have key-value data, store it in a key-value database. If you have semi-structured document data, store it in a document database. If you have semantic RDF data, store it in a triple database. If you build a data warehouse, store it in a column database. And if you have relational data, then, by all means store it in a relational database. (But only if you actually have relational data!)

A: Some people have contemplated about standards for document db's: http://nosql.mypopescu.com/post/731261002/a-common-nosql-query-language .
However key-value-stores and document db's don't do joins and that means that their query languages are simple and easy to learn. There is less need for a common language like SQL.
However .NET developers can use LINQ to access document db's MongoDB and RavenDB, and some people are developing a LINQ provider to document db CouchDB: http://github.com/sinesignal/ottoman . LINQ isn't a NoSQL standard but a standard for everything that is related to data. You can use it to talk to a relational database or an xml file too.
Graph databases are very different from key-value-stores and document db's. I don't think you can unite them in one standard. I really don't know if it is possible to develop a LINQ provider for a graph database. I guess not but I'm not sure.

A: Some NoSQL product supports SQL or a super set of it. This is the case of OrientDB, a document-graph nosql dbms with the support of SQL. It's released under Apache 2 license.
Furthermore it can export document in JSON format (you can export/import the entire database in JSON). Other NoSQL products read/write JSON.
bye,
Lvc@

A: (Speaking specifically on subset of NoSQL known as Document databases).
Many document databases do not expose a "Query Language".  In lieu, they often provide Query APIs and these APIs are specific to the implementation and controlled by the individual sponsors/owners of the implementations (10gen for MongoDB, for example).
In the XML database space (a subset of Document databases), there is the W3C standard XQuery.  It is a query and functional programming language designed for querying collections of XML data (says wikipedia).
It is unclear yet if there is any need/desire for a standard query API (or language) for JSON data.  JSONPath (analogous to XPath) has been proposed, but it's received little attention other than it's use by Kynetx .

A: One potentially interesting one is AppScale which provides a unified API for HBase, Hypertable, MySQL Cluster, Cassandra, Voldemort, MongoDB, MemcacheDB and Redis. The API is defined by Google for the Google App Engine and is available for Java, Python and Go.


text:
Q: Отличия структуры БД у Django 1.4 vs 4.1 Есть очень старый сайт, работающий на Django 1.4.3. Стоит задача обновить на свежее, на данный момент актуальная версия 4.1.
Базу нужно не потерять, она большая.
Скажите, есть ли какие-то факторы, приводящие к невозможности переноса существующей БД и использовании её после обновления Django?
На данный момент используется БД 10.3.34-MariaDB, планируется плюс-минус такая же версия. ОС - Debian.


text:
Q: react native with firebase onDisconnect I build react native app and I'm trying to make event when user close the app, so it update in firebase the status to 'offline'.
what I do is
    import React, { Component } from 'react'
import Router from './src/Router'
import firebase from 'react-native-firebase';

export default class App extends Component {
    constructor(props){
        super(props)
        this.state = {
            uid: '',
            userStatusDatabaseRef :'',
            userStatusFirestoreRef: ''
        }
    }
    componentWillMount() {
        firebase.auth().signInAnonymouslyAndRetrieveData().then((user) => {

            var uid = firebase.auth().currentUser.uid;
            console.log('uid', uid)
            var userStatusDatabaseRef = firebase.database().ref('status/' + uid);

            var isOfflineForDatabase = {
                state: 'offline',
                last_changed: firebase.database.ServerValue.TIMESTAMP,
            };

            var isOnlineForDatabase = {
                state: 'online',
                last_changed: firebase.database.ServerValue.TIMESTAMP,
            };

            var userStatusDatabaseRef = firebase.database().ref('status/' + uid);

            var userStatusFirestoreRef = firebase.firestore().doc('status/' + uid);

            var isOfflineForFirestore = {
                state: 'offline',
                last_changed: firebase.firestore.FieldValue.serverTimestamp(),
            };

            var isOnlineForFirestore = {
                state: 'online',
                last_changed: firebase.firestore.FieldValue.serverTimestamp(),
            };

            const connectedRef = firebase.database().ref(".info/connected");
            connectedRef.on("value", function (snap) {
                // validate if connection is established
                if (snap.val() === true) {
                    // remove the user's record on the disconnect
                    userStatusDatabaseRef.onDisconnect().set(isOfflineForDatabase).then(()=>{
                        userStatusFirestoreRef.set(isOnlineForFirestore);

                    })
                    // then request user to enter their name
                } else {
                    userStatusFirestoreRef.set(isOfflineForFirestore);

                }
            });
            this.setState({userStatusDatabaseRef,userStatusFirestoreRef,uid})
        })

    }
    render() {
        return <Router />
    }
    componentWillUnmount(){
        var isOfflineForFirestore = {
            state: 'offline',
            last_changed: firebase.firestore.FieldValue.serverTimestamp(),
        };

        this.state.userStatusFirestoreRef.set(isOfflineForFirestore);

    }
}

first, I would like to understand when onDisconnect fire and what is do. second, when i navigate to other screen, it fire me and that's not what I'm looking for, only when user close app from each screen. I don't want to duplicate the code and write in each component because it's not right coding. what I'm looking for event from each screen/component that user that can update in firebase offline or online
I changed my code and it update only in firebase and not the firestore
 const connectedRef = firebase.database().ref(".info/connected");

            // validate if connection is established
            if (snap.val() === true) {
                userStatusFirestoreRef.set(isOnlineForDatabase);
                userStatusDatabaseRef.set(isOnlineForDatabase)

                // remove the user's record on the disconnect
                userStatusDatabaseRef.onDisconnect().remove((error)=>{
                    userStatusDatabaseRef.set(isOfflineForFirestore);
                    userStatusFirestoreRef.set(isOfflineForFirestore);

                })
                // then request user to enter their name
            } else {

                userStatusFirestoreRef.set(isOfflineForFirestore);

            }
        });

why it's not set the value also in firestore to 'offline'
 userStatusDatabaseRef.onDisconnect().remove((error)=>{
                    userStatusDatabaseRef.set(isOfflineForFirestore); // it update only in firebase
                    userStatusFirestoreRef.set(isOfflineForFirestore);

                })

A: Once you establish a firebase onDisconnect() operation, the operation is initiated on FireBase RealTime Sever. It checks if your user can perform write operations and pass callbacks for the same if invalid.
It also checks the connection status. When your connection is lost or timed out or deliberately closed by the client, the connection is invoked.
The second part of your question depends upon the nature of your navigation, whether the component umounts thereby disconnecting from the server or whether it is nested inside the same.
According to the docs , you can use the remove operation
Ensures the data at this location is deleted when the client is disconnected (due to closing the browser, navigating to a new page, or network issues)
 YourFireBaseRef.onDisconnect().remove((error) => {
      // Do some stuff
    });

Also another thing to note is
onDisconnect operations are only triggered once. If you want an operation to occur each time a disconnect occurs, you'll need to re-establish the onDisconnect operations each time you reconnect.


text:
Q: How to read/understand the code behind TF/Keras API? I started using Tensorflow/Keras for basics Neural Networks architectures such as Feed-Forward networks or RNN.
Although it is working well and there are plenty of information on how this works, in principle, on the internet, I could not find any direct explanation of Tensorflow/Keras source code.
When I have a look in the source directory of the package, there are thousands of files and there is virtually no way (at least for me) to find relevant information in this. It seems everything is highly nested and I can't find the code corresponding to the maths behind layers I call.
So I'd like someone to provide tips on how to find such information in Tensorflow/Keras code or any resource that comments the inner working of basic networks directly linked with the source of the API implementation.

A: Well I am unsure Tensorflow/Keras has ever been made to be "used" for this purpose.
You may want to look at EpyNN.
This is an educational project which provides API, examples and documentation website. The source code is written to be read.
While this is basic compared to Tensorflow/Keras, what it provides has been validated against it. For identical configurations results are identical. So you could use that to understand, somehow, the necessary part of what's behind Tensorflow/Keras API for the basic use you mention.
Disclaimer: I am the main author of EpyNN.


text:
Q: Inserting multiple columns to a list at once I'm working with a nested list (labeled here as allEntries) and I'm trying to insert some additional columns. My list has 12 categories, each category has a different number of entries, and each entry starts with 15 elements.
I'm trying to add 3 more elements, and currently I'm doing it one element at a time using table and insert. For instance the first thing I want to add is the day of the week explicitly
allEntries  =
Table[
    Insert[
        allEntries[[j, i]],
        DateString[{allEntries[[j, i, 2]], {"Month", "Day", "Year", "Hour", "Minute"}}, "DayName"],
         3],
{j, 1, Length[shapes]},
{i, 1, Length[allEntries[[j]]]}
];

Here j goes from 1 to 12, and then i goes from 1 to the number of entries in the category (anywhere from a few hundred to a few 10s of thousands). I'm simply converting the date into a simple day of the week to make it easier to select later on, and I want this added at position 3.
This works fine, but I'm doing it two more times to add other data in the same fashion, and it seems like there should be a way to add this in one step.

A: Multiple inserts can be made using Fold or ReplaceAll, e.g.
list = {1, 2, 3, 4, 5, 6, 7, 8, 9};

Fold[Insert[#1, First[#2], Last[#2]] &, list, {{"a", 2}, {"b", 4}, {"c", 6}}]

{1, a, 2, b, 3, c, 4, 5, 6, 7, 8, 9}

list /. {x_Integer, y_, z_, rest__} :> {x, "a", y, "b", z, "c", rest}

{1, a, 2, b, 3, c, 4, 5, 6, 7, 8, 9}

Applied to the OP's data structure.
shapes = Range[12];
r = ReplacePart[Range[15], 2 -> "Nov 9 2017 13:24"];

save = allEntries = {
    {r, r, r},
    {r, r},
    {r, r, r, r},
    {r},
    {r, r, r, r},
    {r, r, r},
    {r},
    {r, r, r, r},
    {r, r},
    {r, r, r},
    {r},
    {r, r, r, r}
    };

Demonstrating the OP's single insert function.
allEntries = Table[Insert[allEntries[[j, i]],
    DateString[{allEntries[[j, i, 2]],
      {"Month", "Day", "Year", "Hour", "Minute"}}, "DayName"], 3],
   {j, 1, Length[shapes]}, {i, 1, Length[allEntries[[j]]]}];

allEntries[[1, 1]]

{1, Nov 9 2017 13:24, Thursday, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}

Resetting allEntries for the Fold method.
allEntries = save;

allEntries = Table[
   Fold[Insert[#1, First[#2], Last[#2]] &,
    allEntries[[j, i]], {{DateString[{allEntries[[j, i, 2]],
        {"Month", "Day", "Year", "Hour", "Minute"}}, "DayName"], 3},
     {DateString[DatePlus[
        allEntries[[j, i, 2]], {1, "Day"}], "DayName"], 4},
     {DateString[DatePlus[
        allEntries[[j, i, 2]], {2, "Day"}], "DayName"], 5}}],
   {j, 1, Length[shapes]}, {i, 1, Length[allEntries[[j]]]}];

allEntries[[1, 1]]

{1, Nov 9 2017 13:24, Thursday, Friday, Saturday, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}

Easier usingReplaceAll.
allEntries = save;

allEntries = allEntries /. {a_Integer, date_, rest__} :> {a, date,
    DateString[{date,
      {"Month", "Day", "Year", "Hour", "Minute"}}, "DayName"],
    DateString[DatePlus[date, {1, "Day"}], "DayName"],
    DateString[DatePlus[date, {2, "Day"}], "DayName"], rest}

allEntries[[1, 1]]

{1, Nov 9 2017 13:24, Thursday, Friday, Saturday, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}


text:
Q: MySQL 5.5 : Cannot drop database : Lost connection to MySQL server during query After a huge crash of my mysql database, I've made a recovery, all is ok except one schema.
In phpMyAdmin, this schema doest not cotains any tables, but we i ask mysql to drop the schema (drop database xxxx) I've the following error :
Lost connection to MySQL server during query

In the mysql error.log, I see the following :
InnoDB: Load table 'xxxx/menu' failed, the table has missing foreign key indexes. Turn off 'foreign_key_checks' and try again.140120 10:52:35  InnoDB: Assertion failure in thread 139903484229376 in file row0mysql.c line 3822
InnoDB: Failing assertion: table
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
InnoDB: If you get repeated assertion failures or crashes, even
InnoDB: immediately after the mysqld startup, there may be
InnoDB: corruption in the InnoDB tablespace. Please refer to
InnoDB: http://dev.mysql.com/doc/refman/5.5/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.
09:52:35 UTC - mysqld got signal 6 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help
diagnose the problem, but since we have already crashed,
something is definitely wrong and this may fail.
Please help us make Percona Server better by reporting any
bugs at http://bugs.percona.com/

key_buffer_size=16777216
read_buffer_size=131072
max_used_connections=6
max_threads=153
thread_count=5
connection_count=5
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 351196 K  bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

Thread pointer: 0x314ff30
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 7f3dd17aee80 thread_stack 0x30000
/usr/sbin/mysqld(my_print_stacktrace+0x2e)[0x7c613e]
/usr/sbin/mysqld(handle_fatal_signal+0x4a4)[0x69daf4]
/lib/x86_64-linux-gnu/libpthread.so.0(+0xfcb0)[0x7f3dd0d96cb0]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x35)[0x7f3dcff87425]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x17b)[0x7f3dcff8ab8b]
/usr/sbin/mysqld[0x813038]
/usr/sbin/mysqld[0x7eb25c]
/usr/sbin/mysqld[0x69db6f]
/usr/sbin/mysqld(_Z24plugin_foreach_with_maskP3THDPFcS0_P13st_plugin_intPvEijS3_+0x226)[0x5b2376]
/usr/sbin/mysqld(_Z11mysql_rm_dbP3THDPcbb+0x616)[0x587ca6]
/usr/sbin/mysqld(_Z21mysql_execute_commandP3THD+0x139e)[0x5a411e]
/usr/sbin/mysqld(_Z11mysql_parseP3THDPcjP12Parser_state+0x314)[0x5aa304]
/usr/sbin/mysqld(_Z16dispatch_command19enum_server_commandP3THDPcj+0x20a4)[0x5ac454]
/usr/sbin/mysqld(_Z24do_handle_one_connectionP3THD+0x137)[0x648397]
/usr/sbin/mysqld(handle_one_connection+0x51)[0x648471]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x7e9a)[0x7f3dd0d8ee9a]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x6d)[0x7f3dd00453fd]

Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (7f3d98004b60): is an invalid pointer
Connection ID (thread ID): 710
Status: NOT_KILLED

I have tested all innodb_force_recovery value (1 to 6) and disable foreing key checks, but nothings help...
Moreover, in the information_schema I can see some values :

*

*In INNODB_SYS_TABLES
==> (1717, 'xxxx', 'menu', 1, 10, 0),

*In INNODB_SYS_FOREIGN ==> ('xxxx/menu_FK_1', 'xxxx/menu', 'kms_site1/page_zone_component', 1, 5),

*In INNODB_SYS_FOREIGN_COLS ==> ('xxxx/menu_FK_1', 'page_zone_component_id', 'id', 0),

I think, I've some residual table/index in innodb description file, but I don't know how to repair that...


text:
Q: Spring ProxyFactoryBean Injection Problem I have a ProxyFactoryBean bean :
<bean id="sendSingleSmsServiceProxy" class="org.springframework.aop.framework.ProxyFactoryBean">
   <property name="target">
      <ref bean="sendSingleSmsServiceImpl" />
   </property>
   <property name="proxyInterfaces">
      <value>com.test.SendSingleSmsService</value>
   </property>
   <property name="interceptorNames">
      <value>hibernateInterceptor</value>
   </property>
</bean>

and I'm trying to inject this bean into another one with @Resource annotation here is my code for that :
@Resource
public ProxyFactoryBean sendSingleSmsServiceProxy;

but I get this exception :

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.test.webservice.impl.SendSingleSmsImpl': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean named 'sendSingleSmsServiceProxy' must be of type [org.springframework.aop.framework.ProxyFactoryBean], but was actually of type [$Proxy24]

any help would be appreciated.

A: This is a mis-understanding in what ProxyFactoryBean does. Like all implewntations of FactoryBean, the bean that is generated is not the type of the FactoryBean, but the type of whatever bean the factory generates (see Spring docs)
In your case, the sendSingleSmsServiceProxy bean is going to be of type SendSingleSmsService:
@Resource
public SendSingleSmsService sendSingleSmsService;

The ProxyFactoryBean object is effectively transparent, what you see is whatever it generates.


text:
Q: ProgressBar Theme with diagonal lines decorator I want to decorate the WPF ProgressBar like the image below:
Current:

Decorated:

Also, those blank diagonal lines should move in marquee animation from left to right. At the moment i have this simple Style for the current appearance:
<Style x:Key="{x:Type ProgressBar}" TargetType="{x:Type ProgressBar}">
    <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="{x:Type ProgressBar}">
                <Border x:Name="BorderBackground" CornerRadius="3" BorderThickness="1" BorderBrush="{StaticResource ProgressBarBorderBrush}" Background="{StaticResource ProgressBarBackgroundBrush}">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Determinate" />
                                <VisualState x:Name="Indeterminate" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="PART_Track" Margin="2" BorderThickness="1" CornerRadius="2" />
                        <Border x:Name="PART_Indicator" Margin="2" BorderThickness="1" CornerRadius="2" HorizontalAlignment="Left" Background="{StaticResource ProgressBarTrackBackgroundBrush}"/>
                    </Grid>
                </Border>
            </ControlTemplate>
        </Setter.Value>
    </Setter>
</Style>

Anyone can help me to get it? I searched for it but maybe i missed the correct keywords to find something like this, at least i usually see (like at OS X progressbar) that this "decoration" is usually used.
Thanks in advance ;).

Solution template with the answer code a bit modified:
<Style x:Key="{x:Type ProgressBar}" TargetType="{x:Type ProgressBar}">
    <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="{x:Type ProgressBar}">
                <Border x:Name="BorderBackground" CornerRadius="3" BorderThickness="1" BorderBrush="{StaticResource ProgressBarBorderBrush}" Background="{StaticResource ProgressBarBackgroundBrush}" Effect="{StaticResource LightStrongDownLinearShadowEffect}">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Determinate" />
                                <VisualState x:Name="Indeterminate" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="PART_Track" Margin="2" BorderThickness="1" CornerRadius="2" />
                        <Border x:Name="PART_Indicator" Margin="2" BorderThickness="1" CornerRadius="2" HorizontalAlignment="Left" Background="{StaticResource ProgressBarTrackBackgroundBrush}" ClipToBounds="True">
                            <Border x:Name="DiagonalDecorator" Width="5000">
                                <Border.Background>
                                    <DrawingBrush TileMode="Tile" Stretch="None" Viewbox="0,0,1,1" Viewport="0,0,25,25" ViewportUnits="Absolute">
                                        <DrawingBrush.RelativeTransform>
                                            <TranslateTransform X="0" Y="0" />
                                        </DrawingBrush.RelativeTransform>
                                        <DrawingBrush.Drawing>
                                            <GeometryDrawing Brush="#20FFFFFF" Geometry="M10,0 22,0 12,25 0,22 Z" />
                                        </DrawingBrush.Drawing>
                                    </DrawingBrush>
                                </Border.Background>
                                <Border.Triggers>
                                    <EventTrigger RoutedEvent="FrameworkElement.Loaded">
                                        <BeginStoryboard>
                                            <Storyboard>
                                                <DoubleAnimation Storyboard.TargetProperty="(Border.Background).(DrawingBrush.RelativeTransform).(TranslateTransform.X)" From="0" To=".25" RepeatBehavior="Forever" Duration="0:0:15" />
                                            </Storyboard>
                                        </BeginStoryboard>
                                    </EventTrigger>
                                </Border.Triggers>
                            </Border>
                        </Border>
                    </Grid>
                </Border>
            </ControlTemplate>
        </Setter.Value>
    </Setter>
</Style>

A: Edit:
This article from codeproject.com has a working version of the "barber pole" progress bar.  Search the article for "CandyCaneProgressPainter".
Previous answer:
This does almost exactly what you want.  All you have to do to make it what you want is restrict the visibility of the rectangle to the percentage you want and change the height/width ratio.
The keywords you want are "storyboard", "animate" and "trigger"
Here is the xaml from the link with some comments from the link on making the animation smooth:
 <Rectangle x:Name="pole" Width="100" Height="20" Stroke="Black" StrokeThickness="1">
  <Rectangle.Fill>
   <DrawingBrush TileMode="Tile" Stretch="None" Viewbox="0,0,1,1" Viewport="0,0,25,25" ViewportUnits="Absolute">
    <DrawingBrush.RelativeTransform>
     <TranslateTransform X="0" Y="0" />
    </DrawingBrush.RelativeTransform>
    <DrawingBrush.Drawing>
     <GeometryDrawing Brush="Red" Geometry="M10,0 25,0 15,25 0,25 Z" />    </DrawingBrush.Drawing>
   </DrawingBrush>
  </Rectangle.Fill>
  <Rectangle.Triggers>
   <EventTrigger RoutedEvent="FrameworkElement.Loaded">
    <BeginStoryboard>
     <Storyboard>
      <DoubleAnimation Storyboard.TargetProperty="(Rectangle.Fill).(DrawingBrush.RelativeTransform).(TranslateTransform.X)" From="0" To=".25" RepeatBehavior="Forever" Duration="0:0:1" />
     </Storyboard>
    </BeginStoryboard>
   </EventTrigger>
  </Rectangle.Triggers>
 </Rectangle>

I guess the jerking happens if you remove the "width" value, but if the value is put back it runs smooth. Weird.
Yup, indeed it basically needed a few adjustments with the multiples of the number rules the width in this case the animation can be a .1 or a .05 if for instance you have a 5000 width.... now it work great!

A: In your PART_Indicator border embed a Compound Path of the shapes to make the diagonal lines. You're going to have to kind of fake the Marquee effect to get the scrolling diagonal lines however unless you want to use a jquery plugin or other alternative.
However what you CAN do in pure xaml is create the diagonal line paths, make lots and lots of them to make the row of diagnol lines very very long. Since they're embedded in the indicator border they're only visible within it.
Now create a new storyboard animation and use a ControlStoryboardAction Behavior to trigger it onload and set it to repeat. Grab the diagonal lines compound path an choose a keyframe on your timeline a ways out from the start frame, then drag the Compound Path of diagonal lines to one side or set a large Margin to the left so during the animation sequence it moves to the right. The idea is its a visual hoax. Your diagonal lines will just act as an animation storyboard that only mimics the marquee animation. So those lines will still move across the bar and hopefully theres enough of them the animation doesnt repeat before the content is loaded. Hopefully this makes sense haha. It takes some tweaking but you can result in a decent solution. Best of luck!

A: This post is quite old, but I just faced the same problem and got a nice solution I would like to share:
  <SolidColorBrush x:Key="ProgressBarBackgroundBrush" Color="Gray" />
  <SolidColorBrush x:Key="ProgressBarTrackBackgroundBrush" Color="#105295" />
  <Style x:Key="{x:Type ProgressBar}" TargetType="{x:Type ProgressBar}">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type ProgressBar}">
                        <controls:RoundBorder x:Name="BorderBackground" CornerRadius="3" BorderThickness="0"
                        BorderBrush="{StaticResource ProgressBarBorderBrush}"
                        Background="{StaticResource ProgressBarBackgroundBrush}">
                            <Grid>
                                <VisualStateManager.VisualStateGroups>
                                    <VisualStateGroup x:Name="CommonStates">
                                        <VisualState x:Name="Determinate" />
                                        <VisualState x:Name="Indeterminate" />
                                    </VisualStateGroup>
                                </VisualStateManager.VisualStateGroups>
                                <Border x:Name="PART_Track" Margin="0" BorderThickness="0" CornerRadius="3"  />
                                <Border x:Name="PART_Indicator" Margin="0" BorderThickness="0" CornerRadius="3" HorizontalAlignment="Left"
                                Background="{StaticResource ProgressBarTrackBackgroundBrush}" ClipToBounds="True">
                                    <Border x:Name="DiagonalDecorator" Width="5000">
                                        <Border.Background>
                                            <DrawingBrush  TileMode="Tile" Stretch="None" Viewbox="0,0,1,1" Viewport="0,0,36,34"  ViewportUnits="Absolute">
                                                <DrawingBrush.RelativeTransform>
                                                    <TranslateTransform X="0" Y="0" />
                                                </DrawingBrush.RelativeTransform>
                                                <DrawingBrush.Drawing>
                                                    <GeometryDrawing Brush="#156dc7" Geometry="M0,0 18,0 36,34 18,34 Z" />
                                                </DrawingBrush.Drawing>
                                            </DrawingBrush>
                                        </Border.Background>
                                        <Border.Triggers>
                                            <EventTrigger RoutedEvent="FrameworkElement.Loaded">
                                                <BeginStoryboard>
                                                    <Storyboard>
                                                        <DoubleAnimation Storyboard.TargetProperty="(Border.Background).(DrawingBrush.RelativeTransform).(TranslateTransform.X)"
                                                    From="0" To=".36" RepeatBehavior="Forever" Duration="0:0:18" />
                                                    </Storyboard>
                                                </BeginStoryboard>
                                            </EventTrigger>
                                        </Border.Triggers>
                                    </Border>
                                </Border>
                            </Grid>
                        </controls:RoundBorder >
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>


text:
Q: How to compare two word documents (.docx) using AppleScript? I am trying to compare two MS Word Docx's (.docx files) using Macro's but Mac OS is not supporting VB Script and Microsoft is not providing the support for MAC OS as well.
Hence I found that, If I want to execute Macro's then I need to write AppleScript. I am very new to AppleScript, could anyone please help on this.
1) In the script, i have to get two documents from some source location and want to compare both the doc's using MS Word compare functionality.
MS Word Doc1: "http://source/old.docx";
MS Word Doc2: "http://source/new.docx";

A: You can't use AppleScript in this instance, I suspect you're confusing the OS-level automation provided by AppleScript with the Office-specific automation provided by Microsoft macros.
If you wish to compare two .docx files for differences, you either need to make use of a Word document-aware "diff editor" or you need to make use of a code-based solution (perhaps using docx4j or similar). Here are a couple of links to get you started:

*

*How to make TortoiseSVN diff .dot and .dotx Word template files

*https://www.altova.com/diffdog/word-document-comparison.html

*http://blog.martinfenner.org/2014/08/25/using-microsoft-word-with-git/

A: It is possible to do it.
Just open the Spotlight Search => write AppleScript Editor, open it and then File => Open Dictionary,  in the list, find Microsoft Word.app then click on Choose and in the input searcher write "Compare"
and you will see all the commands available to compare two .docx files using Microsoft Word Office and AppleScript


text:
Q: Need help modifying CSS code of animated text to fit with a form I created I'm trying to add and modify some animated CSS that I found to a 'subscription form' that I originally created.  The problem is that the animation I found does not fit within the confines of my form (i.e., it's too big).  I've tried to change the font size of the animation, but that seems to make things worse. I'm not even certain that my html is 100% correct.  At best, I am a beginner.   You'll find my code below:

<!DOCTYPE html>

        <form  action="https://feedburner.google.com/fb/a/mailverify" method="post" target="popupwindow" `onsubmit="window.open('https://feedburner.google.com/fb/a/mailverify?uri=blogspot/BKkas', 'popupwindow', 'scrollbars=yes,width=550,height=520');return true">`

Subscribe

Enter Your Email

To get the most recent news

delivered right to your inbox.

SIGN-UP NOW!

<input type="text" name="email"/>

          <input type="hidden" value="blogspot/BKkas" name="uri"/>
          <input type="hidden" name="loc" value="en_US"/>
          <input type="submit" value="Subscribe" />

        </form>

A: Here is the text fit into the box.

<!DOCTYPE html>

        <form  action="https://feedburner.google.com/fb/a/mailverify" method="post" target="popupwindow" `onsubmit="window.open('https://feedburner.google.com/fb/a/mailverify?uri=blogspot/BKkas', 'popupwindow', 'scrollbars=yes,width=550,height=520');return true">

Subscribe

Enter Your Email

To get the most recent news

delivered right to your inbox.

SIGN-UP NOW!

<input type="text" name="email"/>

          <input type="hidden" value="blogspot/BKkas" name="uri"/>
          <input type="hidden" name="loc" value="en_US"/>
          <input type="submit" value="Subscribe" />

        </form>


text:
Q: MySQL constraints to force data check on two columns I have this innoDB table with two columns in Mysql:
CREATE TABLE mytable (
  `id_1` mediumint(8) unsigned NOT NULL,
  `id_2` mediumint(8) unsigned NOT NULL
) ENGINE=InnoDB;

And I want to force a check on INSERT operations: id_1 must be less than id_2
So I tried with this but it didn't work out:
ALTER TABLE mytable ADD CONSTRAINT mycheck CHECK (id_1 < id_2)

Is this even possible? What I did wrong?
Thanks!

A: Unfortunately MySQL don't support CHECK CONSTRAINT and thus your ALTER statement won't be of any use. Per MySQL documentation it parses but ignores the CHECK clause. Though you can get the similar effect using a BEFORE INSERT TRIGGER. Something like below
delimiter //
CREATE TRIGGER trig_check BEFORE INSERT ON  mytable
FOR EACH ROW
BEGIN
IF NEW.id_1 > NEW.id_2 THEN
//Throw Error Probably
END IF;
END
//
delimiter ;


text:
Q: Como tornar global uma variável local em C (ou C++)? Eu consigo fazer uma variável local se transformar em global, mesmo ela estando dentro de uma função? Na linguagem C ou mesmo C++ se não existir na C. Já vi algo do tipo em Java, mas não sei exatamente como funciona.

A: Faça como todos falaram, ou ainda melhor, declare fora do escopo da função e como static.
static int variavel=0;

void X()
{
      variavel++;
}
int main()
{
     cout << variavel;
     variavel ++;
     cout << variavel;
     X();
     cout << variavel;
     return 0;
}

A: A única maneira (até aonde eu conheço) de você possuir uma variável global em C é declarando ela fora de qualquer função, como qualquer outra variável global.
Imagino que o que você esteja querendo é declarar uma variável local com o comportamento de uma variável global, com as limitações de escopo. Para isso utilize a palavra static.
void funcao(){
    static int k = 0;
    k++;
    printf("%d\n", k);
}

Ao chamar a função 3 vezes, ela irá imprimir:
1
2
3

A explicação para isso se deve ao fato de que, ao declarar uma variável local como static, ela será armazenada em outro local de memória. Sempre que há uma chamada de função é gerada o chamado call stack, nela é reservada um espaço para guardar os valores das variáveis locais e, ao sair da função, a região é liberada. Ao utilizar o static, a variável é alocada em outro local.
Há uma leitura interessante sobre pilha de chamada de funções, caso tenha interesse: BufferOverflow
Recomendo: Static: The Multipurpose Keyword


text:
Q: Passing a parameter through URL via loop So, I'm trying to pass the name of the PDF to the URL so that the view can display the relevant PDF.
urls.py
path('show-invoice/<str:invoice>', views.pdf_view, name ="pdfview")

views.py
def pdf_view(request, invoice):
    invoicename = Laptop.objects.get(invoice=invoice)
    invoicename = invoicename.invoice
    pdfpath = settings.MEDIA_ROOT + invoicename
    pdfpath = pdfpath.replace('/', '\\')
    try:
       return FileResponse(open(pdfpath, 'rb'), content_type='application/pdf')
    except FileNotFoundError:
       raise Http404()

models.py
invoice = models.FileField(default='default.pdf', upload_to='uploads/')

invoice_list.html

View invoices

{%for i in invoices%}

        {{i.invoice}}

{%endfor%}

Now, my question is: Why does it work when I use invoice='default.pdf' and not when I useinvoice=i.invoice? I get the following error
NoReverseMatch at /invoices/
Reverse for 'pdfview' with keyword arguments '{'invoice': 'uploads/default1.pdf'}' not found. 1 pattern(s) tried: ['show\\-invoice\\/(?P<invoice>[^/]+)$']

A: Because the str  converter you have used in the path does not match the \ in your invoice attribute.
You can use the path converter instead:
path('show-invoice/<path:invoice>', ...)


text:
Q: Content editor web part issue in PNP Modernization from classic publishing page to modern client side page I am using PNP modernization framework (.net) to transform classic SharePoint online publishing pages to modern client side pages.
The classic publishing page contains content editor web part in which HTML markup is written with CSS class names and the CSS file is referenced in the script editor web part that exists in the same page.
As there is no script editor web part in modern site so i am using community script editor to transform the script editor web part. I am also using community script editor web part to transform the content editor web part from the classic publishing page.
I am able to successfully transform the classic page to modern however when i open the transformed client side page in edit mode the sections on the page automatically converts to the text editor web part and the custom CSS classes are lost.
Did someone faced similar issue or can guide me how can i fix this issue ?
This is kind of urgent and quick response will be highly appreciated. Let me know if more details are required.
Many Thanks.

A: For Modern Page, it's suggested to deploy and use Modern Script Editor Web Part to add custom CSS/Javascript in the page, here is a detailed video demo in Youtube for your reference:
How To Install React Script Editor Webpart in Modern Sharepoint Sites Step by Step Full Information
Here is the source code from GitHub:
Script editor web part for modern pages built in React


text:
Q: Go POST request to Third-Party API I am stuck wanting to do a simple POST request from my go microservice to Rapyd API.
I searched for many solutions on the web but none worked...
If I try to make the request, I either got a 400 Bad Request or an error containing "Network unreachable"
I tried making the body payload with Go structs, with JSON from string but nothing seems to work, here is my code : (Sorry I had to insert the structs with snippet because it wasn't working with code sample)

type CardRequest struct {
    Amount        float64 `json:"amount"`
    Currency      string  `json:"currency"`
    PaymentMethod PaymentMethod `json:"payment_method"`
    ErrorPaymentURL string `json:"error_payment_url"`
    Capture         bool   `json:"capture"`
}

type PaymentMethod struct {
    Type   string `json:"type"`
    Fields Fields `json:"fields"`
}

type Fields struct {
    Number          string `json:"number"`
    ExpirationMonth string `json:"expiration_month"`
    ExpirationYear  string `json:"expiration_year"`
    Cvv             string `json:"cvv"`
}

    hc := http.Client{}
    form, _ := json.Marshal(CardRequest{
       Amount: 53.5,
       Currency: "THB",
       PaymentMethod: PaymentMethod{
           Type: "th_visa_card",
           Fields: Fields{
               Number: "4111111111111111",
               ExpirationMonth: "10",
               ExpirationYear: "21",
               Cvv: "123",
           },
       },
      ErrorPaymentURL: "https://error_example.net",
      Capture: true})
    http_method := "post"
    url_path := "/v1/payments"
    salt := strconv.Itoa(10000000 + rand.Intn(99999999-10000000))
    timestamp := strconv.Itoa(int(time.Now().Unix()))
    access_key := "my_access_key"
    secret_key := "my_secret_key"
    sign_str := http_method + url_path + salt + timestamp + access_key + secret_key + string(form[:])
    fmt.Println(form)
    h := hmac.New(sha256.New, []byte(secret_key))
    h.Write([]byte(sign_str))
    buf := h.Sum(nil)
    signature := base64.RawURLEncoding.EncodeToString(buf)
    httpReq, err := http.NewRequest("POST", "https://sandboxapi.rapyd.net/v1/payments", bytes.NewBuffer(form))
    // req.PostForm = form
    httpReq.Header.Set("Content-Type", "application/json")
    httpReq.Header.Set("access_key", access_key)
    httpReq.Header.Set("salt", salt)
    httpReq.Header.Set("signature", signature)
    httpReq.Header.Set("timestamp", timestamp)

    resp, err := hc.Do(httpReq)
    if err != nil {
        fmt.Println(err)
        return errors.New(fmt.Sprintf("payment request failed... %v", err))
    }
    bytes, err := httputil.DumpRequest(httpReq, true)
    if err != nil {
        fmt.Println(err)
    }

    fmt.Println(string(bytes))
    data, err2 := io.ReadAll(resp.Body)
    if err2 != nil {
        fmt.Println(err2)
        return errors.New(fmt.Sprintf("payment body lecture failed... %v", err2))
    }
    fmt.Println(string(data))
    resp.Body.Close()
    // if data.status != "SUCCESS" || data.data.status != "CLO" || data.data.amount != req.Order.Total {
    //  return errors.New(fmt.Sprintf("payment failed... %v", data.status.message))
    // }

Thank you very much for reading me, I don't what to do...
Don't hesitate to ask me for more informations and sorry if my english is bad!
EDIT
With my code I get this error : Post "https://sandboxapi.rapyd.net/v1/payments": dial tcp: lookup sandboxapi.rapyd.net on [::1]:53: dial udp [::1]:53: connect: cannot assign requested address
And with curl doing curl --header "Content-Type: application/json" --request POST --data '{"amount":9.99,"currency":"USD","payment_method":{"type":"us_visa_card","fields":{"number":"4111111111111111","expiration_month":"10","expiration_year":"21","cvv":"123"}},"error_payment_url":"https://error_example.net","capture":true}' -v https://sandboxapi.rapyd.net/v1/payments in verbose mode I receive :
*   Trying 23.21.18.233...
* TCP_NODELAY set
* Connected to sandboxapi.rapyd.net (23.21.18.233) port 443 (#0)
* schannel: SSL/TLS connection with sandboxapi.rapyd.net port 443 (step 1/3)
* schannel: checking server certificate revocation
* schannel: sending initial handshake data: sending 191 bytes...
* schannel: sent initial handshake data: sent 191 bytes
* schannel: SSL/TLS connection with sandboxapi.rapyd.net port 443 (step 2/3)
* schannel: failed to receive handshake, need more data
* schannel: SSL/TLS connection with sandboxapi.rapyd.net port 443 (step 2/3)
* schannel: encrypted data got 4096
* schannel: encrypted data buffer: offset 4096 length 4096
* schannel: encrypted data length: 4030
* schannel: encrypted data buffer: offset 4030 length 4096
* schannel: received incomplete message, need more data
* schannel: SSL/TLS connection with sandboxapi.rapyd.net port 443 (step 2/3)
* schannel: encrypted data got 1024
* schannel: encrypted data buffer: offset 5054 length 5054
* schannel: encrypted data length: 232
* schannel: encrypted data buffer: offset 232 length 5054
* schannel: received incomplete message, need more data
* schannel: SSL/TLS connection with sandboxapi.rapyd.net port 443 (step 2/3)
* schannel: encrypted data got 115
* schannel: encrypted data buffer: offset 347 length 5054
* schannel: sending next handshake data: sending 126 bytes...
* schannel: SSL/TLS connection with sandboxapi.rapyd.net port 443 (step 2/3)
* schannel: encrypted data got 51
* schannel: encrypted data buffer: offset 51 length 5054
* schannel: SSL/TLS handshake complete
* schannel: SSL/TLS connection with sandboxapi.rapyd.net port 443 (step 3/3)
* schannel: stored credential handle in session cache
> POST /v1/payments HTTP/1.1
> Host: sandboxapi.rapyd.net
> User-Agent: curl/7.55.1
> Accept: */*
> Content-Type: application/json
> Content-Length: 200
>
* upload completely sent off: 200 out of 200 bytes
* schannel: client wants to read 102400 bytes
* schannel: encdata_buffer resized 103424
* schannel: encrypted data buffer: offset 0 length 103424
* schannel: encrypted data got 226
* schannel: encrypted data buffer: offset 226 length 103424
* schannel: decrypted data length: 197
* schannel: decrypted data added: 197
* schannel: decrypted data cached: offset 197 length 102400
* schannel: encrypted data buffer: offset 0 length 103424
* schannel: decrypted data buffer: offset 197 length 102400
* schannel: schannel_recv cleanup
* schannel: decrypted data returned 197
* schannel: decrypted data buffer: offset 0 length 102400
< HTTP/1.1 400 Bad Request
< Date: Wed, 14 Apr 2021 06:16:04 GMT
< Content-Type: text/plain; charset=utf-8
< Content-Length: 11
< Connection: keep-alive
< ETag: W/"b-glZE90e6qywA5CDbvDnksw"
<
Bad Request* Connection #0 to host sandboxapi.rapyd.net left intact


text:
Q: WSO2 Distributed logging I am trying to send our application server logs to BAM. There is a documentation for how could we do it on the wso2 web site.
However I could not understand how could we extend Log4JAppender. Is there any sample to do this?

A: Logging configuration can be found at http://sparkletechthoughts.blogspot.com/ for sending logs from app server to BAM. To view archived Logs from app server, Apache server used only from 4.0.0 to 4.0.3 carbon based products. After 4.0.3, hadoop need to be configured for this purpose.
You can use the already extended Log4jAppender as LogEventAppender which is available in CARBON-HOME/repository/log4j.properties of App server rather writing a new appender to send logs from app server to BAM.
In order to extend Log4jAppender for your own purpose, you can refer How to create a own Appender in log4j?.


text:
Q: PyTorch Dataloader hangs when num_workers > 0 PyTorch Dataloader hangs when num_workers > 0. The code hangs with only about 500 M GPU memory usage.
System info: NVIDIA-SMI 418.56 Driver Version: 418.56  CUDA Version: 10.1.
The same issue appears with pytorch1.5 or pytorch1.6, codes are run in anaconda envs.
Note that this error appears when I run my script in terminal as  python main.py, but when I
debug the same code on Pycharm or VScode, or when I run the same code (in terminal) on
other machines, everything goes fine.
Any idea about the reason for this?
Here is the trace when I ctrl c the code in terminal:
  File "train.py", line 226, in main
    train_domain_adaptation(model, source_loader, target_loader, val_loader,
  File "/home/zhangyu/codes/person_seg/IntraDA/ADVENT/advent/domain_adaptation/train_UDA.py", line 326, in train_domain_adaptation
    train_advent(model, trainloader, targetloader, val_loader, cfg, group=group, fk_loader=fk_loader)
  File "/home/zhangyu/codes/person_seg/IntraDA/ADVENT/advent/domain_adaptation/train_UDA.py", line 114, in train_advent
    _, (images_source, labels, src_names, voc_ids, _) = trainloader_iter.__next__()
  File "/home/zhangyu/anaconda3/envs/pt16/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 363, in __next__
    data = self._next_data()
  File "/home/zhangyu/anaconda3/envs/pt16/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 974, in _next_data
    idx, data = self._get_data()
  File "/home/zhangyu/anaconda3/envs/pt16/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 931, in _get_data
    success, data = self._try_get_data()
  File "/home/zhangyu/anaconda3/envs/pt16/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 779, in _try_get_data
    data = self._data_queue.get(timeout=timeout)
  File "/home/zhangyu/anaconda3/envs/pt16/lib/python3.8/queue.py", line 179, in get
    self.not_empty.wait(remaining)
  File "/home/zhangyu/anaconda3/envs/pt16/lib/python3.8/threading.py", line 306, in wait
    gotit = waiter.acquire(True, timeout)
KeyboardInterrupt
Exception in thread Thread-2:
Traceback (most recent call last):
  File "/home/zhangyu/anaconda3/envs/pt16/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "/home/zhangyu/anaconda3/envs/pt16/lib/python3.8/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/home/zhangyu/anaconda3/envs/pt16/lib/python3.8/site-packages/torch/utils/data/_utils/pin_memory.py", line 25, in _pin_memory_loop
    r = in_queue.get(timeout=MP_STATUS_CHECK_INTERVAL)
  File "/home/zhangyu/anaconda3/envs/pt16/lib/python3.8/multiprocessing/queues.py", line 116, in get
    return _ForkingPickler.loads(res)
  File "/home/zhangyu/anaconda3/envs/pt16/lib/python3.8/site-packages/torch/multiprocessing/reductions.py", line 282, in rebuild_storage_fd
    fd = df.detach()
  File "/home/zhangyu/anaconda3/envs/pt16/lib/python3.8/multiprocessing/resource_sharer.py", line 57, in detach
    with _resource_sharer.get_connection(self._id) as conn:
  File "/home/zhangyu/anaconda3/envs/pt16/lib/python3.8/multiprocessing/resource_sharer.py", line 87, in get_connection
    c = Client(address, authkey=process.current_process().authkey)
  File "/home/zhangyu/anaconda3/envs/pt16/lib/python3.8/multiprocessing/connection.py", line 508, in Client
    answer_challenge(c, authkey)
  File "/home/zhangyu/anaconda3/envs/pt16/lib/python3.8/multiprocessing/connection.py", line 752, in answer_challenge
    message = connection.recv_bytes(256)         # reject large message
  File "/home/zhangyu/anaconda3/envs/pt16/lib/python3.8/multiprocessing/connection.py", line 216, in recv_bytes
    buf = self._recv_bytes(maxlength)
  File "/home/zhangyu/anaconda3/envs/pt16/lib/python3.8/multiprocessing/connection.py", line 414, in _recv_bytes
    buf = self._recv(4)
  File "/home/zhangyu/anaconda3/envs/pt16/lib/python3.8/multiprocessing/connection.py", line 379, in _recv
    chunk = read(handle, remaining)
ConnectionResetError: [Errno 104] Connection reset by peer


text:
Q: Mysql UPDATE with selected data according to multiple tables I wrote a SELECT query to select specific values, basically it only select data that is in all 3 tables.
But when I try to update, it still updates more data (rows) than it should
Here is select
SELECT
    i.id, i.group_id, i.name, u.item, u.value, u.shows, u.nr, u.type
FROM
    items AS i
INNER JOIN
    item_groups, item_properties2 AS u ON item_groups.id = i.group_id
WHERE
    item_groups.idp = '1140503406'
    AND i.id = u.item
    AND u.type = 1140614900
LIMIT
    30, 3000

And here is UPDATE
UPDATE item_properties2 AS P
INNER JOIN items ON items.id = P.item
INNER JOIN item_groups ON item_groups.idp = '1140503406'
SET P.nr = '0'
WHERE
    P.type = 1140614900`

It seems like it ignores my item_groups.idp = '1140503406' and instead updates everything in it, not just this value. I don't know how to make understand that it should only update data if its item_groups.idp = '1140503406' and not all item_groups.idp.
HELP
Sample data
CREATE TABLE IF NOT EXISTS `item_groups` (
  `id` int(11) NOT NULL default '0',
  `idp` int(11) default '0',
  `text_id` int(10) unsigned default NULL,
  `name` text NOT NULL,
  `nr` int(11) default '0',
  `title` text,
  `description` text,
  `keywords` text,
  `seo_title` text,
  `seo_description` text,
  `seo_keywords` text,
  `active` tinyint(1) unsigned NOT NULL default '1',
  `type` tinyint(2) unsigned NOT NULL default '0',
  `ord_alias` varchar(128) NOT NULL default '',
  `another_title` text NOT NULL,
  PRIMARY KEY  (`id`),
  KEY `idp` (`idp`)
) TYPE=MyISAM;

(1339999485, 1306487541, 0, 'Scandomestic||||||||{lv}', 20, NULL, '||||||||{lv}', NULL, 'Šaldytuvai vitrinos, šaldymo vitrinos, šaldytuvas vitrina, šaldymo vitrina||||||||{lv}', 'Šaldytuvai vitrinos, šaldymo vitrinos, Šalna — šaldytuvai pramonei, šaldikliai pramonei, šaldymo skrynios, šaldytuvai vitrinos, šaldymo vitrinos, šaldymo spintos, Minsk, Polair, Snaige||||||||{lv}', 'Šaldytuvai vitrinos, šaldymo vitrinos, Šalna, šaldytuvai pramonei, šaldikliai pramonei, šaldymo skrynios, šaldytuvai vitrinos, šaldymo vitrinos, šaldymo spintos, Minsk, Polair, Snaige||||||||{lv}', 1, 0, '003_003_009_020', '||||||||{lv}'),
(1340000121, 1273586684, 0, 'Šaldymo stalai||Refrigeration tables||??????????? ???????||||{lv}Saldešanas galdi', 6, NULL, '||||||||{lv}', NULL, 'Šaldymo stalai, šaldymo stalai||||||||{lv}', 'Šaldymo stalai, Šalna — šaldytuvai pramonei, šaldikliai pramonei, šaldymo skrynios, šaldytuvai vitrinos, šaldymo vitrinos, šaldymo spintos, Electrolux, Liebherr, Whirlpool, šaldymo iranga, šaldymo kameros, šaldymo vitrinos||||||||{lv}', 'šaldymo iranga, Šaldymo skrynios, Šalna, šaldytuvai pramonei, šaldikliai pramonei, šaldymo skrynios, šaldytuvai vitrinos, šaldymo vitrinos, šaldymo spintos, Electrolux, Liebherr, Whirlpool, šaldymo iranga, šaldymo kameros, šaldymo vitrinos||||||||{lv}', 1, 2, '003_006', '||||||||{lv}'),
(1340114091, 1140503406, 0, 'Panasonic||||||||{lv}', 45, NULL, '||||||||{lv}', NULL, '||||||||{lv}', '||||||||{lv}', '||||||||{lv}', 1, 0, '002_001_045', '||||||||{lv}'),
(1340351314, 1339500892, 0, 'Mawi||Mawi||Mawi||||{lv}Mawi', 209, NULL, '||||||||{lv}', NULL, '||||||||{lv}', '||||||||{lv}', '||||||||{lv}', 1, 2, '003_004_018_209', '||||||||{lv}'),
(1340687392, 1140503406, 0, 'UPO||||||||{lv}', 47, NULL, '||||||||{lv}', NULL, 'Sharp||Sharp||Sharp||||{lv}', 'Sharp šaldytuvas-šaldiklis||Sharp fridges||Sharp||||{lv}', 'Sharp, šaldytuvas, šaldytuvai, šaldikliai, šaldiklis, šaldymo iranga, šaldymo iranga buiciai||Sharp, fridges, freezers||Sharp||||{lv}', 1, 0, '002_001_047', '||||||||{lv}');

DROP TABLE IF EXISTS `item_properties2`;

CREATE TABLE IF NOT EXISTS `item_properties2` (
  `id` int(11) NOT NULL auto_increment,
  `type` int(11) default NULL,
  `item` int(11) default NULL,
  `value` text,
  `shows` int(11) default NULL,
  `nr` int(11) default NULL,
  PRIMARY KEY  (`id`)
) TYPE=MyISAM AUTO_INCREMENT=78180 ;

--
-- Dumping data for table item_properties2
INSERT INTO `item_properties2` (`id`, `type`, `item`, `value`, `shows`, `nr`) VALUES
(44774, 1140614843, 1146145783, '30', 0, 6),
(44775, 1140764279, 1146145783, '+1°C - +65°C', 1, 7),
(44776, 1140614891, 1146145783, 'Deže (išore ir vidus): šviesiai pilka/tamsiai pilka; dangtis: šviesiai pilka.', 1, 8),
(42360, 1140614891, 1242137094, 'Nerudijancio plieno', 1, 8),
(42361, 1140614900, 1242137094, 'Japonija', 1, 9),
(46368, 1140764407, 1209560120, 'Erdve 2l buteliui, šaldytuvas gali buti pastatomas vertikaliai, šaldymo - šildymo funkcijos.', 1, 10),
(44874, 1140614900, 1250520801, 'Vokietija', 1, 9),
(46380, 1146127137, 1277976190, 'Waeco CoolMatic CDF-035', 0, 0),
(46367, 1140614900, 1209560120, 'Vokietija', 1, 9),
(46366, 1140614891, 1209560120, 'Juoda / balta', 1, 8),
(44730, 1140614900, 1146144811, 'Vokietija', 1, 9),
(44728, 1140614891, 1146144811, 'Deže (išore ir vidus): šviesiai pilka, dangtis: tamsiai pilka', 1, 8),
(44727, 1140764279, 1146144811, '+1°C - +65°C', 1, 7),
(44726, 1140614843, 1146144811, '19', 0, 6),
(44725, 1140614826, 1146144811, '33', 0, 5),
(44724, 1140614802, 1146144811, '28', 0, 4),
(44723, 1157531440, 1146144811, '36 W', 0, 3),
(44721, 1140614775, 1146144811, '12/230 voltu DC/AC', 0, 1),
(44669, 1140764407, 1146140235, 'Šviesa viduje, elektroninis valdymas, patogios rankenos nešimui, erdve 2 l buteliui, išimamas metalinis krepšys', 1, 10),
(44668, 1140614900, 1146140235, 'Vokietija', 1, 9),
(44665, 1140764279, 1146140235, '+10 iki -18 (nustatoma elektroniniu termostatu)', 1, 7),
(44666, 1140614891, 1146140235, 'Tamsiai/šviesiai pilka', 1, 8),
(78120, 1140614792, 1352201554, '327', 1, 5),
(25927, 1140614900, 1176359569, 'USA', 0, 7),
(25926, 1141204836, 1176359569, 'yra', 0, 6),
(44664, 1140614843, 1146140235, '58', 0, 6),
(44653, 1140614900, 1146137735, 'Vokietija', 1, 9),
(44651, 1140614891, 1146137735, 'Tamsiai/šviesiai pilka', 1, 8),
(44648, 1140614826, 1146137735, '36', 0, 5),
(44647, 1140614802, 1146137735, '38,5', 0, 4),
(44707, 1146127137, 1207641727, 'Waeco Coolfreeze CF-110 AC', 0, 0),
(44682, 1140764407, 1207639997, 'Šviesa viduje, elektroninis valdymas, nuimamos rankenos nešimui, erdve 2 l buteliui', 1, 10),
(44680, 1140614900, 1207639997, 'Vokietija', 1, 9),
(44679, 1140614891, 1207639997, 'pilka', 1, 8),
(44678, 1140764279, 1207639997, '+10 iki -18', 1, 7),
(44677, 1140614843, 1207639997, '63', 0, 6),
(44676, 1140614826, 1207639997, '36', 0, 5),
(44675, 1140614802, 1207639997, '48', 0, 4),
(44674, 1157531440, 1207639997, 'Vidut. 45W', 0, 3),
(44673, 1140614792, 1207639997, '49', 0, 2),
(22032, 1140764407, 1146135011, 'Patogi rankena, mechaninis valdymas', 1, 10),
(22029, 1140614891, 1146135011, 'Tamsiai/šviesiai pilka', 1, 8),
(22031, 1140614900, 1146135011, 'Vokietija', 1, 9),
(22007, 1140764407, 1146133201, 'DC pajungimo laidas', 1, 10),
(22006, 1140614900, 1146133201, 'Vokietija', 1, 9),
(22028, 1140764279, 1146135011, '+10 iki -18 (nustatoma elektroniniu termostatu)', 1, 7),
(22027, 1140614843, 1146135011, '46.5', 0, 6),
(22026, 1140614826, 1146135011, '30', 0, 5),
(22025, 1140614802, 1146135011, '41.4', 0, 4),
(22004, 1140614891, 1146133201, 'Tamsiai/šviesiai pilka', 1, 8),
(22003, 1140764279, 1146133201, 'nuo +10 iki -18 (nustatoma elektroniniu termostatu)', 1, 7),
(22002, 1140614843, 1146133201, '56', 0, 6),
(22001, 1140614826, 1146133201, '34', 0, 5),
(22000, 1140614802, 1146133201, '47.5', 0, 4),
(21999, 1157531440, 1146133201, 'Vidut. 45W', 0, 3),
(21998, 1140614792, 1146133201, '39', 0, 2),
(46390, 1140764407, 1277976190, 'Šviesa viduje, elektroninis valdymas, patogios rankenos nešimui, erdve 2 l buteliui, išimamas metalinis krepšys', 1, 10),
(21997, 1140614775, 1146133201, '12/24 DC', 0, 1),
(46389, 1140614900, 1277976190, 'Vokietija', 1, 9),
(46388, 1140614891, 1277976190, 'Tamsiai/šviesiai pilka', 1, 8),
(46387, 1140764279, 1277976190, '+10 iki -18 (nustatomas elektroniniu termostatu)', 1, 7),
(42201, 1140764407, 1224489821, '', 1, 8),
(46110, 1140764407, 1140784557, '1 durys, 6 stalciai', 1, 11),
(42066, 1140614900, 1140784557, 'Baltarusija', 1, 9),
(42067, 1140614900, 1140784557, 'Baltarusija', 1, 10),
(46386, 1140614843, 1277976190, '56', 0, 6),
(46385, 1140614826, 1277976190, '34', 0, 5),
(46383, 1157531440, 1277976190, 'Vidut. 45 W', 0, 3),
(42065, 1140614891, 1140784557, 'balta', 1, 8),
(43302, 1140614900, 1140788581, 'Lietuva', 1, 9),
(43471, 1140614900, 1140790207, 'Lietuva', 1, 9),
(43470, 1140614891, 1140790207, 'balta', 1, 8),
(43469, 1140771001, 1140790207, '245', 1, 7),
(43468, 1140784675, 1140790207, '-', 1, 6),
(43467, 1140614792, 1140790207, '245', 1, 5),
(43466, 1140614843, 1140790207, '60', 0, 4),
(43465, 1140614826, 1140790207, '60', 0, 3),
(43464, 1140614802, 1140790207, '145', 0, 2),
(43463, 1140770892, 1140790207, '0.73', 0, 1),
(43462, 1140614720, 1140790207, 'A', 0, 0),
(53894, 1140771001, 1304447043, '-', 1, 7),
(43448, 1140614900, 1140789961, 'Lietuva', 1, 9),
(43447, 1140614891, 1140789961, 'Balta', 1, 8),
(43446, 1140771001, 1140789961, '100', 1, 7),
(43445, 1140784675, 1140789961, '-', 1, 6),
(43444, 1140614792, 1140789961, '100', 1, 5),
(43443, 1140614843, 1140789961, '60', 0, 4),
(43442, 1140614826, 1140789961, '56', 0, 3),
(43441, 1140614802, 1140789961, '85', 0, 2),
(43460, 1140614900, 1140786679, 'Lietuva', 1, 9),
(43459, 1140614891, 1140786679, 'balta', 1, 8),
(43458, 1140771001, 1140786679, '245', 1, 7),
(43457, 1140784675, 1140786679, '-', 1, 6),
(43456, 1140614792, 1140786679, '245', 1, 5),
(43455, 1140614843, 1140786679, '60', 0, 4),
(43454, 1140614826, 1140786679, '60', 0, 3),
(43453, 1140614802, 1140786679, '145', 0, 2),
(43452, 1140770892, 1140786679, '0.73', 0, 1),
(43451, 1140614720, 1140786679, 'A', 0, 0),
(23707, 1140614900, 1140786959, 'Italija ', 1, 10),
(23706, 1140614891, 1140786959, 'balta ', 1, 9),
(23705, 1140771001, 1140786959, '140 ', 1, 8),
(23704, 1140784675, 1140786959, '-', 1, 7),
(23703, 1140614792, 1140786959, '140 ', 1, 6),
(23702, 1140614843, 1140786959, '60 ', 0, 5),
(23701, 1140614826, 1140786959, '60 ', 0, 4),
(23700, 1140614802, 1140786959, '105 ', 0, 3),
(23699, 1140770892, 1140786959, '0.84 ', 0, 2),
(23698, 1140614720, 1140786959, 'B ', 0, 1),
(23696, 1140614909, 1140787174, 'Rusija ', 1, 11),
(23695, 1140614900, 1140787174, 'Italija ', 1, 10),
(23694, 1140614891, 1140787174, 'balta ', 1, 9),
(23693, 1140771001, 1140787174, '275 ', 1, 8),
(23692, 1140784675, 1140787174, '-', 1, 7),
(23691, 1140614792, 1140787174, '275 ', 1, 6),
(23690, 1140614843, 1140787174, '60 ', 0, 5),
(23689, 1140614826, 1140787174, '60 ', 0, 4),
(23688, 1140614802, 1140787174, '167 ', 0, 3),
(23687, 1140770892, 1140787174, '1.1 ', 0, 2),
(23686, 1140614720, 1140787174, 'B ', 0, 1),
(23717, 1140614891, 1140787419, 'balta ', 1, 9),
(23716, 1140771001, 1140787419, '275 ', 1, 8),
(23715, 1140784675, 1140787419, '-', 1, 7),
(23714, 1140614792, 1140787419, '275 ', 1, 6),
(23713, 1140614843, 1140787419, '60 ', 0, 5),
(23712, 1140614826, 1140787419, '60 ', 0, 4),
(23711, 1140614802, 1140787419, '167 ', 0, 3),
(23710, 1140770892, 1140787419, '1.1 ', 0, 2),
(23709, 1140614720, 1140787419, 'B ', 0, 1),
(43785, 1140764407, 1159857676, 'Plasmacluster technologija, greito šaldymo funkcija.', 1, 10),
(43783, 1140614900, 1159857676, 'Japonija', 1, 9),
(43782, 1140614891, 1159857676, 'Sidabro', 1, 8),
(43781, 1140771001, 1159857676, '215', 1, 7),
(43780, 1140784675, 1159857676, '358', 1, 6),
(41632, 1140614900, 1140787900, 'Kinija', 1, 8),
(41631, 1140614891, 1140787900, 'balta||white', 1, 7),
(41630, 1140771001, 1140787900, '-', 1, 6),
(41629, 1140784675, 1140787900, '-', 1, 5),
(41628, 1140614792, 1140787900, '45', 1, 4),
(41627, 1140614826, 1140787900, '44', 0, 3),
(41626, 1140614802, 1140787900, '82', 0, 2),
(41625, 1140770892, 1140787900, '0.8', 0, 1),
(41624, 1140614720, 1140787900, 'A', 0, 0),
(42079, 1140764407, 1140788111, '1 durys, tik šaldytuvas be šaldiklio.', 1, 10),
(42077, 1140614900, 1140788111, 'Baltarusija', 1, 9),
(42076, 1140614891, 1140788111, 'Balta', 1, 8),
(42075, 1140771001, 1140788111, '-', 1, 7),
(42074, 1140784675, 1140788111, '285', 1, 6),
(42073, 1140614792, 1140788111, '285', 1, 5),
(42072, 1140614843, 1140788111, '60', 0, 4),
(42071, 1140614826, 1140788111, '60', 0, 3),
(42070, 1140614802, 1140788111, '150', 0, 2),
(42759, 1140614900, 1140788367, 'Lietuva', 1, 9),
(42758, 1140614891, 1140788367, 'balta', 1, 8),
(42757, 1140771001, 1140788367, '-', 1, 7),
(42756, 1140784675, 1140788367, '127', 1, 6),
(42755, 1140614792, 1140788367, '127', 1, 5),
(42754, 1140614843, 1140788367, '60', 0, 4),
(42753, 1140614826, 1140788367, '56', 0, 3),
(43293, 1140614720, 1140788581, 'A', 0, 0),
(43294, 1140770892, 1140788581, '0.46', 0, 1),
(43301, 1140614891, 1140788581, 'balta', 1, 8),
(43300, 1140771001, 1140788581, '-', 1, 7),
(43299, 1140784675, 1140788581, '275', 1, 6),
(42191, 1140614900, 1140788826, 'Baltarusija', 1, 9),
(42190, 1140614891, 1140788826, 'balta', 1, 8),
(42189, 1140771001, 1140788826, '115', 1, 7),
(42188, 1140784675, 1140788826, '220', 1, 6),
(42187, 1140614792, 1140788826, '335', 1, 5),
(42186, 1140614843, 1140788826, '60', 0, 4),
(42185, 1140614826, 1140788826, '60', 0, 3),
(42184, 1140614802, 1140788826, '176', 0, 2),
(42179, 1140614900, 1140789085, 'Baltarusija', 1, 9),
(42178, 1140614891, 1140789085, 'balta', 1, 8),
(42177, 1140771001, 1140789085, '80', 1, 7),
(42176, 1140784675, 1140789085, '268', 1, 6),
(42175, 1140614792, 1140789085, '348', 1, 5),
(42174, 1140614843, 1140789085, '60', 0, 4),
(43522, 1140614891, 1140789239, 'balta ', 1, 9),
(43521, 1140771001, 1140789239, '- ', 1, 8),
(43520, 1140784675, 1140789239, '245 ', 1, 7),
(43519, 1140614792, 1140789239, '245 ', 1, 6),
(43518, 1140614843, 1140789239, '60 ', 0, 5),
(43517, 1140614826, 1140789239, '60 ', 0, 4),
(43516, 1140614802, 1140789239, '131 ', 0, 3),
(43515, 1140770892, 1140789239, '1,2 ', 0, 2),
(43514, 1140614720, 1140789239, 'B ', 0, 1),
(46661, 1140614826, 1283262225, '', 1, 1),
(41743, 1140784675, 1224573246, '106', 1, 6),
(43500, 1140614900, 1228469272, 'Vokietija', 1, 9),
(28009, 1140614900, 1140790832, 'Italija ', 1, 10),
(28008, 1140614891, 1140790832, 'balta ', 1, 9),
(28007, 1140771001, 1140790832, '40 ', 1, 8),
(28006, 1140784675, 1140790832, '178 ', 1, 7),
(28005, 1140614792, 1140790832, '218 ', 1, 6),
(28004, 1140614843, 1140790832, '57 ', 0, 5),
(28003, 1140614826, 1140790832, '50 ', 0, 4),
(28002, 1140614802, 1140790832, '154 ', 0, 3),
(28001, 1140770892, 1140790832, '0.75 ', 0, 2),
(28000, 1140614720, 1140790832, 'A ', 0, 1),
(40313, 0, 1141202290, '', 0, 6),
(41145, 1140614900, 1221565412, 'Vokietija', 1, 9),
(41280, 1140614900, 1222331102, 'Italija', 1, 9),
(41124, 1140614900, 1140791004, 'Italija', 1, 9),
(41123, 1140614891, 1140791004, 'gelsva', 1, 8),
(41122, 1140771001, 1140791004, '83', 1, 7),
(41121, 1140784675, 1140791004, '218', 1, 6),
(41120, 1140614792, 1140791004, '301', 1, 5),
(41119, 1140614843, 1140791004, '65', 0, 4),
(41118, 1140614826, 1140791004, '60', 0, 3),
(41117, 1140614802, 1140791004, '188', 0, 2),
(28047, 1140614909, 1140791385, 'Italija ', 1, 11),
(28046, 1140614900, 1140791385, 'Italija ', 1, 10),
(28045, 1140614891, 1140791385, 'balta ', 1, 9),
(28044, 1140771001, 1140791385, '35 ', 1, 8),
(28043, 1140784675, 1140791385, '179 ', 1, 7),
(28042, 1140614792, 1140791385, '214 ', 1, 6),
(28041, 1140614843, 1140791385, '58 ', 0, 5),
(28040, 1140614826, 1140791385, '50 ', 0, 4),
(28039, 1140614802, 1140791385, '141 ', 0, 3),
(28038, 1140770892, 1140791385, '0.75 ', 0, 2),
(28037, 1140614720, 1140791385, 'A ', 0, 1),
(28036, 1140764407, 1140791820, '\\"automatinis šaldytuvo atitirpinimas, kamera viršuje\\"', 1, 12),
(28035, 1140614909, 1140791820, 'Italija ', 1, 11),
(28034, 1140614900, 1140791820, 'Italija ', 1, 10),
(28033, 1140614891, 1140791820, 'inox ', 1, 9),
(28032, 1140771001, 1140791820, '49 ', 1, 8),
(28031, 1140784675, 1140791820, '194 ', 1, 7),
(28030, 1140614792, 1140791820, '243 ', 1, 6),
(28029, 1140614843, 1140791820, '58 ', 0, 5),
(28028, 1140614826, 1140791820, '55 ', 0, 4),
(28027, 1140614802, 1140791820, '141 ', 0, 3),
(28026, 1140770892, 1140791820, '1.1 ', 0, 2),
(28025, 1140614720, 1140791820, 'B ', 0, 1),
(28059, 1140614909, 1140791988, 'Italija ', 1, 11),
(28058, 1140614900, 1140791988, 'Italija ', 1, 10),
(28057, 1140614891, 1140791988, 'inox ', 1, 9),
(28056, 1140771001, 1140791988, '55 ', 1, 8),
(28055, 1140784675, 1140791988, '216 ', 1, 7),
(28054, 1140614792, 1140791988, '271 ', 1, 6),
(28053, 1140614843, 1140791988, '58 ', 0, 5),
(28052, 1140614826, 1140791988, '54 ', 0, 4),
(28051, 1140614802, 1140791988, '154 ', 0, 3),
(28050, 1140770892, 1140791988, '0.8 ', 0, 2),
(35415, 1140764407, 1140792326, 'automatinis šaldytuvo atitirpinimas, šaldiklis - \\"no frost\\"', 1, 12),
(35414, 1140614909, 1140792326, 'Turkija ', 1, 11),
(35413, 1140614900, 1140792326, 'Turkija ', 1, 10),
(35412, 1140614891, 1140792326, 'balta ', 1, 9),
(35411, 1140771001, 1140792326, '96 ', 1, 8),
(35410, 1140784675, 1140792326, '162 ', 1, 7),
(35409, 1140614792, 1140792326, '258 ', 1, 6),
(23595, 0, 1140792462, '', 0, 14);

CREATE TABLE IF NOT EXISTS `item_property_groups2` (
  `id` int(11) NOT NULL default '0',
  `name` text,
  `unit` text,
  `nr` tinyint(4) default '0',
  PRIMARY KEY  (`id`)
) TYPE=MyISAM;

--
-- Dumping data for table item_property_groups2
INSERT INTO `item_property_groups2` (`id`, `name`, `unit`, `nr`) VALUES
(1140614720, 'Energijos klasė||Energy Class||Класс электронергии||Energijos klasė||{lv}Enerģijas klase', '||||||||{lv}', 9),
(1140614775, 'El. įtampa||Voltage||Эл. напряжение||El. įtampa||{lv}Elektriskais spriegums', '||||||||{lv}', 11),
(1140614792, 'Bendras tūris, L||Total capacity, L||Общий объем, Л||Bendras tūris||{lv}Kopējais apjoms (litri)', 'litrai||litrai||litrai||litrai||{lv}litri', 4),
(1140614802, 'Aukštis (cm.)||Height||Высота (см)||Aukštis||{lv}Augstums (cm)', 'cm||cm||cm||cm||{lv}cm', 1),
(1140614826, 'Plotis (cm.)||Width (cm.)||Ширина  (см.)||Plotis||{lv}Platums (cm)', 'cm||cm||cm||cm||{lv}cm', 37),
(1140614843, 'Gylis (cm)||Depth (cm)||Глубина (см)||Gylis||{lv}Dziļums (cm)', 'cm||cm||cm||cm||{lv}cm', 16),
(1140614891, 'Spalva||Color||Цвет||Farbe||{lv}Krāsa', '||||||||{lv}', 38),
(1140614900, 'Gamintojas||Producer||Производитель||Gamintojas||{lv}Ražotājs', '||||||||{lv}', 24);

A: Move the predicate items_groups.idp = '1140503406' to the WHERE clause, with a JOIN condition item_groups.idp = items.group_id instead of it, like so:
UPDATE item_properties2 AS P
INNER JOIN items ON items.id = P.item
INNER JOIN item_groups ON item_groups.idp = items.group_id
SET P.nr = '0'
WHERE P.type = 1140614900
  AND items_groups.idp = '1140503406';


text:
Q: How to detect if tray already running or disabling for running more then once I created a TrayIcon via java.
But I have a problem that if you run the runable jar file its creating again the same tray.
Is there a way to disable it to open only one tray?
Or to check if the tray already exist and by that not running the tray?

A: Runing multiple times the jar means starting multiple applications (and JVM) and every Java application has a single SystemTray instance.
From SystemTray javadoc :

Every Java application has a single SystemTray instance that allows
  the app to interface with the system tray of the desktop while the app
  is running. T

So you should use a home strategy to detect if the application is already run or more simply prevent the application to run more than once.
Creating a server socket, bounds to a specific port (with a ServerSocket instance for example) as the application starts is a simple way to do that.
Here is an example with a exception thrown as detected :
public static void main(String[] args) {
    assertNoOtherInstanceRunning();
    ...     // application code then
}

public static void assertNoOtherInstanceRunning() {
    new Thread(() -> {
        try {
            new ServerSocket(9000).accept();
        } catch (IOException e) {
          throw new RuntimeException("the application is probably already started", e);
        }
    }).start();
}


text:
Q: java 8 handling custom exception when using Collectors.toMap Is there any support for handling custom exception inside the Collectors.toMap.
I am calling a method inside the Collector.toMap which throws MyException. Can it be rethrown in the calling function pupulateValues()? For demonstration I used below code to rethrow MyException but couldn't get through. My objective is to handle MyException in main method.
public static void main(String[] args){
    try {
        pupulateValues();
    } catch (MyException e) {
           // do something
        e.printStackTrace();
    }
}

private static void pupulateValues() throws MyException{
    Map<String,String> map = new HashMap<>();
    map.put("asdf", "asdf");
    map.put("ss", "fff");
    map.put("aaaaaa", "aaaaaaa");

    Map<String,String> map2=map.entrySet().stream().collect(
            Collectors.toMap(entry->entry.getKey(),entry-> {
                try {
                    return getCert(entry.getValue());
                } catch (MyException e) {
                    // TODO Auto-generated catch block
                    throw new MyException();
                }}));

}

static String getCert(String val) throws MyException {
    if(val == null) {
        throw new MyException("Some exception");
    }
    return val;
}

A: You have a few options:

*

*make MyException an unchecked exception

*wrap it: catch (MyException e) { throw new RuntimeException(e); }

*trick the compiler:

*

*https://stackoverflow.com/a/19757456/829571

*https://stackoverflow.com/a/31470959/829571

*https://github.com/jOOQ/jOOL#orgjooqlambdaunchecked


text:
Q: Чтение содержимого сайта Есть небольшая задачка. Написать программу для чтения содержимого сайта. И дальнейшей записи этого в файл. Но желательно очистить текст от лишнего мусора.
Вот как я просто читаю всё содержимое:
string data = "Time = 12:00am temperature = 50";
var Client = new System.Net.WebClient();
Client.Credentials = System.Net.CredentialCache.DefaultCredentials;
Client.Proxy.Credentials = System.Net.CredentialCache.DefaultCredentials;
string text = Client.UploadString("", data);
int startIndex = text.IndexOf("<h1");
int length = text.IndexOf("Спасибо за внимание!") - startIndex;
text = text.Substring(startIndex, length);
string[] splitString = new string[] {"
", "
", "", "", "", "", "", "", "
", "
", "
", "
"};
string[] clearText = text.Split(splitString, StringSplitOptions.None);

Прокси, на случай если сайт не даст дёрнуть свои данные без авторизации. Так вот какие параметры для вытаскивания информации. Начиная с открытия тега h1 и заканчивая введённым словом/фразой, которую в консольке введёт пользователь. И всё что я вытащу, мне нужно очистить от специальных символов. То есть оставить только текст. Кто нибудь может подсказать как это можно сделать?

*

*Как считать от открытия тега h1 до введённого слова/фразы.

*Как очистить текст от кода html?
Так же появилась 3 проблема.
Бывает сползает кодировка. Пытаюсь поправить вот так вот:
Client.Encoding = System.Text.Encoding.UTF8;
Не помогает. Подскажите пожалуйста что сделать ещё и с этим.

A: Ваше решение плохо несколькими моментами:

*

*Вы используете прямую работу со строками, а не специализированные парсеры html

*Вы захардкодили список тегов. Их больше, вы постоянно будете их дописывать, они будут постоянно ломаться и вам придётся перекачивать сайт. Код хрупкий.

*Тег типа
 вы вырежете, хорошо. А
 уже нет. А внутри может быть очень много вариантов -- и вы придёте к регуляркам, сложным и плохо отлаживаемым.

Возьмите например, AngleSharp.
Он умеет скачивать сайты:
private static IDocument GetPage(Url url)
{
    var config = Configuration.Default.WithDefaultLoader();
    var document = BrowsingContext.New(config).OpenAsync(url).Result;
    if (document.StatusCode != HttpStatusCode.OK)
        throw new Exception($"Bad document status: {document.StatusCode}");
    return document;
}

Он умеет парсить html, для вашего случая:
    var parser = new HtmlParser();
    var document = parser.Parse(@"

                link1
                link2
                link3

    Hello, world

1

            Head1
            Head2

            31
            content

            32
            content

");

    // Remove scripts
    var scripts = document.QuerySelectorAll("script");
    foreach (var script in scripts)
    {
        script.Remove();
    }

    // Remove menu
    document.QuerySelector("div.top_menu").Remove();

    var text = document.QuerySelector("body").TextContent;
    Console.WriteLine(text);

Вывод:

Поэтому как я вижу решение вашей задачи: распарсить сайт html-парсером и получить TextContext для документа.
PS Да, это подойдёт для любого сайта.
Ставить AngleSharp проще всего через менеджер пакетов: правый клик на солюшене - Manane Nuget packages for solution. Тогда и все неймспейсы подтянутся.


text:
Q: how to fetch chat list in order with newest chat first using sqlite and android
this is the function where i fetch my users according to the latest
  text msg first but the query doesnt seem to work. can any one help me
  out here.

    public HashMap<String, String> show_chat_list (String uid){

            HashMap<String, String> friend_list = new HashMap<String, String>();

here is the query for fetching the name of the users engaged in a
    chat

String selectQuery = "select * from friendlist where _id in (select com_id from chat_list order by _id desc)";

            SQLiteDatabase db = this.getReadableDatabase();
        Cursor cursor = db.rawQuery(selectQuery, null);

        // Move to first row
        boolean st = cursor.moveToFirst();

        if (st == true) {
            if (cursor.moveToFirst()) {
                do {

                    cfrname += cursor.getString(cursor.getColumnIndex("name")) + ":";
                    friend_list.put("frname", cfrname);

                    cfruid += cursor.getString(cursor.getColumnIndex("_id")) + ":";
                    friend_list.put("fruid", cfruid);

                    badger += cursor.getString(cursor.getColumnIndex("badger")) + ":";
                    friend_list.put("badger", badger);

                    cfrthumb += cursor.getString(cursor.getColumnIndex("thumb")) + ":";
                    friend_list.put("frthumb", cfrthumb);

                }
                while (cursor.moveToNext());
            }
        } else {

            friend_list.put("frname", "notdatainsql");
            friend_list.put("fruid", "notdatainsql");
            friend_list.put("frthumb", "notdatainsql");
            friend_list.put("badger", "notdatainsql");
        }

        cursor.close();
        db.close();
        return friend_list;
    }

A: Your SQL query does not provide any order at all:
select * from friendlist where _id in (select com_id from chat_list order by _id desc)

The order here is not defined on your returned resultset, but rather in the sub-query which is only used to create the set of ID's that is later scanned to create the returned result set. The order of your returned result set is basically undefined.
You should be able to solve this using something like this:
select friendlist.*
  from friendlist
  join chatlist on friendlist._id=chatlist.com_id
  group by chatlist.com_id
  order by chatlist._id desc;

--
PS. Not really relevant to the question, but I am very curious on why you choose to represent each item by a HashMap of key-values instead of creating proper objects describing your data structure. Your current code seems really error prone, hard to debug and requires extensive use of string constants.

A: Use Comparator sort messages by date or any other field
Collections.sort(listMsg, new Comparator<MessageInfo>() {
                        public int compare(MessageInfo o1, MessageInfo o2) {
                            if (o1.Datetime == null || o2.Datetime == null)
                                return 0;
                            return o1.Datetime.compareTo(o2.Datetime);
                        }
                    });
In layout xml add following code:
android:stackFromBottom="true"
android:transcriptMode="alwaysScroll"


text:
Q: Why the fading in/out of the saving text is fading only one time when saving? The post is a bit long but the scripts are connected to each other.
When the game start first time it's saving after 3 seconds and fading for 3 seconds.
but in the game later when it's saving again it's showing the save text fading only once.
In this script I'm making the save and also set the time to start the saving and the time it will fade in/out :
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

public class SaveLoad : MonoBehaviour
{
    public FadeInOutSaveGameText fadeInOutSaveGame;
    public float timeToStartSaving;
    public float savingFadeInOutTime;

    private List<GameObject> objectsToSave = new List<GameObject>();

    private void Awake()
    {
        SaveSystem.Init();

        var objectsWithGenerateGuid = GameObject.FindObjectsOfType<GenerateGuid>().ToList();
        if (objectsWithGenerateGuid.Count > 0)
        {
            for (int i = 0; i < objectsWithGenerateGuid.Count; i++)
            {
                objectsToSave.Add(objectsWithGenerateGuid[i].gameObject);
            }
        }

        Debug.Log("Start");

        for (int i = 0; i < objectsToSave.Count; i++)
        {
            Debug.Log($"{i}");
            Debug.Log($"{objectsToSave[i].name}");
        }

        Debug.Log("End Init");
    }

    public void Save()
    {
        SaveGame saveGame = new SaveGame();
        saveGame.saveObjects = new List<SaveObject>();
        for (int i = 0; i < objectsToSave.Count; i++)
        {
            SaveObject saveObject = new SaveObject();
            saveObject.transformSaver = new TransformSaver();
            Debug.Log($"{i}");
            Debug.Log($"{objectsToSave[i].name}");
            saveObject.gameObjectUniqueID = objectsToSave[i].GetComponent<GenerateGuid>().uniqueGuidID;
            var x = objectsToSave[i].GetComponents<Component>();
            var stateQueryComponent = x.Where(component => component is IStateQuery).ToList();
            List<KeyToValue> componentsState = new List<KeyToValue>();
            foreach (var z in stateQueryComponent)
            {
                var w = z as IStateQuery;
                componentsState.Add(new KeyToValue(w.UniqueId.ToString(), w.GetState()));
            }

            saveObject.transformSaver.position = objectsToSave[i].transform.position;
            saveObject.transformSaver.rotation = objectsToSave[i].transform.rotation;
            saveObject.transformSaver.scaling = objectsToSave[i].transform.localScale;

            saveObject.componentsState = componentsState;
            saveGame.saveObjects.Add(saveObject);
        }

        string json = JsonUtility.ToJson(saveGame);
        SaveSystem.Save(json);
    }

    public void Load()
    {
        Dictionary<string, GameObject> uniqueIdToObject = objectsToSave
            .ToDictionary(o => o.GetComponent<GenerateGuid>().uniqueGuidID, o => o);
        var saveString = SaveSystem.Load();
        if (saveString != null)
        {
            SaveGame saveGame = JsonUtility.FromJson<SaveGame>(saveString);
            foreach (var saveObject in saveGame.saveObjects)
            {
                List<KeyToValue> loadedComponents = saveObject.componentsState;
                var objectToSetState = uniqueIdToObject[saveObject.gameObjectUniqueID];

                objectToSetState.transform.position = saveObject.transformSaver.position;
                objectToSetState.transform.rotation = saveObject.transformSaver.rotation;
                objectToSetState.transform.localScale = saveObject.transformSaver.scaling;

                var y = objectToSetState.GetComponents<Component>();
                var z = y.Where(component => component is IStateQuery).ToList();
                Dictionary<string, IStateQuery> zz = z.ToDictionary(sq => (sq as IStateQuery).UniqueId.ToString(), sq => sq as IStateQuery);

                foreach (KeyToValue keyvalue in loadedComponents)
                {
                    zz[keyvalue.Key].SetState(keyvalue.Value);
                }
            }
        }
    }

    public IEnumerator SaveWithTime()
    {
        yield return new WaitForSeconds(timeToStartSaving);

        Save();

        StartCoroutine(fadeInOutSaveGame.OverAllTime(savingFadeInOutTime));
    }
}

At the bottom I created the to save with time :
public IEnumerator SaveWithTime()
        {
            yield return new WaitForSeconds(timeToStartSaving);

            Save();

            StartCoroutine(fadeInOutSaveGame.OverAllTime(savingFadeInOutTime));
        }

The method OverAllTime make the fading depending on the time I set in this case 3 seconds :
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class FadeInOutSaveGameText : MonoBehaviour
{
    public Canvas canvas;
    public float fadingSpeed;

    private bool stopFading = false;
    private const float THRESHOLD = 0.01F;

    // Start is called before the first frame update
    void Start()
    {

    }

    IEnumerator CanvasAlphaChangeOverTime(Canvas canvas, float duration)
    {
        float alphaColor = canvas.GetComponent<CanvasGroup>().alpha;

        while (true)
        {
            alphaColor = (Mathf.Sin(Time.time * duration) + 1.0f) / 2.0f;
            canvas.GetComponent<CanvasGroup>().alpha = alphaColor;

            // only break, if current alpha value is close to 0 or 1
            if (stopFading && Mathf.Abs(alphaColor) <= THRESHOLD)//if (stopFading && (Mathf.Abs(alphaColor) <= THRESHOLD || Mathf.Abs(alphaColor - 1) <= THRESHOLD))
            {
                break;
            }

            yield return null;
        }
    }

    public IEnumerator OverAllTime(float time)
    {
        StartCoroutine(CanvasAlphaChangeOverTime(canvas, fadingSpeed));

        yield return new WaitForSeconds(time);

        stopFading = true;
    }
}

And in this script at the bottom I'm starting the save :
private void Update()
    {
        if(dimLights.lightsDimmed == true && lightsDim == false && unlockCarte.HasOpened() == true
             && MenuController.LoadSceneForSavedGame == false)
        {
            m_state.naviLightsIntensity = dimLights.lightsToDim[0].intensity;
            lightsDim = true;
            var brainBlendTime = Camera.main.GetComponent<CinemachineBrain>();
            saveLoad.timeToStartSaving = brainBlendTime.m_DefaultBlend.m_Time;
            StartCoroutine(saveLoad.SaveWithTime());
        }
    }

I'm setting the timeToStartSaving to the time it takes to blend from one cinemachine camera to another camera in this case 5 seconds.
I used break points and it's getting to the SaveWithTime method when the value of timeToStartSaving is 5 and the value of savingFadeInOutTime stay 3 as before. Only the timeToStartSaving variable vlaue was 3 and changed to 5.
but ion the game the fading happens only once one time instead 3 times.
in the start of the game first time saving it does fading 3 times for 3 seconds. but on the second saving for some reason it's fading only one time even if the value of savingFadeInOutTime is 3.

A: You have to reset stopFading, otherwise your loop will always break after the first time reaching the zero threshold.
public IEnumerator OverAllTime(float time)
{
    stopFading = false; // reset this, otherwise it stays true, after the first run
    StartCoroutine(CanvasAlphaChangeOverTime(canvas, fadingSpeed));

    yield return new WaitForSeconds(time);

    stopFading = true;
}


text:
Q: Polynomial Functions (Thinking #1; High school math) Question: Consider the polynomial function: $2x^3 - mx^2 + x -5m$. The remainder when $P(x)$ is divided by $(x - 2)$ is four times the remainder from dividing $P(x)$ by $(x + 1)$. Determine $m$ algebraically and show all your work.
I tried to do this on my own and I managed to find the remainder and the quotient using the function $2x^3 - mx^2 + x -5m$ with the dividend, $(x - 2)$ and $(x + 1)$. (I got two remainders and the two quotients) but now I don't know what to do next and how to solve for $m$.
I would really appreciate if anyone can help me solve this question! Thanks.

A: The polynomial remainder theorem states that the remainder of the division of a polynomial $f(x)$ by the linear polynomial $x-r$ is equal to $f(r)$.
So in your case, the remainder when $P(x)$ is divided by $(x-2)$ is $P(2)$, and the remainder when $P(x)$ is divided by $(x+1)$ is $P(-1)$ (as $x+1=x-(-1)$).

It is given that the remainder after division by $(x-2)$ is four times the remainder after division by $(x+1)$. So, using the above, $P(2)$ is four times $P(-1)$, or
$$P(2)=4P(-1)$$
which means that you need to solve
$$2(2)^3-m(2)^2+2-5m=4[2(-1)^3-m(-1)^2+(-1)-5m]$$
to find $m$.


text:
Q: Is there a trace mode for Jenkins pipeline? I'd like to know (don't find that within the official documentation... but  ...) if there is some sort of trace mode for jenkinsfiles scripts ?
More specifically, my current concern is to trace the sshCommand step, to understand why something that runs "manually" fails within a pipeline.


text:
Q: Hyperthreading on multicore processors - is it of any use? I know hyperthreading from the time long ago where the processors used to have only a single core. The technology was really usefull then. Right now, Intel is still offering hyperthreading with 6-core processors (so they can be run in 12 threads). I'm wondering what is the use of this technology for multicore processors? Has anyone done some tests?
I'm thinking of gaming/office applications

A: Well, basically it has the same use as on single processor machines: It adds additional hardware threads unless there is ressource contention. That simple. Same argumentation there and as with single processor the use totally depends on the application.
Office applications dont even need 6 cores, the the question is moot. Same for games - most dont even support multiple threads so ecores or hyperthreading makes no difference to them at all.

A: HT on a multicore CPU is not as good as it was on a single core CPU. But multicore (without HT) is better than HT. And a dual core is not as good as two single cores.
So all in all - it depends - propably mostly wether the application core fits into the CPU-cache so that HT can switch fast enough to make sense.
There are surely some benchmarks around for this.
My feeling is therefore that HT on multi cores makes sense on applications that need many cores for the same purpose. AND my feeling is that HT will not makes things slower (its effect may be zero in the worst case, but not below zero - i.e. slow down processes).


text:
Q: How can I tell Android Studio NOT to look in the jniLibs folder for a specific library? I'm new to android studio and am working on an existing project that is using OpenCV. I need to implement CMU's Pocketsphinx for Android, and in following the installation steps they give I have created a jniLibs folder in my /src directory of my project, and placed the appropriate files for pocketsphinx in there.
This is where the problem occurs- when I do this, I suddenly get the following error message:
java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.robodoot.dr.facetracktest-2/base.apk"],nativeLibraryDirectories=[/data/app/com.robodoot.dr.facetracktest-2/lib/arm, /data/app/com.robodoot.dr.facetracktest-2/base.apk!/lib/armeabi-v7a, /vendor/lib, /system/lib]]] couldn't find "libjniopencv_core.so"

I do NOT get this error if I don't have the jniLibs folder in the /src directory, though then of course I get an error from pocketSphinx saying that it can't find it's required .so files.
What's more, after looking through OpenCV's SDK, I noticed there is no such file "libjniopencv_core.so". It doesn't exist anywhere, there are other .so files but none of which with that name. Even if I install all of the armeabi and what not directories from openCV to my new jniLibs folder, I still get this error message.
How can I tell android studio to only load the pocketsphinx jniLibs files, and disregard searching that directory for openCV .so files?

A: you can do this by adding following code in gradle
android {
    ...
    defaultConfig {
        ...
        ndk {
            abiFilters "armeabi-v7a", "x86","armeabi"
        }

        packagingOptions {
            exclude "lib/arm64-v8a/mysofile.so"
        }
    }
}

replace arm64-v8a/mysofile.so with whatever you want to exclude.

A:
How can I tell android studio to only load the pocketsphinx jniLibs files, and disregard searching that directory for openCV .so files?

You should not disregard an important file. libjniopencv_core.so is required by opencv.

What's more, after looking through OpenCV's SDK, I noticed there is no such file "libjniopencv_core.so".

It must be inside opencv-android-arm.jar together with other important so files.
It's not clear why file conflicts, it should be some issue with gradle. You need to check internals of APK what so files are actually packed inside. Most likely you try to pack different architectures like armeabi and armeabi-v7. You might need to pack .so files from the same architecture.


text:
Q: Inbox messages store in database or via Real Email System? For a user control panel that features a private message inbox, is it better to serve the private messages via a "real" email server or just store the messages in the database?

A: I would think this design decision depends heavily on how much connectivity you expect the user to have, how complicated / performant the proposed email server is to work with, and what your security requirements are for this project.
Relying on a real email server would probably be the simplest route if you can assume/require that the user will always be network connected.  Talking to email servers, particularly with login credentials, can be a pain so find a good library to take care of the nitty gritty for you. Sorry, don't have any recommendations on libs.
Copying the emails into a local database will raise a lot of security flags - how do you keep that data private and ensure that it cannot be exploited by malicious software on the same machine?  How do you keep multiple users sharing the same machine from seeing each other's emails? (use separate db's kept in user local storage).  Etc.
However, copying to a local database could give you offline capabilities.  If this would be a key feature, great, it's probably worth the headaches, but if offline ops are not key to your control don't toss it in on a whim.


text:
Q: how to use ng-click on a li to hide its ul parent I have a list refreshing with results in my li elements :

        {{suggestion}}

I would like to hide my list (ul) when a li is clicked but i can't make it work... is this a bad way to do that ?

A: ng-repeat creates a scope for each iteration, so your visible variable from the ul element is not necessarily the same one as in each li element. Calling the parent scope's variable from the li elements should fix it:

 <--this is the key
        {{suggestion}}

What you wrote originally would allow you to hide each li element separately.
See the difference here: http://jsfiddle.net/oxda3aes/