I recently wanted to give an answer on an SO platform, but instead had to write a comment.  The weird thing is, that I think the comment would have been a decent answer, which in turn could bump me well above the threshold to answer protected questions.  I also have the 100 rep bonus, and 1900 reputation or more overall on the SO network.  I think it would be cool if a user with enough reputation say 1000 or 1500 overall on the SO network (real reputation not with the bonus counted), could still answer protected questions.  The reason is that I think it's unlikely that someone with a lot of reputation would write a bad answer on another SO platform.  I don't know if it can be implemented though and what each SO platform has access to.  I mean you can still give the information in a comment, or ask someone in chat to post it for you, but you will forfeit the potential gain of reputation, which then would allow you to answer future protected questions (which are the ones you are most likely to see, because you're likely not actively search on that particular network, but instead only see the hot networks)  Ofcourse you could argue that this is design, but somehow I think that this could prevent a few people which could post gem answers for specific situation/contexts they are familiar with, but are simply not active on that network.

The purpose of protected questions is, according to the message presented on such a question, "to prevent 'thanks!', 'me too!', or spam answers by new users." The more verbose  agrees on the purpose. And the  says this is why protected questions exist:     Some questions are protected because they are expected to attract   either spam or users -- often new users -- who may mistake the site as   a traditional forum, posting "noisy" answers such as "Thank you" or   "This worked for me" or "I'm also having this problem".   Considering this, shouldn't a user be able to answer protected questions if they have gained at least 10 rep on any stack exchange site? If they've already demonstrated one site that they are familiar enough with the SE Q/A format to not be a drive-by useless answerer, shouldn't that confidence in them carry over to other SE sites?  Or maybe at some level of combined SE rep this restriction should be waived. I find it silly that at 15k+ combined network rep, I'm unable to answer a protected question on a SE site I've just started using.


How do you turn off the MacBook retina internal display with the lid open while using an external monitor on Mac OS X 10.12.6 Sierra? All the previous method doesn't work! 1.Turning down the brightness is not the same as turning off the display as the GPU still sends a signal to the internal display and the external monitor. 2.These were the terminal commands to achieve this on Mavericks: Enable sudo nvram boot-args="iog=0x0" Disable sudo nvram -d boot-args 3.sudo nvram boot-args=niog=1 4.sudo pmset -a lidwake 0.  So, how can i do it without use the third party app? Thank you

I have a Late 2011 Macbook Pro 13" (running Lion - OS 10.7.4) which I use with a dual external monitor setup. I have two 21" LCDs that I use as external monitors. One uses the built in Mini Display Port on the Macbook Pro and the other is connected via a USB to DVI adapter (Diamond DVILink).  The problem I am having is with the 13" built in display of the Macbook Pro. I would like it to remain closed and unused (I prefer the dual monitors at same resolution), however I cannot seem to "disable" the display in the display preferences applet. So even though the Macbook Pro lid is closed the operating system still makes use of the display, even though the apple logo on the back of the display is unlit. I have tried to move the laptop screen off out of the way in display preferences but I find when I "sleep" my setup that any applications that remain open move to the laptop screen. This makes it difficult to locate the application windows when resuming from sleep.    Does anyone know of a way to disable the laptop built in display so it is not seen by the OS when external monitors are being used?


Thunderbird is open but the main icon in unity-panel doesn't show that I received an email. I would like that icon change when I receive an email. Take a look at screenshot.    When I receive an email, there is a notification sound but no pop up. I am using Thunderbird 38.5.1 on Ubuntu 14.04 and my account is on Gmail.  Also there is another problem that I like to fix: desktop notification doesn't work.

Problems:   The main icon in unity-panel doesn't change when I receive an email. There is no pop up.   System setting:   Thunderbird is open. Sound notification works.    Messaging Menu and Unity Launcher integration 1.3.1" in list of extensions. Thunderbird 38.5.1   Ubuntu 14.04   My account is on Gmail.     Update1: I tried to install Web apps application with these instructions   sudo add-apt-repository ppa:webapps/preview sudo apt-get update sudo apt-get install unity-webapps-preview   It doesnt work.Now the number of unread emails even doesnt show up in the icon below the screen.  Update: I tried to install popper as an alternative but it doesnt support after  Ubuntu 12.04


Please see my reputation changes . Yesterday someone serially upvoted all my questions at around 11:46 to 11:57. Seeing which I stopped answering any more questions as all those would go reversed as a whole. Today all those got reversed and I got a -165 an hour ago. Now guess what, again it started up voting this time with my answers (just 15 mins after the reversal happened). My question is that it is the second time the same thing is happening to me in less than a day. So it seems the action is  really intentional. Can't we think of actually disabling the account which is intentionally causing this? I am sure that it is not any one who saw my answers helpful upvoting me because he would take sometime in understanding the questions or answers he is upvoting so that it won't be 5-6 upvotes per sec.

Probably everybody who is very active on SO has experienced cases of random, serial upvoting as the expression of thanks from a (usually newbie) user. The pattern is usually 5 or more upvotes on your latest answers. The upvotes will be detected within 24 hours, and removed. (Or so I assume.)  No harm done except maybe a minor irritation for people after one of the "rep cap" badges because they are shown a higher reputation than they actually have. Still, I was thinking whether, in an attempt to channel the positive attitude into more productive areas, it would be worth showing a tooltip on the third upvote for the same person within time frame x:  Please use one upvote, a comment, or some quality content of your own, to say thank you Large numbers of upvotes for the same user may become invalid as part of our spam detection mechanisms.  Does this make sense? Maybe it is too localized and rare, but it has happened to me three or four times in the last two weeks alone. You decide.  Clarification: I am not advocating putting up any kind of barrier on upvotes. . I'm suggesting informing people of the barrier and the futility of their ten or so upvotes for a single person because those votes are likely to be revoked.  Update: @devinb makes the good point that "saying thanks" is not the only possible reason for serial upvoting, and the message wouldn't make sense then. The point still stands: Your votes aren't going to count, and when it comes to up voting (which is always some sort of positive behaviour, however misguided if done indiscriminately) I think it's fair to inform people of this.


I want to protect my web app from SQL_Injection. Here's the function I wrote but I want your opinion about it and if you have any tips to improve it! Thank you in advance! function charfilter($String) { /*Sanitize input*/     $count=0;     $forbidden= array("'",";","--","=","\"","#","<",">");     $String=str_replace($forbidden," ", $String,$count);     // String lenght limited to MAX_BUFF     return substr($String,0,MAX_BUFF); }

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?


I am trying to compare two string and ignore case- sensitive but i don't want to use .lower() or .upper(). Is there another way of doing this?

How can I do case insensitive string comparison in Python?  I would like to encapsulate comparison of a regular strings to a repository string using in a very simple and Pythonic way. I also would like to have ability to look up values in a dict hashed by strings using regular python strings.


I'm the domain administrator for, say, example.com. I have a few dozen users and we provide them with e-mails (first-name@example.com) that are aliases to their main e-mail.  Now there's quite a few servers on the internet that mark mails as spam if they don't use SPF, and I'd like my users not to be considered as spammers. How should I configure SPF on my domain given that they might send mail from many different mail servers (their ISP, gmail, hotmail, their own server, whatever) ?  The only solution I've found so far would be to set up an SMTP server and ask users to send it through it (which is probably what SPF expects me to do). Is there any simpler way ? Is it common among usual mail providers that allow using aliases to also allow a specific SMTP server when using an alias ?  Here, I'm not asking how to configure basic SPF parameters or what SPF is in general, but how to deal with SPF when it involves many users that may send e-mails using their own SMTP server.

