MainActivity.java:       import android.media.MediaPlayer;     import android.support.v7.app.AppCompatActivity;     import android.os.Bundle;     import android.view.View;     import android.widget.Button;      public class MainActivity extends AppCompatActivity {          int currentPosition;          @Override         protected void onCreate(Bundle savedInstanceState) {             super.onCreate(savedInstanceState);             setContentView(R.layout.activity_main);              MyListener myListener = new MyListener();              Button startButton = (Button) findViewById(R.id.start);             startButton.setOnClickListener(myListener);              Button pauseButton = (Button) findViewById(R.id.pause);             pauseButton.setOnClickListener(myListener);          }     }   MyListener.java:      import android.media.MediaPlayer;     import android.provider.MediaStore;     import android.support.v7.app.AppCompatActivity;     import android.os.Bundle;     import android.view.View;      public class MyListener extends AppCompatActivity implements View.OnClickListener{          MediaPlayer musicPlayer = MediaPlayer.create(this, R.raw.sound_file);          @Override         protected void onCreate(Bundle savedInstanceState) {             super.onCreate(savedInstanceState);             setContentView(R.layout.activity_my_listener);         }          @Override         public void onClick(View v){              switch(v.getId()){                 case R.id.start:                     musicPlayer.start();                     break;                 case R.id.pause:                     musicPlayer.pause();                     break;             }         }     }   Logcat shows the following error:       java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.android.musicplayer/com.example.android.musicplayer.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference   I am trying to create an app that plays audio from my res/raw file, but there seems to be something wrong with my code as it is not working, please help me.

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?


POI XSSF class Throws NullPointerException when createCell or setCellValue to empty row in existing Excel  If Existing Excel's row is fill with data then .. below code will execute and override the data.. CODE :                    rowsline= sourceSheet.getRow(RowNo);             rowsline.createCell(CellNo);             rowsline.getCell(CellNo).setCellValue(DataValue);             outputStream = new FileOutputStream(file);             srcBook.write(outputStream);   ERROR :        Exception in thread "main" java.lang.NullPointerException       at Source_Program.SourceProgram.SetDataInExcel(SourceProgram.java:146)


When I went into my Minecraft the first thing I saw was a log in with your email and password I wrote my password, email, and username on paper but when I tried it, it said that it was wrong. I never changed computers and I never reset my password in case it would delete my Minecraft servers and worlds. Help?

We just got a new laptop (ASUS) though we did have a mac.  We are trying to log onto Mojang to download Minecraft and it keeps saying, "The username and password are not recognized."   We have done all the usual procedures; we have reset the password, we are using the email, not the username to sign in, and it looks like the minecraft login servers are working etc. etc.  We quit Minecraft on the old computer and shut off that computer thinking that was the issue.   Still, we can't get onto Mojang.  We are accessing mincraft through firefox and trying to download it to the new computer but we can't get into the account to do that!  What in the world could be the issue?


Where can I get indepth tutorials about compositing in blender for Free? Any channel I can get such videos about compositing in blender?

Since asking for tutorials, videos, resources, links to other content or downloads is considered off topic here, this is a specifically created Community Wiki which gathers resources for Blender and it has been approved by the .  Just write in the appropriate answer/section. If you have concerns, questions, post a  question, so we don't clutter the comments, but you can link your meta question from the comments.  Questions regarding such resources are not allowed anymore, except for very specific and on topic requests (ask on  if you're unsure about your question). Follow the instructions made in the question about how to post, what can be posted, etc.  Learning             Assets    (also see: )   Reference Images/Blueprints (also see: )    Tools    (also see: )      Other   Special Interest ()     Also see the .


Is there any grammatical reason why "the" is used in front of acronyms? Such as the UK the US the USSR ?

I'm wondering when to use or not to use the definite article, when using acronyms or initialisms in a sentence. Is there a rule for this, or does it depend on the context?  For example, let's look at some example sentences DDR  = detailed design review.  NASA is planning to launch the final shuttle soon (no article) The FBI shut down this website (article) ESA is a full partner in the ISS (no article, article) The project was cancelled at the DDR. (article)  What confuses me is that if NASA or ESA would be written in full, the article would be necessary.


Suppose $Y\sim N(\mu,\sigma)$ I would like to investigate the distribution of: $$\frac{1}{1+Y}$$ Does the distribution exist and is it well defined? Does it have analytically computable moments? Googling hasn't lead to any concrete results, so I have attempted to derive its PDF using the method of derived distributions (I believe I have succeeded), and I have tried to compute it's mean (I haven't succeeded). My work is as follows: let $X:=\frac{1}{1+Y}$, then: $$F_X(x)=\mathbb{P}\left(X\leq x\right)=\mathbb{P}\left(\frac{1}{1+Y}\leq x\right)=\mathbb{P}\left(\frac{1}{x}-1\leq Y\right)=1-\mathbb{P}\left(Y\leq \frac{1}{x}-1\right)=1-F_Y\left(\frac{1-x}{x}\right)$$ Now (setting $d:=\frac{1-x}{x}$) $$f_X(x):=\frac{\partial}{\partial x}\left(F_X\left(x\right)\right)=\frac{\partial}{\partial x}\left(1-F_Y\left(d\right)\right)=-\frac{\partial}{\partial d}F_Y(d)\frac{\partial d}{\partial x}=-f_Y(d)\left(\frac{-1}{x^2}\right)$$ So we finally have the PDF of $X$ as: $$\frac{1}{x^2}\frac{1}{\sigma \sqrt{t2 \pi}}\exp\left\{-\frac{(d-\mu)^2}{2t\sigma^2}\right\}=\frac{1}{x^2}\frac{1}{\sigma \sqrt{t2 \pi}}\exp\left\{-\frac{(\frac{1-x}{x}-\mu)^2}{2t\sigma^2}\right\}$$ To simplify the above, I will do the following: $$\left(\frac{1-x}{x}-\mu\right)^2=\left(\frac{1}{x}-1-\mu\right)^2=\frac{1}{x^2}-2(1-\mu)\frac{1}{x}+(1-\mu)^2+4\mu=\left(\frac{1}{x}-(1-\mu)\right)^2+4\mu$$ So that: $$f_X(x)=\frac{1}{x^2}\frac{1}{\sigma \sqrt{t2 \pi}}\exp\left\{-\frac{\left(\frac{1}{x}-(1-\mu)\right)^2}{2t\sigma^2}\right\}e^{-\left(\frac{4\mu}{2t\sigma^2}\right)}$$ Now attempting to compute the expectation: $$\mathbb{E}\left[X\right]=\int_{h=-\infty}^{h=\infty}hf_X(h)dh=e^{-\left(\frac{4\mu}{2t\sigma^2}\right)}\int_{h=-\infty}^{h=\infty}\frac{1}{h}\frac{1}{\sigma \sqrt{t2 \pi}}\exp\left\{-\frac{\left(\frac{1}{h}-(1-\mu)\right)^2}{2t\sigma^2}\right\}dh$$ I will use the substitution $v=\frac{1}{h}$, with $dh=\frac{-1}{v^2}dv$: $$\mathbb{E}\left[X\right]=e^{-\left(\frac{4\mu}{2t\sigma^2}\right)}\int_{v=0}^{v=0}\frac{-1}{v}\frac{1}{\sigma \sqrt{t2 \pi}}\exp\left\{-\frac{\left(v-(1-\mu)\right)^2}{2t\sigma^2}\right\}dv$$ The above is where I get stuck, and the fact that the integral limit is from zero to zero makes me think the expectation might no be well defined, in the sense that it is not analytically computable? Any further tips and hints would be greatly appreciated.

The title is the question. I am told that ratios and inverses of random variables often are problematic. What is meant is that expectation often do not exist. Is there a simple, general explication of that?


I am trying to check the convergence of the real infinite  series  $\sum \frac{n!e^{n}}{n^{n}}$. My problem is  i tried for it ratio and root test both but both failed as in both case limit comes to $1$. Please give me a hint for its convergence.Thaks a lot.

Is the following series convergent?  $$\sum_{n=1}^{\infty}\frac{e^n\,n!}{n^n}$$  I treid the Ratio and Root tests, but both of them failed.


(Working in SSMS2016) I have a table as below:  | ORDER_NUMBER | ITEM_CAT| ORDER_QTY | UNALLOCATED| |--------------|---------|-----------|------------| |  1           | FLAT    | 2         | 1          | |  1           | HANG    | 1         | 1          | |  1           | SHOE    | 2         | 1          | |  2           | FLAT    | 1         | 1          | |  2           | FLAT    | 1         | 1          | |  3           | SHOE    | 1         | 1          | |  3           | SHOE    | 1         | 1          | |  3           | SHOE    | 1         | 1          | |  4           | FLAT    | 1         | 1          | |  4           | SHOE    | 1         | 1          | |  4           | FLAT    | 1         | 1          | |  4           | SHOE    | 1         | 1          |   If I do   SELECT ORDER_NUMBER, ITEM_CAT, SUM(ORDER_QTY) AS 'ORDER_QTY', SUM(UNALLOCATED) AS 'UNALLOCATED'  FROM TABLEA  GROUP BY ORDER_NUMBER, ITEM_CAT   I get the below:  | ORDER_NUMBER | ITEM_CAT| ORDER_QTY | UNALLOCATED| |--------------|---------|-----------|------------| |  1           | FLAT    | 2         | 1          | |  1           | HANG    | 1         | 1          | |  1           | SHOE    | 2         | 1          | |  2           | FLAT    | 2         | 2          | |  3           | SHOE    | 3         | 3          | |  4           | FLAT    | 2         | 2          | |  4           | SHOE    | 2         | 2          |   Ideally, I'm looking to get just a single row for each ORDER_NUMBER, and list the unique ITEM_CAT values in the same row, so something like:  | ORDER_NUMBER | ITEM_CAT             | ORDER_QTY | UNALLOCATED| |--------------|----------------------|-----------|------------| |  1           | FLAT / HANG / SHOE   | 5         | 3          | |  2           | FLAT                 | 2         | 2          | |  3           | SHOE                 | 3         | 3          | |  4           | FLAT / SHOE          | 4         | 4          |   Can this be easily achieved?  Thanks.

I'm trying to migrate a MySQL-based app over to Microsoft SQL Server 2005 (not by choice, but that's life).  In the original app, we used almost entirely ANSI-SQL compliant statements, with one significant exception -- we used MySQL's group_concat function fairly frequently.  group_concat, by the way, does this: given a table of, say, employee names and projects...  SELECT empName, projID FROM project_members;   returns:  ANDY   |  A100 ANDY   |  B391 ANDY   |  X010 TOM    |  A100 TOM    |  A510   ... and here's what you get with group_concat:  SELECT      empName, group_concat(projID SEPARATOR ' / ')  FROM      project_members  GROUP BY      empName;   returns:  ANDY   |  A100 / B391 / X010 TOM    |  A100 / A510   So what I'd like to know is: Is it possible to write, say, a user-defined function in SQL Server which emulates the functionality of group_concat?   I have almost no experience using UDFs, stored procedures, or anything like that, just straight-up SQL, so please err on the side of too much explanation :)


