React/GraphQL: Can only create NonNull of a Nullable GraphQLType but got 'type'

Question: I am working on my first GraphQL schema. I've never done this before, and I am confused by the errors that I get. For instance:
  /Users/lorm/projects/aggregated_centralized_api/node_modules/graphql/jsutils/invariant.js:20
      throw new Error(message);
      ^

  Error: Can only create NonNull of a Nullable GraphQLType but got: function GraphQLList(type) {
      _classCallCheck(this, GraphQLList);

      (0, _jsutilsInvariant2['default'])(isType(type), 'Can only create List of a GraphQLType but got: ' + type + '.');
      this.ofType = type;
    }.
      at invariant (/Users/lorm/projects/aggregated_centralized_api/node_modules/graphql/jsutils/invariant.js:20:11)
      at new GraphQLNonNull (/Users/lorm/projects/aggregated_centralized_api/node_modules/graphql/type/definition.js:761:39)
      at Object.<anonymous> (/Users/lorm/projects/aggregated_centralized_api/server/schema.js:121:19)
      at Module._compile (module.js:413:34)
      at normalLoader (/Users/lorm/projects/aggregated_centralized_api/node_modules/babel-core/lib/api/register/node.js:199:5)
      at Object.require.extensions.(anonymous function) [as .js] (/Users/lorm/projects/aggregated_centralized_api/node_modules/babel-core/lib/api/register/node.js:216:7)
      at Module.load (module.js:357:32)
      at Function.Module._load (module.js:314:12)
      at Module.require (module.js:367:17)
      at require (internal/module.js:16:19)

My schemaTypes.js file looks like this:
  export const BookType = new GraphQLObjectType({
      name: 'Book',
      description: 'A Book',
      fields: () => ({
    book_id: {
        type: GraphQLString,
        description: 'UUID for book',
    },
    title: {
        type: GraphQLString,
        description: 'The name of the book',
    },
    author: {
        type: GraphQLList,
        description: 'List of authors, each author an object',
    },
    isbn: {
        type: GraphQLString,
        description: 'The primary way of identifying the book both domestically and internationally',
    },
    agency_price: {
        type: GraphQLFloat,
        description: 'The price set by the agency',
    },
    pub_date: {
        type: GraphQLString,
        description: 'The publication date of the book',
    },
    amazon_rank: {
        type: GraphQLInt,
        description: "The book's current selling rank on Amazon, updated daily",
    },
    reviews: {
        type: GraphQLFloat,
        description: "The book's current average review rating on Amazon, can 1 to 5, accurate to 1 decimal, updated daily",
    },
    book_img: {
        type: GraphQLString,
        description: 'Absolute URL for the image used for the book cover',
    },
    asin: {
        type: GraphQLString,
        description: "Amazon Standard Identification Numbers (ASINs) are unique blocks of 10 letters and/or numbers that identify items",
    },
    publisher: {
        type: GraphQLString,
        description: "The publisher name. There is only one publisher per book.",
    },
    bisacs: {
        type: GraphQLList,
        description: 'A list of Book Industry Standards and Communications subject headings as strings',
    },
    series_name: {
        type: GraphQLString,
        description: "If the book belongs to a series, the name of the series",
    },
    volume: {
        type: GraphQLString,
        description: "If the book is part of a series, this is its location in the sequence",
    },
    formats: {
        type: GraphQLList,
        description: 'Open Road has 20 standard formats',
    },
    keywords: {
        type: GraphQLList,
        description: 'Open Road puts mulitiple keywords (separated by a semi-colon) into the keyword1 field in Firebrand',
    },
    description: {
        type: GraphQLString,
        description: "Open Road's summary of the book",
    },
    campaigns: {
        type: GraphQLList,
        description: "A list full of marketing Campaigns we've done for the author",
    },
    retailers: {
        type: GraphQLList,
        description: 'A list full of Retailers, holding data specific to this book',
    },
    nominations: {
        type: GraphQLList,
        description: 'A list full of nominations to which this book belongs',
    },
    created: {
        type: GraphQLInt,
        description: 'The creation timestamp of this book'
    }
      })
  });