This is a  about setting up .     I have an office with many computers that share a single external ip (I'm unsure if the address is static or dynamic). Each computer connects to our mail server via IMAP using outlook. Email is sent and received by those computers, and some users send and receive email on their mobile phones as well.  I am using  to generate an SPF record and I'm unsure about some of the fields in the wizard, specifically:   Enter any other domains who may send or relay mail for this domain Enter any IP addresses in CIDR format for netblocks that originate or relay mail for this domain Enter any other hosts which can send or relay mail for this domain How stringent should SPF-aware MTA's treat this?   the first few questions i'm fairly certain about... hope i have given enough info.


Unable to assign the SSH version number to a variable in bash. Running the below code, the output from "uname -a" is assigned to the variable "os", however the output from "ssh -v" appears in the terminal window but isn't assigned to the variable "ssh_v".   Confirmed this is happening on various versions of Solaris and Ubuntu and I have no idea why.  CODE:  #!/usr/bin/env bash  ssh_v=$(ssh -V) printf "ssh_version = $ssh_v\n"  os=$(uname -a) printf "OS_version = $os\n"   OUTPUT:  root@myserver:/usr/build/run# ./test.sh Sun_SSH_2.4, SSH protocols 1.5/2.0, OpenSSL 0x100020bf ssh_version = OS_version = SunOS myserver 5.11 11.3 sun4v sparc sun4v

I have read many threads on this topic, but none of the solutions have worked for me.   I am trying to do the following:  RELEASE_COMMAND_OUTPUT=$(exec ~/temp/execs/github-release release --user patick --repo $REPO_NAME --tag $RELEASE_VERSION --name $RELEASE_VERSION --description "$DESC")   but the output of ./github-release is not stored in the RELEASE_COMMAND_OUTPUT variable.   I'm aware of the concept of , but none of the solutions I've tried have worked. What am I doing wrong?


There are lots of ways to make comment in LaTex such as single percentage sign, \begin{comment} and so on, but as I know none of them use for creating comment for separating lines of a doc. It's good to know there is a way  to make a group comment in LaTex.   ie:  we have text and command here and want to be comment(group1) . . . we have text and command here and want not to be comment(group2) . . . we have text and command here and want to be comment(group1) . . . we have text and command here and want not to be comment(group2)   and other groups, now we want to comment one group and see result and then comment other group and uncomment first group and so on. for a bit challenging imagine that this groups of comment are  distribute in multiple file (not all file but a part of it like one line in chapter 1, two lines in chapter 2, three lines in chapter 8 and ...).  any help would be appreciated.

To "comment out" a line, I need to insert a % at the beginning of the line (so that the line will not be compiled). Is there a way to comment out a large section without having to manually place % in front of each line?


I am trying to call a jquery button click function from an element created by the append function, but it is not working below is my source code   var tr = $('#t_body').append(                              "
",                              "<input type='checkbox' id='check' value='" + (Order_Result.ORDER_ID) + "'>	",                              "<button class='btn btn-outline-secondary' value='" + (Order_Result.ORDER_ID) + "' id='btn_ViewItem'>pageview</button>	",                              "<button class='btn btn-outline-danger' value='" + (Order_Result.ORDER_ID) + "' id='btn_Delete' ></button>	",   for the above id btn_Delete i have created the function as follow  $("#btn_Delete").click(function(event) {     alert("same"); });   but when I click nothing is happening I have checked the console there is no error and even the appended table date with has been created properly.      what is the problem and why it is not working? please provide me a Solution  Thanks in advance

I have a bit of code where I am looping through all the select boxes on a page and binding a .hover event to them to do a bit of twiddling with their width on mouse on/off.  This happens on page ready and works just fine.  The problem I have is that any select boxes I add via Ajax or DOM after the initial loop won't have the event bound.  I have found this plugin (), but before I add another 5k to my pages with a plugin, I want to see if anyone knows a way to do this, either with jQuery directly or by another option.


I've been confused on the connection between photons and electrons for a very long time.  Some examples of questions I"ve asked are linked here:      In their answers, when people address photons, they always talk about the electrons jumping to higher energy states and dropping to lower energy states.  But...what does this mean? Does a higher energy state mean that the electron is vibrating faster? That it's further away from the nucleus?  What ARE energy states, and why do changes in them produce photons?  What I've gotten from my other questions is that electron vibrations on one atom cause other electrons elsewhere to vibrate, and the transmission of that vibration from one electron to another IS a photon...so that means a change in an energy state the same thing as an electron vibration?

I have seen similar posts, but I haven't seen what seems to be a clear and direct answer.  Why do only a certain number of electrons occupy each shell? Why are the shells arranged in certain distances from the nucleus? Why don't electrons just collapse into the nucleus or fly away?  It seems there are lots of equations and theories that describe HOW electrons behave (pauli exclusion principle), predictions about WHERE they may be located (Schrödinger equation, uncertainty principle), etc. But hard to find the WHY and/or causality behind these descriptive properties.  What is it about the nucleus and the electrons that causes them to attract/repel in the form of these shells at regular intervals and numbers of electrons per shell?  Please be patient with me, new to this forum and just an amateur fan of physics.


I was thinking about this problem but could not come up with any normal example. I was trying to crack with some playing with some number theory, like gcd, lcm but could not solve it. I am interested only in b) part.

Let $G$ be a group, with $H,K\subset G$ subgroups of finite index. Show by counterexample that the index $[H:H\cap K]$ need not divide $[G:K]$.  It's pretty easy to prove that $[H:H\cap K]\le [G:K]$ using group actions. I've considered all the cyclic and product groups I can think of to no avail.


I cannot see underwater in Skyrim. Every time I go underwater everything is completly blue. I recall being able to see underwater before when I began to play the game but now I can't

As of patch 1.5, I am completely unable to see underwater in Skyrim.  It's not even that it's murky or dark - it's just a solid grey or green screen.  I can still skim across the surface and see into deep waters, but if I go any deeper than that, nothing is visible.  I can still access items like chests underwater if I figure out their location first (by skimming across the surface) and then point my character there and hope really hard that it gets me to the right place.  I was never able to see much underwater, but I at least used to be able to see small things like wood floating near a shipwreck.  Now, there's just nothing. I am running the Steam version of Skyrim with graphics on Ultra High, with the high res textures DLC.  I've tried disabling the high res textures (along with all my other mods) and it still happens.  In case it's relevant, my GPU is a GTX 560 Ti.  Does anyone have any solutions to this?


Do the two letters mean High Definition? Are they called HD lenses? How do they differ from normal (SD?) lenses? Please include a plenty of details in your answer..

When looking at a lens name, there are a lot acronyms describing its features (often specific to the manufacturer).   Examples, Nikon: Nikon AF-S DX 16-85mm VR f/3.5-5.6G IF-ED Nikon AF-I 600mm f/4D IF-ED Nikon AF-S VR Micro-NIKKOR 105mm f/2.8G IF-ED    Examples, Canon: Canon EF 85mm f1.2L USM Mark II Canon 70-300mm f/4.5-f/5.6 DO IS    Examples, Sigma: Sigma 150mm F2.8 EX APO DG HSM Macro Sigma 70-200mm F2.8 EX DG OS HSM Sigma 50-150mm F2.8 EX DC APO HSM II    How do I decipher these lens codes from different manufacturers?


I upgraded to Ubuntu 19.04 from 17.10 and now I do not have anything on my desktop at all. I am running this on Virtual Box 6. I know enough about Unix to be dangerous, I just use it for developing websites.    From looking around various articles I have tried these commands as suggested but nothing has worked, any ideas?  From SSH I have tried these:  sudo apt-get install --reinstall ubuntu-desktop sudo apt install --reinstall gnome-shell-extension-desktop-icons sudo apt install --reinstall gnome

Yesterday I upgraded my Ubuntu 18.10 to Ubuntu 19.04, and after the restart, the trash icon and my Desktop files have disappeared from the UI. If I go to the Desktop folder from my personal folder, I can see the files, but my Desktop is empty.  How can I show my files in the Desktop again?


My question is that, is there any way of creating a new array(any datatype) filled with a particular value as we can do in C/C++? eg :- int array[100] = {0};  I know, we can first create an array and then fill it with any value using java.util.Arrays, but I was asking if there was a single statement to do it like in C/C++

I know how to do it normally, but I could swear that you could fill out out like a[0] = {0,0,0,0}; How do you do it that way? I did try Google, but I didn't get anything helpful.


Prove If $f$ is a function , $f^{-1}(A \cap B) = f^{-1}(A) \cap f^{-1}(B)$.   Proof attempt I am guessing here $A$ and $B$ are sets in the range of $f$. Let's assume $x$ belongs to both $A$ and $B$ and $f^{-1}$ exists for both $A$ and $B$.   Then there must exist a $y$ such that $y = f^{-1}(x)$.  Now by our assumptions $x$ is in intersection of $A$ and $B$ and since $f^{-1}(A)$ and $f^{-1}(B)$ exist then $f^{-1}(A) \cap f^{-1}(B)$ must also exist. Also since $A$ and $B$ exist and are not equal to null set so $A \cap B$ exists and $f^{-1}(A\cap B)$ also must exist and contain our $y$?? Not sure about the ending in this attempt. Any help would be much appreciated.   Sources : ♦ 2nd Ed $\;$  P219 9.60(e) $\;$  Mathematical Proofs by Gary Chartrand, ♦ P214 $\;$ Theorem 12.4.#3 $\;$  Book of Proof by Richard Hammack, ♦ P257-258 $\;$  Theorem 5.4.2.#2(a) $\;$   How to Prove It by D Velleman.

I am given this equation:  $f^{-1}(B_1 \cap B_2) = f^{-1}(B_1) \cap f^{-1}(B_2)$  I want to prove it: what i did is  I take any $a \in f^{-1}(B_1 \cap B_2)$, then there is $b \in (B_1 \cap B_2)$ so that $f(a)=b$. Because of $b \in (B_1 \cap B_2)$, it is true that $b \in B_1$ and $b \in B_2$, so $a \in f^{-1}(B_1)$ and $a \in f^{-1}(B_2)$.    this means $f^{-1}(B_1 \cap B_2) \subseteq f^{-1}(B_1) \cap f^{-1}(B_2)$.   is it ok?


I have seen a video (                              ) of a guy who is at the same mission as me but of a much higher level as me (He is 25, I am 19) and has a TON more shields and HP than me.  I am pretty much always dying when I try to solo missions. When I am with a team, I have to let them do the mission while I sit in a corner.  Are there any tips to level up fast? Like.... kill tons of enemies, do side quests, etc.? Also, are there any ways to get more shields and HP?

What is the sweet spot for experience gain? Is it more effective to fight the highest level enemies I can find, or am I penalized for being out of my depth? Are certain areas of the game better/best for experience gain/leveling? Are bosses better than areas with infinite minions? Would I get exp faster in a higher-level co-op game? What are the most time-effective techniques for rushing/boosting a character (either solo or co-op)?


Guys please i need help any suggestions on this post would be appreciated so i need to know if i can acutally restore my data since i lost it all while i was trying to install windows 7 on my computer there was a message telling that it was impossible to install windows on this partition so what i did was i used cmd command using shift andF10 and i selected the volume that i wanted to clean it all went that's actually what i thought however, what i did find out is that windows cleaned all my partitions and joined them into only one partition that merged all the partitions into one with all the store indicating no data sign so what i did was i processede into windows installation and when the installation completed and windows booted up i found my self completely lost since i found my without any of my previous data as a brand new with only windows files so what im asking please is a way to recover my data if there's anything possible i can do before it's too late please any help is appreciated .

I was on my way installing windows 7 alongside linux installation that was scattered over 3 partitions, namely: root, home and additional big partition for data files. I was trying to install windows on 4th a non mbr empty partition that was specifically created for windows. When I booted from windows 7 DVD, I used "shift+F10" command to enter a command line interface and used "diskpart" app. While going through the disk partitions and selecting the empty volume I typed "clean" thinking that it would erase ONLY the selected volume, but instead the whole hdd drive was removed of its partitions. I could barely stand because the information on those non empty linux partitions is irreplaceable and worth months of work.  What should I do to get my data back guys? I have 2 usb sticks, 2 external hdds, another windows laptop and internet connection.


I'm making an application which sends an POST request using ajax to a python script. I'm new to python and doesn't know much about it.  As in PHP we do something like this to get a value from post request.  $val = $_POST['data'];   How to do this in python? any help would be appreciated. Thanks

In PHP you can just use $_POST for POST and $_GET for GET (Query string) variables. What's the equivalent in Python?


How might I take multiple pictures or videos of my computers log on screen?  It is unclear of me how to do such.  PrintScreen doesn't appear to work.  The linked question has no accepted answer as is.

Ideally, this can be done for a non-virtual installation of Windows 7 and without the use of an RDP client connection.  There are numerous blog posts, , etc that include screen shots of the Windows 7 logon screen... how did they do it?


There seems to be a limit to where my camera dsitance from the objects can be... How do I fix this? because I want to get the whole of my fortress in the camera, but this happens.

I have created a simple model here   When rendering it the end of it is cut off   How can I get the camera to render a longer distance?


I'd like to keep track within Trello of things I've asked others to do, including clients, partners, etc. I can't really ask them to create a login in Trello just to help me. So is there a way to identify that this card is not for me to do something but actually for someone else, other than just putting their name in the title obviously ? Ideally, I'd like to be able to add them as "ghost member" or something like that. By the way, it would be nice to have a suggestion board in Trello itself where users can suggest things.

I want to manage a Trello board with a bunch of users on it, but I don't actually want the users to participate, I just want to be able to assign them to things. Is there a way to add fictive ("dummy/mock", if you prefer) users to my board, just to easily manage their assignments to cards, but without inviting actual people?  Alternatively, if there's no such option, is there another way I can approximate this (e.g. defining each student as a card and association a card with another card)?    Background: I occasionally supervise students' projects. Trello seems really useful for me to track which project is at what stage and which students are assigned to what, but the projects are not necessarily related and I don't actually want the students to participate in this high-level management, it's just intended for me and my fellow grad students / faculty members.


Let $a\in \mathbb {Z} $ and $a,b \in \mathbb {N} $. Suppose that $b $ divides $ad $ where  $\mathrm {gcd} (a,b)=1$. What can you conclude from the above assumptions?   I have a feeling that we must have $b $ divides $d $, but I am unsure and have no intuition guiding me as to a formal way to express what I believe is the conclusion.

Well I thought this is obvious. since $\gcd(a,b)=1$,  then we have that $a\not\mid b$ AND $a\mid bc$. This implies that $a$ divides $c$. But apparently this is wrong. Help explain why this way is wrong please.   The question tells you give me two relatively prime numbers $a$ and $b$ such that $a$ divides the product $bc$, prove that $a$ divides $c$. how is this not obvious? Explain to me how my "proof" is not correct.


I'm running a script on a group of mint/ubuntu VMs that every weeks downloads exactly 23 files, elaborates them one at time, and creates one big file (1..3 GB) for each downloaded file.  Downloaded files are in a folder, and elaborated files are in a different one folder.   Because the sript handle one downloaded file at time, creating one single new elaborated file, I'd like, at end of elaboration, to delete the oldest files automatically, in both folders.  My idea was to list folder content sorted by modified time descending, and to delete file starting from 24th.  Is it possibile to realize this using bash (so I can cron it) ?

Is there a simple way, in a pretty standard UNIX environment with bash, to run a command to delete all but the most recent X files from a directory?  To give a bit more of a concrete example, imagine some cron job writing out a file (say, a log file or a tar-ed up backup) to a directory every hour. I'd like a way to have another cron job running which would remove the oldest files in that directory until there are less than, say, 5.  And just to be clear, there's only one file present, it should never be deleted.


I started learning Java under Android device and trying to write a simple example. After clicking the button, the program should write the file. The main class MainActivity after clicking the button calls the method fileWrite from the ReadWriteFile class and I get an error. The ReadWriteFile class is described in a separate file. What I did wrong?  MainActivity.java:  public class MainActivity extends AppCompatActivity implements View.OnClickListener {     @Override     protected void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         setContentView(R.layout.activity_main);         Button button = (Button) findViewById(R.id.button);         button.setOnClickListener(this);     }     @Override     public void onClick(View view) {         ReadWriteFile readWriteFile = new ReadWriteFile();         readWriteFile.fileWrite("test.txt","test text");     } }   ReadWriteFile.java:  public class ReadWriteFile {     Context context;     public void ReadWriteFile (Context context){         this.context = context;     }     public void fileWrite (String fileName, String inputData){         try {             FileOutputStream fos;             fos = context.openFileOutput(fileName,Context.MODE_PRIVATE);             OutputStreamWriter osw = new OutputStreamWriter(fos);             BufferedWriter bw = new BufferedWriter(osw);             bw.write(inputData);             bw.close();         } catch (FileNotFoundException e) {             e.printStackTrace();         } catch (IOException e) {             e.printStackTrace();         }     } }   ERROR:  D/AndroidRuntime: Shutting down VM E/AndroidRuntime: FATAL EXCEPTION: main     Process: ru.test.test, PID: 8751     java.lang.NullPointerException: Attempt to invoke virtual method 'java.io.FileOutputStream android.content.Context.openFileOutput(java.lang.String, int)' on a null object reference         at ru.test.test.ReadWriteFile.fileWrite(ReadWriteFile.java:22)         at ru.test.test.MainActivity.onClick(MainActivity.java:20)         at android.view.View.performClick(View.java:5610)         at android.view.View$PerformClick.run(View.java:22265)         at android.os.Handler.handleCallback(Handler.java:751)         at android.os.Handler.dispatchMessage(Handler.java:95)         at android.os.Looper.loop(Looper.java:154)         at android.app.ActivityThread.main(ActivityThread.java:6077)         at java.lang.reflect.Method.invoke(Native Method)         at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756) Application terminated.

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?


