I want to know if the way I'm escaping quotes is the best or if it can be enhanced.  Visitors can submit text which is stored in database and then displayed in another page. Simple enough. I use  to store in a database:  $sql = "INSERT INTO inscriptions (             name,             surname,             comments             )             VALUES (                 :name,                 :surname,                 :comments             )";       $req = $db->prepare($sql);  $req->execute(array(     ':name' => $name,     ':surname' => $surname,     ':comments' => $comments ));   This, I got it, it's the following part that cause me questionning:  Then to display it, I use htmlentities to prevent quotes and javascript to interfer with the code. I also use array_walk_recursive (or array_map depending on the case) to automise the escaping.  <?php function escaped(&$item) {     $item = htmlentities($item); }  $sql = "SELECT *         FROM master_table"; $req->execute();  $req = $db->prepare($sql); while($row=$req->fetch()){     array_walk_recursive($row, 'escaped'); ?>
<?php echo $row["comments"]; ?>
     <form action="supp.php" method="post" onsubmit="return confirm('Do you want to delete <?php echo $row["surname"].' '.$row["name"]; ?> comment ?')">         <input type="hidden" value="<?php echo $row["id"]; ?>" name="idcom" />         <input type="image" alt="Delete" src="trash.png"/>     </form>     <?php } ?>   (This code is used to delete a comment with an alert before doing so, hence the importance of escaping because the name is used in the alert)  This code works fine, but I wanna if I'm doing escaping the right and secure way.  If something seems unclear in my post, please comment it so I can modify it.  Thanks !  Edit: Not asking about SQL Injection but Javascript,  tag and quotes users could put on a field.

If user input is inserted without modification into an SQL query, then the application becomes vulnerable to , like in the following example:  $unsafe_variable = $_POST['user_input'];   mysql_query("INSERT INTO `table` (`column`) VALUES ('$unsafe_variable')");   That's because the user can input something like value'); DROP TABLE table;--, and the query becomes:  INSERT INTO `table` (`column`) VALUES('value'); DROP TABLE table;--')   What can be done to prevent this from happening?


while I was refactoring my code, I got a System.StackOverflowException thrown by my get method when my view try to access a member of my class.  That's the first time that I'm using the ?? (null-coalescing operator) in c#.  That's my model:  using System; using System.ComponentModel.DataAnnotations;  namespace Extranet45.Models {     public class Complaint     {         public string Nome         {             get => Nome ?? "Nome não informado.";             private set => Nome = value ?? "Nome não informado.";         }         public string Email         {             get => Email ?? "Email não informado.";             private set => Email = value ?? "Email não informado.";         }         [Required(ErrorMessage = "A denuncia não possui o texto obrigatório do seu conteúdo. (Corpo da Mensagem)")]         public string Denuncia         {             get => Denuncia ?? "O texto da denuncia não foi encontrado.";             private set => Denuncia = value ?? throw new ArgumentNullException("O campo denúncia é obrigatório.");         }         public Complaint() { }          public Complaint(string nome, string email, string denuncia)         {             Nome = nome;             Email = email;             Denuncia = denuncia;         }     } }   That's my controller/action:  using System; using System.Web.Mvc; using Extranet45.Models; using Utils;  namespace Extranet45.Controllers {     public class ComplaintController : Controller     {         public ActionResult Index()         {             return RedirectToAction("Send");         }          // GET: Complaint/Send         public ActionResult Send()         {              return View(new Complaint());         }     } }   That's the part of my view where the exception is raised.  @model Extranet45.Models.Complaint  @{      Layout = "~/Views/Shared/_Layout.cshtml";     ViewBag.Title = "Denúncia";     ViewBag.ShowHeader = false;     ViewBag.BodyClass = "profile-page"; //Faz com que o header fique com a altura menor, porém ñão é uma solução elegante, refatorar     ViewBag.HeaderImageUrl = "https://github.com/creativetimofficial/material-kit/blob/master/assets/img/city-profile.jpg?raw=true";  }  @using (Html.BeginForm("Send", "Complaint", FormMethod.Post, new { @Class = "contact-form"})) {

             @ViewBag.ErrorMessage
Denuncie

Caso você tenha alguma reclamação ou precise comunicar algo incorreto ao Ceape, nos envie uma mensagem abaixo ou um email para denuncias@@ceapema.org.br

                         Nome - Opcional                         @Html.TextBoxFor(m => m.Nome, new { @id = "textbox-nome", @Type = "Text", @Class = "form-control", name = "nome" })

   More precisely at this line, when the view try to access the member m.Nome  @Html.TextBoxFor(m => m.Nome, new { @id = "textbox-nome", @Type = "Text", @Class = "form-control", name = "nome" })   I don't know why my usage of null coalescing operator is causing an stack overflow.

I know java and would normally put in getter/setter methods. I am interested in doing it in C# with the following code, but it throws a StackOverflow exception. What am I doing wrong?  Calling Code  c.firstName = "a";   Property Code    public String firstName; {     get     {         return firstName;     }     set     {         firstName = value;     } }


I am trying to solve this problem but nothing is thought on my mind. Please any one help me to solve this problem  $\sqrt{x + \sqrt {x + \sqrt{ x + \cdots } } } = 5$ then find the value of $x$.