And by schema.js looks, in part, like this:
  let schema = new GraphQLSchema({
    query: new GraphQLObjectType({
      name: 'RootQueryType',
      fields: {
        book: {
          type: new GraphQLList(BookType),
          resolve: () => ""
        },
        book_retailer_summary: {
          type: BookRetailerSummaryType,
          args: {
            name: {
              description: 'Summary of books sales information, via various retailers',
              type: new GraphQLNonNull(GraphQLString)
            }
          },
          resolve: (root, {name}) => {
            return mongo()
              .then(db => {
                let deferred = Q.defer();

                let collection = db.collection('users');
                collection.find({ name })
                  .toArray((err, docs) => {
                    if (err) {
                      deferred.reject(err);
                      return;
                    }

                    db.close();
                    deferred.resolve(docs.length ? docs[0] : null);
                  });

                return deferred.promise;
              });

          }
        }
      }
    }),

So I am curious what mistake I am making?
[[ UPDATE ]]
Responding to helfer's remarks I have to wonder about this use of GraphQLList:
  nomination: {
    type: NominationType,
    args: {
      name: {
        description: 'The name of the list of books',
        type: new GraphQLNonNull(GraphQLString)
      },
      books: {
        description: 'The name of the books belonging to this nomination',
        type: new GraphQLNonNull(GraphQLList)
      }
    },

Perhaps this line is not allowed?
        type: new GraphQLNonNull(GraphQLList)

Is there some way I can get better error messages, so I can narrow in on what the real problem is?
Answer: GraphQLList and GraphQLNonNull are wrapping types, that means they always have to be created as follows:
const someListType = new GraphQLList(anotherType);
const someNonNullType = new GraphQLNonNull(anotherType);

Your book type has many fields that have the type GraphQLListType without actually creating an instance (i.e. without calling new and passing the type to wrap). The error message indicates that you're trying to wrap a GraphQLListType in NonNull somewhere, but it doesn't work because you didn't create the list type properly.
By the way, the schemas can get quite long and hard to read in Javascript, which is why I've created a package that lets you write them in schema language so it's much easier to read:
type Book {
  book_id: String
  title: String
  author: [Author]
  # etc.
}

You can find the documentation here: http://docs.apollostack.com/apollo-server/generate-schema.html
Comment: helfer, thank you. I am currently feeling overwhelmed trying to learn the Javascript version, yet I feel I should understand it before I learn yet another language. But I admire the effort you've made to simplify things.
Comment: I've added a follow up quesiton about this line:
            type: new GraphQLNonNull(GraphQLList)
Comment: I copy and pasted that from here: https://github.com/davidchang/graphql-pokedex-api/blob/master/server/schema.js#L29
Comment: I tried to change this to:             "type: new GraphQLList(BookType)" but got "Book.author field type must be Output Type but got: function GraphQLList(type) {
    _classCallCheck(this, GraphQLList);" Does this mean I need to full specify every field in the book? Do I have to pass in an already initialized book, with all of its fields filled out?
Comment: @lorm Yes, the line you posted is indeed invalid. The Book type doesn't have to be initialized yet, if you pass a so-called "thunk" to create fields for types that have circular references, which you've already done for Book. I don't know of any ways to get better error messages for this kind of thing.


Make a python script that opens another python script

Question: I am very disappointed that after looking for several hours, I have still not found an answer to: - Make a python script that opens another python script ?
Mabye I don't know how to search for stuff, but I am usually good at finding solutions online.
Any help would be gladly appreciated!
Here's my code:
import subprocess
subprocess.Popen(['C:\Users\user\Documents\run.py'])

Here is the python file called "run.py"
print('Hello World!')

Thanks!
Comment: if you have access to that python script, why don't you just import the content from it?
Comment: Do you want just to open `run.py` as a text file? Or, do you want to execute `run.py`?
Comment: What about this? [https://stackoverflow.com/questions/1186789/what-is-the-best-way-to-call-a-script-from-another-script](https://stackoverflow.com/questions/1186789/what-is-the-best-way-to-call-a-script-from-another-script)
Comment: I want a script to run several scripts in subfolders automatically so I don't have to do it myself :)
Answer: You can use the call library, it's pretty easy:
from subprocess import call

call(["python", "your_file.py"])

Answer: This is how I will go about it. Suppose you have two files: Main.py and run.py
and will want Main.py to open and run this file run.py:

this is the content of Main.py : it calls run.py through import (run.py file needs to be in the same folder)

import run

this is your run.py

print('Hello World!')
Then you can run Main.py by calling python Main.py
the output will be : Hello World!
Let me know if it works.
Answer: Try this:
your_cmd = "python3 path/to/file/run.py"
p = subprocess.Popen("exec " + your_cmd, stdout=subprocess.PIPE, shell=True)

Answer: i find this to work and it looks clearer:
import subprocess
import pathlib

path_to_file=pathlib.Path(__file__).parent.resolve()
script_path=f'{path_to_file}/your_script.py'

subprocess.run(['python',script_path])


How can I return an array of bids made by the current user

Question: I have a collection of adverts, inside that there is a array of objects of bids made by other users to that specific advert.
The thing I want to return is only the bids made by the current user so it has to match with req.user.id (where i hold the jwt token)
So I tried filter method but it returned an empty array, then tried with for in loop, got another empty set of square brackets...

Here is my 'adverts' collection;
For example, from the collection below, i want to get an array of objects only contains bids  made by this user (user : 5f7c40a0ec1a374c6c924610).
[
{
    "_id": "5f7d924371469c21f866fa16",
    "user": "5f7c40a0ec1a374c6c924610",
    "title": "Logistics for carrying chemicals",
    "text": "We need a approximately 20 trucks of logistics line for carrying our chemicals",
    "status": false,
    "company": "Bayrak Company",
    "location": "San Francisco",
    "date": "2020-10-07T10:02:43.811Z",
    "bids": [
        {
            "_id": "5f7dc3225a835c359432ab15",
            "user": "5f7c40a0ec1a374c6c924610",
            "bid": "50000",
            "company": "Bayrak Company",
            "avatar": "https://gravatar.com/avatar/4ecfd3d216693adc6867bf09c9087b1a?d=mm&r=pg&s=200",
            "date": "2020-10-07T13:31:14.890Z"
        },
        {
            "_id": "5f7db5fea762d34054072f8c",
            "user": "5f7c40a0ec1a374c6c924610",
            "bid": "50000",
            "company": "Bayrak Company",
            "avatar": "https://gravatar.com/avatar/4ecfd3d216693adc6867bf09c9087b1a?d=mm&r=pg&s=200",
            "date": "2020-10-07T12:35:10.237Z"
        }
    ],
    "comments": [],
    "__v": 2
},
{
    "_id": "5f7db0153870fd4178390a4d",
    "user": "5f7c40a0ec1a374c6c924610",
    "title": "Need construction trucks for new buildings",
    "text": "The new constrution area needs approximately 15 trucks",
    "status": false,
    "company": "Bayrak Company",
    "location": "San Francisco",
    "date": "2020-10-07T12:09:57.362Z",
    "bids": [],
    "comments": [],
    "__v": 0
}
]

**And here is what I tried so far; **

// @route   GET /api/adverts/mybids
// @desc    Get bids that I made
// @access  Private.
router.get('/mybids', auth, async (req, res) => {
 try {
let adverts = await Advert.find();

let mybids = [];
let bidsByMe = [];
for (let x in adverts) {
  let bid = adverts[x].bids;

  for (let y in bid) {
    let innerBid = bid[y];
    mybids.push(innerBid);
  }
}

for (let x in mybids) {
  let bid = mybids[x];

  if (bid.user == req.user.id) {
    bidsByMe.push(bid);
  }
}

res.json(bidsByMe);
} catch (err) {
console.error(err.message);
res.status(500).send('Server Error...');
}
});

Comment: Ok, but if `bid.user` is populated and therefore contains the user object, then stringifing it will not give you an id string you can compare to `req.user.id`. You'd have to do `if (bis.user._id == req.user.id)` instead.
Comment: Use for instance `adverts.filter(ad => ad.bids.some(bid => bid.user == "..."))` to get all ads containing a bid by the user. The main problem with your current code is that you keep changing and pushing a single object into the array; you need to create a new bid object, populate and push it each time you find one.
Comment: I realized there is a logic missing... so here is a quick update
Comment: Don't put code in comments. [Edit](https://stackoverflow.com/posts/64245817/edit) the question instead.
Comment: just fixed that also. Now the thing is in my Advert schema typeof user is an ObjectId, on the other hand req.user.id is a string so i converted it into a string but it still goes to else condition
Comment: Why would you use `JSON.stringify()` there? `bid.user` is a string, not an object. Anyway, the first order of debugging is to `console.log()` *everything*.
Comment: I checked my Advert schema, inside 'bids' array, field of 'user' is an ObjectId, therefore I converted it. At the beginning of the question the reason was one of them was object, other one was a string
Comment: An object id is something like `"5f7c40a0ec1a374c6c924610"`, i.e. a string.
Comment: but `console.log(typeof bid.user)` returns object in the console other hand `console.log(typeof req.user.id)` returns string
Comment: The thing is that all this is basically moot, because like Kuldeep says, the database should support a query that already returns exactly what you want.
Comment: Just like you said a basic `==` solved the issue... Also yes the database supports that. Thank you for your answers. Sometimes the solution is just in front of our nose but we dont notice it... I will update the code. Code updated
Answer: You can run this query :
  db.collection.aggregate([
 {
   $match: {
  user: "5f7c40a0ec1a374c6c924610",
  "bids.user": "5f7c40a0ec1a374c6c924610"
 }
},
{
$group: {
  _id: "$_id",
  user: {$first: "$user"},
  title: {$first: "$title"},
  text: {$first: "$text"},
  status: {$first: "$status"},
  location: {$first: "$location"},
  bids:{$first:"$bids"}

  }
}
 ])

//check below URL

https://mongoplayground.net/p/TBGPDXO5lIl

Comment: That also returned fields like "comments" , "company" ... how do I ignore rest ?
Comment: updated the query please check and you can check result below given URL


Can you suggest free javascript plugin for IntelliJ IDEA?

Question: Downloaded IntelliJ IDEA Community Edition, realized that it has no JavaScript Support and Debugger.
Any suggestions for good free plugin?
Comment: My financial status is not subject of this question, I just looking for free solution.
Comment: @Matt Ball -- well, there are many IDEs that bundle a JavaScript engine to try to provide an integrated debugging environment -- I'm not saying I like or endorse any of them, but "not gonna happen" isn't really accurate. For example, the IntelliJ folks (JetBrains) make a web-specific IDE, WebStorm, that includes Mozilla's JS engine: http://www.jetbrains.com/webstorm/features/index.html#JavaScript_Debugger_Based_on_Mozilla (But yeah, ultimately, I agree the *best* way is debugging in the tools bundled with the browser whenever possible)
Comment: Yeah, you right. Best way to test js is in browser. But I need normal support from IDE, I tried but it can't see even the functions that is available, just highlighting the code.
Comment: Are you looking to debug JavaScript in the IDE? Not gonna happen. JS runs in the browser, so you need to use an in-browser debugger like [Firebug](http://getfirebug.com), or the built-in dev tools that come with Safari, Chrome, and IE8+.
Comment: I just saw comparison matrix between Ultimate and Community Edition here link http://www.jetbrains.com/idea/features/editions_comparison_matrix.html, it says something about JavaScript Debugger.
Comment: Thanks! I forget about WebStorm, but it has only 30 days of demo version and no some community version. It is too expensive for me.
Looking for long-term solutions.
Comment: The best approach I've found is installing [ESLint Daemon Version](https://www.npmjs.com/package/eslint_d) and running it with `--cache` option from the IntelliJ Terminal for nearly instant linting results. Not great, but workable for at least catching most errors.
Comment: ten years, this questions is still active
Comment: If you are willing to use other IDE's then I think VS Code has good support OOTB.
Answer: Just in case, I found Netbeans more productive than Eclipse/IntelliJ (CE) at least for web/UI/jQuery. Its amazing inline compilation of JavaScript helped much in shooting the bug at development time rather than testing in browser and not to forget amazing intellisense for jQuery functions.
Answer: For what it's worth, SonarLint seems to be decent for the new IntelliJ Community Edition (with Java8)
Comment: Though as of Feb 2021 the current version doesn't seem fully updated to handle React (Hooks). I am seeing "Remove Unused Declaration" linting because it doesn't understand how a variable is being referenced in JSX.
Answer: It's not a plugin, but you could try the WebStorm IDE from the same guys.
There's a free trial version (30 days, I think), but it's only €29 at the moment for a personal license (as of May 2011, I don't know the dollar price the website detects where you are and only gives prices for your country of residence).
Comment: You could also try Cloud9 IDE. I haven't tried it yet so I can't comment on the quality. It's a cloud based Java Script IDE backed by GitHub as far as I can see, so as long as you're happy to open source your code it's free. You can also get paid subscriptions for private code.
Answer: IntelliJ 11 does support JS debugging with Chrome (maybe Firefox too), but only the ultimate edition.
But it's not just the debugging. It offers code completion (for libraries too), reformatting the code according to the specified coding style, etc.
Answer: WebCalm is a free and open-source IntelliJ plugin that provides JavaScript and CSS support (disclaimer: I'm the developer).


Decorator Pattern - Access a wrapped ConcreteComponent Value

Question: I currently working on an example using the Decorator Pattern.
My current code looks like this:
abstract class LibraryItem

    {
        private int _numCopies;

        // Property

        public int NumCopies
        {
            get { return _numCopies; }
            set { _numCopies = value; }
        }

        public abstract void Display();
    }

    ///

    /// The 'ConcreteComponent' class

    ///

    class Book : LibraryItem

    {
        private string _author;
        private string _title;

        // Constructor

        public Book(string author, string title, int numCopies)
        {
            this._author = author;
            this._title = title;
            this.NumCopies = numCopies;
        }

        public override void Display()
        {
            Console.WriteLine("\nBook ------ ");
            Console.WriteLine(" Author: {0}", _author);
            Console.WriteLine(" Title: {0}", _title);
            Console.WriteLine(" # Copies: {0}", NumCopies);
        }
    }

    ///

    /// The 'ConcreteComponent' class

    ///

    class Video : LibraryItem

    {
        private string _director;
        private string _title;
        private int _playTime;

        // Constructor

        public Video(string director, string title,
          int numCopies, int playTime)
        {
            this._director = director;
            this._title = title;
            this.NumCopies = numCopies;
            this._playTime = playTime;
        }

        public override void Display()
        {
            Console.WriteLine("3");

            Console.WriteLine("\nVideo ----- ");
            Console.WriteLine(" Director: {0}", _director);
            Console.WriteLine(" Title: {0}", _title);
            Console.WriteLine(" # Copies: {0}", NumCopies);
            Console.WriteLine(" Playtime: {0}\n", _playTime);
        }
    }

    ///

    /// The 'Decorator' abstract class

    ///

    abstract class Decorator : LibraryItem

    {
        protected LibraryItem libraryItem;

        // Constructor

        public Decorator(LibraryItem libraryItem)
        {
            this.libraryItem = libraryItem;
        }

        public override void Display()
        {
            Console.WriteLine("2");
            libraryItem.Display();
        }
    }

    ///

    /// The 'ConcreteDecorator' class

    ///

    class Borrowable : Decorator

    {
        protected List<string> borrowers = new List<string>();

        // Constructor

        public Borrowable(LibraryItem libraryItem)
          : base(libraryItem)
        {
        }

        public void BorrowItem(string name)
        {
            borrowers.Add(name);
            libraryItem.NumCopies--;
        }

        public void ReturnItem(string name)
        {
            borrowers.Remove(name);
            libraryItem.NumCopies++;
        }

        public override void Display()
        {
            Console.WriteLine("1");
            // base.Display();
            this.libraryItem.Display();

            foreach (string borrower in borrowers)
            {
                Console.WriteLine(" borrower: " + borrower);
            }
        }
    }

Now I create a Borrowable-Decorated Video with the following code:
Video video = new Video("Spielberg", "Jaws", 23, 92);
Borrowable borrowvideo = new Borrowable(video);

What I want to do now, is to access the NumCopies - Property of the borrowvideo-object. The expected value is 23, as I specified that value in the video-constructor, but i get the value 0.
Can someone help me how to get the programm to return 23?
Thanks in advance!
Answer: Make NumCopies virtual and override the behaviour in your decorator base class.
Side note about decorator pattern:
In a decorator pattern the abstract class LibraryItem should have been an interface. That the decorator is required to implement.
Comment: @YashGupta technically you are right, but the idea behind the interface is that the decorator has to change all virtual members. An abstract class leaves an opening for error while an interface not.
Comment: About that side note, it's not compulsory to have the base as an interface. It could be an Interface and/or Abstract Class depending on your requirement.
Comment: That's correct @verbedr - An abstract class should only be used if there's some commonality (state/behaviour) among all the descendants (that can eventually be moved to some base entity), otherwise an Interface should be the preferred way to go.


Simple rail & hooks solution to attach a bin to the inside of a cupboard

Question: I want to attach our bin (trash can, for the US readers), which is basically a plastic rectangle, to the inside of the door of one of the cupboards in our kitchen.  The bin will need to be removed for cleaning, so I can't attach it directly - it needs to hang on something.
So, I'll permanently attach some hooks to the side of the bin, and permanently attach something for these hooks to hook onto, on the inside of the cupboard door, such as a rail or some brackets or something similar (or perhaps vice versa).
I'd like the hooks to be thin, so as to not have (or minimise) the gap between the door and the bin, but still strong so that they don't bend over time, so probably steel.
I'd have thought that these hooks and brackets would be easy to source but I'm having trouble finding them on DIY stores' websites, which are returning coathooks and the like.
Is there a name for what i'm looking for, which would help me find it?
Answer: Almost all plastic trash bins have a turned over lip around the top. Why not make a French cleat slightly narrower than the width of the bin and hang the bin by its lip on the cleat?

A French cleat is a long narrow board whose front edge is higher than its back edge. A mating board with the reverse configuration is then hung on it. In this case, the bin lip is the mating piece.
You could use a small rotating clip, such as a plastic mirror clip, to keep the bin from bouncing off the cleat. Just don't tighten the retaining screw too much.
Comment: Thanks a lot @bib.   Nice diagram too, cheers :)  I think it does have a lip but i don't know if it's big enough to hang the bin off - i'll investigate tonight.
Comment: @MaxWilliams : if it doesn't, and you have some heavy wire (14 ga or better) or strapping, you might be able to make something to go under the bin's edge to spread the weight better.  You could also bend it on one side to add protrusions that you could use to attach it to other types of hooks.
Answer: I'd consider typical closet shelf brackets. They'll be easy to find and rigid enough for your needs. You can install them reversed (vertically) if needed to arrive at less depth.

Be aware that your cabinet door will need to be substantially wider than the bin to clear the arc when opening and closing.
Comment: What about inverting them and attaching to a board a bit wider than the bin. Then the angle braces serve as lateral limiters.
Comment: Sure, but then you have a board getting dirty and wet. It's a trash can. :)
Comment: Thanks a lot @isherwood, but i'm not sure what you intend for the shelf brackets - how would the bin attach to them?  Are you intending that the bin sits on them?  cheers
Comment: Yes, I pictured the bin simply hanging between.


Building custom CookiesResource for http-rest-communication in Tosca

Question: I am trying to access a rest-api from Tosca. For now I am using the "Communicate: Rest over HTTP"-module as described in the manual and in the webinar.
The communication has the following sequence:

At the beginning, the client logs in to the server and receives a session-string in the data part of the packet.
The server then expects this session-string as a cookie in each request.

My problem now is to put this new cookie (for example "session=somerandomdata") into the CookieResource.
Unfortunately the manual only applies to already existing CookieRecources.
My question is now whether it is possible to build a CookieRecource with this new cookie.
Answer: Whenever a Set-Cookie-Header is returned from the server, a new cookie resource is created.
Please check the manual here: https://support.tricentis.com/community/manuals_detail.do?lang=en&version=10.0.0&url=tbox/wse_tc_session_cookies.htm --> a new cookie resource is created with the name "myCookieResource". This cookie resource can later on be used in the "send" part.
Does this answer your question?
Comment: Unfortunately not.
I get no cookie from the server (at least not in the Set-Cookie-Header). I only get a string in the data part of the package. From this string, Tosca needs to build a CookieResource.
Comment: What is the data part of the package? Tosca acts like a normal browser would, which means creating a cookie resource whenever there is a Set-Cookie-Header in the response from the server. Whenever you already send the cookie to the server, you will see no Set-Cookie-Header in the response. I usually clear all cookies in the browser and than check the location, which actually creates the cookies. This is what I than use in Tosca, which in most cases leads to the Cookie-Resource being filled properly.


Show panel on click

Question: please for a little help in displaying the panel at the click of a button, namely in my application I have a FormMenu in which the panelCentralForm is displayed when loading.
When I click on btnListOfActiveUser_Click I manage to open FormListStaff over panelCentralForm using this code:
<code> private void btnListOfActiveUser_Click(object sender, EventArgs e)
        {
            FormListStaff formListStaff = new FormListStaff();
            AddFormToPanel(formListStaff);
        }

 private void AddFormToPanel(object form)
        {
            if (this.panelCentralForm.Controls.Count > 0)
                this.panelCentralForm.Controls.RemoveAt(0);
            Form fh = form as Form;
            fh.TopLevel = false;
            fh.FormBorderStyle = FormBorderStyle.None;
            fh.Dock = DockStyle.Fill;
            this.panelCentralForm.Controls.Add(fh);
            this.panelCentralForm.Tag = fh;
            fh.Show();
        }
</code>
my question is how can I in a similar way that now when I click on buttonDashboard to return to me the first view, ie the view from the Central Form panel (panelCentralForm).
<code>   private void buttonDashboard_Click(object sender, EventArgs e)
        {
            panelCentralForm.Visible = true; //something like this, p.s. this code doesn't just work as an example I wrote
        }
</code>
the whole view belongs from FormMenu.cs
Thanks a lot to everyone for the help
Comment: Sounds like you want a toggle button? If so check out the answers [here](https://stackoverflow.com/questions/282118/togglebutton-in-c-sharp-winforms) you can use a checkbox then set the appearance to button. Depending on the state of the check box you can then either show or hide the FormListStaff
Comment: @Anonymous ok thanks for the reply, do you have any example?
Comment: You could save the Form fh globally and then use fh.Hide() in your buttonDashboard_Click() method.
Comment: @ValentinSky thanks for the comment but it doesn't work.
Answer:
my question is how can I in a similar way that now when I click on
  buttonDashboard to return to me the first view

Just Clear() the panel, then add the label back in?
<code>this.panelCentralForm.Controls.Clear();
this.panelCentralForm.Controls.Add(label1);
</code>
The label should still be accessible even though it was previously removed from the panel since it is declared at form level in your designer file.
Comment: It's unclear where "buttonDashboard" resides, though.  Is it in the same place as "btnListOfActiveUser", or is it in the child form "FormListStaff"?
Comment: I corrected the question, I added the layout of FormMenu, and from which I open FormListStaff on the left side to btnListOfActiveUser_Click ()
I just need more for Dashboard to return me to the initial state with panelCentralForm and label1 content, thank you very much for your effort and help
Comment: great, it only works, it shows me more label1 all the way to the corner, can I set its location as it is current in menuForm? LIKE:
this.panelCentralForm.Controls.Clear();
label1.Dock = DockStyle.Fill;
label1.Location = new Point(28, 39); //it doesn't work for me, where am I wrong?
this.panelCentralForm.Controls.Add(label1);
Comment: If you don't want it to fill the entire panel then remove the `Dock` line.

Show panel on click


What are the properties of this exotic function transform, which divides Taylor series coefficients by $(n!)$?

Question: While investigating a model in particle physics, I encountered an exotic function transform. The form that appears in our application acts on analytic functions. In its original form, it can be written in terms of a contour integral, but it looks the most transparent in terms of Taylor series,
$$f(z) = \sum_n \frac{f^{(n)} z^n}{n!} \, \mapsto \, \tilde{f}(w) = \sum_n \frac{f^{(n)} \, w^{n+1}}{n! (n+1)!}.$$
The derivative of the output function looks a bit nicer,
$$\tilde{f}'(w) = \sum_n \frac{f^{(n)} \, w^n}{(n!)^2}.$$
We've computed several special cases (for instance, it converts exponentials to Bessel functions), but in practice we need to evaluate it for more general functions, such as exponentials divided by polynomials, where the resulting series seems hard to sum. However, it's simple enough that we suspect it already has a name, or at least some known properties that would be helpful. Is this transform known in the mathematical literature, and is there anything known that could help with evaluating it on functions such as $e^{iz}/(z-z_0)(z-z_1)$?
Comment: It sounds like what you're talking about is the [Hadamard Product](https://en.wikipedia.org/wiki/Generating_function_transformation#Hadamard_products_and_diagonal_generating_functions) of your function (power series) with the exponential power series.
Answer: $f^\tilde'(w)$ is the Borel transform of the Maclaurin series of $f$.


CMDeviceMotion userAcceleration drift

Question: I'm getting the acceleration data using the <code>-[CMDeviceMotion userAcceleration]</code>
I've noticed one interesting thing: I always get a small bias on the Z axis. It is about 0.0155 (with variance of 0.002). While on other axes the average values are near 0.
I'm testing this with iPod Touch 4G (and it is just laying on the table during testing). The question is: where this bias is from and is it device specific?
Answer: I noticed similar values although CoreMotion tries to eliminate bias. If you rotate your device so that x (or y) is parallele to gravity you will probably see the bias in x direction. Using raw sensor data showed the same tendency but with larger values and some more super-imposing effects like temperature dependency, time based shifting, ...
18 months ago I read a specification of the iPhone 3 devices' accelerometers and according to this the accuracy was about 1.8 % of g. (what a pity the bookmark to STM product page I set now leads to 404).
Basically this should not be a problem as long as you don't try to estimate exact positions (displacements) and this seems to be impossible with an acceptable accuracy - see the several discusion here on SO.

CMDeviceMotion userAcceleration drift


Adobe Photoshop CC crashes through PlayOnLinux

Question: I have installed Adobe Photoshop CC using PlayOnLinux and following this tutorial.
My computer is a Dell Inspiron 3537 (here's the spcifications), I'm using a 64 bit Ubuntu 12.04, with Wine 1.6 and PlayOnLinux 4.2. The installation uses a 32bit virtual drive of Windows7.
Everything was working fine, no bugs during the installation. When I try to run Adobe CC through POL, everything seems to be working (I get an error message that 3D features requires more RAM but I'm not sure that's relevant), but when I try to open any file at all, it crashes.
Here's the error Log:
<code>Unhandled exception: page fault on read access to 0x8904478b in 32-bit code (0x8904478b).
Register dump:
 CS:0023 SS:002b DS:002b ES:002b FS:0063 GS:006b
 EIP:8904478b ESP:0032d344 EBP:0032d3ac EFLAGS:00210212(  R- --  I   -A- - )
 EAX:8904478b EBX:00000000 ECX:0068cb64 EDX:0032d3b8
 ESI:00000000 EDI:0032d3d7
Stack dump:
0x0032d344:  0168c9d8 0032d39c 00000001 0032d3b8
0x0032d354:  00000000 40ddc85a 072f6390 0c184af0
0x0032d364:  f5090ff4 00000000 f5067caf 072f6390
0x0032d374:  0274db2c 0032d394 0032d3c4 072f6394
0x0032d384:  0032d39c 00000001 072f6394 0c184af0
0x0032d394:  00000000 0d5a7af8 0068cb64 0032e5bc
Backtrace:
=>0 0x8904478b (0x0032d3ac)
  1 0x0168cb78 in photoshop (+0x128cb77) (0x0032d3c8)
  2 0xf506cbc2 in comdlg32 (+0x2cbc1) (0x0032d438)
  3 0x7e367972 in shell32 (+0x27971) (0x0032d498)
  4 0x7e3bfc81 in shell32 (+0x7fc80) (0x0032d4f8)
  5 0x7e3c3b55 in shell32 (+0x83b54) (0x0032d6a8)
  6 0x7e3c48d1 in shell32 (+0x848d0) (0x0032d748)
  7 0x7ec342ba WINPROC_wrapper+0x19() in user32 (0x0032d788)
  8 0x7ec3499c in user32 (+0xa499b) (0x0032d7d8)
  9 0x7ec370b5 in user32 (+0xa70b4) (0x0032d828)
  10 0x7ebf54be in user32 (+0x654bd) (0x0032d898)
  11 0x7ebfc856 in user32 (+0x6c855) (0x0032d908)
  12 0x7ebfcd29 SendMessageW+0x58() in user32 (0x0032d958)
  13 0x7e269b5e in comctl32 (+0x39b5d) (0x0032d9a8)
  14 0x7e2757d3 in comctl32 (+0x457d2) (0x0032da88)
  15 0x7e275eeb in comctl32 (+0x45eea) (0x0032db18)
  16 0x7e276de4 in comctl32 (+0x46de3) (0x0032dbd8)
  17 0x7e2773be in comctl32 (+0x473bd) (0x0032dc68)
  18 0x7e27c7b9 in comctl32 (+0x4c7b8) (0x0032dd68)
  19 0x7e28362f in comctl32 (+0x5362e) (0x0032de78)
  20 0x7ec342ba WINPROC_wrapper+0x19() in user32 (0x0032deb8)
  21 0x7ec3499c in user32 (+0xa499b) (0x0032df08)
  22 0x7ec370b5 in user32 (+0xa70b4) (0x0032df58)
  23 0x7ebf74b2 DispatchMessageW+0xb1() in user32 (0x0032e068)
  24 0x7ebc37b8 IsDialogMessageW+0x137() in user32 (0x0032e1d8)
  25 0x7ebc4187 in user32 (+0x34186) (0x0032e258)
  26 0x7ebc6449 DialogBoxParamW+0x98() in user32 (0x0032e2a8)
  27 0xf506aa97 in comdlg32 (+0x2aa96) (0x0032e2f8)
  28 0xf5066e96 in comdlg32 (+0x26e95) (0x0032e328)
  29 0x0169062b in photoshop (+0x129062a) (0x0032e5c8)
  30 0x01690a22 in photoshop (+0x1290a21) (0x0032e95c)
  31 0x0165aca2 in photoshop (+0x125aca1) (0x0032e9f4)
  32 0x016abf48 in photoshop (+0x12abf47) (0x0032ea28)
  33 0x00f44339 in photoshop (+0xb44338) (0x0032eacc)
  34 0x015f45f9 in photoshop (+0x11f45f8) (0x0032eae8)
  35 0x0163dded in photoshop (+0x123ddec) (0x0032eb28)
  36 0x0166188f in photoshop (+0x126188e) (0x0032eb88)
  37 0x0164bd5c in photoshop (+0x124bd5b) (0x0032ebbc)
  38 0x0167f223 in photoshop (+0x127f222) (0x0032ec1c)
  39 0x0164d49b in photoshop (+0x124d49a) (0x0032eee8)
  40 0x7ec342ba WINPROC_wrapper+0x19() in user32 (0x0032ef18)
  41 0x7ec3499c in user32 (+0xa499b) (0x0032ef68)
  42 0x7ec37351 CallWindowProcW+0x60() in user32 (0x0032efb0)
  43 0x03c1768c in adobeowl (+0x2768b) (0x0032f120)
  44 0x03c2e6bf in adobeowl (+0x3e6be) (0x0032f18c)
  45 0x03c343c6 in adobeowl (+0x443c5) (0x0032f1cc)
  46 0x0071268f in photoshop (+0x31268e) (0x0032f208)
  47 0x7ec342ba WINPROC_wrapper+0x19() in user32 (0x0032f238)
  48 0x7ec3499c in user32 (+0xa499b) (0x0032f288)
  49 0x7ec370b5 in user32 (+0xa70b4) (0x0032f2d8)
  50 0x7ebf54be in user32 (+0x654bd) (0x0032f348)
  51 0x7ebfc856 in user32 (+0x6c855) (0x0032f3b8)
  52 0x7ebfcd29 SendMessageW+0x58() in user32 (0x0032f400)
  53 0x03c7ef5a in adobeowl (+0x8ef59) (0x0032f460)
  54 0x03c7dfcb in adobeowl (+0x8dfca) (0x0032f490)
  55 0x03c2e6bf in adobeowl (+0x3e6be) (0x0032f4f8)
  56 0x03c343c6 in adobeowl (+0x443c5) (0x0032f538)
  57 0x7ec342ba WINPROC_wrapper+0x19() in user32 (0x0032f568)
  58 0x7ec3499c in user32 (+0xa499b) (0x0032f5b8)
  59 0x7ec370b5 in user32 (+0xa70b4) (0x0032f608)
  60 0x7ebf74b2 DispatchMessageW+0xb1() in user32 (0x0032f718)
  61 0x01686c74 in photoshop (+0x1286c73) (0x0032f7d0)
  62 0x016abdaa in photoshop (+0x12abda9) (0x0032f810)
  63 0x00695568 in photoshop (+0x295567) (0x0032f96c)
  64 0x01688e44 in photoshop (+0x1288e43) (0x0032fdcc)
  65 0x01767f1d in photoshop (+0x1367f1c) (0x0032fe60)
  66 0x7b85f33c call_process_entry+0xb() in kernel32 (0x0032fe78)
  67 0x7b8605bb in kernel32 (+0x505ba) (0x0032feb8)
  68 0x7bc7a120 call_thread_func_wrapper+0xb() in ntdll (0x0032fed8)
  69 0x7bc7d12d call_thread_func+0x7c() in ntdll (0x0032ffa8)
  70 0x7bc7a0fe RtlRaiseException+0x21() in ntdll (0x0032ffc8)
  71 0x7bc4e75e call_dll_entry_point+0x33d() in ntdll (0x0032ffe8)
  72 0xf75fd76d wine_call_on_stack+0x1c() in libwine.so.1 (0x00000000)
  73 0xf75fd82b wine_switch_to_stack+0x2a() in libwine.so.1 (0xffb32238)
  74 0x7bc545c0 LdrInitializeThunk+0x3af() in ntdll (0xffb322a8)
  75 0x7b866b92 __wine_kernel_init+0xa21() in kernel32 (0xffb33458)
  76 0x7bc54d7b __wine_process_init+0x25a() in ntdll (0xffb334e8)
  77 0xf75faccc wine_init+0x2db() in libwine.so.1 (0xffb33558)
  78 0x7bf00f43 main+0xf2() in <wine-loader> (0xffb339a8)
  79 0xf74244d3 __libc_start_main+0xf2() in libc.so.6 (0x00000000)
0x8904478b: -- no code accessible --
Modules:
Module  Address         Debug info  Name (222 modules)
PE    330000-  38a000   Deferred        cggl
PE    390000-  3cb000   Deferred        tbb
PE    3d0000-  3d9000   Deferred        adbeape
PE    400000- 37d7000   Export          photoshop
PE   37e0000- 3871000   Deferred        sccore
PE   3880000- 3b75000   Deferred        patchmatch
PE   3b80000- 3bed000   Deferred        adobe_caps
PE   3bf0000- 3d65000   Export          adobeowl
PE   3d70000- 3dae000   Deferred        ahclient
PE   3db0000- 3e57000   Deferred        axedomcore
PE   3e60000- 42e4000   Deferred        mps
PE   42f0000- 47d8000   Deferred        plugplugowl
PE   4b30000- 4b32000   Deferred        psart
PE   50d0000- 5100000   Deferred        tbbmalloc
PE   5b50000- 5cc3000   Deferred        adobelinguistic
PE   6480000- 64cd000   Deferred        logsession
PE   64e0000- 64ed000   Deferred        fastcore.8bx
PE   64f0000- 6687000   Deferred        photoshop
PE   6690000- 68ee000   Deferred        psviews
PE   6c10000- 6c89000   Deferred        multiprocessor support.8bx
PE   6c90000- 6caa000   Deferred        plugin
PE   7320000- 7505000   Deferred        amtlib
PE   7610000- 763c000   Deferred        axe8sharedexpat
PE   9210000- 922e000   Deferred        adbeapecore
PE   9310000- 935b000   Deferred        adobexmp
PE   9bd0000- 9c87000   Deferred        mmxcore.8bx
PE   9c90000- a069000   Deferred        libmmd
PE   a430000- a4ac000   Deferred        updaternotifications
PE   ac90000- b39d000   Deferred        svml_dispmd
PE   c6a0000- ccfe000   Deferred        dicom.8bi
PE   eb30000- eb7e000   Deferred        bib
PE   ec90000- ecd1000   Deferred        bibutils
PE   edf0000- efdc000   Deferred        ace
PE   f0f0000- f476000   Deferred        agm
PE   f590000- f889000   Deferred        cooltype
PE   ffb0000- fff6000   Deferred        servicemanager-launcher
PE  10000000-100a4000   Deferred        extendscript
PE  15540000-15674000   Deferred        wrservices
PE  15780000-159ab000   Deferred        scriptingsupport.8li
PE  159b0000-15a60000   Deferred        scriptuiflex
PE  16460000-16d45000   Deferred        adbeapeengine
PE  18bd0000-18cfd000   Deferred        imslib
PE  4ec50000-4edfb000   Deferred        gdiplus
PE  4fad0000-51375000   Deferred        camera raw.8bi
PE  6a000000-6a63a000   Deferred        cg
PE  78050000-780b9000   Deferred        msvcp100
PE  78aa0000-78b5f000   Deferred        msvcr100
ELF 7b800000-7ba5b000   Dwarf           kernel32<elf>
  \-PE  7b810000-7ba5b000   \               kernel32
ELF 7bc00000-7bcdc000   Dwarf           ntdll<elf>
  \-PE  7bc10000-7bcdc000   \               ntdll
ELF 7bf00000-7bf04000   Dwarf           <wine-loader>
ELF 7d6a2000-7d6d8000   Deferred        uxtheme<elf>
  \-PE  7d6b0000-7d6d8000   \               uxtheme
ELF 7d6d8000-7d6dd000   Deferred        libgpg-error.so.0
ELF 7d6dd000-7d6f5000   Deferred        libresolv.so.2
ELF 7d6f5000-7d6f9000   Deferred        libkeyutils.so.1
ELF 7d6f9000-7d742000   Deferred        libdbus-1.so.3
ELF 7d742000-7d754000   Deferred        libp11-kit.so.0
ELF 7d754000-7d7d9000   Deferred        libgcrypt.so.11
ELF 7d7d9000-7d7eb000   Deferred        libtasn1.so.3
ELF 7d7eb000-7d813000   Deferred        libk5crypto.so.3
ELF 7d813000-7d8e2000   Deferred        libkrb5.so.3
ELF 7d8e2000-7d8f4000   Deferred        libavahi-client.so.3
ELF 7d8f4000-7d9b8000   Deferred        libgnutls.so.26
ELF 7d9b8000-7d9f6000   Deferred        libgssapi_krb5.so.2
ELF 7d9f6000-7da49000   Deferred        libcups.so.2
ELF 7da67000-7da6d000   Deferred        libxfixes.so.3
ELF 7da6d000-7da78000   Deferred        libxcursor.so.1
ELF 7da78000-7da89000   Deferred        libxi.so.6
ELF 7da89000-7da8d000   Deferred        libxcomposite.so.1
ELF 7da8d000-7da96000   Deferred        libxrandr.so.2
ELF 7da96000-7daa0000   Deferred        libxrender.so.1
ELF 7daa0000-7daa6000   Deferred        libxxf86vm.so.1
ELF 7daa6000-7daaa000   Deferred        libxinerama.so.1
ELF 7daaa000-7dab1000   Deferred        libxdmcp.so.6
ELF 7dab1000-7dab5000   Deferred        libxau.so.6
ELF 7dab5000-7dad6000   Deferred        libxcb.so.1
ELF 7dad6000-7dc0a000   Deferred        libx11.so.6
ELF 7dc0a000-7dc1c000   Deferred        libxext.so.6
ELF 7dc1c000-7dc25000   Deferred        libkrb5support.so.0
ELF 7dc25000-7dc2a000   Deferred        libcom_err.so.2
ELF 7dc2a000-7dc38000   Deferred        libavahi-common.so.3
ELF 7dc3a000-7dccc000   Deferred        winex11<elf>
  \-PE  7dc40000-7dccc000   \               winex11
ELF 7dd23000-7dd4d000   Deferred        libexpat.so.1
ELF 7dd4d000-7dd81000   Deferred        libfontconfig.so.1
ELF 7dd81000-7de1b000   Deferred        libfreetype.so.6
ELF 7de1b000-7dee9000   Deferred        crypt32<elf>
  \-PE  7de20000-7dee9000   \               crypt32
ELF 7dee9000-7e01d000   Deferred        oleaut32<elf>
  \-PE  7df00000-7e01d000   \               oleaut32
ELF 7e01d000-7e044000   Deferred        mpr<elf>
  \-PE  7e020000-7e044000   \               mpr
ELF 7e044000-7e0bf000   Deferred        wininet<elf>
  \-PE  7e050000-7e0bf000   \               wininet
ELF 7e0bf000-7e200000   Deferred        msvcp90<elf>
  \-PE  7e100000-7e200000   \               msvcp90
ELF 7e200000-7e22d000   Deferred        msvcr90<elf>
  \-PE  7e210000-7e22d000   \               msvcr90
ELF 7e22d000-7e335000   Dwarf           comctl32<elf>
  \-PE  7e230000-7e335000   \               comctl32
ELF 7e335000-7e568000   Dwarf           shell32<elf>
  \-PE  7e340000-7e568000   \               shell32
ELF 7e568000-7e5a8000   Deferred        winspool<elf>
  \-PE  7e570000-7e5a8000   \               winspool
ELF 7e5a8000-7e5e5000   Deferred        winhttp<elf>
  \-PE  7e5b0000-7e5e5000   \               winhttp
ELF 7e5e5000-7e61b000   Deferred        ws2_32<elf>
  \-PE  7e5f0000-7e61b000   \               ws2_32
ELF 7e61b000-7e729000   Deferred        opengl32<elf>
  \-PE  7e640000-7e729000   \               opengl32
ELF 7e729000-7e7a3000   Deferred        shlwapi<elf>
  \-PE  7e740000-7e7a3000   \               shlwapi
ELF 7e7a3000-7e7dc000   Deferred        liblcms.so.1
ELF 7e7fa000-7e81b000   Deferred        mscms<elf>
  \-PE  7e800000-7e81b000   \               mscms
ELF 7e81b000-7e89c000   Deferred        rpcrt4<elf>
  \-PE  7e830000-7e89c000   \               rpcrt4
ELF 7e89c000-7e9d8000   Deferred        ole32<elf>
  \-PE  7e8b0000-7e9d8000   \               ole32
ELF 7e9d8000-7e9f2000   Deferred        version<elf>
  \-PE  7e9e0000-7e9f2000   \               version
ELF 7e9f2000-7ea61000   Deferred        advapi32<elf>
  \-PE  7ea00000-7ea61000   \               advapi32
ELF 7ea61000-7eb7e000   Deferred        gdi32<elf>
  \-PE  7ea70000-7eb7e000   \               gdi32
ELF 7eb7e000-7ecd9000   Dwarf           user32<elf>
  \-PE  7eb90000-7ecd9000   \               user32
ELF 7ecd9000-7ed83000   Deferred        msvcrt<elf>
  \-PE  7ecf0000-7ed83000   \               msvcrt
ELF 7ef83000-7ef90000   Deferred        libnss_files.so.2
ELF 7ef90000-7ef9c000   Deferred        libnss_nis.so.2
ELF 7ef9c000-7efb6000   Deferred        libnsl.so.1
ELF 7efb6000-7efe2000   Deferred        libm.so.6
ELF 7efe3000-7eff9000   Deferred        libz.so.1
ELF f49dd000-f4a08000   Deferred        libvorbis.so.0
ELF f4a08000-f4b80000   Deferred        libvorbisenc.so.2
ELF f4b80000-f4bce000   Deferred        libflac.so.8
ELF f4bce000-f4c40000   Deferred        libsndfile.so.1
ELF f4c40000-f4ca5000   Deferred        libpulsecommon-1.1.so
ELF f4ca5000-f4cf3000   Deferred        libpulse.so.0
ELF f4d11000-f4d39000   Deferred        winepulse<elf>
  \-PE  f4d20000-f4d39000   \               winepulse
ELF f4d39000-f4d5b000   Deferred        mmdevapi<elf>
  \-PE  f4d40000-f4d5b000   \               mmdevapi
ELF f4d5b000-f4d70000   Deferred        schannel<elf>
  \-PE  f4d60000-f4d70000   \               schannel
ELF f4d70000-f4da3000   Deferred        secur32<elf>
  \-PE  f4d80000-f4da3000   \               secur32
ELF f4da3000-f4dcb000   Deferred        mlang<elf>
  \-PE  f4db0000-f4dcb000   \               mlang
ELF f4dcb000-f4e33000   Deferred        dbghelp<elf>
  \-PE  f4dd0000-f4e33000   \               dbghelp
ELF f4e33000-f4e53000   Deferred        dnsapi<elf>
  \-PE  f4e40000-f4e53000   \               dnsapi
ELF f4e53000-f4e9b000   Deferred        dsound<elf>
  \-PE  f4e60000-f4e9b000   \               dsound
ELF f4e9b000-f4f3e000   Deferred        urlmon<elf>
  \-PE  f4eb0000-f4f3e000   \               urlmon
ELF f4f3e000-f503c000   Deferred        msi<elf>
  \-PE  f4f50000-f503c000   \               msi
ELF f503c000-f5128000   Dwarf           comdlg32<elf>
  \-PE  f5040000-f5128000   \               comdlg32
ELF f5606000-f5631000   Deferred        msacm32<elf>
  \-PE  f5610000-f5631000   \               msacm32
ELF f5631000-f5649000   Deferred        wtsapi32<elf>
  \-PE  f5640000-f5649000   \               wtsapi32
ELF f5649000-f566d000   Deferred        dwrite<elf>
  \-PE  f5650000-f566d000   \               dwrite
ELF f566d000-f56af000   Deferred        usp10<elf>
  \-PE  f5670000-f56af000   \               usp10
ELF f56af000-f56dc000   Deferred        netapi32<elf>
  \-PE  f56c0000-f56dc000   \               netapi32
ELF f56dc000-f5800000   Deferred        actxprxy<elf>
  \-PE  f5700000-f5800000   \               actxprxy
ELF f5904000-f5925000   Deferred        cabinet<elf>
  \-PE  f5910000-f5925000   \               cabinet
ELF f5925000-f59df000   Deferred        winmm<elf>
  \-PE  f5930000-f59df000   \               winmm
ELF f59df000-f5a00000   Deferred        oleacc<elf>
  \-PE  f59e0000-f5a00000   \               oleacc
ELF f5b02000-f5b0a000   Deferred        libogg.so.0
ELF f5b64000-f5ca5000   Deferred        wined3d<elf>
  \-PE  f5b70000-f5ca5000   \               wined3d
ELF f6d78000-f6d99000   Deferred        explorerframe<elf>
  \-PE  f6d80000-f6d99000   \               explorerframe
ELF f6d99000-f6ddb000   Deferred        rsaenh<elf>
  \-PE  f6da0000-f6ddb000   \               rsaenh
ELF f6ddb000-f6de2000   Deferred        libnss_dns.so.2
ELF f7104000-f711a000   Deferred        dwmapi<elf>
  \-PE  f7110000-f711a000   \               dwmapi
ELF f711a000-f7138000   Deferred        libgcc_s.so.1
ELF f713a000-f7156000   Deferred        wsock32<elf>
  \-PE  f7140000-f7156000   \               wsock32
ELF f7156000-f716a000   Deferred        msimg32<elf>
  \-PE  f7160000-f716a000   \               msimg32
ELF f716a000-f7190000   Deferred        dxgi<elf>
  \-PE  f7170000-f7190000   \               dxgi
ELF f7190000-f7200000   Deferred        setupapi<elf>
  \-PE  f71a0000-f7200000   \               setupapi
ELF f7305000-f730f000   Deferred        libwrap.so.0
ELF f734b000-f737c000   Deferred        wbemprox<elf>
  \-PE  f7350000-f737c000   \               wbemprox
ELF f737c000-f73a2000   Deferred        iphlpapi<elf>
  \-PE  f7380000-f73a2000   \               iphlpapi
ELF f73a2000-f73c7000   Deferred        imm32<elf>
  \-PE  f73b0000-f73c7000   \               imm32
ELF f73c7000-f73ec000   Deferred        sti<elf>
  \-PE  f73d0000-f73ec000   \               sti
ELF f73ec000-f7400000   Deferred        psapi<elf>
  \-PE  f73f0000-f7400000   \               psapi
ELF f7401000-f740a000   Deferred        libnss_compat.so.2
ELF f740b000-f75b5000   Dwarf           libc.so.6
ELF f75b5000-f75ba000   Deferred        libdl.so.2
ELF f75bb000-f75d6000   Deferred        libpthread.so.0
ELF f75d7000-f75e0000   Deferred        librt.so.1
ELF f75e1000-f75e8000   Deferred        libasyncns.so.0
ELF f75e8000-f75f0000   Deferred        libjson.so.0
ELF f75f4000-f77aa000   Dwarf           libwine.so.1
ELF f77ac000-f77ce000   Deferred        ld-linux.so.2
ELF f77ce000-f77cf000   Deferred        [vdso].so
Threads:
process  tid      prio (all id:s are in hex)
00000008 (D) C:\Program Files\Adobe\Adobe Photoshop CC\Photoshop.exe
    00000096    0
    00000095    0
    00000093    0
    0000008f    0
    0000008b    0
    00000088    0
    00000087    0
    00000086    0
    00000085   15
    00000084    0
    00000083    0
    00000082    0
    00000081    0
    00000080    0
    0000007f    0
    0000007e    0
    0000007d    0
    0000007c    0
    0000007b    0
    0000007a    0
    00000079    0
    00000078    0
    00000077    0
    00000076    0
    00000075    0
    00000074    0
    00000073    0
    00000072    0
    00000071    0
    00000070    0
    0000006f    0
    0000006e    0
    0000006d    0
    0000006c    0
    0000006b    0
    0000006a    0
    00000069    0
    00000068    0
    00000032    0
    0000002e    0
    00000067    0
    00000066    0
    00000065    0
    00000064    0
    00000063    0
    00000062    0
    00000061    0
    00000060    0
    0000005f    0
    0000005e    0
    0000005d    0
    0000005c    0
    0000005b    0
    0000005a    0
    00000059    0
    00000058    0
    00000057    0
    00000056    0
    00000055    0
    00000054    0
    00000053    0
    00000052    0
    00000050    0
    0000004f    0
    0000003e    0
    00000043    0
    0000003c    0
    0000001e    0
    0000002c    0
    0000002d    0
    00000024    0
    00000025    0
    0000000b    0
    0000000d    0
    0000000c    0
    00000044    0
    00000040    0
    0000002b    0
    0000002a    0
    00000029    0
    00000028    0
    00000027    0
    00000021    0
    00000009    0 <==
0000000e services.exe
    00000037    0
    00000036    0
    0000001d    0
    00000014    0
    00000010    0
    0000000f    0
00000012 winedevice.exe
    0000001c    0
    00000019    0
    00000017    0
    00000013    0
0000001a plugplay.exe
    00000020    0
    0000001f    0
    0000001b    0
00000022 explorer.exe
    00000026    0
    00000023    0
00000034 svchost.exe
    00000047    0
    00000046    0
    00000041    0
    0000003d    0
    0000003b    0
    0000003a    0
    00000038    0
    00000035    0
0000003f rpcss.exe
    00000051    0
    0000004e    0
    0000004d    0
    0000004c    0
    0000004b    0
    0000004a    0
    00000049    0
    00000042    0
    00000045    0
00000090 CEPServiceManager.exe
    00000094    0
    00000092    0
    00000091    0
System information:
    Wine build: wine-1.6.1
    Platform: i386
    Host system: Linux
    Host version: 3.11.0-15-generic
</code>
I have no idea what this means. Any ideas how I should attempt to fix this? What should I check? etc.
Comment: Possibly a bug in PlayOnLinux, which should be reported on their forums. Otherwise, any reason for not using Gimp?
Comment: I need to view psd files. Gimp (and other alternatives) distort those and I really don't want to be using dual boot. You really think it's a bug?
Comment: From experience, you're likelier to get better help on PlayOnLinux forums with issues related to their installers.
Comment: I'm not sure the issue is with POL (I didn't use an official installer) but thanks, I'll try that too
Comment: virtual machine is your friend
Comment: Photoshop cs6 in wine works for me!
Comment: You can try to open files via drag and drop into Photoshop or right clicking files "open with"
Comment: @DušanMilosevic I'll try that, See if it's any better. Thanks
Answer: It is a bad idea to run Adobe  Photoshop CC in wine because wine doesn't support this version of Photoshop. So what's the deal?  install other working version of it. See the rating by wine @ here . Use Platinum or gold for better working.
CS 6 works fine under many versions of wine see http://appdb.winehq.org/objectManager.php?sClass=version&iId=25607
Comment: Actually, I got it working. I installed some newer drivers (which suddenly popped up as optional beta drivers when I opened additional drivers). It's kinda of half-working (trying to open files crashes it, but dragging a psd to the program works). Also I don't care what's officially supported, because as far as I know wine only supports CS4 and below (which is kinda old). I would like to know if you can tell me that CS6 *is* supported or has been reported as more stable than CC (I can't think of any reason why it would though).
Answer: From experience, you're like to get better help on PlayOnLinux forums with issues related to their installers. It is Possibly a bug in PlayOnLinux, which should be reported on their forums. If you want to view psd files, You may like Kuickshow.
KuickShow is an image browser/viewer with a nice filebrowser to select images to be shown, slideshow support and the ability to display the following image formats: jpg, gif, tiff, png, bmp, psd, xpm, xbm, pbm and eim. Images can be displayed either in their own window, as large as the image, or fullscreen (which shrinks images too large to display). KuickShow also has a slideshow mode.
Comment: Because I want it to be faster, and photoshop generally requires a lot of RAM, which wine is [better suited to serve](http://askubuntu.com/a/113395/134047)
Comment: I need to access the layers, not just view the images.
Comment: then why dont you run windows xp from virtualbox?]
Comment: I prefer to try and run it through wine for now, though I'll certainly check that option (also, I need Window 7, xp can't run photoshop CC)
Comment: then why odnt you run windows 7 from virtualbox? wine has a issue, it is buggy, it can even damage you important files
Answer: I opened up <code>System Settings > Additional Drivers</code> and suddenly (I swear this was only added this week, I had a different driver activated before this) there appeared a new option called <code>ATI/AMD propriety FGLRX graphics driver (**experimental** beta)</code>, which in the description:

Video driver for the AMD Radeon and FireGL graphics accelerators. This
  package provides 2D display drivers and hardware accelerated OpenGL.

Activating this made Photoshop CC work for me. It still crashes sometimes (if I try to open a file through the menu for example), but if I drag a psd file to the program it opens up and I can view all the layers etc. For me that's enough, though for other I guess I can only recommend trying a different photoshop release maybe (or sending angry emails to Adobe that's it's high-time they released a version that supports Ubuntu as a native environment)


manage.py not generated

Question: I just installed django  after i run
django-admin.py startproject test2
  BOX@BOXLinux:~/django/test2/test2$ ls
  __init__.py  settings.py  urls.py  wsgi.py

There is no file called manage.py ? is my mistake or a bug in django
Comment: is it in the dir above the one you just listed?
Comment: which version of django?
Comment: 1.4 alpha 1 its seem i download the in correct version but the i taken from official installation guide
Answer: You appear to be using the development version, for some reason. In that version, the structure has changed a bit so that manage.py is in the directory above.
You should really be using version 1.3, until 1.4 is released.
Comment: i download Django-1.3.1 but it still give 1.4 alpha 1

manage.py not generated


Delay between requests in Apify

Question: Apify's legacy Crawler had a randomWaitBetweenRequests option :

This option forces the crawler to ensure a minimum time interval between opening two web pages, in order to prevent it from overloading the target server.

Do Apify Actors have a similar setting ?  If so, how does it impact the Actor Units computation ?
Answer: There are no options like that in apify/web-scraper, which should replace legacy crawler option.
But there is a way how to implement this yourself in pageFunction. You can simply use context.waitFor() function and pass there random time in ms.
async function pageFunction(context) {
    const { request, log, jQuery } = context;

    // To be able to use jQuery as $, one needs save it into a variable
    // and select the inject jQuery option. We've selected it for you.
    const $ = jQuery;
    const title = $('title').text();

    log.info(`URL: ${request.url} TITLE: ${title}`);

    // This waits time in ms, which getRandomWait returns.
    await context.waitFor(getRandomWait());

    // To save data just return an object with the requested properties.
    return {
        url: request.url,
        title
    };
}

If you want to have this option in apify/web-scraper, you can submit an issue on GitHub repo.
Comment: Note that if `waitFor` does not exist on context object (it does not for me, maybe because I'm using newer version, maybe because I'm using BasicCrawler), plain `await Apify.utils.sleep(_.random(500, 3000))` in `handleRequestFunction`/`handlePageFunction` works too

Delay between requests in Apify


How and when does Vue store data in its underlying elements?

Question: I am attempting to make use of the dataset attributes of elements, to enable data to be transferred from one item to another during a drag/drop process. But I am having some odd results depending on how Vues' v-if condition is used. The code below works as expected: if you click the 'move' button, then look at the underlying elements' datasets using the 'inspect' button, the dataset for the second item changes.....

<template>
   <template v-for="(item,n) in thisData" :key="n" >
     <button  v-if="localTest(n)"  style="background-color: lightblue;" class="swappable"
        :data-transfer = dataTransfer(item)
        :id=idString(n)
        > {{ item }}
     </button>
     <button    v-else   style="background-color: lightgreen;" class="swappable"
        :data-transfer = dataTransfer(item)
        :id=idString(n)
        > {{ item}}
    </button>

   </template>
     <button  @click="inspect()">Inspect Element Data</button >

   <button  @click="move()">Copy btn 1 to btn 2</button >
</template>

... but if the v-if test is changed to globalTest(n) instead of localTest(n), the dataset does not change.
My app needs to use a test using a 'global' (a reactive one in fact) but I also need to access the changed dataset.
The effect can be seen here, by editing the v-if test.
Comment: I only added `moves` to show the problem, it doesn't actually do anything useful. All the components themselves update correctly; it's the data behind that isn't updating with the 'global' test.
Comment: I don't think there's anything here that is unneccesary! It's already taken me several hours to distil my original code to the minumum needed to show the effect.
Answer: Inspecting the resulting page using the browser toolbox shows that the elements are updating correctly even when using globalTest.
The problem is that you are using references to detached elements, which obviously don't update. You shouldn't store elements in a simple array when using Vue, as Vue sometimes changes and replaces elements when updating the component, causing the references you stored to become obsolete.
Instead, you should use template refs:

ref is a special attribute, similar to the key attribute discussed in the v-for chapter. It allows us to obtain a direct reference to a specific DOM element or child component instance after it's mounted.

In your case, we can replace var items = [] with var items = ref([]) and all other references to items with items.value, then remove items= document.querySelectorAll('.swappable') ; from onMounted.
We should also add ref="items" to the button.
This resolves issue, as now the references are automatically updated when Vue replaces an element.
Here is the fixed code:

<template>
   <template v-for="(item,n) in thisData" :key="n" >
     <button  v-if="globalTest(n)"  style="background-color: lightblue;" class="swappable"
        :data-transfer = dataTransfer(item)
        :id=idString(n)
        ref="items"
        > {{ item }}
     </button>
     <button    v-else   style="background-color: lightgreen;" class="swappable"
        :data-transfer = dataTransfer(item)
        :id=idString(n)
        ref="items"
        > {{ item}}
    </button>

   </template>
     <button  @click="inspect()">Inspect Element Data</button >

   <button  @click="move()">Copy btn 1 to btn 2</button >
</template>

Comment: As per the code in my question, your answer is a solution so I have marked it as correct. Sadly, though, in the real world my project is far more complex and after much restructuring I still have the same problem. I guess this is one potential pitfall of a 'minimum reproducible example' - I have created a simpler illness with the same symptoms but a different cause :( - I will come back here later if/when I solve it.
Comment: @quilkin I did notice that in your example, when using `localTest` the `v-if` was only triggered on creation, whereas with `globalTest`, the `v-if` was also triggered after clicking "copy". Maybe it's related somehow. Good luck finding the root cause.


Casperjs equivalent of var dump

Question: I would like to know whats equivalent of var_dump in casper js ?
Answer: To serialize any var contents as JSON:
var serialized = require('utils').serialize(yourVar);

To directly dump the JSON serialization to the console:
require('utils').dump(yourVar);

Casperjs equivalent of var dump


How should I use fiberglass batts to insulate between floor joists over a stone basement?

Question: I have an old home built on a stone foundation.  The stone foundation is solid, as well as the floor joists. I run a dehumidifier in the basement full time, to keep the air moisture low.  There is never any water in the basement.  The floor is dirt with a covering of gravel. There is currently some fiberglass insulation between the floor joists (installed incorrectly, paper backing facing down), and a foam insulating board nailed to the bottom of the floor joists.
I was advised to flip the fiberglass over, so that the paper backing is facing the living space, instead of facing the basement.  If I am going to do that, should I do anything else with the fiberglass at the same time? Should I put plastic sheeting in? Should I wrap each length of fiberglass in plastic, tape it shut, making a bag of insulation in each floor joist void?
Answer: Buildingscience.com has a decent article that covers a very similar situation with floors over crawlspaces
The two key points with this:

One vapour barrier, so as not to trap moisture. Essentially, drying happens on both sides going in the direction away from the vapour barrier, and if you use two barriers you're trapping moisture which leads to mold and rot.
Condensation happens when warm meets cold. When you're using batt insulation, you want the vapour barrier on the warm side so you're not getting condensation (and thus water) on the insulation.

The situation that most closely matches what you're talking about recommends this:

The rigid foam on the bottom of the joists is your vapor barrier: it must be impermeable and this means that the connections between sheets and around the edges must be sealed too. Even though the vapour barrier is essentially on the outside of the batt insulation, because the foam has an insulating value (unlike 6mil plastic) you don't have warm meeting cold here and won't get the condensation problem.
Comment: I think a distinction needs to be made between flooring On grade (over a slab) and flooring over a basement.  On grade needs the vapor impermeable against the slab.  Against the wall or for overhead floor, foam but not impermeable foam(the foil backed is impermeable) should be used .  XPS foam has SOME permability and allows drying in both directions
Answer: You do want the insulation backing facing up, or removed if you have a good vapor barrier with the foam board and/or flooring. Do not seal the bottom side of the insulation with a vapor barrier since that will trap moisture which can lead to mold and mildew. What you can do is use a house wrap material (e.g. Tyvek) to reduce drafts and any dust/dirt from getting into the insulation. A house wrap, unlike a vapor barrier, allows moisture vapor to pass through.
The risk with the vapor barrier on the non-heated side is that during the winter, warm moist air from your home could travel through the insulation to the cold side where it condenses.
Answer: The latest advice from Building Sciences is for poly against floor, XPS foam against that and then build up from there.
If you are not having moisture problems, your sandwich meets the best thinking of "allow drying in both directions". I would not do any encasing with poly.


I wan to decode this code. How can I do it?


Cannot login (login loop), I tried multiple solutions. + no space left

Question: I use Ubuntu 18.04 LTS with Xfce4. I have a very low-end computer and the storage size is very low, only 60GB. I almost stay at a few 100MB from the limit.
But now, my computer lagged so I forced to reboot, then I got the endless login loop thing. I pressed CTRL+ALT+F3 and I ran the command df -h
I got as result that my disk was full at 100% and I got no byte left.
Then I tried to remove things, I am pretty sure I removed over than 300MB but it still says that I got 0 byte left. I tried it with different users but nothing works.
I tried to change the permissions of .Xauthority .ICEauthority and /tmp but these perms are correct.
Then I tried to install "lxdm" but I couldn't because I don't have the space left.
Please help me, I don't know what to do I cannot use my computer. : /
Thanks in advance.
Comment: Does this answer your question? [Root drive is running out of disk space. How can I free up space?](https://askubuntu.com/questions/57994/root-drive-is-running-out-of-disk-space-how-can-i-free-up-space) and [How to start Ubuntu in Console mode](https://askubuntu.com/q/859630/)
Comment: If you're worried about removing files & not seeing the space being freed, I'd stop using the system asap & switch to a *live* system & `fsck` your disk/partition from there, and do changes there. A lack of space can mean some background jobs are *zombie* waiting for space for them to work, when space is available they'll continue processing & instantly use the space, so when space is that low, it can be a little annoying. Maintain your system & keep say ~1GB safety margin (you'll need more come *release-upgrade* time though)
Comment: What is 04 LTS ?
Comment: If the problem is space, changing permissions of files could just make it worse. A GUI requires space in $HOME (your user directory), and will abort the login & return you to the greeter (no messages, ie. login loop) if insufficient space is required (the GUI couldn't start), but that won't stop your text terminals from logging in to explore & create some space. Login via terminal & check you have space in $HOME (/home/$USER) and don't try and install anything when space is limited (it risks corrupted files due to space & makes issues worse)
Comment: @guiverc Sorry, I misspell I meant Ubuntu 18.04 LTS instead. But interesting fact to know!
Comment: @guiverc Also I tried to do that but as I said I removed hundreds of megabytes and it still says that 0 bytes left. I don't understand that, because the files are not put into trash in these cases.
Comment: @SorenA Sorry, I misspell I meant Ubuntu 18.04 LTS instead. But interesting fact to know!
Comment: @karel I will look after your first link, but I removed space and ran commands similar as these ones (apt clean, etc) but it doesn't change the number and stays at 0  bytes left
Comment: @guiverc Yeah I think I learnt a lesson here. What is fsck? Also, do you think Snap stuff have a link with zombie processes? I was trying to create a snap package before it failed. And snap is also always slowing down the startup and poweroff of the computer.So I start to get somewhat suspicious about it...
Comment: `fsck` is the *file-system check* command which checks for, and fixes any logical errors on your file-system. FYI: I have a 27GB / partition, and my /home is 31GB (though I store most my files on network storage & not locally) so 60GB is fine, but you still need to watch for space issues (I know that from experience)
Comment: Let us [continue this discussion in chat](https://chat.stackexchange.com/rooms/111574/discussion-between-chopin-and-guiverc).
Comment: Sorry I'm accessing the site via Ubuntu SSO & thus not logged into SE itself. Chat is a Stack Exchange service I cannot access via Ubuntu.
Comment: @guiverc Sorry, I am not using askubuntu often so I just clicked on the link... About fsck : I can't run it logged in right? I need to run it with another medium?
Comment: Most file-systems are best if they are checked (`fsck`) whilst umounted.. which is why I suggested a *live* system (your disk file-systems won't be used).  I wouldn't expect problems (I suspect it's zombie/tasks waiting for disk space to be free so they can continue, log entries of out-of-disk-space warnings being written/queued to be written etc) but if it's not - unexpected reducing disk space can be a warning sign telling you to `fsck` asap.
Comment: @guiverc Unfortuately I cannot do it using a live disk. My USB is not recognized in the BIOS. I already got something like that in the past but here It requires a password to access to the BIOS, and I forgot it :/
Comment: You can install/clone an ISO to a partition on your hdd/ssd, so `grub` will let you select and boot it from `grub`, likewise use another installed system you boot, but to `chroot` to another system isn't easy, and you still need another system to `chroot` into. Your issue though is space, so use the text terminal to fix that, and `touch /forcefsck` to force your system to `fsck` next boot.
Answer: About what was taking the storage, it was the data from the snap package "multipass" which I removed, but the data was still there. 10GB of data for a package I never used! I don't understand where it's coming from xD
To solve the issue tho, it wasn't just the "0 byte left" that was creating the login loop. I don't know the source of this issue. But I simply backup everything and install Xubuntu instead.
Thanks to everybody who answered, these are still interesting things to know : )


where I can post my request to no removal qt3 libraries from next ubuntu releases?

Question: I know that ubuntu takes 'debian sid' packages to bake next ubuntu and I know that Debian developers currently obsoletes qt3-libraries. Unfortunately I'm still need it because in my company we still use qt3 libraries for our project.
Answer: Qt3 is really old and you should have moved to Qt4 a long while ago. It isn't maintained upstream anymore, so you cannot expect Linux distributions to just maintain it for you.
From here:

Trolltech will continue to support the Qt 3 series until July 1st 2007.

And besides, in Quantal Qt3 is already removed, so you're way too late to start a discussion about the Qt3 removal.
I suggest to put your efforts on either of the options below.

Port your application to Qt4 or even Qt5 (longer term)
Maintain a PPA with the Qt3 libraries your own and tell your users to enable that PPA first.
Move to RHEL. Red Hat supports a release for 10+ years. See their lifecycle document mentioning

Red Hat Enterprise Linux 5 and 6 are offered with 10 years of Production Phase support, followed by a three year Extended Life Phase.

However, I'm not sure if Qt is one of their core packages included in this; Red Hat is a GTK company.
Live with the fact the product doesn't run on newer distribution versions anymore.
Comment: Thanks for info.... and I know that is old and we starts some time ago porting our application to qt4 but this is huge application and secondly we have to maintain production releases which is based on qt3. And it will be maintained for a very long time (10 years or later) so in a commercial world is not easy 'just remove' 'obsolete' packages... So its a pity that is too late...
Comment: If you need to maintain something for 10 years, then you can't do that with Ubuntu anyway (only 5 years in LTS). You and your customers should realize that the world changes. The only OS I know to support 10+ years is RHEL. See [their lifecycle document](https://access.redhat.com/support/policy/updates/errata/).
Comment: Thanks! Currently we use also CentOS, maybe ubuntu extends support for LTS like Microsoft for Windows XP. :-)


My tkinter window isn't showing everything it should

Question: I wrote this code and it makes the window I'm trying to create just fine:
import math
import tkinter as tk
from tkinter import ttk
from ttkthemes import ThemedStyle

radValue = ""

def submit():
    rangeWin.destroy()

rangeWin = tk.Tk()
rangeWin.title("Range Calculator")
style = ThemedStyle(rangeWin)
style.theme_use("equilux")
bg = style.lookup('TLabel', 'background')
fg = style.lookup('TLabel', 'foreground')
rangeWin.configure(bg=style.lookup('TLabel', 'background'))
upperFrame = ttk.Frame(master=rangeWin)
lowerFrame = ttk.Frame(master=rangeWin)
underFrame = ttk.Frame(master=rangeWin)

frame1_1 = ttk.Frame(master=upperFrame)
frame1_2 = ttk.Frame(master=upperFrame)
frame2_1 = ttk.Frame(master=upperFrame)
frame2_2 = ttk.Frame(master=upperFrame)
frame3_1 = ttk.Frame(master=upperFrame)
frame3_2 = ttk.Frame(master=upperFrame)
frameList = [frame1_1, frame1_2, frame2_1, frame2_2, frame3_1, frame3_2]

upperFrame.grid(row=0, column=0, sticky="w")
lowerFrame.grid(row=1, column=0, sticky="w")
underFrame.grid(row=2, column=0, pady=8)
frRow = 0
frCol = 0
for fr in frameList:
    fr.grid(row=frRow, column = frCol, padx=5, pady=5, sticky="w")
    frCol += 1
    if frCol == 2:
        frCol = 0
        frRow += 1

lblName = ttk.Label(master=frame1_1, text="Name")
entName = ttk.Entry(master=frame1_1, width=10)
lblName.grid(row=0, column=0, sticky="w")
entName.grid(row=0, column=1, sticky="e")

lblHP = ttk.Label(master=frame1_2, text="HP")
entHP = ttk.Entry(master=frame1_2, width=8)
lblHP.grid(row=0, column=0, sticky="w")
entHP.grid(row=0, column=1, sticky="e")

lblCoord = ttk.Label(master=frame2_1, text="Coordinate")
entXCoord = ttk.Entry(master=frame2_1, width=2)
lblX = ttk.Label(master=frame2_1, text="X")
entYCoord = ttk.Entry(master=frame2_1, width=2)
lblY = ttk.Label(master=frame2_1, text="Y")
entZCoord = ttk.Entry(master=frame2_1, width=2)
lblZ = ttk.Label(master=frame2_1, text="Z")
lblCoord.grid(row=0, column=0, sticky="w")
entXCoord.grid(row=0, column=1, sticky="e")
lblX.grid(row=0, column=2, sticky="e")
entYCoord.grid(row=0, column=3, sticky="e")
lblY.grid(row=0, column=4, sticky="e")
entZCoord.grid(row=0, column=5, sticky="e")
lblZ.grid(row=0, column=6, sticky="e")

lblHeight = ttk.Label(master=frame2_2, text="Height (Blocks)")
entHeight = ttk.Entry(master=frame2_2, width=8)
lblHeight.grid(row=0, column=0, sticky="w")
entHeight.grid(row=0, column=1, sticky="e")

frameSizeLeft = ttk.Frame(master=frame3_1)
frameSizeRight = ttk.Frame(master=frame3_1)
lblSize = ttk.Label(master=frame3_1, text="Size Class")
rbnTiny = ttk.Radiobutton(master=frameSizeLeft, text="Tiny", variable= radValue, value="Tiny")
rbnSmall = ttk.Radiobutton(master=frameSizeRight, text="Small", variable= radValue, value="Small")
rbnMedium = ttk.Radiobutton(master=frameSizeLeft, text="Medium", variable= radValue, value="Medium")
rbnLarge = ttk.Radiobutton(master=frameSizeRight, text="Large", variable= radValue, value="Large")
rbnHuge = ttk.Radiobutton(master=frameSizeLeft, text="Huge", variable= radValue, value="Huge")
rbnGargantuan = ttk.Radiobutton(master=frameSizeRight, text="Gargantuan", variable= radValue, value="Gargantuan")
lblSize.grid(row=0, column=0)
frameSizeLeft.grid(row=1, column=0)
frameSizeRight.grid(row=1, column=1)
rbnTiny.grid(row=0, column=0, sticky="w")
rbnSmall.grid(row=0, column=0, sticky="w")
rbnMedium.grid(row=1, column=0, sticky="w")
rbnLarge.grid(row=1, column=0, sticky="w")
rbnHuge.grid(row=2, column=0, sticky="w")
rbnGargantuan.grid(row=2, column=0, sticky="w")

lblNotes = ttk.Label(master=lowerFrame, text="Notes")
txtNotes = tk.Text(master=lowerFrame)
lblNotes.grid(row=0, column=0)
txtNotes.grid(row=1, column=0, sticky="w")

btnSubmit = ttk.Button(master=underFrame, command=submit, text="Submit")
btnSubmit.grid(row=0, column=0)

rangeWin.mainloop()

Which looks like this:
Pop-up window
The problem is that when I try to turn this code into a pop-up window, it doesn't show everything I defined. This is the main that calls the window:
from rangeCalculator import RangeCalculator
import tkinter as tk
from tkinter import ttk
from ttkthemes import ThemedStyle

window = tk.Tk()
window.title("BattleTracker")
#window.geometry("200x200")
style = ThemedStyle(window)
style.theme_use("equilux")
bg = style.lookup('TLabel', 'background')
fg = style.lookup('TLabel', 'foreground')
window.configure(bg=style.lookup('TLabel', 'background'))
newChar = RangeCalculator(window)

lblGreeting = ttk.Label(master=window, text="Welcome to the BattleTracker")
lblGreeting.grid(row=0, column=0)
btnOpen = ttk.Button(master=window, text="Input Stats")
btnOpen.bind("<Button>", lambda e: newChar.generateWindow())
btnOpen.grid(row=1, column=0)

window.mainloop()

And this is the program as the pop-up window:
import math
import tkinter as tk
from tkinter import ttk
from ttkthemes import ThemedStyle

class RangeCalculator:
    def __init__(self, win = None):
        self.win = win
        radValue = ""
        stats = {}

    def generateWindow(self):
        rangeWin = tk.Toplevel(master=self.win)
        rangeWin.title("Range Calculator")
        style = ThemedStyle(rangeWin)
        style.theme_use("equilux")
        bg = style.lookup('TLabel', 'background')
        fg = style.lookup('TLabel', 'foreground')
        rangeWin.configure(bg=style.lookup('TLabel', 'background'))
        upperFrame = ttk.Frame(master=rangeWin)
        lowerFrame = ttk.Frame(master=rangeWin)
        underFrame = ttk.Frame(master=rangeWin)

        frame1_1 = ttk.Frame(master=upperFrame)
        frame1_2 = ttk.Frame(master=upperFrame)
        frame2_1 = ttk.Frame(master=upperFrame)
        frame2_2 = ttk.Frame(master=upperFrame)
        frame3_1 = ttk.Frame(master=upperFrame)
        frame3_2 = ttk.Frame(master=upperFrame)
        frameList = [frame1_1, frame1_2, frame2_1, frame2_2, frame3_1, frame3_2]

        upperFrame.grid(row=0, column=0, sticky="w")
        lowerFrame.grid(row=1, column=0, sticky="w")
        underFrame.grid(row=2, column=0, pady=8)
        frRow = 0
        frCol = 0
        for fr in frameList:
            fr.grid(row=frRow, column = frCol, padx=5, pady=5, sticky="w")
            frCol += 1
            if frCol == 2:
                frCol = 0
                frRow += 1

        lblName = ttk.Label(master=frame1_1, text="Name")
        entName = ttk.Entry(master=frame1_1, width=10)
        lblName.grid(row=0, column=0, sticky="w")
        entName.grid(row=0, column=1, sticky="e")

        lblHP = ttk.Label(master=frame1_2, text="HP")
        entHP = ttk.Entry(master=frame1_2, width=8)
        lblHP.grid(row=0, column=0, sticky="w")
        entHP.grid(row=0, column=1, sticky="e")

        lblCoord = ttk.Label(master=frame2_1, text="Coordinate")
        entXCoord = ttk.Entry(master=frame2_1, width=2)
        lblX = ttk.Label(master=frame2_1, text="X")
        entYCoord = ttk.Entry(master=frame2_1, width=2)
        lblY = ttk.Label(master=frame2_1, text="Y")
        entZCoord = ttk.Entry(master=frame2_1, width=2)
        lblZ = ttk.Label(master=frame2_1, text="Z")
        lblCoord.grid(row=0, column=0, sticky="w")
        entXCoord.grid(row=0, column=1, sticky="e")
        lblX.grid(row=0, column=2, sticky="e")
        entYCoord.grid(row=0, column=3, sticky="e")
        lblY.grid(row=0, column=4, sticky="e")
        entZCoord.grid(row=0, column=5, sticky="e")
        lblZ.grid(row=0, column=6, sticky="e")

        lblHeight = ttk.Label(master=frame2_2, text="Height (Blocks)")
        entHeight = ttk.Entry(master=frame2_2, width=8)
        lblHeight.grid(row=0, column=0, sticky="w")
        entHeight.grid(row=0, column=1, sticky="e")

        frameSizeLeft = ttk.Frame(master=frame3_1)
        frameSizeRight = ttk.Frame(master=frame3_1)
        lblSize = ttk.Label(master=frame3_1, text="Size Class")
        rbnTiny = ttk.Radiobutton(master=frameSizeLeft, text="Tiny", variable= radValue, value="Tiny")
        rbnSmall = ttk.Radiobutton(master=frameSizeRight, text="Small", variable= radValue, value="Small")
        rbnMedium = ttk.Radiobutton(master=frameSizeLeft, text="Medium", variable= radValue, value="Medium")
        rbnLarge = ttk.Radiobutton(master=frameSizeRight, text="Large", variable= radValue, value="Large")
        rbnHuge = ttk.Radiobutton(master=frameSizeLeft, text="Huge", variable= radValue, value="Huge")
        rbnGargantuan = ttk.Radiobutton(master=frameSizeRight, text="Gargantuan", variable= radValue, value="Gargantuan")
        lblSize.grid(row=0, column=0)
        frameSizeLeft.grid(row=1, column=0)
        frameSizeRight.grid(row=1, column=1)
        rbnTiny.grid(row=0, column=0, sticky="w")
        rbnSmall.grid(row=0, column=0, sticky="w")
        rbnMedium.grid(row=1, column=0, sticky="w")
        rbnLarge.grid(row=1, column=0, sticky="w")
        rbnHuge.grid(row=2, column=0, sticky="w")
        rbnGargantuan.grid(row=2, column=0, sticky="w")

        lblNotes = ttk.Label(master=lowerFrame, text="Notes")
        txtNotes = tk.Text(master=lowerFrame)
        lblNotes.grid(row=0, column=0)
        txtNotes.grid(row=1, column=0, sticky="w")

        btnSubmit = ttk.Button(master=underFrame, command=submit, text="Submit")
        btnSubmit.grid(row=0, column=0)

    def collectStats():
        stats = {
            "name": entName.get(),
            "hP": entHP.get(),
            "coordinate": [entXCoord.get(), entYCoord.get(), entZCoord.get()],
            "height": entHeight.get(),
            "size": radValue,
            "notes": txtNotes.get(1.0, tk.END)
        }

    def submit():
        rangeWin.destroy()

I've tried to find an answer to this all over the internet, but I haven't found anything. I'm still fairly new to Python and very new to tkinter.
Comment: You know that in your `collectStats` method you are missing the `self` argument and most variables there aren't defined.
Comment: I'm still trying to figure that one out. Every time I try to use self, I get a NameError.
Comment: When you define all of the widgets that you will later use, do this: `self. = tk.(...)` so basically change `entXCoord = ttk.Entry(...)` and `entXCoord.grid(...)` to `self.entXCoord = ttk.Entry(...)` and `self.entXCoord.grid(...)`. Btw this isn't going to fix the window problem
Comment: So you know how when you ask a question, the answer generally hits you right after you ask? Not using self is exactly what the problem was. Thank you for your help. You got me on track. I'll post the fixed code for anyone else who might run into this.
Comment: I didn't even think it would help with your original problem :D. I recommend you look at [this](https://www.w3schools.com/python/python_classes.asp) tutorial.
Answer: After being shown how to use self correctly, I figured out what was wrong with the code. I'm putting the fixed code here for anyone else who might run into this.
Summarized Fix:
class RangeCalculator:
    ...
    def generateWindow(self):
        ...
        # The radValue needed self prepended to it.
        rbnTiny = ttk.Radiobutton(master=frameSizeLeft, text="Tiny", variable= self.radValue, value="Tiny")
        rbnSmall = ttk.Radiobutton(master=frameSizeRight, text="Small", variable= self.radValue, value="Small")
        rbnMedium = ttk.Radiobutton(master=frameSizeLeft, text="Medium", variable= self.radValue, value="Medium")
        rbnLarge = ttk.Radiobutton(master=frameSizeRight, text="Large", variable= self.radValue, value="Large")
        rbnHuge = ttk.Radiobutton(master=frameSizeLeft, text="Huge", variable= self.radValue, value="Huge")
        rbnGargantuan = ttk.Radiobutton(master=frameSizeRight, text="Gargantuan", variable= self.radValue, value="Gargantuan")
        ...

    # This also needed self to be implemented.
    def collectStats(self):
        stats = {
            "name": self.entName.get(),
            "hP": self.entHP.get(),
            "coordinate": [self.entXCoord.get(), self.entYCoord.get(), self.entZCoord.get()],
            "height": self.entHeight.get(),
            "size": self.radValue,
            "notes": self.txtNotes.get(1.0, tk.END)
        }

If anyone would like to see the full program, here it is:
import math
import tkinter as tk
from tkinter import ttk
from ttkthemes import ThemedStyle

class RangeCalculator:
    def __init__(self, win = None):
        self.win = win
        self.radValue = ""
        self.stats = {}

    def generateWindow(self):
        rangeWin = tk.Toplevel(master=self.win)
        rangeWin.title("Range Calculator")
        style = ThemedStyle(rangeWin)
        style.theme_use("equilux")
        bg = style.lookup('TLabel', 'background')
        fg = style.lookup('TLabel', 'foreground')
        rangeWin.configure(bg=style.lookup('TLabel', 'background'))
        upperFrame = ttk.Frame(master=rangeWin)
        lowerFrame = ttk.Frame(master=rangeWin)
        underFrame = ttk.Frame(master=rangeWin)

        frame1_1 = ttk.Frame(master=upperFrame)
        frame1_2 = ttk.Frame(master=upperFrame)
        frame2_1 = ttk.Frame(master=upperFrame)
        frame2_2 = ttk.Frame(master=upperFrame)
        frame3_1 = ttk.Frame(master=upperFrame)
        frame3_2 = ttk.Frame(master=upperFrame)
        frameList = [frame1_1, frame1_2, frame2_1, frame2_2, frame3_1, frame3_2]

        upperFrame.grid(row=0, column=0, sticky="w")
        lowerFrame.grid(row=1, column=0, sticky="w")
        underFrame.grid(row=2, column=0, pady=8)
        frRow = 0
        frCol = 0
        for fr in frameList:
            fr.grid(row=frRow, column = frCol, padx=5, pady=5, sticky="w")
            frCol += 1
            if frCol == 2:
                frCol = 0
                frRow += 1

        lblName = ttk.Label(master=frame1_1, text="Name")
        entName = ttk.Entry(master=frame1_1, width=10)
        lblName.grid(row=0, column=0, sticky="w")
        entName.grid(row=0, column=1, sticky="e")

        lblHP = ttk.Label(master=frame1_2, text="HP")
        entHP = ttk.Entry(master=frame1_2, width=8)
        lblHP.grid(row=0, column=0, sticky="w")
        entHP.grid(row=0, column=1, sticky="e")

        lblCoord = ttk.Label(master=frame2_1, text="Coordinate")
        entXCoord = ttk.Entry(master=frame2_1, width=2)
        lblX = ttk.Label(master=frame2_1, text="X")
        entYCoord = ttk.Entry(master=frame2_1, width=2)
        lblY = ttk.Label(master=frame2_1, text="Y")
        entZCoord = ttk.Entry(master=frame2_1, width=2)
        lblZ = ttk.Label(master=frame2_1, text="Z")
        lblCoord.grid(row=0, column=0, sticky="w")
        entXCoord.grid(row=0, column=1, sticky="e")
        lblX.grid(row=0, column=2, sticky="e")
        entYCoord.grid(row=0, column=3, sticky="e")
        lblY.grid(row=0, column=4, sticky="e")
        entZCoord.grid(row=0, column=5, sticky="e")
        lblZ.grid(row=0, column=6, sticky="e")

        lblHeight = ttk.Label(master=frame2_2, text="Height (Blocks)")
        entHeight = ttk.Entry(master=frame2_2, width=8)
        lblHeight.grid(row=0, column=0, sticky="w")
        entHeight.grid(row=0, column=1, sticky="e")

        frameSizeLeft = ttk.Frame(master=frame3_1)
        frameSizeRight = ttk.Frame(master=frame3_1)
        lblSize = ttk.Label(master=frame3_1, text="Size Class")

        # This is what was causing the window to only show up to this point
        # The radValue needed self prepended to it

        rbnTiny = ttk.Radiobutton(master=frameSizeLeft, text="Tiny", variable= self.radValue, value="Tiny")
        rbnSmall = ttk.Radiobutton(master=frameSizeRight, text="Small", variable= self.radValue, value="Small")
        rbnMedium = ttk.Radiobutton(master=frameSizeLeft, text="Medium", variable= self.radValue, value="Medium")
        rbnLarge = ttk.Radiobutton(master=frameSizeRight, text="Large", variable= self.radValue, value="Large")
        rbnHuge = ttk.Radiobutton(master=frameSizeLeft, text="Huge", variable= self.radValue, value="Huge")
        rbnGargantuan = ttk.Radiobutton(master=frameSizeRight, text="Gargantuan", variable= self.radValue, value="Gargantuan")
        lblSize.grid(row=0, column=0)
        frameSizeLeft.grid(row=1, column=0)
        frameSizeRight.grid(row=1, column=1)
        rbnTiny.grid(row=0, column=0, sticky="w")
        rbnSmall.grid(row=0, column=0, sticky="w")
        rbnMedium.grid(row=1, column=0, sticky="w")
        rbnLarge.grid(row=1, column=0, sticky="w")
        rbnHuge.grid(row=2, column=0, sticky="w")
        rbnGargantuan.grid(row=2, column=0, sticky="w")

        lblNotes = ttk.Label(master=lowerFrame, text="Notes")
        txtNotes = tk.Text(master=lowerFrame)
        lblNotes.grid(row=0, column=0)
        txtNotes.grid(row=1, column=0, sticky="w")

        btnSubmit = ttk.Button(master=underFrame, command=self.submit, text="Submit")
        btnSubmit.grid(row=0, column=0)

    # Passed in self
    def collectStats(self):
        stats = {
            "name": self.entName.get(),
            "hP": self.entHP.get(),
            "coordinate": [self.entXCoord.get(), self.entYCoord.get(), self.entZCoord.get()],
            "height": self.entHeight.get(),
            "size": self.radValue,
            "notes": self.txtNotes.get(1.0, tk.END)
        }

    def submit():
        rangeWin.destroy()

Comment: Anyone having this problem wouldn't go through these many lines of code, just post a summary of the fix on top of the answer too.
Comment: No problem. Hope this helps.


Vaadin 14 disable text inline editing in a combobox component

Question: I am using a combobox in a webapp with Vaadin 14. When the user clicks into the textfield, he can enter text.
I do not want that. The values of the combobox itself should not be editable, but the user should still be able to select the predefined values.
This is the standard behaviour of these components.
How to do that in Vaadin 14.6.8?
Answer: The standard behavior of a ComboBox is that you can both type and select – thus the "combo".
I believe you are looking for the Select component: https://vaadin.com/docs/v14/ds/components/select
Answer: The solution I found on the internet (on the feature request site):
<code>cb.getElement().setAttribute("onkeydown", "return false");
</code>
It works partially, the cursor keeps blinking in the textfield, but custom user input is disabled.


$I_n=\frac{1}{\pi}-\frac{n(n-1)}{\pi^2}I_{n-2}$

Question: I have to calculate $I_n=\int_0^1 x^n \sin{(\pi x)} dx$.
By double partial integration I got $I_n=\frac{1}{\pi}-\frac{n(n-1)}{\pi^2}I_{n-2}$ and $I_0=\frac{2}{\pi}$, $I_1=\frac{1}{\pi}$.
How to solve this recurrence, in order to find $\lim_{n\to\infty} I_n$ and to deduce convergence of $\sum_{n=1}^\infty I_n$?
Any help is welcome. Thanks in advance.
Comment: How about
$
\sum_{n=1}^\infty \int_0^1 x^n\sin\pi xdx=\int_0^1 \frac{\sin \pi x}{1-x}dx
$?
Comment: @MostafaAyaz I'm loking for more simple solution, without using theorem that states when is it possible to exchange $\int$ and $\sum$.
Comment: @alans Do you know the limit comparison test for series. that is what i used.
Comment: $\;\sum\limits_{n=1}^\infty I_n=\text{Si}(\pi)-\dfrac2\pi\;$

and as far as I know there is not a simplier  way to write the sum of your series.
Comment: Please avoid titles that are made up entirely of MathJax; it prevents some navigation shortcuts.
Answer: $$(\forall n\in \Bbb N)\;\;\big|I_n\big|=\left|\int_0^1x^n\sin(\pi x)dx\right|$$
$$\le \int_0^1\big|x^n\sin(\pi x)\big|dx$$
$$\le \int_0^1x^ndx=\frac{1}{n+1}$$
$$\implies \lim_{n\to+\infty}I_n=0$$
The recursive relation you got by double partial integration, can also be written as
$$\boxed{I_{n+2}\pi^2=\color{red}{\pi}-(n+2)(n+1)I_n.}$$
$$\lim_{n\to+\infty}I_{n+2}=0\implies$$
$$\implies \lim_{n\to+\infty}(n+2)(n+1)I_n=\color{red}{\pi}$$
$$\implies I_n\sim \frac{\pi}{(n+2)(n+1)}\sim \frac{\pi}{n^2}$$
$$\implies \sum I_n \text{ converges}$$
Answer: $\;\sum\limits_{n=1}^\infty I_n=\text{Si}(\pi)-\dfrac2\pi\;$
and as far as I know there is not a simplier  way to write the sum of your series.