Context: I am looking to upgrade to Ubuntu 20.04 LTS  I performed following steps:  $ sudo apt update $ sudo apt upgrade -y $ sudo reboot $ sudo apt --purge autoremove $ sudo apt install update-manager-core -y $ sudo do-release-upgrade -d   And this where I get the Py3 error message (in the subject)  I spent about 3 hours researching on what could be the problem. I also navigated to threads for the same question asked earlier but have not been able to figure out to fix the problem. I am hoping folks could help me here...  $ python --version Python 2.7.17 $ python3 --version Python 3.7.5 $ update-alternatives --list python3 /usr/bin/python3.6 /usr/bin/python3.7   I checked the config, ofcourse nothing shows up for python, for python3 I have 3.6 and 3.7. I have selected 3.7 as default.  Using Ubuntu version below:  DISTRIB_ID=Ubuntu DISTRIB_RELEASE=18.04 DISTRIB_CODENAME=bionic DISTRIB_DESCRIPTION="Ubuntu 18.04.4 LTS"   And some more details:  $ ls -l /usr/bin/python3 lrwxrwxrwx 1 root root 25 Dec 15 23:08 /usr/bin/python3 -> /etc/alternatives/python3   What more do I need to do fix the symlink problem?

I want to upgrade from Ubuntu 16.04.5 LTS to 18.04, so ran sudo do-release-upgrade. After downloading and extracting bionic.tar.gz I get:  Can not upgrade   Your python3 install is corrupted. Please fix the '/usr/bin/python3' symlink.   I saw  and so I did sudo ln -sf /usr/bin/python3.6 /usr/bin/python3 thinking that it would be a similar problem. But that didn't work (still same error message).  I have a few python versions:  $ ls /usr/lib | grep python python2.7 python3 python3.5 python3.6  $ update-alternatives --display python3 python3 - auto mode   link best version is /usr/bin/python3.6   link currently points to /usr/bin/python3.6   link python3 is /usr/bin/python3 /usr/bin/python3.5 - priority 1 /usr/bin/python3.6 - priority 2   How do I fix python3?


I am going to blink with LED from MCU I/O port. Where do I need to connect LED: VCC ot GND? I think it might be a difference whether the current goes into the inside MCU (when the port is low level and LED is connected to the VCC) or the current goes out from the MCU's port (when the port pin is high and the LED is pulled down to the GND). Is one of them better than another or they are equal and why?

I have always been taught to driver an LED using an MCP using the following method (Driving the pin high) as shown in the diagram below:   However I have recently seen LED's being driven using the following method as shown in the diagram below. I assume in this method the LED is driven when the digital pin is set to low. Which method is best practice and why?


I have the exact same problem as this person: , except that I removed; Social.framework, Weathkit.framework and ContactsAgent.framework.   Finder reptitively fails saying it can't load the libraries. I can view the files in my .Trash directory via Terminal, however I've unsuccessfully attempted to move them back multiple times by executing mv .Trash/Social.framework.  Honestly, I really dont care about any of those apps but I want Finder to work.  If someone would please upload a zip file of those frameworks, so that I could do the same thing as Sayan and replace, that would be much appreciated.

I've deleted a system file from my Mac and need to get it back.  System files can include:   hidden files in the root of / - especially unix files in /private  /System files /Library files /Applications files that ship with the core OS   System files are not any app, user files or files that can be regenerated by a known sequence such as cache files, Spotlight index files, etc…    Canonical question and answer for .


I want to write a query or a stored procedure in SQL Server to solve this problem - I tried a lot but no chance !   I have this data in a SQL table and I want to make a special operation on it :   0   3   1   0   0   0   0   NULL    NULL    35  117461  Mark    CEO     OBAMA   NULL    PARIS   FaceBook    NULL          NULL  NULL    NULL    NULL    NULL    NULL    NULL    01/10/2015  Very Good 0   3   1   0   0   0   0   1901    6925    35  117461  Mark    CEO     OBAMA   Med1    PARIS   FaceBook    One2Few 20/10/2015  NULL    NULL    NULL    NULL    NULL    NULL           NULL NULL 0   3   1   0   0   0   0   2135    7835    35  117461  Mark    CEO     OBAMA   Soft1   PARIS   FaceBook    One2Few 27/11/2015  NULL    NULL    NULL    NULL    NULL    NULL           NULL NULL 0   3   1   0   0   0   0   2574    9575    35  117461  Mark    CEO     OBAMA   Med1    PARIS   FaceBook    GroupMe 17/03/2016  NULL    NULL    NULL    NULL    NULL    NULL           NULL NULL 0   3   1   0   0   0   0   2832    1849    35  117461  Mark    CEO     OBAMA   Tech1   PARIS   FaceBook    One2Few 30/05/2016  NULL    NULL    NULL    NULL    NULL    NULL           NULL NULL   What I want is to remove the duplication and group those 5 rows into one single row containing the important information:   0   3   1   0   0   0   0     Mark          CEO         OBAMA     Med1|Soft1|Tech1     PARIS     FaceBook    01/10/2015    Very Good       I explain :   The 7 first columns are count operation and it is always the same in each row.  A concatenation of values Med1|Soft1|Tech1 - when two Values are the same take only one.  Take the comment when it exists here =  "very Good"  - The comment will exist once.

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 :)


Let's start with the warm-up.  I created a class template whose destructor just cannot be instantiated without compiler activating static_assert:  File: M.hpp  template <typename T> struct M {     M(){}     ~M()     {         static_assert(sizeof(T) == 0, "no type can pass this");     } };   Next I used this class in two different ways: allocate it on heap and allocate it on stack:  File main.cpp  #include "M.hpp"  int main() {     M<int> *pmi = new M<int>(); // does compile     M<int> mi;                  // doen't compile }   Allocating it on a heap M<int> *pmi = new M<int>(); works. It is so as we only use constructor and don't need destructor. The rules for class template implicit instantiation :      ... unless the member is used in the program, it is not instantiated ...   Allocating it on stack M<int> mi; doesn't work as compiler definitely need to instantiate the destructor.  So far so good, clear rules.  Let's get to the point.  I wrote another class which uses M as a member:  File X.cpp  #include "M.hpp"  struct X {     X() = default;     ~X() = delete;  private:     M<int> m_; };   I deleted the destructor intentionally because I don't want it to interfere anyhow with my experiment.  Constructor is defaulted which in my understanding should only generate constructor of M<int>, its only member, and call it. To my surprise this is not the case. X() also tries to generate the destructor of M<int>:  File main.cpp  #include "X.hpp"  int main() {   X* px = new X(); }   and this is what I get from a compiler:  $ g++ -std=c++17 main.cpp In file included from X.hpp:1,                  from main.cpp:1: M.hpp: In instantiation of ‘M<T>::~M() [with T = int]’: X.hpp:5:3:   required from here M.hpp:7:29: error: static assertion failed: no type can pass this      static_assert(sizeof(T) == 0, "no type can pass this");   The question is: why during the instantiation of the default constructor a compiler tries to instantiate a destructor for a member class template if it is not needed? If it is indeed needed could you point me at the documentation where it is stated?

