body1
stringlengths 20
4.1k
| body2
stringlengths 23
4.09k
|
---|---|
I can't seem to find any way to get to the chest. | I understand that the trick would be to pass over the eggs and use anti-grav potions but i have no idea how to jump. |
Stars create heavy elements up to iron during their lifetimes, and heavier elements beyond iron during supernova events. Are there any processes which create new hydrogen? If not, will all (or most) of the hydrogen in the universe eventually be turned into heavier forms by stars? | I recently became really interested in learning about physics and cosmology, but I still know very little. Hopefully someone with more knowledge will be able to shed some light on my questions. Here are my presumptions (please correct me if I'm mistaken): $t_{0}$: Big Bang. The Universe expands (and thus cools) sufficiently to allow the formation of atoms. The early Universe mostly consists of Hydrogen and is not uniform in its geometry. Gravity pushes lumps of matter together until their density (temperature) is so high that nuclear fusion kicks off. The first giant stars are born. Some heavy elements are created in these stars and when they explode, sufficient temperatures are reached to form heavier elements still. All of the successive stars and planets are the product of these original stars. My questions: If the amount of Hydrogen is finite in the Universe and each successive generation of stars use up most of their Hydrogen, what is the theoretical maximum number of generations of stars that our Universe can support? A ballpark figure in terms of years is fine too. ;) Are there some special physical processes that occur in the Universe on a large enough scale that are able to break up heavy elements (i.e., Helium) into lighter elements (i.e., Hydrogen)? Kind of like a cosmic recycling operation. If we discount the possibility of a Big Crunch, is the Universe pretty much headed into a time when there will be no more stars and only a bunch of black holes, planets, and other debris? |
I am curious about the ability for a lens to start a fire without using sunlight. Is it possible for alternative light sources (LED, incandescent, etc.) in combination with a very large Fresnel to start a fire? Or more appropriately how much energy could a very large Fresnel lens concentrate into one point using everyday light sources? In considering different types of light sources, which would be best for generating the most heat? Luminous efficacy and the size of the light source seem the most obvious but how would the color of the light affect the lens' ability to generate heat? Will a high focal length and large aperture lens (such as a giant spot Fresnel) even be able to focus the amount of light sources necessary into a small enough point to generate enough heat? | I have a cylindrical lens & a surface that can be burned.( for example wood , sheet ,...) In a sunny day , I wanna burn the surface but I don't know the "Energy for burning surfaces" If the $Power$ of sun is $1400 W/m^2$ , could you tell me how can I burn them? |
How can the orbit of Jupiter's moons be used to calculate the speed of light? It seems this was one of the first methods and goes back to 1656. | I am interested in the practical method and I like to discover if it is cheap enough to be done as an experiment in a high school. |
Simple, possibly stupid question, but here it is. So I know $$\nabla \cdot\vec E = \frac{\rho}{\epsilon_0},$$ but how do I use a given charge density to calculate an electric field? I guess the root of my question is about the mathematical procedure of "undoing" the div operator. | This question is a sequel of sorts to my about . In the paper, the authors performed molecular dynamics (MD) simulations of parallel-plate supercapacitors, in which liquid resides between the parallel-plate electrodes. The system has a "slab" geometry, so the authors are only interested in variations of the liquid structure along the $z$ direction. In my previous question, I asked about how particle number density is computed. In this question, I would like to ask about how the electric potential is computed, given the charge density distribution. Recall that in CGS (Gaussian) units, the Poisson equation is $$\nabla^2 \Phi = -4\pi \rho$$ where $\Phi$ is the electric potential and $\rho$ is the charge density. So the charge density $\rho$ is proportional to the Laplacian of the potential. Now suppose I want to find the potential $\Phi(z)$ along $z$, by integrating the Poisson equation. How can I do this? In the paper, on page 254, the authors write down the average charge density $\bar{\rho}_{\alpha}(z)$ at $z$: $$\bar{\rho}_{\alpha}(z) = A_0^{-1} \int_{-x_0}^{x_0} \int_{-y_0}^{y_0} dx^{\prime} \; dy^{\prime} \; \rho_{\alpha}(x^{\prime}, y^{\prime}, z)$$ where $\rho_{\alpha}(x, y, z)$ is the local charge density arising from the atomic charge distribution of ionic species $\alpha$, $\bar{\rho}_{\alpha}(z)$ is the average charge density at $z$ obtained by averaging $\rho_{\alpha}(x, y, z)$ over $x$ and $y$, and $\sum_{\alpha}$ denotes sum over ionic species. The authors then integrate the Poisson equation to obtain $\Phi(z)$: $$\Phi(z) = -4\pi \sum_{\alpha} \int_{-z_0}^z (z - z^{\prime}) \bar{\rho}_{\alpha}(z^{\prime}) \; dz^{\prime} \; \; \; \; \textbf{(eq. 2)}$$ My question is, how do I "integrate the Poisson equation" to obtain equation (2)? How do I go from $\nabla^2 \Phi = -4\pi \rho$ to equation (2)? In paricular, where does the $(z - z^{\prime})$ factor come from? Thanks for your time. |
import numpy as np class MyClass: a = int() b = float() c = np.array([0 for i in range 10]) def Memberfunction(): print("Hii") | I've read that it is possible to add a method to an existing object (i.e., not in the class definition) in Python. I understand that it's not always good to do so. But how might one do this? |
I have been trying to render a thumbnail for a Roblox game. I have everything ready I just need to render it. When I try to render the final product It only shows the terrain and not the actual people. I think something is wrong with the camera. Not sure though. | This is meant to solve this problem once and for all. What is every reason an object isn't showing up in a render or viewport in when using the cycles render engine? |
why doesn't the text get centered? it becomes on the right edge what should i change? .text4 { width: 762px; height: 714px; font-size: 24px; line-height: 40px; color: #273d46; font-family: "Times New Roman"; text-align: center; } <div class="text4"> Donec aredsed odio dui. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Donec ullamcorper nulla non metus auctor fringilla. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. </div> | How can I horizontally center a <div> within another <div> using CSS? <div id="outer"> <div id="inner">Foo foo</div> </div> |
How to find the formula for the sum of fractions like this? $$\frac{1}{1\times 2}+\frac{1}{2\times 3}+\ldots+\frac{1}{n\times (n+1)}=$$ | How can I find the formula for the following equation? $$\frac{1}{1\cdot 2}+\frac{1}{2\cdot 3}+\frac{1}{3\cdot 4}+\cdots +\frac{1}{n(n+1)}$$ More importantly, how would you approach finding the formula? I have found that every time, the denominator number seems to go up by $n+2$, but that's about as far as I have been able to get: $\frac12 + \frac16 + \frac1{12} + \frac1{20} + \frac1{30}...$ the denominator increases by $4,6,8,10,12,\ldots$ etc. So how should I approach finding the formula? Thanks! |
I've just installed Xubuntu for the first time and am trying to set up a wireless connection, configuring the connection in Terminal, as I can't see the network icon in the desktop. I want to configure a wlan0 connection but unsure how to do this. When I run a ifconfig, I get this: 06:05.0 Network controller [0280]: Broadcom Limited BCM4318 [AirForce One 54g] 802.11g Wireless LAN Controller [14e4:4318] (rev 02) Subsystem: AMBIT Microsystem Corp. TravelMate 2410 [1468:0312] Kernel driver in use: b43-pci-bridge Kernel modules: ssb lan@alan-TravelMate-2420:~$ lspci -knn | grep Net -A3; rfkill list 06:05.0 Network controller [0280]: Broadcom Limited BCM4318 [AirForce One 54g] 802.11g Wireless LAN Controller [14e4:4318] (rev 02) Subsystem: AMBIT Microsystem Corp. TravelMate 2410 [1468:0312] Kernel modules: ssb, wl 06:07.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL-8100/8101L/8139 PCI Fast Ethernet Adapter [10ec:8139] (rev 10) 0: acer-wireless: Wireless LAN Soft blocked: no Hard blocked: no I managed to sort the wlan0 out but now i get the error ""Set Encode" (8B2A)". After research online, I dont think you can connect to a WPA/WPA2 network by using the iwconfig. alan@alan-TravelMate-2420:~$ iwconfig lo no wireless extensions. wlan0 IEEE 802.11 ESSID:"VM1579855" Mode:Managed Access Point: Not-Associated Tx-Power=20 dBm Retry short limit:7 RTS thr:off Fragment thr:off Power Management:off enp6s7 no wireless extensions. alan@alan-TravelMate-2420:~$ sudo iwconfig wlan0 key s:password [sudo] password for alan: Error for wireless request "Set Encode" (8B2A) : SET failed on device wlan0 ; Invalid argument. Thanks all in advance :) | I'm having serious problems installing the Broadcom drivers for Ubuntu. It worked perfectly on my previous version, but now, it is impossible. What are the steps to install Broadcom wireless drivers for a BCM43xx card? I'm a user with no advance knowledge in Linux, so I would need clear explanations on how to make, compile, etc. lspci -vnn | grep Network showed: Broadcom Corporation BCM4322 802.11a/b/g/n Wireless LAN Controller [14e4:432b] iwconfig showed: lo no wireless extensions. eth0 no wireless extensions. NOTE: Answer below is updated every time new information is added and confirmed working. |
Suppose we have a material point. If it is moving from position $X_0$ with initial velocity $V_0$ and constant acceleration $A$, then from elementary physics course I remember that its movement is described by the equation $$X(t) = X_0 + V_0t + At^2/2.$$ Now, my question is, what is the equation of the movement of the material point if its acceleration is an arbitrary function of $t$: $A(t)$. Is it simply: $$X(t) = X_0 + V_0t + A(t)t^2/2,$$ or is it more complicated than that? From the looks of $At^2/2$ I have a suspicion that integrals may be involved. | I have a background in calculus but don't really know anything about physics. Forgive me if this is a really basic question. The equation for distance of an accelerating object with constant acceleration is: $$d=ut +\frac{1}{2}at^2$$ which can also be expressed $$d=\frac{\mathrm{d}x}{\mathrm{d}t}t+\frac{\mathrm{d^2}x}{\mathrm{d}t^2}\frac{t^2}{2}$$ (where x(t) is the position of the object at time t) That's fine for a canonball or something like that, but what about a car accelerating from 0 to cruising speed? The acceleration is obviously not constant, but what about the change in acceleration? Is it constant? I suspect not. And then what about the change in the change of acceleration, etc. etc.? In other words, how does one know how many additional terms to add in the series? $$d=\frac{\mathrm{d}x}{\mathrm{d}t}t+\frac{\mathrm{d^2}x}{\mathrm{d}t^2}\frac{t^2}{2}+\frac{\mathrm{d^3}x}{\mathrm{d}t^3}\frac{t^3}{3}+\frac{\mathrm{d^4}x}{\mathrm{d}t^4}\frac{t^4}{4}\cdot etc. \cdot ?$$ |
Assume a simple class: class MyClass(object): pass . . . m = MyClass print type(m) # gets: <type 'classobj'> # if m is classobj, how can i check a variable is class object? My question is: how can i check a variable is a class object? a simple solution: if str(type(m)) == "<type 'classobj'>": # do something But i think there is at least one classic way to check that. | I was wondering how to check whether a variable is a class (not an instance!) or not. I've tried to use the function isinstance(object, class_or_type_or_tuple) to do this, but I don't know what type would a class will have. For example, in the following code class Foo: pass isinstance(Foo, **???**) # i want to make this return True. I tried to substitute "class" with ???, but I realized that class is a keyword in python. |
For external packages CTAN provides the needed documentation, however, for built-in Latex commands I am not aware of any proper documentation except for which doesn't really list all the options I would like to know how I could check all the available environments, commands and relative optional fields of all the built-in commands of Latex more or less like I would use the man command under linux. I'm looking for something exhaustive like the documentation that breaks down every single piece available. | I can't find official documentation for the \@startsection command. I already looked in: LaTeX Wikibook LaTeX: Structured document for TEX, 2008 beginLatex — a book that comes with ProTeX in the files that comes with MikTeX in the folder doc and Google. I found a lot of sites that show examples and discussions about it but I'd like to find the official help or document. |
I cannot boot into fedora. Boot is stucked on: A start job is running for File System Check on /dev/disk/by-uuid/... I let it be for about 4 hours but nothing happened. But with flag fastboot it boots normally. The uuid of disk is correct in fstab file. Any ideas ? SOLVED there | I have problem with my Fedora disto. Boot is stucked on system check on disk by UUID... I discovered that it is EFI partition and I tried to reconfigure grub2 but there are inffinite Input Outpur errors(see ) in Microsoft folder (yes, I have dual boot but each system on different disk). During my investigation I completely broke Windows so I want to delete Microsoft folder - fix Fedora and reinstall Windows. BUT when I try to delete the folder (sudo rm -rf... - also from Live CD with partition booted with RW permissions) it says that it is Read Only file system. What am I doing wrong ? |
I set up my und my webserver but I'm facing the problem that the website cannot be opened from the internet. I'm using Ubuntu server 12.04 with Apache 2.2 (I believe). This is what I checked so far: http://localhost/ responds with my website Firewall: port 80 open for incoming and outgoing traffic ports.conf -> listen 80 Virtual host in httpd.conf is configured Port forwarding is enabled in the router configurations When the firewall is disabled and I ping the domain, I get my external IP doesn't see open port 80 ISP doesn't seem to block incoming traffic on port 80 Domain name is linked to my IP Still, no connection to the server can be established. What did I forget? | I am new to apache2. I have an ubuntu 12.04.4 LTS machine in my home, and just installed apache2 on it. I wanted to set up a webserver running on a port other than port 80 (my router uses port 80). Here's what I did: Changed some lines at the beginning of /etc/apache2/ports.conf from NameVirtualHost *:80 Listen 80 to NameVirtualHost *:8041 Listen 8041 Changed the first line of /etc/apache2/sites-available/default from <VirtualHost *:80> to <VirtualHost *:8041> Restarted apache2 My ubuntu machine has local IP address 192.168.1.133, and from any computer on my home intranet if I point a web browser to http://192.168.1.133:8041 then I get the standard apache2 "It works!" web page. I also set up my router to port forward any incoming TCP packets on port 8041 to the ubuntu machine (still on port 8041). Let's say my ISP has given me the IP address 123.456.78.90. If I am outside my intranet and I point a web browser to http://123.456.78.90:8041 then again it works. However, within my intranet (on the ubuntu machine itself or on other machines on the intranet), when I point a web browser to http://123.456.78.90:8041 I get an "unable to connect" error. Where do I go from here? I am now unclear about whether this is an issue with my apache set-up or my router. I have now unfortunately realised though that it is probably not a question about Ubuntu :-/ |
When discussing with my children Newton's laws (high school level), I told them (long story short) that one can imagine that since a body on which all forces balance move straight and at constant speed, one can imagine that not moving at constant speed implies (or is linked to) the fact that there is a net force. And that this relationship is linear, and that the coefficient is the mass. And that this is magical. I then started to wonder why the relationship is linear the coefficient is the mass of the object Are there fundamental reasons for the relationship to be exactly $F = m \times \dot v$, with $m$ being simply the mass? What I am trying to say that this could have been $F = m^{1.346} \times \dot v^{0.6547} + 10^{-11}$ (obviously made up example for a non proportional relation, with a tiny loose end, and a less nice coefficient) | If you consider as laws, then there must be independent definitions of and but I don't think there's such definitions. If you consider them as definitions, then why are they still called laws? |
Is there some way I can use MS Word with the TeX formulas? On I've learned the syntax $\frac{\partial u}{\partial x}$ etc.. But I do not know how to create a LaTeX document. Is there some way I can use this syntax in MS Word? | Let's say I have a (comparatively) lovely-looking document in LaTeX, full of lovingly typeset, (relatively) complex equations. Now, let's say some barbarians come along one day and decide that the document has to be put into Microsoft Word (2007). ...after the usual mourning period associated with such events, let's say I value my job (more specifically, the bread it provides) enough to get all the text and tables formatted and references organised into the Word document. –...related questions and – Now I'm looking at the equations with fear and dread. One option of course is to just lift screenshots from the original document, but this is painstaking if I need to refer to parts of the equation in the text. Also, I might need to edit equations on the fly. Anyone know of a free application which allows embedding LaTeX math into MS Word? I've looked at and which do roughly what I want... they build LaTeX images from source and embed them into the Word document, allowing to edit the source later... but both are commerical. ...any help in these troubling times will be greatly appreciated. EDIT: Just a note that offers a 30-day free trial and is working out really nicely... but still, it's not free. Might be a good solution for those with short-term needs, or money. |
SO's Google code prettify on python wrongly handles // (floor division) as a C-style comment, , even when the question is tagged . Here is a more recent example from : a[:len(a)//3*3] | I noticed that sometimes my code gets highlighted in different colors when rendered. What is syntax highlighting? How does it work? Why isn't my code being highlighted correctly? How do I report a bug or request a new language? How do I use syntax highlighting? What languages are currently available on Stack Exchange? |
When introducing the concept of continuous random variables, my textbook states the following: If $X$ is a continuous random variable, then $P(a \le X \le b) = P(a < X \le b) = P(a \le X < b) = P(a < X < b)$. However, it does not give a justification for why this is true. I would greatly appreciate it if people could please take the time to explain why this is true. | My understanding is that a random variable is actually a function $X: \Omega \to T$, where $\Omega$ is the sample space of some random experiment and $T$ is the set from which the possible values of the random variable are taken. Regarding the set of values that the random variable can actually take, it is the image of the function $X$. If the image is finite, then $X$ must be a discrete random variable. However, if it is an infinite set, then $X$ may or may not be a continuous random variable. Whether it is depends on whether the image is countable or not. If it is countable, then $X$ is a discrete random variable; whereas if it is not, then $X$ is continuous. Assuming that my understanding is correct, why does the fact that the image is uncountable imply that $Pr(X = x) = 0$. I would have thought that the fact that the image is infinite, regardless of whether it is countable or not, would already imply that $Pr(X = x) = 0$ since if it is infinite, then the domain $\Omega$ must also be infinite, and therefore $$Pr(X = x) = \frac{\text{# favorable outcomes}}{\text{# possible outcomes}} = \frac{\text{# outcomes of the experiment where X = x}}{|\Omega|} = \frac{\text{# outcomes of the experiment where X = x}}{\infty} = 0$$ What is wrong with my argument? Why does the probability that a continuous random variable takes on a specific value actually equal zero? |
Let $X,Y$ be metric spaces. Suppose that there is a mapping $f:X\to Y$ which is bijective and continuous. Suppose that there is a mapping $g:Y\to X$ which is bijective and continuous. Then, are $X$ and $Y$ homeomorphic? | I happen to found about finding two metric spaces $X$ and $Y$ such that there exists bijective continuous functions $f:X\to Y$ and $g:Y\to X$, and $X$ and $Y$ are not homeomorphic. I could not produce my own example, and I think the reason is that I am thinking of manifolds only. Suppose we have two second-countable Hausdorff metrisable manifolds $X$ and $Y$ such that there exists bijective continuous functions $f:X\to Y$ and $g:Y\to X$. Can we show that the two manifolds are homeomorphic? Or is there still a counterexample? Please note that I have taken only one course on metric space and topology, and I don't have much experience with manifolds. So please explain answers in details or post references to the details. Edit: In case of any ambiguity, I would like to state that I do not restrict attention to manifolds without boundary, i.e. the manifolds may have boundary, if such a counterexample exists. |
I want to set an optimum value for MaxClient in apache for my production server. What are the parameters that I should consider while calculating this value ? | This is a about capacity planning for web sites. Related: What are some recommended tools and methods of capacity planning for web sites and web-applications? Please feel free to describe different tools and techniques for different web-servers, frameworks, etc., as well as best-practices that apply to web servers in general. |
I am new to server administering and learning and I have an old dell server with windows server 2008 standard installed. I almost forgot the password for the admininstrator account so I went in and changed it from the control panel user section. Now after reboot the administrator button vanished. It was the only administrator account. What happened and how do I log in as admin now? Ive looked and cannot see anybody with this same issue on searching. I logged on to a normal user account and looked at properties of the user groups and I see the Adminstrator account there and it doesnt say its disabled. It just doesnt want to show on login screen for some reason. | I accidentally disabled my admin account. After I login to another account I found I can not get admin rights, because all admin accounts on my computer are disabled. I clicked on 'run as administrator' but only see a smart card choice (all the admin accounts are disabled so no choice provided) I don't want to re-install my OS, help! Details: I have account A on my computer. I got a new computer so I want to give the old one to my mother. Creating a new user account B for her and disable account A. Logout and restart. Successfully login B, now I found I could not get admin rights because no account choice is provided. More informations about my machine: OS is Windows 10 and my admin account is a Microsoft Account. I have an arch-linux installed on my computer and dual-boot it using GRUB, so maybe I can not use safe mode. |
What is the effect of changing the Aperture on the quality of the image? | How does aperture affect my photographs? Why should I care about the aperture with which a photo was taken? |
Is there any difference when we declare our methods within a class class Foo { ... doSomething(){ ... } } or directly to the class prototype? class Foo { ... } Foo.prototype.doSomething = function(){ ... } | I'm not that into dynamic programming languages but I've written my fair share of JavaScript code. I never really got my head around this prototype-based programming, does any one know how this works? var obj = new Object(); obj.prototype.test = function() { alert('Hello?'); }; var obj2 = new obj(); obj2.test(); I remember a lot discussion I had with people a while back (I'm not exactly sure what I'm doing) but as I understand it, there's no concept of a class. It's just an object, and instances of those objects are clones of the original, right? But what is the exact purpose of this ".prototype" property in JavaScript? How does it relate to instantiating objects? Update: correct way var obj = new Object(); // not a functional object obj.prototype.test = function() { alert('Hello?'); }; // this is wrong! function MyObject() {} // a first class functional object MyObject.prototype.test = function() { alert('OK'); } // OK Also these really helped a lot. |
I am developing an app that downloads an XML file, parses it and then displays the information on the screen. I get a NullPointerException Exception error in the following code: here is the code: private class DownloadXmlTask extends AsyncTask<String, Void, List<vehicleInfo>> { @Override protected List<vehicleInfo> doInBackground(String... url) { try { return getvehicles.processBusTime(); } catch (IOException e) { return null; } catch (XmlPullParserException e) { return null; } } @Override protected void onPostExecute(List<vehicleInfo> result) { for (int record = 0; record < result.size(); record++) { double latitude = result.get(record).latitude; double longitude = result.get(record).longitude; mMap.addMarker(new MarkerOptions().position(new LatLng(latitude, longitude)).title("Marker")); } } } it is returns a NullPointerException at the line: for (int record = 0; record < result.size(); record++) { what could be the issue? thanks. | What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them? What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely? |
I've been using rsync to backup my "main" hdd quite successfully with the following command rsync -aivr --delete --progress /src/my-files/ /dest/my-files But I carry my external drive on the go and I might modify files on it. The above command would wipe out those changes. I can't just swap src and dest either because I may have changes on both drive that I want to preserve. The behavior I want is something like this... # rsync walks the src drive # if a file is present in src that is not present in dest, then copy the file to dest # if a file is present both in src and in dest, then compare modification times # and overwrite using the later one. # if a file is present on dest but is not on src, then copy the file from dest to src. Could I use rsync to get the above behavior? | I am trying to setup bi-direction or two way sync with rsync. In my case I only need to delete the files when syncing from B to A. So, I was thinking of running rsync twice as follow : rsync -rtuv ./A/ ./B/ rsync -rtuv --delete ./B/ ./A/ This problem with this solution is that when I run rsync (B->A) which would be right after running the rsync (A-B), Any new file that get created in between the sync will also get removed. Is there a way I can specify a time stamp as condition that it only delete the file if it created before this date/time. Updated: I understand there is a unison solution but the problem with unison is required to install on both ends. I am syncing with a remote server and I can not install unison on the remote end. |
Given the right half plane $H = \{z \mid \operatorname{Re} z>0\}$, how can I find all the Möbius transformations that preserves $H$? I can't go very far by my own. | Show Möbius transformation which maps $\Im(z)>0$ to itself iff $$ f(z)= \frac{az+b}{cz+d}\,,\,\,ad-bc>0$$ and $a,b,c,d$ are real. |
From the moment that I used your OS I have become a fan. Fan of it's simplicity and beauty, but I worry about the creators. Creating something that is so simple and easy to use plus a beautiful OS requires a lot of money. Your OS is just like the Mac it is so simple to use, but unlike them you gave it for free. I would suggest that you sort of copy apple. Make your own app store that way you'll earn money plus developers would be easily be able to make money too. Second you can sell music videos books and magazines so that it could generate income just like Android. As a Windows 8 user I find it easy to navigate to your OS. Make the apps upgradable. And I like how your OS design language fits perfectly on smartphones, tablets and TVs. I can't donate because I don't know how to use Paypal, but I think that this might help you. Try copying what Apple and Android has done, and combine it in a way that it will attract developers and users but at the same time you could earn money. Thanks and one more thing please while developers are busy creating they're apps please create exclusive apps of your own. | We get various distros like kubuntu/ubuntu/lubuntu/edu/etc... for free. We get critical updates constantly. We can download any programs we want from Ubuntu repos. Gee, I can't even imagine what kind of a CDN network you gotta have to support all this. Also, Ubuntu has a lot of people working for them: Can someone explain how this is possible financially? |
How would you you show that $2^{32}+1$ is divisible by $641$ without making large calculations? | How can I show that $F_{5}=2^{2^5}+1$ is divisible by $641$. |
It seems to me, there are two broad categories of questions: (1) from people who use a programming language at their work place, and (2) from people who just started to learn using it. Almost everyone in the community seems to understand, based on the quality of the question, to answer the latter by initiating some thought and not just giving the solution. I think, SO can do more to facilitate this. I am thinking about a special tag "beginner". Ideally, the actual accepted answer should not be revealed for questions tagged with such tags until clicked. Do you think this would make sense? Maybe some other ideas? | See the revision history on , where the tag was edited in (and subsequently edited out after I started this discussion). I think, by adding this tag, you're making assumptions about the OP which they could find a little bit offensive. Particularly with this question, there's no mention of the level of PHP knowledge — it's more a math question than it is a programming question. Someone could be excellent at a particular language whilst not being particularly great at math, so isn't it a bit insulting to make the assumption they're a beginner? It's also interesting to note tag, which currently stands at 7,784 on SO. Compare this to , which only has 18 questions, most of them being "discussiony." Why do users retag questions as "beginner" but not "expert"? UPDATE, , . Related (thanks @Ralph) |
I would like to bring in terms (just parents) from one taxonomy vocabulary to use as options in a form but I can't seem to pull them in. I thought taxonomy_vocabulary_machine_name_load would work but I can't seem to get the terms to show up. $topic_options = array(); $name = 'web_topics'; $myvoc = taxonomy_vocabulary_machine_name_load() as $name => $vocabulary; $tree = taxonomy_get_tree($myvoc->vid); foreach ($tree as $term) { $topic_options[$name] = $vocabulary->name; } | How can I get the terms of a vocabulary using vocabulary machine name. I have used the following code, although it works for me but I am looking for efficient methods. $vocabulary = taxonomy_vocabulary_machine_name_load('school_courses'); $terms = taxonomy_get_tree($vocabulary->vid); $courses = array(); foreach($terms as $term) { $courses[$term->tid] = $term->name; } |
I am currently using Apache mod_rewrite to redirect to HTTPS, but I would like to remove the body from the response. How it is currently: Example: How I would like it to be My redirect configuration: <IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] </IfModule> | We have noticed that when using nginx internal 301 and 302 handling, nginx will serve a small document body with the appropriate Location: ... header. Something along the lines of (in html): 301 redirect - nginx. As appropriate in the above behaviour, a content-type text/html and content-length header is also sent. We do a lot of 302 and some 301 redirects, the above behaviour is wasted bandwidth in our opinion. Any way to disable this behaviour? One idea that crossed our mind was to set error_page 301 302 to an empty text file. We have not tested this yet, but I am assuming even with the above, the content-type and content-length (0) headers will be sent. So, is there a clean way to send a "body-less" 301/302 redirect with nginx? |
I want to install ubuntu alongside windows 10 but my laptop specifications are: 2G RAM, 300G HHD, 2.16 GHz dual processor. Could that work!? Because my computer is somewhat limited on resources! I winder if that couldn't affect the performance. | I am going to install Ubuntu to dual boot with Windows 8 soon, but one of my friends warned me that partitioning my hard drive will slow my computer down. I run on a 500GB HDD and 8GB of ram if that helps at all. Is that true if I do it? |
I'm trying to match only {n} digits not more or less and may be surrounded by characters or special symbols example: suppose the {n} = {14} *12345678901234*300 OK 12345678901234x21 OK *123456789012345*300 NOT OK 12345678901234 OK 123456789012345 NOT OK | I don't really understand regular expressions. Can you explain them to me in an easy-to-follow manner? If there are any online tools or books, could you also link to them? |
Let me explain. For example, you have a site, site.com, and on the domain provider service, you decide you want to have your own nameservers, and enter the new addresses. You decide to let these nameservers have domain names, ns.site.com. Now what happens if a client wants to resolve my.site.com, as far as i understand it, it (client and/or recursive DNS servers) will ask for authority for the second level domain record of site.com, pick the NS name from it, and resolve that to contact it. Now we have set the nameserver to ns.site.com, which lays in it's own domain... wait, that's recursive. This is exactly what I think could be a problem, how is it solved in the real world? Does/did this ever happen? | This is a about DNS glue records. What exactly (but briefly) is a DNS glue record? Why are they needed and how do they work? |
What about allowing things like [Edit this question][edit] [What's on topic?][help/on-topic] [The proposal site][a51] So they look like To reduce answers' and comments' (raw) length. Oh, there's another thing. Can we have the text auto-generated so that we don't have to write [Allow custom text for magic links](https://meta.stackexchange.com/questions/296051/allow-custom-text-for-magic-links) but simply [/q/296051]? That'd be convenient (especially in comments)! | The are awesome. How much more awesome would it be to be able to make a comment linking to one of the URLs covered by a magic link, but with custom text? Since the square-bracket link type isn't included in the mini-markdown used for comments, it could be stolen for this purpose. Comment text like Please [add that information][edit] to the body of your post rather than using comments. or Please [include the shortest possible amount of code that demonstrates the problem you see][mcve]. would convert to Please [add that information](http://{SITE}.stackexchange.com/posts/{ID}/edit) to the body of your post rather than using comments. and Please [include the shortest possible amount of code that demonstrates the problem you see](http://stackoverflow.com/help/mcve). for example. |
I want to block usb mass storage in some of the systems in the LAN. I have written a bash script which will modify the file. I am running the script as default admin in ubuntu. But the script is not able to modify the file. I am getting the following error "bash: /etc/modprobe.d/blacklist.conf: Permission denied" Below is my bash script #/bin/bash password='mypassword' #admin password of remote system val='blacklist usb-storage' #text which i want to add in the file for sysName in $(cat systemDetails) #systemDetails is file which stores do ssh $sysName 'echo '$password' | sudo -S echo '$val ' >> /etc/modprobe.d/blacklist.conf' echo done #script ends NOTE: I have configured my system such that no ssh password is required. Any pointers in this regard will be really helpful. | I've been given sudo access on one of our development RedHat linux boxes, and I seem to find myself quite often needing to redirect output to a location I don't normally have write access to. The trouble is, this contrived example doesn't work: sudo ls -hal /root/ > /root/test.out I just receive the response: -bash: /root/test.out: Permission denied How can I get this to work? |
I know how to split a window (dragging the window splitter widget in the top right or bottom left of a window), but how do I undo it? | I would like to close some view windows that I opened accidentally. See the image below: Edit: another note: I tried searching for the solution, but only found things like "Join Area", which don't seem to work in this situation. |
When I download HTML Help Workshop from Microsoft, the first part is a success, but after 2 boxes this appears: Error creating process C:\Users\AWAKE_~1\AppData\Local\Temp\IXP000.TIMP\setup.exe Reason: The requested operation requires elevation. What do I do to fix this and what caused it? By the way, I have a 64-bit operating system and a x64-based processor. Thanks! | I need to run a program as a different user + make it run with admin privileges (Run as administrator). I use the '' for running the program as a different user How can I run the program as admin with that command? (or a different one so will give me my requirements) EDIT : I need 2 things Run as a different user Run as admin - not just as the admin user but also with full permissions As this image |
A machine receives messages according to a Poisson process of rate $\lambda$ messages per second. If it does not receive a message for $\theta$ seconds, then it is programmed to stop functioning. Evaluate mean value $E(T)$ of the total time $T$ the machine is working. Attempt. If $N$ is the total amount of messages the machine receives while working, then for $N=n$, the time working is $T=W_1+\ldots+W_n+\theta$, where $W_i$ are the intermediate times between the arrivals of the $n$ messages (each of the exponential distibution, parameter $\lambda$). Somehow we should take into account that the intermediate times above are $<\theta$ and also that $W_{n+1}>\theta$, in order to evaluate $E(T|N=n)$ and then $E(T)=E(E(T|N))$. Thanks in advance for the help. | A pedestrian wishes to go across a single-lane road where the cars arrive according to a Poisson process with the rate λ. The time needed for him to cross the road safely is denoted as k. He will have to wait until he sees a gap of at least k between the coming cars. If the gap between the car that just arrived and the next one is at least k, he begins to cross the road. Let T denote the random time he needs to wait by the road. What is the expected time the pedestrian needs to cross this particular road? I've encountered several similar problems on here, but none of them gives a detailed, step-by-step explanation, so I am really confused. I would appreciate any help! Thank you in advance. |
I am not sure if this can be done but I am wondering if it is possible to specify the 'T' type of a generic at run time. I have an object that has been serialized and stored in the database. The type of the object has also been stored. So when the object is retrieved I have the serialized object stored in a string variable as it's type also stored in a string variable. What I want to be able to do is something like this: var serializer = new AbcSerializer(); var typeString = "Abc.Group.Common.Domain.DomainObject, Abc.Group.Common.Domain"; var serializedObject = "some serialized data here..."; var retObj = serializer.Deserialize<Type.GetType(typeString)>(serializedObject); Does someone know if this is possible? Other questions that are similar to this one talk about using MakeGenericType like this: Type constructed = d1.MakeGenericType(typeArgs); And then doing: object o = Activator.CreateInstance(constructed); to create an instance of that object. That is not what I am trying to do. I want to create an instance of my object from data that has been serialized. | The title is kind of obscure. What I want to know is if this is possible: string typeName = <read type name from somwhere>; Type myType = Type.GetType(typeName); MyGenericClass<myType> myGenericClass = new MyGenericClass<myType>(); Obviously, MyGenericClass is described as: public class MyGenericClass<T> Right now, the compiler complains that 'The type or namespace 'myType' could not be found." There has got to be a way to do this. |
Monster’s planet is Earth like planet from Monsters inc. their race is Mons. The monster went to Earth and scare the children. Every monster who growing, growing, and growing as well. In “History of the Monster World.” | In Pixar's Monsters films (Monsters Inc. & Monsters U), the Monsters living on an Earth-like planet that is clearly not Earth. Via their special doors, they're able to come to Earth. It's unclear to me though how their planet and Earth are related. Is the Monsters' planet in a parallel dimension? Is it elsewhere in the same universe? Is the Monsters' planet Earth in the far future ala Planet of the Apes? How are Earth and the Monsters' planet related/connected? |
I was wondering if ice is subject to the liquids rule. It is not a liquid, gel, aerosol, cream or paste. | Once I read a suggestion saying that frozen "liquids" are not subject to the 100 ml restriction of security checks in airports. I've found of this googling, but they all refer to TSA (I assume only hold in the US). Is it true then that it's possible to carry frozen fluids in your hand luggage, in larger quantities than 100 ml? |
There is a well-known proof of the fact that the prime gaps can be arbitrarily large. Namely, for any natural number $n$, the consecutive integers $(n+1)!+2,...,(n+1)!+(n+1)$ are never prime. But clearly, this proof does not guarantee that $(n+1)!+1$ and $(n+1)!+(n+2)$ are prime. How can we show that the prime gap can be exactly $n$ for any even $n$? | Is it true that for every even natural number $k$ there exists some $n \in \mathbb{N}$ such that $g_n = p_{n+1} - p_n = k$? I don't know how to approach the problem at all, and in fact I don't even know enough about prime gaps to even form a conjecture as to the answer. I feel like the answer is "yes", but only because that would be "nicer" than having some even integers never appear in sequence of prime gaps. I hope it's not an unsolved problem! Edit: My question is distinct from Polignac's Conjecture, since I ask if there is at least one prime gap, instead of infinitely many prime gaps, for every size. |
I'm Indian. Can I enter the Schengen area 5 days before my Czech visa expires? I have applied for extension, but I have not received a decision, so far. | I have a Vietnamese passport. I'm planning to visit Vietnam on July 7th and be back in the Czech Republic (in Schengen area) on August 29th. My visa is a multiple-entry, long-term, D type visa (for study purposes) and the expiration date is September 10th. I am afraid that the boarding officer will not allow me to enter EU since the arrival is so close to the expiration date. Is it OK for me to enter Schengen on August 29th when I have only 12 days left until visa expiration? |
I am setting up a script in bash that return some information about a specific dictionary (french for example). I want that this script supports some parameters (4 currently). The issue is how manage the parameters easily than via many conditions ? For the time being I am testing all the arguments of the script ($1, $2, ..) to be able to know which argument refers to which parameter # langstat.sh : give statistics on letter occurrences in a specific language # Usage : langstat.sh <dictionary> # -> Display the number of times each letter is used at least once in a word of <dictionary> # Usage : langstat.sh --percentage <dictionary> # -> Display the percentage of times each letter is used at least once in a word of <dictionary> # Usage : langstat.sh --word <word> <dictionary> # -> Return true if <word> is a word of <dictionary> # Usage : langstat.sh --all <dictionary> # -> Display the number of times each letter is used in <dictionary> # Usage : langstat.sh --alphabet <alphabet> <dictionary> # -> Display the number of times each letter is used at least once in a word of <dictionary> using <alphabet> as alphabet if [[ $# -lt 1 || $# -gt 5 ]] then echo "Usage : $0 [--percentage] [--all] [--alphabet <alphabet>] <dictionary>" echo "Usage : $0 --word <word> <dictionary>" exit fi ...... ...... ...... # Tests to understand how parameters are ordered if [ $# -eq 1 ] then elif [ $# -eq 2 ] then if [ $1 == "--percentage" ] then elif [ $1 == "--all" ] then fi elif [ $# -eq 3 ] then if [[ $1 == '--percentage' && $2 == '--all' || $1 == '--all' && $2 == '--percentage' ]] then elif [ $1 == '--alphabet' ] then elif [ $1 == '--word' ] then fi elif [ $# -eq 4 ] then if fi elif [ $# -eq 5 ] then if [[ $1 == '--percentage' && $2 == '--all' && $3 == '--alphabet' ]] then fi fi So my question is do you have some suggestions, maybe do you know any command, that permit to manage easier the parameters ? There are many conditions to test with 4 parameters then how people do when parameters are 10 or 20 ? | Say, I have a script that gets called with this line: ./myscript -vfd ./foo/bar/someFile -o /fizz/someOtherFile or this one: ./myscript -v -f -d -o /fizz/someOtherFile ./foo/bar/someFile What's the accepted way of parsing this such that in each case (or some combination of the two) $v, $f, and $d will all be set to true and $outFile will be equal to /fizz/someOtherFile? |
I'm sick of waiting for The Winds of Winter. Where should I start watching the show where I won't be too lost from the book differences and I won't have to watch a lot of stuff I've already read about? Or am I screwed and I should just watch them all? I just want to wade through the least amount of stuff I already know about from the books. | I've started reading George R. R. Martin's "A Song of Ice and Fire" book series, and I intend to watch HBO's television series based on it at some point. I wonder about two things: Should I start watching the series before having finished all the books? If so, which chapters should I have read? What is a good starting point? The point is obviously avoiding spoilers. |
I recently graduated from a university in Germany, and I would like to apply for a phD in UK. However, my university provides initial funding for me if I choose to do my phD in the university. I will apply for my dream schools in UK. However, there will be a one year gap and I have no idea how to use it to enhance my chance of getting admitted in this year. I would like to take the initial funding to work as a phD student in my home university, and quit it if I get admitted. If I wasn't admitted, I can stay in the same lab. Is it ethical to do this if I don't tell the supervisor of my home university before he accept me ? If I should tell him, how can I prevent hurting his feeling, and let him accept my proposal ? Thanks ! | I am an international student who has been admitted at a low ranked institute in the US. I also have an offer from an institute in my own country to do a Masters'. I ultimately want to get admitted at a prestigious program in the US. I was recently advised to join the low ranked US institute, do my course work well, establish contacts with professors at more prestigious schools, and then switch to a better school for a PhD. It sounds immoral to me. But I was told it is not immoral in practice as the institute receives thousands of offers to fill up the seat you will be vacating. Is doing the above seriously unethical? |
I've looked at a few of these types of posts but can't seem to find a concrete answer. I am investigating the relationship between 'risk aversion' and 'human capital' for a project. Risk aversion: Acceptable risk is used as a measurement and it takes a value between 10% and 100%, in increments of 10%. (I.E. 10 possible values where 10% = risk taker and 100% = risk averse). [DISCRETE] Human capital: Represents the present value of all future earnings and depends on a number of factors including age, salary and occupation. [CONTINUOUS] I performed a Pearson correlation between these two variables without really looking into the specifics too much. It finds a small negative correlation which is as expected. However, I have since then read that the Pearson correlation is only designed to measure the correlation between two continuous variables and so I don't think I can use this result. Am I correct in saying this and if so how can I test this relationship (including significance). | I'd like to estimate the correlation between: An ordinal variable: subjects are asked to rate their preference for 6 types of fruit on a 1-5 scale (ranging from very disgusting to very tasty) On average subjects use only 3 points of the scale. A continuous variable: the same subjects are asked to quickly identify these fruits, which results in an mean accuracy for the 6 fruits. Is Spearman rho the best method to analyze these data and/or are there other good methods I could consider? |
I'm refactoring my ASP.net application from ASP.net 3.5 to 4.0. Also I'm changing the URLs to user friendly URLs /product.aspx?id=100 to /product-name/100. All my pages are indexed by search engines and the site has already been online for 6 years. I'm planning to do 301 redirect from the old pages to the new one. I want to make sure I won't lose the rankings and traffic. Any suggestion how to do it properly? | I recently submitted a sitemap.xml in Google's Webmaster Tools and some of the pages already got indexed. The problem now is, that I cleaned my URLs with MOD_REWRITE in the .htaccess file afterwards and I would like the new ones to be indexed. The old ones should be removed from the Google Index. Indexed Page: www.example.com/article.php?=article=this%is%an%example New URL: www.example.com/article-this-is-an-example Do I even have to remove them manually from the index in any way or do they refresh if Google crawls my new sitemap? I really wan't to prevent duplicate content. Thanks in advance. |
I am a US citizen. I just finished a French visa type D VLS-T "long séjour temporaire" student visa on February 27. I returned to the US and got an exit stamp. I want to return to France (to visit friends) for 70 days starting April 1. I want to confirm that the 90/180 rules did not apply while I had a type D visa, even though it was a VLS-T not a VLS-TS. I think this is in article 6 of the schengen borders code. I want to confirm this, but the French consulate is being vague and I'd really like a more clear answer as to how/why this is possible. Additionally, I am worried that a VLS-T may not have the same rights as a VLS-TS. ****if anybody is wondering I got into the country no problem | I have a 1-year residence permit from one Schengen country that is now expiring. Upon its expiration, I would like to get my 90/180 days validity as a tourist to stay, or return here as soon as possible. I understand that the tourist short-stay scheme is based on the 90/180 days "counter". But what happens if my previous stay was not tourism but residence (as searching year). Wouldn't that mean that I can quickly exit and re-enter the Schengen area to activate my tourist stay? Also, is there a way to change this purpose of stay without exiting the Schengen area? |
I am creating an Addon with Python and BPY, and I would want to have something like this: How are these things called? Subpanels? I have been looking and couldn't find any info. I would like to know how to create them, I have a panel that needs to be better organized and I want it to have multiple "subpanels" with checkboxes so I can disable them like this one: | I'm trying to find out how to add a checkbox to a panel header so panel can be deacivated (as well as storing that checkbox value in some property). It may be quite obious task, but I didn't find any info about it in the docs so far. Example of what I'm trying to achive is the "Gravity" panel, that can be turned off with the checkbox. Any suggestions or leads? I would be grateful for any code examples with it. |
I have content in shadow file: root:!:17777:::::: bin:x:14871:::::: daemon:x:14871:::::: mail:x:14871:::::: ftp:x:14871:::::: http:x:14871:::::: dbus:x:14871:::::: nobody:x:14871:::::: systemd-journal-gateway:x:14871:::::: systemd-timesync:x:14871:::::: systemd-network:x:14871:::::: systemd-bus-proxy:x:14871:::::: systemd-resolve:x:14871:::::: systemd-journal-remote:!!:17635:::::: systemd-coredump:!!:17635:::::: uuidd:!!:17635:::::: dnsmasq:!!:17635:::::: rpc:!!:17635:::::: ntp:!:17635:0:99999:7::: usbmux:!:17635:0:99999:7::: avahi:!!:17635:::::: colord:!!:17635:::::: cups:!!:17635:::::: git:!!:17635:::::: lightdm:!!:17635:::::: nm-openconnect:!!:17635:::::: nm-openvpn:!!:17635:::::: polkitd:!!:17635:::::: rtkit:!!:17635:::::: qwerty:$6$4b0Rmzt4U9I6zbhV$zWtNjLeqSYTOrWagic0L10PSNwVuOTCcWD:17802:0:99999:7::: gluster:!!:17798:::::: minidlna:!!:17818:::::: acestream:!:17861:0:99999:7::: postgres:!:17892:0:99999:7::: pgbouncer:!:17892:::::: geoclue:!!:17946:::::: I saw this question - . But there is no explanation what "x" is in the second field of shadow file. I saw this question - . I'm not sure what files /etc/group and /etc/shadow have same convention. | A sample /etc/group file contains the following entries: root:*:0: adm:!:4:logcheck antoine:x:1000: The man pages I've read (Debian & OSX) says the second field is to store a group password. As they are rarely used, an asterisk * or a x is usually placed in it rather than leaving it blank. The shadow man page also says that this second field should store the result of the crypt function. And if an invalid result is stored (such as * or !) it means the password cannot be used as authentication method. Does that hold true for the group file as well? Why do I end up with 3 different characters in my group file all having the same meaning? Can I safely change all to *? |
Let $a,b\in\mathbb{Z} \backslash \{0\}$. Show that $a\mid b$, $b\mid a$ $\implies a=\pm b$. I can see why this is true, but not write it down. | If $A|B$ and $B|A$ then prove $A=\pm B$ So far I have $A|B \iff AX=B$ and $B|A \iff BY=A$ with $X,Y \in \mathbb{Z}$ Not sure how to finish, any help. |
Im having trouble understanding what << means in C. Im supposed to explain some code as a homework assignment, but it's kinda difficult to find an answer by googling. It's related to programming a multi function shield connected to arduino (atmega328p chip) Here's the line: PORTB = ~(money << 2); | I've been attempting to learn C in my spare time, and other languages (C#, Java, etc.) have the same concept (and often the same operators) ... What I'm wondering is, at a core level, what does bit-shifting (<<, >>, >>>) do, what problems can it help solve, and what gotchas lurk around the bend? In other words, an absolute beginner's guide to bit shifting in all its goodness. |
First, this is a homework, StackOverflow has now different type of questions and I chose "I need help with a homework problem". The program print all the prime numbers from range(k to n) from this expression: ((1 + sin(0.1*i))*k) + 1, i = 1, 2, ..., N. The code only works for the first test case. I get "Terminated due to timeout" on the 2nd and final case. The homework is uploaded to HackerRank, I don't know how to fix this. I did all the things that the task wants. Constraints: k <= 10^18 n <= 10^3 Input Format: No more than 100 examples. Every example has 2 positive integers on the same line. Output Format: Print each number on a separate line. Sample Input: 4 10 500 100 Sample Output: 5 17 #include <iostream> #include <cmath> using namespace std; int main() { long long k, n; int j; while (cin >> k >> n) { if (n>1000 && k>1000000000000000000) continue; int count = 0; for (int i = 1; i <= n; i++) { int result = ((1 + sin(0.1*i)) * k) + 1; for (j = 2; j < res; j++) { if (result % j == 0) break; } if (j == result) count++; } cout << count << endl; } system("pause"); } | Which is the fastest algorithm to find out prime numbers using C++? I have used sieve's algorithm but I still want it to be faster! |
I am a Dutch citizen and want to visit South Korea. Do I need a visa? | I'm a national of country XYZ who wants to visit the state ABC for the purpose of tourism. How can I find out if I will need a visa? NB: this is intended as a canonical/wiki question |
I accumulate sequentially named files as the result of an automated process, and I would like to keep only the last 10 around. I tried this, which had the effect of deleting everything: ls -r | more +11 | xargs rm Apparently piping more +n causes the entire result to be piped, without regard to the +n argument. What would be the correct approach? | I`m trying to delete old files from directory and leave only 3 newest files. cd /home/user1/test while [ `ls -lAR | grep ^- | wc -l` < 3 ] ; do rm `ls -t1 /home/user/test | tail -1` echo " - - - " done something is wrong with conditional statement. |
I have the following table: source_id bands duration 24 L BAND 0.215447 24 L BAND 0.00017 24 S BAND 0.00017 88 L BAND 0.215447 88 L BAND 0.00017 72 L BAND 0.00017 For every combination of "source_id" and "bands" values, I would like to output the entry with the longest duration, such that the output would be: source_id bands duration 24 L BAND 0.215447 24 S BAND 0.00017 88 L BAND 0.215447 72 L BAND 0.00017 What would be the easiest and/or best way to achieve this? | My table is: id home datetime player resource 1 10 04/03/2009 john 399 2 11 04/03/2009 juliet 244 5 12 04/03/2009 borat 555 3 10 03/03/2009 john 300 4 11 03/03/2009 juliet 200 6 12 03/03/2009 borat 500 7 13 24/12/2008 borat 600 8 13 01/01/2009 borat 700 I need to select each distinct home holding the maximum value of datetime. Result would be: id home datetime player resource 1 10 04/03/2009 john 399 2 11 04/03/2009 juliet 244 5 12 04/03/2009 borat 555 8 13 01/01/2009 borat 700 I have tried: -- 1 ..by the MySQL manual: SELECT DISTINCT home, id, datetime AS dt, player, resource FROM topten t1 WHERE datetime = (SELECT MAX(t2.datetime) FROM topten t2 GROUP BY home) GROUP BY datetime ORDER BY datetime DESC Doesn't work. Result-set has 130 rows although database holds 187. Result includes some duplicates of home. -- 2 ..join SELECT s1.id, s1.home, s1.datetime, s1.player, s1.resource FROM topten s1 JOIN (SELECT id, MAX(datetime) AS dt FROM topten GROUP BY id) AS s2 ON s1.id = s2.id ORDER BY datetime Nope. Gives all the records. -- 3 ..something exotic: With various results. |
#include <iostream> #include <array> int main() { std::array myArray { 7, 3, 1, 9, 5 }; // Iterate through the array and print the value of the elements for (int i{ 0 }; i < myArray.size(); ++i) std::cout << myArray[i] << ' '; std::cout << '\n'; return 0; } It is stated that There is a signed/unsigned mismatch. The size() function and array index parameter to operator[] use a type called size_type. Our loop counter/index (variable i) is a signed int. Therefore both the comparison i < myArray.size() and the array index myArray[i] have type mismatches. I understand the statement, but what is the consequence of this mismatch? My IDE (VS2019) neither gives a error nor a warning. Are there any performance benefits from using std::size_t in place of int in this code? #include <array> #include <cstddef> // std::size_t #include <iostream> int main() { std::array myArray { 7, 3, 1, 9, 5 }; for (std::size_t i{ 0 }; i < myArray.size(); ++i) std::cout << myArray[i] << ' '; std::cout << '\n'; return 0; } | In several C++ examples I see a use of the type size_t where I would have used a simple int. What's the difference, and why size_t should be better? |
Sorry if this question might seem suspicious - as a frequent traveler to Israel it's simply something I've always wondered about. El Al has some well-known extra security methods for all flights to Israel, including operating their own additional baggage screening system, air marshals, etc. I believe Arkia and Israir do the same and that the Israeli government supplies the budget. Are foreign airlines flying to Israel (Lufthansa, BA, etc) forced to also use these methods and screen passengers? Strangely although I've flown with foreign carriers and El Al many times I can't recollect how the experience differed - and would have no way of knowing about additional baggage screening. If anybody has any information it would be nice to have my curiosity satisfied! | The one thing I hate about flying to Israel are the security checks at the origin airports. I don't mind X-rays and deep luggage searches, but there's also an annoying interview you have to "pass". The security folks can't really turn you down (especially since I'm a citizen), but they always make it a pain in the butt, because for some reason I fit their profile of a suspicious person. Can I avoid the personal interviews if I book on a non-Israeli airline? Or perhaps a low-cost airline? |
Here in Python, I have a list like this: array = [[[0,0,1,0],[0,0,0,1],[1,0,0,0],[0,1,0,0]], [[0,1,0],[1,0,0],[0,0,1],[0,0,1]], [[0],[1],[0],[1]], [[1],[1],[0],[1]]] I want to reshape it into: array = [[[0,0,1,0],[0,1,0],[0],[1]], [[0,0,0,0],[1,0,0],[1],[1]], [[1,0,0,0],[0,0,1],[0],[0]], [[0,1,0,0],[0,0,1],[0],[1]]] Any suggestions? | I have a list of 2-item tuples and I'd like to convert them to 2 lists where the first contains the first item in each tuple and the second list holds the second item. For example: original = [('a', 1), ('b', 2), ('c', 3), ('d', 4)] # and I want to become... result = (['a', 'b', 'c', 'd'], [1, 2, 3, 4]) Is there a builtin function that does that? |
Find number of ring homomorphisms from $\mathbb Z_{12} \to \mathbb Z_{28}$. This question has been asked before but I found the solution confusing.Please check whether my approach is valid. A ring homomorphism satisfies $f(x+y)=f(x)+f(y);f(xy)=f(x)f(y)$ A ring homomorphism must first be a group homomorphism. So $f$ will entirely depend upon its image on $[1]$.Now $o(f([1]))$ must divide both $12,28$.Hence $f([1])=0;f([1]=[7],f([1]=[14]$ But if we take $f([1])=[7] $ then it will fail to be ring homomorphism as $f[nm]=[7][nm]\neq [7m][7n]$ if we take $f([1])=[14] $ then it will fail to be ring homomorphism as $f[nm]=[14][nm]\neq [14m][14n]$ Thus only one available is $f([1])=[0]$ .Is it correct ? Please help. | Question: Find the number of non trivial ring homomorphisms from $\mathbb Z_{12}$ to $\mathbb Z_{28}$. ($f$ is not necessarily unitary, i.e., $f(1)$ need not be $1$.) Suppose $f$ is a ring homomorphism from $\mathbb Z_{12}$ to $\mathbb Z_{28}$. Consider $f$ as a additive group homomorphism. Let $k= |\ker f|$ and $ t = |\operatorname{im}(f)|$. Then $k\mid 12$ and $t\mid 24$ and $kt=12$, by first isomorphism theorem of groups. There are two possibilities $k=3$, $t=4$ and $k=6$, $t=2$. For the first case $f$ should map $1$ to an element of the subgroup generated by $7$ as there is a unique subgroup of $\mathbb Z_{28}$ of order $4$ generated by $7$. For the second case $1$ has to map to $14$, for the same reasoning. So there are at most two ring homomorphisms from $\mathbb Z_{12}$ to $\mathbb Z_{28}$. Question is how to check the possible maps which are ring homomorphisms. Thanks. |
I have a little console C# program like Class Program { static void main(string args[]) { } } Now I want to do something after main() exit. I tried to write a deconstructor for Class Program, but it never get hit. Does anybody know how to do it. Thanks a lot | I have a console application that contains quite a lot of threads. There are threads that monitor certain conditions and terminate the program if they are true. This termination can happen at any time. I need an event that can be triggered when the program is closing so that I can cleanup all of the other threads and close all file handles and connections properly. I'm not sure if there is one already built into the .NET framework, so I'm asking before I write my own. I was wondering if there was an event along the lines of: MyConsoleProgram.OnExit += CleanupBeforeExit; |
Using Python/Django on App Engine, is it possible for the creation of a Datastore record to cause a function to run? I have more than one function that creates a record. What I want is for every time any function creates a record of a certain Model, another function is run, without the function needing to be called from the code that originally created the record. | I'm having trouble wrapping my head around this. Right now I have some models that looks kind of like this: def Review(models.Model) ...fields... overall_score = models.FloatField(blank=True) def Score(models.Model) review = models.ForeignKey(Review) question = models.TextField() grade = models.IntegerField() A Review is has several "scores", the overall_score is the average of the scores. When a review or a score is saved, I need to recalculate the overall_score average. Right now I'm using a overridden save method. Would there be any benefits to using Django's signal dispatcher? |
I suggested an edit for a question with a bounty on it. I stayed on the page, and saw the "An edit has been made to this page"-message coming in. I clicked on it. Then, the bounty message disappeared! This is front-end, with a refresh, the bounty message was there again. Sadly, I didn't make a screenshot of it, but you can imagine what it would look like. The question: | I've come across a small issue which occurs when a question has been closed but the question itself or one of its answers are being edited. Steps to reproduce: Visit a closed question. (even closed years ago) In a different tab or browser, edit the question or one of its answers. "an edit has been made to this post; click to load" message will appear above the edited post in the first tab/browser, click it. The .question-status div becomes hidden, which includes the closed notice below a question and, for a duplicate-closed question, the list of duplicates above the question body. This gives the appearance that the question is no longer closed (until you refresh). Some screenshots: I know it isn't common/important but it did confuse me when looking at a particularly bad question - I thought it had been reopened. Is this an intentional feature? If so, what was the thinking behind it? Another example Before After |
Ok, I've looked all over the place and I'm really stuck. I would like to have a panel with some input variables (like height and radius), which can be typed in. Then I would like a button that, when pushed, executes some python code (like creating a cylinder, moving it, put material on some of the vertices etc.) But it seems that variables and buttons need to be hooked up to specific operators, so I lose control over the input variables. Maybe I'm thinking too much like Visual Studios forms. I could really use help. | I was watching this on making a custom UI tab using Python, and in the line from bpy.types import Menu, Panel, UIList, I see the names of objects that look like they can all be used to make different UI elements. Does bpy.types contain all the objects that people use when they want to make custom UI elements? |
I watched with interest the which was fun. They had a secondary list of vids of one was entitled . Now I thought that black holes don't necessarily have to be dense, if they are very large. The Swartzchild radius is $$ r_\text{s} = \frac{2 M G}{c^2} $$ so if the mass-to-radius ratio exceeds $$ \frac{M}{r} > \frac{c^2}{2 G} $$ you gotta black hole. But it's only a single power of $r$ in the denominator. This means, assuming a sphere, if the density exceeds $$ \frac{M}{\tfrac{4}{3}\pi r^3} > \frac{3 c^2}{8 \pi G r^2} $$ you gotta black hole. With $r^2$ in the denominator, it appears you wouldn't need a lotta density if the radius is large enough. With $ \frac{c^2}{2 G} = 6.7332 × 10^{26} \frac{\text{kg}}{\text{m}} $ and $ \frac{M}{r} = 4.5455 × 10^{27} \frac{\text{kg}}{\text{m}} $ (Numbers come from Wikipedia. This is including non-baryonic matter and energy, all which should have gravitational effect.) It looks pretty close, but with these numbers the entire mass and energy of the observable Universe is contained in a radius smaller than the Swartzchild radius. 45.455 is bigger than 6.7332. Couldn't an entire observeable universe be a black hole? Wouldn't this be a different "type", a fifth type of black hole than the four described in the NOVA vid? | I was surprised to only recently notice that An object of any density can be large enough to fall within its own Schwarzschild radius. Of course! It turns out that supermassive black holes at galactic centers can have an average density of less than water's. Somehow I always operated under the assumption that black holes of any size had to be superdense objects by everyday standards. Compare the Earth to collapsing into a mere 9mm marble retaining the same mass, in order for the escape velocity at the surface to finally reach that of light. Or Mt. Everest packed into one nanometer. Reading on about this , it increases proportionally with total mass. Assuming matter is accumulated at a steady density into a spherical volume, the volume's radius will only "grow" at a cube root of the total volume and be quickly outpaced by its own gravitational radius. Question: For an object the , what would have to be its diameter for it to qualify as a black hole (from an external point of view)? Would this not imply by definition that: The Earth, Solar system and Milky Way are conceivably inside this black hole? Black holes can be nested/be contained within larger ones? Whether something is a black hole or not is actually a matter of perspective/where the observer is, inside or outside? |
I am tring to make bibliographig list in Bibtex with subtitles. For this I have the following minimal example: \begin{filecontents}{minimal.bib} @online{electronic1, author = {A. Author}, title = {Funny website}, urldate = {2013-01-09}, url = {http://www.example.org}, }, @book{book1, author = {B. Bthor}, title = {A Book of whatever}, date = {2012}, }, @article{article1, author = {C. Cthor and D. Dthor}, title = {Writing interesting articles}, journaltitle = {The Journal of References}, date = {2010-12-01}, } \end{filecontents} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Optionen zum Layout des Buchs %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \documentclass[a4paper, 11pt liststotoc, % Abb.- und Tab.verzeichnis im Inhalt bibtotocnumbered listtotoc idxtotoc bibtotoc ] {scrbook} \usepackage[ natbib = true, style = alphabetic ]{biblatex} \addbibresource{Literatur.bib} \setuptoc{toc}{numbered} \usepackage[ngerman]{babel} \usepackage[ansinew]{inputenc} \usepackage{graphicx} %%Zum Laden von Grafiken \begin{document} \title{Minimalbeispiel zur Literaturverwendungsstyl ausprobung} \author{Autor Anonymus} \maketitle \tableofcontents % Inhaltsverzeichnis \mainmatter % Vorspann (z.B. römische Seitenzahlen) \chapter{Einleitung} Bei der Book-Klasse des KOMA-Script wird durch den Gliederungsbefehl \verb#\frontmatter# automatisch auf römische Seitennummerierung gewechselt und die Nummerierung der Kapitel unterdrückt. In der Regel sollte der Vorspann nur aus einem Kapitel -- dem Vorwort -- bestehen. \cite{Kuester 2010} Der Vorspann endet für scrbook, wenn durch \verb#\mainmatter# der Hauptteil beginnt. \appendix % Beginn des Anhangs \pagenumbering{Roman} \newpage \addcontentsline{toc}{chapter}{Tabellenverzeichnis} \listoftables % Tabellenverzeichnis \newpage \addcontentsline{toc}{chapter}{Abbildungsverzeichnis} \listoffigures % Abbildungsverzeichnis \newpage \addcontentsline{toc}{chapter}{Literaturverzeichnis} \nocite{*} \printbibheading % print heading for all bibliographies \printbibliography[ nottype = online, % Put here verything that is NOT of the type "online". % The "electronic" type is just an alias to "online" title={Quellen}, % title of the subbibliography heading=subbibliography % make bibliography go one sectioning level lower ] \printbibliography[ type=online, % Put only references of the type "online" here. title={Online-Quellen}, heading=subbibliography ] \end{document} I tried to compile 3 times, but it doesn't work. My problem is that the entries doesent seem to be printed out to the pdf. If you can help me, I would be happy. | Running the minimal example \documentclass{article} \usepackage{filecontents} \begin{filecontents*}{\jobname.bib} @ARTICLE{example, author = {Other, Anthony Norman}, title = {Some things I did}, year = {2014}, journal = {J.~Irrep. Res.}, volume = {1}, number = {1}, pages = {1-10} } \end{filecontents*} \usepackage[backend=biber]{biblatex} \addbibresource{\jobname.bib} \begin{document} Hello\cite{example}. \printbibliography \end{document} I get the warning There were undefined references. I have read and know that I need to run: LaTeX Biber LaTeX However, my editor is only set up to run BibTeX. How do I go about setting up my editor/IDE to be able to run Biber, and how do I run the LaTeX/Biber/LaTeX cycle? Answers (sorted alphabetically by editor name) Answer guidelines Each answer should be for one editor. If the editor is cross-platform, if possible give a single answer with notes covering the minor platform variations. Please edit the question to include new answers in the 'link list' Each answer should be 'stand alone', i.e. don't say 'It's almost the same as editor Y but ...' for the editor part Instructions for 'build tools' such as arara or latexmk are welcome but should explain how to set up the editor in question as not all editors allow simple addition of arbitrary tools |
I was wondering, whether there are any problems that we already know are difficult to solve for a quantum computer, and that we could potentially use in cryptography, just as we do now with e.g. the factorization of integers? | Quantum computers are known to be able to crack a broad range of cryptographic algorithms which were previously thought to be solvable only by resources increasing exponentially with the bit size of the key. An example for that is . But, as far I know, not all problems fall into this category. On , we can read Researchers have developed a computer algorithm that doesn’t solve problems but instead creates them for the purpose of evaluating quantum computers. Can we still expect a new cryptographic algorithm which will be hard to crack using even a quantum computer? For clarity: the question refers to specifically to the design of new algorithms. |
Let $f(z)$ be an entire function such that $|f(z)|\le C|z|$ where $C$ is a positive constant. Show there exists a $D$ which is a complex constant such that $f(z)=Dz$. I am trying to use a cauchy's estimate to show that $f''(z)=0$ but not sure how to go about this. | Let $f(z)$ be an entire function s.t $|f(z)|\leq M|z|$ ; $M>0$ is a constant then $f(z)$ Is polynomial of degree 1 My try $f(z)$ is entire so it can be written as a $\sum a_n z^n$ $$|\sum a_n z^n|\leq \sum |a_n||z|^n\leq M|z|$$ So $n=1$ Seems that the move $\sum |a_n||z|^n\leq M|z|$ is problematic |
I added two photos in Latex. I want these two pictures to be placed next to each other. Note that two pictures are appropriate, not two sub-pictures in one picture. \begin{figure}[t] \centering \includegraphics[width=\linewidth]{figure/a.eps} \caption{This is my first picture } \end{figure} \begin{figure}[t] \centering \includegraphics[width=\linewidth]{figure/b.eps} \caption{This is my second picture. } \end{figure} | How can I put two figures side-by-side? Not two sub-figures, but two actual figures with separate "Fig.: bla bla" captions. A figure is supposed to spread over the entire text width, but I have two figures which are narrow and long, and I need to save the space in order to withstand the pages limit. |
I wanted to restart my server so I did : sudo service apache2 restart It instead showed me the message below : Job for apache2.service failed. See 'systemctl status apache2.service' and 'journalctl -xn' for details. I then did systemctl -l status apache2.service and it came out with these results: apache2.service - LSB: Apache2 web server Loaded: loaded (/etc/init.d/apache2) Drop-In: /lib/systemd/system/apache2.service.d └─forking.conf Active: failed (Result: exit-code) since Thu 2016-12-15 07:44:48 CST; 43min ago Process: 31239 ExecStart=/etc/init.d/apache2 start (code=exited, status=1/FAILURE) Dec 15 07:44:48 s87890 apache2[31239]: Starting web server: apache2 failed! Dec 15 07:44:48 s87890 apache2[31239]: The apache2 configtest failed. ... (warning). Dec 15 07:44:48 s87890 apache2[31239]: Output of config test was: Dec 15 07:44:48 s87890 apache2[31239]: apache2: Syntax error on line 216 of /etc/apache2/apache2.conf: Could not open configuration file /etc/apache2/conf-enabled/softaculous.conf: No such file or directory Dec 15 07:44:48 s87890 apache2[31239]: Action 'configtest' failed. Dec 15 07:44:48 s87890 apache2[31239]: The Apache error log may have more information. Dec 15 07:44:48 s87890 systemd[1]: apache2.service: control process exited, code=exited status=1 Dec 15 07:44:48 s87890 systemd[1]: Failed to start LSB: Apache2 web server. Dec 15 07:44:48 s87890 systemd[1]: Unit apache2.service entered failed state. I looked at line 216 of /etc/apache2/apache2.conf and this is what I saw: IncludeOptional conf-enabled/*.conf I did journalctl -xn and it showed me : - Logs begin at Tue 2016-12-13 16:17:11 CST, end at Thu 2016-12-15 08:11:24 CST. -- Dec 15 08:11:05 s87890 sshd[32074]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=116.31.116.48 user=root Dec 15 08:11:07 s87890 sshd[32074]: Failed password for root from 116.31.116.48 port 61622 ssh2 Dec 15 08:11:10 s87890 sshd[32074]: Failed password for root from 116.31.116.48 port 61622 ssh2 Dec 15 08:11:12 s87890 sshd[32074]: Failed password for root from 116.31.116.48 port 61622 ssh2 Dec 15 08:11:12 s87890 sshd[32074]: Received disconnect from 116.31.116.48: 11: [preauth] Dec 15 08:11:12 s87890 sshd[32074]: PAM 2 more authentication failures; logname= uid=0 euid=0 tty=ssh ruser= rhost=116.31.116.48 user=root Dec 15 08:11:22 s87890 postfix/smtpd[32032]: warning: hostname dedic858.hidehost.net does not resolve to address 91.200.13.20: Name or service not kn Dec 15 08:11:22 s87890 postfix/smtpd[32032]: connect from unknown[91.200.13.20] Dec 15 08:11:24 s87890 sudo[32065]: ejandra : TTY=pts/0 ; PWD=/home/ejandra ; USER=root ; COMMAND=/bin/journalctl -xn Dec 15 08:11:24 s87890 sudo[32065]: pam_unix(sudo:session): session opened for user root by ejandra(uid=0) I already did an apache uninstall and then installed it again but still the same error persists. What could be wrong here? | Trying to restart apache from terminal using following command: sudo service apache2 restart when executing that command getting below error: Job for apache2.service failed. See "systemctl status apache2.service" and "journalctl -xe" for details. On excuting "systemctl status apache2.service" got below output apache2.service - (null) Loaded: loaded (/etc/init.d/apache2) Active: failed (Result: exit-code) since Sat 2015-05-30 02:22:41 IST; 12s ago Docs: man:systemd-sysv-generator(8) Process: 4866 ExecStart=/etc/init.d/apache2 start (code=exited, status=1/FAILURE) apache error.log AH00489: Apache/2.4.12 (Unix) configured -- resuming normal operations AH00094: Command line: '/usr/local/apache2/bin/httpd' |
I recently moved from Linux to Mac, and am missing a two pane file manager. I was thinking about along the lines of midnight commander, krusader (Linux) or total commander (Windows). I installed midnight commander and am using it, but a GUI file manager would sometimes be handy. Any suggestions for Open Source alternatives? | I'm looking for a graphical fro OS X, for console Midnight Commander is ok. I need two panels, function keys operations and preferably FTP and SCP support. Also, it would be great to be free. |
the output of sudo apt-get update command are below: Hit:9 http://ppa.launchpad.net/ubuntu-mozilla-daily/ppa/ubuntu xenial InRelease Get:11 http://archive.ubuntu.com/ubuntu xenial-backports InRelease [102 kB] Hit:12 http://ppa.launchpad.net/ubuntu-wine/ppa/ubuntu xenial InRelease Hit:13 http://ppa.launchpad.net/webupd8team/brackets/ubuntu xenial InRelease Err:14 http://dell.archive.canonical.com/updates xenial-dell InRelease Could not connect to dell.archive.canonical.com:80 (91.189.89.6), connection timed out Fetched 306 kB in 2min 0s (2,551 B/s) Reading package lists... Done W: Failed to fetch http://dell.archive.canonical.com/updates/dists/xenial-dell/InRelease Could not connect to dell.archive.canonical.com:80 (91.189.89.6), connection timed out W: Some index files failed to download. They have been ignored, or old ones used instead. | I've just purchased a Dell Precision 7520 with Ubuntu 16.04. I needed to reinstall the Ubuntu version with partitions for the root and home and now I want to install the Dell Repositories which this machine had on it originally. They were: http://dell.archive.canonical.com/updates/ exnial-dell-crane-kbl public http://dell.archive.canonical.com/updates/ exnial-dell-crane-kbl public (source Code) http://dell.archive.canonical.com/updates/ exnial-dell public http://dell.archive.canonical.com/updates/ exnial-dell public (source Code) How can I do this in the Software & Updates window (Other Software Tab)? I need to install some open software drivers which were in the Additional Drivers Tab (when I bought it). |
I'm fond of old especially folk songs, but as a foreigner I often have troubles interpreting some phrases. Here is one from : I'm going there to see my father I'm going there no more to roam I'm just a-going over Jordan I'm just a-going over home Does "going over" here mean "going to", i.e. approaching to some goal? I can't find some dictionary article which can prove this - though I've seen some about "go over to smth" with similar sense. Or can this be some archaic, or dialect-specific (Appalachian?) usage, but not "normal" for contemporary / everyday language? Thanks in advance for guiding me! | Can someone explain the etymology of using over in expressions like come over to and go over to as in "pay a casual visit"? Is there a source for the etymology of idiomatic expressions somewhere? |
I have this habit of searching Jon Skeet and checking his reputation(inspires me). But when I searched it today, I found two Jon Skeet's as : Hoping Jon Skeet doesn't have two accounts. :) (EDIT: a moderator has reset the offending user's name and image, so they no longer show up as pictured above) So this user is using name of famous Jon Skeet and using his picture too. What should be done to these accounts? Can they be reported directly or is this OK to use name and picture of anybody? | What is done to prevent people from changing their display name to another persons', for example Jon Skeet, and then also changing their gravatar to match too? In comments it seems there is no visible differentiator, and the differentiator in questions and answers is just reputation and badges. This doesn't seem to be a problem for stackoverflow, but I'm just wondering what are possible safeguards against this? EDIT: Also it doesn't even have to be deliberate, if two people just happen to choose the same display name, and they both participate in the same question/comment thread, that would be confusing right? |
Give an example of a finite and infinite Boolean ring without unity. I find difficulty to answer this question.Please help me. Thank you in advance. | Let $(B, +, \cdot)$ be a non-trivial ring with the property that every $x \in B$ satisfies $x \cdot x = x$. How does one prove that such a ring $(B, +, \cdot)$ must have a unit element $1_B$? (Or, in case this is not true in general, what is a counterexample?) BTW, I'm looking for an elementary proof, not requiring anything more than the definition of a ring, the definition of $(B, +, \cdot)$, and, if necessary, the easily shown facts that $x + x = 0$ and $x\cdot y = y\cdot x,\,\forall\, x,y \in B$. |
I read somewhere that "if python can't find instance variable it will try to return value of the class variable having the same name" eg class Sample: pi = 10 Now x1 = Sample() x2 = Sample() x1.pi # returns 10 x2.pi # returns 10 x1.pi = 20 # change the value of class variable x1.pi # return 20 (OK) x2.pi # still returns 10 :( Sample.pi # returns 10 :( What is happening?? | Is it possible to have static class variables or methods in Python? What syntax is required to do this? |
I'm trying to understand imaginary quadratic fields and the ideal class group seems to be really important, yet I cannot find a simple explanation of it and why it's important. I understand that it is related to unique factorization, yet I don't know why. If someone could give a simple explanation of it and maybe a simple example of it I'd really appreciate it. | Let $O$ be a Dedekind domain and $K$ its field of fractions. The set of all fractional ideals of $K$ form a group, the ideal group $J_K$ of K. The fractional principal ideals $(a) = aO, a \in K^*$, form a subgroup of the group of ideals $J_K$, which will be denoted $P_K$. The quotient group $$CL_K=J_K/P_K$$ is called the ideal class group of $K$. This definition looks completely arbitary, I fail to see why the class group or the ideal class group is worth studying. So, why is the class group or ideal class group interesting? I've read that ideal class group "measures" how much unique factorization fails in a domain, but I don't understand how it does so. This from Algebraic Number Theory by Neukirch. The class group $C_K$ measures the expansion that takes place when we pass from numbers to ideals, whereas the unit group $O^*$ measures the contraction in the same process. This immediately raises the problem of understanding these groups $O^*$ and $C_K$ more thoroughly. I don't understand the above paragraph. What does it mean by "the expansion that takes place when we pass from numbers to ideals"? And why should we even bother about such "expansion"? |
So I have this function I created called isDateOverlapping. It takes in (of all type LocalDate): Start Date 1 End Date 1 Start Date 2 End Date 2 What this function does is it tells me if the 2 date periods are overlapping or not. For example if I have 1 period from 2019-06-15 to 2019-06-18 and another period from 2019-06-15 to 2019-06-12. It would return true because the 2 date periods overlap. However my function doesn't seem to always return the right answer. Could you please help. public boolean isDateOverlapping(LocalDate start1, LocalDate end1, LocalDate start2, LocalDate end2) { if (start1.isAfter(start2) && start2.isBefore(start1)) { return true; } else if (end1.isBefore(end2) && start1.isAfter(start2)) { return true; } else if (start1.isAfter(end1) && end2.isBefore(start2)) { return true; } return false; } | Given two date ranges, what is the simplest or most efficient way to determine whether the two date ranges overlap? As an example, suppose we have ranges denoted by DateTime variables StartDate1 to EndDate1 and StartDate2 to EndDate2. |
Recently, when a user deleted his account on Lifehacks, his questions with negative scores and no accepted answers were deleted, including . However, some users . I don't think it should have been deleted -- yes, the question had a negative score, no there wasn't an accepted answer....but there was an answer with a positive score. Why should positive score answers be deleted, ever? In short: Please protect positive score answers to deleted users' negative score questions from damaging deletion by the Roomba. | As I found out earlier today, users who are deleted . This goes against established conventions, for two reasons: As moderators, we constantly tell users that we won't unilaterally delete questions that have upvoted answers. Even our . See also . This 'delete my user' process allows a user to get around this policy by simply deleting their own account. Since nothing stops them from creating another account, it's quite possible this harms our mission of keeping good content around. Also, it allows users to delete their own questions whose answers have received bounties, which can take away the bounty award; this behavior was recently prevented for normal question self-deletions. I propose that we make changes to the user deletion algorithm: If a user is deleted and they have questions with upvoted answers, those questions are disassociated from the user's account instead of being summarily deleted. Questions without upvoted answers are treated like they are currently: they are deleted when the user is deleted. This should be the same for destroyed users as well. |
I use xev to debug x11 events for a window. I can filter events using grep, for example: xev -id windowid | grep FocusIn. I want to append time to each output from the above command (date +"%T.%N") . I need to know when each event occured. Is it possible ? How to achieve that ? Edit1 Following command works: xev -id windowid | awk '{ print strftime("%Y-%m-%d %H:%M:%S"), $0; fflush(); }' but with grep there is no output: xev -id windowid | grep FocusIn | awk '{ print strftime("%Y-%m-%d %H:%M:%S"), $0; fflush(); }' When I use grep and ts there is also no output: xev -id windowid | grep FocusIn | ts How to fix that ? | I ended up writing a quick little script for this in Python, but I was wondering if there was a utility you could feed text into which would prepend each line with some text -- in my specific case, a timestamp. Ideally, the use would be something like: cat somefile.txt | prepend-timestamp (Before you answer sed, I tried this: cat somefile.txt | sed "s/^/`date`/" But that only evaluates the date command once when sed is executed, so the same timestamp is incorrectly prepended to each line.) |
It is well known (and the proof is simple) that $\det(AB)=\det(A)\det(B)$ when $A,B\in M_n(F)$ where $F$ field. But what about for $A,B\in M_n(R)$ where R is any arb. commutative ring? A field is distinguished from a com. ring by the presence of multiplicative inverses. I feel like this isn't a necessary condition for proving the determinant function is a homomorphism but I'm having a hell of a time trying to do so. How would I go about proving the above? | Given two square matrices $A$ and $B$, how do you show that $$\det(AB) = \det(A)\det(B)$$ where $\det(\cdot)$ is the determinant of the matrix? |
After puzzling over this phrase for quite some time I came across the possible answers offered in this site. The one that seemed to show the most promising solution was the longest entry, which included the possibility of there being a verb “to lam” meaning “to run.” I found just such a verb in the English Dialect Dictionary, a somewhat now forgotten, yet very useful, text. I here provide the germane entry, from Vol. III, pp. 509-10: “LAM...4. to run quickly. w. Yks 5 Whear’s tuh lamming tul! Ther wur a peeler after him - by Gow didn’t he lam!” The above quotation - which seems to fit exactly the meaning of “lam” - as “running from the police” (i.e. a “peeler”) - comes from C.C Robinson’s The Dialect of Leeds and its Neighbourhood, of 1861. | According to the Online Etymological Dictionary, lam means: "flight," as in on the lam, 1897, from a U.S. slang verb meaning "to run off" (1886), of uncertain origin, perhaps somehow from the first element of lambaste, which was used in British student slang for "beat" since 1590s. Does anyone know of any other explanations? |
I don't want to use the same Apple ID on my new phone as on my old phone because it got messed up, however I don't want to have to buy each app twice. Is there a way I can without using the same Apple ID? Same goes for music. | I have two Apple IDs and would like to close one and move the apps from one to the other. Is this possible and how? |
char *char_ptr = "anisha"; char char_arr[]= "anisha"; What is the "reason" that the contents of first memory location cannot be modified but the contents of second memory can? Why is the first memory storage a constant string whereas the second one isn't? | The following code receives seg fault on line 2: char *str = "string"; str[0] = 'z'; // could be also written as *str = 'z' printf("%s\n", str); While this works perfectly well: char str[] = "string"; str[0] = 'z'; printf("%s\n", str); Tested with MSVC and GCC. |
I have an object that is visible, and on frame 30 I'd like that object to be invisible, the same way you would hide an object with 'h' and un-hide it with 'alt+h'. Is there a way to achieve this without an material alpha? | lets assume we have an iron man pointing his hand to a target and shooting few frames later as shown in the picture below: frame 0 to 10 he will point frame 11 to 15 he will shoot, which is just a long cube with one larger face to give idea or a laser projectile how can I add the projectile cube only on frame 11? I don't what it to exist before that thanks |
This question is in regards to an existing thread: . I am facing an issue with regards to Part-IV / Figure 8 from the thread above. After assigning letter G to the volume, I tried executing cd /d g:. However, I get an error "Access is denied". I am unsure how to fix it, and proceed with rest of the steps mentioned in the thread above. Appreciate any help/advice. | OS: Windows 7. I want install Linux Ubuntu on portable external Hard Drive USB 2.0. I read a variety of methods, but I'm confused by contradictory advices and methods. Actually, installing Ubuntu on anything other than clean PC looks much more complicated than installing Windows. I need to have Ubuntu package + Python 2.7 + C compiler installed. My external hard drive is partially filled, I need to keep all files. Will Ubuntu run entirely on external hardrive, without writing anythinhg to Windows system folders and to registry? Can anyone post detailed guide how install Ubuntu on external hard drive? |
I am practicing for my algebra qual and I would like to know if $\mathbb{Z}[2\sqrt{2}]$ is a PID. I had no intuition at first except the fact that $\mathbb{Z}[i\sqrt{2}]$ is a ED with norm $N(a+i\sqrt{2}b)=a^2+2b^2$. I tried proving that $\mathbb{Z}[2\sqrt{2}]$ is a ED with norm $N(a+b2\sqrt{2})=a^2-8b^2$ using the standard proof for $\mathbb{Z}[i\sqrt{2}]$ and $\mathbb{Z}[i]$. This led nowhere. This may not be a PID, but I'm not sure how to prove it. Any tips? Thanks in advance. | Why is not the polynomial ring $R[x]$ a unique factorization domain, where $R$ is the quadratic integer ring $\mathbb{Z}[2\sqrt{2}]$? I'm trying to find a irreducible nonprime element or something but I don't know where to start. |
I'm having some difficulty with this proof. I want to show $ \sup (E_1 \cup E_2) = \max \{ \sup E_1, \sup E_2 \}$, where $E_1, E_2$ are two bounded, non-empty subsets of $\mathbb{R}$. Naturally, the supremum must exist by the least upper bound property. I know by definition that $\sup (E_1 \cup E_2) \geq x \ \forall x \in E$ and that $\sup (E_1 \cup E_2) \leq \beta$ where $\beta$ is the set of all upper bounds for E. I know the first condition satisfies one of the conditions for the maximum, but my problem is that I don't know how to show that $ \sup (E_1 \cup E_2)$ is in an element of E. As for $\max \{\sup E_1, \sup E_2\}$, I have proved that it is equal to a supremum by the following: Let $\beta _0$ denote $\max \{\sup E_1, \sup E_2\}$. Assume $\beta$ is the set of upper bounds for E, and $ x \in E$. Then we have that: If $x > \beta_0$, then by definition of upper bound $x \notin E$ If $\beta_0$ > $\beta$, then $\beta$ cannot be an upper bound since $\beta_0 \in E$ Therefore, $\beta_0 = \sup (\max \{\sup E_1, \sup E_2\})$ Again, this proof is incomplete because I have not shown that $\beta_0$ lives in the supremum of the union. | Let $A,B \subset \mathbb{R}$. Show that $\sup(A \cup B) = \max\{\sup A, \sup B\}$ Here's what I did so far: Let $\sup A, \sup B$, and $\sup (A \cup B)$ denote upper bounds of $A,B$, and $A \cup B$, respectively. If $x \in A$, then $x \le \sup A$. If $x \in B$, then $x \le \sup B$. In either case, $x \in (A \cup B)$. So either $x \le \sup A$ or $x \le \sup B$. In either case, $x \le \max \{\sup A, \sup B\}$. So $\max \{\sup A, \sup B\}$ is the upper bound of $A \cup B$, which means $\sup (A \cup B) \le \max\{\sup A, \sup B\}$. I do not know if there's a better way to go at it, but all I did was show the inequality. Can I do this, and show the reverse inequality? If so, how can I go about doing that? |
I am using ubuntu 12.04 LTS (64bit) in 64 bit machine. But I want to use a 32-bit operating system (either 12.04 or 8.04), I tried to do it using bootable pen drive but it failed, while I have alreay changed my OS from 12.10 (64 bit) to 12.04 (64bit) using bootable pendrive. Any kind of help will work. | I would like to see a full how-to guide on how to install Ubuntu. |
If I buy Minecraft on my laptop and I’m getting a new one at the end of the year can I get Minecraft on the new one I’m gonna get? I’ve seen people say this works but other people say it won't. I really want to play but I don't know if I’m going to have to buy it again and waste money? | I plan on buying a gaming PC as I expect to be able to get it around a year and I currently have a laptop that I play (a pirated version of) minecraft. I heard that minecraft broke out off of the "cringe culture", which convinced me to finally buy it (for now) and later buy the gaming PC, but... The thing I'm wondering about is, if I buy minecraft on a laptop, will I be able to avoid the whole buying part when I'll get a gaming PC in the future? Just want to know if I just need to re-download minecraft and log-in on my mojang account or (in the worst case) re-purchase minecraft and log-in on my mojang account... |
Recently I started googling out old AD&D books, but I stumbled upon very strange mix-up in terms of edition naming convention. For example, the has most of the Greyhawk book covers, but strangely enough, many times newer books are named "AD&D" while older ones have "AD&D 2nd Edition" in the title. The same happens for Forgotten Realms listings, and other setting books too. I've read somewhere that AD&D 1e and 2e had some small overlap in terms of releases, but it doesn't explain the scale of the issue and the examples below. How am I supposed to know which AD&D books are actually for 2nd Edition, and which are for 1st Edition? Even assuming the small overlap mentioned above and some reprints which I identified, I'm still finding books released 5+ years into the lifespan of 2nd Edition that still have the old 1st Edition logo. Was the release schedule that insanely messy back in the days? Or did they drop the "2nd Edition" part of the logo for some reason? Or did something else happen there? Examples of the problem: Greyhawk Player's Guide (1998): Not a reprint (at least not of anything I can find); nearly 10 years into the 2nd Edition lifespan but with a 1st Edition logo. Also released long after other Greyhawk 2nd Edition content which makes it even more odd. The Scarlet Brotherhood (1999): Also not a reprint; also has 1st Edition logo. TSR Silver Anniversary Collector's Edition (1999): On the first page, there is information that its content is updated for 2nd Edition, yet the cover still has the 1st Edition logo. There are, of course, many more examples; the ones I found so far are mostly of setting-specific books (Forgotten Realms, Greyhawk, Dark Sun, etc.). | , each of which has loads of rules, source, and splat books. But how do I know which edition the books I'm looking at are for? A lot of the time the ones in hobby stores are wrapped up, or you'll buy from elsewhere that doesn't say in the description, and the covers just say D&D. Is there a way to identify which edition of D&D the books I'm buying are for, either from the cover or some description in the book? For the purposes of this question I'm asking about core rule books only. Eg. PHB, MM, and DMG. Hopefully the answer to this can be carried over to other books. |
I went ahead and upgraded from Mint 17.2 to Ubuntu 15.10 on my Acer ES1-511-P1T9 with Bay Trail n3530 CPU and so far am having amazing performance over Mint 17.2 (almost 70-80% performance increase) however the system has started freezing. It seems to be when hitting the 4gb+ of memory in use (8gb installed). I've run a full memtest (about 3-4 hours) on the 8gb stick and am not seeing any errors. I've read a few things about issues with the new Intel HD linux drivers causing issues, has anyone else seen this with the Bay Trail CPUs? I'm hesistant to pull the 8gb and reinstall the 4gb as its such a pain removing the whole motherboard to do so lol if there is any chance that it's something else. Edit: Under 8.1 Pro x64 system is fully stable. Under 15.04 system is fully stable however performance is horrible (actually worse than under Win8.1). Fresh install of 15.10 yields a freeze usually within 10 minutes even with 0 applications running and wifi disabled. This sucks :( I don't want to use Win8.1 lol | My system freezes completely at random, frequent intervals. I started to have the same problem in Ubuntu 14.04 but after recent upgrade to 16.04 there is no improvement, in fact it seems worse. When it happens, it's impossible to do anything. I've tried everything in this thread: but nothing works, I have to hard reset. I have read all the system logs and journalctl but there is never any information that could help diagnose the problem. This is a dual-boot system with Windows 10 and there's no problem there, so it's not defective hardware. My laptop has an Intel Bay Trail processor (Pentium N3540) |
So I changed my name on my profile but when I go to it in the leaderboards, it still has my old name instead of my new one. Does anyone know how to fix this? Thanks! | I would like to change my Geometry Dash username. I know how, but will all my posted levels still have my old name and will changing the username negatively affect them? I have changed my name and waited, but it still lists me as my old name when commenting, and viewing my name on levels. The only place it shows my updated name is when you are actually on my profile. Is there a way to get it to display my new name and not my old name? |
Is it possible to call javaScript from <apex:commandButton> ...? | I have a custom search page for use in Customer Portal. VF Page: <form name="frmSearch"> <input type="text" name="keyword" id="keyword" value="{!portalSearchModel.searchTerm}" onkeypress="return noenter(event);" style="width:25%; height:25px;margin:0; padding: 0px 6px 0px;" placeholder="What are you looking for?" /> <input type="button" id="btnSearch" name="btnSearch" value="Search" onclick="searchTerm()" class="go-we3" /> </form> <script type='text/javascript'> function searchTerm(){ var searchTerm = document.getElementById("keyword").value; var url="/apex/PortalSearch?s="+searchTerm; window.location = url; return false; } </script> Is there a way to call this apex method in Controller on button click along with the JavaScript? public void logSearchTerm(){ portalSearchModel.searches(); Search_Log__c sl = new Search_Log__c(); sl.search_term__c = portalSearchModel.searchTerm; sl.user__c = UserInfo.getUserId(); insert sl; } |
Even though the field becomes infinite near the charge a gaussian surface can pass through the continuous charge distribution and have a finite value of flux. How? | The Electric field lines coming out of a charge are infinite, So the lines passing through a closed surface should be infinite , right? |
While I was executing a C program in terminal I wrote: gcc -o demo demo.c ./demo Actually my doubt is why we write ./ before demo and what does it mean? | While executing a C program, a.out, using the Ubuntu terminal, why do I always need to type ./ before a.out, instead of just writing a.out? Is there solution for this? |
I have a large amount of data associated with latitude/longitude in a database (currently housed in MS SQL Server). For the data, I would like to use SQL to calculate the distance from a user derived lat long and then use this distance in an (IDW) algorithm. I want to do this in SQL rather than inside of a GIS because the data is quite honestly large and complex and I have a tendency to not rely on ArcGIS to do these calculations. I was wondering if there are SQL implementations of IDW algorithm out there that some could share. As stated in the link above, IDW is NOT a distance calculator rather the IDW algorithm is an INTERPOLATION function which uses distance as an input. Please remove the duplication status. | I've got a working PHP script that gets Longitude and Latitude values and then inputs them into a MySQL query. I'd like to make it solely MySQL. Here's my current PHP Code: if ($distance != "Any" && $customer_zip != "") { //get the great circle distance //get the origin zip code info $zip_sql = "SELECT * FROM zip_code WHERE zip_code = '$customer_zip'"; $result = mysql_query($zip_sql); $row = mysql_fetch_array($result); $origin_lat = $row['lat']; $origin_lon = $row['lon']; //get the range $lat_range = $distance/69.172; $lon_range = abs($distance/(cos($details[0]) * 69.172)); $min_lat = number_format($origin_lat - $lat_range, "4", ".", ""); $max_lat = number_format($origin_lat + $lat_range, "4", ".", ""); $min_lon = number_format($origin_lon - $lon_range, "4", ".", ""); $max_lon = number_format($origin_lon + $lon_range, "4", ".", ""); $sql .= "lat BETWEEN '$min_lat' AND '$max_lat' AND lon BETWEEN '$min_lon' AND '$max_lon' AND "; } Does anyone know how to make this entirely MySQL? I've browsed the Internet a bit but most of the literature on it is pretty confusing. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.