My camera, aimed at a motionless object, is mounted on a tripod. Do I get a different image by changing exposure time and the diaphragm in such a way that the total amount of light coming in stays the same?

Ok, here's my doubt. Suppose I want to get a certain exposure for an image. Keeping the ISO constant, there are two tentative possibilities here:   Put the camera at f 1.4 (say) and at 1/1600 shutter speed (suppose). Put aperture at f 8.0 (say) and shutter speed at 1/50 (suppose).   Both would get me the exact same exposure. Yes, for the latter, I may have to use a tripod. But the question being, what would be the difference in the image thus obtained? I can fairly interchange the settings for the same shot (theoretically). Or can't I?


So today I am working on a huge warehouse scene so I need to be very efficient with my geometry and obviously instancing will be a huge help.  I want to place the empty that represents the collection neatly over the instanced object, but instead that empty wants to be in a totally different location which does not look very clean.  I have tried applying the location, setting it from the world origin, resetting the origin point for the base object and I can't figure it out.     What I want is in the second image. (keep in mind the second image is just an empty I placed over the lockers to give you a visual for what I am trying to achieve )   Seems like there should be a simple way to place this thing.

I have created an Collection Instance, when I try to move it, the origin(to snap at vertices or edges) is far away from the object, I want to set it.    In the image, the Collection Instance is selected, the cross is far away from the object and I can´t set it using "Set Origin to 3D Cursor"  What Am I missing?


I am using UBUNTU 16.04. My wifi keep disconnecting again and again!! The output of lspci -knn | grep Net -A2 is:  06:00.0 Network controller [0280]: Realtek Semiconductor Co., Ltd. RTL8723BE PCIe Wireless Network Adapter [10ec:b723] DeviceName:   Subsystem: Hewlett-Packard Company RTL8723BE PCIe Wireless Network Adapter [103c:2231]   Output of lsusb is:  Bus 002 Device 003: ID 0bda:b001 Realtek Semiconductor Corp.  Bus 002 Device 002: ID 0438:7900 Advanced Micro Devices, Inc.  Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 001 Device 004: ID 064e:c341 Suyin Corp.  Bus 001 Device 003: ID 138a:0050 Validity Sensors, Inc. Swipe Fingerprint Sensor Bus 001 Device 002: ID 0438:7900 Advanced Micro Devices, Inc.  Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub   Output of lspci is:  00:00.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Device 1566 00:01.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Mullins [Radeon R4/R5 Graphics] (rev 05) 00:01.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Kabini HDMI/DP Audio 00:02.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Device 156b 00:02.1 PCI bridge: Advanced Micro Devices, Inc. [AMD] Family 16h Processor Functions 5:1 00:02.2 PCI bridge: Advanced Micro Devices, Inc. [AMD] Family 16h Processor Functions 5:1 00:02.3 PCI bridge: Advanced Micro Devices, Inc. [AMD] Family 16h Processor Functions 5:1 00:02.4 PCI bridge: Advanced Micro Devices, Inc. [AMD] Family 16h Processor Functions 5:1 00:08.0 Encryption controller: Advanced Micro Devices, Inc. [AMD] Device 1537 00:10.0 USB controller: Advanced Micro Devices, Inc. [AMD] FCH USB XHCI Controller (rev 11) 00:11.0 SATA controller: Advanced Micro Devices, Inc. [AMD] FCH SATA Controller [AHCI mode] 00:12.0 USB controller: Advanced Micro Devices, Inc. [AMD] FCH USB EHCI Controller (rev 39) 00:13.0 USB controller: Advanced Micro Devices, Inc. [AMD] FCH USB EHCI Controller (rev 39) 00:14.0 SMBus: Advanced Micro Devices, Inc. [AMD] FCH SMBus Controller (rev 42) 00:14.2 Audio device: Advanced Micro Devices, Inc. [AMD] FCH Azalia Controller (rev 02) 00:14.3 ISA bridge: Advanced Micro Devices, Inc. [AMD] FCH LPC Bridge (rev 11) 00:18.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Device 1580 00:18.1 Host bridge: Advanced Micro Devices, Inc. [AMD] Device 1581 00:18.2 Host bridge: Advanced Micro Devices, Inc. [AMD] Device 1582 00:18.3 Host bridge: Advanced Micro Devices, Inc. [AMD] Device 1583 00:18.4 Host bridge: Advanced Micro Devices, Inc. [AMD] Device 1584 00:18.5 Host bridge: Advanced Micro Devices, Inc. [AMD] Device 1585 01:00.0 Display controller: Advanced Micro Devices, Inc. [AMD/ATI] Jet XT [Radeon R5 M240] (rev ff) 02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 10) 06:00.0 Network controller: Realtek Semiconductor Co., Ltd. RTL8723BE PCIe Wireless Network Adapter 07:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTS5227 PCI Express Card Reader (rev 01)   Output of dmesg | grep -i firmware is:  [    0.326620] [Firmware Bug]: ACPI: BIOS _OSI(Linux) query ignored [    0.894754] [Firmware Bug]: ACPI: No _BQC method, cannot determine initial brightness [    0.896423] [Firmware Bug]: ACPI: No _BQC method, cannot determine initial brightness [    0.905790] acpi PNP0A08:00: [Firmware Info]: MMCONFIG for domain 0000 [bus 00-3f] only partially covers this bridge [    1.940849] [Firmware Bug]: ACPI: No _BQC method, cannot determine initial brightness [    1.940874] [Firmware Bug]: ACPI: No _BQC method, cannot determine initial brightness [    2.074380] [drm] Found VCE firmware/feedback version 40.2.2 / 15! [   10.624914] rtl8723be: Using firmware rtlwifi/rtl8723befw.bin

Only when I'm closer to the router, it shows any signal, but when I'm just little far from it, it is not showing wifi routers signals.


I have only started learning in blender on my own and don't really have a teacher I could ask for help. I saw two blender tutorials on UV mapping for beginners, but found myself unable to follow along because of a different layout of the uv mapping. Both autthors of tutorials seemed to have the same layout, preview, surface and such. But my layout was different and I don't know how to fix it. Additional images of how it looks in my blender and how it looked in the tutorials

Complete beginner here.  I'm trying to follow  tutorial on Anisotropic shaders, but my property panel looks nothing like the property panel in the tutorial.  For example, when creating a material, this is what his property panel looks like:    But this is what mine looks like, if I follow the same path:    I'm sure I'm missing something obvious.  How can I see the property panel shown in the tutorial?


I got my google play and google play services deleted from my rooted phone.I had moved all the apps on internal apps to my partitioned sd card,which got corrupted.Tried installing google play apk and services from other sites but they would not install. Phone model:Galaxy Y S5630  Need your help.

I have recently installed a custom ROM and cannot find the Play Store. It seems like all apps that belong to Google are missing.  How can I install the Google Apps Package (Play Store, ...) on my Android device?


I'm still a student and something funny that I've seen is that many mathematicians evade the question, "What is mathematics?" And when they don't evade it, every person gives a different definition. So I was wondering, and I think this is the best place to ask: What is mathematics specifically?   I think it is a very curious question and I just want to see what you think.

we all study mathematics , and all of us learn mathematical methods to solve problems , we learn how to prove , how to think mathematically   but the question is, what is mathematics ? how can we define it as a branch of science ?


Let $L$ be a first-order language consisting of only relation symbols (no function symbols, no constant symbols). Let $M = (S,\iota)$ and $M' = (S',\iota')$ be two $L$-structures. The two structures $M$ and $M'$ are said to be isomorphic if there is a bijection $h\colon S\to S'$ such that for every relation symbol $R$ in $L$ and tuple $s_1, s_2,\dots,s_{\text{arity}(R)}$ of elements in S, we have $(s_1,s_2,\dots,s_{\text{arity}(R)})\in \iota(R)$ iff   $(h(s_1),h(s_2),\dots,h(s_{\text{arity}(R)})) \in \iota'(R)$. For any given finite $L$-structure $M$, show that there exists a first-order sentence $\phi_M$ such that any structure $M'$ satisfies $\phi_M$ iff $M$ and $M'$ are isomorphic.    I was trying to write a first order sentence for $\phi_M$. I don't know how to show the bijection in between $S$ and $S'$ because in $\phi_M$ the universe is $S$.

The answer seems to be yes, judging from the following exercise I found in the book Mathematical Logic by H.D. Ebbinghaus, J. Flum, and W. Thomas:     Let $S$ be a finite symbol set and let $\mathfrak{U}$ be a finite $S$-structure. Show that there is an $S$-sentence $\varphi _{\mathfrak{U}}$ the models of which are precisely the $S$-structures isomorphic to $\mathfrak{U}$.   I think I have an idea of how to solve this exercise, but I seem to be unable to materialize it. Thanks.


How about making something like chitchat.stackexchange.com where people would not have to necessarily ask questions but be more like a regular forum format to discuss things.  There could still be up/down votes but does not have to be a "best answers" feature.  Right now it's hard to start off-topic discussion as it is quickly killed by moderators and worst off you get a few down votes for something like that and lose reputation points.  I think many people sometimes want to just hang out and talk to other members of this site, maybe to share ideas or say something, but not necessarily in a form of a question.  I know there is a chat, but chat is something real-time. In chat you limited to talking to people who are already there in that chatroom with you at the same time. What if a want to post a topic and then check responses the next day and the next day....

Sometimes you just want to let out some steam, and troll about some technology or software. You are not looking for any answers, but for users with similar experiences and interesting stories. So why not create a separate discussion site (trolling.stackoverflow.com?), where you could ask questions like "why do you hate technology X" or "What are the stupidest bugs you encountered in X"?


When I increment the y axis by 0.01, the numbers encounter a rounding error for some weird reason.  \documentclass[tikz]{standalone} \begin{document} \begin{tikzpicture}   \foreach \y in {0.01, 0.02, ... 0.1}{     \draw (0, \y cm) -- (-0.1cm, \y) node[left] {$\y$};   } \end{tikzpicture} \end{document}