Looking for an answer for C# and C++. (in C#, replace 'destructor' with 'finalizer')


What I mean is, I know that if a play has four spell slots of level 1, they can cast four  level 1 spells and no more. But what I am confused about is does a player have to specify if they want, for example, two Cure Wounds spells and two Detect Magic spells? Or can they just say "I have prepared Detect Magic and Cure Wounds" and then cast how many they want until their spell slots are expended?

Our group had some confusion about preparing spells for a Wizard and Cleric. The rules say that you prepare a number of spells from your list and that you tick off spell slots when you cast a spell. In D&D 3.x, if you wanted to cast a spell multiple times you had to prepare it multiple times, but we couldn't figure out from the rules whether or not this was the case in D&D 5e.   So can a spell be prepared once and then cast multiple times?


Following code gets correctly formatted in HTML using Pre tag. The break tags get rendered correctly showing line breaks
  package a;
import a.b;
import d.c;
public class Test{
}
  Get the following output -   package a;import a.b;import d.c;public class Test{}           However if I load the same text using javascript code.innerText = currentQuestion.code;  The break tag do not get rendered correctly and are shown as it is - package a;
import a.b;
import d.c;
public class Test{
}  Can someone please help me here..thanks

I'm using Prototype's PeriodicalUpdater to update a div with the results of an ajax call.  As I understand it, the div is updated by setting its innerHTML.  The div is wrapped in a
 tag.  In Firefox, the
 formatting works as expected, but in IE, the text all ends up on one line.  Here's some sample code found  which illustrates the problem.  In Firefox, abc is on different line than def; in IE it's on the same line.                  <title>IE preformatted text sucks</title>
         a b c         d e f
                    Anyone know of a way to get around this problem?


20 minutes ago, in a matter of minutes I got downvotes on 6 of my past answers. My guess is that it comes from somebody seeking revenge because I downvoted one of his/her answers.  I don't know if I should find it sad or funny, but anyway I have two concerns with this. The first one is that some of my good answers don't look so good now with one less upvote. The second is that I don't really want people like this in our community.  Does stackoverflow have policies in place to address such behaviors?  [Edit] my question was marked as duplicate, however the other answers don't explain what happens to the downvoter. btw once again I am impressed by stackoverflow's ability to moderate a community.

I just noticed that I lost a bunch of points from my reputation score, and I used the "reputation" tab on my user profile page to try and track down the cause.  During my investigation, I noticed there was an unusual event of type "reversal". In the normal place of a question title, it says "voting corrected".     What does this mean, and what caused it?  Did I do something wrong? Why did I lose all of that reputation? Is the system punishing me for leaving too many good answers?  Is there any way to earn it back?


I use a location api to set my lat and long into variables. Which I am tying to pass into my location for my google API call.  I have tried different sequences of turning two string variables into one. (str(lat), str(lon)), (str(lat) + str(lon)), str(lat), str(lon), str(lat) + str(lon), and (str(lat, lon))  check_url = 'http://api.ipstack.com/check?access_key=3fea3b33a38ef7abd674c9e0515183be' r = requests.get(check_url) j = json.loads(r.text) lat = j['latitude'] lon = j['longitude'] mylocation = (str(lat), str(lon))   I am trying to pass the lat and lon into the variable   LOCATION = 'mylocation'   for my api call.  It prints as '38.9208','-77.036'  But for my api call I need it to return as '38.9208,-77.036'

What would be your preferred way to concatenate strings from a sequence such that between every two consecutive pairs a comma is added. That is, how do you map, for instance, ['a', 'b', 'c'] to 'a,b,c'? (The cases ['s'] and [] should be mapped to 's' and '', respectively.)  I usually end up using something like ''.join(map(lambda x: x+',',l))[:-1], but also feeling somewhat unsatisfied.


I know that black absorbs light and converts it into heat which makes it a good emitter of radiant heat while white reflects it. Let's say if I place 2 cups, 1 black and 1 white, same material, in a dark room, which cools faster? Why is black a better emitter? Is it because it converts light to heat?

Why are emitters colored black better emitters than other colors?  Why is white a worse emitter?


I have no idea what is going on, what to check or even where to search for help other than here. The past 5 updates have all frozen at around 75% complete, and I'm trying to install Gnome Calculator and it's stuck at 99%. All other software in the past 2 weeks has failed to install too.

When I log into my web server via SSH I see the information:  88 packages can be updated. 80 updates are security updates   I tried apt-get update then apt-get upgrade but each time I log in I still see the message about updates. How do I install them?


I have two passports, Brazilian and Swedish (dual nationalities). I am flying from Brazil to the US  (Miami) and would like to use my Swedish passport with approved ESTA. During my vacation in the US (16 days) I will fly to Mexico (Cancun for 8 days) and would like to know if I can leave the US and enter Mexico with my Brazilian passport (Brazilians don't need a Visa to enter MEX). When flying back from Cancun to the US (Miami) can I enter with my Swedish passport again?  My concern is:   I will enter the US with my Swedish passport (valid ESTA), and from the US fly to MEX with my Brazilian passport. Is that ok? Can I leave the US with my Brazilian passport (which doesn't have a valid US visa) to enter MEX? I will enter MEX with my Brazilian passport (no visa required), and from MEX fly to the US with my Swedish passport (valid ESTA). Is that OK? When I return to the US the second time, will I have a “departure stamp” or will the officer only see one “entry stamp”?

I am a citizen of two different countries, and have two passports.  How should I use my passports when traveling?


I'm a student, and I've never tried declaring an array explicitly like this before. I want to put more than one sudoku grid into the class for the finished product, or else I would declare and initialize the array in one statement. I want for "solved" to refer to a different grid depending on whether an easy, medium or hard sudoku grid was selected. Is that possible? The way that I've written it results in a null pointer exception, but I am not sure how to declare an array as a class member and then initialize it explicitly within each constructor. If you could please straighten me out on syntax, I would appreciate it. I guess that something must be wrong with how I am declaring that array. This is what I used to test it: public class SudokuDriver {  public static void main(String[] args) {      SudokuSolution solved = new SudokuSolution();          System.out.println(solved.getSolved(0, 1));     System.out.println(solved.toString());  }}  And here is the class that I am testing: public class SudokuSolution { private int [][] solved;  public SudokuSolution () {          int [][] solved = {                  {6, 9, 7, 8, 3, 1, 4, 2, 5},                 {2, 8, 4, 9, 7, 5, 1, 6, 3},                 {5, 3, 1, 2, 6, 4, 9, 7, 8},                 {3, 4, 9, 1, 5, 6, 2, 8, 7},                 {7, 5, 8, 4, 9, 2, 3, 1, 6},                 {1, 6, 2, 7, 8, 3, 5, 9, 4},                 {4, 2, 6, 3, 1, 7, 8, 5, 9},                 {8, 1, 5, 6, 4, 9, 7, 3, 2},                 {9, 7, 3, 5, 2, 8, 6, 4, 1}             };     }      public int getSolved(int a, int b)  {                  return solved[a][b];                 }          public String toString()  {                  StringBuilder grid= new StringBuilder();         int i, j;                  for (i=0 ; i < solved.length; i++) {             for (j = 0; j < solved.length; j++)  {                 grid.append(solved [i][j] + ((i==solved.length - 1) ? "\n" : " "));             }         }                  return grid.toString();     }  }

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 can't use the std container iterator in a template class.  I get this errors : error C2061: syntax error : identifier 'iterator' error C2238: unexpected token(s) preceding ';'  Here the source code:  #include <list> #include <functional> #include <memory>  template<typename TParam> class MyClass { public:     using TFunction = std::function<void(TParam)>;     using TContainer = std::list<TFunction>;     using TIterator = TContainer::iterator; // compilation error here! };   How to use the iterator of the container in the templated class?

In templates, where and why do I have to put typename and template on dependent names? What exactly are dependent names anyway?    I have the following code:  template <typename T, typename Tail> // Tail will be a UnionNode too. struct UnionNode : public Tail {     // ...     template<typename U> struct inUnion {         // Q: where to add typename/template here?         typedef Tail::inUnion<U> dummy;      };     template< > struct inUnion<T> {     }; }; template <typename T> // For the last node Tn. struct UnionNode<T, void> {     // ...     template<typename U> struct inUnion {         char fail[ -2 + (sizeof(U)%2) ]; // Cannot be instantiated for any U     };     template< > struct inUnion<T> {     }; };   The problem I have is in the typedef Tail::inUnion<U> dummy line. I'm fairly certain that inUnion is a dependent name, and VC++ is quite right in choking on it. I also know that I should be able to add template somewhere to tell the compiler that inUnion is a template-id. But where exactly? And should it then assume that inUnion is a class template, i.e. inUnion<U> names a type and not a function?


My computer has an unallocated free space of 3.69 GB according to Gparted in Ubuntu. Ubuntu is running out of space. I want to add that unallocated space of 3.69 Gb to the Ubuntu. My problem is that when I type a command line in the terminal in Ubuntu I get /dev/sda5 to 8 with Linux. Already, I know it is not /dev/sda6. To which one do I add this unallocated free space ??  Please check the graphics if that helps.

Previously, I have installed Windows 7 on my 320 GB laptop with three partitions 173, 84 and 63 GB each. The 63 GB partition was where the Windows was installed. The rest were for file containers.  Now I changed my OS to Ubuntu 12.04 LTS. I installed Ubuntu by replacing the entire Windows 7 on the 63 GB partition. The rest of the partitions remain as an NTFS Windows partition and I can still access them both (the 173 and 84 GB partitions).  Now I want to change the two partitions of Windows into an Ubuntu format partitions plus most importantly, I want to extend the 63 GB partition to more than a 100 GB because at the moment I am running out of disk space. Whenever I try to install any application, especially using wine, it always complains for a shortage of disk space.  How do I do the extending activity before I entirely format my laptop again and lose all the important files on my partitions?


