body1
stringlengths
20
4.1k
body2
stringlengths
23
4.09k
I'm a huge fan of StackOverflow.com, but it seems like there should be a related site where developers can post quick tips or lessons learned. There are many time when I have searched the web and stackoverflow for information on a particular topic or problem I need to solve and have come up empty. In those time, I have to work at the problem until I solve it. It would be nice if there was a simple place for me to create a post explaining how to solve the problem without having to post to a forum or start my own blog. Specifically, it would be a lot like the existing stackoverflow.com, but without the requirement of an initial question. Instead, developers could post quick tips, lessons learned and tutorials that the community could vote on like they do on stackoverflow.com. I know posting a question then answering it myself is a possibility on stackoverflow.com. I was just thinking it might be nice to have a companion site related to stackoverflow.com where we as a community could post helpful tutorials for problems we recently had to solve. The site could act as a single blog where all readers could easily be authors, too. It could be a place where we could provide more comprehensive details for solving larger problems than we typically see on stackoverflow.com. Also, the posts would have to solve a specific problem and not be theory or opinion based. And we could up/down vote posts like stackoverflow.com. An example of the kind of post that comes to mind might be something like... Microsoft releases a new version of OData support via the Web Api. Searching the web only seems to show the greenfield development path, but many users need to know how to convert their existing web api project to support the new release. Given that I just went through the process of figuring this out, I'd like to share it with the community. It's not really the typical short-ish answer you'd see on stackoverflow, and it's not really the size of a typical blog post. It's something in between. The kind of thing many companies internally use a tool like Confluence to post these brief tutorials on.
There are times when I'd like to communicate something to the Stack Overflow community but it doesn't fit a question. Right now, I have the product of many answers (a bunch of code) I'd like to share back but can't. If each user had a blog or wiki (or something) they could create articles / blogs on and then link the related SO questions to it. You could then add an icon to those questions to show there is also more expansive information available. By linking to the questions, this means anyone could author articles addressing a question outside of the scope of the more simple Q/A scenario. Of course, many people have blogs but they must link that in a not so immersive fashion and not everyone has a blog (and also many blogs are inadequate in displaying text from a coding viewpoint (e.g. formatting code). Folding such a mechanism into SO would open up all sorts of creative opportunities and make the site even more sticky for users. I think it's a winner and I'd use it for sure.
I just came across this article about how pressing backspace 28 times on the grub screen. Since most mainstream media just says this happens, I've been unable to find anything that explains how it could possibly happen. Does anybody know why pressing backspace 28 times would break Grub2? Is it a memory thing?
There have been reports yesterday about a new security vulnerablity: Lucian Constantin (2015-12-16). . CSO Online. Patrick Allan (2015-12-16). . Life Hacker. Swati Khandelwal (2015-12-16). . The Hacker News. The news reports all say things like the vulnerability can "allow a hacker to install malware on a locked-down Linux system", can "bypass all security of a locked-down Linux machine", and can "bypass password protection on your computer". The actual vulnerability itself is CVE-2015-8370, and has been written up by one of its discoverers: Hector Marco and Ismael Ripoll (2015-12-14). . CVE-2015-8370. Whilst the news reports are hyperbolic, talking of vulnerabilities in Linux, the report by Marco and Ripoll is very technical for the non-programmer to absorb, descending into colourized source code or GRUB2 and 40-character-long strings of numbers and letters within the first page. I'm just an ordinary "security guy". I keep my applications and operating systems up to date with security patches. So, without the hyperbole from the news reports, and without baffling me with source code and hexddumps: Is there any immediate action that I should take? Is there any immediate action that I can take? What is the risk to my personal systems at home? What is the risk to my servers at work? If someone had IPKVM or ILO access, for example, could this be exploited?
I want to make a shell script that runs as a daemon process and every X minutes read the temperature of every cpu core to report it later with GNU plot. And here is my question, Is there any file in /sys or /proc or any other location which this info be uniformly placed across several UNIX systems (not only in Linux)? If not, tell me at least, where can I find these files in Linux.
I want to use to display my CPU-Core temperatures (haswell i7). However the setting: order += "cpu_temperature 1" #... cpu_temperature 1{ format = "T: %degree °C" } # doesn't display the correct core temperature. The numbers it shows seem to correspond to the value xsensors shows for temp1, if I change the 1 to 2 above it corresponds to xsensors temp2. Trying 3 or 4 doesn't have any effect. However I want to get the true core temperatures of all 4 cores with i3 status. How can I do this?
I was trying to install spotify for Ubuntu when this error appeared: E: Type 'debo' is not known on line 1 in source list /etc/apt/sources.list.d/spotify.list E: The list of sources could not be read. I don't know what to do to solve it.
Every once in a while I see users having issues to update due to errors like this: E:Type 'ain' is not known on line 1 in source list /etc/apt/sources.list.d/some-ppa.list' with varying types/line numbers/source list files (often after removing a PPA). How can such an error be fixed?
I'm new to ubuntu and i've partitioned disk as follows / 100G swap 30g -- i need to run virtuals /home 500g and that structure after searching the problem I face is where to put files for all users
I don't want the shared folder to be accessible by anyone on the system, I want it to be accessible just to a restricted set of users. How to I do that?
I am interested in $$\sum_{k=1}^{\infty} ke^{-k}$$ And I can get the closed form on Wolfram Alpha, $\frac{e}{(e-1)^2}$, but I am curious how to derive it. It doesn't appear to be a typical geometric series.
How can I evaluate $$\sum_{n=1}^\infty\frac{2n}{3^{n+1}}$$? I know the answer thanks to , but I'm more concerned with how I can derive that answer. It cites tests to prove that it is convergent, but my class has never learned these before. So I feel that there must be a simpler method. In general, how can I evaluate $$\sum_{n=0}^\infty (n+1)x^n?$$
I have found wine software in Ubuntu software Software, but the rating is low. Is it good or is there any source or command to install wine?
I am looking for a step by step instruction to guide me in the ways of installing, configuring and debugging many of the issues new users have when dealing with Wine in Ubuntu. What is the recommended way of installing Wine, some of the key issues that it has and how to solve them? If I have a specific problem with an App in Wine, how do I go about solving it? What are the recommended steps to ensure that I can fix a problem related to an app I wish to use?
Just tried to search for the diamond symbol (♦) and got . It seems that searching for any single symbol is not implemented. For instance: Even more, searching for the doesn't work too. However since diamond symbol (♦) for whole Stack Exchange has special meaning it would be desired to allow searching for that symbol.
We used to be able to , but that now appears to be broken. I'd expect a to return a result, but instead the search engine appears to put quotes around the whole request; the search box shows the search has been replaced with "[python] += list" and the I was looking for doesn't appear among the returned questions. Using quotes around the symbols do not seem to help here; returns an empty result.
Often in baking, instructions say to mix wet and dry separately, then add wet to dry. Chemically, shouldnt mixing it all into one single mushy lump produce the same mixture of ingredients as mixing dry and wet separately and then combining? Why bother separating the two (and dirtying more bowls along the way)?
Why would one need to mix the dry ingredients (flour, salt, soda) separately and before mixing into the liquid (butter, sugar) than just mixing everything into one bowl at the same time when making cakes? What would be the result if done ?
How am I supposed to put the first image under 1.6 and the second under 1.7?
How to influence the position of float environments like figure and table in LaTeX? This is a general question and should collect useful answers for all users. I hope we can use this as a reference
Recently, my Firefox home page became stuck on trustedweb.com (probably as a result of something my son had installed). No matter what I set the home page to, it always goes to that trustedweb.com site. Short of resetting everything, how do I get rid of that stubborn start page? This is not like the other question that others think that this duplicates. Something has hijacked my browser and is showing its own start page regardless of what I set the start page to (about:blank, superuser.com google.com or whatever). In addition, I get a banner ad at the top of the page of nearly every site that I go to.
What should I do if my Windows computer seems to be infected with a virus or malware? What are the symptoms of an infection? What should I do after noticing an infection? What can I do to get rid of it? how to prevent from infection by malware? This question comes up frequently, and the suggested solutions are usually the same. This community wiki is an attempt to serve as the definitive, most comprehensive answer possible. Feel free to add your contributions via edits.
I was watching a show where a character made the statement, It's been years since I've played that game. I thought that was odd, since I'd have said something like, It's been years since I played that game. Which is more correct?
Which tense should I use in the following example? Is it OK to use the Past Perfect Continuous if I want to explain to someone that I had been working in some company for 10 years, without mentioning - before I finally quit, or maybe I should use the Past Perfect - I had worked in that company for 10 years… but also without mentioning - before I moved to… ??? Thanks!
I'm using hyperlinks to jump the page as well as shift page on my webpage. I'm having difficulty getting my hyperlinks to work. I can't figure out why. I use the following code to shift page <a href="secondpage.html">secondpage</a> and the following code to jump page <a href="#!">jumppagedownwards</a> (further down the page) <a href="!"></a> How do I combine my jumppage and my shift page in one hyperlink? I tried the followingcode: <a href="secondpage.html#!">secondpagefurtherdown</a> For some reason it was working on some links and others it only shift page without jumping. Is there a better way to write the link?
When one wants to refer to some part of a webpage with the "http://example.com/#foo" method, should one use <h1><a name="foo"/>Foo Title</h1> or <h1 id="foo">Foo Title</h1> They both work, but are they equal, or do they have semantic differences?
on looking myself it seems to be a missing favicon-* class likely the same css issue as
When I look at e.g. , I see the following under "Top Questions": It appears that the MSO sprite is being stacked on top of the sprite for some beta site which I can't identify. I have cleared my cache and hard-refreshed, so this probably isn't a problem on my end. This appears to be related to the fact that favicon.css specifies a background-image for .favicon.
I recently just completed an exercise which states an atomic domain $A$ is a UFD $\iff$ it satisfies the ascending chain condition on principal ideals. This is all well and good, but because this is an if and only if statement, that seems to suggest there are atomic domains that DON'T satisfy the ACCP. Does anyone know of such an example? I would imagine you need something like the algebraic numbers but I am unsure.
Let $A$ be an integral domain. We know that if $A$ satisfies ACC on principal ideals then it is a Factorisation Domain. I want to know about the converse, i.e., Does there exist a FD not satisfying ACC on principal ideals? Edit. A Factorisation Domain is an integral domain whose every non-zero non-unit element is a finite product of irreducible elements. Thank You.
I don't mean why is it important. I mean why can't we just define the "selector function" like $S\colon \mathbb{F} \to A, $ such that $S(X) = x \in X$, without an axiom? Why can't we do that but we can, for example, take some set that satisfies a condition from an uncountable family?
I'm having trouble understanding the necessity of the Axiom of Choice. Given a set of non-empty subsets, what is the necessity of a function that picks out one element from each of those subsets? For instance, take a look at following paragraph from Wikipedia: A sketch of the proof of Zorn's lemma follows, assuming the axiom of choice. Suppose the lemma is false. Then there exists a partially ordered set, or poset, P such that every totally ordered subset has an upper bound, and every element has a bigger one. For every totally ordered subset T we may then define a bigger element b(T), because T has an upper bound, and that upper bound has a bigger element. To actually define the function b, we need to employ the axiom of choice. Using the function b, we are going to define elements a0 < a1 < a2 < a3 < ... in P. [...] To me it is clear that the ai's exist so why do we need singling them out? Sure enough, the binary relation representing b may not exist as a set, but what do we need it for? Finally... if we actually need the Axiom of Choice to single out the ai's in the above paragraph, since the axiom only postulates the existence of choice functions, how do we single out the choice function itself so that we can select the ai's with it? Certainly not with another choice function, since we would need to choose this function by a third choice function. So when and why do we really need the Axiom of Choice?
It's generally understood that anything that "spreads out" in 3D space dissipates at a rate proportional to the square of distance. Light, sound, gravitational force, etc. I know this is a pretty fixed rate due to geometry. A thought I can't get out of my head, though: What if it somehow made since for this rate to be cubic? What if doubling the distance didn't make an interaction one fourth as strong, but one eight, etc? Particularly gravity on a cosmic scale. Apologies if this question is too broad, but I couldn't think of a better place to ask it.
What would happen if the force of gravitation suddenly starts varying as $1$$/$$r^3$ instead of $1/r^2$ ? Would the symmetry of universe now seen be disrupted?
We can create a thread in Java either by implementing Runnable interface or by extending Thread class and implementing Runnable interface is preferred because multiple inheritance is not supported in case of classes,then why would one go for extending Thread class as it seems that implementing Runnable is more beneficial? Can anybody please tell me some practical application where thread class is extended for the creation of thread. Thanks in advance for the help.
From what time I've spent with threads in Java, I've found these two ways to write threads: With implements Runnable: public class MyRunnable implements Runnable { public void run() { //Code } } //Started with a "new Thread(new MyRunnable()).start()" call Or, with extends Thread: public class MyThread extends Thread { public MyThread() { super("MyThread"); } public void run() { //Code } } //Started with a "new MyThread().start()" call Is there any significant difference in these two blocks of code ?
So I have just now started working on a minecraft plugin for joining pvpevents and it is my first plugin so don't roast me too much on the code. I just want to know why it isn't running properly and these are the classes. Main public class Main extends JavaPlugin{ @Override public void onEnable(){ System.out.println("PvP event plugin je upaljen"); getCommand("event").setExecutor(new EventCommand()); getCommand("join").setExecutor(new EventJoinCommand()); } } EventCommand import org.bukkit.Bukkit; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import net.md_5.bungee.api.ChatColor; import net.md_5.bungee.api.chat.ClickEvent; import net.md_5.bungee.api.chat.ComponentBuilder; import net.md_5.bungee.api.chat.HoverEvent; import net.md_5.bungee.api.chat.TextComponent; public class EventCommand implements CommandExecutor{ @Override public boolean onCommand(CommandSender sender, Command arg1, String arg2, String[] arg3) { Player player = (Player) sender; if (arg3[0].equalsIgnoreCase("host") || arg3[1].equalsIgnoreCase("gapple")) { String kit = arg3[0]; String velikoSlovo = kit.substring(0, 1).toUpperCase() + kit.substring(1); TextComponent message = new TextComponent(player.getName() + " je zapoceo " + velikoSlovo + " turnir. "); message.setColor(ChatColor.LIGHT_PURPLE); TextComponent ulazak = new TextComponent("Klikni da udes"); ulazak.setColor(ChatColor.YELLOW); ComponentBuilder cb = new ComponentBuilder("Klikni na tekst da udes").color(ChatColor.AQUA); ulazak.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, cb.create())); ulazak.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND,"/join")); message.addExtra(ulazak); for (int i = 0; i < 5; i++) { Bukkit.getServer().spigot().broadcast(message); try { Thread.sleep(7000); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } else {player.sendMessage("Moras upisati tocnu komandu: /event [kit]");} return false; } } EventJoinCommand import java.util.ArrayList; import org.bukkit.ChatColor; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; public class EventJoinCommand implements CommandExecutor{ static int i = 0; static ArrayList<String> listaIgracaTurnira = new ArrayList<String>(); @Override public boolean onCommand(CommandSender sender, Command arg1, String arg2, String[] arg3) { Player igrac = (Player) sender; if (EventUlazakJosTraje(sender)) { igrac.sendMessage(ChatColor.DARK_RED + "Uspijesno si usao u event"); } else { igrac.sendMessage(ChatColor.DARK_RED + "Nema eventa u kojeg mozes uc ili je vec startao"); } return false; } public static boolean EventUlazakJosTraje(CommandSender sender){ Player player = (Player) sender; listaIgracaTurnira.add(player.getName()); i++; return true; } } And this is the error my server puts out:
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?
OS=ubuntu 12.04 64bit 3.2.0-29-generic what i did? apt-get purge libre* which i thought will remove LO 3.5 but, which was a big mistake after couple of moments, i realise that its is removing all other software so i did cltl-c which stopped the apt process i restarted my system after that i found that following software were missing apt-get,evince(pdf), cheese etc..here is full list i managed to install APT deb file through dpkg but now i am not able to do any installation so i just removed /var/lib/dpkg/status and created new but that didnt help apt-get -f install Reading package lists... Done Building dependency tree Reading state information... Done Correcting dependencies... Done The following extra packages will be installed: apt-utils coreutils debconf debconf-i18n dpkg libacl1 libapt-inst1.4 libapt-pkg4.12 libattr1 libbz2-1.0 libdb5.1 libgcc1 liblocale-gettext-perl liblzma5 libselinux1 libstdc++6 libtext-charwidth-perl libtext-iconv-perl libtext-wrapi18n-perl perl-base tar tzdata xz-utils zlib1g Suggested packages: debconf-doc debconf-utils whiptail dialog gnome-utils libterm-readline-gnu-perl libgtk2-perl libnet-ldap-perl libqtgui4-perl libqtcore4-perl apt bzip2 ncompress xz-lzma The following NEW packages will be installed: apt-utils coreutils debconf debconf-i18n dpkg libacl1 libapt-inst1.4 libapt-pkg4.12 libattr1 libbz2-1.0 libdb5.1 libgcc1 liblocale-gettext-perl liblzma5 libselinux1 libstdc++6 libtext-charwidth-perl libtext-iconv-perl libtext-wrapi18n-perl perl-base tar tzdata xz-utils zlib1g 0 upgraded, 24 newly installed, 0 to remove and 0 not upgraded. 2 not fully installed or removed. Need to get 0 B/9,246 kB of archives. After this operation, 29.9 MB of additional disk space will be used. Do you want to continue [Y/n]? y E: Cannot get debconf version. Is debconf installed? debconf: apt-extracttemplates failed: No such file or directory dpkg: regarding .../libgcc1_1%3a4.6.3-1ubuntu5_amd64.deb containing libgcc1, pre-dependency problem: libgcc1 pre-depends on multiarch-support multiarch-support is unpacked, but has never been configured. dpkg: error processing /var/cache/apt/archives/libgcc1_1%3a4.6.3-1ubuntu5_amd64.deb (--unpack): pre-dependency problem - not installing libgcc1 No apport report written because MaxReports is reached already Errors were encountered while processing: /var/cache/apt/archives/libgcc1_1%3a4.6.3-1ubuntu5_amd64.deb E: Internal Error, No file name for libc6 W: Could not perform immediate configuration on 'multiarch-support:amd64'. Please see man 5 apt.conf under APT::Immediate-Configure for details. (2) E: Sub-process /usr/bin/dpkg returned an error code (1) # apt-get -u dist-upgrade Reading package lists... Done Building dependency tree Reading state information... Done You might want to run 'apt-get -f install' to correct these. The following packages have unmet dependencies: libc6 : Depends: libgcc1 but it is not installed Depends: tzdata but it is not installed E: Unmet dependencies. Try using -f. i have tried below link but no help... thanks
I accidentally removed all the packages starting with the name jpeg with: sudo apt-get remove jpeg* This screwed up a lot of things, removed Unity, Firefox, Flash player etc. I somehow managed to recover the desktop and unity but then a lot of things are still buggy. For example .rpm files and .tag.gz just won't open up at all. What I want is a way to fix everything that's amiss. Something that is the equivalent of a 'repair installation' with a windows disc. Any tips, anyone?
I'm running a predictive model and I have one possible predictive variable that is a factor and has more than 800 levels. I tried to reduce it running ctree in R (with the variable as the only predictive variable and the original class as class) and using the prediction to bin the variable and reduce the levels. But ctree takes too long (and never ends). What other method would you recommend?
What techniques are available for collapsing (or pooling) many categories to a few, for the purpose of using them as an input (predictor) in a statistical model? Consider a variable like (discipline chosen by an undergraduate student). It is unordered and categorical, but it can potentially have dozens of distinct levels. Let's say I want to use major as a predictor in a regression model. Using these levels as-is for modeling leads to all sorts of issues because there are just so many. A lot of statistical precision would be thrown away to use them, and the results are hard to interpret. We're rarely interested in specific majors -- we're much more likely to be interested in broad categories (subgroups) of majors. But it isn't always clear how to divide up the levels into such higher-level categories, or even how many higher-level categories to use. For typical data I would be happy to use factor analysis, matrix factorization, or a discrete latent modeling technique. But majors are mutually exclusive categories, so I'm hesitant to exploit their covariance for anything. Furthermore I don't care about the major categories on their own. I care about producing higher-level categories that are coherent with respect to my regression outcome. In the binary outcome case, that suggests to me something like linear discriminant analysis (LDA) to generate higher-level categories that maximize discriminative performance. But LDA is a limited technique and that feels like dirty data dredging to me. Moreover any continuous solution will be hard to interpret. Meanwhile something based on covariances, like multiple correspondence analysis (MCA), seems suspect to me in this case because of the inherent dependence among mutually exclusive dummy variables -- they're better suited for studying multiple categorical variables, rather than multiple categories of the same variable. edit: to be clear, this is about collapsing categories (not selecting them), and the categories are predictors or independent variables. In hindsight, this problem seems like an appropriate time to "regularize 'em all and let God sort 'em out". Glad to see this question is interesting to so many people!
How can you check if a command can be executable or not in Linux. Example: xeyes
When looking for the path to an executable or checking what would happen if you enter a command name in a Unix shell, there's a plethora of different utilities (which, type, command, whence, where, whereis, whatis, hash, etc). We often hear that which should be avoided. Why? What should we use instead?
I'm very new to Latex, I'm using MiKTeX with Texmaker on Windows. When I execute the following code I get the desired result: \begin{figure}[htb] \label{fig:MagEngT} \centering \includegraphics[scale=0.55]{MagEngTemp.png} \caption{Words and such} \end{figure} \paragraph{} Yet more words However, if I instead choose to position the figure with [htbp] it has some kind of emotional breakdown and sits in the middle of the page by itself, pushing the paragraph below onto the next page. My understanding was that by using [htbp] I was indicating a preference in position, so I don't see why adding the p explicitly, since, as far as I know, it defaults to that when it's out of options anyway, changes the behaviour? More to the point, why does it change the behaviour to sitting in the middle of a blank page with occupied pages above and below? I thought it was supposed to float to an empty page at the end of the document? Any help understanding this is appreciated. :) Also, I just noticed I've made some spelling errors, aha.
How to influence the position of float environments like figure and table in LaTeX? This is a general question and should collect useful answers for all users. I hope we can use this as a reference
Show that $\log({n\choose n/2})=O(n)$, I've tried to use stirling's formula but didn't get any close
Evaluate $$\lim_{n\rightarrow \infty}\frac{1}{2n}\cdot \ln \binom{2n}{n}.$$ $\underline{\bf{My\;\;Try}}::$ Let $\displaystyle y = \lim_{n\rightarrow \infty}\frac{1}{2n}\cdot \ln \binom{2n}{n} = \lim_{n\rightarrow \infty}\frac{1}{2n}\cdot \ln \left(\frac{(n+1)\cdot (n+2)\cdot (n+3)\cdots (n+n)}{(1)\cdot (2)\cdot (3)\cdots (n)}\right)$ $\displaystyle y = \lim_{n\rightarrow \infty}\frac{1}{2n}\cdot \left\{\ln \left(\frac{n+1}{1}\right)+\ln \left(\frac{n+2}{2}\right)+\ln \left(\frac{n+3}{3}\right)+\cdots+\ln \left(\frac{n+n}{n}\right)\right\}$ $\displaystyle y = \lim_{n\rightarrow \infty}\frac{1}{2n}\cdot \sum_{r=1}^{n}\ln \left(\frac{n+r}{r}\right) = \lim_{n\rightarrow \infty}\frac{1}{2n}\cdot \sum_{r=1}^{n}\ln \left(\frac{1+\frac{r}{n}}{\frac{r}{n}}\right)$ Now Using Reinman Sum $\displaystyle y = \frac{1}{2}\int_{0}^{1}\ln \left(\frac{x+1}{x}\right)dx = \frac{1}{2}\int_{0}^{1}\ln (x+1)dx-\frac{1}{2}\int_{0}^{1}\ln (x)dx = \ln (2)$ My Question is , Is there is any method other then that like Striling Approximation OR Stolz–Cesàro theorem OR Ratio Test If yes then please explain here Thanks
I want to create a Python library called blah with a directory structure like: blah/ ├── blah/ ├── __init__.py └── file.py Currently, to run the code in file.py we have to run python3 -m blah.file .... Is there any way to structure the library so that we can simply write python3 -m blah ...? The library contains some utility scripts that will be called many times a day and the shorter command will save millions of keystrokes.
What is __init__.py for in a Python source directory?
Is there a way to use sed or awk to filter data inside a zipped file? When I run a sed or awk command and send to stdout the file created is 0 bytes.
I have 100s of directories and within those I have a few zip files. Now there are images named abc.jpg in those zip files. The zip files may be in any folder or in any subfolder so its difficult to extract them all in one place. I just want to collect those image files. Is this possible?
Suppose there is guy in an elevator, who has a mass of 100kg. The elevator is ascending with an acceleration of $10m/s^2$. What would be the apparent weight of the guy? Now, my resources tell me that it can be found out by addding the acceleration due to gravity ie. 9.8 and acceleration of the elevator, giving us the apparent weight as $$W=100(9.8+10)=1980N$$ Why do they get added? Isn’t the acceleration of the elevator upwards, while gravity is acting downward? By that logic, they should get subtracted. I know, intuitively that an object moving with upward acceleration experiences more force, and one moving downward experiences lesser force. But what is the real reason behind this?
A question asks you to determine the relationship between true weight and apparent weight when an elevator that has descended from the 50th floor is coming to a halt at the first floor. I believe that as the elevator is coming to a halt, the acceleration is decreasing (close to zero), and so this downward acceleration is negative. Therefore, w = mg - ma. Then w should be less than mg. However, the book tells me that w should be more than mg. I do not understand, in any way, how this is possible. Can someone please explain how true weight is less than apparent weight when the person in an elevator is experiencing overall downward acceleration?
I'm using \tableofcontents. I'd like to hide some, but not all, subsections from the contents, but I don't want to lose the subsection numbering within the document itself. (So I can't use \subsection*{}.) Is there an easy way to do this? If not, could someone provide a clever solution? In my case, if I want to suppress a single subsection within a section, then I want to suppress all the subsections in that section. I don't need the flexibility to both suppress and incorporate subsections within a single section. Here's a MWE: \documentclass[11pt]{article} \usepackage{amsmath} \usepackage{amssymb} \usepackage{graphicx} \usepackage{fancybox} \usepackage{fancyhdr} \usepackage[margin=1in]{geometry} \usepackage{hyperref} \usepackage{cleveref} \begin{document} \tableofcontents \section{Section} \subsection{To be included in TOC} \subsection{Also to be included in TOC} \section{Another Section} \subsection{Not to be included in TOC} \section{Another Section Redux} \subsection{Not to be included in TOC} \end{document}
I have the simple following document: \documentclass[10pt,a4paper]{report} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{graphicx} \setcounter{secnumdepth}{4} \setcounter{tocdepth}{4} \usepackage{algorithm,algcompatible} \begin{document} \tableofcontents \listoffigures \listoftables \listofalgorithms \chapter{Chapter First} This is my chapter first. \chapter{Chapter Two} This is my chapter two. \section{sec 1} \begin{table} \centering \caption{my table} \label{tab1} \begin{tabular}{|c|c|} \hline 1 & 2 \\ \hline 3 & 4 \\ \hline \end{tabular} \end{table} \subsection{subsec 1} \begin{algorithm} \caption{(\textit{The EGl-FOM})} \label{myalg} \begin{algorithmic}[1] \STATE Choose \STATE Use the \STATE Compute $\alpha_m$ \STATE Compute $\lVert R_m\rVert_F=h_{m, m+1}|e_m^T\alpha_m|$. \end{algorithmic} \end{algorithm} \subsubsection{subsubsec 1} \end{document} I am going to hide chapter, section, subsection and subsubsection titles about chapter two from table of contents. Furthermore, I want to hide tables, figures and algorithms titles about chapter two from list of tables, figures and algorithms. Is there a proper way to do these things?
Here is my df -g output: df -g /var Filesystem GB blocks Free %Used Iused %Iused Mounted on /dev/hd9var 3.50 0.10 98% 6376 18% /var But if a enter in the mount point and issue du command, I get the following output ux-zzz02:/var>du -sm . 374.38 . ux-zzz02:/var> How can this happen? I have only 374mb being used but df command says it's used 98% of 3.50gb
I have a Linux CentOS server, the OS+packages used around 5GB. Then, I transferred 97GB data from a Windows server to two folders on this Linux server, after calculated the disk usage, I see the total size of the two folders is larger than the disk used size. Run du -sh on each folder, one use 50GB, the other one use 47GB But run df -h, the used space is 96GB. (50GB + 47GB + 5GB) > 96GB Is there any problem? Those two folders contain lots of files (1 million+). Thanks.
An XP and a Win10 PC reside on a LAN. The goal: the Win10 PC executes a program on the XP box: XP_BOX>> myProgram.exe arg1 arg2 argN Is there a built-in Win10 command that enables: Win10>> remoteExecute XP_BOX:userID:password "myProgram.exe arg1 arg2 argN" Once this works, the Win10 box has an application that can bang-out to the Win10 OS and perform remote program execution. If there is a better way of accomplishing the above: suggestions are appreciated. Thank you
How can I run a program on a remote Windows PC in our network without the need of killing an existing remote-desktop-connection? I only need a command line for running the program and getting its results. Thank you!
How to enter credentials using Selenium (Java)? I am not able to enter credentials in the Pop-up window, which is shown above. Please help me in this. Thanks in Advance
I am automating an application which contains browser level authentication. When I open the application, the browser performs basic authentication, i.e. it prompts for a username and password. How can I handle this scenario using Selenium?
Me and my sister are using the same account and we really want to play together in a "LAN world". I have changed the display name, but I am still using her account and I have searched this set up on YouTube and Internet. People says that's it worked to them. But when I join her LAN world it says "connection lost. you logged from another location". Please guys, I really need help!
I just bought Minecraft. Now, my brother wants to play with me but my Mom doesn't want to buy another. We use the same Wifi network. Can we do this?
I am developing an online quiz system in JSP.There are 4 radio buttons for each question. When none of the buttons are checked and submitted,it shows NullPointerException. How to overcome it?
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?
So, I am trying to center this div like shown in the picture "example" below but I am not able to figure out how to do it? my HTML code <section class="project-info"> <div class="short-info"> <div class="info-col"> <h5>role</h5> <p>web design</p> </div> <div class="info-col orange"> <h5>client</h5> <p>Careerfit</p> </div> <div class="info-col blue"> <h5>sector</h5> <p>Recruitment</p> </div> </div> <div class="description"> <p>Branding oneself can be a delicate process. Bobolink, a Beirut based creative agency with an appetite for work, came to us forhelp with overcoming the challenge of uplifting their identity. The result of our collaboration was an organic identity with youthful elegance.</p> </div> With this code its ending up like this
How can I horizontally center a <div> within another <div> using CSS? <div id="outer"> <div id="inner">Foo foo</div> </div>
I am trying to make a music video and import my logo (.png), however the logo does not have accurate colors (it has clear white background, but blender shows it as gray): These are my material settings, I hope I have started correctly: The circle I created behind it is also a bit grayish, so there must be something basic I'm missing. Switching the mode does not solve the color problem, as mentioned in the comments the background of my logo is still gray afterwards. Solved: I needed to add/move the light on top (to face the planes) and re-insert the image in order to reset to default settings. Result:
I already searched the internet but could not find a solution to this. Maybe it is the same question as but there was no answer. I want to render a video with tracking, but the output "loses" color information and gets kind of greyish. I first thought that it is related to the renderer, but it happens in Cycles and Eevee. Therefore i made a sample image, added it to the image sequence editor and rendered it as 1 frame. Resulting in the same problem. I placed the original image beside blenders output so that you can see the difference. The only idea I came up with is that something with the lighting is not correct but I can't find a setting for that. I am using Blender 2.80 with the default settings. Only set the output resolution to match the input resolution.
How can i run a jar file inside another java program? I found this: Runtime.exec("java -jar " + filepath) but i keep getting an error that says its a non-static method that it is being run from a static context when it is not even in a static method. I've searched a lot and couldn't find an answer.
The very common beginner mistake is when you try to use a class property "statically" without making an instance of that class. It leaves you with the mentioned error message: You can either make the non static method static or make an instance of that class to use its properties. Why? I am not asking for solutions. I would be grateful to know what is the reason behind it. The very core reason! private java.util.List<String> someMethod(){ /* Some Code */ return someList; } public static void main(String[] strArgs){ // The following statement causes the error. You know why.. java.util.List<String> someList = someMethod(); }
Let $a_{n+1} = \sin{a_n}$ and $a_0 = 1$. Does the series $\displaystyle \sum_{i=0}^\infty a_i$ converge? Here is my solution. Let's prove by induction, that $a_n > \frac{1}{n}$. We see that $\sin{(1)} > \frac{1}{2}$. Suppose, that $a_n > \frac{1}{n}$. Then: $$\underbrace{\sin{\sin{(...\sin{(1)}...)}} )}_\text{$n+1$ sines}\ ?\ \frac{1}{n+1}$$ $$\underbrace{\sin{\sin{(...\sin{(1)}...)}} )}_\text{$n$ sines}\ ?\ \mbox{arcsin}(\frac{1}{n+1})$$ If $\mbox{arcsin}(\frac{1}{n+1}) < \frac{1}{n}$ (becuase left part is bigger then it by induction hypothesis) then we are done. And it really is, because $\sin{\frac{1}{n}} > \frac{1}{n+1} \Leftrightarrow \frac{1}{n} - \frac{1}{n^33!} > \frac{1}{n+1}$ (here I used Teylor expansion for sine). As $a_n > \frac{1}{n}$ our series is divergent by comparison test. Is my reasoning correct?
I'm trying to solve the following task Sequence $\{a_n\}$ is given by the rule: $a_1 = 1,\: a_{n+1} = \sin (a_n)$. Does the series $\sum a_n$ converge? Can you give me any hints how to solve it, cause i got totally stuck at the very beginning, please?
If you are hurrying to flag this question as a duplicate of or questions, please stop, the answers on those questions do not provide an answer to the question here. After I asked I found that title and file name are pretty much different, so then I tried changing the pdf document's title to whatever I want to?. I tried with Okular, but it doesn't let me change the title, I also tried GIMP but it just don't seem to have the option. I even tried verifying the document properties with Dolphin and it does not work either. How to change the title then?.
I need a command line tool for editing metadata of pdf-files. I'm using a Aiptek MyNote Premium tablet for writing my notes and minutes on this device, import them later and convert them to pdf automatically with a simple script using inkscape and ghostscript. Is there any command line tool to add some categories to the pdf's metadata, so i can find the pdf later (e.g. with gnome-do) by categories? Update: I tried the solution with pdftk and it works, but it seems that gnome-do doesn't take care of pdf-metadata. Is there a way to get gnome-do to do that?
The (Xanathar's Guide to Everything, p. 19-20) gets the Circle of Mortality feature at 1st level, part of which states: In addition, you learn the cantrip, which doesn’t count against the number of cleric cantrips you know. For you, it has a range of 30 feet, and you can cast it as a bonus action. This wording seems to imply the option, rather than necessity, to cast it as a bonus action. Am I correct in assuming this? Can I still cast it as an action and have my bonus action available?
I get that some spells are "especially swift" to cast and thus have a casting time of "Bonus Action". But is there any reason I couldn't cast such a spell as my Action? Does it make a difference if the idea is for the one spell to be cast all by itself on a turn or if the desire is to use another Bonus Action (possibly a spell) on the same turn?
I am trying to compile a document with Russian language and using the fonts from cm-unicode. Code: \documentclass[a4paper,12pt]{report} \usepackage{polyglossia} \setdefaultlanguage[spelling=modern]{russian} \setotherlanguage{english} \usepackage{fontspec} \usepackage{xunicode} \usepackage{xltxtra} \usepackage{xecyr} \defaultfontfeatures{Mapping=tex-text} \setmainfont{CMU Serif} \setsansfont{CMU Sans Serif} \setmonofont{CMU Typewriter Text} Build command: latexmk -xelatex -outdir=build document.tex And error message: ! Package polyglossia Error: The current latin font CMUTypewriterText(0) does n ot contain the "Cyrillic" script! And I get an error with any font. What am I doing wrong?
Ok, so the problem is next, I use Liberation fonts in my XeLaTeX document: \setmainfont{Liberation Serif} \setsansfont{Liberation Sans} \setmonofont{Liberation Mono} \setmainlanguage{ukrainian} \setotherlanguage{english} And Liberation Serif as well as Liberation Sans work as they should. But when an error Package polyglossia Error: The current roman font does not contain the Cyrillic script! Please define \cyrillicfont with \newfontfamily. occurs at the very end of the document where the monospace font appears for the first time as URL. Also my friend has no problems like this on Mac. Is this a problem with Tex-live distribution for Linux, or a problem with Liberation Mono ?
I have Windows Desktop which I am using from a very long time. I have been a regular Windows user since I have stepped in the computer world. I have a plan to install Ubuntu on my desktop and want to remove the the Windows installation entirely. What I mean by this is I want to replace the whole windows 7 OS with the latest version of Ubuntu. I have never used Linux before in my life at all but have started developing an interest in it. My exact question is if in case I happen to install Ubuntu on my C: drive will I be able to access all my data on all the other drives as the data available on all other drives is extremely important for me and I cannot afford to loose it on any circumstances. If not, then what are the steps to accomplish the same and an information if it is critical. On the other hand I cannot backup the entire data as it happens to be about 1 TB. Any help in this case is welcomed and appreciated.
I am a newbie in linux. I wanted to install ubuntu to my desktop. I currently have two partitions, Windows 8 in installed on one, and i have some important files in another partition. While installing ubuntu, if I chose "Replace Windows 8 with Ubuntu", do I lose the other partition too? And are there other ways to leave the other partition as it is, and install ubuntu in the partition where windows was installed.
I know there are a lot of threads on travel photography, I read some, but found that most are out of date, however, manufacturers kept innovating, and that starts to confuse a lot of newbies like me. I'm going on a trip to Japan soon, and would like your advice, on which equipment to take with me, ideally I'd like to take at most two lenses with me. Let's start with what I already have, as I don't wan't to buy a new lens that overlaps what I already own: Nikon D5100 The lens kit it came with: Nikkor 18-55mm 1:3.5-5.6 Sigma Telephoto/Macro: 70-300mm 1:4-5.6 (No stabilization :S) I was thinking about buying an all-in-one lens, or a [ultra] wide angle lens as I found myself having trouble shooting the Cattedrale di Santa Maria del Fiore on a past trip. I did some research, but the Focus aspect of cameras still puzzles me (for me it's just a matter of how many planes one can shoot) so I would need some advice choosing between the lenses below, or possibly other lens brands/types that you would recommend for traveling (I can go up to $500, but would like something on the $350 range) It doesn't have to be Sigma, but the prices are good AFAIK, and the quality of the one I already have make me feel safe buying this brand.
I have a Canon 7D and often take my camera on the road while traveling. In the past I've taken my Sigma 17-70 f/2.8-4 and my Canon 70-300 f/4-5.6, which means that I must switch out lenses quite a bit, depending on what I'm shooting. I get a much better overall image with the 70-300, but the 17-70 gets the big picture. Should I invest in a third lens for better travel portraits, close-up lenses to save space, or just a better lens overall (such as the Canon 24-105 f/4L)? I do love having low f stops for great focus and blur, but I also like having options, macro equipment, and reach. Perhaps there's no easy solution, but what would you do to travel relatively lightly in such a situation? Thanks!
Consider this $$y=x^{x^{x^{x^{x^{......\infty}}}}}$$The above expression can be rewritten as $y=x^y$At first glance the above expression may look as though it will explode to infinity but it won't.Actually for small values of x that infinite series converges.My question is that for what range of x this series converges.I tried taking its drivative and and tried finding the point of discontinuty but i was not successfull Can someone help me outTake look at the above expression's graph
I got this problem from my teacher as a optional challenge. I am open about this being a given problem, however it is not homework. The problem is stated as follows. Assume we have an infinite tetration as follows $$x^{x^{x^{.^{.^.}}}} \, = \, a$$ With a given $a$ find $x$. The next part of the problem was to discuss the convergence radius of a. If a is too big or too small the tetration does not converge. Below is my humble stab at the problem. My friend said you would have to treat the tetration as a infinite series, and therefore could not perform algebraic manipulations on it before it is know whether it converges or diverges. However my attempt is to first do some algebraic steps, then discuss the convergence radius. I) Initial discussion At the start it is obvious that the tetration converges when $a=1$ (just set $x=1$) Now after some computer hardwork it seems that the tetration fails to converge when a is roughly larger than 3. II) Algebraic manipulation $$ x^{x^{x^{.^{.^.}}}} \, = \, a$$ This is the same as $$ x^a \, = \, a$$ $$ \log_a(x^a) \, = \, \log_a(a)$$ $$ \log_a(x) \, = \, \frac{1}{a}$$ $$ x \, = \, a^{\frac{1}{a}}$$ Now, if we let $a=2$ then $x = \sqrt{2}$. After some more computational work, this seems to be correct, which makes me believe this formula is correct. III) Discsussion about convergence By looking at the derivative of $ \displaystyle \large a^{\frac{1}{a}} $ we see that the maxima occurs when $a=e$, which also seems to correspond to the inital computational work. Now I think, that the minima of $\displaystyle \large a^{1/a}$ is zero by looking at its graph, studying its derivative and the endpoints. So that my "guess" or work shows that it converges when $$ a \in [0 \, , \, 1/e] $$ VI) My questions Can my algebraic manipulations be justified? They seem rather sketchy taking the a`th logarithm and so on . (Although they seem to "magically" give out the right answer) By looking at Wikipedia it seems that the tetration converge when $$ a \in \left[ 1/e \, , \, e \right] $$ This is almost what I have, why is my lower bound wrong? How can I find the correct lower bound?
I have just installed Ubuntu on a VmWare virtual machine. IT wants me to login to finish installation, but I do not remember ever creating an account, so I have no idea how to login! I have tried user ubuntu with no password (and various passwords for root).
I'm working on a Ubuntu system, and my client has completely forgotten his administrative password. He doesn't even remember entering one; however it is there. I've tried the suggestions on the website, and I have been unsuccessful in deleting the password so that I can download applets required for running some files. Is there a solution?
I´ve found the solution Apparently hostgator phpmyadmin doesn't have the UTF-8 header on it. Recently I moved my web forum from a development local machine to a production server (Hostgator, shared), but something weird is going on, everytime we pump data out of the database and display it we get replacement characters in lieu of special Portuguese charcters (á, é, ê, ó, ç and so on), even though the database is set to use UTF-8 (on the database, tables, rows and connection). When we pass the same exact string to a mb_detect_encoding it says that it is a valid UTF-8 string. The only thing that makes the data from the database display properly is to remove the <meta charset="utf8"> from the HTML, but then all the other special characters (from text that isn't from the database) gets garbled. What the HTML is going on? PHP 5.2 MySQL 5.5.30-30.2 About the posible duplicate question, I (personally, of course) don't think that it's a fit, because that other question assumes prior knowledge and work with text encoding.
I'm setting up a new server and want to support UTF-8 fully in my web application. I have tried this in the past on existing servers and always seem to end up having to fall back to ISO-8859-1. Where exactly do I need to set the encoding/charsets? I'm aware that I need to configure Apache, MySQL, and PHP to do this — is there some standard checklist I can follow, or perhaps troubleshoot where the mismatches occur? This is for a new Linux server, running MySQL 5, PHP, 5 and Apache 2.
Confirm that $\int_{0}^{\infty}t^{-1}\sin t dt=\pi/2$. The guide book I am using gives the following help: Consider $\int_{\gamma}z^{-1}e^{iz}dz$, where for $0<s<r<\infty$ the contour of integration is described by $\gamma=[s,r]+\gamma_r+[-r,-s]-\gamma_s$, with $\gamma_r(t)=re^{it}$ and $\gamma_s(t)=se^{it}$ on $[0,\pi]$. Recall Exercise IV$.4.20.$ Exercise IV$.4.20.$ For $r$ with $0<r<\infty$ let $I(r)=\int_{\gamma_r}z^{-1}e^{iz}dz$ with $\gamma_r(t)=re^{it}$ on $[0,\pi]$. Show that $I(r)\rightarrow 0$ as $r\rightarrow \infty$ and also that $I(r)\rightarrow \pi i$ as $r\rightarrow 0$ Using the hint, I know that $\int_{\gamma}z^{-1}e^{iz}dz=0$ for the Cauchy theorem, with which $\int_{[s,r]}z^{-1}e^{iz}dz+\int_{\gamma_r}z^{-1}e^{iz}dz+\int_{[-r,-s]}z^{-1}e^{iz}dz-\int_{\gamma_s}z^{-1}e^{iz}dz=0$, but I do not know what else to do here, could someone help me please? Thank you very much.
A famous exercise which one encounters while doing Complex Analysis (Residue theory) is to prove that the given integral: $$\int\limits_0^\infty \frac{\sin x} x \,\mathrm dx = \frac \pi 2$$ Well, can anyone prove this without using Residue theory? I actually thought of using the series representation of $\sin x$: $$\int\limits_0^\infty \frac{\sin x} x \, dx = \lim\limits_{n \to \infty} \int\limits_0^n \frac{1}{t} \left( t - \frac{t^3}{3!} + \frac{t^5}{5!} + \cdots \right) \,\mathrm dt$$ but I don't see how $\pi$ comes here, since we need the answer to be equal to $\dfrac{\pi}{2}$.
This white/yellowish bugs are crawling over my walls under cracks and below my wardrobe. I am not sure if they are bed bugs or some other bugs, there are very small in size thus I zoomed very much on the photograph, I hope someone would be able to assist me on identifying the bug.!
I have a large wooden cutting board which is used in my kitchen mainly for preparing egg pasta. The wood type is Populus (poplar or aspen or cottonwood). The main ingredients used with the cutting board are: flour (mainly soft wheat flour), hens' eggs, white sugar, butter, and baking powder. After the food preparation, the cutting board is cleaned by scraping away the ingredients remains. The board has some cracks and some small unknown insects are living inside the cracks. The board has also a lot of holes due to woodboring beetles but I think the woodworms operated long time ago and they no longer live in the cutting board. The unknown insect has an approximate length of 1 mm (along the direction of their movements) and a width of 0.3 mm. The unknown insects do not have wings, they just walk. I am not able to see how many pairs of legs they have. The color of the insect is pale brown. The cutting board was free from these unknown insects some months ago but then they appeared. My questions: What insects are they? Are these insects poisonous to humans? How can I get rid of them? Update The unknown insects could be Acarus siro, I will try to get a picture of the insects. Update 2 Here is a picture. The bottom part of the image is a one Euro coin, the top part of the image is a caliper (each bright area is one mm tick). Some more pictures:
I don't know what should to write with I would think you were bluffing if it, should it be wasn't or weren't for?
If I was... If I were... When is it correct to use "If I was" vs. "If I were" in standard English?
I have this script: echo $HOME cd $HOME cd / cd /usr/local/src/ When I run it like this . script.sh I get this output: /home/user : No such file or directory : No such file or directory : No such file or directory If I run it normally (I added #!/bin/bash before the first line) sh script.sh I get this output: : not found.sh: 2: script.sh /home/user script.sh: 3: Can't cd to /home/user script.sh: 4: Can't cd to / script.sh: 5: Can't cd to /usr/local/src/ The script was run from $HOME directory each time. If I run each command one by one from shell, it executed without problems (invoking cd $HOME from within $HOME simply didn't change directory). What must I do to make this work?
I'm trying to run a python script, on a headless Raspberry PI using winSCP and get the following error message: Command '"./areadetect_movie_21.py"' failed with return code 127 and error message /usr/bin/env: python : No such file or directory. When I try and run from terminal, I get: : No such file or directory. I try a similar python script, in the same directory, with the same python shebang, the same permissions and using the same user pi, and it works. I also do a ls and I can see the file, so I don't know why it will not run.
I'm actually have the Problem that I don't know how to get a random nickname from my Table called "nicks" where the column called "nicknames". Here is an example what I've. private String getNames() { String names= ""; try { ResultSet rs = Core.getSQL().getResultSet("SELECT * FROM nicks"); names = rs.getString("nicknames"); } catch (Exception e) { e.printStackTrace(); } return names; } } Can someone pls tell me why I only get the String "" and how I can get just one random entry out of my database? Hope that someone can help me.
How can I request a random row (or as close to truly random as is possible) in pure SQL?
says, "Shell functions are faster [than aliases]. Aliases are looked up after functions and thus resolving is slower. While aliases are easier to understand, shell functions are preferred over aliases for almost every purpose." Given that (true or not), how do shell functions compare to standalone shell scripts? Does one have particular advantages over the other, or better suited for certain types of tasks?
It's taken me almost 10 years of Linux usage to ask this question. It was all trial and error and random late-night internet surfing. But people shouldn't need 10 years for this. If I were just starting out with Linux, I'd want to know: When to alias, when to script, and when to write a function? Where aliases are concerned, I use aliases for very simple operations that don't take arguments. alias houston='cd /home/username/.scripts/' That seems obvious. But some people do this: alias command="bash bashscriptname" (and add it to the .bashrc file) Is there a good reason to do that? I'm trying really hard, but I genuinely can't think of any circumstances in which I'd want to do that. So, if there is an edge case where that would make a difference, please answer below. Because that's where I would just put something in my PATH and chmod +x it, which is another thing that came after years of Linux trial-and-error. Which brings me to the next topic. For instance, I added a hidden folder (.scripts/) in the home directory to my PATH by just adding a line to my .bashrc (PATH=$PATH:/home/username/.scripts/), so anything executable in there automagically autocompletes. If I needed to. I don't really need that, though, do I? I would only use that for languages that are not the shell, like Python. If it's the shell, I can just write a function inside the very same .bashrc: funcname () { somecommand -someARGS "$@" } As I stated, I found a lot of this out through trial and error. And I only truly saw the beauty of functions when my computer died and I was forced to use the computers of the people around me when they weren't using them. Instead of moving a whole directory of scripts from computer to computer, I ended up just replacing everyone else's .bashrc with my own, since they had never even made a single modification. But did I miss anything? So, what would you tell a beginning Linux user about when to alias, when to script, and when to write a function? If it's not obvious, I'm assuming the people who answer this will make use of all three options. If you only use aliases, or only use scripts, or only use functions—or if you only use aliases and scripts or aliases and functions or scripts and functions—this question isn't really aimed at you.
I am looking for a good free online or offline tool to draw processor schematics like this:
I have a list of requirements for a program, but I don't know what program meets these criteria. That's about general-purpose software, for example, not a programming IDE or statistical workbench, questions about which would certainly go to respective sites. Is this question appropriate on Stack Overflow? Where should I ask about it? On Super User or elsewhere?
I notice we now have running totals in the recent achievements bar for Today. Why not Yesterday and Last 7 days as well?
The Today group has a nice useful total. However, once 0:00 UTC rolls around, I can no longer see my score for yesterday. Please add a total for the Yesterday and Last 7 days groups. On a broader note, how can you have a button with an icon of two graphs open a popup that never has any graphs?
You cannot delete this question as others have invested time and effort into answering it. For more information, visit the help center. The situation is as follows: A question has a positive record and an answer only upvoted by the question author. The question author doesn't want anyone else to know that they asked this question, but they can't delete it. Is there any solution for this? For example, can I flag the question and let an administrator or moderator change the author to Community?
What circumstances can cause a question or answer to be deleted, and what does that actually mean? How can a post be deleted? When can't I delete my own post? Can I still see my post even after it's deleted? Can I see a list of my deleted posts? How can I undelete one of my posts? What does deletion mean for a post? How do votes to delete work? What are the criteria for deletion? What else should I know about deleted posts? If I flag my question with a request to delete it, what will happen? For more information, see the articles about and in the .
I learned from enzo83130 and percusse to draw a match stick, but I do not know how to draw a pile yet: \documentclass{article} \usepackage[svgnames]{xcolor} \usepackage{tikz} \begin{document} \begin{tikzpicture} \newcommand\allumette[2]{ \fill [yellow] (#1,#2) rectangle (#1+4,#2+0.2); \fill [yellow!60!black] (#1,#2) -- ++(4,0)-- ++(0.1,-0.05) -- ++(-4,0) -- ++(-0.1,0.05); \draw (#1,#2) -- ++(0,0.2) -- ++(4,0) -- ++(0,-0.2) -- ++(0.1,-0.05) -- ++(-4,0) -- ++(-0.1,0.05); \shade[ball color=red] (#1+4,#2+0.1) ellipse (0.25cm and 0.22cm); \draw (#1+4,#2+0.1) ellipse (0.25cm and 0.22cm); } \allumette{0.1}{0.2} \end{tikzpicture} \end{document}
I want to draw various matchstick pictures like this: or like this or other figures from: I want to use TikZ for this and have two questions about this: How do I get the path decoration with the matchsticks? What's the (syntactically) easiest way to draw pictures like this or how would a TikZ expert do this (to be flexible enough to draw such kind of figures but to have an easy syntax)?
I am aware of the way to use got/gotten in BrE vs AmE. I have come across a phrase which, to my eyes at least, seems one where both can be used (we're talking about AmE now). He opened his drawer and removed two items. He then came closer and showed me what he'd gotten Now, following the rule stating that gotten is used when indicating that the subject had acquired/obtained something, the phrase above is obviously correct. But, I was thinking, since we are talking about two items that (in the context) actually belonged to that person (as in, they were in his drawer), would not the form showed me what he'd got also be acceptable? Note: This question has been marked as a duplicate. It's not, I understand the differences mentioned in the other article. I'm asking about ambiguity - i.e. cases (such as this particular example) where both as possible. Let me try to rephrase the question: Is it possible to make a subtle difference in meaning as follows? 1) He showed me what he'd got (he showed me the items he had in his drawer) 2) He showed me what he'd gotten (he showed me the items he obtained from his drawer)
I see these two expressions are used almost identically in different contexts. Is there a difference between I have got and I have gotten?
how to get array index from foreach looping, i use session to print cart data like this, i need to print the index like 1, 2, 3, 4 before the code column in the table <?php if(isset($_SESSION["products"])) { $total = 0; echo '<tbody>'; foreach ($_SESSION["products"] as $cart_itm) { echo '<tr>'; echo '<td>?</td>'; echo '<td>'.$cart_itm["code"].'</td>'; echo '<td>'.$cart_itm["name"].'</td>'; echo '<td>'.$cart_itm["qty"].'</td>'; echo '<td><input type="text" name="product_qty_desired" class="spinner" value="1" size="3" /></td>'; echo '<td>'.$currency.$cart_itm["price"].'</td>'; echo '<td class="subtotal">Subtotal : </td>'; echo '<td><span class="remove-itm"><a href="cart_update.php?removep='.$cart_itm["code"].'&return_url='.$current_url.'">×</a></span></td>'; echo '</tr>'; $subtotal = ($cart_itm["price"]*$cart_itm["qty"]); $total = ($total + $subtotal); } echo '<tr>'; echo '<td></td>'; echo '<td></td>'; echo '<td>Total QTY :</td>'; echo '<td></td>'; echo '<td>?</td>'; echo '<td>Total</td>'; echo '<td>'.$currency.$total.'</td>'; echo '<td></td>'; echo '</tr>'; echo '</tbody>'; }else{ echo 'Your Cart is empty'; } ?> Thanks Warmly
Is it possible to find the foreach index? in a for loop as follows: for ($i = 0; $i < 10; ++$i) { echo $i . ' '; } $i will give you the index. Do I have to use the for loop or is there some way to get the index in the foreach loop?
So, Thanos's goal was to bring balance to the Universe by eradicating 50% of the living. I wonder, was he part of the general population that could have died? In other words, but killing half the living, was he not likely to kill himself as well?
The title is extremely vague, because this question contains HEAVY spoilers for Avengers: Infinity War, specifically the very last scenes of the movie. I can't reasonably put the entire question in spoiler tags, so consider this your warning. At the end of the movie, Thanos pretty much wins. He gets all the Infinity Stones, Gamora and Vision have been brutally murdered, and the rest of the cast completely beaten. Nobody could stop him. So he executes his plan. As far as I know (unless I missed something), his plan is to eradicate exactly half of all mortals in the universe, and from his own words, in a fair lottery (random chance), without taking into account a person's wealth, social status, or anything else. Pure chance decides whether you are sacrified for the greater good or live through this greater good (according to him). During the movie, Thanos and one of his underling (Ebony Maw) say themselves that being sacrified is an honor and should be appreciated. As you would expect, most people do not appreciate being sacrified. At the end of the movie, Thanos uses all 6 stones to do a finger snap, deleting half the universe. The question is: Did he exclude himself from the targets? Was there a 50% chance that Thanos himself would disappear right there? As far as I know, this is not explicitly answered in the movie itself. I am looking for similar situations in the comics (or in the movie if I happened to miss something) where you could know, or have an educated guess, as to Thanos being the kind of person who follows through to the end, even if it means dying, or the kind of person who gets scared of death when it comes down to it, and comes off as an hypocrite. Some people also mentioned his "deal" with Strange would make him spare Tony from the snap too. I'm also wondering about that, if there is a link between the two, but it's not the focus of the question. The reason I'm wondering is that Thanos seems to me like a very extreme utilitarist. Even though he might be wrong about the value of his plan (Do the remaining half really become happy?), in-universe it seemed successful at least once (Gamora's home planet), so his reasoning is not bad, even if the premise might be horribly flawed. Excluding himself from the snap would make it into a straight villain, while considering himself equal to the rest would make him into a wannabe hero with very very evil methods. This makes a huge difference in the interpretation of the movie and his character.
I'm trying to run linear regression models using the R data "Auto.csv", which has the data for miles per gallon and the displacement. Now I'm trying to run two different linear regression models fit <- lm(mpg ~ displacement) For this model, I get the result (intercept) displacement 35.12 -0.06 Then, I interchange the response and predictor fit <- lm(displacement ~ mpg) For this model, I get the result (intercept) displacement 447.50 -10.79 For both these models, I'm getting the same results for p-value, r^2 values. Which of these models if better and what metric do we use to ascertain that? Any explanation would really be helpful
The Pearson correlation coefficient of x and y is the same, whether you compute pearson(x, y) or pearson(y, x). This suggests that doing a linear regression of y given x or x given y should be the same, but I don't think that's the case. Can someone shed light on when the relationship is not symmetric, and how that relates to the Pearson correlation coefficient (which I always think of as summarizing the best fit line)?
Actually I installed Ubuntu alongside Windows 10 a day before. Ubuntu was working little bit slow. Then I uninstalled Ubuntu but grub issue was there due to which I was unable to use Windows. Then I made Windows bootable file and then repair my computer....then troubleshoot, and command prompt...and wrote these commands: bootrec.exe /FixMbr and then enter...again bootrec.exe /FixBoot and enter....and then Windows was loading properly.... Now again I am trying to install the same ISO file but this Ubuntu installer is not booting. Here is the image:
I have installed Ubuntu 20 alongside Windows 10, then removed Ubuntu and grub issues were also solved, now I am unable to install Ubuntu 20 again. I am installing through USB and a black screen comes with some lines. It is when I am booting the installer. Ubuntu is not installed on my system.
Assume $f : [0, 1] \rightarrow [0, 1]$ is continuous. Show that there must be a point $x \in [0, 1]$ such that $f(x) = x$ I am not even sure how to begin with this problem, I know that $f$ is continuous so for all $\epsilon > 0$ there is a $\delta > 0$ such that whenever $|x-c|< \delta$ it follows that $|f(x) - f(c)| < \epsilon$ Any advice?
Can you please help me to understand this proof: Consider $g(x)=f(x)-x$. $f(a)\ge a$ so $g(a)=f(a)-a\ge 0$. $f(b)\le b$ so $g(b)=f(b)-b\le 0$. By the Intermediate Value Theorem, since $g$ is continuous and $0\in[g(b),g(a)]$ there exists $c\in[a,b]$ such that $g(c)=f(c)-c=0$, so $f(c)=c$ for some $c\in[a,b]$." My question is why $f(a)\ge a$ and $f(b)\le b$?? Thanks a lot!
trying to pass line info (2 lines reprensting a user and a password) to a java application, the log show that it take the lines but empty value (like only tkae the \n code is decompiled (only have the copiled version) showing this function and call public String getUser(String prompt) { System.out.print(prompt); BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String userName = null; try { return br.readLine(); } catch (IOException ioe) { System.out.println("IO error trying to read your name!"); } return null; } call in main code is try { String user = application.getUser("User: "); User = user; char[] pswd = application.getPassword(System.in, "Password: "); if (application.isDebug()) { application.log("verify User " + User); } ... } else { application.log("ID not found!"); } } catch (Exception e) { application.log("Exception during login, abort Batch now!"); System.exit(1); } calling with different redirection from the shell ex: printf "%s\n%s\n" "MyUser" "MyPwd" | java SomeArguement Compiledjar show this in log User: Password: [2019-09-25 14:06:26 CEST] getUserPlatformContext [2019-09-25 14:06:26 CEST] Exception during login, abort Batch now! any idea why STDIN in not "read" correctly by this code (this confirm it should). I also put lot more string to pass in case of previous code read STDIN before but it's the same ----------- Other story ----------------------- finaly found the debug argument to pass and it show that the STDIN is correctly read for the user prompt but hang on the getpassword that use a buffer read from another type like ((PushbackInputStream)in).unread(c2) and failed at this level.
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?
Assuming I have this code here : test.sh if [ $2="Yes" ]; then echo 0 else echo 1 fi When running this command : ./test.sh test Yes I get 0 , which seems reasonable but when running ./test.sh test No I get 0 too . Why ?
The following script does not behave as I would have expected. Adding spaces around the '=' in the conditional made it perform how I wanted, but it got me thinking, what is it actually doing inside the conditional? #!/bin/bash S1='foo' S2='bar' if [ $S1=$S2 ]; then echo "S1('$S1') is equal to S2('$S2') fi echo $S1 echo $S2 The output is: S1('foo') is equal to S2('bar') foo bar The contents of S1 and S2 don't change from what they are assigned, so the = doesn't perform an assignment.
By a combinatorial argument, prove for $r \le n$ and $r \le m$, $${n+m \choose r} = { m\choose 0}{n \choose r} + {m \choose 1} {n \choose r-1}+\cdots+{m \choose r}{n \choose 0}$$ Besides knowing that ${m \choose 0}=1$ and ${m \choose 1}=m$, I am completely at a loss. Can someone please advise?
Prove that $$\sum_{k=0}^r {m \choose k} {n \choose r-k} = {m+n \choose r}.$$ This problem is in the chapter about discrete random variables, but I have no idea what to go about substituting. I can't get it to be a featured formula without screwing stuff up, sorry about that.
So, I was reviewing Suggested Edits on StackOverflow. I made a determination on one edit, and the next appeared. I immediately thought "wait--I wonder" and clicked my browser's back button to check something else regarding that review. I honestly don't remember what it was, but everything turned out fine. So I clicked the forward button on my browser to get back to the next suggested edit in line. And I got this: This suggested edit is pretty clearly a review audit, and if you'll glance at the text inside the shiny red circle, you'll see that reloading the audit in the browser window generates the error: This item is not reviewable. When I proceeded onward to the next edit, I was not given another audit. Edits proceeded as normal. The problem I see here is that it gives robo-reviewers a way to cheat the audit system. It would take them a little extra time, but it would be a 100% guarantee that they would never fail an audit. It's easy: load next review, click backspace key, load review again. If you see the error, hit next and repeat. If you don't, press approve and repeat. So... Fix? :) Update: Huh... Further interesting is this. I still had the tab open, and I refreshed the page (I don't know why, I think some part of my brain was expecting a new review to appear, which of course didn't happen.) But upon refresh, I saw this: That's right--someone else got my audit, and it tells me if they passed or failed it! Curiouser and curiouser. Also, here's a , in case that helps anybody.
Steps to repro: Find a suggested edit that seems suspicious (clearly an audit) Press F5 OR Ctrl+R OR the refresh button (who uses the GUI anyway) ... Break the audit! (see image) (Looks like audits are re-used and the link is not longer valid.) When you get a suggested edit that is an audit and accidentally refresh the page, instead of just showing the normal page with all four buttons it changes to this layout with a "item is not reviewable". I've reproduced it many times. The normal behavior is exactly similar to the picture on the left below. The audit is not supposed to have "community" as its username AND should show the 4 buttons. It's a way to avoid audits, and is pretty annoying! EDIT before even submitting the post! pretty sure it's the fastest edit to ever happen on SO. Repro'd Again! (and again, can be repro'd anytime) Correct behavior (When you stumble for the first time on the edit.) Bad behavior (When you've refreshed the page.)
Is there a way that automatically capture all the exceptions occurred through 'logging' module and write them into a .log file? Please do not mention the solution that 'manually' writes traceback.format_exc() into the log
Using something like this: try: # Something... except Exception as excep: logger = logging.getLogger("component") logger.warning("something raised an exception: " + excep) logger.info("something raised an exception: " + excep) I would rather not have it on the error-level cause in my special case it is not an error.
When someone asks me, for example, to go with him to the cinema and I want to reply that I can't because I have to go to the doctor's, what should I say? I'm visiting a doctor I'm going to visit a doctor I will visit a doctor.. My question is when we should use be going to be + present continuous Will ? Which one is the most correct option in the provided context?
From the grammatical point of view all are correct, just the meaning are different, please bring your clarification, thank you. The Train will leave at 10:00 tomorrow morning. The Train is going to leave at 10:00 tomorrow morning. The Train leaves at 10:00 tomorrow morning. The Train is leaving at 10:00 tomorrow morning.
I am a beginner of Ubuntu, and I have been using CentOS system before. Is there any operation manual about Ubuntu system?
I've just started using Lubuntu 13.10. It's the first time I've ever used Linux. Can any of you send me a tutorial-video for new users or explain the basics to me?
How to show that $\mathbb{R}[x, y] / \langle x^2 + y^2 - 1 \rangle $ is a Dedekind domain?
Let $R = F[x,y]/(ax^2+by^2-1)$, where $F$ is a field with $\text{char}(F) \neq 2$ and $a, b \neq 0$. Then $R$ is Dedekind. My attempt: $R$ is Dedekind if and only if it is Noetherian, integrally closed, and if every prime ideal is maximal, so it suffices to show these conditions. Noetherian: I wasn't able to explicitly prove this, but I'm pretty sure that every polynomial in $F[x,y]$ of degree greater than 3 can be expressed as the sum of factors of $ax^2+by^2-1$ and polynomials of degree at most 2, so that $R$ consists of polynomials of degree at most 2. If this is true, then the possible non-units are the possible sums and products of $x, y, x^2, y^2$, and since these are the possible generators of nonzero proper ideals, every ideal is finitely generated, so $R$ is noetherian. Integrally closed: My idea was to show the stronger condition that $R$ is a UFD. Since $ax^2+by^2-1$ is irreducible over $F[x,y]$, $R$ is a domain. Since $ax^2 + by^2 = 1 \in R$, $f \in R^x$ if and only if $f \mid ax^2 + by^2$. But when I tried to use this to show that irreducible elements are prime, I got stuck, and I'm no longer sure $R$ is a UFD, but I can't think of a counterexample either. Every nonzero prime ideal is maximal: Let $P$ be a nonzero prime ideal of $R$. Then, there exists a nonzero ideal $P' \subset F[x,y]$ such that $P'/(ax^2+by^2-1) \cong P$, where this projection comes from the first isomorphism theorem and the canonical projection $\phi: P' \rightarrow P$, where $\text{ker}(\phi) = (ax^2+by^2-1)$. Since the preimage of a prime ideal is also a prime ideal, $P'$ is a prime ideal, and since $$R/P \cong \left(F[x,y]/(ax^2+by^2-1) \right) / \left(P' / (ax^2+by^2-1) \right) \cong F[x,y] / P'$$ by the third isomorphism theorem, it suffices to show that $P'$ is maximal. I feel like $P'$ should be maximal in $F[x,y]$ since $P'$ must contain polynomials of degree at most two, and since these polynomials are "small", the ideal containing them should be "large", but I'm stuck trying to turn this intuition into something formal.
If I want to use my staff ticket I have to book the ticket under my Korean name (which is completely different from my English name) and Korean passport number. The only thing is I know that for the US you have to enter and leave using your US passport if you’re a citizen. Would it be possible for me to just buy my ticket using my Korean name and passport but when I enter the US just explain my situation and show my US passport to show that I’m a US citizen?
I am a citizen of two different countries, and have two passports. How should I use my passports when traveling?
My template class compile successful but link error. Error message: Undefined symbols for architecture x86_64: "calculate<int>::plus(int, int)", referenced from: _main in main.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) Code is very simple: 1. calcualte.hpp template <class T> class calculate { public: T plus(T a, T b); }; 2. calculate.cpp template <class T> T calculate<T>::plus(T a, T b) { return a+b; } 3. main.cpp calculate<int> cal; int a = cal.plus(11,20); If I move the code in calculate.cpp to calculate.hpp, it will build successful. It should be link configuration in XCode. Anyone can help?
Quote from : The only portable way of using templates at the moment is to implement them in header files by using inline functions. Why is this? (Clarification: header files are not the only portable solution. But they are the most convenient portable solution.)
I have run a security check and it came back with 6 high vulnerabilities. OpenSSL Running Version Prior to 1.0.1t OpenSSL Running Version Prior to 1.0.1t OpenSSL Running Version Prior to 1.0.1o OpenSSL Running Version Prior to 1.0.1o OpenSSL Running Version Prior to 1.0.1s (DROWN) OpenSSL Running Version Prior to 1.0.1s (DROWN) I am here as a last result (i have googled) so many conflicting articles on updating i was really hoping the cmd. yum update openssl Would solve my issue but no help i get. Loaded plugins: priorities, update-motd, upgrade-helper amzn-main/latest | 2.1 kB 00:00 amzn-updates/latest | 2.3 kB 00:00 1521 packages excluded due to repository priority protections No packages marked for update I have seen a few articles about building from src and then articles saying you should definitively not do this what is right I really want to make sure my server is secure. My openssl version is: OpenSSL 1.0.1k-fips 8 Jan 2015 I am running centos on AWS ec2 any idea how to update? this does not help Please help.
We just ran an external security scan from 403Labs against one of our servers (RHEL 6.3 x86_64) for PCI compliance and the results appeared to mainly dictate that we had a hand full of applications that needed to be upgraded to pass the scan. That having been said, the problem I am encountering is that the package manager (yum) and the use of the remi repo do not have the versions I need for Apache and OpenSSH. I have already performed the following: yum update yum --enablerepo=remi,remi-test install httpd mysql mysql-server php php-common This resolved our critical and high risk results, but the medium level results are still stating that we need to further upgrade the following packages. The upgrades we need are: Current Required Apache 2.2.15 to >= Apache 2.2.23 OpenSSH 5.3 to >= 5.7 So, since the package manager is not capable of letting me upgrade to those versions, how must I go about doing this? I'm currently under the premise that I will need to install from source. If there's a better alternative, please indicate that. Also, if I have no choice but to install from source, can someone please help me identify what the proper source packages would be so that I know I am installing the correct versions for my OS? Thank you very much for any help.
I have a command that may contain the ampersand charater: &. Sometimes, when I use this command, I want that ampersand interpreted as a space. This is why I wanted to use the TeX command \catcode. While the code below seems to be OK \catcode`\&=11 \ensuremath{2&=2} \catcode`\&=4 When I put the content inside a definition with \def for example: \def\foobar{\ensuremath{2&=2}} \catcode`\&=11 \foobar \catcode`\&=4 I get an error message: Misplaced alignment tab character &. leading text: \foobar How can I solve my problem? Moreover, I don't understand why the second snippet generates this error message while the first one does not.
How to define a command which replaces every instance of a certain character in its argument with another certain character? For example, I'd like to define the command \myreplace{1-2-abc-345} which gives me the output 1.2.abc.345 by replacing every - with ..
How do I completely uninstall Java from Mountain Lion? I wanted to run Minecraft so I followed the system promps and I think I installed Java 7 and then Java 6. I couldn't get Mincraft to work for other reasons so I deleted it and now I want to get rid of Java. Not sure if it's relevant but typing "java -version" into Terminal gives me "java version "1.6.0_37" Java(TM) SE Runtime Environment (build 1.6.0_37-b06-434-11M3909) Java HotSpot(TM) 64-Bit Server VM (build 20.12-b01-434, mixed mode)" Any help would be appreciated.
I recently installed the Java runtime (through Software Update) and enabled the Java browser plug-in and WebStart on Lion, but I don't need them anymore. Unchecking "Enable Java" in Safari preferences gets the job done, but I'd rather get rid of Java completely. So the question is, how do I do this? I want to go back to a clean Lion install, Java-wise.
How to solve this differential equation: $$ m*(dv/dt)=-m g- r v$$ where m, r and g are constants. I am trying to rewrite the equation as dv=dt form, but I do not know how to do it. I get the solution from the mathematica as $$ (mg/r+v)*e^{(-rt/m)}-(mg/r)$$
I've seen many variants of this problem online, but not quite the same as this, so I don't believe this is a duplicate. The famous differential equation problem models a skydiver jumping out of a plane as $$m \frac{dv}{dt} = -mg-cv$$ where m is the mass of the skydiver, g is acceleration due to gravity (9.81 m/s) and c is the coefficient of air resistance. Here is my question: Suppose the skydiver exits the stationary helicopter at an altitude of 2000m and opens the parachute at 500m. For this exercise, the parachute opens instantaneously. Suppose m= 70kgs, the coefficient of air resistance is c = 14 for a free falling body and c = 105 after the parachute opens. When does the skydiver open the parachute? When does the Skydiver hit the ground? So my attempt at a solution kinda starts like this, but this is where I get stuck: Let's assume that s(t) is the distance the body falls in time t from its initial point of release, then $v = \frac{ds}{dt}$ and $a = \frac{dv}{dt} = \frac{d^2s}{dt^2}$. Thus we have a second order differential equation: $m \frac{d^2s}{dt^2} = -mg-c\frac{ds}{dt}$. By simply manipulation, we get $m \frac{d^2s}{dt^2} + c\frac{ds}{dt} = mg$. I originally started thinking of finding the integrating factor, however, this seems more complicated and won't help produce the equation that I need. Would anyone be able to help? Much thanks in advanced!
I want to find out when my log files were compressed by logrotate because when I received them from cron in my email, the logs came in as text in the main body of the email instead. I did: ls -1la /var/log/some_services And found that the logs in question are already in the compressed .gz format. So I was wondering if those files were emailed first, before being compressed. However, the dates shown are not when the files were compressed, but when the logs were last updated. How can I tell when a file was compressed?
How to know in Linux whether a particular file is compressed or not using a command?
I want to dual boot Windows and Ubuntu from my computer, which has only Ubuntu installed. I have done dual booting before but in that case, Windows was installed first. Here are my Ubuntu partitions: And I want to free up some 60GB space for my Windows. How do I do that?
I'm having a lot of issues dual booting Windows 10 and Ubuntu 14.04. I'd like to not do anything too crazy if possible. I need to install Windows 10, when I already have Ubuntu 14.04 installed. My Laptop is a Dell. OK, here's what I need help with: Downloading everything I need Making my live USB's Split partitions Installing Windows 10 Repairing Grub Fixing the UEFI to boot Grub
I'm just an amateur in this and I Need Help.. I've drawn this circuit of my Shaving machine and I want to remove the battery and connect it directly to one of these phone chargers-: The first: output 5.7v ~ 800mA or The second-: output 5v ~ 350mA or -The shaving machine charger: 3v ~ 200mA Will Any Of These Work?
Power supplies are available in a wide range of voltage and current ratings. If I have a device that has specific voltage and current ratings, how do those relate to the power ratings I need to specify? What if I don't know the device's specs, but am replacing a previous power supply with particular ratings? Is it OK to go lower voltage, or should it always be higher? What about current? I don't want a 10 A supply to damage my 1 A device.
I need to express that "a is not divisible by b" in my LaTeX document. It is my understanding that I should use the \nmid symbol for this case, as in $b \nmid a$. LaTeX gives me the following error: Undefined control sequence. The \mid symbol works fine. I have imported the amsmath package via the following command: \usepackage{amsmath}. What am I missing?
I know what my symbol or character looks like, but I don't know what the command is or which math alphabet it came from. How do I go about finding this out?
I have written the following code to determine if someone is 18 in the UK. I want it to work out if the person was a 'leapling' (born on 29 February). int age; if (DateTime.IsLeapYear(startDate.Year) && startDate.Month == 2 && startDate.Day == 29) { age = (int)Math.Floor((endDate - startDate).TotalDays / 365.25); } else { age = (int)Math.Floor((endDate - startDate).TotalDays / 365); } return age; I have roughly tested it using the various dates like (apologoes for the horrible code for demo purposes only): DateTime startDateLeapYearNonLeapling = new DateTime(1996, 02, 28, 0 , 0, 0, 0, DateTimeKind.Local); DateTime endDateLeapYearNonLeapling = new DateTime(2014, 02, 28, 0, 0, 0, 0, DateTimeKind.Local); DateTime startDateLeapling = new DateTime(1996, 02, 29, 0 , 0, 0, 0, DateTimeKind.Local); DateTime endDateLeaplingToday28Feb = new DateTime(2014, 02, 28, 0 , 0, 0, 0, DateTimeKind.Local); DateTime endDateLeaplingToday1March = new DateTime(2014, 03, 01, 0 , 0, 0, 0, DateTimeKind.Local); DateTime startDateNonLeapYear = new DateTime(1996, 03, 28, 0 , 0, 0, 0, DateTimeKind.Local); DateTime endDateNonLeapYear = new DateTime(2014, 03, 28, 0 , 0, 0, 0, DateTimeKind.Local); int ageLeapYearNoLeapling = GetAge(startDateLeapYearNonLeapling, endDateLeapYearNonLeapling); //18 int ageLeapYearLeaplingToday28Feb = GetAge(startDateLeapling, endDateLeaplingToday28Feb); //17 int ageLeapYearLeaplingToday1Marach = GetAge(startDateLeapling, endDateLeaplingToday1March); //18 int ageNonLeapYear = GetAge(startDateNonLeapYear, endDateNonLeapYear); //18 Returns 18 and 17 in the correct test cases. The code appears to work but I know that DateTime calculations can trip us up. Are there any cases I have missed? I'd also be interested in a more elegant solution if anyone has one or even how to make this work with different cultures but that is probably for another day.....
Given a DateTime representing a person's birthday, how do I calculate their age in years?
I am new to java. I am having slight confusion regarding date arithmetic in java. I have following scenario, where I want to find differences between two dates :- java.util.Date objDt1 = getDate1FromSrc1(); // I am obtaining it from src1 java.util.Date objDt2 = getDate2FromOtherSrc(); // I am getting dt2 by other way. Now, I want to find difference between two dates and the output must be other date object. So, I have written the following code :- Calendar objCal1 = Calendar.getInstance(); Calendar objCal2 = Calendar.getInstance(); objCal1.setTime(objDt1); objCal2.setTime(objDt2); objCal1.add(Calendar.DAY_OF_MONTH, -objCal2.get(Calendar.DAY_OF_MONTH)); objCal1.add(Calendar.MONTH, -objCal2.get(Calendar.MONTH)); objCal1.add(Calendar.YEAR, -objCal2.get(Calendar.YEAR)); objCal1.add(Calendar.HOUR_OF_DAY, -objCal2.get(Calendar.HOUR_OF_DAY)); objCal1.add(Calendar.MINUTE, -objCal2.get(Calendar.MINUTE)); objCal1.add(Calendar.SECOND, -objCal2.get(Calendar.SECOND)); java.util.Date objDiff = objCal1.getTime(); But, I am getting some wierd results. Eg. If objDt1 is "02/22/2016 09:00:00" and objDt2 is "02/22/2016 11:00:00", then I am expecting objDiff to be "02:00:00" as output, which I am not getting. Can you suggest me what's wrong I am doing here and what's the right way to approach this problem ? Thanks in advance.
I find it funny that Java (or the java.util library) does not have a built-in function to calculate difference in dates. I want to subtract one date from another to get the elapsed time between them. What is the best way to do this? I know the simple way is to take the difference of the time in milliseconds and then convert that into days. However, I wanted to know if this works in all cases (with daylight saving, etc.).
I have a site with php+mysql on shared hosting and it works well, has good traffic and I want to plan for the future when traffic to my site grows and shared hosting can't handle it. Since the code is not trivial, rewriting is not an option, so I'd like to plan for a future site upgrade which considers these parameters: The site should not be rewritten, I'd like to move the existing code over to the new hosting as is (with minor modifications at most) when the time comes I'm the only developer/admin on the site and it works out well, because shared hosting is PaaS, so I don't need to bother with administering the base software, installing software updates, etc. so the new future hosting should be PaaS as well It should not be too expensive, so a managed VPS and such is not an option What are the possible hosting options which would satisfy the above conditions and allow me to handle more traffic when needed?
This is a "catch-all" question designed to serve as an answer for all questions about choosing web hosting. Pro Webmasters no longer accepts new questions about how to choose hosting. All future questions pertaining to finding web hosting should be closed as a duplicate of this question. For more information about this policy please see . How to find web hosting that meets my requirements? What we're looking for in answers to this question are the basics about web hosting: What is web hosting? What is the difference between shared, VPS, and dedicated hosting? How does a content delivery network relate to web hosting? Anything else you feel is helpful in finding a web host. What we do not want is: Endorsements or recommendations for specific web hosts We do not want your experience or other subjective information (just the facts please)
I need your help. My postfix is sending spam mails. I checked my main.cf and it should be fine. In the following a snippet of my mail.log Jan 3 22:35:41 mail postfix/pickup[104179]: 866352963F01: uid=33 from=<[email protected]> Jan 3 22:35:41 mail postfix/cleanup[104027]: 866352963F01: message-id=<[email protected]> Jan 3 22:35:41 mail opendkim[3895]: 866352963F01: DKIM-Signature field added (s=key1, d=mydomain.net) Jan 3 22:35:41 mail postfix/qmgr[27451]: 866352963F01: from=<[email protected]>, size=6867, nrcpt=1 (queue active) Any clue what happen? Thanks in advance!
This is a about Server Security - Responding to Breach Events (Hacking) See Also: Canonical Version I suspect that one or more of my servers is compromised by a hacker, virus, or other mechanism: What are my first steps? When I arrive on site should I disconnect the server, preserve "evidence", are there other initial considerations? How do I go about getting services back online? How do I prevent the same thing from happening immediately again? Are there best practices or methodologies for learning from this incident? If I wanted to put a Incident Response Plan together, where would I start? Should this be part of my Disaster Recovery or Business Continuity Planning? Original Version 2011.01.02 - I'm on my way into work at 9.30 p.m. on a Sunday because our server has been compromised somehow and was resulting in a attack on our provider. The servers access to the Internet has been shut down which means over 5-600 of our clients sites are now down. Now this could be an FTP hack, or some weakness in code somewhere. I'm not sure till I get there. How can I track this down quickly? We're in for a whole lot of litigation if I don't get the server back up ASAP. Any help is appreciated. We are running Open SUSE 11.0. 2011.01.03 - Thanks to everyone for your help. Luckily I WASN'T the only person responsible for this server, just the nearest. We managed to resolve this problem, although it may not apply to many others in a different situation. I'll detail what we did. We unplugged the server from the net. It was performing (attempting to perform) a Denial Of Service attack on another server in Indonesia, and the guilty party was also based there. We firstly tried to identify where on the server this was coming from, considering we have over 500 sites on the server, we expected to be moonlighting for some time. However, with SSH access still, we ran a command to find all files edited or created in the time the attacks started. Luckily, the offending file was created over the winter holidays which meant that not many other files were created on the server at that time. We were then able to identify the offending file which was inside the uploaded images folder within a website. After a short cigarette break we concluded that, due to the files location, it must have been uploaded via a file upload facility that was inadequetly secured. After some googling, we found that there was a security vulnerability that allowed files to be uploaded, within the ZenCart admin panel, for a picture for a record company. (The section that it never really even used), posting this form just uploaded any file, it did not check the extension of the file, and didn't even check to see if the user was logged in. This meant that any files could be uploaded, including a PHP file for the attack. We secured the vulnerability with ZenCart on the infected site, and removed the offending files. The job was done, and I was home for 2 a.m. The Moral - Always apply security patches for ZenCart, or any other CMS system for that matter. As when security updates are released, the whole world is made aware of the vulnerability. - Always do backups, and backup your backups. - Employ or arrange for someone that will be there in times like these. To prevent anyone from relying on a panicy post on Server Fault.
I've noticed on some of the early censuses that when giving the address you will see something like "Ward 5" or "Ward 7". Is that something like Districts?
Many, if not most, of the 20th century U.S. census records include fairly precise address information for those living in cities and towns. Even many 1880 census records include at least street-level information. Some of the earlier census sheets (say 1860 and 1870) don't include street-level data, but do list the ward of the town or city. I'm curious to know whether city wards are useful for genealogical purposes. I'd rather not get into rare, speculative uses, but rather actual uses where ward information can solve some other problem.
Is it possible to find in which commit a certain version of a binary file is? I'm thinking something like: $ sha1sum mybinaryfile 2fc60fcc4a92a2b171db333b482dabf94c82d51f mybinaryfile $ git tell-me-which-commit-has 2fc60fcc4a92a2b171db333b482dabf94c82d51f commit fc8d840778024557faf6bd2d93c56a2b4be55ab1 Author: author <[email protected]> Date: Wed Feb 19 15:41:06 2014
Given the hash of a blob, is there a way to get a list of commits that have this blob in their tree?
Can someone point to a location, where this photograph was taken? It looks stunning! This is one of lockscreen wallpapers in Windows 10.
Windows 10 has an extensive collection of lock screen photos, many of which have here on Travel.SE. Is there a website which lists the location of all of these photos? I imagine Microsoft has purchased an official license, so they should have a record about the photographer and the place where the photo was taken.
So if I have two sets A and B and if |A| = |B| and if function f is a function from A to B and is injective, how can I prove that it is also surjective? Forgot to mention. A and B are finite sets.
i cant solve this exercise, if you can help or give me a lead. I would like to also say its not marked. Let $f$ an application from $E$ to $F$, with $\#E=\#F=n$. Show that these propositions are equivalent: $f$ is injective $f$ is surjective $f$ is bijective Going from 2 to 3 is fairly simple, and from 3 to 1 is automatic but I can't go from 1 to 2. Thank you, cordially, JF
I am installing ubuntu on my real computer but with the error "this kernel requires an x86-64 cpu but only detected an i686 cpu. unable to boot - please use a kernel appropriate for your cpu" help me!!
I want to create liveUSB on part of my flash stick. I made a partition with GParted and downloaded .iso file of Ubuntu 19 from the official website to mount with gnome-disk-utility. I noticed that the iso file has "amd64" in the name. But I intend to use this USB not only on amd computers! Is that important? Will the live USB work on PC with Intel/other processor?
I have a random forest classification model that classifies into 3 different labels. The thing is my data is unbalanced label 1 dominates the data with frequency of 0.5 while label 2 is around 0.35 and the third one is 0.15. Which classification metric would you recommend me to use in order to evaluate my candidate models. what is your rational ? thank you all in advance !
I have to do classification model to predict the possibilities of person getting cancer based on certain attributes. The data is highly imbalanced. As per client requirement I have to report model performance based on any one of these 4 metrics AUC_Weighted normalized root mean square log loss Accuracy Can you suggest me which one should I use?
function verifyEmail(component){ var status = false; var emailAddress = component.value; if(emailAddress == ""){ return true; } var emailRegEx = /^([A-Z0-9._%+-])+@([A-Z0-9.-])+\.([A-Z])+$/i; if (!(emailAddress.search(emailRegEx) == -1)) { status = true; } return status; } This regex accepting duplicate words after @ . Eg: [email protected] Here com word is coming 2 times. we should not allow duplicate words after '@'
Is there a regular expression to validate an email address in JavaScript?
In the Longman Dictionary I have found the following sentence: 'Try phoning Robert-he should be home by now.' Can I say:'Try to phone Robert – he should be home by now'?Is this sentence correct?In case it is correct, do these two sentences have exactly the same meaning?
I tried to open the door. I tried opening the door We can use both infinitive and gerund with verb "try" as used in above sentences. Does it change the meaning of the sentence if use gerund or infinitive?.(here i don't know if the meaning of sentences is changed.) The same confusion arise in these two sentences. 1.I stopped seeing him. 2. I stopped to see him.(But in case of these two sentence i know the meaning is changed but don't know exactly what the change is).
I'm using OSX 10.10 Google Chrome Version 45.0.2454.85 (64-bit) And When I go through the sidebar elements on my Wordpress site it looks like this: Is this a known bug?. On Firefox and Safari everything is looking fine. UPDATE 1 You can temporary fix this by adding this on your functions.php file template: add_action('admin_enqueue_scripts', function (){ if ( strpos( $_SERVER['HTTP_USER_AGENT'], 'Chrome' ) !== false ){ wp_add_inline_style( 'wp-admin', '#adminmenu { transform: translateZ(0); }' ); } }); UPDATE 2 This has been reported on Google Chrome forums:
I'm having an issue with my admin menu in WordPress. As you can see in the image below the formatting of the menu is out of order. This happens whenever I first land on one of the admin pages but if I refresh the page the menu looks fine. I tried disabling my plugins but none of them seem to be causing the issue.
I am using Azimuthal Equidistant Projection to plot points in a map being drawn in an Android application. The origin is the centre of the map. I have the formulas from and . I am getting expected results. Simplified version of the code being used by me in JavaScript: // Add functions to Math if (!Math.toRadians) Math.toRadians = function(angledeg) { return angledeg * Math.PI / 180; }; if (!Math.toDegrees) Math.toDegrees = function(anglerad) { return anglerad * 180 / Math.PI; }; /* Mean radius of Earth (in metres)*/ const WGS_1984_R = 6370997; /* Function to convert geodetic coordinates to Azimuthal Equidistant Projection projection (cartesian metres)*/ function convertGeodeticToAEP(longitude, latitude, longitudeOrigin, latitudeOrigin) { var deltaLongitudes = Math.toRadians(longitude - longitudeOrigin), cosDeltaLongitudes = Math.cos(deltaLongitudes), cosLatitude = Math.cos(Math.toRadians(latitude)), sinLatitude = Math.sin(Math.toRadians(latitude)), cosLatitudeOrigin = Math.cos(Math.toRadians(latitudeOrigin)), sinLatitudeOrigin = Math.sin(Math.toRadians(latitudeOrigin)), // Angular distance from the centre c = Math.acos(sinLatitudeOrigin * sinLatitude + cosLatitudeOrigin * cosLatitude * cosDeltaLongitudes), k = c == 0 ? 0 : c / Math.sin(c), x = k * cosLatitude * Math.sin(deltaLongitudes) * WGS_1984_R, y = k * (cosLatitudeOrigin * sinLatitude - sinLatitudeOrigin * cosLatitude * cosDeltaLongitudes) * WGS_1984_R; return {x: x, y: y}; } What would be the formulas to rotate the projection by a given angle, from the origin? Say modify the function to include an additional parameter for angle of rotation and then modify the output accordingly...
I'm trying to rotate a tif raster in R using Proj4's projection - I think the only way to rotate spatial geometries to custom angles. But I'm finding the operation gets very slow approaching 90°, and in fact fails for that angle (possibly 2 separate issues). This demonstrates: require(raster) require(rgdal) # demo raster r <- disaggregate(raster(volcano[1:60,1:60]), 4) extent(r) <- c(-5,5,-5,5) crs(r) <- "+proj=longlat +datum=WGS84" # proj4 two-point equidistant rotate transformations tpeqd_45 <- CRS("+proj=tpeqd +lat_1=2 +lon_1=-2 +lat_2=-2 +lon_2=2 +a=6371000 +units=m +no_defs") tpeqd_80 <- CRS("+proj=tpeqd +lat_1=1.9 +lon_1=0.35 +lat_2=-1.9 +lon_2=-0.35 +a=6371000 +units=m +no_defs") tpeqd_90 <- CRS("+proj=tpeqd +lat_1=2 +lon_1=0 +lat_2=-2 +lon_2=-0 +a=6371000 +units=m +no_defs") system.time(r_45 <- projectRaster(r, crs=tpeqd_45)) user system elapsed 0.350 0.051 0.404 par(mfcol = c(1,2)); image(r, asp=T); image(r_45, asp=T) system.time(r_80 <- projectRaster(r, crs=tpeqd_80)) user system elapsed 3.857 0.879 4.877 system.time(r_90 <- projectRaster(r, crs=tpeqd_90)) Error in if (value[1] != nrow(x) | value[2] != ncol(x)) { : missing value where TRUE/FALSE needed In addition: Warning message: In `dim<-`(`*tmp*`, value = c(nr, nc)) : NAs introduced by coercion to integer range Note the increasing time to process for 80°. For a 10x bigger raster this crashes my Macbook. Does anyone know if this is a problem in the math for this projection and/or if there is any other way to rotate these in R?
What is the remainder when $2^{2^{517}}$ divided by $23$? I tried Fermat Little theorem, and seems like I cannot make a further step. The trick here is about $2^{517}$ which does not follow the normal principles of power's calculation.
I have had a go at this for a while now and can't seem to get anywhere. $$2^{(2^{517})} \pmod {23}$$ I see that Fermat's Little Theorem must come into play but I can't see where to pull $22$ from. Any help would be appreciated. Here is my attempt: $$2^{(2^{517} \!\!\mod {22})} \equiv 2^{(2^{517})} \pmod {23}$$ Then proceed to do Chinese remainder theorem to find the exponent?
I tried a few threads already on Blender Stack Exchange: I'm using 'Images as Background' add-on. I've tried the 'Film' 'Transparent' recommendation. The render icon is on in the outliner. I've messed with the nodes all day. Nothing seems to be working. I made an animation in 2.79, and I opened the file in 2.83,(I checked the box to not load the UI thing) so maybe a few bugs from the old one got into the this file because I tried loading up a new 2.83 file and the background rendered just fine with no modifications. I am using HitFilm 3 Express as my video editing program, I am more comfortable with it than Blender's internal video editing software. So I'm rendering out a greenscreen for the program to use.
I would like to render an animation as a series of .png images with transparent backgrounds for use in a video. Is this possible?
I wanted to enable the hadware acceleration of the chromium browser and therefore followed . At first it didn't work, but then I discovered a comment in the comment section which suggested to use the command LIBVA_DRIVER_NAME=i965 chromium-browser to start the chromium browser via terminal with hardware acceleration enabled and it worked! Then I thought to create a new custom desktop file for chromium to include this prefix automatically. I copied the existing dekstop file from /usr/share/applications to /home/myUser/.local/share/applications. Then I edited the desktop file and infront of every Exec Keyword I added LIBVA_DRIVER_NAME=i965. The resulting .dekstop file looks so now: [Desktop Entry] Version=1.0 Name=Chromium Web Browser Name[ast]=Restolador web Chromium ... Exec=LIBVA_DRIVER_NAME=i965 chromium-browser %U Terminal=false X-MultipleArgs=false Type=Application Icon=chromium-browser Categories=Network;WebBrowser; MimeType=text/html;text/xml;application/xhtml_xml;x-scheme-handler/http;x-scheme-handler/https; StartupNotify=true Actions=NewWindow;Incognito;TempProfile X-AppInstall-Package=chromium-browser [Desktop Action NewWindow] Name=Open a New Window Name[ast]=Abrir una Ventana Nueva Name[bg]=Отваряне на Нов прозорец ... Exec=LIBVA_DRIVER_NAME=i965 chromium-browser [Desktop Action Incognito] Name=Open a New Window in incognito mode ... Exec=LIBVA_DRIVER_NAME=i965 chromium-browser --incognito [Desktop Action TempProfile] Name=Open a New Window with a temporary profile Name[ast]=Abrir una ventana nueva con perfil temporal Name[bg]=Отваряне на Нов прозорец с временен профил ... Exec=LIBVA_DRIVER_NAME=i965 chromium-browser --temp-profile But now chromium browser is not found anymore by the launcher, so it seems like my .desktop file is somehow wrong. Can somebody explain to me what the problem could be here? PS: I'm using Ubuntu 20.04.
I'm trying to modify my Firefox shortcut in Unity so that it started with a specific parameter. From a terminal, I would start like this: VDPAU_DRIVER=va_gl firefox I tried modifying the firefox.desktop file so that the Exec line looked like Exec=VDPAU_DRIVER=va_gl firefox But this doesn't work (the application doesn't start). I thought it could be a problem with two "=" signs, so I tried Exec="VDPAU_DRIVER=va_gl firefox" but this doesn't work either. What should I do?
I am a completely new to Ubuntu & Linux. I would like to install a PC game, so I understand that I need to use Wine. Also I have the PC game as an .iso file which I assume will need another application to run... I downloaded Wine 1.8 "from source" from . I don't really know if it's installed, or if it even needs to be installed. Afterwards I found this link , which mentions you can download wine from the Software Centre. I'd like to install it from the Software Centre now because I don't know what to do with the files I have from Winehq (not to mention binary packages???). But I am worried that what I already downloaded needs to be removed first. Is this the case??
I am looking for a step by step instruction to guide me in the ways of installing, configuring and debugging many of the issues new users have when dealing with Wine in Ubuntu. What is the recommended way of installing Wine, some of the key issues that it has and how to solve them? If I have a specific problem with an App in Wine, how do I go about solving it? What are the recommended steps to ensure that I can fix a problem related to an app I wish to use?
My iPad keeps ringing when I get a call on my iPhone. I have disabled FaceTime and Messages, but it still doesn't work.
Similar to , but my iPad is ringing, not my Mac.
I upgraded my old (Squeeze) server, but still the vulnerability seems to be there: $ env x='() { :;}; echo vulnerable' bash -c 'echo hello' vulnerable hello How do I upgrade Bash to a newer version on Debian 6.0 (Squeeze)?
We are running Debian Etch, Lenny and Squeeze because upgrades have never been done in this shop; we have over 150 systems running various Debian versions. In light of the "shell shock" of this week, I assume I need to upgrade bash. I do not know Debian so I am concerned. Can I merely execute apt-get install bash on all of my Debian systems and get the correct Bash package while my repository is pointed at a Squeeze entry. If not, what other course of action do I have?
I've taken the regular expressions from a website some time ago, and now I'm trying to fix some issues but I'm terrible with regular expressions, I'm just learning, any help would be appreciated. What am I doing wrong here? function validateEmail(email) { var reg1 = /^([a-zA-Z0-9])+\@([a-zA-Z0-9])+\.+([a-zA-Z0-9])+$/; // [email protected] var reg2 = /^([a-zA-Z0-9])+\@([a-zA-Z0-9])+\.+([a-zA-Z0-9])+\.+([a-zA-Z0-9])+$/; // [email protected] var reg3 = /^([a-zA-Z0-9])+\@([a-zA-Z0-9])+\.+([a-zA-Z0-9])+$/; // [email protected] var reg4 = /^([a-zA-Z0-9])+\.+@([a-zA-Z0-9])+\.+([a-zA-Z0-9])+\.+([a-zA-Z0-9])+$/; // [email protected] return reg1.test(email) || reg2.test(email) || reg3.test(email) || reg4.test(email) } I need to accept mails in this formats: [email protected] [email protected] [email protected] [email protected] reg1 and reg2 are working, reg3 and reg4 are not working. Last edit: I've tried to fix it like this, didn't work properly neither: function validateEmail(email) { var reg1 = /^([a-zA-Z0-9])+\@([a-zA-Z0-9])+\.+([a-zA-Z0-9])+$/; // [email protected] var reg2 = /^([a-zA-Z0-9])+\@([a-zA-Z0-9])+\.+([a-zA-Z0-9])+\.+([a-zA-Z0-9])+$/; // [email protected] var reg3 = /^([a-zA-Z0-9])+\.+([a-zA-Z0-9])+\@([a-zA-Z0-9])+\.+([a-zA-Z0-9])+\.+([a-zA-Z0-9])+$/; // [email protected] var reg4 = /^([a-zA-Z0-9])+\.+([a-zA-Z0-9])+\@([a-zA-Z0-9])+\.+([a-zA-Z0-9])+$/; // [email protected] return reg1.test(email) || reg2.test(email) || reg3.test(email) || reg4.test(email) }
Over the years I have slowly developed a that validates MOST email addresses correctly, assuming they don't use an IP address as the server part. I use it in several PHP programs, and it works most of the time. However, from time to time I get contacted by someone that is having trouble with a site that uses it, and I end up having to make some adjustment (most recently I realized that I wasn't allowing 4-character TLDs). What is the best regular expression you have or have seen for validating emails? I've seen several solutions that use functions that use several shorter expressions, but I'd rather have one long complex expression in a simple function instead of several short expression in a more complex function.