(Fitzpatrick Advanced Calculus 2e, Sec. 2.4 #12)  For $c \gt 0$, consider the quadratic equation $x^2 - x - c = 0, x > 0$.  Define the sequence $\{x_n\}$ recursively by fixing $|x_1| \lt c$ and then, if $n$ is an index for which $x_n$ has been defined, defining  $$x_{n+1} = \sqrt{c+x_n}$$  Prove that the sequence $\{x_n\}$ converges monotonically to the solution of the above equation.  Note: The answers below might assume $x_1 \gt 0$, but they still work, as we have $x_3 \gt 0$.    This is being repurposed in an effort to cut down on duplicates, see here: .  and here: .


Suppose I have a very simple function: def myFunction(arg1, arg2):     return arg1, arg2  Now if I only want to access the second argument, can do I something like: none, arg2 = myFunction(arg1, arg2)  ?

Say I have a Python function that returns multiple values in a tuple:  def func():     return 1, 2   Is there a nice way to ignore one of the results rather than just assigning to a temporary variable? Say if I was only interested in the first value, is there a better way than this:  x, temp = func()


Believeing I was in another directory I accidentally ran the following command on the root:  sudo chown -R j:root /   My username is j  Unfortunately because of this I am unable to run any sudo commands and undo my mistake, as the server can no longer access the sudo file. I am also unable to login via SSH as the file that controls that is also inaccessible!  I have physical access to the device - Is there a way to undo my mistake?

I accidently ran  sudo chmod 755 -R /   instead of  sudo chmod 755 -R ./   I stopped it after few seconds, but now there is some problems such as  sudo: must be setuid root   How can I revert permissions back?


I've been trying to append file.bak into file.php using this command:  sed r file.php file.bak   It gives correct output as desired. However, it doesn't save that appended file.bak into file.php.  Any idea how to get it done?

I have been trying to insert a file as the first line of another with following SED command, without much success. Each time the file is inserted after line 1. Is there a switch that will inserted before line 1?  sed -i '1r file1.txt' file2.txt   Thanks in advance.


I have  which the android version is 4.2. After read some articles about Kitkat, I'm really excited and want to try to experience it on my phone. However, it seems the manufacturer won't update it to Kitkat in the future. So I think I'll do it my own. I understand and accept the risks.  So, what should I do now? I read some articles about this but can't make a check list of things to do. Will it be  or I can re-use the old kernel? How can I extract the old driver?  If someone can provide me a guide or a check list, it will help me so much! Any idea will be appreciated!

This Community Wiki question is designed to be the "canonical question" for questions asking how to upgrade one's device to a new Android version.   I want to get a newer version of the OS for my Android device. How can I do that?  See also:


How do I remove a Stack Exchange account from my profile?  Suppose I added an account that I now want to remove. How do I do that?

How can I delete my Stack Exchange account(s)? Also,  What happens to my content? Can I request it be deleted as well? What if I'm suspended, rate-limited, or banned from posting questions or answers? What will happen to my votes? Will other users be impacted? Why wasn't my account deleted immediately after the timer expiring? What will happen to my pending bounties and close, reopen, delete, or undelete votes? I want my account deleted on all Stack Exchange sites. How do I do this? Will my profile on chat be removed once I delete my site account?   For more information, see "" in the .


In Matthew Schwartz's textbook, Quantum Field Theory and the Standard Model, equation 14.68 on page 266 says the following:  $$f(\infty)+f(-\infty)=\lim_{\varepsilon\rightarrow0^+}\varepsilon\int_{-\infty}^{\infty}dtf(t)e^{-\varepsilon|t|}.\tag{14.68}$$  The only constraint stipulated in the text is that $f(\tau)$ must be a smooth function. Can anyone help me to prove this expression? When I try to evaluate the right side by bringing the limit and the $\varepsilon$ inside the integral, I find that the right side is equal to zero. I've tried using Dirac delta function identities to prove this, but I've had no luck.

In Weinberg's book The Quantum Theory of Fields, Volume 1 on p.388 (Chapter 9), the following identity is used (with $f$ being any "reasonable" function):  $$f(+\infty) + f(-\infty) = \lim_{\epsilon \rightarrow 0^+} \epsilon \int_{-\infty}^{+\infty} d\tau f(\tau) e^{-\epsilon |\tau|}.\tag{9.2.15} $$  I don't understand the identity in a qualitative / heuristic way.


Is there a .NET obfuscation tool present for Linux? Or is there a class which can provide me a functionality of writing a obfuscation tool for byte code?

My product has several components: ASP.NET, Windows Forms App and Windows Service. 95% or so of the code is written in VB.NET.  For Intellectual Property reasons, I need to obfuscate the code, and until now I have been using a version of dotfuscator which is now over 5 years old. I'm thinking it is time to move to a new generation tool. What I'm looking for is a list of requirements which I should consider when searching for a new obfuscator.  What I know I should look for so far:   Serialization/De-serialization. In my current solution, I simply tell the tool not to obfuscate any class data members because the pain of not being able to load data which was previously serialized is simply too big. Integration with Build Process Working with ASP.NET. In the past, I have found this problematic due to changing .dll names (you often have one per page) - which not all tools handle well.


When I add a new mesh, I don't see any primitive options. Ie. being able to adjust the number of vertices etc.   If I create a brand new file then the option to adjust the core mesh primitives is visible in Properties panel. So it appears to be linked to the file I'm working on.   Driving me nuts.

When you add a new object into the blender scene, normally on the tool shelf a window will become available where you can put in the objects size or number of vertices etc.  These options:   For what-ever reason, when I now add an object I am no longer seeing that area where I can alter the measurements. Currently I want to use the Spin function but I need to alter it but I have no way of effecting how the spin operates. Does anyone know what I have done or how to fix it?


I have a database called oss-pwds.kdb located in a folder /keepassx.  This is a password database that I use with the KeePassX software.  I want to allow all members of the "oss" group to open and modify the database, but not to inadvertently delete it.  Here is what I have:  groupadd oss chgrp oss /keepassx chown root /keepassx chown root /keepassx/oss-pwds.kdb chmod 1770 /keepassx chmod 1770 /keepassx/oss-pwds.kdb   At first, it looks like this should work.  However, if I open the database in the KeePassX software, make a change, then try to save it, a .tmp file appears in the /keepassx directory and I get an error upon saving: "File could not be saved. The file could not be removed."  How do I prevent deletion of only the oss-pwds.kdb file but allow deletion of other files in the /keepassx directory such as the .tmp file?

Let's say user has Directory1 and it contains File1 File2 CantBeDeletedFile How to make so the user would never be allowed to delete the CantBeDeletedFile?  If I change the ownership of Directory1 and remove write permissions users wouldn't be able to delete any file. They also wouldn't be able to add new files etc.  I just want to be able to set some files which would never be deleted.  More specific description.  I am creating user profiles. I am creating application launcher files in their Desktop. So I want to set some launcher files (.desktop) and make them so user can only launch them and they couldn't rename nor delete, just launch.  Currently if user owns the directory which contain any file. He can delete.  If there is no generic way for all *nix, it's a Linux and ext4 FS.


I don't know what's wrong in my code  this is my Fragment class  package com.example.gandi.symanlub;   /**  * A simple {@link Fragment} subclass.  */ public class Reminder extends Fragment {      Button btnubah, btnkeluar;     SessionManager session;      View rootview;        @Override     public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {         // Inflate the layout for this fragment         rootview = inflater.inflate(R.layout.fragment_reminder, container, false);          btnkeluar = (Button)rootview.findViewById(R.id.btnlogout);         btnkeluar.setOnClickListener(new View.OnClickListener() {             @Override             public void onClick(View v) {                 session.logoutUser();             }         });          return rootview;      }  }     and this is my SessionManager.java  package com.example.gandi.symanlub;  @SuppressLint("CommitPrefEdits") public class SessionManager {     // Shared Preferences     SharedPreferences pref;      // Editor for Shared preferences     SharedPreferences.Editor editor;      // Context     Context _context;      // Shared pref mode     int PRIVATE_MODE = 0;      // nama sharepreference     private static final String PREF_NAME = "Sesi";      // All Shared Preferences Keys     private static final String IS_LOGIN = "IsLoggedIn";     public static final String KEY_EMAIL = "email";     public static final String KEY_PASS = "pass";        // Constructor     public SessionManager(Context context){         this._context = context;         pref = _context.getSharedPreferences(PREF_NAME, PRIVATE_MODE);         editor = pref.edit();     }      /**      * Create login session      * */     public void createLoginSession(String email, String pass){         // Storing login value as TRUE         editor.putBoolean(IS_LOGIN, true);          editor.putString(KEY_EMAIL, email);         editor.putString(KEY_PASS, pass);         editor.commit();     }      /**      * Check login method wil check user login status      * If false it will redirect user to login page      * Else won't do anything      * */     public void checkLogin(){         // Check login status         if(!this.isLoggedIn()){             Intent i = new Intent(_context, Login.class);             i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);             i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);             _context.startActivity(i);             //((Activity)_context).finish();         }      }      /**      * Get stored session data      * */     public HashMap<String, String> getUserDetails(){         HashMap<String, String> user = new HashMap<String, String>();          user.put(KEY_EMAIL, pref.getString(KEY_EMAIL, null));         user.put(KEY_PASS, pref.getString(KEY_PASS, null));          return user;     }      /**      * Clear session details      * */     public void logoutUser(){         editor.clear();         editor.commit();     }      public void hapussesi(){         editor.clear();         editor.commit();     }      public boolean isLoggedIn(){         return pref.getBoolean(IS_LOGIN, false);     } }     the error when I run the project :  java.lang.NullPointerException: Attempt to invoke virtual method 'void com.example.gandi.symanlub.SessionManager.logoutUser()' on a null object reference

What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them?  What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?


\documentclass[a4paper,12pt]{article} \usepackage{amsmath,amssymb,cases} \usepackage[margin=2cm]{geometry} \usepackage{mathrsfs} \begin{document} \noindent $\displaystyle \mathcal{M}'= \bigcup_{ \mathcal{F} \subset \mathcal{E} ,\, \mathcal{F} \text{is countable}}\mathcal{F}(\mathcal{F}).$ \end{document}   Its output is:   But I want:

Is there a way to force a line break inside a math mode text?  My example:  \[   \underbrace{....}_\text{Some long text that should be multiline} \]   Trying  \text{Some long text that\\ should be multiline}   Didn't do the trick.


I am using illustrator to make watercolor shapes. I am able to make the shapes with watercolor background.. but they look too flat on the edges. I actually want them to look like these 2 sample sources:    As you can see the ring and star have a nice watercolor esque borders even with roughness. I can create the roughness but I want to actually darken the border for which I'm confused how. I am comfortable with photoshop and illustrator both.

I'm using adobe illustrator and I am putting watercolor effect on my elements. I want it to look like this:   I have added a watercolor background to the element, but then my art looks very plain and flat:     I want to add a thick outline to the art to make it look like the original. Or here are some more examples:


I'd like to obtain one certificate working for all my subdomains *.example.com.  This works:   certbot-auto certonly --webroot --webroot-path /home/www/example/ --domain example.com                                  --domain www.example.com --email certbot@example.com   but this (with  *.):  certbot-auto certonly --webroot --webroot-path /home/www/example/ --domain example.com                                  --domain *.example.com --email certbot@example.com   fails with:     Obtaining a new certificate   Performing the following challenges:   Client with the currently selected authenticator does not support any combination of challenges that will satisfy the CA. You may need to use an authenticator plugin that can do challenges over DNS.     How to use certbot-auto to generate a certificate for *.example.com?

Let's Encrypt has  they have:     Turned on support for the ACME DNS challenge   How do I make ./letsencrypt-auto generate a new certificate using DNS challenge domain validation?  EDIT I mean: How do I avoid http/https port binding, by using the newly announced  feature (2015-01-20) that lets you prove the domain ownership by adding a specific TXT record in the DNS zone of the target domain?


I have tried defining the following kripke model:  $K = ({0,1}, \leq , \models)$   then I define the followings for $A$ and $B$   $0 \nvDash A$ $1 \vDash A$  $ 1 \nvDash B$ $0 \vDash B $  then I say that   $ 1 \nvDash (\neg B \to \neg A) \to A\to B$  Can somebody say how to do it correctly?

this is what I've tried;  define kripke model K=({0,1},≤,⊩) where ≤ is the (total) order relation over {0,1} defined by 0≤0 0≤ 11≤1,and ⊩ is a binary relation from {0,1} to the set of propositional variables such that 0⊮A and 1⊩A and 1⊮B and 0⊩B. then  1⊮(A⊃B)≡(¬B⊃¬A) ( B ⊃ A ) ≡ ( ¬ B ⊃ ¬ A )  can somebody tell me if this is correct or if there are errors, what are they and how can they be corrected?


My cursor moves okay, as commanded by the mouse, but, in MS Word, I can't place an insertion point nor can I drag-select text.  Also, I have to shut down Word using Alt+F4, since shutting down with the X in the upper right corner generates a failure.

I cannot select text with my mouse in Word and Outlook. I can for a little while, then I can't, so, I close and restart the applications again and all is well. This also means that I can't drag anything like text that I have selected with the keyboard or table widths or tabs in the ruler bar...  The cause was unknown until today when I narrowed it down to the Ctrl key.  That is, as soon as I use the Ctrl key (for copy, paste, undo or even by itself for the purpose of this test), my ability to select and drag is gone.  There are no sticky keys. I am using Office 2010 (Professional 14.0.6112.5000 32-bit on Windows 7 Pro SP1).  I have uninstalled and re-installed Office. I have tried several registry edits offered by my findings with no luck.  Any ideas?


I have three features with the same ID, let's say "5". I also have a corresponding text table containing IDs among other info (for example a "category" value). I want to join the table with the features using the ID so that every feature has the same info from the text table. The problem is that only one feature gets joined, and the others are left out. How can I do the join properly?  EDIT: Image for more clarity.   Desired shape attribute result:

I'm trying to create a join/relate in QGIS where I have a shapefile of buildings and to that I would like to join a non-spatial table (.csv-file) containing people who work in each building. So I have multiple records in my table that I would like to be able to join to my single features in my shapefile. I can only run a join in QGIS where the first record is joined to the shapefile feature (ie building) but subsequent records get removed. Could someone let me know how to complete this join/relate in QGIS?


I want to show that if  p | $a^{e}-1$ then also p | $a^{ek}-1$ where k is any integer. Def. of order in terms of divisibility: Let $m ≥ 2$ and a be any integer coprime to $m$. The order of $a$ mod $m$ is the smallest $e > 0$ so that $m$ divides $a^{e}-1$. In terms of congruence I can see why this is the case: e.g. let $a = 2, e = 4, m = 5$. Then $2^{4} ≡ 1 $ (mod $5$), lets scale $e$ with $k=2$, then $2^{4^2} ≡ 1 $ (mod $5$) = $2^{4}2^{4} ≡ 1 $ (mod $5$). So it does not matter what $k$ is, the congruence is still valid. I don't know exactly how to show why the scaling of $e$ with any $k$ does not change the fact that $p$ divides  $a^{e}-1$.

I did some mathematical induction problems on divisibility   $9^n$ $-$ $2^n$ is divisible by 7. $4^n$ $-$ $1$ is divisible by 3. $9^n$ $-$ $4^n$ is divisible by 5.   Can these be generalized as $a^n$ $-$ $b^n$$ = (a-b)N$, where N is an integer? But why is $a^n$ $-$ $b^n$$ = (a-b)N$ ?  I also see that $6^n$ $- 5n + 4$ is divisible by $5$ which is $6-5+4$ and $7^n$$+3n + 8$ is divisible by $9$ which is $7+3+8=18=9\cdot2$.  Are they just a coincidence or is there a theory behind?  Is it about modular arithmetic?


In my psd from designer I have a background like in the red rectangle.    This pattern doesn't show up in any Photoshop patterns. (maybe it's inner psd container)  How could I fetch a small rectangle from Photoshop and use it as a css background, having it repeat seamlessly without any bugs or borders etc.?  How do I fetch repeated content for a background from a .psd layout?

I pulled a repeating pattern from someone else's PSD. Is there a way to figure out the size of the original pattern? I need to create an image with only one tile.


Can anybody resolve the issue where I am trying to restore a database to a SQL Server 2008 server from a backup file taken from a SQL Server 2008 R2 server?

What are my options if I need to move a database from SQL Server 2012(32bit) to SQL Server 2005(64bit)?  I know I cannot:   restore a backup of the database on SQL Server 2005 detach & attach   I know I can:   use import data wizard, and I tried it on one database, but it only moves data, and even that was troublesome as I needed to do a lot of work creating temp tables to maintain identity columns, recreating all FKs, indexes etc.    Is there an easier option?


Why is the verb to be in the infinitive in 'Praise be to God.'?   Other sentences that look similar are:  'May you be always in our presence.'  'May you be forgiven.'  But May + sub + infinitive of be is used to make a wish and 'Praise be to God' is more of a informative statement rather than a wish.

We will make the convention that exact categories be skeletally small.   Is this construction (used in a mathematical context) correct? There is something that strikes me as odd in that "be". Should it be "are"? I know I've seen a similar way of using "be" like that, without conjugating the verb, but I'm not completely sure when it should be used.


I am new to Hadoop and Hive as well. I am trying to connect to Hive from Java by creating Java project and by adding all below required libraries  $HIVE_HOME/lib/*.jar $HADOOP_HOME/share/hadoop/mapreduce/*.jar $HADOOP_HOME/share/hadoop/common/*.jar   And below is my sample code to connect Hive database.  package com.stpl.hive.jdbc;  import java.sql.SQLException; import java.sql.Connection; import java.sql.Statement; import java.sql.DriverManager;  public class HiveSample {      //private static String driverName = "org.apache.hadoop.hive.jdbc.HiveDriver"; private static String driverName = "org.apache.hive.jdbc.HiveDriver";      public static void main(String[] args) throws SQLException,             ClassNotFoundException {         // Register driver and create driver instance         Class.forName(driverName);         // get connection         Connection con = DriverManager.getConnection(                 "jdbc:hive2://localhost:10000/default", "", "");         Statement stmt = con.createStatement();         stmt.execute("CREATE DATABASE newdatabase");         System.out.println("Database userdb created successwdbfully.");         con.close();     } }   While running i am getting below error   Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class org.apache.derby.jdbc.AutoloadedDriver40     at java.lang.Class.forName0(Native Method)     at java.lang.Class.forName(Class.java:348)     at java.sql.DriverManager.isDriverAllowed(DriverManager.java:556)     at java.sql.DriverManager.getConnection(DriverManager.java:661)     at java.sql.DriverManager.getConnection(DriverManager.java:247)     at com.stpl.hive.jdbc.HiveSample.main(HiveSample.java:18)   Am I missing any other jars to add in project? Please help me to solve this error. And i am using Hive 2.3.2 version. Please ask me if any other details required to solve it.

I am getting a NoClassDefFoundError when I run my Java application.  What is typically the cause of this?


I have just bought a MacBook and recently switched from Windows OS. Let's take the example of Microsoft Word documents. In Windows OS, I have a habit of making my MS Word files in the destination directory itself, so all I have to do is save my work later.   However with my limited knowledge of MacOS, I realise there seems to be no way to achieve this, I always make a new MS Word file and only at the saving stage then I require to go through the whole motion of entering my nested folders. If I have to work on multiple files that would be stored in the same destination folder, this process will become quite irritating if the destination is quite deep into other folders.   Is there a way to overcome this dilemma in MacOS in general for any application?

In Windows when you're in File Explorer, you can right-click anywhere and create a new item of various types (there's then a submenu option to select which type: text file, ZIP file, etc., just to name a few). In Finder there seems to be no such option. I imagine the expected workflow on Mac would be to open an Application and create a new file from within the application, then save it. But I sometimes prefer this alternative workflow of creating a blank file first, and then opening it as the entrypoint into the application.  Is there some way to configure Finder to add a right-click option to create new, empty files?


I want to find the sum of a series for which the $n^{th}$ term is given by $T_n=n(n+1)(-1)^{n+1}$ Basically if we find the sum of $n$ terms the series turns out to be like this: $1 \times 2 -2 \times 3 +3 \times 4 -4 \times 5 +5 \times 6\ldots$

i know the summation of $1 \times 2 + 2\times 3 + 3\times 4 = \frac{k(k+1)(k+2)}3$ but this one has negative terms. so we need to find below  $$\sum_{i=1}^n(-1)^{i+1} (i(i+1))$$  e.g. $1\times 2 - 2\times 3 + 3\times 4 ....$  if you can share the derivation then it would be very great.


Using the regexp string, how can I remove all the lines before the first line that contains a match?  e.g How can I change this:  lost load linux loan linux   into this:  linux loan linux   I tried:  echo "lost load linux loan linux" | sed -e 's/.*^li.*$//g'   but it returns this, not changing anything:   lost load linux loan linux   I'd like to make it work so that it won't output anything when there's no match.

I am attempting to write a filter using something like sed or awk to do the following:   If a given pattern does not exist in the input, copy the entire input to the output If the pattern exists in the input, copy only the lines after the first occurrence to the output   This happens to be for a "git clean" filter, but that's probably not important. The important aspect is this needs to be implemented as a filter, because the input is provided on stdin.  I know how to use sed to delete lines up to a pattern, eg. 1,/pattern/d but that deletes the entire input if /pattern/ is not matched anywhere.  I can imagine writing a whole shell script that creates a temporary file, does a grep -q or something, and then decides how to process the input. I'd prefer to do this without messing around creating a temporary file, if possible. This needs to be efficient because git might call it frequently.


Ok so i tried to reset my password using these instructions    Hold shift during start menu to open up the ubuntu menu Hit enter on recovery mode Hit enter on root After that this appeared like it was supposed to root@vera-hp-g62-pc: or something like that and i put in the code "passwd" (dont add the apostraphe's) and than my user name  Immediatly fallowing that it asked me to enter a new password only problem was that i couldnt type and had to use the "exit" comand (again no apostraphe)  P.S. I ignored the fact that the characters werent visible and entered my would be password but an error messege showed up

When I'm about to install a program in the terminal it wants the password:  [sudo] password for xxx:   But when I start to type my password nothing happens. What should I do?


Can I get the chronology of books written for LaTeX  For example I have gone through D._Knuth-The_TeXbook.pdf  But most of the examples will not compile in the modern Win Cmptr running MikTex like \line \topinsert etc   What book comes next in the series after the aforementioned TeXbook?

I've been using LaTeX for about 3 months, and I'm hooked. My background is programming, so for the basic, google is sufficient. I did some research on amazon.com and found these two books with many positive feedback:    However, most of people said they are more like references than a real book. And if they really are, then I think I'd rather look up at CTAN. What I'm looking for is a book that can teach me how to program in LaTeX, for example:   Write my own package   Create animation  Create and using macro in LaTeX ....   I know there are many options around, however to pick the right one is not an easy task. Any advice or suggestion would be greatly appreciated. Thank you.


I have a requirement to build multi regional site. Some regions will have more than one language, so this makes the site both mulitregional and multi lingual.  Client want to have one domain for all the region and to use region code in url. For example, in case of switzerland url will be xxx.com/ch/index. and when it comes to region with more than one language the url will be like xxx.com/ca/en/index for canada english and xxx.com/ca/fr/index for canada frech version.  But I would like to suggest slightly different url format. like, xxx.com/en-ca.index and xxx.com/fr-ca/index and in case of region with only one language, xxx.com/ch/index (switzerland).  Now, i would like to know on SEO perspective which approach will be advantageous?  thanks in advance!

We are currently maintaining country folders like  www.example.net/de/ www.example.net/fr/   Now we are thinking about Swiss with 3 languages (it, de, fr). I think it's bad to change all the current directories. Is it okay to only add the region if necessary? For example:  www.example.net/de/ = German speaking, not Swiss www.example.net/fr/ www.example.net/it/ www.example.net/de-CH/ = German speaking, Swiss only www.example.net/it-CH/ www.example.net/fr-CH/   So: Is it for SEO okay to mix the subfolder structure between /lang/ & /lang-country/?


Similary to this  after breaking (automatically, or manually with \newline) lines in a tabularx environment I would like to obtain an automatic indentation of the second, new line. So something like \begin{tabularx}{\textwidth}{X} Some very long text here such that it spreads over the whole textwidth and even beyond. LaTeX will automatically break the line at some point but lets say we do it manually here \newline then THIS part should be indented by, idk, 5pt. (should also happen when tabularx breaks the line automatically) \end{tabularx}  Thank you very much!


Prove: Use the triangle inequality to prove that for all $x, y, | |x| − |y| | ≤ |x − y|$     Proof:       If $x ≥ 0$ and $y ≥ 0$, then both sides of the   inequality are the same.      Also if $x ≤ 0$ and $y ≤ 0$ then both sides of the   inequality are the same.       Assume $x ≥ 0$ and $y ≤ 0$ then $|x| = x$, and $|y| = −y$, and so:      $||x|| = ||x − y + y|| ≤ ||x − y + y|| ⇒ ||x−y||≤||x − y||$      and      $||y|| = ||x − y − x|| ≤ ||x − y|| + ||x|| ⇒ −(||x||−||y||) ≤ ||x − y||$   How do I approach this? Is this a good start?  Update:  I feel the following approach is a little bit more clear.     Proof:      Case $x≥0$ and $y≥0$: We have both sides equal each-other      Case $x≤0$ and $y≤0$: We also have both sides equal each-other      Case $x≥0$ and $y≤0$: Then $|x|=x$, and $|y|=−y$, and so   $||x|| = ||x − y + y|| ≤ ||x − y + y|| ⇒ ||x−y||≤||x − y||$      Case $x≤0$ and $y≥0$: Then $|x|=-x$, and $|y|=y$, and so   $||y|| = ||x − y − x|| ≤ ||x − y|| + ||x|| ⇒ −(||x||−||y||) ≤ ||x − y||$      QED

I've seen the full proof of the Triangle Inequality  \begin{equation*} |x+y|\le|x|+|y|.  \end{equation*} However, I haven't seen the proof of the reverse triangle inequality:  \begin{equation*} ||x|-|y||\le|x-y|. \end{equation*} Would you please prove this using only the Triangle Inequality above?  Thank you very much.


In other words, in the context of authenticated encryption using Encrypt-Then-MAC, is this stupid?:  derived_key = PBKDF(key, salt, dkLen=32) hmac_key, enc_key = derived_key[:16], derived_key[16:]   It is advised that separate keys be used for MAC and encryption. Is this sufficient? If not, how dangerous is it?

When using Encrypt-then-MAC with AES and HMAC by password, and given 128 bits of payload with the ciphertext to store a random salt, which would be more secure:   Using PBKDF2 with then entire 128 bit random salt and generating 512 bits of derived data to split into a 256 bit AES Key and a 256 bit HMAC key.   or   Using PBKDF2 separately for each key using two 64 bits salts to generate a 256 bit AES Key and a 256 bit HMAC key.    or    Better option?


I wanna spawn a skeleton with full leather with all MAX blast protection riding a creeper. And so the command I came out with is this:  /summon Skeleton 16 53 -21 {Equipment:[{},{id:leather_boots,tag:{ench:[{id:3,lvl:4}]}},{id:leather_leggings,tag:{ench:[{id:3,lvl:4}]}},{id:leather_chestplate,tag:{ench:[{id:3,lvl:4}]}},{id:leather_helmet,tag:{ench:[{id:3,lvl:4}]}}]},Riding:{id:Creeper}}     But it doesn't work. It does say:  [11:56:34] Data tag parsing failed: Unbalanced square brackets []: {Equipment:[{},{id:leather_boots,tag:{ench:[{id:3,lvl:4}]}},{id:leather_leggings,tag:{ench:[{id:3,lvl:4}]}},{id:leather_chestplate,tag:{ench:[{id:3,lvl:4}]}},{id:leather_helmet,tag:{ench:[{id:3,lvl:4}]}]},Riding:{id:Creeper}

Often, when making a command block contraption, you need to set an entity's data tag. These tags can sometimes be very long, with many layers of nested curly and square brackets. For example, this is the command to summon a villager with a single custom trade:  /summon Villager ~ ~ ~ {Profession:3,Career:2,Offers:{Recipes:[{buy:{id:minecraft:diamond,Count:6b}},sell:{id:minecraft:diamond_hoe,tag:{ench:[{id:16s,lvl:10s}]}]}}   The single-line command block interface of Minecraft makes it incredibly difficult to find and fix errors, especially when it comes to mismatched brackets. In fact, for illustration purposes, I put an error in the above command.  What techniques can I use to find and fix unbalanced square or curly brackets when writing long and complicated data tags?


Is it possible for me to get push notifications or emails (or other) when a question arises on specific tags?

Is there a way to configure your Stack Overflow account so that you receive notification emails when posts are made to specific tags?    Or do you simply have to log on to see new posts?


I was wondering how is it possible to mathematically prove that Shannon entropy does not change when applying any bijective function to X? For instance H(X) = H(f(X)) assuming that f is invertible and X takes only finitely many possible values. In addition, I saw that this holds for block ciphers also but I could not figure out why?

I was not able to mathematically prove that all permutation and substitution ciphers satisfy H(X)=H(Y) if we say that Y is the set of ciphertexts while X is the corresponding set of plaintexts in Shanon Entropy? More generally, how is it possible to mathematically prove that Shannon entropy does not change when applying any bijective function to X?


I am reading a book about web security and they are now talking about AES CBC. After reading the chapter I was wondering, can an attacker compute my secret key if he has access to the IV, the plain text and the ciphertext.  Is this possible? If not why?  Thanks.

I have a file, which was encrypted with AES-128 in ECB mode. I know the format of the original file and know that all files in this format have the same headers. So, I have an encrypted block and the original block.  Can I get the encryption key, using this information?


I have a (Verizon) basic (aka "dumb") cell phone, and I have a question about SMS capabilities. Is there a Stack Exchange site for my question?

Where would I ask a question pertaining to an ordinary phone? Or just cell phones in general? I saw Windows Phone while browsing the SE database, nothing else really popped out at me. Google didn't bring up anything either. Is that just too small a community to cover with SE?


I have the following user who keeps running very complex analytics queries, that usually take 1m each query:  Id  User    Host            db  Command Time    State                 Info 97  tvs0XXX ec2...com:47703 ax  Query   55      Creating sort index   SELECT...   Is there a way to set a SELECT timeout for the tvs0000 user above to 5 seconds? How would I do this?

I would like to set a maximum execution time for sql queries like set_time_limit() in php. How can I do ?


I recently acquired a Motorola Droid XYBoard loaded with GoPago. This software starts up immediately and I was wondering if there is a way to either bypass it or access the operating system around it.

Possible Duplicate:          I've installed some applications that I mostly like, except for the fact that they all decided they were too important not to auto-start.  None of them give me any option within the application to disable the auto-start "feature."  Can I stop these applications from auto-starting?  And if so, how?  Note: My phone is not rooted, so I'm especially interested in solutions that do not require a rooted device, but all answers are welcome, even if they require rooting the device, since I may do this eventually.  Also note: I'd prefer not to fiddle around with clumsy auto-kill features in task-killer programs, as I've found them to be incredibly unreliable on my phone (Motorola Milestone/Droid).


I change Some Setting Of My BIOS but After I Restart my CPU. it Will Show Me Default Setting of BIOS whatever changes i make it's not saved.so what is the problem in BIOS.What Should i do For Save my Settings ?

When I start my PC, my computer plays a loud BEEP for 2 seconds and after that it starts abnormally like press F1 To Start. I found some video in that many of the video tells to clean the RAM. After that I clean my RAM but it's not working.  So please tell how I get rid ofthis BEEP sound of CPU.


I have a quite long Bash script I use to install Apache server environments including PHPmyadmin and several other utilities, after logging to the remote machine via SSH. I run the script via the Ubuntu server 16.04 CLI terminal.  When the script runs, it stops sometimes, about 5-6 times to ask for password (whether in Unix itself or in some installation programs it starts).  Is there a way to make sure a sound notification will be played in each such stop whether in Unix itself or when a new installation program is initiated?    Update for SYN:  I did:      82  sudo apt install alsa-utils    83  speaker-test -t sine -f 1000 -l 1   And got:  speaker-test 1.1.0  Playback device is default Stream parameters are 48000Hz, S16_LE, 1 channels Sine wave rate is 1000.0000Hz ALSA lib confmisc.c:768:(parse_card) cannot find card '0' ALSA lib conf.c:4292:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings ALSA lib conf.c:4292:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory ALSA lib confmisc.c:1251:(snd_func_refer) error evaluating name ALSA lib conf.c:4292:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory ALSA lib conf.c:4771:(snd_config_expand) Evaluate error: No such file or directory ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM default Playback open error: -2,No such file or directory

I am executing every now and then some python scripts which take quite long to execute.  I execute them like this: $ time python MyScript.py  How can I play a sound as soon as the execution of the script is done?  I use Ubuntu 10.10 (Gnome desktop).


I'm playing Minecraft in Windows 10 edition and I type /give @s gold_block 1 0 {CanPlaceOn:["minecraft:planks"]}  in-game chat but I keep getting the response, Line 1, Column 2 missing '}' or object member name   I've tried looking up people answering this question but nothing is helping me solve this problem. What can I do to get this command to work or at least get this block with those features. FYI, I'm pretty sure this command works in my version because the can_destory command does.

Java Edition has the CanPlaceOn and CanDestroy NBT tags, which are used to restrict the blocks an item can be placed on and destroy respectively (in adventure mode). For example, the following commands give the player a stone block that can only be placed on grass and dirt, and a netherite axe that can only destroy pumpkins: give @s stone{CanPlaceOn:["minecraft:grass","minecraft:dirt"]} give @s netherite_axe{CanDestroy:["minecraft:pumpkin"]}  How can I do this in Bedrock Edition?


The Wikipedia entry for  has a section, "Of residuals," that discusses the two equations that constrain the residuals:  $\hat{e_1} + ... + \hat{e_n} = 0$ and  $x_1\hat{e_1} + ... + x_n\hat{e_n} = 0$  The first equation is obvious. I am struggling to understand why the second equation must be true.

The first sentence of this  page claims that  "In econometrics, an endogeneity problem occurs when an explanatory variable is correlated with the error term. "  My question is that how can this ever happen? Isn't regression beta chosen such that the error term is orthogonal to the column space of the design matrix?


Here is my attempt:  Substituting y for infinite x powers:  $$x^{x^{x^{x^{.^{.^{.}}}}}}=y → x^y=y $$  Giving: $$x=y^{\frac{1}{y}}$$  Take natural logs & differentiate with respect to $y$: $$ln(x)=ln(y^\frac{1}{y}) → ln(x)=\frac{1}{y}ln(y^\frac{1}{y})$$ $$\frac{1}{x}\frac{dx}{dy}=-\frac{1}{y^2}ln(y)+\frac{1}{y^2}$$ $$\frac{dx}{dy}=x\left(\frac{1-ln(y)}{y^2}\right)$$  Sub. in $y^{\frac{1}{y}}$ for $x$: $$\frac{dx}{dy}=y^{\frac{1}{y}}\left(\frac{1-ln(y)}{y^2}\right)$$ $$\frac{dx}{dy}=y^{\frac{1}{y}-2}\left(1-ln(y)\right)$$  Inverse $\frac{dx}{dy}$ to get $\frac{dy}{dx}$: $$\frac{dy}{dx}=\left[y^{\frac{1}{y}-2}\left(1-ln(y)\right)\right]^{-1}$$ Therefore:  $$\frac{dy}{dx}=\frac{y^{2-\frac{1}{y}}}{1-ln(y)}$$  Have I made a mistake anywhere? Have I made a false assumption? Please kindly provide some guidance, thanks.

I am a 12th grade student, and I am afraid that in realistic terms this question might not even make sense because of the infinities that have to be dealt with. However, in my attempt to calculate it's derivative, I did the following:  $$y=x^{x^{x^{.^{.^.}}}}$$  $$\ln(y)=\ln(x)x^{x^{x^{.^{.^.}}}}$$  $$\ln(y)=y\ln(x)$$  after taking derivative with respect to x on both sides, I obtained the following:  $$\frac{\mathrm dy}{\mathrm dx}=\frac{y^2}{x(1-\ln(y))}$$  I am fairly certain that the calculations up to this point are valid. However, to further continue, I analyzed the nature of y in different domains and obtained the values, by observation(that is, by observing how $x$, $x^x$, $x^{x^x}$, $x^{x^{x^x}}$, and so on would behave to draw a conclusion):   for $x<1,$ $y$ becomes 0 for $x=1,$ $y$ becomes 1 for $x>1,$ $y$ becomes infinite   These 3 points is where the first problem lies. Are these true? If so, how do we reach to the conclusion?  Secondly, considering this to be true, I get the derivative at:   $x<1$ to be 0. $x=1$ to be 1. for $x>1$, I took $x=2.$ then the derivative $\frac{\mathrm dy}{\mathrm dx} = y^2/[2(1-ln(y))]$ (replacing $x$ by $2$). Now, I applied L hospital's rule to get the value of the expression to be negative infinity.   This is the second problem. I have used L Hospital's rule, but limits were not concerned. Is this method valid? If not, how would we calculate it?


Let $|X|=n$. How to find all number of subsets $X$ consisting of an even number of elements?

Let $A$ be a non-empty set and $n$ be the number of elements in $A$, i.e. $n:=|A|$.  I know that the number of elements of the power set of $A$ is $2^n$, i.e.  $|\mathcal{P}(A)|=2^n$.  I came across the fact that exactly half of the elements of $\mathcal{P}(A)$ contain an odd number of elements, and half of them an even number of elements.  Can someone prove this? Or hint at a proof?


I'm trying to install Steam and i downloaded the .deb file from the page but when i click install on it it just flashed "installing" for about 0.3  seconds.  As shown in the screen shot    HELP  EDIT:I ran this:sudo dpkg -i ~/Downloads/steam_latest.deb  And this error was shown.  `  Selecting previously unselected package steam-launcher. (Reading database ... 154515 files and directories currently installed.) Preparing to unpack .../Downloads/steam_latest.deb ... Unpacking steam-launcher (1.0.0.52) ... dpkg: dependency problems prevent configuration of steam-launcher:  steam-launcher depends on curl; however:   Package curl is not installed.  steam-launcher depends on python-apt; however:   Package python-apt is not installed.  dpkg: error processing package steam-launcher (--install):  dependency problems - leaving unconfigured Processing triggers for gnome-menus (3.13.3-6ubuntu3) ... Processing triggers for desktop-file-utils (0.22-1ubuntu5) ... Processing triggers for mime-support (3.59ubuntu1) ... Processing triggers for hicolor-icon-theme (0.15-0ubuntu1) ... Processing triggers for man-db (2.7.5-1) ... Errors were encountered while processing:  steam-launcher   `

. An update has been issued. If you still cannot install, ensure you have updated fully, and then restart your computer.   I am trying to install downloaded DEB packages. Each time, I see a warning like this:    And clicking install just loads and nothing changes.  This shows for all the packages I try and install. How can I install a package?


Let $k$ be a field of characteristic zero and $A$ be a matrix over $k$. Then the characteristic polynomial of $A$ is $x^n$ if and only if $\text{Tr}(A^i)=0$ for all $1\le i \le n$.   The only proof I can think of is by applying the Jordan normal form to $A$ (considered as a matrix over $\overline{k}$). Is there any slick proof without invoking this theorem?

Let $A$ be an $n\times n$ complex nilpotent matrix. Then we know that because all eigenvalues of $A$ must be $0$, it follows that $\text{tr}(A^n)=0$ for all positive integers $n$.  What I would like to show is the converse, that is,      if $\text{tr}(A^n)=0$ for all positive integers $n$, then $A$ is nilpotent.   I tried to show that $0$ must be an eigenvalue of $A$, then try to show that all other eigenvalues must be equal to 0. However, I am stuck at the point where I need to show that $\det(A)=0$.  May I know of the approach to show that $A$ is nilpotent?


I am thinking about making a new character and was wondering what would a half-elf with a drow history act like and if it would have something new. For example, would it have the drow magic trait? Or would it have light sensitivity? And if it is possible to make it, how would it be made?

One of the players in my campaign has created a Half-Elf Ranger and picked The Underdark as his preferred terrain. We are busy fleshing out his background and he is an escaped slave of the Drow. Can he be the bastard child of a human slave and a Drow master? Or should we rather decide he is a captured half-elf?  The campaign is set in the Sword Coast region of the Forgotten Realms and I am interested in whether there is anything in the Players Handbook, Dungeon Masters Guide or other published 5th edition material that makes reference to Half-Drow characters and if it does whether there is any game affect to this ancestry.


I have a Visualforce form which that contain a couple of fields restricited to only certain profiles. With Salesforce the fields are automatically hidden/shown depending on the permissions, what I would like to do is extend functionality to the surounding code I have written.  Here is an example of the code I want to show only if 'Profile B' user logged in.
             Outlet ID             <apex:inputField value="{!Service_Order__c.Outlet_ID__c}" styleClass="form-control" />
   Currently it will still output div element and the label.

I have a controller extension and want to use the Tabbed view to get rid of the Chatter caused endless scrolling.      public class UserProfileGetter {     public UserProfileGetter(ApexPages.StandardController controller) {      String userProfileName = [select u.Profile.Name, id, UserType from User u where u.id = :Userinfo.getUserId()].Profile.Name;      system.debug('Profile===================='+userProfileName);      }    }   When I run the debug it shows my Profile as 'System Administrator' correctly.  My VF page code:  <apex:page standardController="Account" extensions="UserProfileGetter" showHeader="true" tabStyle="account" >   <apex:tab label="Opportunities" name="Opportunities" id="tabOpp" rendered="{userProfileName!='Chatter Content'}">          <apex:relatedList subject="{!account}" list="opportunities" />       </apex:tab>        </apex:tabPanel> </apex:page>   So the logic for render I want is - if the user profile name isn't Chatter Content, render. But if I have this logic in the page it won't render for anyone, including me. Ideas? Thanks  Amending - to query other variable on the user, a checkbox called "Admin Team" to display the tab for Account Teams related list, I query for both like this:  public class UserProfileGetter {     public String userProfileName {         get {             return [                     select Profile.Name                     from User                     where Id = :Userinfo.getUserId()                     ].Profile.Name;         }     }     public boolean userAdminTeam {         get {             return [                     select Admin_Team__c                     from User                     where Id = :Userinfo.getUserId()                     ].Admin_Team__c;         }     }      public UserProfileGetter(ApexPages.StandardController unused) {     }   }   And then I use like this:   <apex:tab label="Account Team" name="Account Team" id="Act" rendered="{!userAdminTeam}">   Thanks all.


I just went on to my minecraft world and in the middle of a underwater structure that I had built with no issues yesterday was a huge hole. I can't place block or even go into it. Several of these appeared and they even started to occur on land. Also I have the Mo' Creatures mod and alot of the rays and dolphins are spawning around these areas.  /EbQF7.jpg

I have interesting bug that I have experienced before but has gone away on its own. This one is not going away though.  I have a giant stripe or chunks missing from my desert biome, I would say probably 7 chunks long.  I'm guessing the chunks are corrupted or something, what was hoping to figure is whether it can repaired or reverted.  Here is a picture of the problem.


I want to add r.vieshed.cva on my grass 7.2.0 from QGIS 2.18.3. I need to access to r.vieshed.cva from processing and conect it with processing.runalg(). I saved the alg on C:\Program Files\QGIS 2.18\apps\qgis\python\plugins\processing\algs\grass7 as python file but it doesn't appear on processing tools on QGIS or GRASS.  I want to add the result os a first processing in r.viewshed.cva vector file.  How can I do it?

I have been using QGIS and Grass for ages and while I've noticed this issue before, I've not been bothered by it until now.  It is (hopefully) a bit of a noob question but when I open GRASS in the QGIS Processing toolbox, I notice that a lot of standard utilities appear to be missing (e.g. r.in.bin and others  - There are only 161 commands listed for Grass 6.4.3 and this figure should be much higher).    I am not talking about add-on plugins but standard parts of the GRASS toolset (according to the Grass documentation).  Looking in the Grass bin folder, however, I can see the are there.  It is not that the bin folder is not recognized as I can see many of the other utilities there in Processing.  I have tried updating to the latest version of QGIS (2.18) with OsGeo4W and re-installing both Grass 6.4.3 and 7.2.  I have checked the paths in Processing-options and all looks fine (in as much as the paths point to the top-level directory in each case as they always have).  How can I make the missing ones appear in the Processing toolbox?


I was given this hint in a different problem,  Now use that a prime $p$ occurs in $n!$ with multiplicity exactly $\lfloor n/p\rfloor + \lfloor n/p^2\rfloor  + \lfloor n/p^3\rfloor + \lfloor n/p^4\rfloor +\ldots$ For $$P=\frac{200!}{2^{100}\cdot 100!}$$ And the prime being $p = 3$.  How is the claim for $n!$ true? Consider $n \ge 6$. $$n = 6 \implies n! = 720$$ $$720/3 = 240 \to 240/3 = 80 \implies \text{3 comes in twice.}$$ Then, $[6/3] + [6/9] = 2$. So suppose $3$ occurs in $n!$ with multiplicity,  $\lfloor n/p\rfloor + \lfloor n/p^2\rfloor  + \lfloor n/p^3\rfloor + \lfloor n/p^4\rfloor +\ldots$ It is required to show that, for $(n+1)!$, $3$ occurs in multiplicity, $\lfloor n+1/p\rfloor + \lfloor n+1/p^2\rfloor  + \lfloor n+1/p^3\rfloor + \lfloor n+1/p^4\rfloor +\ldots$ $(n+1)! = (n+1)n!$. But I cant prove anything else. Even intuitively, why does this make sense?

How does one find the highest power of a prime $p$ that divides $N!$ and other related products?  Related question: How many zeros are there at the end of $N!$?    This is being done to reduce abstract duplicates. See   and  for more details.


Ok, I have a female friend, can I say "girlfriend" as "a female friend, not a romantic lover"?  Ex, I got married but I have a girlfriend.  Can I say "I have a girlfriend (a female friend, not a romantic lover)"?  Also, is "female friend" a popular term in everyday conversation?

When I'm talking about my friend, who is a girl, but not a girlfriend, what word or phrase should I use? If the gender was unimportant, it would not be a problem. But if I want to note that the friend is female, not male, how should I say that, to avoid ambiguity?


A rectangle is divided into smaller rectangles of random sizes each having at least one side of integer length. Prove that larger rectangle has at least one side of integral length.  I don't know how to approach this problem and where to start from.

A challenge problem asked to show that if rectangle $R$ with axis-parallel sides is partitioned into finitely many subrectangles $R_1,R_2,\ldots,R_n$ (also with axis-parallel sides), such that each $R_i$ has at least one integer side length, then $R$ must also have at least one integer side length. The only proof I've seen, although simple, is quite unintuitive. Namely you look at the integral  $$ \int_R e^{2 \pi i (x+y)} dx dy $$ and note that the integral is $0$ if and only if $R$ has an integer side length, and then note that by assumption the integral is $0$ over all the $R_i$, hence summing the integral over all $R_i$ gives that the integral is also $0$ over $R$. Can someone give a more direct/intuitive argument that doesn't use voodoo like a complex-valued integral?


I've been observing that asking a question is a way better search tool than the search bar. Here is an example:  Say, this is what I am looking for:      pandas number of subgroups for each group   Let's see which one of the following three methods will return better search results.   Go to , and type it in there. It returns only one result, and  is really not an answer to what we are looking for. Try , and type it in there, and you'll see that  is perfectly what that search query would be looking for! Go to , and search like this: site:stackoverflow.com pandas number of subgroups for each group, and the first result is again that useful post.   So clearly, googling or asking a question is a better idea than using the native search engine.   asked 6 years ago if we could implement a better search engine, and the answers refer to the search tool I just mentioned in item 1. Clearly, it is not working as desired.  My question is two-fold:    Why is the "Ask Question" search is working better than the search bar? Please include examples in your answer if you believe this is not true. If most of us believe that this is indeed true, can we implement the search that the "Ask Question" invokes as the main search engine?

When I search for a question I'd like to be shown the same results as when I type in a title in "n" I often use the "Ask Question" as a search tool, like this: Some results!  Better results?  Update: I have updated the screen shot to a version without quote marks, the two search results are still inconsistent. But are they better?


I want to understand (and report the bug) which app is showing the "Network Error" toast notifications in the middle of the screen each time when I unlock the device. Any tips or ideas?  I'm a JS developer, so can utilise any developer tools if necessary.  Device is stock oneplus 5, Android 7.1.1 if that matters.

Several times a day my Android phone (Samsung Galaxy A51, Android 11) is showing this toast  We're having trouble connecting. Check your network connection and try again.  If I stay offline this toast will return every few minutes. How can I find out which app is posting these toasts. And most importantly how do I get rid of them? Long-pressing the toast doesn't show anything.


zsh Ubuntu 16.04: ls -l *.pdf | wc -l  returns 1629.  The 1629 .pdf files totals ~1.2GB.  top indicate 5GB of RAM free date;qpdf --empty --pages ./*.pdf(On) -- ../concatInboxLatestFirst_batch2.pdf;date  returns an error "Too many open files": Wed Nov 11 20:34:22 EST 2020 open ./Agenda-768.pdf: Too many open files Wed Nov 11 20:34:25 EST 2020  Per  ulimit -a | grep descriptors                                                        returns: -n: file descriptors                1024 ulimit -n 10000. #increase file descriptors from 1024 to 10000 ulimit -a | grep descriptors                                                        returns: -n: file descriptors                10000 Increasing the file descriptors to 10000 seemed to resolve the problem. Observations  a second instance of zsh opened has file descriptors = 1024 a bash instance does not return a file descriptor  It would seem that the scope of the setting file descriptors is confined to a single instance of zsh. Questions  What is the risk & penalty associated with bumping up file descriptors from 1024 to 10000?  The question is posed because I am considering permanently increasing the number to 10000.

Is there a (technical or practical) limit to how large you can configure the maximum number of open files in Linux?  Are there some adverse effects if you configure it to a very large number (say 1-100M)?  I'm thinking server usage here, not embedded systems.  Programs using huge amounts of open files can of course eat memory and be slow, but I'm interested in adverse effects if the limit is configured much larger than necessary (e.g. memory consumed by just the configuration).


I know that single ? is used to make a variable nullable, but what does double ?? mean in below code?  txtId.Text = Convert.ToDecimal(conn.LeavesRequests.Max(lr => (decimal?)lr.Id) + 1 ?? 1).ToString();

Ran across this line of code:  FormsAuth = formsAuth ?? new FormsAuthenticationWrapper();   What do the two question marks mean, is it some kind of ternary operator? It's hard to look up in Google.


As I read in some papers, most verbs in a paper are written in the passive third person. For example: "This method was experimented; satisfying results were achieved..."   My question is, is this a must and all types of papers in all journals should be this way? For example, if I write "I experimented with the method", is this wrong and editors could reject the paper? If the answer is yes, what is the reason that the author has to write the paper that way?

Are there written or unwritten rules for avoiding the use of first-person while writing research papers? I was advised at the beginning of my grad school to avoid use of first person - but I still don't know why I should do this.  I have seen that, at many places, authors refer to themselves are "the authors" and not "we". At the same time, I have also seen use of first-person to a good extent.    Do these things differ in different Journals and Conferences (and in different disciplines as well - mine happens to be CS)?


ChatFragment.java:   public class ChatFragment extends Fragment { private FirebaseListAdapter<ChatMessage> adapter; View RootView; EmojiconEditText emojiconEditText; ImageView emojiButton,submitButton; EmojIconActions emojIconActions; @Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {     View RootView = inflater.inflate(R.layout.fragment_chat,container,false);     this.RootView = RootView;     return RootView; }  @Override public void onCreate(@Nullable Bundle savedInstanceState) {     super.onCreate(savedInstanceState); //:55     emojiButton = (ImageView)this.RootView.findViewById(R.id.emoji_button);     submitButton = (ImageView)this.RootView.findViewById(R.id.submit_button);     emojiconEditText = (EmojiconEditText)this.RootView.findViewById(R.id.emojicon_edit_text);     emojIconActions = new EmojIconActions(getActivity().getApplicationContext(),this.RootView,emojiButton,emojiconEditText);     emojIconActions.ShowEmojicon();   error:  Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View android.view.View.findViewById(int)' on a null object reference     at dev.edmt.chatapp.ChatFragment.onCreate(ChatFragment.java:55)   I tried another way(ChatFragment.java):  public class ChatFragment extends Fragment { private FirebaseListAdapter<ChatMessage> adapter; View RootView; EmojiconEditText emojiconEditText; ImageView emojiButton,submitButton; EmojIconActions emojIconActions; @Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {     View RootView = inflater.inflate(R.layout.fragment_chat,container,false);     this.RootView = RootView;     this.emojiButton = (ImageView)RootView.findViewById(R.id.emoji_button);     this.submitButton = (ImageView)RootView.findViewById(R.id.submit_button);     this.emojiconEditText = (EmojiconEditText)RootView.findViewById(R.id.emojicon_edit_text);     return RootView; }  @Override public void onCreate(@Nullable Bundle savedInstanceState) {     super.onCreate(savedInstanceState); //:60     emojIconActions = new EmojIconActions(getActivity().getApplicationContext(),this.RootView,this.emojiButton,this.emojiconEditText);     emojIconActions.ShowEmojicon();   error:  Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void hani.momanii.supernova_emoji_library.Helper.EmojiconEditText.setOnFocusChangeListener(android.view.View$OnFocusChangeListener)' on a null object reference     at hani.momanii.supernova_emoji_library.Actions.EmojIconActions.setFocusListener(EmojIconActions.java:241)     at hani.momanii.supernova_emoji_library.Actions.EmojIconActions.<init>(EmojIconActions.java:64)     at dev.edmt.chatapp.ChatFragment.onCreate(ChatFragment.java:60)   I am new and do not understand the fragment..............................................................................................................................

What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them?  What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?


For debugging purposes, I'd like to see the approximate memory size of each living variable in my python script, because a variable is growing up quickly in size (or multiple variables are created but not destroyed).  EDIT 1:  Here is the output of  (total variables size ~54MB) at the moment when used memory grows by 6GB.  Partition of a set of 370715 objects. Total size = 54137008 bytes.  Index  Count   %     Size   % Cumulative  % Kind (class / dict of class)      0 151088  41 16953320  31  16953320  31 str      1  91788  25  8121344  15  25074664  46 tuple      2  16472   4  4979464   9  30054128  56 unicode      3   4699   1  3118216   6  33172344  61 dict (no owner)      4    895   0  3100648   6  36272992  67 dict of module      5  23616   6  3022848   6  39295840  73 types.CodeType      6  23707   6  2844840   5  42140680  78 function      7   2412   1  2303520   4  44444200  82 dict of type      8   2412   1  2178768   4  46622968  86 type      9  12733   3  1805096   3  48428064  89 list <925 more rows. Type e.g. '_.more' to view.>   I suspect a library () that uses an external lib(libmagickwand-dev). but don't know at what level in my code this is happening.  is there a better way to debug this kind of problems ?  EDIT 2  I can see those 6GB in htop but not in Guppy-PE:

I've recently become interested in algorithms and have begun exploring them by writing a naive implementation and then optimizing it in various ways.  I'm already familiar with the standard Python module for profiling runtime (for most things I've found the timeit magic function in IPython to be sufficient), but I'm also interested in memory usage so I can explore those tradeoffs as well (e.g. the cost of caching a table of previously computed values versus recomputing them as needed). Is there a module that will profile the memory usage of a given function for me?


When is the perfect tense used? All examples illustrating perfect are always answer to the same question.  So there is no way when I can simply said:     I have written a note   or   I had written a note   Is that right? Instead I  need to say:     I wrote a note   But if someone asked me: Did you finish a note? then I need to use perfect:     Yes, I just have written a note    or   Yes, I had written a note yesterday      Am I right?

If I seem tired, can I say: "I haven't slept last night"? If not, why have I been told that we use present perfect for actions that have present effects?


I'am trying to learn about the filesystem hierarchy but I can't get my mind wrapped around some of the concepts.   /mnt: What do I put here? In theory, is a place for mounting temporary file systems so, where do I mount the 3 extra hard-drives that are in my computer? /usr: here is where all the programs that are not a part of the OS go (Thunderbird, Gimp,...) so, why is useradd command in /usr/sbin? Isn't user management an intrinsic part of the OS? if all the software that is not part of the OS is intalled in /usr (/usr/bin, /usr/lib,...), why the configuration files are in /etc? shouldn't they be in /usr/etc/? /opt: What's the difference between /opt and /usr?   EDIT:  I do not see, in the post indicated, the answers to:   where do I mount the 3 extra hard-drives that are in my computer?  why is useradd command in /usr/sbin? Becasue in /bin only goes what's necessary for starting up the system.  why the configuration files are in /etc? shouldn't they be in /usr/etc/? What's the difference between /opt and /usr? I've already found the answer to this one. /opt is for software that is not part of the distro nor the official repository.

Coming from the Windows world, I have found the majority of the folder directory names to be quite intuitive:   \Program Files contains files used by programs (surprise!) \Program Files (x86) contains files used by 32-bit programs on 64-bit OSes \Users (formerly Documents and Settings) contains users' files, i.e. documents and settings   \Users\USER\Application Data contains application-specific data \Users\USER\Documents contains documents belonging to the user  \Windows contains files that belong to the operation of Windows itself   \Windows\Fonts stores font files (surprise!) \Windows\Temp is a global temporary directory    et cetera. Even if I had no idea what these folders did, I could guess with good accuracy from their names.  Now I'm taking a good look at Linux, and getting quite confused about how to find my way around the file system.  For example:   /bin contains binaries. But so do /sbin, /usr/bin, /usr/sbin, and probably more that I don't know about. Which is which?? What is the difference between them? If I want to make a binary and put it somewhere system-wide, where do I put it? /media contains external media file systems. But so does /mnt. And neither of them contain anything on my system at the moment; everything seems to be in /dev. What's the difference? Where are the other partitions on my hard disk, like the C: and D: that were in Windows? /home contains the user files and settings. That much is intuitive, but then, what is supposed to go into /usr? And how come /root is still separate, even though it's a user with files and settings? /lib contains shared libraries, like DLLs. But so does /usr/lib. What's the difference? What is /etc? Does it really stand for "et cetera", or something else? What kinds of files should go in there -- global or local? Is it a catch-all for things no one knew where to put, or is there a particular use case for it? What are /opt, /proc, and /var? What do they stand for and what are they used for? I haven't seen anything like them in Windows*, and I just can't figure out what they might be for.   If anyone can think of other standard places that might be good to know about, feel free to add it to the question; hopefully this can be a good reference for people like me, who are starting to get familiar with *nix systems.  *OK, that's a lie. I've seen similar things in WinObj, but obviously not on a regular basis. I still don't know what these do on Linux, though.


Anyone want to comment on sudo bash in comparison to sudo su and sudo -i?  I know sudo -i is the preferred because "environment".  I've gotten into the bad habit from years ago when I was a kid in a basement of using sudo bash.  I know it's rather kludgy and awkward, but it works.  I'm looking for a precise and compelling argument to cut my brain free from this habit.  Please tell me why my method is trash? I need an intervention.

I would like to know what is the difference between    su - sudo bash sudo sh   I cannot login as root while doing su - because I do not have the root password - I mean I have my user password with which I can sudo "command"  but this password does not work for su - I can log in as root with sudo bash with my user password and I can login while doing sudo sh but then I get a command prompt in this form #


I just learned that the energy stored in a capacitor is electrostatic potential energy. Also potential energy is a state function and is independent of the path. So, when the capacitor is fully charged to $Q$ and a potential difference of $V$, the potential energy of the system would be $$Q(V_+)-Q(V_-) = Q(\Delta V) = U$$ where, $V_+$ is the potential of the positive plate and $V_-$ is the potential of the negatively charged plate.   This is how we calculate the potential energy of system of charges. Why does this reasoning fail in case of capacitors?

The maximum energy stored by a capacitor is when it’s (theoretically) fully charged, or just before it reaches dielectric breakdown, if you will. It seems, then, that the maximum energy ($E$) $=QV$, where $Q$ is the maximum charge attained and $V$ is the maximum ‘voltage’. However, the correct equation for the maximum energy is $E=\frac{1}{2}QV$. Why? I’m looking for a simple, intuitive explanation because my reasoning that $E=QV$ seems sound to me. I know about , but I’m looking for a reason to disprove my specific argument that $E=QV$ and not the “Oh, it comes from integration.” response.


I am a British citizen and my partner is Chinese. We plan on getting married in the UK in April 2018. However, my partner's marriage visitor visa has been denied with the letter included in this post.  We have every intention for my partner to return to China after we are married in order to apply for the spouse visa due to him not being allowed to apply while in the UK.  Is it wise to try to reapply for the marriage visitor visa after being refused if we try to provide evidence to prove the points they have made in the refusal letter? If so, what is the best proof we can provide for these points?  Or, is there a better way of going about this. Is there another way of us getting married and then being together?  Any help is greatly appreciated, we have tried our best to understand and explore all options but we are no experts. Thank you in advance.

Many of the UK visa refusals we see here share a common pattern and the prevailing reasons refer to V 4.2 (a) and (c).    I do understand that, while the applicants may describe very different individual circumstances, there's a consistent pattern and, broadly, fall into specific categories:    Credibility (lifestyle, lack of ties, visit history, lies & omissions) Funding (insufficient funds, provenance of funds, funds parking) Sponsorship (family, friends, employer)   Question: What most commonly triggers a UK visa refusal where V 4.2 (a) and (c) are given as the grounds?  Secondarily: Given that there is a clear pattern, to what extent are these refusals predictable? Does sponsorship make a difference? Is there a set of personal circumstances, however abstract, where a refusal is all but guaranteed? For example, why do those we see here on TSE who sought entry for the PLAB or British Army appear to be refused with a common theme? Is there a uniform shortcoming or is it just discrimination?   PLAB: What is about applications for a visa, for the purpose of sitting the Professional and Linguistic Assessments Board (PLAB) exam, that seem to invite refusals. After all, the test is given so that international medical graduates can show that they qualify to practise medicine in the UK. The first part, PLAB 1, can be taken in centres outside of the UK. However, PLAB 2 can be taken only in the UK. Why can't you can't get a visa just to sit the exam, promising that you'll leave immediately after?    British Army: Since Commonwealth citizens are eligible to apply online to join, even those who don't reside in the UK, why is it so difficult to get a visa just to attend an interview to see whether you are suitable? Even with an invitation from the Army, such visa applications seem to be unsuccessful. Isn't a career in the British Army a valid reason?     Lastly:  After such a refusal, what approaches would increase the chance of a successful application?


I'm still learning Blender and have a slight problem. Lines are created behind object being bent with lattice or bend modifier. Please see pics. Warm regards, Shaun Dickson

Is it possible to somehow remesh plane? I have a logo that needs to be curved along an object. So I import the SVG logo and convert it to the mesh. But the plane has a bad distribution of polygons and vertices so when I use the shrink wrap modifier it breaks in some of the parts. The remesh modifier looks to work only on models with some thickness. I ended up manualy cleaning the mesh, but wanted to find a faster way. Beautify faces helped in one of four cases.


How could I do the following plot with Tikz:  I'm new on Latex (and Tikz), thanks for your help!

I have a TikZ picture like this:  \begin{tikzpicture}   \begin{axis}[     axis lines=middle,     xmin=-0.5,xmax=3.5,ymin=-0.5,ymax=3.5   ]   \addplot[very thick,blue, samples=300, domain=0:3, name path=A] {sqrt(x)};    \addplot[very thick,yellow!70!red, samples=300, domain=0:3, name path=B] {9-3*x};    \addplot[very thick,red!90!teal, samples=300, domain=0:3, name path=C] {3};    \addplot[very thick,green!70!magenta, samples=300, domain=0:3, name path=D] coordinates{(1/9,-6) (1/9,6)};   \end{axis} \end{tikzpicture}     I’d like to fill the area enclosed by these four curves.  Similar questions have been answered using pgfplots’s fillbetween package, but it only seems to support filling between two curves. What are my options?


I'm trying to get out some minimally designed pages. The WYSIWYG (CKEditor) has a habit of collapsing the code between saves. WHile this is fine and all, I'm finding myself copying copy and pasting it into sublime text in order to reformat. The copy-pasting -- while not difficult -- is thumbing me up a bit. I've copied/pasted the wrong code and had to redo a lot of my work.   So can I have stop CKEditor from minimizing the HTML code? This is a legacy site in Drupal 6.28.

I've tried every combination of "CLEANUP AND OUTPUT" settings that might conceivably prevent munging my HTML, but nothing works.  No matter, what, my HTML gets flattened or in some way rewritten, mainly with whitespace being trimmed off that I want to leave in.  I would suspect CKEditor (version 3.6.4.7575) except that when I tell WYSIWYG to "Apply source formatting", CKEditor doesn't prevent that, so it seems that logically this problem is in the WYSIWYG module.  "Apply source formatting" simply causes the HTML to be screwed up differently.  Some linebreaks are left in place, but spaces at the beginning of the line are left in place.  How can I prevent this, and still use a WYSIWYG editor?


I have Ubuntu 17.10. When I enable "Power Saving / Blank screen" and screen locks after N minutes, all running applications shut down. Is it normal? If no how can I fix it?

There is a very bad problem with the "Blank screen" function in Ubuntu 17.10. I refer to the setting accessed via Settings->Power->Blank Screen. This seems to actually perform a screen lock, since I need to enter my password after un-blanking the screen. (However, given the behavior described below it's not clear exactly what this function actually does - maybe it just logs you out? maybe it reboots the machine?)  The problem is that a simple screen lock, which one would expect to lock the screen without affecting the state of any applications, in fact closes all applications that are open when the screen lock activates. In other words, if you have the screen lock set to 5 minutes, and you walk away from your machine to get a sandwich or whatever, when you come back and unlock the machine all your apps have closed without saving their state. So far, the only work-around I have found is to entirely disable screen locking in Ubuntu 17.10. My question is, how can this be fixed so that screen locking works properly - that is: the screen locks on schedule after a period of inactivity, and when unlocked all applications that were running are still running?  I am asking a new question for the following reasons:  1) The existing answers to (and comments on)  do not address the issue, and in fact misrepresent the actual problem in ways that make me think the comment writers have not understood what is happening;  2) I cannot usefully address that question because I do not have sufficient reputation to either upvote the question or comment on it, and I cannot answer the question because I have no idea why this problem occurs;  3) I will probably never achieve a reputation of 15, much less 50, on StackExchange. Which is fine, that's not among my life goals.  4) But this question is important and deserves to be addressed. It is a drastically unacceptable bug.


I managed to install MySQL on Ubuntu 20.04 from the terminal. Everything went perfectly. But why can't I access MySQL like any normal application, i.e., from the menu? The only way I can use it is from the terminal, which is quite uncomfortable. Is this the only way to use this application in Ubuntu? How can I open the normal MySQL window?

Does anyone have any good ideas as to native MySQL GUI clients for Ubuntu?  So far I've tried , which never seemed to work properly,  which I found a bit slow, and  which is a windows port and runs under wine, but none of these is perfect. In an ideal world, I'm looking for something like a native version of navicat.


Let's say I've configured my chrome browser to use an elite proxy for browsing downloading etc,. What information can my ISP see about the connection? Thanks in advance.

What does my internet service provider know about my online activites in these cases?   plain server (www, ftp, whatever) connection and provider's DNS secured (e.g. TLS) server connection and provider's DNS plain server (www, ftp, whatever) connection and an non-provider non-logging DNS secured (e.g. TLS) server (www, ftp, whatever) connection and non-provider non-logging DNS   In case 4) does my provider know anything more about my online behaviour than "IP w.x.y.z was assigned to Foo Bar between connect-time and disconnect-time" (i.e. only the duration my router was connected)?  What traffic does need to go through the provider's infrastructure to make my connection work at all?


There is a desktop application that uses apache.poi to interate a 50,000 line XLSX file and following validation write it to a database for reporting purposes.  The application is finalized as all required functionality works. Developed on a box under OpenSuse 43.3, KDE, 4 x i5-2500CPUs, 16gig RAM. Packaging it out to a jar file sees it run without issue on laptop under same linux and Win 10. However, running it on the development box under Win 10 causes the following error when running the validation method on the file.  Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space         at org.apache.xmlbeans.impl.store.Cur$CurLoadContext.attr(Cur.java:3044)         at org.apache.xmlbeans.impl.store.Locale.loadNode(Locale.java:1440)         at org.apache.xmlbeans.impl.store.Locale.loadNodeChildren(Locale.java:1403)         at org.apache.xmlbeans.impl.store.Locale.loadNode(Locale.java:1445)         at org.apache.xmlbeans.impl.store.Locale.loadNodeChildren(Locale.java:1403)         at org.apache.xmlbeans.impl.store.Locale.loadNode(Locale.java:1445)         at org.apache.xmlbeans.impl.store.Locale.loadNodeChildren(Locale.java:1403)         at org.apache.xmlbeans.impl.store.Locale.loadNode(Locale.java:1445)         at org.apache.xmlbeans.impl.store.Locale.parseToXmlObject(Locale.java:1385)         at org.apache.xmlbeans.impl.store.Locale.parseToXmlObject(Locale.java:1370)         at org.apache.xmlbeans.impl.schema.SchemaTypeLoaderBase.parse(SchemaTypeLoaderBase.java:370)         at org.apache.poi.POIXMLTypeLoader.parse(POIXMLTypeLoader.java:164)         at org.openxmlformats.schemas.spreadsheetml.x2006.main.WorksheetDocument$Factory.parse(Unknown Source)         at org.apache.poi.xssf.usermodel.XSSFSheet.read(XSSFSheet.java:226)         at org.apache.poi.xssf.usermodel.XSSFSheet.onDocumentRead(XSSFSheet.java:218)         at org.apache.poi.xssf.usermodel.XSSFWorkbook.parseSheet(XSSFWorkbook.java:443)         at org.apache.poi.xssf.usermodel.XSSFWorkbook.onDocumentRead(XSSFWorkbook.java:408)         at org.apache.poi.POIXMLDocument.load(POIXMLDocument.java:169)         at org.apache.poi.xssf.usermodel.XSSFWorkbook.<init>(XSSFWorkbook.java:300)         at com.zimpics.eds.app_wa01a.VDate.readFile(VDate.java:97)         at com.zimpics.eds.app_wa01a.VDate.validate(VDate.java:122)         at com.zimpics.eds.app_wa01a.GUI.Application.validateFile(Application.java:507)         at com.zimpics.eds.app_wa01a.GUI.Application.access$600(Application.java:43)         at com.zimpics.eds.app_wa01a.GUI.Application$5.actionPerformed(Application.java:425)         at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)         at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)         at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)         at javax.swing.DefaultButtonModel.setPressed(Unknown Source)         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)         at java.awt.Component.processMouseEvent(Unknown Source)         at javax.swing.JComponent.processMouseEvent(Unknown Source)         at java.awt.Component.processEvent(Unknown Source)   I have no idea how to address this issue. Can somebody point me in the right direction please?

I am writing a client-side Swing application (graphical font designer) on Java 5. Recently, I am running into java.lang.OutOfMemoryError: Java heap space error because I am not being conservative on memory usage. The user can open unlimited number of files, and the program keeps the opened objects in the memory. After a quick research I found  and others saying on Windows machine the JVM defaults max heap size as 64MB.  Given this situation, how should I deal with this constraint?  I could increase the max heap size using command line option to java, but that would require figuring out available RAM and writing some launching program or script. Besides, increasing to some finite max does not ultimately get rid of the issue.  I could rewrite some of my code to persist objects to file system frequently (using database is the same thing) to free up the memory. It could work, but it's probably a lot work too.  If you could point me to details of above ideas or some alternatives like automatic virtual memory, extending heap size dynamically, that will be great.


So say I have a Class:   class Testclass:       def __init__(self, key)           self.key = key             def function(self, key):               do something ...     can I call specifically the function without calling the whole __init__ somewhere down the line inside a Testclass Method?  I need this because I have two functions within __init__ and I need them separately.   Or maybe I am doing this all wrong from the get go, so any other suggestions would be welcome.

What exactly are the Python scoping rules?  If I have some code:  code1 class Foo:    code2    def spam.....       code3       for code4..:        code5        x()   Where is x found?  Some possible choices include the list below:   In the enclosing source file In the class namespace In the function definition In the for loop index variable Inside the for loop   Also there is the context during execution, when the function spam is passed somewhere else. And maybe  pass a bit differently?  There must be a simple reference or algorithm somewhere.  It's a confusing world for intermediate Python programmers.


In  we report and flag spam on the network, and it seems that some of the spam that still passes through the quality filter, has only a URL as title, nothing else. I believe posts like this can be blocked by SE's filter: I've never seen a legitimate post with only a URL in the title (and I also cannot imagine one). Titles that contain a URL can certainly be valid if they have some more title content, but not if there's only a URL. Can posts with URL-only titles please be blocked? That could reduce the amount of spam posts a bit.

On Drupal Answers we just had a spam question (now deleted).  The question's title was, in its entirety:  http://premiumpureforskolinrev.com/metabo-garcinia/   I can't think of a good reason that any reasonable question, on any site in the network, could consist of only a URL.   I think such questions should be blocked before they are asked; can this be implemented?  And another one today (a couple of months later):    Over a year later and it's still going on:    Any chance this could be looked at?  Updating yet again as we just had a particularly disturbing one advertising something called "mutilation theatre". .  I don't think there's any question we do need this, hopefully someone from Stack Exchange will respond this time.


Let $G$ be a finitely generated group of infinite order. Then is there always an element $g$ of infinite order in $G$?

Is it true that every infinite finitely generated group contains an element of infinite period?  I think it is true, but I can't prove it.


Here is a long list of packages that have been kept back:  The following packages have been kept back:   aptdaemon fcitx-frontend-qt5 gir1.2-packagekitglib-1.0 kde-style-breeze     kde-style-breeze-qt4 libfcitx-qt5-1 libkf5archive5 libkf5auth-data     libkf5auth5 libkf5codecs-data libkf5codecs5 libkf5config-data     libkf5configcore5 libkf5configgui5 libkf5configwidgets-data     libkf5configwidgets5 libkf5coreaddons-data libkf5coreaddons5     libkf5guiaddons5 libkf5i18n-data libkf5i18n5 libkf5iconthemes-data     libkf5iconthemes5 libkf5itemviews-data libkf5itemviews5 libkf5style5     libkf5widgetsaddons-data libkf5widgetsaddons5 libkf5windowsystem-data  libkf5windowsystem5 libqt4-dbus libqt4-dbus:i386 libqt4-declarative     libqt4-declarative:i386 libqt4-designer libqt4-network libqt4-network:i386   libqt4-opengl libqt4-opengl:i386 libqt4-qt3support libqt4-script   libqt4-script:i386 libqt4-sql libqt4-sql:i386 libqt4-sql-mysql:i386   libqt4-sql-sqlite libqt4-svg libqt4-xml libqt4-xml:i386 libqt4-xmlpatterns     libqt4-xmlpatterns:i386 libqt5core5a libqt5dbus5 libqt5gui5     libqt5multimedia5 libqt5network5 libqt5opengl5 libqt5positioning5     libqt5printsupport5 libqt5qml5 libqt5quick5 libqt5quicktest5 libqt5script5   libqt5sql5 libqt5sql5-mysql libqt5sql5-sqlite libqt5svg5 libqt5test5   libqt5webkit5 libqt5widgets5 libqt5x11extras5 libqt5xml5 libqtcore4   libqtcore4:i386 libqtdbus4 libqtdbus4:i386 libqtgui4 libqtgui4:i386   python-aptdaemon python-aptdaemon.gtk3widgets python3-aptdaemon     python3-aptdaemon.gtk3widgets qdbus qml-module-qt-labs-folderlistmodel qml-module-qt-labs-settings qml-module-qtgraphicaleffects     qml-module-qtquick-layouts qml-module-qtquick-window2 qml-module-qtquick2   qml-module-qttest qml-module-qtwebkit qmlscene qtchooser   qtdeclarative5-dev-tools 0 upgraded, 0 newly installed, 0  to remove and 94 not upgraded.   I've tried to run this shell script that I made to remove broken packages, but i could not remove any at all:  grep Broken /var/log/dist-upgrade/apt.log | cut -d\   -f2 | while read -r package ; do     echo "Processing $package"     sudo dpkg --remove --force-remove-reinstreq $package     sudo apt-get update done

I just added a PPA repository for the development version of the GIMP, but I get this error:  $ apt-get update && apt-get upgrade ... The following packages have been kept back:   gimp gimp-data libgegl-0.0-0 libgimp2.0   Why and how can I solve it so that I can use the latest version instead of the one I have now?


Can an Arraylist of Custom Objects contain arraylists of other custom objects? And how would that work?  I tried:  public class BankAccount {     private String mTitle;     private float mBalance;     private ArrayList<sE> mHistory;      public BankAccount(String title) {         mTitle = title;         mPrefFile = null;         mBalance = 0;         mHistory = new ArrayList<>();     }      public void changeBalance(float newBalance) {         mBalance = newBalance;     }      public String getTitle() {         return mTitle;     }      public String getPrefFile() {         return mPrefFile;     }      public float getBalance() {         return mBalance;     }      public ArrayList<sE> getHistoryArrayList() {         return mHistory;     }      public void addToHistoryArrayList(String Title, Boolean IsEarning, float Amount) {         mHistory.add(new sE(Title, IsEarning, Amount));     }      //sE stands for Spending/Earning     public class sE {         private String mTitle;         private Boolean mIsEarning;         private float mAmount;          public sE(String Title, Boolean IsEarning, float Amount) {             mTitle = Title;             mIsEarning = IsEarning;             mAmount = Amount;         }          public String getTitle() {             return mTitle;         }          public Boolean getIsEarning() {             return mIsEarning;         }          public float getAmount() {             return mAmount;         }     } }   But when trying to add an sE object to the History Array it gives me an error:     java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.util.ArrayList.add(java.lang.Object)' on a null object reference   How can I fix that? thanks for any help!

What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them?  What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?


In this scene, Uncle Owen says Obi-Wan Kenobi died about the same time as Luke's father. And Owen tells Luke to stop asking about his father.                                  Did Owen know Anakin was Luke's father? I think he would know since otherwise, why else would Kenobi ask him to adopt baby Luke? I can't imagine Kenobi getting away with some excuse like this. "Hey, here's some random baby. Why don't you look after him? Oh, his parents? Nevermind them. They were killed by Jawas on the south ridge." "But Mr. Kenobi, why are you giving us this baby?" "Oh, you look like nice people."  Kenobi surely had to say something about Luke's father. We know he chose Owen and Beru because of the family connection to Anakin. And if he said Luke's father was that local boy who became the galaxy-wide famous Jedi hero of the Clone Wars, then wouldn't everyone from Mos Eisley to Anchorhead know "Hey, there goes Luke. That's the son of Anakin, the Jedi hero. Remember when Anakin was a little slave boy and how he finally won the pod race?"  So what did Uncle Owen and Aunt Beru know of Luke's real father?  The video snippet indicates he seems to know, but didn't know the whole truth (maybe Kenobi lied to him or at least clearly didn't say everything about Anakin's true fate). But Kenobi telling Owen and Beru seems like a major risk given how famous Anakin was and even bringing the baby to them is a major risk.  Owen outright lies to Luke by saying Obi-Wan Kenobi died years ago - about the same time as Luke's father. He knew Obi-Wan Kenobi was that crazy old wizard, Old Ben Kenobi. He should have known that if Luke learned that Obi-Wan Kenobi was still alive, then Luke would not trust him.

In  in Star Wars: A New Hope, Luke speaks with Owen about his father:     Luke Skywalker: But what if this Obi-Wan comes looking for him?      Uncle Owen: He won't. I don't think he exists anymore. He died about   the same time as your father.      Luke Skywalker: He knew my father?      Uncle Owen: I told you to forget it.   Uncle Owen told Luke that Obi-Wan died at the same time as Anakin but do Uncle Owen and Aunt Beru know the truth? That Anakin Skywalker is actually      Darth Vader


I have two arrays of objects, one is update and another is older. I need to to make third array with the values that are not in older one but are in updated one. I read a few answers like one here  but it is filtering the object based on string as values whereas I want to compare the complete object.   test = [{1:'name',2:'tame'},{3:'fame',2:'tame'}] checks = [{3:'fame',2:'tame'},{5:'lame',1:'name'}]  updated = test.filter(n => !checks.includes(n))  console.log(updated)    Expected output was :- [{"1": "name","2": "tame"}] Any help is appreciated :) I found this simple solution.   arr1 = [{1:'a',2:'b'},{1:'a',3:'c'}] arr2 = [{1:'a',3:'c'},{2:'b',3:'c'}]  for(let i = 0; i < arr1.length; i++){   for(let n = 0; n < arr2.length; n++){     if(JSON.stringify(arr1[i]) == JSON.stringify(arr2[n])){         arr1.splice(i, 1)     }   } } console.log(arr1)

A strict equality operator will tell you if two object types are equal. However, is there a way to tell if two objects are equal, much like the hash code value in Java?  Stack Overflow question  is similar to this question, but requires a more academic answer. The scenario above demonstrates why it would be necessary to have one, and I'm wondering if there is any equivalent solution.