If we let $U_1, U_2, U_3,..., U_n$ be uniform (0,1), find $$\mathbb E[\sum_{i=0}^n iU_i^{i-1}]$$which, using the linearity of expectation, gives $$\sum_{i=0}^n \mathbb E[i U_i^{i-1}]$$  Doing this summation gives us $$\Bbb E[U_1^0]+\Bbb E[2U_2^1]+\Bbb E[3U_3^2]+...+\Bbb E[nU_n^{n-1}]$$$$=1+1+1+...$$ Which is equal to $\infty$, or rather equals infinty in the limit $n\to \infty$.  How can an expected value be infinte? How would one give this answer if asked to 'find' the expected value? Does this mean that the expected value does not exist? Or have I miscalculated this - it seems unlikely that a finite sum should give an infinite answer.

From the distribution density function we could identify a mean (=0) for Cauchy distribution just like the graph below shows. But why do we say Cauchy distribution has no mean?


I am running Debian. I have a jar file that I need to execute. A wrapper bash script does a java -jar MyProg.jar. The jar also calls some C code for which LD_LIBRARY_PATH needs to be set.   I have set LD_LIBRARY_PATH in the current user's (let's say Sriram)'s bashrc like so: export LD_LIBRARY_PATH=myLibLocation.    Everything works as expected when running the above script from the command line. However, when I run the same bash file by double-clicking on it, LD_LIBRARY_PATH is not set. Here is a sample bash script I wrote:  #!/bin/bash echo `whoami`; echo "PATH = ${LD_LIBRARY_PATH}"     It runs as expected from the command line but not when I run it by double-clicking. The output in that case is:    Sriram PATH =       question is exactly the same as this. I have tried to implement all the suggestions there but have not had success.    Update:   What I tried from the answer to the question I linked to: 1. Created a file ~/.xsessionrc. It did not exist on my system. 2. Set LD_LIBRARY_PATH in the above script.    Restarted a new shell. Re-ran the above script. No changes were observed.  Any help is most welcome.

Is ~/.bashrc  the only place to specify user specific environment variables, aliases, modifications to PATH variable, etc?  I ask because it seems that ~/.bashrc seems to be bash-only, but other shells exist too…


Lives in damp places and can protrude head from both directions, 1 cm long approximately

I couldn't identify which species these worms belong to. I believe they're insect larvae.  They measure approximately 5 to 10 mm in length, and are common in the southern states of India. They carry cocoons, open at both ends, which the worms can wriggle inside and alternate their direction of movement. These cocoons are perfectly smooth except for the openings.  Another  shows something similar, but the cocoon of that worm looks more woven, while this one doesn't.