How come that in the code below, \foreach is unable to give me round numbers?  \documentclass{standalone} \usepackage{tikz} \usepackage{pgfplots}  \usetikzlibrary{positioning, calc}  \begin{document}     \begin{tikzpicture} \foreach\x in {0.1,0.2,...,0.9}\node at (0,{-2*\x}){\tiny\x};     \end{tikzpicture} \end{document}


Would I be off base if I suggested (or created) the word "sciophile"? Meaning "one who loves science".

I'm searching for a one-word synonym for "science lover". In my case, I love science and I self study it, but I never got a degree in Physics or Chemistry or any of these related subjects (except computer-science). But I enjoy experimenting stuff and see what's going on.  So, what would be a one-word good alternative for "science lover"?  The best one I found is learner, but that's more general I guess. Scientist is probably too much in my case. I saw sciencophile in another post, but I don't really like it–it sounds too complicated.


I'm a newbie :)   My context: I installed Ubuntu in a desktop behind a proxy that needs authentication, its very very boring because I need to configure proxy's URL, and to enter my username and password in everything, example: firefox, eclipse, and etc...   I need something to leave it in a transparent way(for programs, it would be as if they are in a direct connection)  There is a natively way (or third-party program) that allows to storage my proxy authentication(preferably, encrypted), and Ubuntu ALWAYS use this information to ALL System and software?

How do you configure proxy settings in the Ubuntu Server or Minimal (CLI) versions using the terminal?


I have this code:    in a.h file:  #ifndef A_H_ #define A_H_  class Class_Hierarchy{ public:     std::map<const Type*, std::set<const Type*>> map;     Class_Hierarchy(){             std::map<const Type*, std::set<const Type*>> map;     }  };  template<class T> class BASE_Polymorphic {     friend T; //only the actual type can register this class at the CASTS data structure.  private:     void Register_Inheritence(const Type *base); public:     virtual ~OOP_Polymorphic() {}     static const Type *Get_Type();     virtual const Type *My_Type(); };  class CASTS{ private:     static Class_Hierarchy classHierarchy; public:     static void Register_Inheritence(const Type *derived, const Type *base);      template<typename Dst, typename Src>     static Dst new_static_cast(Src src);      template<typename Dst, typename Src>     static Dst new_dynamic_cast(Src src);  };  #include "a.cpp" #endif /* A_H_ */   and in a.cpp file:  #ifndef A_CPP_ #define A_CPP_  #include "hw5.h" #include <type_traits> #include <typeinfo>  inline void CASTS::Register_Inheritence(const Type *derived, const Type *base) {     std::map<const Type*, std::set<const Type*> >::iterator it;     it = CASTS::classHierarchy.map.find(derived); }  #endif /* A_CPP_ */   I have another file called test.cpp which #includes a.h and uses it's code.  At first I had map as a static private data member in CASTS and had it's initialization in a.cpp, but I had undefined reference to BASE_Polymorphic member functions, so I included a.cpp in a.h.  Then I had another problem, I couldn't initialize map (private static data member of CASTS class) in the cpp file because I started getting multiple definition error. Therefore I tried making Class_Hierarchy which has map as a public data member and make a static instance of Class_Hierarchy in CASTS class to use its map, but I'm getting undefined reference to CASTS::classHierarchy.  I can't think of a solution for both problems, How can I keep the template class in the header file and have a static member in CASTS class?  Right now the only error I have is undefined reference toCASTS::classHierarchy'`.  EDIT:  I had an error of multiple definition for every member function, so I added #include guards on a.cpp file.

What is the best way to initialize a private, static data member in C++?  I tried this in my header file, but it gives me weird linker errors:  class foo {     private:         static int i; };  int foo::i = 0;   I'm guessing this is because I can't initialize a private member from outside the class.  So what's the best way to do this?


I have input values like user can upload a photo, enter a username, password...etc   I want to test the SQL injection by myself and I want some way to prevent it.  I am using MySQL I know some of you will say use PDO or MySqli BUT at this time I am still having Mysql as database.  Thank You!

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?


w = ['a','b','c','d','e','f','g','h']    l = []  a = w[0:2] b = w[2:4] c = w[4:6] d = w[6:8]   l = [a,b,c,d]              #[['a', 'b'], ['c', 'd'], ['e', 'f'], ['g', 'h']]   How can i get the same result ('w' to 'l') using loop method instead of slicing multiple times? Assuming  i dont know how many characters can there be in 'w' variable (in this example it is just from 'a' to 'h'), and slicing will always start from 0 but the range in unknown(where in this example it is 0:2)  Thank You very much.

I have a list of arbitrary length, and I need to split it up into equal size chunks and operate on it. There are some obvious ways to do this, like keeping a counter and two lists, and when the second list fills up, add it to the first list and empty the second list for the next round of data, but this is potentially extremely expensive.  I was wondering if anyone had a good solution to this for lists of any length, e.g. using generators.  I was looking for something useful in itertools but I couldn't find anything obviously useful. Might've missed it, though.  Related question:


I want to resize my root partition using Gparted but before doing it I want to make sure I'm doing it correctly. Here is a screenshot of my GParted:    I know this question has been answered before here:  but the answer is too old and I want to know will that work in Ubuntu 18.04 or I have to try other method. And also is it better to mess around with Gparted or Uninstall and reinstall ubuntu

I want to resize my root partition using Gparted but before doing it I want to make sure I'm doing it correctly.  Here is a screenshot of my GParted:    So, my question is:  Assuming I launch Ubuntu from a LiveCD and I get to run GParted how should I give space from the home folder to the root folder knowing that the SWAP is in the middle?  What is the correct process to minimize the risk of screwing up?


I have Realme Pro 2 (ColorOS 6 and Android 9). I updated Facebook from Play Store.  After update, the new version is Facebook 260  And the issue is:    Even I don’t this see option:   Then, I uninstalled and reinstalled Facebook and issue not resolved.  I downloaded previous version (250) and installed.  It’s okay and easy to use. Facebook 250 is working fine and I don’t want to update it. Auto-update is also OFF from Play Store. However, it gets updated automatically.  Pls let me know,  how to resolve issue with new version or how to stop it to get updates automatically?  Thank is advance.  Regards FewL

I have the Facebook app installed on my Android 7 phone.   Auto-update is disabled for all applications on my Play Store account I have disabled installation from unknown sources   For some reason, whenever there is an update of the Facebook app, it automatically updates itself even though I disabled auto-updates for all applications.  How to stop the Facebook app from updating itself automatically?


I have an object that is having multiple child objects. I want to perform certain actions only if the current record has child records associated with it. For this I am checking the related list's size first, dynamically.But I am facing issues while saving my code :   for(Lead objLeadRec : lstLead) {     for(LC_Setup_Map_Related_List__c objRelatedList1 : lstRelatedListRecords){         relatedChildObjName = objRelatedList1.tdc_tlc__Child_Object__c.replace('__c','s__r');          System.debug('relatedChildObjName'+relatedChildObjName);         if(objLeadRec.relatedChildObjName.size() >0){             hasRelatedListRecords = true;         }     } }   I am facing issue on this line, since the list name which I want to query, I have created using a string ,   if(objLeadRec.relatedChildObjName.size() >0){   Can anyone suggest any workaround. Can't hardcode object names as this code belongs to a managed package and the object names can be different in different orgs.

I have a contact in a generic sObject in apex and while I'm able to easily get detail field values using   sObject.get('MyContactField__c')  I'm not able to get fields off the related parent object, and I'm sure the related field is in memory, based on the debug logs. This returns a runtime error:  sObject.get('Account.MyAccountField__c')  with the error     Invalid field Account.MyAccountField__c' for Contact   How do I get a field value off of a parent on a generic sObject?


While writing tests, some of the target code behaves differently depending on the value of a certain environment variable. In order to test its functionality, I need to change the variable and execute the code being tested. Unfortunately, there seems to be no sensible way to do it from within our Spek tests. The map that System.getenv() gives me is read-only.

How do I set environment variables from Java?  I see that I can do this for subprocesses using . I have several subprocesses to start, though, so I'd rather modify the current process's environment and let the subprocesses inherit it.  There's a System.getenv(String) for getting a single environment variable. I can also get a Map of the complete set of environment variables with System.getenv(). But, calling put() on that Map throws an UnsupportedOperationException -- apparently they mean for the environment to be read only. And, there's no System.setenv().  So, is there any way to set environment variables in the currently running process?  If so, how?  If not, what's the rationale?  (Is it because this is Java and therefore I shouldn't be doing evil nonportable obsolete things like touching my environment?)  And if not, any good suggestions for managing the environment variable changes that I'm going to need to be feeding to several subprocesses?


Definition Modular Arithmetic: Based on the definition of modular arithmetic, $a \equiv b \pmod{m}$ is meant to say that $a$ will leave the same remainder as $b$ when either $a$ or $b$ are divided by $m$. So the remainder of $\frac{a}{m}$ would be the same as $\frac{b}{m}$. In a , it was asked to find the integer $a$ such that $a \equiv 99 \pmod{41}$ and $100 \le a \le 140$. Question 1: A solution to that was, "It's also good to note that for $x \equiv y \mod z$, $x$ is just the remainder of integer division of $y$ by $z$. For example, $35/14$ is equal to $2$ remainder $7$, and $7 \equiv 35 \mod 14$." But is this is not the same as the definition provided above, is not it?

I am trying to write the Euclidean algorithm in the following way:  $A = \lfloor A \div B \rfloor \times B + (\text{remainder of}) \: A \div B $   Now is there any symbol I can use  to say "remainder of A $\div$ B"? I know that in the C programming language there is the operator % for modulus; is that a valid symbol in maths? Can I write A % B? Or is there some other way?


While we were studying pure rolling of bodies in the chapter rotation we were told that energy conservation holds if a body is purely rolling ( The point of contact between the rolling body and ground is stationary w.r.t. ground ). Considering a person to be system. Whenever the person walks his point of contact with the ground does not move. So apparently the only force(s) which acts on him are $(m_{man} + m_{clothes}) \cdot g,$ static friction and normal due to ground. Now energy can be conserved because normal and $mg$ while cancelling out each other are also perpendicular to the direction of walking. And since the force acting is static friction energy can be conserved. However if this is the case a person should not tire while walking becuase his energy is conserved. But practical experiences deny this. So what part of the work am I missing.

I read the definition of  as  $$W ~=~ \vec{F} \cdot \vec{d}$$  $$\text{ Work  =  (Force) $\cdot$ (Distance)}.$$ If a book is there on the table, no work is done as no distance is covered. If I hold up a book in my hand and my arm is stretched, if no work is being done, where is my energy going?


I expanded my vault and added more living quarters and built storage. I have enough resources im fairly sure. The three women are working, but that shouldn't be a problem. I don't know if being armed with weapons would do anything, but they are armed. This is really confusing...