Does anyone have a link to clear docs on the meaning of all the fields for Wi-Fi networks when I Enable Wi-Fi verbose logging in the developer options?  I can guess a few and worst case I can read the source, but I was hoping for a clear and simple table.  Specific fields are:   rssi (this is about the only one I'm 100% clear on) score tx rx   Also, the extra data after the mac address of each access point, e.g.  [(1){FF:FF:FF:FF:FF:FF*=2462,-49,4s};]

I've been trying to troubleshoot a Wi-Fi issue (with a specific network) and have Wi-Fi verbose logging on, but I can't find any documentation on what any of the fields in the network selection menu are. The network in question has the full info of: Connected [ UN UN UN ] f=2462 00:00:b1:6b:00:b5 standard=4 rssi=-75 score=59 tx=23.3,27.9,1.0 rx=20.9 4G STAs:8[(2)  I understand rssi and STAs (although, I have no idea for the second number for STAs) and f fits the channel frequency, but the rest (UN, tx/rx, standard, score, and 4G) have me stumped. Does anyone have any idea for these or a pointer to the relevant documentation?


What is the word that describes an act that was meant to be an act of kindness/helpful, but ironically has not been helpful at all.  I know the word, but it's totally gone out of my head, and I cannot for the life of me remember it.  A few examples:      Hanging out the washing for someone trying to do them a favour, but hanging it incorrectly so it's not going to dry that well.     Doing the dishes for Mum after she's cooked you tea, but you put something non dish washer safe in the dish washer.     Mowing the lawns for your Grandma, but the mower was too short and has now killed the grass.     You told your wife you'd do the washing for her, which she was so thankful for, but you put the towels in with the clothes, and she   wasn't too happy about that.    I KNOW there is a word, but I just am absolutely stumped. Any help?!

I want to say "someone (or something) intends to help, but instead it makes things worse". Is there any succinct expression or phrase for this?  Thanks.


I have the following lines in my .bash_aliases file alias enw='emacsclient -nw' alias gie='enw ~/.config/git/ignore' alias ls='ls --color=auto'  and I don't understand how and why they all work (they do!). The second alias uses the first, which means that expansion has to be performed repeatedly to get an actual command. In fact, I can observe this by writing gie in the terminal and pressing Ctrl+Alt+e to expand manually. After pressing it once I get enw ~/.config/git/ignore, and after pressing it again I get emacsclient -nw ~/.config/git/ignore. However, an expansion strategy that simply expands until there's nothing to expand wouldn't work for the third alias since it's recursive, and the third alias works nevertheless. If bash can expand nested aliases, how does it avoid non-termination? Does it simply stop after a fixed number of steps? Or does it stop after it encounters the same alias twice in an expansion chain?

Bash manual says     The first word of the replacement text is tested for aliases, but a   word that is identical to an alias being expanded is not expanded a   second time. This means that one may alias ls to ls -F, for   instance, and Bash does not try to recursively expand the replacement   text.   I'm trying to figure out which alias follows "identical to" in the quote,    any alias being expanded in the same sequence of alias expansion recursions, or  the alias whose expansion was first started, or  the alias whose expansion was last started.   So I create  an example  $ alias a1=a2;  $ alias a2=a3; $ alias a3=a4;   and want to check the alias expansion result of a1, in the following cases  $ alias a4=a1;   or  $ alias a4=a2;   or  $ alias a4=a3;   How can I check the alias expansion result of a1, possibly by performing alias expansion on a1 without letting the shell going further than alias expansion?


Let $A$ be a domain with $\max(A)$ a finite set. It is known that if $\mathfrak{m}\in \max(A)$ then $A_{\mathfrak{m}}$ is a PID. Show that $A$ is also a PID.  Here is what I was thinking. Suppose that $A$ is a local ring first. It is enough to show that every $\mathfrak{p}\in \text{spec}(A)$ is a principal ideal. We know, by hypothesis, $\mathfrak{p}'$ is a principal ideal where $\mathfrak{p}'$ denotes the image of $\mathfrak{p}$ under the localization map $A\to A_{\mathfrak{m}}$. Thus, we can write $\mathfrak{p}' = (\frac{a}{1})A_{\mathfrak{m}}$ for some $a\in A$. We claim that $\mathfrak{p} = (a)A$. Let $x\in \mathfrak{p}$, since $\frac{x}{1}\in \mathfrak{p}'$ we can write $dx = ay$ for some $y\in A$ and $d\in A\setminus \{m\}$. Since $A$ is a local ring, and $d$ is not in the maximal ideal, $d$ is a unit, therefore $x = d^{-1}ay$. This shows that $\mathfrak{p}$ is generated by $a$. What if $A$ is not a local ring? If we pick a prime ideal $\mathfrak{p}$ then we at least know there is a finite list of maximal ideals $\mathfrak{m}_i$ for $1\leq i\leq n$ which contain $\mathfrak{p}$. As before let us denote by $\mathfrak{p}_i$ to be the image of $\mathfrak{p}$ under the localization. We can write $\mathfrak{p}_i = ( \frac{a_i}{1}) A_{\mathfrak{m}_i}$ for some $a_i\in A$. Therefore, for every $x\in \mathfrak{p}$, and every $1\leq i\leq n$, there exists $y_i\in A$ and $d_i \in A\setminus \{m_i\}$ such that $d_i x = a_i y_i$. Now we have two issues. Even if we can somehow show that each $d_i$ is a unit then it will only show that $\mathfrak{p} = (a_1,a_2,...,a_n)$. The issue of "simplifying" this ideal all the way down to the form $(a)$ for some $a\in A$ is essentially asking for a gcd. It feels like we need to use the Chinese Remainder Theorem here somehow but it is not clear to me how to apply it.

I am reading a proof of this result that uses the Chinese Remainder Theorem on (the finite number of) prime ideals $P_i$. In order to apply CRT we should assume that the prime ideals are coprime, i.e. the ring is equal to $P_h + P_k$ for $h \neq k$, but I can't see it. How does it follow?


This question was asked years ago  by another user but I cannot find satisfying answer so I ask again. The problem is from Arnold's "Mathematical Methods of Classical Mechanics", p. 97 in Chapter 21 on the D'Alembert's principle: A rod of weight P, tilted at an angle of $60^{\circ}$ to the plane of a table, begins to fall with initial velocity zero. Find the constraint force of the table at the initial moment, considering the table as (a) absolutely smooth (b) absolutely rough (In the first case, the holonomic constraint holds the end of the rod on the plane of the table, and in the second case, at a given point.)  My solution for question (b) is,  Since the end is fixed, the virtual variation is orthogonal to the rod, hence the total force of the constraint force and the gravity must be orthogonal to the rod. On the other hand, according to the D'Alembert's principle, the constraint force must be orthogonal to the virtual variation, so the constraint force must be along the rod. Combine 1 and 2 and by elementary geometry, we can find that the constraint force is $\frac{\sqrt{3}}{2}P$.    My questions are:    Is my solution to (b) right? How to solve (a)?

I really hope someone will take a quick look at the following, I would just love to better understand it...  This exercise is from Arnold's "Mathematical Methods of Classical Mechanics", p. 97 in the chapter on d'Alemberts principle:  A rod of weight P, tilted at an angle of 60° to the plane of a table, begins to fall with initial velocity zero. Find the constraint force of the table at the initial moment, considering the table as  (a) absolutely smooth  (b) absolutely rough  (In the first case, the holonomic constraint holds the end of the rod on the plane of the table, and in the second case, at a given point.)"      I must admit, I am pretty unsure on how to do calculations using this "fancy" mathematical kind of physics.  First off, I'm lost with (a). But I'll have a go at (b): As far as I understood, d'Alemberts principle states, that if $M$ is a constraining manifold, $x(q)$ is a curve in $M$ and $\xi$ is a vector perpendicular to $T_xM$, then $x$ satisfies Lagrange's equations  $\frac{d}{dt} \frac{\partial L}{\partial \dot q} = \frac{\partial L}{\partial q} \qquad L = \frac{{\dot x}^2}{2} - U(x)$  iff for the following inner product, we have  $\left(m \ddot x + \frac{\partial U}{\partial x}, \xi \right) = 0$  I guess that's about right so far? The constraint would in this case essentially be $\mathbb S^1$, since the rod moves on a circe around the point in contact with the table. Can we assume that all the rod's mass is at the center of mass?  Would we then have $U(x) = -gx_2$ in this case (where $x_2$ is the vertical component of $x$)?  If yes, then $\partial U / \partial x = -ge_2$. Where $e_1, e_2$ are the horizontal and vertical unit vectors, respectively.  At the inital moment, we have $x = \cos(60°) e_1 + \sin(60°) e_2$, so by d'Alembert's principle we must have  $\left(m \ddot x + \frac{\partial U}{\partial x}, \cos(60°) e_1 + \sin(60°) e_2 \right) = 0$  or written differently  $m \ddot {x_1} \cos(60°) + m \ddot{x_2} \sin(60°) - \sin(60°)g = 0$    So: Is this correct so far? Or am I way off? Is (a) handled any differently up to this point?  Thanks for reading (and hopefully thanks for your helpful reply)!  If anyone could recommend a good problem book (with solutions), in which this kind of mathematical approach is used (I don't know if this is how physicists would actually compute stuff??), I would greatly appreciate it.  Kind regards,  Sam


On p94 of Fetter & Walecka's Quantum Theory Of Many Particle Systems, it is stated that since propagators with both arguments at the same time such as $G^0_{\alpha\beta}(x, x)$ arise from contractions of field operators in the 2-body potential, which always appear in the order $\psi^\dagger_\beta(x)\psi_\alpha(x)$ i.e. [adjoint]$\cdot$[non-adjoint], the contraction should be interpreted as  $$ \begin{split}iG^0_{\alpha\beta}(x,x) & = \lim_{t'\rightarrow t^+}\left<\Phi_0|T\left[\psi_\alpha(\vec{x}t)\psi^\dagger_\beta(\vec{x}t')\right]|\Phi_0\right>\\ & = -\left<\Phi_0|\psi^\dagger_\beta(\vec{x}t')\psi_\alpha(\vec{x}t)|\Phi_0\right> \end{split}$$ whose field operator order matches that above. However, p98 says that the factor of $(-1)^{N_{\mathrm{closed\space loops}}}$ multiplying each diagram is only incurred once the field operators contracted in the loop are rearranged so that each pair is ordered $\psi_\alpha(x)\psi^\dagger_\beta(x)$ [non-adjoint]$\cdot$[adjoint]. This seems like a discrepancy to me. Can someone explain?

I know this is connected to the fact that fermions are represented by anticommuting operators, but I still cannot find the way to get this minus in Feynman rules.


I do not know the data type of time_t. Is it a float double or something else? Because if I want to display it I need the tag that corresponds with it for printf. I can handle the rest from there for displaying time_t but I need to know the data type that corresponds with it.

I searched my Linux box and saw this typedef:  typedef __time_t time_t;   But I could not find the __time_t  definition.


I need to move my blog say example.blogspot.com to example.com and custom service provider say Hostgator. I want to do this migration without impacting the SEO.  What I am thinking of  1. Using the link below I just change pointing of example.blogspot.com to example.com.    After a week when all my pages are migrated from  example.blogspot.com to example.com, I will revert the settings of cname and now exmaple.com starts pointing to HostGator   Is this approach ok or a better solution is there?

Is it possible to redirect a blogspot site to an existing URL?  Note that I don't want to buy a new domain and tell blogspot to use that, eg as per this question: .    Instead I am trying to 301 redirect to an existing website in order to combine the website and the blog in one place.  So it needs to be:  301 example.blogspot.com/post to example.com/blog/post


I have install php versions 5.6,7.0 and 7.1 . But php -v returns  PHP 5.5.9-1ubuntu4.21 (cli) (built:feb 9 2017) <br> copyright (c) 1997-2014 The PHP Group   I also tried these commands    a2enmod php7.1   a2dismod php5.6   service apache2 restart   but they don't work ..   so how can i run multiple versions of php on terminal?

I want to have both PHP 5.2.17 and PHP 5.3.5 installed on my Ubuntu machine and switch as per my necessity. How can I achieve this?


My laptop is 2GB, 1.2GHz dual core, LUKS. I installed Ubuntu in place of Windows XP and I thought it would go faster, but it's dog slow. This is what I have to live with:

For a given hardware configuration, how do I find out if Ubuntu will run on it? What considerations should I take into account when choosing an Ubuntu version and  such as:    with a lighter desktop than the usual Gnome and Unity  with the even lighter LXDE desktop   Obviously Ubuntu does not run on some processor architectures. So how do I go about choosing the right version and derivate. How can I find out the minmal system requirements?


I've read just a few books in SciFi genre, never liked it, because it's usually written by writers, not scientists. Though, recently I've read few books written by Peter Watts and Stanislaw Lem. There is actual science in those books, with some speculation, but still: science instead of usual mumbo jumbo. How do I find more of such books? Is it some specific sub-genre?

Are there terms that describe a science fiction story that strictly adheres to, I guess, plausible science concepts and technology versus science fiction were the science is really just made up and is theoretically impossible? I know a lot of sci-fi TV shows, like Battlestar Galactica, employed physicists and other scientists as consultants to make sure things were accurate, whereas other shows that I won't name employed people solely to fill in technical- and sciency-sounding words in the script.


I'm trying to install Ubuntu, my computer has the following configuration:  mobo Asus Maximus VI Extreme 2x Ati R9 280x (crossfire) 8gb ram 120GB kingston ssd sata 2xconventional hd, 500GB and 1000GB   When i try to install Ubuntu, even trying with the nomode option set, the screen goes black with a blinking line on the left upper part of the screen, and it does nothing. I've tried with older versions, but I can't install it.  Every help is appreciated, i really need to install it. Thank you!

I am trying to boot Ubuntu on my computer.  When I boot Ubuntu, it boots to a black screen.  How can I fix this? Table of Contents:


After a Windows 10 update, I'm experiencing a problem with GRUB: the system boots directly into Windows and i don't have the chance to select Ubuntu. I tried to use a live USB of Boot-Repair (first the recommended option and then with the "purge the grub" option flagged). I also tried to use these commands in an administrator command prompt (Windows):  bcdedit /set {bootmgr} path \efi\ubuntu\shimx64.efi bcdedit /set {bootmgr} path efi\ubuntu\grubx64.efi     Any tips?

I've just upgraded to Windows 10 from Windows 8.1 on my partitioned laptop that has Ubuntu 14.04 installed. Grub no longer appeared on boot so I ran boot-repair from an Ubuntu liveUSB. This didn't seem to have any effect. I've checked and secure boot is still disabled. Log from boot-repair:  So what's next?  Update: I've attempted to use chroot to update grub from my Ubuntu partition. update-grub runs successfully finding both linux and windows boot manager but the process still doesn't have any effect. grub-install complains that it cannot find EFI directory (but I have mounted everything correctly).  Update2: Just discovered that running efibootmgr after chroot into ubuntu shows ubuntu as not being in the boot order at all. I manually changed the order and rebooted to discover that the bootorder was reset. I run in windows: bcdedit /set {bootmgr} path \EFI\ubuntu\shimx64.efi But this has no effect either even after reporting 'Operation Successful'.


I am traveling to Amsterdam and then Dusseldorf and Brussels for about 20 days. My Schengen visa expires one week after the date of entry. Is this allowed, or should I apply for another Schengen visa?

I'm from Tunisia and I got a Schengen visa from the Austrian Embassy for  28 days, the “duration of stay”, and the number of entries is 1. But the validity of the visa is from 02/08/2015 to 13/09/2015.  Do I have to stay only 28 days, for example from 02/08/2015 to 29/08/2015 or can I stay there until 12/09/2015 ?  And if I have got to stay only 28 days, then can I choose the days of stay, that's mean can I stay in Austria for example from 09/08/2015 to 05/09/2015?


My network wide comments are listed in the stackexchange.com . When I'm clicking on any of the comment it navigates to the post instead of the particular comment.  But when I click the comment from site's , it navigates to the particular comment.  So will be the approach changed to navigate to the comment instead of post, in the stackexchange.com comments section too?

On , under the comments subtab, there's a giant list of comments. However, they only give links like http://stackoverflow.com/questions/####, which open the page the comment is on but don't move the page to the comment. Could the comment ID be included in the URL such that the page opens to the comment?


\documentclass[12pt]{article} \usepackage{amsmath}  \begin{document}  As shown in Appendix~\ref{app_eg},...  \appendix \renewcommand{\thesection}{\Alph{section}} \numberwithin{equation}{section}  \section{An example} \label{app_eg}  \begin{equation} 1+1=2 \label{pert} \end{equation}  \end{document}   I would like the name of the appendix to be Appendix A: An example. But the equation number and referencing in the main text should remain as it is now. Please suggest a fix.

I wanna display A as Appendix A in TOC, as shown below.     I tried to add \backmatter before \appendix as shown in , but cref{label} will display as Section 1. I also used \renewcommand as suggested in the most posts on this site, but it doesn't make any changes. Here is the source code.  \documentclass[twoside,12pt]{article}  \usepackage{cleveref}  \usepackage[english]{babel} \usepackage[toc, title]{appendix} \renewcommand\appendixname{Anexo} %\renewcommand\appendixpagename{Anexos} \renewcommand\appendixtocname{Appendix}  \begin{document}  \tableofcontents  \section{The main body of the text} Refer to \cref{appendix} for more information.  \appendix \section{A complete table.} \label{appendix} Some text.  \end{document}


Linear regression uses the "vertical" (in two dimensions) distance of (y - ŷ). But this is not the real distance between any point and the best fit line.   I.e. - in the image here:    you use the green lines instead of the purple.   Is this done because the math is simpler? Because the effect of using the real distance is negligible, or equivalent? Because it's actually better to use a "vertical" distance?

Let’s say we have the input (predictor) and output (response) data points A, B, C, D, E and we want to fit a line through the points. This is a simple problem to illustrate the question, but can be extended to higher dimensions as well.  Problem Statement    The current best fit or hypothesis is represented by the black line above. The blue arrow ($\color{blue}\rightarrow$) represents the vertical distance between the data point and the current best fit, by drawing a vertical line from the point till it intersects the line.   The green arrow ($\color{green}\rightarrow$) is drawn such that it is perpendicular to the current hypothesis at the point of intersection, and thus represents the least distance between the data point and the current hypothesis.  For points A and B, a line drawn such that it is vertical to the current best guess and is similar to a line which is vertical to the x axis. For these two points, the blue and the green lines overlap, but they don’t for points C, D and E.  The least squares principle defines the cost function for linear regression by drawing a vertical line through the data points (A, B, C, D or E) to the estimated hypothesis ($\color{blue}\rightarrow$), at any given training cycle, and is represented by   $Cost Function = \sum_{i=1}^N(y_i-h_\theta(x_i))^2$  Here $(x_i, y_i)$ represents the data points, and $h_\theta(x_i)$ represents the best fit.   The minimum distance between a point (A, B, C, D or E) is represented by a perpendicular line drawn from that point on to the current best guess (green arrows).   The goal of least square function is to the define an objective function which when minimized would give rise to the least distance between the hypothesis and all the points combined, but won’t necessarily minimize the distance between the hypothesis and a single input point.   **Question**  Why don’t we define the Cost Function for linear regression as the least distance between the input data point and the hypothesis (defined by a line perpendicular to the hypothesis) passing through the input datapoin, as given by ($\color{green}\rightarrow$)?


What is the reason that initial monthly payments towards a mortgage mostly goes to the interest and then later on, the payment goes to the principal? Is it designed this way for the benefit of the bank or the benefit of the home owner?In the same vein, why making a lump sum payment goes towards the principal?

When you take out a traditional mortgage the first payment you make to a bank pays off mostly interest and then later payments start paying off principal.   What is the reason for this?   Is it just a historical accounting/industry convention? Or is there some reason why it happens this way?


How can I use my iPad Mini and my Android tablet as another two monitors for my notebook? How can I use my iPad mini and android table as a secondary and a third monitors of my notebook? i.e. I want to use another two monitors for my notebook. and the secondary and the tertiary tablets are using different OSs (Android and iOS) Thanks.

About ten years ago everyone at work started using dual monitors. It was great. But I switched to laptop for most tasks and do not have a second monitor. It occurred to me that I have a second screen right next to me (my phone) that I'm not using.   Is it possible to use it as a second monitor? I can imagine using it to show a training video while I follow along on the main screen.   I have a Mac and my phone is Android Galaxy 6S. I have an older iPhone 4S as well. Funnibly enough, my Android phone has higher resolution than my Macbook.


Sorry for no-too-much clear title.  I'm using Twitter Bootstrap Modal to edit some record.                                       And this is the javascript code that open the Modal:  $(".sms-model").click(function(ev) { // for each edit contact url     ev.preventDefault(); // prevent navigation     var url = $(this).data("form"); // get the contact form url      $("#smsModelModal").load(url, function() { // load the url into the modal         $(this).modal('show'); // display the modal on url load     });    $("#smsModelModal").modal('show'); // display the modal on url load     return false; // prevent the click propagation });   Finally this is the form injected inside the modal:
             <form role="form" method="post" class="sms-model-form" action="{{ @SERVER.REQUEST_URI }}">                 <fieldset>                     <legend class="sr-only">Edit</legend>                     <input type="hidden" name="edit_id_model" value="{{ isset(@sms_model) ? @sms_model[0]['fields']['id']['value'] : '' }}" />
                         {{ @lng_label_sms_title }}                         <input type="text" class="form-control required-field" name="title" value="{{ isset(@sms_model) ? @sms_model[0]['fields']['title']['value'] : '' }}"/>

                         {{ @lng_label_sms_text }}                         <textarea class="form-control" name="text" class="required-field">{{ isset(@sms_model) ? @sms_model[0]['fields']['text']['value'] : '' }}</textarea>
                     <button type="submit" class="btn btn-white pull-right">                          {{ isset(@sms_model) ? @lng_btn_edit : @lng_btn_add }}                     </button>                     <input type="submit" class="btn btn-primary" value="Test" />                 </fieldset>             </form>
   Everything functions as a charme. Now I would submit the form via AJAX.  So I'm adding this:  $('.sms-model-form').on('submit', function(e) {         console.log('test on submit....');         e.preventDefault();         $.ajax({             type: $(this).attr('method'),             url: this.action,             data: $(this).serialize()+'&ajax=TRUE',             context: this,             success: function(data, status) {                 $('#smsModelModal').html(data);             }         });         return false;     });   But form is submitted via regular mode, and not via AJAX. I.e. I don't have neither the event logged in console.  I'm thinking that this is because the form is injected in a second moment in the page and not at  $(document).ready(function() {   Am I right? How I can solve my issue?

I have a bit of code where I am looping through all the select boxes on a page and binding a .hover event to them to do a bit of twiddling with their width on mouse on/off.  This happens on page ready and works just fine.  The problem I have is that any select boxes I add via Ajax or DOM after the initial loop won't have the event bound.  I have found this plugin (), but before I add another 5k to my pages with a plugin, I want to see if anyone knows a way to do this, either with jQuery directly or by another option.


Let $f: I \to \mathbb R$ be a differentiable function, where $I$ is an open interval, and assume that there exists a constant $C>0$ such that for all $x \in I$, $|f'(x)| \leq C$. Note that I am not assuming that $f$ is of class $C^1$: so $f'$ is a priori not continuous or even Riemann-integrable, but $|f'|$ is bounded and positive and Lebesgue-integrable. Question: is it true that for all $x,y \in I$, we have $|f(y)-f(x)| \leq \int_x^y |f'(t)| dt$? Using the Mean Value Theorem, you could express $f(x)-f(y)$ as a Riemann sum of $f'$, but since a priori $f'$ is not Riemann integrable I'm not sure this helps. I guess the question probably amounts to knowing the sharp regularity conditions on $f$ to have $f(y)-f(x)=\int_x^y f'(t) dt$.

In a  I needed an argument of the following kind:  Let $f, g: [a, b] \to \Bbb R$ be functions with the following properties:  $f$ is differentiable, $g$ is continuous, $|f'(x)| \le g(x)$ for all $x \in [a, b]$.  Then $|f(b) - f(a)| \le \int_a^b g(x) \, dx$.  Seems pretty easy: We have $$ \tag{*}  |f(b) - f(a)| = \left| \int_a^b f'(t) \, dt \right|  \le \int_a^b |f'(x)| \, dx \le \int_a^b g(x) \, dx \, . $$ There is just one problem: We have used the , and that requires $f'$ to be Riemann integrable (or Lebesgue integrable and absolutely continuous), compare . This is for example satisfied if $f'$ is continuous. But the above statement holds without additional assumptions on $f'$: Let $n$ be a positive integer and $x_k = a + \frac kn (b-a)$, $0 \le k \le n$, be a partition of the interval $[a, b]$. We apply the  to each subinterval $[x_k, x_{k+1}]$: $$  f(x_{k+1}) - f(x_k) = (x_{k+1} - x_k) f'(c_{n, k}) $$ for some $c_{n, k} \in [x_k, x_{k+1}]$. It follows that $$ |f(b) - f(a)| \le \sum_{k=0}^{n-1}| f(x_{k+1}) - f(x_k)| \le \sum_{k=0}^{n-1} (x_{k+1} - x_k) g(c_{n, k}) \, . $$ $g$ is continuous and therefore Riemann integrable. The expression on the right is a Riemann sum for $\int_a^b g(x) \, dx$ with the partition size $(b-a)/n$. It follows that $$  \lim_{n \to \infty } \sum_{k=0}^{n-1} (x_{k+1} - x_k) g(c_{n, k})  = \int_a^b g(x) \, dx $$ and therefore $|f(b) - f(a)| \le \int_a^b g(x) \, dx$. My question: Is there a simpler proof of the statement? It seems pretty basic, therefore I wonder if there is a simpler proof, without going into technical details such as partitions and Riemann sums. Perhaps it is a consequence of some other theorem about integration which I failed to find?


According to :     Edits made by the same editor in a short period of time are collapsed: no matter how many times a post is edited within a 5-minute window, only one revision is stored ...   In this , revisions 2 and 3 (by me) for the question are less than 2 minutes apart, and yet they weren't rolled into one revision.  I posted an answer between the edits, but it's not the first time I've done that. Shouldn't the timer be post-specific?

When answers are posted within a question's initial grace period, it is possible that further edits could completely change the question (see ""), and render those first few answers incorrect.   Worse yet, nobody is notified that there was a change to the question, except those that are sitting on the page and notice the edit bar pop in. And of those, only those bothered enough to open it in a new window to compare the differences, will see how much was changed.   After the grace period is up, nobody will be able to consolidate why the first few answers actually answered a different question. And the answerers won't know unless someone comments or down-votes (and in the latter case, without context, they still might have trouble understanding, unless they memorized the question's initial state).  Jon Skeet stated it pretty well in  on :     I'd like this to apply to the question, as well as answers. Sometimes I (or others) have added perfectly good answers, but then the question has been changed within the grace period, making answers look foolish without any indication of what's happened.   So this time, my proposal is quite simple:     Once an answer is posted to a question within the initial grace period, a new grace period should start, and the current state of the question should be saved as the first revision. Further edits within the next 5 minutes will be aggregated into a new, second revision.   This will only noticeably affect questions where answers are posted within the grace period and the author of the question makes edits within 5 minutes of the first answer. (Effectively, it would treat it as if a different user made an edit within the author's grace period.) All other scenarios will continue to behave as they do today.  This feature request comes close:    However, the answer suggests a simple change to the wording or a pencil icon (like we see with edited comments), without adding a revision that can be viewed and compared. I don't think this is enough - in some cases it's going to be important to know what changed, not just when.


I have Gigabyte b75m-d3h rev1.1(1155) with Corei3 2340(3.4ghz). How do i get some video driver working? this is how it looks like.

After upgrading to 15.04, I have one additional driver (it did not appear in 14.10). What is the purpose of this driver and should I enable it?


I would like to know what version of glibc will be used in later releases.  Is that information available?

I want to list all the packages(installed or not installed) along with the latest version number available in the repositories.  For example:  The output of apt-cache policy chromium-browser shows like below  $ apt-cache policy chromium-browser chromium-browser:   Installed: (none)   Candidate: 34.0.1847.116-0ubuntu2   Version table:      34.0.1847.116-0ubuntu2 0         500 http://ftp.cuhk.edu.hk/pub/Linux/ubuntu/ trusty/universe amd64 Packages   So the latest version of chromium-browser package available in the repository is 34.0.1847.116-0ubuntu2. Like that, i want to list the version number along with the package names that are available in repositories. And all i want to do this through command-line.  I want the output to be like this,  chromium-browser 34.0.1847.116-0ubuntu2 xxxxxxxxxxxxxx   yyyyyyyyyyy ............     ............


Let $X_1$ and $X_2$ be connected topological spaces. I want to show that the product $X_1 \times X_2$ is connected.  By definition the base from which the topology $\mathcal J_{X_1 \times X_2} =    \{\cup_{\alpha \in I} \mathcal B_{\alpha}, \mathcal B_{\alpha} \in \mathcal B \}$ is induced is given as $\mathcal B = \{ U_1 \times U_2 \mid U_i \in \mathcal J_i \}$.  I've tried proving connectedness by assuming $X_1 \times X_2 = U_1 \cup U_2$ with $U_1 \cap U_2 = \emptyset$, $U_1, U_2 \in \mathcal B_{X_1 \times X_2}$, and then use the fact that $X_i$ is connected.  If $U_i = \emptyset$ we are done, so one can assume $U_i \neq \emptyset, X_1 \times X_2$.  Can someone help me to show that $X_1 \times X_2$ is connected ?

You have two connected topological spaces $(A,B)$. Prove that $A\times B$ is also connected.  I understand that I have to prove that there is a point in $B$ (call it $b$), that makes $A\times\{b\}$ homeomorphic to $A$ making it connected to $A\times B$. Then prove that $\{a\}\times B$ is connected in $A\times B$. But I don't really know where to being with this. If you could help that would be appreciated.


is pretty much the only FOSS low-level PDF-editing tool out there. It's pretty useful, and pretty recent since it's updated in 2012.  However, it's a shame that packages are nowhere to be found, and I cannot get it to compile from  on recent distro's.  Aparently, this software uses an ancient form of Qt called Qt3. In order to build Qt3 apps on Qt4 systems, there is this library called libqt4-qt3support and this tool called qt3to4 in the package libqt4-dev-bin. The idea is to convert the source code and compile the source with qt3-support.  I know nothing about Qt, but the basic idea is this, while in the root directory of the project.  Convert the Qt3 source to Qt4:      qt3to4 -alwaysOverwrite ./src/gui/*   Remove the Qt3 check from configure by commenting the check out:  nano ./configure  #       isqmake3=`$testbin --version 2>&1 | grep '3\.[0-9][0-9]*\.[0-9][0-9]*'` #       if test -z "$isqmake3" #       then #               testbin="" #       fi   Configure:    ./configure   Make:  make && sudo make install   But make quits with an error:  ... make[1]: Leaving directory `/tmp/pdfedit/src' make: *** [source] Error 2   So, does anyone have the knowledge to make this work? It would be awesome. We can then apply this to other packages as well. And we can finally answer . :)

Online it says I should be able to find pdfedit in the software center. That doesn't work for me. I've tried many times. Is there any other way to install pdfedit or master pdf edit on ubuntu 12.10.


I installed ubuntu 14.04 alongside windows 8.1 and everything went fine with the installation.  I followed this guide  almost perfectly, except I didn't create a /home partition and I forgot to turn fast boot off till after the install.  After installing, I don't get an option to boot ubuntu upon startup.  If I hold down shift when I restart from windows and click 'use a device' it gives me a ubuntu option, and if I go to Boot Manager ubuntu is listed in the Boot Options Menu, but it boots straight to windows otherwise.  In UEFI Settings ubuntu isn't even listed as a boot option.  I tried running boot-repair but it didn't help.  Secure Boot has been off the entire time.  I can access ubuntu now from windows, but it's a pain not having the option when I boot the computer.

I'm absolutely new to Linux. I would like to know how to install Ubuntu alongside the pre-installed Windows 8+ OS.  Should I do it with Wubi, or through the Live USB/DVD?  What steps do I need to take to correctly install Ubuntu?


It has 3 gears in the front and 7 gears in the rear. And the derailers are suntour XC-Master.

My chain broke and in a moment of silliness (I was cold wet and slightly annoyed)  I threw the broken one away before thinking about measuring the new one.  Is there a guide to getting the chain length/tension correct ?  It's an 8 speed road bike (Shimano Sora back, double ring front)


I am trying to write an in-place reverse function and have followed online code pretty much exactly, yet running the following program throws a bus error. Am I passing the wrong kind of argument to reverse()?  void reverse(char *str) {     char * end = str;     char tmp;     if (str) {         while (*end) {             ++end;         }         --end;         while (str < end) {             tmp = *str;             *str++ = *end;             *end-- = tmp;         }     } }  int main() {     char *s = "sample";     reverse(s);     printf("%s\n");     return 1; }

The following code receives seg fault on line 2:  char *str = "string"; str[0] = 'z';  // could be also written as *str = 'z' printf("%s\n", str);   While this works perfectly well:  char str[] = "string"; str[0] = 'z'; printf("%s\n", str);   Tested with MSVC and GCC.


I know it's possible to modify an element's style attribute using JavaScript, but is it possible to modify the global CSS rule itself? Take the following example:  $('div.test').css('display', 'none');   That modifies all pre-existing elements matching:

   If this script were executed while a page was half loaded the DOM tree would not be complete and any matching elements not loaded wouldn't have this styling rule applied. Is there a way to modify the actual div.test rule itself using JavaScript?  By the way, I do have my own solution to this and am not asking for any workarounds. I would just like to know if this in particular is possible since I've never seen it done before.

It's easy to set inline CSS values with javascript. If I want to change the width and I have html like this:

   All I need to do is:  document.getElementById('id').style.width = value;   It will change the inline stylesheet values. Normally this isn't a problem, because the inline style overrides the stylesheet. Example:

   Using this Javascript:  document.getElementById('tId').style.width = "30%";   I get the following:

   This is a problem, because not only do I not want to change inline values, If I look for the width before I set it, when I have:

   The value returned is Null, so if I have Javascript that needs to know the width of something to do some logic (I increase the width by 1%, not to a specific value), getting back Null when I expect the string "50%" doesn't really work.  So my question: I have values in a CSS style that are not located inline, how can I get these values? How can I modify the style instead of the inline values, given an id?


I'm simplifying a larger complex problem with the following...  Given three arrays of integers, what's the most efficient way to return all the possible combinations of each of the elements? Note that each value from each array will always be given in the same position so [A,B,C] would be the same as [C,B,A]. My desired result is an array of arrays with each hash containing a single combination. For example:  Given:  var array1 = [1,2] var array2 = [a,b] var array3 = [foo,bar]   The result would be:  [   [1,a,foo],   [2,a,foo],   [1,b,foo],   [2,b,foo],   [1,a,bar],   [2,a,bar],   [1,b,bar],   [2,b,bar] ]

How can I get the Cartesian product (every possible combination of values) from a group of lists?  Input:   somelists = [    [1, 2, 3],    ['a', 'b'],    [4, 5] ]   Desired output:  [(1, 'a', 4), (1, 'a', 5), (1, 'b', 4), (1, 'b', 5), (2, 'a', 4), (2, 'a', 5) ...]


I have a complicated account issue with Facebook and need to contact a human.  I could not find any way to get out of the automated help system and actually tell them my story. Is there a way to write them an email, or to otherwise talk to an actual human?

Contacting Facebook can prove to be challenge for some, are there any emails or phone numbers that are active for Facebook?  I know that some of the email addresses come from replies to Facebook others from Support forms.  The rest of the list I think will be made up of Facebook employee usernames e.g. zuck@fb.com  Is there a list out there that contains this?  So far I have found


I was trying to decide between the following two phrasings:   "People like Bob and me are built differently." "People like Bob and I are built differently."   Both sound fine to me and I was trying to figure out what the underlying structure was.  I tried breaking it down in a few ways and evaluating whether it "felt" wrong:   "I am built differently." "Me am built differently." (definitely wrong) "Bob and I are built differently." "Bob and me are built differently." "People like I are built differently." (sounds wrong) "People like me are built differently." "Don't listen to people like Bob and I." (sounds slightly weird) "Don't listen to people like Bob and me."   Do others' gut reactions match up with mine?  I was also hoping someone might have a more compelling analysis.  (I'm not too concerned about following a particular set of prescriptive rules.  But it is sometimes still interesting to see what those rules might say about a particular sentence.)

My friend and I got into an argument about English grammar, so I was hoping maybe you could help us out. Okay so we want to know if the following part of the sentence is correct, "People who are satisfied and feel self-fulfilled like I" rather than "People who are satisfied and feel self-fulfilled like me". I have already provided many sources to my friend showing that the first way is a formal and a grammatically correct way, however he wants an answer with this specific part of the sentence.   Please help us out  Thank you


Should you use is or are here:     I can't tell is you or Amanda is/are the best.   I know with you it would be are.  I know with Amanda it would be is.   And I know with a list of Amanda and Dave it would be is.  But I'm unsure in this particular situation, mixing 2nd and 3rd person.

Should I use 'was' or 'were' in this example?     I was always delighted when my brother or one of my sisters was/were asked to do them.


I have a Windows 8 based Sony Vaio laptop.  Recently I installed Ubuntu 14.04 LTS on my laptop alongside windows, now I can't login into Ubuntu anymore. The boot menu directly boots into Windows 8 and doesn't show the grub menu.  All my files are on Ubuntu, how can I access it or at least how can I retrieve them?

I installed Windows 7, which ate Ubuntu's boot file. When starting up the computer, it now goes straight to Windows, without giving me the option of booting Ubuntu.   How can I get Ubuntu back?


I usually use eclipse , but I said "lets do some fantasy" to myself and things happened. I tried to use terminal command javac at first. I got   The program 'javac' can be found in the following packages:  * default-jdk * ecj * gcj-5-jdk * openjdk-8-jdk-headless * gcj-4.8-jdk * gcj-4.9-jdk * openjdk-9-jdk-headless  Try: sudo apt install (selected package)   I already installed jre8 and jdk8 manually from oracle's website (standard edition) and I'm making programs with eclipse already. Then I typed java -version and the answer was   openjdk version "9-internal" OpenJDK Runtime Environment (build 9-internal+0-2016-04-14-195246.buildd.src) OpenJDK 64-Bit Server VM (build 9-internal+0-2016-04-14-195246.buildd.src, mixed mode)   which is not what i installed manually. Then I used locate -br ^javac$ and got two locations (not a surprise). So:   I can use javac only with the path to where I installed jdk manually, but I wanna use commands without path, just directly . Is that possible (if yes then how ? It seems like I have two java versions. Does that cause any problem? If it does, tell me how to fix please (I prefer eliminating openjdk9)

On Ubuntu 12.04 LTS I have installed Sun's JDK7, Eclipse, and the Arduino IDE. I want the Arduino to use OpenJDK 6 and want Eclipse to use Sun's JDK 7.   From my understanding I need to manually choose which Java to use before running each application. This led me to the update-java-alternatives -l command. When I run this I only see the following:   java-1.6.0-openjdk-amd64 1061 /usr/lib/jvm/java-1.6.0-openjdk-amd64   but when I run update-alternatives --config java I see the following:   *0  /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/java   auto mode 1  /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/java   manual mode 2  /usr/lib/jvm/jdk1.7.0/bin/java                   manual mode 3  /usr/lib/jvm/jre1.7.0/bin/java                   manual mode   I don't understand why the update-java-alternatives doesn't display the same 3 options. I also don't understand how to switch between OpenJDK6 and JDK7. How I can go about using the OpenJDK6 for Arduino development and Sun JDK7 for Eclipse/Android development?