I am playing Fallout Shelter on my IPad. There were some women who have already gave birth, but two female dwellers are carrying their babies for about 18(!) hours. I know that this process takes three hours, so this is not normal. What do I do?


I have keypair (u,r), and two pieces of data, X and Y.  I reveal X publicly but keep Y secret. Y has high entropy.  I then combine X and Y, into c(X,Y) = Z.  I encrypt Z, into "encrypt(Z,u) = Q".  r is needed to decrypt Q back into Z.  Can I prove (including interactive zero-knowledge proofs) that Q contains X, without revealing r or Y?  Please help! Thank you very much.

I have keypair (u,r), and two pieces of data, X and Y.  I reveal X publicly but keep Y secret. Y has high entropy.  I then concatenate X and Y, into Z.  I encrypt Z, into "encrypt(Z,u) = Q". r is needed to decrypt Q back into Z.  Later, (when it doesn't matter), r will be revealed and everyone will decrypt Q into Z. At that point, everyone will know that, all along, Q "contained" X. Can I prove that Q contains X before r is revealed (including interactive zero-knowledge proofs)?


I'm a US citizen as is my son. Due to COVID-19, I was unable to renew my son's passport. We have tickets and are supposed to travel to Spain within the next two weeks. He also has a current Spanish passport (holds dual citizenship). Will I have trouble boarding the plane or leaving/entering the US? I can provide a birth certificate, street address and school ID if needed. Will I need other documents, or can I get a letter from your agency to assist me with this endeavor?

The law requiring US citizens to "bear" a US passport when leaving and entering the US is the Immigration and Naturalization Act section 215, found at 8 USC § 1185, Travel control of citizens and aliens, subsection (b). I need to take my baby back to my home country soon since my job in United States is ending in the July and I managed to get my baby a foreign passport. However I cannot get a United States passport for her since they stopped issuing United States passport and will delay for months. What is the best way to leave the USA without violating this law? Is it possible to get approval or should I get a lawyer for help on this? What type of lawyer should I have? Any experience with this? Thanks for the comments: For departure, we get many comments about no one enforcing the law, but still it is a law... We are worried that the penalty will change in future and affect my daughter in future, which could be several decades. For return, I will definitely apply in overseas Embassy in future. But another issue is will my daughter lose her citizenships if she leave USA with a foreign passport? Update in May 2021. No one really ask about the US passport for my daughter during the travel. The passport was sent to my friend and then mailed to me in last September.


I want to overwrite a GetHashCode method with following code:  public override int GetHashCode() {     var magicNumber1 = 5;     var magicNumber2 = 3;      return intType * magicNumber1 +            (int)enumType * magicNumber2; }   Is this a proper way of returning GetHashCode when one value is Integer and second an Enum?

In .NET, the  is used in a lot of places throughout the .NET base class libraries. Implementing it properly is especially important to find items quickly in a collection or when determining equality.  Is there a standard algorithm or best practice on how to implement GetHashCode for my custom classes so I don't degrade performance?


I have the following XML (only part of it, can't share it all as its confidential):  <?xml version="1.0" encoding="utf-8"?> <Report xsi:schemaLocation="Aircraft_SpecSheetDetails" Name="Aircraft_SpecSheetDetails" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="Aircraft_SpecSheetDetails">     <Aircraft_SpecSheet_SUB_SpecificData>         <Report Name="Aircraft_SpecSheet_SUB_SpecificData">             <table8 Textbox29="No">                 <Detail_Collection>                     <Detail OperWeightType_Description="Maximum Landing Weight" AcrftOperWeight_Current_KG="43000" AcrftOperWeight_Current_LBS="94799" />                     <Detail OperWeightType_Description="Maximum Take Off Weight" AcrftOperWeight_Current_KG="50300" AcrftOperWeight_Current_LBS="110893" />                     <Detail OperWeightType_Description="Maximum Zero Fuel Weight" AcrftOperWeight_Current_KG="40800" AcrftOperWeight_Current_LBS="89949" />                     <Detail OperWeightType_Description="Basic Empty Weight" AcrftOperWeight_Current_KG="27841" AcrftOperWeight_Current_LBS="61379" />                 </Detail_Collection>             </table8>         </Report>     </Aircraft_SpecSheet_SUB_SpecificData> </Report>   I want to grab the Detail element with a specific value in the OperWeightType_Description attribute.  My XPath looks like this: //Detail[@OperWeightType_Description='Maximum Landing Weight']  It works using this tool:   But in C#, the code below doesn't work - the weightNode remains NULL.  private int? ImportWeightValue(XmlNode report, string weightDescription) {     XmlNode weightNode = report.SelectSingleNode($"//Detail[@OperWeightType_Description='{weightDescription}']");      if (weightNode != null)     {         return weightNode.ReadInt("AcrftOperWeight_Current_KG");     }      return null; }   The report XmlNode in the parameter is the DocumentElement -- the <Report> element of the XML.

I've got an XML document with a default namespace. I'm using a XPathNavigator to select a set of nodes using Xpath as follows:     XmlElement myXML = ...;   XPathNavigator navigator = myXML.CreateNavigator(); XPathNodeIterator result = navigator.Select("/outerelement/innerelement");   I am not getting any results back: I'm assuming this is because I am not specifying the namespace. How can I include the namespace in my select?


Is there another way to do this without the XML function? I've tried following   I'm having issues trying to run this on SQL Server 2008 R2.  Conversion failed when converting the varchar value ',' to data type int.  Select distinct ST2.id      substring(         (             Select ','+ST1.id AS [text()]             From dbo.idstable ST1             Where ST1.id = ST2.id             ORDER BY ST1.id             For XML PATH ('')         ), 2, 1000) [idstable] From dbo.idstable ST2

I'm trying to migrate a MySQL-based app over to Microsoft SQL Server 2005 (not by choice, but that's life).  In the original app, we used almost entirely ANSI-SQL compliant statements, with one significant exception -- we used MySQL's group_concat function fairly frequently.  group_concat, by the way, does this: given a table of, say, employee names and projects...  SELECT empName, projID FROM project_members;   returns:  ANDY   |  A100 ANDY   |  B391 ANDY   |  X010 TOM    |  A100 TOM    |  A510   ... and here's what you get with group_concat:  SELECT      empName, group_concat(projID SEPARATOR ' / ')  FROM      project_members  GROUP BY      empName;   returns:  ANDY   |  A100 / B391 / X010 TOM    |  A100 / A510   So what I'd like to know is: Is it possible to write, say, a user-defined function in SQL Server which emulates the functionality of group_concat?   I have almost no experience using UDFs, stored procedures, or anything like that, just straight-up SQL, so please err on the side of too much explanation :)


Basically this is the action I want to achieve:  Please type your new password: 1234 Please enter your password: 1234 This password is correct. (And Vice Versa)   Everytime I launch or edit this code, all I get is "This password is incorrect" P.S: I'm new to all this! This is my main class:   package PasswordValidation; import java.util.Scanner;  public class Main { public static void main(String[] args){     Scanner kbrdIn = new Scanner(System.in);      PasswordDB pwdObject = new PasswordDB();         System.out.println("Please type your new password: ");      String userPwd;         userPwd = kbrdIn.nextLine();      pwdObject.setPwd(userPwd);     pwdObject.checkPwd();          kbrdIn.close();     } }   This is my PasswordDB.java class:  package PasswordValidation; import java.util.Scanner;  class PasswordDB {  Scanner pwdInput = new Scanner(System.in);  private String passWord;  public void setPwd(String name){     passWord = name; }     public String getPwd(){     return passWord; } public final void checkPwd(){      System.out.println("Please enter the password: ");         String pwdIn = pwdInput.nextLine();   if(pwdIn == passWord){      System.out.println("Your password is correct."); }else{      System.out.println("Your password is incorrect.");      }   } }

I've been using the == operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug.  Is == bad? When should it and should it not be used? What's the difference?


Currently i am working on storing Arabic text in MySQL db table using php. but it store text in this ???????? format, interesting things is that same code is working properly on local machine but issue is occurred on live server table field is set to CHARSET=utf8   function con(){     $link = mysqli_connect("", "", "", "");         if (mysqli_connect_errno()) {         printf("Connect failed: %s\n", mysqli_connect_error());         exit();     }      printf("Initial character set: %s\n", mysqli_character_set_name($link));      /* change character set to utf8 */     if (!mysqli_set_charset($link, "utf8")) {         printf("Error loading character set utf8: %s\n", mysqli_error($link));         exit();     } else {         printf("Current character set: %s\n", mysqli_character_set_name($link));     }      return $link; }  function finsert() {     $vReturn = false;     $rQuery = "INSERT INTO tblname(`c1`, `c2`) VALUES (v1, v2)";     $link = con();     if (mysqli_query($link, $rQuery)) {         echo "success";     } else {         echo mysqli_error($link);     } }  finsert();

I'm setting up a new server and want to support UTF-8 fully in my web application. I have tried this in the past on existing servers and always seem to end up having to fall back to ISO-8859-1.  Where exactly do I need to set the encoding/charsets? I'm aware that I need to configure Apache, MySQL, and PHP to do this — is there some standard checklist I can follow, or perhaps troubleshoot where the mismatches occur?  This is for a new Linux server, running MySQL 5, PHP, 5 and Apache 2.


Why does a person sees water in the desert even then when no water is present there at that time? How does this happens?

Often, I'll be driving down the road on a summer day, and as I look ahead toward the horizon, I notice that the road looks like there's a puddle of water on it, or that it was somehow wet. Of course, as I get closer, the effect disappears.  I know that it is some kind of atmospheric effect. What is it called, and how does it work?


I have a question, I posted that on one site, but they consider it more of a career advice question. I am unable to find if there any site of this type?

The  specifically says not to ask  for career advice but people do it anyway.  Should I consider the Help Center outdated or only loosely enforced?    And what about a career advice site on the network?  There are 70+ sites, and most of them are for relatively narrow interests (which is not a criticism, I enjoy looking through the many sections).  A career section seems like it would be very popular.  Also, a careers section would help keep career questions off the other sites.


If velocity is a relative term then a body would possess different Kinetic Energy in different frames of reference. How can a body have different energies simultaneously for different observers ?

If the velocity is a relative quantity, will it make inconsistent equations when applying it to the conservation of energy equations?  For example:  In the train moving at $V$ relative to ground, there is an object moving at $v$ relative to the frame in the same direction the frame moves. Observer on the ground calculates the object kinetic energy as $\frac{1}{2}m(v+V)^2$. However, another observer on the frame calculates the energy as $\frac{1}{2}mv^2$. When each of these equations is plugged into the conservation of energy, they will result in 2 distinct results (I think).


On Workplace.SE, we have come across an interesting user, who seemed to have had a roller coaster ride in his first week at work. Quoting JackArbiter's comment on this user from the  :     This guy asks a question 7 days ago where he "just got" the job. 4 days ago where he works with over 100 devs. Then 2 days ago he works with just over 50 devs, and he's been working there for a while and he wants to defend a junior dev. He gets called out for BS and he states that this account (which is 8 days old) is used by multiple people.    This is the  he is referring to:     This account is used by more than one person hence the different scenarios    In other words, this case seems to be the inverse of a sock puppet (puppet sock?). Let us, for a moment, assume that he is stating the truth. Is there any SE policy against use of the same account by multiple people?  Personally I feel that this should not be allowed as:   Creating a user account is free and easy, no reason why people cannot use their own accounts. It is not at all necessary to share your real name, so there is very little fear of your online post biting you in real life (unless you make it really obvious). You can even ask questions without registration. Most importantly, reputation is tied to privileges. People "pooling" reputation undermines this principle. Since the reputation has been gained by multiple people, we cannot really be sure if the person currently using the account knows the site well enough to use those privileges.   However, I could not find any policy explicitly barring such practice, so we cannot "punish" the user in any way if they have not really violated anything.

It has been my understanding that accounts are suppose to be for a specific user. This user, , is a company: . No doubt, this account has provided some quality answers. However, if a specific user cannot be identified, I don't think that the rep gain, rewards, or badges should be given. This should somehow be tagged as a 'Corporate User'. The rep has no real value when you can't be somewhat sure that the same person is giving the answers all the time.  This is where I found an answer by Devart: , peddling a product.    Edit 2 Good points have been brought up and most I can agree with. But we are setting a precedent. Meta Fudgey brought up a good point about the account's ability to use mod tools responsibly and consistently. Maybe this feature is not available to an account that appears to be an umbrella account unless a single user is identified. I think it is important to consider this aspect.    Let me re-iterate: the user(s) has provided excellent content and I would want that to continue. However, there is more at stake here than meaningful content and helpful resources.      Edit The view on 'shared' accounts wasn't so bright a year ago. For most of us, we have information in our profiles that identifies us as individuals. No, I don't have absolute knowledge of the activities on this account and how many people might use it. Meh, for all we know it could be a knowledgeable programmer with some good PR sense. On the other hand, it could be a PR person with no programming knowledge getting the answers from an employee. Who knows...


Maybe a silly question, but I'm really struggling.  I've created a MySQL Database and Table and am trying to push data into it. The data in question is a unique ID and a load of Javascript.  Code is simple:  $sql = "INSERT INTO TableName (id, code) VALUES ('$uniqueid', '$codeoutput')";   However, whilst I can get the ID in there, I can't get the DB to accept the Javascript (which is currently stored in the variable $codeoutput.  I get the error:     You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax   I'm not that familiar with using MySQL, and I have played around with different data types in PhpMyAdmin, but sadly still no luck.  What am I doing wrong? Do I need to have a very specific setup on the column where I'm storing the code? I'm currently trying to store it as medium text.  Is it something to do with needing to escape special characters? Is there an easy solution to this?

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?


Taking input from a user that would be:  !timeout 60 username reason   !timeout, 60, and username will never have spaces, but it can be assumed that reason will usually have spaces.  I'd hope to end up with:  var1 = "!timeout" var2 = 60 var3 = "username" var4 = "reason"

I have this string  'john smith~123 Street~Apt 4~New York~NY~12345'   Using JavaScript, what is the fastest way to parse this into  var name = "john smith"; var street= "123 Street"; //etc...


For example I have 2 variables:  a = 2 + 2 b = 3 + 3   And now I want to construct a dictionary where keys are variable names, that is “a”, “b” and values are 4 and 6 accordingly.   {x: x for x in (a, b)} # --→  {4: 4, 6: 6}   Question is that I don't know how to make keys “a” and “b” instead of 4 and 6.  str(), str doesn't work. Each time x as a key gets evaluated and becames 4 or 6  Desirable output would be   {a: 4, b: 6}   Thank you!

Say I have a variable named choice it is equal to 2. How would I access the name of the variable? Something equivalent to  In [53]: namestr(choice) Out[53]: 'choice'   for use in making a dictionary. There's a good way to do this and I'm just missing it.  EDIT:  The reason to do this is thus. I am running some data analysis stuff where I call the program with multiple parameters that I would like to tweak, or not tweak, at runtime. I read in the parameters I used in the last run from a .config file formated as  filename no_sig_resonance.dat  mass_peak 700  choice 1,2,3   When prompted for values, the previously used is displayed and an empty string input will use the previously used value.  My question comes about because when it comes to writing the dictionary that these values have been scanned into. If a parameter is needed I run get_param which accesses the file and finds the parameter.   I think I will avoid the problem all together by reading the .config file once and producing a dictionary from that. I avoided that originally for... reasons I no longer remember. Perfect situation to update my code!


Every time I plug in a SD memory card, Image Capture launches, is there a way to disable this? I am running OS X Mavericks.

Everytime I connect my iPhone to my laptop, Image Capture opens. How to I stop it? I just need to use iTunes, not Image Capture.


Is there any needs to change the table structure or which function, so please put the solution here. thanks in advance.  My example is as:   $find_regex = 'Δ'; $replace_regex = '&#916;'; $sql = mysql_query("INSERT INTO regex_table (find_regex, replace_regex, import_date) VALUES ('$find_regex', '$replace_regex')");   When I run the above code, it executed successfully but instead of symbol(find_regex) it insert '?'  One more thing I have already tried all the suggestion likes htmlentities, htmlspecialchar and so on provided in others questions in stackoverflow but didn't resolved.

I'm setting up a new server and want to support UTF-8 fully in my web application. I have tried this in the past on existing servers and always seem to end up having to fall back to ISO-8859-1.  Where exactly do I need to set the encoding/charsets? I'm aware that I need to configure Apache, MySQL, and PHP to do this — is there some standard checklist I can follow, or perhaps troubleshoot where the mismatches occur?  This is for a new Linux server, running MySQL 5, PHP, 5 and Apache 2.


I've got a piece of script in python that parses a line containing date and time:  d = dateutil.parser.parse("%s %s" % (m.group('date'),             m.group('time')), dayfirst=True)   it returns the date in YYYY-MM-DD. How can I get it to say Weekday DD Month YYYY? Or if that is not possible DD-MM-YYYY?   Additionally, it also gives the time in HH:MM:SS, but I only need HH:MM, is there a way to lose the seconds?   Thank you!   I'm a complete novice to python so hope that anyone can help me, thank you very much!

This is my code:  import datetime today = datetime.date.today() print(today)   This prints: 2008-11-22 which is exactly what I want.  But, I have a list I'm appending this to and then suddenly everything goes "wonky". Here is the code:  import datetime mylist = [] today = datetime.date.today() mylist.append(today) print(mylist)   This prints the following:   [datetime.date(2008, 11, 22)]   How can I get just a simple date like 2008-11-22?


I have checked the possible duplicates which flagged up on this and I have attempted research with no conclusion. ELU is my final port of call.  I wrote, on another forum of Stack Exchange :     'the majority of people was concerned about . . .'   And I have just altered it to :     'the majority of people were concerned . . '   and I am now in a state of conflict so great that I cannot eat my breakfast.  Can you help ?

I have the following question:     The majority of fund studies has or have agreed that a common attribute for superior performance is due to managers' skill.


I recently changed the default font using dconf tool. That was ok, and after trying that font, I opened dconf again and clicked "Restore Default" button. Then the screen was unresponsive, I forced it to shutdown. Next when I tried to login, the login screen was ok, but after logging in, nothing would show up, not even launcher, terminal, folders on Desktop etc.,. Only visible things are alert box to ask me to confirm shutting down when I press power button. What might be the reason for this and what are possible solutions?  I tried the solution mentioned for the original question, but I get the error   GtkWarning: Default font does not have a family set GtkWarning: Default font does not have a positive size set   Is there any way to correct this without logging in as a new user?  Tried Solutions:     (for this, I get an error saying  ERROR unity.launcher.trashlaunchericon TrashLauncherIcon.cpp:62 Could not create file   monitor for trash uri:Operation not supported  Segmentation fault(core dumped)             (all the above links are different).  All the above solutions didn't work and one more thing that started happening is when I do  export DISPLAY=:0 ccsm   and enter UI by Ctrl+Alt+F7, it says, CompizConfig-Settings-Manager has stopped working unexpectedly.  I tried re-installing ccsm but, it says, it is already installed and it is the newest version.  OS: Ubuntu 12.04

When I login, nothing happens.   I am presented with my desktop wallpaper.    No Dash, no Launcher, nothing.


I know that the map $f:A\to B$ is a surjective function (onto) if for all $b$ in $B$, there exists an $a$ in $A$ such that $f(a)=b$   But I am having trouble getting started with this proof since it involves the composition of two surjective functions.

Suppose we have two functions, $f:X\rightarrow Y$ and $g:Y\rightarrow Z$. If both of these functions are onto, how can we show that $g\circ f:X\rightarrow Z$ is also onto?


I am trying to prove that the set $\mathbb R^2 \setminus \mathbb Q^2$ is connected.   I don't know if the following is true: could it be that it is also path connected? If that is the case, maybe it's easier to prove path-connectedness and from here one would conclude connectedness. So, I pick two points $x, y \in \mathbb R^2 \setminus \mathbb Q^2$. I think I must separate in cases, so, for example, if $x=(x_1,x_2)$ and $y=(y_1,y_2)$ are such that $x_1$ is irrational and $y_1$ is irrational, how could I join these two points by union of line segments? I am clueless on how to go on.

If I want to prove that $\mathbb{R} \setminus \mathbb{Q}$ is disconnected, does it suffice to say that there are two open disjoint sets that cover $\mathbb{R}\setminus\mathbb{Q}$, namely:  $$(- \infty, 0), (0, \infty)\text{ ?}$$  Along the same lines, I want to prove or disprove that $S = \mathbb{R}^2 \setminus \mathbb{Q}^2$ (points $(x, y) \in S$ that have at least one irrationais connected. I feel that it is also disconnected; does it suffice to say that there are two open disjoint sets that cover $S = \mathbb{R}^2 \setminus \mathbb{Q}^2$, namely $((- \infty, - \infty), (0, 0))$ and $((0, 0), (\infty, \infty))$? (Very iffy on my assertion and my notation, sorry.)  Thanks!


Let $G(V,E)$ be an un-directed, un-connected graph. Prove that $\bar G$ is connected, and that its diameter is at most $2$.  I've started by writing myself some guidelines:   Two vertices will be neighbors in $\bar G$ if and only if they weren't neighbors at $G$.  Undirected means that exists $u,v\in V$ so there's no track between them.   So I need to prove:   $\bar G$ connected  $\bar G$ diameter is 2 at most.   I guess that for (1) i need to prove that for every $u,v\in V$, I can find a track between them. Or, In some way prove that there are at least $n-1$ edges. And for (2) i just don't know.  So i'm pretty much stuck, I can see the logic behind it [been drawing some examples], But I can't see how can I 'merge' between looking at a vertex in $G$ and then in $\bar G$, I know this might be pretty easy. But i just can't 'see' it.  Thanks.

I was tasked to prove that when given 2 graphs $G$ and $\bar{G}$ (complement), at least one of them is a always a connected graph.  Well, I always post my attempt at solution, but here I'm totally stuck. I tried to do raw algebraic manipulations with # of components, circuit ranks, etc, but to no avail. So I really hope someone could give me a hint on how to approach this problem.


Whenever Flash updates, some colleague or friend keeps pressing OK, and without noticing, McAfee Security Scan Plus is installed (and it happened to me several times as well). Then, after a while, a screen pops up, and I get questions from those friends who are worried that their computer is at risk. I've seen this happen so many times, and I cannot ignore it, only remove it once again.   Is there a way to prevent this from happening, no matter if it's downloaded or not? Can I prevent it from downloading somehow? If it's installed, can I prevent it from running? Using the hosts file, marking it as malware in the antivirus program (which can be any antivirus program, but most likely MS Security Essentials, Avast or Kaspersky but of course not Norton or McAfee), or any other method?   I want to get rid of it and I don't want to to deal with it ever again!!!   What's the best way to handle this?

Much like  (and other applications), I've encountered several instances of applications bundling, and luring the user into installing, McAfee Security Scan. Adobe, I'm looking in your direction!  I'll try my best not to install McAfee Security Scan when prompted, or use  (which doesn't install bundled software) when installing applications, but when providing support for my family and friends, it's obvious they don't.  How can I prevent McAfee Security Scan from being installed, e.g. bundled with other applications, in the first place?


I was changing partition style of my hdd but did that to my sdcard instead that was plugged in the laptop. I havent touched the sdcard now, it still has all the space unallocated. It had very important data that i need to get back. Please advice how should I proceed. Kindly help 😅

Are there any tools, methods, incantations to recover recently deleted files on Ubuntu?  If it makes any difference, I want to recover a  2.x database file. But would be better to have a method/tool that works on any kind of file.


I'm trying to host a laravel app on a windows machine and I am trying to find out whether I should use WAMP or WNMP for best speed. Right now I have nginx and php fastcgi running in service wrappers. I have been searching and found threads about nginx having the best scalability due to its event driven nature but I have not been able to figure what happens when the requests start piling up on the php fastcgi process.   the limited on 1024 concurrent connections of the worker of nginx is fine. My only concern is the php behind the windows nginx.  I have yet to find a discussion about the way the php fastcgi server acts with multiple requests (ie. threads, event driven noblocking...etc.)  I have read on some sites about running apache to handle dynamic content while nginx handles all the static content. I'm wondering if that means the best windows config for laravel is for apache to run as a fastcgi (I'm not even sure if that is possible) with mod_php behind an nginx   Thanks in advance to anyone who can clear up my confusion :)  The linked post does contain a discussion of WAMP as a stack vs Windows with each component installed separately, but I'm curious about WEMP/WNMP) vs WAMP  -Chris

This is a  about  the use of a *AMPP's stack.    I recently had a talk with some experienced people and they suggested to me not to use a WAMP stack, and instead install apache, mysql and php separately.  I don't understand why they have suggested this, though, so can anyone tell me?  Is there a particular disadvantage of WAMP, or a particular advantage to installing all of them separately?  Since a WAMP stack itself is composed of apache, mysql and php, then what's the difference between using the WAMP stack and installing them all separately?


If two charged bodies are connected by a string will the tension be F or 2F?(F is the force of repulsion between them)

I'm going to provide my argument for why I think the tension in a rope should be twice the force exerted on either side of it.  First, let's consider a different example. Say, there is a person named A and a block in space. A pushes on the block with a force of 100 N. Then, the block will also push A with a force of 100 N by Newton's third law. Now, consider the case where instead of the block, there is a person B who is also pushing on A with a force of 100 N while A is pushing on him. A will experience a force of 100 N because he pushed on B, AND another 100 N because he is being pushed by B. Hence he will experience a force of 200 N. Similarly, B also experiences 200 N of force.  Now, back to the original problem. There are two people A and B in space with a taut rope (no tension currently) in between them. If only A is pulling and B is not, then I agree that the tension is equal to the force A exerts. This situation (in my opinion) becomes analogous to the above if B is also pulling. So, say both of them pull from either side with a force of 100 N. Then the rope at the end of B will pull B with a force of 100 N (this pull is caused by A). By Newton's third law, the rope will experience a pull of 100 N. But B is also pulling his end of the rope with 100 N. Therefore, the tension should be 200 N. Similarly, the end of the rope at A must pull A with 100 N of force (because B is pulling from the other side) and hence experience a force of 100 N itself by Newton's third law plus another 100 N because A is pulling on the rope.  Apparently, the answer is not this (according to my searching on the web). So, could anyone tell me why this reasoning is wrong? Thanks.  EDIT : So apparently people don't agree with my first example, leave alone the second. This is to the downvoters and the upvoters of the highest-rated answer: You all agree that if only A pushes B with a force of 100 N, then A and B both will get pushed by a force of 100 N in opposite directions, right? Then, in the case where B is also pushing with a force of 100 N, it doesn't make sense that the answer would be exactly the same. It doesn't seem right that no matter what B does, B and A will always experience the same force as they would have if B hadn't applied any force.  EDIT 2 : I'm going to provide here a link to a question that I posted:  According to the answer and the comments there, the reason as to why my first example is incorrect is different to the one provided here. So maybe you should all read the answer and the comments provided by the person and reconsider what you think.


Apparently, the gain of this Op Amp is one, but I can't see how I could figure that out. Can someone help?

What is the value of Vout if we know the value of Vin in this case?    It is a buffer amplifier, but it has two extra resistors so I think that the gain is smaller than 1, but how small?    (Vin-V3)/R1=0 <=> Vin-V3=0 => Vin=V2=V3  (Vout-V2)/R2=0 <=> Vout-V2=0 => Vout=Vin=V2=V3


I wonder how idle games, games where players only make a few clicks to get a game progress, work. These games appear to be running in the background, even when the app is closed. Therefore these games may be implemented on the server side and run on it accordingly. I'm interested in the kind of implementation.   Is there a program running on the server that creates a separate instance for each player and performs the actions accordingly? Or is this realised via a database?   Furthermore I ask myself where the data is stored, on the client (susceptible to manipulation) or on the server (high memory requirements).  Maybe one of you has experience in this area and can give me more information, insights or explain how it works. I am also happy about further reading or links.

A hallmark of many idle games is the ability to still progress (or at least regain resources) while the game isn't active. The device can even be off.  Initially I figured they just calculated progress off system time next time it was started, but they do not appear fooled by messing with the clock.  How do they manage this specific feat?


OS: Ubuntu Server 16.04 LTS,  but willing to find a universal solution.   I have written a script that starts my Minecraft Server. Let's say I want to create a command (e.g. startmc) to start the server without tinkering with the path to the script, cd-ing to directory etc... So, how can I associate some Bash commands to a simple - custom command I can run from the Terminal or SSH?

I have an executable for the perforce version control client (p4). I can't place it in /opt/local because I don't have root privileges. Is there a standard location where it needs to be placed under $HOME?  Does the File System Hierarchy have a convention that says that local executables/binaries need to be placed in $HOME/bin?  I couldn't find such a convention mentioned on the .  Also, if there indeed is a convention, would I have to explicitly include the path to the $HOME/bin directory or whatever the location of the bin directory is?


Prior to Reaper of Souls, flawless square gems were the highest level gem that could be dropped.  With the expansion, Marquis gems are the normal gem pop for a level 70 character.  How can I farm flawless square gems to complete some achievements?

These two achievements require crafting a Radiant Star gem of the four original types: topaz, ruby, emerald, and amethyst.  Finding the recipes is no longer an issue because in the 2.0.1 patch, all gem recipes through Marquise were automatically trained (or gained on jeweler levels - mine started at 10 so I can't check).  So, prior to the expansion, one could farm hundreds of Flawless Square gems at level 60 and slowly work their way up to a Radiant Star.  Unfortunately, once you hit level 61, Flawless Squares no longer drop.  Only Marquise and Imperial gems do.  Given the very small window where Flawless Square gems are eligible to drop, the high number of gems required, and the low amount of experience required to get out of this range, is there any reasonable method for acquiring these two achievements in RoS?


I do not know if that's the correct name for this panel, but I would like to change it to a blue colour, same as the desktop colour.  How to go about it? Thanks  edit:  i tried the suggestion at   to edit the gdm3.css file but after editing with new colour code and rebooting, the colour remains the same. are there other copies of the file in other directories being used beside /etc/alternatives/ ?

How can I change the Ubuntu app drawer background color? or how can I decrease the blur effect, I don't want to see my wallpaper when I'm on the app drawer page.  Too transparent.    I like this background.


I'm sure that throughout the history of mathematics the problem to find solutions of the equation $$a^b = b^a$$ has been raised. The only solution I have found off the top of my head is $$ a = 2, b = 4$$ My question is whether this problem has a name and it it has some relevance in mathematics

We know that $2^4 = 4^2$ and $(-2)^{-4} = (-4)^{-2}$. Is there another pair of integers $x, y$ ($x\neq y$) which satisfies the equality $x^y = y^x$?


I'm new to linux OS so forgive my noobiness.  I installed ubuntu 14.04 on my Windows XP computer as a dual partition using the netinstall mini.iso burned to a cd-r. I had issues with unity desktop running slow so I installed the Xubuntu desktop, everything runs great, I love it and now I want to completely remove all traces of Windows XP and have Xubuntu take over the 50GB of space Windows is currently occupying.  I read in another post that I can go to Settings-Disks, choose the Windows partition and delete it using the - button, then remove the grub so it removes the option for XP at startup.  My question then is, will this then give Xubuntu that 50GB to use or do I have to do this another way?  Any help appreciated, I want my 50GB back lol  Thanks  Jamie

I'm currently dual-booting to either Ubuntu 10.10 or Windows XP. However, I rarely use windows and would like to remove it.  I've use the Ubuntu live CD to access GParted. I've also deleted the windows partitions (I think), which were labeled both ntfs and fat32.  I'm just not sure how to extend the Ubuntu partition to cover the unallocated space. Furthermore, how do I deal with the 'key' designations, which state that a partition is busy.  Help!


Let's say I have a directory called /tmp/main and inside it I have 100 other directories . I want to run a loop through each directory of those directories, for example to make a file with touch test.txt How do I tell the script to process the first, the second, the third and so on?

Suppose I have a directory structure like this:   $ [~/practice] ls a/ b/ c/ d/   Now I want to create a directory tmp1 in all sub directories of practice and I do this:   $ [~/practice] mkdir */tmp1 mkdir: cannot create directory `*/tmp1': No such file or directory   Then I try the -p switch and I endup with a directory named * with a sub directory tmp1   $ [~/practice] mkdir -p */tmp1  $ [~/practice] ls */ a/ b/ c/ d/   I know the use of -p switch is to create multiple nonexistent directories. I just thought it might help.  How do I create tmp1 in all subdirectories at once?   If this can be done, how do I extend it to create \tmp1, \tmp2, \tmp3 in \a, \b and \c at once?  Edit: I missed mentioning that the directories don't have to be simple and in order, like a, b, c etc., and the directory to be created is not necessarily like tmp1, tmp2.    $ [~/practice] ls dog/ cat/ rat/   In them, I would like to have something like   $ [~/practice] ls * dog: red/ blue/  cat: red/ blue/  rat: red/ blue/


Does Windows 98's command.exe invoke a dos prompt or a command prompt? this question is inspired by this!  added Somebody thought that this question was a duplicate of "Does Windows still rely on MS-DOS?" I am not asking if Windows 98 runs on MS-DOS, I know it does. I'm asking specifically if the command prompt or MS-DOS prompt that exists within Windows 98, is a command prompt, or an MS-DOS prompt. And since it has been closed so one can't post an answer. I guess it was called an MS-DOS Prompt in Win98https://www.exclamationsoft.com/exclamationsoft/netmailbot/help/website/HowToOpenADOSCommandWindow.html btw-  command.com  (def not cmd.exe and I suppose there was no command.exe)

I am just about to start an OS course and as an Apple user I am not very familiar with the underlying details of Windows OS. I was wondering, is MS DOS still used with Windows running on top or is ONLY Windows used now as the OS? I was a little confused because I read somewhere that MS-DOS is used for booting but Windows has all other OS capabilities built into it and thus is used for all other OS operations...


My start menu icons don't show. They look like the screenshot below. Clearing the icon cache database file and restarting explorer.exe doesn't seem to work. Is there another solution?

My start menu icons look like this:    I'm using Windows 10 from Windows 7.  How can I make the normal icons appear (not just the shown generic blank icons)?


In this instance, what is being accomplished by the super function?      class A(object):         def __init__(self, <args>):             super(A, self).__init__()   The other questions on StackOverflow involve a Base class that inherits from a parent class. In this particular question, class A has a parameter object (default object, as per Python 2.7 syntax), and the __init__() function has a super call referring to the ___init__() method of object(?). Since object is a default notation, what does this code mean? What exactly is being called when there is no parent class declared?

I'm trying to understand the use of super(). From the looks of it, both child classes can be created, just fine.   I'm curious to know about the actual difference between the following 2 child classes.  class Base(object):     def __init__(self):         print "Base created"  class ChildA(Base):     def __init__(self):         Base.__init__(self)  class ChildB(Base):     def __init__(self):         super(ChildB, self).__init__()  ChildA()  ChildB()


I want to write the name Ibn-Sīnā with macrons over the i and the a. I found out that can I add macrons using \=a and that I need \=i\ to avoid the dot over the i.   When I write Ibn-S\=i\n\=a I get an error, undefined control sequence. If I put a space after the i (Ibn-S\=i\ n\=a) it works, but I don't want a space after the i.   I also tried Ibn-S\=\in\=a but that also generated an error.   How can I do it?

I am working on an article for which I need to use the package amsmath and several newcommands defining logic variables, e.g., \newcommand{\nec}{\mathsf{nec}}. Since the topic of the article is Sanskrit logic, I would also need to be able to type diacritics. I tried with the xunicode package, but this clashes with the newcommands mentioned above. I thus tried to input diacritics one by one, e.g., \={a} for long a (ā) and so on. This works pretty well in most cases, but in the case of the long i I get the wrong result, namely a normal i with an added line over it instead of ī. Does anyone know of the solution? I typeset with XeLaTeX.


Tried substitution $n+2=p$, but it only gets more complicated.   For   $ n=1 $ this is true, but how can I find other  $ n$'s?

What is the largest positive $n$ for which $n^3+100$ is divisible by $n+10$  I tried to factorize $n^3+100$, but $100$ is not a perfect cube. I wish it were $1000$.


This post is dedicated to testing out the . Feel free to answer with your own Stack Snippets!

Notes:  Answers will occasionally be moved to the  when there are too many of them. When using them to report bugs, keep an eye on the post.    This site, Meta Stack Exchange, is usually used as a "test bed" for pending changes happening to the way text is rendered on all network sites. Changes to text rendering that are going to be rolled out to the network are usually deployed here first to test them out and fix any potential glitches. Currently, there are no such changes pending, but if there were, keep in mind that text posted here may render differently from the other sites until the changes roll out to them as well.    As per Jeff's suggestion in : You can use this question as a formatting sandbox. You can:  edit  itself ( questions such as this one require only 100 reputation to edit instead of 2,000) post answers to this question (This question might be , requiring earning 10 reputation on this site to answer) post comments to this question or its answers test suspected bugs with the editor or the rendering post ponies (only when mods are asleep)   Beware that since the  in December 2010, and  added in March 2011, no syntax highlighting is applied unless the question's tags or an inline hint enable it. So, to test highlighting here in the sandbox:  , you can use GitHub-flavor fenced code blocks in your posts, specifying the language after the opening fence: ```html While not hinted otherwise: <html></html> source <b>goes</b> "here". ```  ```js var a = 3; while (not (a > 0)) {     alert("JavaScript code <b>goes</b> here."); } ```   Or:  Create code blocks in any way (using the fence notation above, the four-space indent form, or using HTML <pre><code> tags).  Save your post.  Use your browser's developer tools to edit the resulting HTML. To open developer tools, press F12, or ⌥⌘ I on Mac.  Find the <pre> element and add the attribute class="prettyprint", or change it into one of the valid syntax hints linked above, like class="lang-vb prettyprint".  Run the following in the location bar: javascript:prettyPrint(); or prettyPrint() in the console.     Answers that are considered annoying or obnoxious, or that cause breakage for users, will be deleted. This is .


When I run the command awk -F: '$3>999 {print $1}' /etc/passwd I see this:  nobody tim askubuntu   Why is there a user called nobody? The only 2 user accounts I have are tim and askubuntu.

After I read  I noticed that there is a user account named 'nobody' in my Ubuntu system.   Also I noticed that I can login in this account from terminal using the following command and my password:  sudo su nobody     It doesn't mind me at all, but I want to know what is the purpose of this user? Is it created by default on a fresh install of Ubuntu or is created by installing a particular package?


Similarly to  I am looking to copy over only specific file types (or files with names containing specific strings) preserving the folder structure. I only want to add the caveat that the folders in question are located on a different server which I connect to through ssh. Normally that means I use scp or rsync on the local system. However,  we want to be able to run find on the remote system. How would I copy the files and directories in this case? P.S. Would there be a way to estimate the total file size before performing the copy for real.

I want to rsync only certain file types (e.g. .py) and I want to exclude files in some directories (e.g. venv).  This is what I have tried:  rsync -avz --include='*/' --exclude='venv/' --include='*.py' --exclude='*' /tmp/src/ /tmp/dest/   But it doesn't work.  What am I missing?  I also followed the answer to  but it didn't help.


I have a text file. It is a simple database, that stores json objects line by line. One json object per one line. Lines are separated with "\n" character.  So my task is to get necessary object from file, deserialize it to java object, change some fields, and write object back to file. Replacing old line with new json line.  Is it possible to make this operation without opening the whole big file to memory, and then saving it? Just replacing bytes in 1 small line.  I read file line by line, and get nessesary line number. I deserialize object and change fields. But I can't find the correct way how to save it according to my goal. I tried FileWriter, BufferedWriter, but it didn't helped.  {"name":"John","surname":"Galt","email":"john@gmail.com"} {"name":"John2","surname":"Galt","email":"john2@gmail.com"} {"name":"John3","surname":"Galt","email":"john3@gmail.com"} {"name":"John4","surname":"Galt","email":"john4@gmail.com"}

I have a text file where I want to change only the first line of the file.  The file could be millions of rows long, so I'd rather not have to loop over everything, so I'm wondering if there is another way to do this.  I'd also like to apply some rules to the first line so that I replace instances of certain words with other words.  Is this possible?


Ever since I got my laptop, I have been wanting to explore Ubuntu. But unluckily, I can't download it because I do not have an internet connection. I have tried many times, but downloading it from cyber cafes is not possible.  Is there any solution to this problem?

I need to upgrade my existing Ubuntu system, and I also want to install Ubuntu on a new laptop.  I would like to have an installation CD or DVD to do both of these.  Where exactly I can order or request an Ubuntu installation CD/DVD/USB?


I have a site hosted at Brinkster and all keywords are there, but I still can't get it to show up in a Google search.   I thought if I searched for it by domain name, it would show up in the Google search results.  Can anyone explain why it's not showing up?

This is a general, community wiki  question and answer pair intended to address any questions   concerning the reasons a site or specific site contents do not appear   in search engine results.      If your question was closed as a duplicate of this question and you   feel that the information provided here does not provide a sufficient   answer, please open a discussion on .   My site (or specific pages on my site) is not appearing in search engine results.  Why isn't my content indexed and what can I do about it?


Is there a way to disable the gnome screenshot camera sound, with needed admin access?  There's an answer here, that involves moving a file from somewhere in /usr/...    I don't have enough privileges to do that on my system.  Is there another way?  Thanks.

After a recent update of my , the gnome-screenshot tool started making an annoying camera shutter noise every time a screenshot is taken. This is both annoying and startling (especially if you happen to be wearing earphones when taking the screenshot).  I checked the man page of gnome-screenshot` but there were no relevant options. How can I take silent screenshots?


I'm trying to write a class which is to handle the maps methods (showmap, addmarker, etc) and I call these methods in an Activity or Fragment, but I get this error:  java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference   I know what it means, but I canit solve it. So I hope somebody can help me.  Here is the map calss:  public class MapHandle extends AppCompatActivity implements LocationListener {  private SupportMapFragment mapFragment; private GoogleMap map;   public void initMap() {       mapFragment = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map));     if (mapFragment != null) {         mapFragment.getMapAsync(new OnMapReadyCallback() {             @Override             public void onMapReady(GoogleMap map) {                 createMap(map);             }         });     } else {         Toast.makeText(this, "Error - Map Fragment was null!!", Toast.LENGTH_SHORT).show();     }   }  public void createMap(GoogleMap googleMap) {     map = googleMap;     if (map != null) {         // Map is ready         Toast.makeText(this, "Map Fragment was loaded properly!", Toast.LENGTH_SHORT).show();     } else {         Toast.makeText(this, "Error - Map was null!!", Toast.LENGTH_SHORT).show();     } } }   And here I call it in an Activity:  public class FragOne extends Fragment {  MapHandle mh;  @Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {     mh = new MapHandle();     mh.initMap();     return inflater.inflate(R.layout.frag1,container,false); } }

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?


I would like to pass a List<> of object say List<Student> to the parameter of stored proc and have the data stored in corresponding fields in the database. How can I do this? I use SQL Server 2005.   So if the database Table has fields StudentId,Name,Age and the object List<Student> has the same properties containing the data, then the data should go to the corresponding fields in Table.  Please advice with code. Thanks in advance.

I've often had to load multiple items to a particular record in the database. For example: a web page displays items to include for a single report, all of which are records in the database (Report is a record in the Report table, Items are records in Item table). A user is selecting items to include in a single report via a web app, and let's say they select 3 items and submit. The process will add these 3 items to this report by adding records to  a table called ReportItems (ReportId,ItemId).  Currently, I would do something like this in in the code:  public void AddItemsToReport(string connStr, int Id, List<int> itemList) {     Database db = DatabaseFactory.CreateDatabase(connStr);      string sqlCommand = "AddItemsToReport"     DbCommand dbCommand = db.GetStoredProcCommand(sqlCommand);      string items = "";     foreach (int i in itemList)         items += string.Format("{0}~", i);      if (items.Length > 0)         items = items.Substring(0, items.Length - 1);      // Add parameters     db.AddInParameter(dbCommand, "ReportId", DbType.Int32, Id);     db.AddInParameter(dbCommand, "Items", DbType.String, perms);     db.ExecuteNonQuery(dbCommand); }   and this in the Stored procedure:  INSERT INTO ReportItem (ReportId,ItemId) SELECT  @ReportId,           Id FROM     fn_GetIntTableFromList(@Items,'~')   Where the function returns a one column table of integers.  My question is this: is there a better way to handle something like this? Note, I'm not asking about database normalizing or anything like that, my question relates specifically with the code.


I want to subtract the pastDate with current date and check if the different is greater than 7 days. I am trying to do with momentjs but the subtract doesn't seems working my way.  pastDate= "2018-03-09 22:53:19"; dateFrom = moment(Date.now() - pastDate).format('YYYY-MM-DD HH:mm:ss');  if(dateFrom >= 7 ){   console.log("Expiry Date"); }   Please help me with correct syntax.

I'm creating an application which lets you define events with a time frame.  I want to automatically fill in the end date when the user selects or changes the start date.  I can't quite figure out, however, how to get the difference between the two times, and then how to create a new end Date using that difference.


Timbre is a property associated with the shape of a sound wave, that is, the coefficients of the discrete Fourier transform of the corresponding signal. This is why a violin and a piano can each play the same note at the same frequency yet sound completely different. Now for light: if you mix red and blue light, the resulting wave has on average the same frequency as green, but a different shape. Is this why we observe it as magenta instead of green? So can we say light has timbre?  But other colours mixtures don't work! Red+green is yellow, but yellow is a pure colour, so apparently red+green has no unique timbre in this case; the shape of the red+green wave is identical to a pure yellow wave.

In music, when two or more pitches are played together at the same time, they form a chord. If each pitch has a corresponding wave frequency (a pure, or fundamental, tone), the pitches played together make a , which is obtained by simple addition. This wave is no longer a pure sinusoidal wave.  For example, when you play a low note and a high note on a piano, the resulting sound has a wave that is the mathematical sum of the waves of each note. The same is true for light: when you shine a 500nm wavelength (green light) and a 700nm wavelength (red light) at the same spot on a white surface, the reflection will be a superposition waveform that is the sum of green and red.  My question is about our perception of these combinations. When we hear a chord on a piano, we’re able to discern the pitches that comprise that chord. We’re able to “pick out” that there are two (or three, etc) notes in the chord, and some of us who are musically inclined are even able to sing back each note, and even name it. It could be said that we’re able to decompose a Fourier Series of sound.  But it seems we cannot do this with light. When you shine green and red light together, the reflection appears to be yellow, a “pure hue” of 600nm, rather than an overlay of red and green. We can’t “pick out” the individual colors that were combined. Why is this?  Why can’t we see two hues of light in the same way we’re able to hear two pitches of sound? Is this a characteristic of human psychology? Animal physiology? Or is this due to a fundamental characteristic of electromagnetism?


I know in calculus the form $\frac{0}{0}$ is indeterminate.but if it is not calculus is it still indeterminate or undefined in the real number field?   P.S. I know that $\frac{1}{0}$ is undefined whether it is calculus or normal arithmetic in the real number system. but in the projectively extensive real number system, $\frac{1}{0}=\infty$ but in this system what would be $\frac{0}{0}$ it becomes $0*\infty$ also an indeterminate form. in that system the problem $\frac{1}{0}$ is solved but $\frac{0}{0}$ remains.    P.P.S some answers in the question which has been identified as a duplicate of my Q state the $\frac{0}{0}$ is indeterminate. but in Wikipedia page(division by zero) states it is undefined. and that question was asked not to clarify this ambiguity(indeterminate or undefined) and there is no clear answer to my problem.

Suppose we have an equation $ab=0$. This equation is true when statements $a=0$ or $b=0$ are true.  If $a=0$, then $b=\frac{0}{0}$. That means $b$ could be any number for $ab=0$ to be true. If the set which groups all the numbers is the complex set, then $b$ will every number within $\mathbb{C}$, so $\forall z\in\mathbb{C}:b=\frac{0}{0}=z$. Therefore, $\frac{0}{0}$ is every number.  I know it really is not defined as number but conceptually it is every number, right?  Is this right, or am I missing something?


I saw on  that a formula for derangements is   $\text{Round}\left[\frac{n!}{e}\right]$  However, how did they arrive at this elegant formula?  Does it have to do with $ !n=n! \sum _{k=0}^n \frac{(-1)^k}{k!}$

I understand the whole concept of Rencontres numbers but I can't understand how to prove this equation  $$D_{n,0}=\left[\frac{n!}{e}\right]$$  where $[\cdot]$ denotes the rounding function (i.e., $[x]$ is the integer nearest to $x$). This equation that I wrote comes from solving the following recursion, but I don't understand how exactly the author calculated this recursion.  $$\begin {align*}  D_{n+2,0} & =(n+1)(D_{n+1,0}+D_{n,0}) \\ D_{0,0} & = 1 \\ D_{1,0} & = 0  \end {align*} $$


As far as i know, introns do not encode protein products, but living creatures still have them. So what’s their function ?  P/s: Sorry for my grammar

We touched on introns and exons in my bio class, but unfortunately we didn't really talk about why Eukaryotes have introns. It would seem they would have to have some purpose since prokaryotes do not have them and they evolved first chronologically, but I could easily be wrong. Did the junk sections of DNA just evolve there by some sort of randomness or necessity as opposed to an actual evolutionary advantage? Why hasn't evolution stopped us from having introns since they seem to be a 'waste' of time and DNA? Why do prokaryotes not have introns?


Using , I created a self.site.yml file which seemed to work fine.  I get the correct values when running drush site:alias @self.stage, but when I try to run drush command @self.stage I get this error message.     PHP Fatal error:  Uncaught Error: Using $this when not in object context in ... /vendor/drush/drush/src/Runtime/DependencyInjection.php:59

Since drush 9 (drupal 8.4 requirement), alias @sites does not seem to be implemented anymore (or yet ?).  $ drush @sites cr The alias @sites could not be found.   Is this a way to get the same behavior that does not consist of typing my 300 alias in a config file ?


I have absolutely no idea what the backslash at the end of the first line does. I have searched high and low.   camera = CameraServer.getInstance() \      .startAutomaticCapture(name=config.name, path=config.path)

I have a long line of code that I want to break up among multiple lines. What do I use and what is the syntax?  For example, adding a bunch of strings,  e = 'a' + 'b' + 'c' + 'd'   and have it in two lines like this:  e = 'a' + 'b' +     'c' + 'd'


How  restart ubuntu 16.04 sound settings?

I was listening to music, and my sound suddenly went dead in all my applications. I'm using Ubuntu 12.04, which uses pulseaudio, so I tried sudo /etc/init.d/pulseaudio restart, but nothing happened. According to lsof | grep pcm, nothing is using the soundcard at the moment, although I'm not entirely sure if  is applicable.   Is there a way another way to restart Ubuntu 12.04's sound system from the command line without rebooting the system?


Suppose I have the following hypothetical data:   One thousand times value 15 (i.e., 15 occurs 1000 times) and a single outlier value - 115 (i.e., 115 occurs just once - an outlier)   Thus the mean is: $$((15 \times 1000) + 115)/1001 \Rightarrow (15000 + 115) / 1001 \Rightarrow 15.1$$  The standard deviation is: $3.16$.  Whereas, $Σ|x - x̄| / N$ (i.e., using the absolute deviation instead of squaring) I get: $0.20$.  I think the later value is more appropriate, but I have read in many places that one of the reasons we take the square for calculating the SD is because we want to give more weight to outliers. But I have always thought that outliers are supposed to be ignored!  What is the benefit of using the standard deviation formula (with squared deviations) which amplifies the effect of outliers (as compared to using absolute deviations)?

In the definition of standard deviation, why do we have to square the difference from the mean to get the mean (E) and take the square root back at the end? Can't we just simply take the absolute value of the difference instead and get the expected value (mean) of those, and wouldn't that also show the variation of the data? The number is going to be different from square method (the absolute-value method will be smaller), but it should still show the spread of data. Anybody know why we take this square approach as a standard?  The definition of standard deviation:  $\sigma = \sqrt{E\left[\left(X - \mu\right)^2\right]}.$   Can't we just take the absolute value instead and still be a good measurement?  $\sigma = E\left[|X - \mu|\right]$