body1
stringlengths 20
4.1k
| body2
stringlengths 23
4.09k
|
---|---|
A while ago, I thought one could use trigonometry. Simply have the actors hold the base of the light saber, and the stick part would be generated by the computer. | , the the props are made of wood. Also, due to the brittleness of the stunt blades used during this fight, which were little more than wooden dowels, Diamond was forced to instruct Alec Guinness and David Prowse to stop their blades before contact due to their fragility. If there isn't any particularly special feature about the props to separate them from the rest of the image, were they done manually? How were the lightsaber effects accomplished? I'm interested in all the movies, but mainly episode IV/original trilogy. |
I have a valid US visa as I study there. I am returning back home via Germany. Do I need a transit visa in Germany? Also, the ticket has no information about the flight terminals. | I found many related questions on this site but I am still not sure about the rules. How can I decide if I need a visa to transit? Schengen members as of May 2021 are as follows: Austria Belgium Czech Republic Denmark (excluding Greenland and the Faroe Islands - but an open border with the Schengen Area is maintained) Estonia Finland France (excluding overseas departments and collectivities) Germany Greece Hungary Iceland Italy Latvia Liechtenstein Lithuania Luxembourg Malta Netherlands (excluding Aruba, Curaçao, Sint Maarten and the Caribbean Netherlands) Norway (excluding Svalbard) Poland Portugal Slovakia Slovenia Spain (except Ceuta and Melilla) Sweden Switzerland |
I want to use temporary Xubuntu without installing on the PC. Also, I want to keep my system empty after removing the bootable USB drive. It will be great if you could suggest how the below might be achieved: Try Ubuntu option should be automatically selected. Ubuntu OS should be run temporarily when power is on (without selecting any option manually). As soon as USB is removed the system should stay empty again. | I am creating a custom live CD based on Ubuntu 15.10. When the user sees the first boot screen (and doesn't press a key), it will automatically boot into a GUI menu where the user can choose 'Try Ubuntu' or 'Install Ubuntu': However, if the user presses a key, it gets a text menu. Selecting 'Try Ubuntu' boots directly into the desired live CD: I can successfully remove the installer boot entries in the text menu (isolinux/txt.cfg), but this doesn't change the default boot option when the user does not press any key. Removing the installation package ubiquity is not an option, I just want to prevent the user from starting the installer directly. How can I change the default boot option to boot into 'Try Ubuntu'? |
Why I can't implicitly convert Generic<T> to GenericSetted : Generic<T> ? This driving me insane: Declaration: class GenericParam<T> { } class WithGenericParamAndGeneric<G, T> where G : GenericParam<T> { } Implementation: class Generic : GenericParam<string> { } class Inherited : WithGenericParamAndGeneric<Generic, string> { } Trouble: void Assign() { WithGenericParamAndGeneric<GenericParam<string>, string> b = new Inherited(); //(!) } Error: Cannot implicitly convert type 'Inherited' to 'WithGenericParamAndGeneric<GenericParam<string>, string>' I do not know the reasons in which case CLR can't process this case. | It seems that a List object cannot be stored in a List variable in C#, and can't even be explicitly cast that way. List<string> sl = new List<string>(); List<object> ol; ol = sl; results in Cannot implicitly convert type System.Collections.Generic.List<string> to System.Collections.Generic.List<object> And then... List<string> sl = new List<string>(); List<object> ol; ol = (List<object>)sl; results in Cannot convert type System.Collections.Generic.List<string> to System.Collections.Generic.List<object> Of course, you can do it by pulling everything out of the string list and putting it back in one at a time, but it is a rather convoluted solution. |
Can a matrix 3x3 have 2 solutions? Can it be determined somehow without solving it? For other type of matrix, how do you determine the number of solutions without solving it? Thanks! | How would you go about proving that for any system of linear equations (whether all are homogenous or not) can only have either (if this is true): One solution Infinitely many solutions No solutions I found this a bit difficult to prove (even though its a very fundamental thing about any linear equation). The intuitive geometric explanation is that a line can only intersect at one point, and if it intersects at a later point, it can't be a linear equation, but I don't think this is a convincing proof. I thought of if you assume that there are two (or more, but I picked two) solutions for some linear system, then for the points in between Solution Set 1: X1, X2....., Xn Solution Set 2: X1, X2....., Xn Then (I think), the points between S1 and S2, must be infinitely many points (and thus infinitely many solutions) such that these points can also satisfy the linear system, which would mean the system has 2 infinite solutions. However, I don't think this is rigorous enough and nor do I understand completely why its true. Can anyone help in explaining (correcting) and elaborating on the intuition and proof of this? |
I'm improving upon the motion path in Blender. As it is now, the motion path is something that needs to be calculated for each bone, then updated manually. I want to make the motion path (for the active bone) update every time I change something in the graph editor. I have this simple script: import bpy bpy.ops.pose.paths_update() That I want to trigger, every time I make a change in the graph editor. Is this possible? Is there a simpler way of doing it, rather than trigger a script? What I currently have, is the above script as an operator. I then reference this operator with a hotkey. But I want to remove the need for a hotkey. | Blender's application handlers are listed , but is it possible to create a new one? For example, I'd like an application handler which is a callback for every time I add a strip to the Video Sequence Editor. |
This particular question was asked in quiz yesterday and I was unable to solve it. Suppose f and g are entire functions and g(z) $\neq$0 for all z $\epsilon \mathbb{C} $ . If |f(z) |$\leq$ |g(z) | , the which one of them is true. 1.f is a constant function. 2.f(0) =0 . 3.for some C $\epsilon \mathbb{C} $ , f(z) = C g(z) . 4.f(z) $\neq$ 0 for all z $\epsilon \mathbb{C} $ . 4 th option can be removed by taking f(z) =0 and g(z) =2 . But I am unable to find any way to remove rest of options. | Let $f$ and $g$ be entire functions and $g(z)\neq 0$ for all $z\in \mathbb{C}$. If $|f(z)|\le |g(z)|$, can we say $f$ is constant? Liouville theorem says that an entire bounded function is constant, but g is not given bounded here. So I think it should be false. What else can we say about $f$? |
So I'm on a dual boot machine and was wondering if there was any way I could expand the root partition (Booted into Windows or Ubuntu) because I accidentally allocated too little space when setting up. Here's a . I just want to know if I am able to allocate some of the memory in the unallocated area to root, thanks in advance. | Previously, I have installed Windows 7 on my 320 GB laptop with three partitions 173, 84 and 63 GB each. The 63 GB partition was where the Windows was installed. The rest were for file containers. Now I changed my OS to Ubuntu 12.04 LTS. I installed Ubuntu by replacing the entire Windows 7 on the 63 GB partition. The rest of the partitions remain as an NTFS Windows partition and I can still access them both (the 173 and 84 GB partitions). Now I want to change the two partitions of Windows into an Ubuntu format partitions plus most importantly, I want to extend the 63 GB partition to more than a 100 GB because at the moment I am running out of disk space. Whenever I try to install any application, especially using wine, it always complains for a shortage of disk space. How do I do the extending activity before I entirely format my laptop again and lose all the important files on my partitions? |
I was benchmarking if it is worth to put loop inside a callback function so I tested fourth order Runge-Kutta of on y'=y in C++, all with gcc 5.1 on Ubuntu with compilation command g++ -std=c++11 -O3 -march=native --fast-math test.cpp The Runge-Kutta loop double dt=(t_end-t_0)/N; auto y=y_0; auto t=t_0; for(size_t k=0;k<N;++k) { auto k_1=f(k*dt, y); auto k_2=f(k*dt + 0.5*dt, y + 0.5*dt*k_1); auto k_3=f(k*dt + 0.5*dt, y + 0.5*dt*k_2); auto k_4=f(k*dt + dt, y + dt*k_3); y+=dt*(k_1 + 2*k_2 + 2*k_3 + k_1)/6.0; } return y; Inlining was achieved by a template and a function object. For dynamic binding a function pointer was used. The Pentium M Specs as given by /proc/cpuinfo cpu family : 6 model : 13 model name : Intel(R) Pentium(R) M processor 1.73GHz stepping : 8 microcode : 0x20 Frequency from sudo cpufreq-info current policy: frequency should be within 800 MHz and 1.73 GHz. The governor "userspace" may decide which speed to use within this range. current CPU frequency is 1.73 GHz (asserted by call to hardware). Results ODE solution exp(1) diff Execution time Function pointer 2.718281828037378 2.718281828459045 -4.21667145644733e-10 53321972 Inlined call 2.718281828037378 2.718281828459045 -4.21667145644733e-10 19916460 The Prescott: Specs as given by /proc/cpuinfo cpu family : 15 model : 4 model name : Intel(R) Pentium(R) 4 CPU 3.40GHz stepping : 3 microcode : 0x5 Frequency from sudo cpufreq-info current policy: frequency should be within 2.80 GHz and 3.40 GHz. The governor "userspace" may decide which speed to use within this range. current CPU frequency is 3.40 GHz. Results ODE solution exp(1) diff Execution time Function pointer 2.718281828037378 2.718281828459045 -4.21667145644733e-10 70811683 Inlined call 2.718281828037378 2.718281828459045 -4.21667145644733e-10 19928642 Comparison and question So the Prescott performs no better (it seems to be much worse), than the much lower clocked Pentium M. Sure, Prescott had a very long pipeline, but my code is highly predictable since N=2^30. So what makes the Prescott that slow despite its high CPU frequency? | Why, for example, would a 2.66 GHz dual-core Core i5 be faster than a 2.66 GHz Core 2 Duo, which is also dual-core? Is this because of newer instructions that can process information in fewer clock cycles? What other architectural changes are involved? This question comes up often and the answers are usually the same. This post is meant to provide a definitive, canonical answer for this question. Feel free to edit the answers to add additional details. |
I have two hard drives in my computer and would like to install Ubuntu 18.04.3 on the second hard drive. I wanted to know if there is any way to install it without leaving my main drive? | I have 2 1tb hard drives on my computer with Windows 8 on the first hard drive and nothing on the other. I want to install Ubuntu 14 on the second hard drive. I've looked up some guides and they all say to install Ubuntu on the sdb partition when booting off a usb stick. I have also seen some say to unplug the Windows HDD and then install Ubuntu onto the second HDD, and Ubuntu will automatically detect Windows and ask what you want to boot into upon boot. I am really concerned about this - Will it ask me to choose what OS I want to boot into? Is there something like rEFInd(Mac) for Windows? Can anyone please give me a guide on how to do it without ruining my computer? Thanks |
Hello I'm following some tutorial on Blender 2.5. Author shows how to use Bevel on cube's edge. Here is simple code (edit mode is on): cube = bpy.context.active_object cube.data.edges[0].bevel_weight = 1.0 But when i try this code in Blender 2.69/2.71, I can't see any changes. When I do it by shortcut ctrl+b it works | I need to set weights for some edges from a python script. I have tried looping through object.data.edges and setting bevel_weight values but I can't get it right. It only works if I have first edited some edge's bevel weight by hand from the 3d-view's transform window. But I would like to get it work from my script without any manual hacking. Steps to reproduce: Start Blender with default cube and switch to Scripting view. Try to set weights for all edges: for edge in C.object.data.edges: edge.bevel_weight = 1.0 Verify that values changed: for edge in C.object.data.edges: edge.bevel_weight Switch into edit mode in 3d-view and open up transform window by pressing n. Select edges to see that the change did not work (bevel weights are all zero). Switch back to object mode and read values again in scripting console to see that they were reset to zero: for edge in C.object.data.edges: edge.bevel_weight Go back to edit mode and change some edge bevel weight straight from the transform window by hand. Go back to object mode and change values again from the scripting console: for edge in C.object.data.edges: edge.bevel_weight = 1.0 This time it works, bevel weights are 1.0 when you go back to edit mode and look from the transform window. Any ideas? My final need is to apply a bevel modifier to only some set of edges and that's why I'm trying to mark them by using weights. Using vertex group for bevel modifier does not work in my situation, since I need to specify edges, not vertices, which to bevel. I'm using Blender v2.71. |
So here is their . And here is the . How did the person in question, who has 1 rep, comment on a question? | Yesterday I wanted to comment on a question on Stack Overflow, but I don't have 50 reputation points. The question is that I referred in my answer to another Stack Overflow question, and my response had showed as a comment. It is correct?? I don't know if this is a bug. This is the question: And now my rep is 47. |
I have created a file that contains arithmetic expressions, one per line. How can I evaluate the expressions and display the results, from the command line? The file looks like this: 1 + 2 6 * 4 97 % 12 43215 / 43 * 100 The goal is to output each result, in order, also one per line. I recall there is a way to do this that only requires one command, and that command used might start with w, but I can't remember how. | I am looking for a Calculator which can do calculations in the terminal itself without any other extra prefixes and suffixes. For example: If I typed something like 10000-9000 in the terminal, the answer should come out as 1000. Once again I am saying, I just need a quick calculator in terminal, without any characters added. I know if I switch to Python, it can do that but I don't want it in such a way. |
I am trying to connect 2 separate paths somewhere along its centre, see picture: Is there a way to do this? | I want to extrude a curve in two directions. Or join both curves into one, is it possible? I've tried copying it and then join segments, but I don't see Remove Doubles option while working with curves. |
Problem statement: Let $Y$ be an ordered set in the order topology and $X$ a topological space. $f,g:\, X\to Y$ are continuous. Show that $\{x\mid f(x)\leq g(x)\}$ is closed. My thoughts: In case $Y=\mathbb{R}$ I would define $h=g-f$ and say that the above set is $h^{-1}([0,\infty))$ which is closed by continuity of $h$. But in an ordered set $Y$ there is no meaning of $g-f$. Can someone give me a hint ? | Let $Y$ be an ordered set in the order topology with $f,g:X\rightarrow Y$ continuous. Show that the set $A = \{x:f(x)\leq g(x)\}$ is closed in $X$. I am completely stumped on this problem. As far as I can tell I've either got the task of proving $A$ gathers its limit points, or showing that there is a closed set $V \subset Y$ such that $f^{-1}(V)$ or $g^{-1}(V)$ is equal to A, which would prove $A$ closed since both $f$ and $g$ are continuous. The latter strategy seems like the more likely to succeed. Unfortunately I can't find any way of constructing this set $V$. The fact that I don't know if $f$ or $g$ are injective means I keep running into the problem of having $f^{-1}(V)$ or $g^{-1}(V)$ give me extra points not in $A$. And even if I were able to construct $V$ this wouldn't guarantee it was closed. I suspect I may need to use the continuity of both $f$ and $g$ together in some way but I can't see how. Can anyone give me some guidance on this problem? Thanks. |
Let's say I have a Header element which has various content that is determining its height rather than a set property. Is it possible to get that height using CSS only? I want that in order to know how much vertical space I have left on the page and size a video div accordingly. If I had the dimension set manually I could just use height: calc(100vh - headerHeight); sample: <header> <p>something</p> </header> <div> </div> header { background-color: yellow; margin: 0; } p { font-size: 2em; padding: 0.5em; margin: 0; background-color: pink; } div { background-color: blue; height: 100vh; /* This should adjust so it doesn't overflow-y.*/ } | I am working on a web application where I want the content to fill the height of the entire screen. The page has a header, which contains a logo, and account information. This could be an arbitrary height. I want the content div to fill the rest of the page to the bottom. I have a header div and a content div. At the moment I am using a table for the layout like so: CSS and HTML #page { height: 100%; width: 100% } #tdcontent { height: 100%; } #content { overflow: auto; /* or overflow: hidden; */ } <table id="page"> <tr> <td id="tdheader"> <div id="header">...</div> </td> </tr> <tr> <td id="tdcontent"> <div id="content">...</div> </td> </tr> </table> The entire height of the page is filled, and no scrolling is required. For anything inside the content div, setting top: 0; will put it right underneath the header. Sometimes the content will be a real table, with its height set to 100%. Putting header inside content will not allow this to work. Is there a way to achieve the same effect without using the table? Update: Elements inside the content div will have heights set to percentages as well. So something at 100% inside the div will fill it to the bottom. As will two elements at 50%. Update 2: For instance, if the header takes up 20% of the screen's height, a table specified at 50% inside #content would take up 40% of the screen space. So far, wrapping the entire thing in a table is the only thing that works. |
let $n=\mid V\mid$ base case: let $n=0$. Thus lemma becomes vacuously true since both bipartitions will contain the empty set thus not a bipartite graph. Inductive step: let $k\in\mathbb{N}$, assume $P(k)$ show P(k+1): $\forall G=(V,E), k+1 = \mid V \mid\Rightarrow \mid E\mid\leq\frac{(\mid k+1\mid)^{2}}{4}$, where G is bipartite I'm having trouble the inductive step, here's my intuition of how I think I should approach. create a subproof to show max possible edges in bipartite graph is when both bipartitions of V has the same size. Then we can assume if a bipartite graph is complete then proposition is satisfied for case 1. I think for Case two, prove for when # of edges are less than the max? | Prove that for a bipartite graph $G$ on $n$ vertices the number of edges in $G$ is at most $\frac{n^2}{4}$. I used induction on $n$. Induction hypothesis: Suppose for a bipartite graph with less than $n$ vertices the result holds true. Now take a bipartite graph on $n$ vertices.Let $x,y$ be two vertices in $G$ where an edge exist between $x$ and $y$. Now remove these two vertices from $G$ and consider this graph $G'$. $G'$ has at most ${(n-2)^2}\over4$. Add these two vertices back. Then the number of edges $G$ can have is at most $$|E(G')|+d(x)+d(y)-1$$ My question is in my proof I took $d(x) + d(y) \le n$, where $d(x)$ denotes the degree of vertex $x$. Can I consider $d(x)+d(y) \leq n$? I thought the maximum number of edges is obtained at the situation $K_{\frac n 2,\frac n 2}$ |
I bit the bullet and upgraded to iOS 9.1, and the phone now moves like it's an iPhone 3GS. I can see iOS 8.x is no longer signed, but fortunately I have SHSH of iOS 8.2 saved. How can I downgrade without losing my warranty? I've heard jailbraking will void warranty, but I guess jailbraking then flashing an iOS version that removes the jailbreak should allow my phone to still be in warranty. PS: This is not a duplicate of , because it talks about restoring from IOS9 to usinged IOS8 version with SHSH blobs. | I'm trying to downgrade my iPhone from the current iOS to an older one, as per . But every time I try, I always receive this error: The iPhone could not be restored. This device isn't eligible for the requested build. I have tried many times with and without DFU mode. Any ideas regarding this? |
I believe the first of the code examples is a short-hand Singleton implementation and I'm not sure if it is thread safe. As the class, EventSourceLogger derives from EventSource, which is not static, this class can not just be a static class itself (which would have been even more convenient - tradeoffs between singletion and static notwithstanding). I reverted from a more thorough specific known thread safe implementation to this implementation for brevity - after liking the look of this approach in a colleagues code. What have I lost? Current implementation [EventSource(Name = "EventSourceLogger")] public class EventSourceLogger : EventSource { public static readonly EventSourceLogger Logger = new EventSourceLogger();` } Previous implementation [EventSource(Name = "EventSourceLogger")] public class EventSourceLogger : EventSource { private static EventSourceLogger instance; private EventSourceLogger() { } public static EventSourceLogger Instance { get { if (instance == null) { instance = new EventSourceLogger(); } return instance; } } } | In other words, is this Singleton implementation thread safe: public class Singleton { private static Singleton instance; private Singleton() { } static Singleton() { instance = new Singleton(); } public static Singleton Instance { get { return instance; } } } |
while I'm learning for exams i need often to search multiple pdf files for some text. I have done it till now using adobe reader.The Problem is that adobe reader or all other pdf viewers i tried ("PDF-XChange Viewer","Foxit Reader" ..) have an unpratical search interface in the way that if one needs to choose another index folder one must navigate again all over through the way there! It also doesn't recognise shortcuts. I tried wingrep which is really good tool and its integrated into context menu but it doesn't support searching into pdf files :( also tried Docfetcher but it's not really user friendly and not integrated into the context menu. Is there any anyway anytool(except "Windows Search indexing") which let user navigate fast between index folders( like typing directory into address bar or a has search function in context menu) ? | I'm trying to get Windows Search (4.0) to index PDFs and .pub, .doc, etc. files. The files are on an XP Pro PC acting as a file server. But I don't have MS Office, etc. installed (no need, trying to keep it "slim and trim") but WS 4.0 is doing the indexing of those files and not indexing .pdf and .pub. I've found a few (from Foxit PDF reader) rated 3/5 and only support WS 2.0 or 3.0. Looking for other solutions and also a way to index .pub files. |
Suppose $z_1,...,z_n\in \Bbb C$ are complex numbers, not necessarily distinct, satisfying $$ z_1^k+\cdots +z_n^k=0$$ $ \color{red}{\forall\; k>0}$. Then is it true that $z_1=\cdots=z_n=0$? This will be obvious if the $z_i$'s were all real, but I'm wondering that this is true for the complex case. | Here is a statement that seems prima facie obvious, but when I try to prove it, I am lost. Let $x_1 , x_2, \dots, x_k$ be complex numbers satisfying: $$x_1 + x_2+ \dots + x_k = 0$$ $$x_1^2 + x_2^2+ \dots + x_k^2 = 0$$ $$x_1^3 + x_2^3+ \dots + x_k^3 = 0$$ $$\dots$$ Then $x_1 = x_2 = \dots = x_k = 0$. The statement seems obvious because we have more than $k$ constraints (constraints that are in some sense, "independent") on $k$ variables, so they should determine the variables uniquely. But my attempts so far of formalizing this intuition have failed. So, how do you prove this statement? Is there a generalization of my intuition? |
Which is more appropriate to use? I graduated at Harvard university Or I've graduated at Harvard university | Non-native speakers often get confused about what the various tenses and aspects mean in English. With input from some of the folk here I've put together a diagram that I hope will provide some clarity on the matter. I offer it as the first answer to this question. Consider it a living document. Input is welcome, and good suggestions will be incorporated into the diagram. Nota bene: What this is not is a discussion of whether there are more than two tenses in English. , to which this question is not intended to supply arguments one way or the other. Here, the aim is to provide an overview of what constructions English-speaking people use for conveying information about actions referring to past, present, and future, and to provide it first and foremost to precisely the people who are likely to use "tense" as a catch-all term in their search, rather than to linguists who know better. Breaking News There is now an excellent ELU blog article titled . It is highly recommended reading. |
When a file is double clicked in a file manager it is automatically opened using the application associated with the type of the file. How can I do the same from code. I am open to any programming language. I have a little experience with Python and C. My target operating systems are Ubuntu Linux and OSX. However, ideally I would like to find a solution that works with Windows, OSX, and Ubuntu linux. | I need to be able to open a document using its default application in Windows and Mac OS. Basically, I want to do the same thing that happens when you double-click on the document icon in Explorer or Finder. What is the best way to do this in Python? |
Supeeer new to Latex so I'm sorry if my question is stupid. I have a programming assignment using pseudo-code for one of my courses. Our professor suggested we do the assignment using LaTeX. Can anyone guide my how to format the code using LaTeX? I should make it look like this: Thanks in advance! | I have defined my own language whose syntax is very close to the one of Pascal. I would like to type the following program for instance. Many people use the packages algorithmicx or algorithm2e to print programs, but it seems that we have to use their specific keywords of its syntax like procedure, end while. I just want to indent spaces when needed, and bold some words when I want (sorry that I could not bold letters in the following figure). Do I have to use texttt for each line? Also, with verbatim, I could not bold words... Also, as the program is not large, I would need to put it on the left side of the page, and leave space for some explanasion text on its right hand side. So I guss I need to get them all together, and use multicols. Could anyone help? program test some text here var i : integer; ... b : boolean; begin i := 1; ... b := true; while i < 15 do i := i + 1; b := not b some text here od end Edit1: Following @Werner's tabbing solution, I have made the code a minipage: \begin{minipage}[t]{0.48\linewidth}% \begin{tabbing} Werner's solution \end{tabbing} \end{minipage}\hfill \begin{minipage}[t]{0.48\linewidth} a paragraph \end{minipage} Actually as the code shows, I want the texts to be another separated minipage on the right hand side of the code. I have then 2 questions: is it reasonable to make 0.48\linewidth instead of 0.5\linewidth? 0.48\linewidth is a conventional choice? is it possible to make a frame around the code, and use \caption and \label to make it a reference (I prefer figures)? |
Let $x_1,x_2,\dots,x_n$ be independent identically distributed random variables uniform on $\{1,2,\dots,N\}$, and let: $Y_n:=\text{the number of different elements in } \{x_1,x_2,\dots,x_n\}$. Let $T:=\inf\{n:Y_n=N\}$. What is $E\left[T\right]$? | What is the average number of times it would it take to roll a fair 6-sided die and get all numbers on the die? The order in which the numbers appear does not matter. I had this questions explained to me by a professor (not math professor), but it was not clear in the explanation. We were given the answer $(1-(\frac56)^n)^6 = .5$ or $n = 12.152$ Can someone please explain this to me, possibly with a link to a general topic? |
I have a list of 20000 email id which have emails from domains like gmail, ymail, gmx, hotmail, custom domains etc I have those list in a spreadsheet Column A. Can you help me separate them according to their domain in different columns? For example gmail ids in column B and ymail in column C and so on.... | I have a txt file which has around 20000 email id. I want to know email count from gmail, yahoo, ymail, googlemail, aol, live,custom domain, gmx, and other temporary emails separately. And also i need to filter them and sort them in email domain order. How can i do that using notepad++? If any other program make this much easier than notepad ++ please refer that too. |
I am passing data through a bean, but whenever I use the passed data in a if function it never passes the first check. I will also post the result for just printing out the Get_Functions I am using. The inputs I use are just admin and password. JSP Code: <jsp:useBean id="user" class="User.GetInfo" scope="session"/> <HTML> <BODY> <% if (user.getUsername() == "admin") { if (user.getPassword() == "password" ) { session.setAttribute( "LoggedIn", true ); response.sendRedirect("AdminPage.jsp"); } else { session.setAttribute( "LoginError", "Wrong password." ); response.sendRedirect("AdminLogin.jsp"); } } else { session.setAttribute( "LoginError", "Wrong username." ); response.sendRedirect("AdminLogin.jsp"); } %> </BODY> </HTML> Results for just printing out code: You entered Name: admin Email: password | I've been using the == operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug. Is == bad? When should it and should it not be used? What's the difference? |
I'm planning a trip to South-Korea in April. I was looking at flight ticket prices and found that I can go from Brussels to Seoul (and back) for about 600€. It lands in London however. I then tried to find the same flight but from London (I was expecting I could get the price even more down if I'm not doing BRU-LHR), but no search engine found it and the cheapest was at about 700€. Here you can see what I'm talking about in action: It's the same date and everything, and it's much cheaper from Brussels although it lands in London. Question: This seem really strange. Why does this happen, and is it possible to buy the ticket from Brussels but only get on the plane from London? | Usually I find a flight I like that uses one or more connections with the same or different companies. In these cases, if the distance between the first and the second connection is not too large, I prefer to go by bus or train and then take the flight. The problem is that sometimes it is more expensive to take the flight in the second airport than to take the flight from the first one. I mean, I'm wondering why sometimes it is more expensive to take only a flight than to take the same flight and another one. A practical example (and real, you can check with SkyScanner). Imagine I am in Madrid (Spain) and would like to go to Rio de Janeiro (Brazil) on April 1st. The cheapest flight I have found is this: TAM airlines: MAD -> GRU -> GIG : 507 € Fantastic! GRU is one of São Paulo's airports. That's perfect for me! I'll go on to Rio traveling overland. But then, I look for this flight (MAD -> GRU, non-stop): TAM airlines: MAD -> GRU : 597 € It's the same flight, 90 € more expensive! I've found this kind of behavior a lot of times and I'm intrigued to know why it happens. |
I have both Windows 7 x64 and Ubuntu 16.04 x64 installed on my laptop. I figured out that the Windows 7 option no longer appears on dual boot. | So, I've successfully dual-booted my Windows 8 machine with Ubuntu 12.04 . However, I still don't have a convenient method of choosing what OS to load at boot time. After installing Ubuntu, my computer still loads Windows 8 directly. I then added grubx64.efi to the white list of my boot loader. But after that, my machine loads Ubuntu directly without even a shadow of GRUB showing up! I used boot-repair and I got this paste.ubuntu URL: . After running boot-repair (and re-white listing the grubx64.efi file), GRUB now shows up but without any Windows 8 option! Lastly, I ran sudo fdisk -l and it gave me this: WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted. Disk /dev/sda: 750.2 GB, 750156374016 bytes 255 heads, 63 sectors/track, 91201 cylinders, total 1465149168 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk identifier: 0x6396389f Device Boot Start End Blocks Id System /dev/sda1 1 1465149167 732574583+ ee GPT Partition 1 does not start on physical sector boundary. I'm guessing my problem has something to do with the warning from fdisk above but I don't know what to do with it. How do I proceed now? Edit My etc/default/grub is as follows: # If you change this file, run 'update-grub' afterwards to update # /boot/grub/grub.cfg. # For full documentation of the options in this file, see: # info -f grub -n 'Simple configuration' GRUB_DEFAULT=0 #GRUB_HIDDEN_TIMEOUT=0 GRUB_HIDDEN_TIMEOUT_QUIET=true GRUB_TIMEOUT=10 GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian` GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" GRUB_CMDLINE_LINUX="" # Uncomment to enable BadRAM filtering, modify to suit your needs # This works with Linux (no patch required) and with any kernel that obtains # the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...) #GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef" # Uncomment to disable graphical terminal (grub-pc only) #GRUB_TERMINAL=console # The resolution used on graphical terminal # note that you can use only modes which your graphic card supports via VBE # you can see them in real GRUB with the command `vbeinfo' #GRUB_GFXMODE=640x480 # Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux #GRUB_DISABLE_LINUX_UUID=true # Uncomment to disable generation of recovery mode menu entries #GRUB_DISABLE_RECOVERY="true" # Uncomment to get a beep at grub start #GRUB_INIT_TUNE="480 440 1" Also, just for the record, in installing my dual-boot. The tutorial (which uses, 11.10, I must note), doesn't mention anything about this problem. Is there anything there I shouldn't have done? |
I have a question about econometrics in general. If I have a regression with an interaction between two dummies, do I need to have those dummies separated in the regression too. I have this regression: is this right? $$ y_i=\beta_0 + \beta_1d\_sex_i*d\_country_i +\beta_2d\_country_i + \varepsilon_i $$ or do I need to do this: $$ y_i=\beta_0 + \beta_1d\_sex_i*d\_country_i +\beta_2d\_country_i + \beta_3d\_sex + \varepsilon_i $$ | Is it ever valid to include a two-way interaction in a model without including the main effects? What if your hypothesis is only about the interaction, do you still need to include the main effects? |
I am still having trouble understanding how voltage sources combine when they are connected in parallel. Consider the following circuit below: If we assume that the wires connecting the resistor to the two voltage sources are perfect (zero resistance), then we get what appears to be a paradox since the voltage at node 1 needs to be both 1V and 2V at the same time. In reality, this situation is resolved by the finite resistance that real wires possess. My misunderstandings occur when one of the voltage sources is an AC source such as below. In this case, is the voltage at node 1 really just a sum of the AC and DC sources? In this scenario, does this mean that the DC source outputs an AC current in order to maintain a constant voltage? Would this AC current coming from the DC source be in-phase with the current from the AC source in order to cancel out the AC source's effects on the DC source? Also, for real world applications, does this type of connection lead to any negative effects that would damage the AC or DC source? I've seen suggestions that using a capacitor or transformer would be better to add AC and DC voltages rather than connecting them directly. | I realize connecting two different voltage sources in parallel is a contradiction (in an ideal circuit). But if I were to connect this in practice and measure the voltage across points A and B, what value of voltage would it show? And how much current would be sunk by the 5V battery? (Non ideal conditions) |
I'm starting a course on algebraic structures in university, and this is one of the first problems. I want to know if my solution is valid. The question goes like this: Being $G$ non-empty semigroup (set with associative binary product). We know that $G$ verifies that: $\exists e\in G:ex=x \forall x\in G$ ("left" neutral element). $\forall x \in G, \exists y\in G : yx=e$ ("left" inverse element). Prove that $G$ is group. My solution goes like this: $$e=ee=(g^{-1}g)e=g^{-1}(ge)$$ Then necessarily $ge=g$, because $g^{-1}(ge)$ must be equal to $e$. So that proves that $e$ is in fact left and right neutral element of $G$. Now, we see that: $$g=ge=g(g^{-1}g)=(gg^{-1})g$$ and we conclude that $gg^{-1}=e$ because $(gg^{-1})g$ must be equal to $g$, so we conclude that $g^{-1}$ is left and right inverse element of $g$. Given this, I conclude that $G$ is in fact group. Is my reasoning correct? I'll thank any help. | Related Link: Reference: Fraleigh p. 49 Question 4.38 in A First Course in Abstract Algebra I will present my proof (distinct from those in the link) for critique and then ask my question. $G$ is a set and $ \times $ is an associative binary operation. Suppose that there exists a $e \in G$ such that, for all $a \in G$, $ea = a$ and $a^{-1}a = e$ for some $a^{-1} \in G$. Show that for the same $e$, $ae = a$ and $aa^{-1} = e$. $a^{-1}(aa^{-1})a = (a^{-1}a)(a^{-1}a) = ee = e = a^{-1}a = a^{-1}(a^{-1}a)a$ Since $a^{-1} \in G$, it has a left inverse; apply it to both ends, and we have $(aa^{-1})a = (a^{-1}a)a$. As a result, $ae$ = $a(a^{-1}a) = (aa^{-1})a = (a^{-1}a)a = ea$. For the right inverse, start with $aa^{-1} = a(a^{-1}a)a^{-1} = (aa^{-1})(aa^{-1})$. Since $\times$ is a binary operation, $aa^{-1} \in G$ and has a left inverse; apply it to both ends, and we have $e = aa^{-1}$. In second comment following the question in the link, Mr. Derek Holt pointed out that the requester did not word his/her question correctly. Specifically, the identity in the second axiom is not well-defined. Let $(G, *)$ be a semi-group. Suppose 1. $ \exists e \in G$ such that $\forall a \in G,\ ae = a$; 2. $\forall a \in G, \exists a^{-1} \in G$ such that $aa^{-1} = e$. How can we prove that $(G,*)$ is a group? This formulation makes the same technical error as many textbooks. The $e$ in your second axiom is not well-defined. "But obviously it's intended to be the same $e$ as in the first axiom" you reply. But the first axiom does not necessarily specify a unique element $e$. So should we interpret the second axiom as meaning "for some $e$ as in 1" or "for all $e$ as in 1"? – Derek Holt Sep 17 '11 at 15:31 Was he saying that if, in axiom 1, we have $ae_1 = a, ae_2 = a$, but $e_1 \neq e_2$, when we get to axiom 2, do we have $aa^{-1} = e_1, aa^{-1} = e_2$, or two different inverses so that $aa_1^{-1} = e_1, aa^{-1}_2 = e_2$? I think my wording eliminated the ambiguity. It does not imply that $e$ is unique, but if $e$ is a left identity and produces left inverses, then it is also a right identity and produces right inverses. I tried really hard on this one; please kindly point out my mistakes. |
I was using the Stack Exchange mobile website today and came across a title that messed up the layout a bit. Not sure whether this has been noted to the admins already. See screenshot of the issue: As can be seen, this is probably caused by the inline code environment in combination with a long string containing no spaces that is longer than allowed. | I’ve found a small, yet annoying, CSS-error in the mobile view of Stack Exchange. It seems like long titles breaks the style, which causes the up-vote arrow and the answer button to break the row and fall beneath the intended spot. From the looks of it, the title cell, or the tags, increase too much and causes this minor CSS-error. Is it possible to fix this? |
I want to define a literal object in Javascript so that, for example: myObject.foo() returns an anonymous function, but myObject.foo.bar() returns a different anonymous function, and myObject.foo.status equals some string, etc. Assume I'm starting with something like: var myObject = { foo: { bar: function () { ... }, status: "someString" } } How would I modify this accordingly? Is it proper syntax to add a static reference like: myObject.foo = function() { ... } My guess is that, if valid, that would override the definition of foo entirely. Is there an elegant way to achieve this? I am creating a literal object that maps directly to a REST API URL so there is consistency between the URL and its object reference. For example, if the relative URL for a particular API call is myObject/foo and another is myObject/foo/bar, then I would like the JS functions to be myObject.foo() and myObject.foo.bar(), respectively. | JavaScript allows functions to be treated as objects--if you first define a variable as a function, you can subsequently add properties to that function. How do you do the reverse, and add a function to an "object"? This works: var foo = function() { return 1; }; foo.baz = "qqqq"; At this point, foo() calls the function, and foo.baz has the value "qqqq". However, if you do the property assignment part first, how do you subsequently assign a function to the variable? var bar = { baz: "qqqq" }; What can I do now to arrange for bar.baz to have the value "qqqq" and bar() to call the function? |
I have created a script that works as expected in shell but cron job does not seem to run it. when I check my cron mail, I see that it prints "hltv is not running" but does not create a screen session. #!/bin/bash if [[ $(netstat -a | grep '27027') == *27027* ]]; then echo "tour 2 hltv is running" else echo "hltv is not running" /usr/bin/screen -A -m -d -S tour2 ./start_hltv +connect xxx.xxx.xx.xx:27015 -port 27027 +exec hltv.cfg fi I have replaced my ip with xx.xxx.xx.xxx for privacy reasons. Further details.. Well, I have a centos vps that I use for hltv (related to half life game) that runs on port 27027. Every once in a while, it crashes, so I was trying to create a script that would check if something is happening on that port and if not, it means process is crashed and need to start it. I created script and named it "autorestart" and ran chmod +x autorestart This is the output i get from my cron job mail, but screen -ls does not show tour2 as valid screen. Message-Id: <[email protected]> Date: Sat, 29 Mar 2014 22:17:01 -0400 (EDT) hltv is not running Thanks Edit. Got this working. #!/bin/bash if [[ $(netstat -a | grep '27027') == *27027* ]]; then echo "tour 2 hltv is running" else echo "hltv is not running" cd /usr/hlds/tour2 chmod +x ./run_hltv (run_hltv has screen command) sh run_hltv | This is a about using cron & crontab. You have been directed here because the community is fairly sure that the answer to your question can be found below. If your question is not answered below then the answers will help you gather information that will help the community help you. This information should be edited into your original question. The answer for 'Why is my crontab not working, and how can I troubleshoot it?' can be seen below. This addresses the cron system with the crontab highlighted. |
I'm trying to redirect www.domain.com to sub.domain.com except when url is www.domain.com/something and in that case keep it that way. I couldn't find any solution on the google and anytime I try to implement this in my own, I get www.www.domain.com. Thanks in advance! Options +SymLinksIfOwnerMatch Options -Indexes RewriteEngine on RewriteCond %{HTTP_HOST} !^www\. RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L] | I would like to redirect www.example.com to example.com. The following htaccess code makes this happen: RewriteCond %{HTTP_HOST} ^www\.example\.com [NC] RewriteRule ^(.*)$ http://example.com/$1 [L,R=301] But, is there a way to do this in a generic fashion without hardcoding the domain name? |
I have strings that contain white-space and punctuation characters that I want to decompose into individual characters. However, I want to avoid breaking up certain sub-strings that have a specific meaning such as ... or - or \n\r. For example, the string \n\r\n... .. - -.. should be decomposed into ['\n', '\r\n', '...', '.', '.', ' - ', '-', '.', '.'] I've tried using re.findall() and re.split() but without success. The following produced so far the best results (I included only some of the delimiters here to make the example shorter): delimiters = [ r'\r\n', r'\n', r' - ', r' ', r'...', r'\.', ] pattern = re.compile(r'(' + r'|'.join(delimiters) + r')') match = pattern.split('\n\r\n... .. - -..') print([m for m in match if m]) which gives ['\n', '\r\n', '...', ' ', '.. ', '- -', '.', '.'] This is very close but I don't understand why .. and - - are matched. | I am tired of always trying to guess, if I should escape special characters like '()[]{}|' etc. when using many implementations of regexps. It is different with, for example, Python, sed, grep, awk, Perl, rename, Apache, find and so on. Is there any rule set which tells when I should, and when I should not, escape special characters? Does it depend on the regexp type, like PCRE, POSIX or extended regexps? |
I want to know why there are two folders while we need one. Eg. Program Files and Program Files(x86) | I know that on a 64-bit version of Windows the "Program Files" folder is for 64-bit programs and the "Program Files (x86)" folder is for 32-bit programs, but why is this even necessary? By "necessary", I don't mean "why could Microsoft not have made any other design decisions?" because of course they could have. Rather, I mean, "why, given the current design of 64-bit Windows, must 32-bit programs have a separate top-level folder from 64-bit programs?" Put another way, "what would go wrong if I somehow avoided the redirection mechanism and forced everything to install to the real C:\Program Files\?" There are plenty of questions on Super User and elsewhere that assert "one is for 32-bit programs, one is for 64-bit programs", but none that I can find give the reason. From my experience, it doesn't seem to matter whether a 32-bit program is installed in the correct place or not. Does Windows somehow present itself differently to a program running out of "Program Files (x86)"? Is there a description that shows exactly what's different for a program installed in "Program Files (x86)" instead of "Program Files"? I think it's unlikely that Microsoft would introduce a new folder without a legitimate technical reason. |
I'm writing my dissertation and that involves typing a lot of $\mathrm{CO_2}$. I'd like to make a macro for it that's a lot easier to type, but if I put \newcommand{\co2}{\mathrm{CO_2}}, for example, it gives me the error that \mathrm can only be used in math mode. But using \newcommand{\co2}{$\mathrm{CO_2}$} doesn't work either. Is there a way for me to make a macro that makes typing CO_2 easier, even if it doesn't use \mathrm? | What is the 'best' package for typesetting chemical formulas? (I don't need anything but the chemical formulas.) Assume I want to typeset The dissociation of a AgBr molecure requires an energy of $E = \SI{123456789}{\J}$. I am using the package for the physical quantity but what about AgBr? |
I find the meaning of hyperparameters not always clear. The hyperparameters are defined as "the parameters of the prior". Suppose that one has prior information about a certain parameter $\theta$. More precisely, one supposes that $\theta \sim N(\mu_0, \sigma_0^2)$. In that case, the hyperparameters are given by $\mu_0$ and $\sigma_0^2$. But, what in case of a non-informative prior? What in case of a uniform prior? For instance, suppose we have the following model. We have data $y_1,\ldots,y_n$ where the likelihood is given conditionally on a parameter $\lambda$. Thus: $$y_i \ | \ \lambda \sim N\left(\mu,\frac{\sigma^2}{\sqrt{\lambda}}\right), \qquad \lambda \sim \Gamma(\nu/2,\nu/2)$$ with the non-informative prior $g(\mu, \sigma^2) \sim 1/\sigma$. So we have in fact three parameters $\lambda, \mu, \sigma^2$. What are the hyperparameters in this case? | Title says it all. I have seen both "the hyperparameter of the Dirichlet distribution" and "the parameter of the Dirichlet distribution" What are the differences? |
Frequently when I open a Unity C# script in Visual Studio, the built-in Unity Engine types aren't recognized, so I don't get syntax highlighting or code completion hints for things like MonoBehaviour. Sometimes if I delete the script and create a new one it works, but lately nothing I do solves the problem. Is there something I can do? | The strange thing is that opened scripts or newly opened ones are working fine. It's the new created C# scripts that are not working. With not working, I mean the MonoBehaviour is not in light blue color it's in black color. In this screenshot I took, I marked it with a red circle. What have I tried so far? I have closed Visual Studio and started over again. Since it didn't solve it, I closed the unity editor and started it over again, to no avail. I pressed 'clean solution', I pressed 'rebuild solution', I pressed 'build solution'. What else can I do ? And why are the other scripts working fine? If I type gameo...it will auto complete it to GameObject but in this specific script it's just not working. This is a screenshot of the editor. I have in the Hierarchy a Ladder object. In the Assets I created a folder name Ladder and a script name Ladder. But this Ladder script is not working. This is the Ladder script and this script was working before but once I created another script inside the ladder folder name Raise empty script the Raise script didn't work and now the Ladder is not working either. But other scripts are working fine. using System.Collections; using System.Collections.Generic; using UnityEngine; public class Ladder : MonoBehaviour { public Transform charcontroller; private bool inside = false; private float heightFactor = 3.2f; private void OnTriggerEnter(Collider other) { inside = true; } private void OnTriggerExit(Collider other) { inside = false; } private void Update() { if (inside == true && Input.GetKey("w")) charcontroller.transform.position += Vector3.up / heightFactor; } } |
Is there a way to get statistical information in Blender for an individual object, not all objects in the scene, how to view statistics of a separate selected grid, each time switch to the mode editing, even with the TAB hotkey, is very inconvenient ... It is also not clear why the transition to the local view with the key - / also does not help to see the statistics of a separate object, only the editing mode how so? | I am trying to access the triangle count of an object with Python. All other python code displays itself when I hover my mouse over the corresponding button in the interface. When I go to the info bar and hover my mouse over the triangle count, nothing appears. When looking in the documentation around data, there doesn't appear to be any clear function to call to get this info. |
Saldana—Choi’s lawyer—started the argument. Saldana (Choi's lawyer) started the argument. Saldana, Choi's lawyer, started the argument. Sometimes I have trouble figuring out which one I should use. Can someone please explain to me when I should each one of these? The definitions I've found online are very similar to each other. | When do you use commas and when do you use parentheses to provide more detail about something? For example: The suspect, Tom Wilson, is now being charged with murder. The suspect (Tom Wilson) is now being charged with murder. John Smith, a member of the jury, agreed with the verdict. John Smith (a member of the jury) agreed with the verdict. The first example, the one about the fox, is the more valid one. The first example (the one about the fox) is the more valid one. I realize that the first example, the one that uses parentheses, is probably more valid in this case (if anyone has a better example, please include it), but when, if ever, would you favor parentheses? Update: I realize that dashes are sometimes used for similar situations, so I'd appreciate information on these as well. For example: The children—who are wearing shoes—will go on the trip The children, who are wearing shoes, will go on the trip The children (who are wearing shoes) will go on the trip |
Let's say I have the following df: import pandas as pd df = pd.DataFrame({'A':['1^','2','3'], 'B':['1^','2','3'], 'C':['1^','2','3']}) df A B C 0 1^ 1^ 1^ 1 2 2 2 2 3 3 3 I want to remove the '^' from the entire dataframe, so I thought using the .replace() method would work: cols_to_check = ['A','B', 'C'] df[cols_to_check] = df[cols_to_check].replace({'^':''}, regex=True) However, this is the output: df A B C 0 1^ 1^ 1^ 1 2 2 2 2 3 3 3 Nothing happens! This works with any character other than the carat symbol and it's frustrating me. Here is an example: df[cols_to_check] = df[cols_to_check].replace({'2':''}, regex=True) df A B C 0 1^ 1^ 1^ 1 2 3 3 3 Why is the carat symbol so stubborn? Is there a way I can fix this? It would be really helpful. Thanks! | I am tired of always trying to guess, if I should escape special characters like '()[]{}|' etc. when using many implementations of regexps. It is different with, for example, Python, sed, grep, awk, Perl, rename, Apache, find and so on. Is there any rule set which tells when I should, and when I should not, escape special characters? Does it depend on the regexp type, like PCRE, POSIX or extended regexps? |
If I were to abbreviate the word university, I would most likely write uni — or would uni’ be more correct? If I wanted to say universities, would I write unis or uni’s? My gut instinct would be to go with unis, but are there any particular rules regarding this? | When I was in high school back in the 1970s, I was taught that to make a plural of an acronym, a letter, or a number, one should add an apostrophe and "s". Like I would have written this sentence, "... back in the 1970's ..." I would write "one CD, two CD's". Etc. I followed this rule faithfully for years until a co-worker told me it was wrong. Now I can't find any source that agrees with what I was taught. Is this a rule that has changed over time? Was the convention in the 70s that one should use an apostrophe but this has changed and now we do not? Or were my high school English teachers just confused? |
Show that $\prod_{1\le p\le n}p\le4^n$ using the fact that $\prod_{m+1\le p\le 2m}p\le {2m\choose m}$ where $p$ are prime. I managed to show that $\prod_{m+1\le p\le 2m}p\le {2m\choose m}$, and I sort of know how this $4^n$ is achieved by similar processes, but I am having a problem making my way to those expressions exactly. Attempt(which I hope you could relate to): Let us denote the set of prime numbers in $[m,n]$ as $\pi(m,n)$. Then: $\pi(1,n)=(\pi(\lfloor{n\over 2}\rfloor+1,2\lfloor{n\over 2}\rfloor)\cup\pi(2\lfloor{n\over 2}\rfloor+1,n))\cup(\pi(\lfloor{n\over 4}\rfloor+1,2\lfloor{n\over 2}\rfloor)\cup\pi(2\lfloor{n\over 4}\rfloor+1,\lfloor{n\over 2}\rfloor))\cup...\cup(\pi(\lfloor{n\over 2^i}\rfloor+1,2\lfloor{n\over 2^i}\rfloor)\cup\pi(2\lfloor{n\over 2^i}\rfloor+1,\lfloor{n\over 2^{i-1}}\rfloor))\cup...$. Where $\pi(2\lfloor{n\over 2^i}\rfloor+1,\lfloor{n\over 2^{i-1}}\rfloor))$ is a singleton: for $i=1$ it is clear because if $a=2b+1$ then $2\lfloor{a\over 2}\rfloor+1=a=\lfloor{a\over 2^0=1}\rfloor$, and it keeps that way inductively. First, let us agree that for a set $S$ with no prime numbers, $\prod_{p\in S}p=1$, so as to enable partitioning the intervals. Then $\prod_{1\le p\le n}p=\prod_{p\in\pi(\lfloor{n\over 2}\rfloor+1,2\lfloor{n\over 2}\rfloor)}p\prod_{p\in \pi(\lfloor{n\over 4}\rfloor+1,2\lfloor{n\over 4}\rfloor)}p...\le{2\lfloor {n\over 2}\rfloor\choose \lfloor {n\over 2}\rfloor}\cdot {2\lfloor {n\over 4}\rfloor\choose \lfloor {n\over 4}\rfloor}\cdot {2\lfloor {n\over 8}\rfloor\choose \lfloor {n\over 8}\rfloor}\cdot...$. Here, I am kinda stuck, and not being fully sure of what I have done so far, I am going to need some guidance, thank you in advance. | This an interesting problem my friend has been working on for a while now (I just saw it an hour ago, but could not come up with anything substantial besides some PMI attempts). Here's the full problem: Let $x_{1}, x_{2}, x_{3}, \cdots x_{y}$ be all the primes that are less than a given $n>1,n \in \mathbb{N}$. Prove that $$x_{1}x_{2}x_{3}\cdots x_{y} < 4^n$$ Any ideas very much appreciated! |
<div class="col-lg-6"> <label>Check-In</label> <input type="date" name="checkin" class="form-control" id="checkin" /> </div> <div class="col-lg-6"> <label>Check-Out</label> <input type="date" name="checkout" class="form-control" id="checkout" /> </div> | How do I get the number of days between two dates in JavaScript? For example, given two dates in input boxes: <input id="first" value="1/1/2000"/> <input id="second" value="1/1/2001"/> <script> alert(datediff("day", first, second)); // what goes here? </script> |
So I have a question which goes like this: Find the equation of a plane containing the line: $$\left\{\begin{align*}x &= 1 + k\\ y &=1\\ z &= -2k\end{align*}\right. ,\quad k\in\Bbb{R}$$ and lying at distance one from the point $(-1,0,1)$. I wouldn't even know how to start this as I am used to having questions which are usually simpler than this. Any help would be appreciated. Thank you very much. | I need to find the equation(s) of the plane containing the line $$ \left\{ \begin{array}{c} x=1+k \\ y=1 \\ z = -2k \end{array} \right. $$ lying at distance 1 from the point (-1,0,1). I was trying to use "Distance from point to a plane" formula and compose a system, given that I know collinear points on the plane (from the line), however, I apparently miss something to finalize the solution. |
I am new to c programming I am trying to understand structs concept in c in many tutorial they explained how to declare structs with this below example struct node { int data; int value; } I under stand the above case ,but in the case below case they declared a struct inside it struct node { int data; struct node *next; \\ what is this? why they declared like it ? } | How can I have a pointer to the next struct in the definition of this struct: typedef struct A { int a; int b; A* next; } A; this is how I first wrote it but it does not work. |
I'm running Ubuntu 18.04 minimal fresh install with dual boot Windows 10 on a Samsung 850 EVO SSD. $ systemd-analyze time Startup finished in 17.129s (firmware) + 3.573s (loader) + 3.058s (kernel) + 22.988s (userspace) = 46.750s graphical.target reached after 22.981s in userspace $ systemd-analyze blame | head -n 10 20.674s plymouth-quit-wait.service 5.077s bolt.service 3.252s NetworkManager-wait-online.service 1.483s docker.service 863ms dev-sda4.device 820ms snap-gnome\x2dlogs-31.mount 787ms fwupd.service 742ms systemd-resolved.service 690ms snap-gnome\x2dsystem\x2dmonitor-39.mount 546ms dev-loop2.device Any ideas why boot time takes so long? Even my Windows 10 partition boots up faster. | There is a long time where SSD does nothing. How can I find the fault and fix it ? Already checked /etc/fstab, no swap or anything wrong there (32GB of RAM, no swap) [ 2.173492] usb 2-1.6: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [ 2.173497] usb 2-1.6: Product: DW375 Bluetooth Module [ 2.173501] usb 2-1.6: Manufacturer: Dell Computer Corp [ 2.173511] usb 2-1.6: SerialNumber: 7CE9D3C0713B [ 2.323728] ata4: SATA link down (SStatus 0 SControl 300) [ 2.441062] input: AlpsPS/2 ALPS GlidePoint as /devices/platform/i8042/serio1/input/input6 [ 2.640309] ata5: SATA link down (SStatus 0 SControl 300) [ 2.954947] ata6: SATA link down (SStatus 0 SControl 300) [ 3.068090] clocksource: Switched to clocksource tsc [ 36.584826] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null) [ 36.726117] ip_tables: (C) 2000-2006 Netfilter Core Team [ 36.732610] systemd[1]: systemd 237 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +AC L +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN2 +IDN -PCRE2 default-hierarchy=hybrid) [ 36.751996] systemd[1]: Detected architecture x86-64. [ 36.753867] systemd[1]: Set hostname to <latitude-e5520>. [ 36.868561] systemd[1]: Started Forward Password Requests to Wall Directory Watch. [ 36.868594] systemd[1]: Reached target Remote File Systems. [ 36.868751] systemd[1]: Created slice User and Session Slice. [ 36.868869] systemd[1]: Created slice System Slice. [ 36.868948] systemd[1]: Listening on udev Control Socket. [ 36.868957] systemd[1]: Reached target Slices. [ 36.868996] systemd[1]: Listening on udev Kernel Socket. [ 36.895156] EXT4-fs (sda1): re-mounted. Opts: errors=remount-ro [ 36.898185] lp: driver loaded but no devices found [ 36.903941] ppdev: user-space parallel port driver |
Consider a series $\sum_{n \geq 0} a_n$. How can I show the following? $$\lim_{n \to \infty} |a_n|^{\frac{1}{n}}=l \implies \lim_{n \to \infty} \frac{|a_{n+1}|}{|a_n|}=l$$ | Let consider the power series $$ \sum_{k=1}^\infty a_kx^k. $$ We know that it converges when $$\lim_{n\to \infty }\sqrt[n]{|a_n|}|x|< 1\quad\text{or}\quad |x|< \frac{1}{\lim_{n\to \infty }\sqrt[n]{|a_n|}}$$ But D'Alembert test tells us that it converges if $$|x|< \frac{1}{\lim_{n\to \infty }\left|\frac{a_{n+1}}{a_n}\right|},$$ so since the radius of convergence is unique, we should have that $$\lim_{n\to \infty }\sqrt[n]{|a_n|}=\lim_{n\to \infty }\left|\frac{a_{n+1}}{a_n}\right|.$$ I tried to prove it, but this result looks strange to me. So if it doesn't work always, how can we have those to limit as radius of convergence? I guess the equality of those two limit should be true most of the time. So under what conditions is it true? |
I am studying the effect of expression of a specific gene signature on patient survival, dividing patients into Low, Mid, and High expression of Signature X. The survival curves for these patients all look very different from each other, and I'm trying to get a statistical value to support this statement (patients with Low, Mid and High expression have different survival trends). I used the coxph function in the survival package in R and obtained this: > coxph(Surv ~ Sig.X.Group, data = data) coef exp(coef) se(coef) z p Sig.X.Group 1.0310 2.8039 0.0795 13 <2e-16 If I had divided patients into Low and High expression of Sig.X I understand that: "High" expression of Sig.X is associated with a 2.8 increase in risk of death compared to "Low" expression (or something along those lines). But what is the English explanation to an HR of 2.8 when I run the coxph function on 3 groups rather than 2? EDIT: Fixed. The problem was my Sig.X.Group was coded as a number. Fixed the issue when changed Sig.X.Group to a factor, which gave me two individual HRs: coef exp(coef) se(coef) z Pr(>|z|) Sig.X.Group2 0.5821074 1.789806 0.1696 3.4318 0.0005993 Sig.X.Group3 1.9186438 6.811714 0.1550 12.3753 0.0000000 | If a factor variable (e.g. gender with levels M and F) is used in the glm formula, dummy variable(s) are created, and can be found in the glm model summary along with their associated coefficients (e.g. genderM) If, instead of relying on R to split up the factor in this way, the factor is encoded in a series of numeric 0/1 variables (e.g. genderM (1 for M, 0 for F), genderF (1 for F, 0 for M) and these variables are then used as numeric variables in the glm formula, would the coefficient result be any different? Basically the question is: does R use a different coefficient calculation when working with factor variables versus numeric variables? Follow-up question (possibly answered by the above): besides just the efficiency of letting R create dummy variables, is there any problem with re-coding factors as a series of numeric 0,1 variables and using those in the model instead? |
I create new element with js like this: $("#vorschau_tr").append('<td><img src="bla.jpg" class="flipped js_is_a_broken_time_wasting_piece_of_garbage"></td>'); And try to just alert something like that: $(".js_is_a_broken_time_wasting_piece_of_garbage").on({ mouseover: function () { alert('enter'); }, mouseleave:function () { alert('leave'); } }); I know it was asked multiple times but every time it says the solution is to use on which I do but it's not working so how to do that? $(".js_is_a_broken_time_wasting_piece_of_garbage").live( click, function(){ alert('js_inventor_is_a_pos'); }); isn't working too | I have a bit of code where I am looping through all the select boxes on a page and binding a .hover event to them to do a bit of twiddling with their width on mouse on/off. This happens on page ready and works just fine. The problem I have is that any select boxes I add via Ajax or DOM after the initial loop won't have the event bound. I have found this plugin (), but before I add another 5k to my pages with a plugin, I want to see if anyone knows a way to do this, either with jQuery directly or by another option. |
I've decided I don't want to be a part of any Stack Exchange communities, as it's drawing my focus away from more important things (work, family, friends, etc.), so I'd like to delete all of my accounts. I've sent requests for each account individually, but is there a way to ensure that every account of mine is removed? Not the questions and answers, just the accounts? If I ever decide to come back and use the same email to log in, I want to start fresh, and I don't want it to be associated with any accounts. | How can I delete my Stack Exchange account(s)? Also, What happens to my content? Can I request it be deleted as well? What if I'm suspended, rate-limited, or banned from posting questions or answers? What will happen to my votes? Will other users be impacted? Why wasn't my account deleted immediately after the timer expiring? What will happen to my pending bounties and close, reopen, delete, or undelete votes? I want my account deleted on all Stack Exchange sites. How do I do this? Will my profile on chat be removed once I delete my site account? For more information, see "" in the . |
I use QGIS print layout to create atlas with many features. I am tring to find a way to show page number left, right, up and down of atlas feature. Is there any way to insert these page numbers to print layout? Example is on a picture below. I need to show page number 4, 6, 8 at atlas with page number 5 as is seen at atlas overview. Unfortunately, script described at post below doesnt work.https://gis.stackexchange.com/questions/214300/how-to-determine-neighbouring-tile-ids-in-qgis | I was asked in a recent training course if QGIS could automatically calculate the next/previous and above/below page numbers for a map book created using the atlas generator. I managed to work out a fairly reasonable label expression for a regular grid if you know the width and height of the grid. But we then started to think of realistic examples where we don't want to draw pages that don't contain our district of interest, such as this one of my home county: So this afternoon I had a play at a python script to work out the 4 neighbours I was interested in for each grid cell and added those values to my grid (this is heavily based on Ujaval Gandhi's ): for f in feature_dict.values(): print 'Working on %s' % f[_NAME_FIELD] geom = f.geometry() # Find all features that intersect the bounding box of the current feature. # We use spatial index to find the features intersecting the bounding box # of the current feature. This will narrow down the features that we need # to check neighboring features. intersecting_ids = index.intersects(geom.boundingBox()) # Initalize neighbors list and sum neighbors = [] neighbors_sum = 0 for intersecting_id in intersecting_ids: # Look up the feature from the dictionary intersecting_f = feature_dict[intersecting_id] int_geom = intersecting_f.geometry() centroid = geom.centroid() height = geom.boundingBox().height() width = geom.boundingBox().width() # For our purpose we consider a feature as 'neighbor' if it touches or # intersects a feature. We use the 'disjoint' predicate to satisfy # these conditions. So if a feature is not disjoint, it is a neighbor. if (f != intersecting_f and not int_geom.disjoint(geom)): above_point = QgsGeometry.fromPoint(QgsPoint(centroid.asPoint().x(), centroid.asPoint().y()+height)) below_point = QgsGeometry.fromPoint(QgsPoint(centroid.asPoint().x(), centroid.asPoint().y()-height)) left_point = QgsGeometry.fromPoint(QgsPoint(centroid.asPoint().x()-width, centroid.asPoint().y())) right_point = QgsGeometry.fromPoint(QgsPoint(centroid.asPoint().x()+width, centroid.asPoint().y())) above = int_geom.contains(above_point) below = int_geom.contains(below_point) left = int_geom.contains(left_point) right = int_geom.contains(right_point) if above: print "setting %d as above %d"%(intersecting_f['id'],f['id']) f['above']=intersecting_f['id'] if below: print "setting %d as below %d"%(intersecting_f['id'],f['id']) f['below']=intersecting_f['id'] if left: print "setting %d as left of %d"%(intersecting_f['id'],f['id']) f['left']=intersecting_f['id'] if right: print "setting %d as right of %d"%(intersecting_f['id'],f['id']) f['right']=intersecting_f['id'] # Update the layer with new attribute values. layer.updateFeature(f) layer.commitChanges() This works just fine. But to be honest the whole creating a test point to the North and then testing all the possible neighbours seems wrong. However after an afternoon of wracking my brain I can't think of a better way to determine what is a particular grid cell's northern neighbour? Ideally I'd like something simple enough to put in a print composer text box, but I suspect that's too much to ask for. |
I bought an unlocked 5c for my kid to use without data etc as an iPod to later use as phone when older but it wants a SIM card to activate the phone what do I do | I just purchased an unlocked iPhone 5 from the Apple store today, and I can't activate it to use it because it says "please" insert a valid SIM card to use it. I'm not using this phone as a "phone" to make calls. I'm a developer and am just looking to use it for development purposes. How can I go about using the iOS 5? |
This is (a small part of) my struct: ` struct BASE { struct s { //... }; template<typename T> struct DerivedTemplate : public s { struct SW { short ndx = 0; double val = 0; bool glch = false; SW(short ndx, double val, bool glch){this->ndx = ndx;this->val = val;this->glch = glch;} }; static vector<SW> SW__BIGGR; }; };` Then I seek to initialize the vector "SW__BIGGR" in the following way: template <typename T> vector<BASE::DerivedTemplate<T>::SW> BASE::DerivedTemplate<T>::SW__BIGGR = BASE::DerivedTemplate<T>::SW(0, 0, false); And I get this compiler error: error: type/value mismatch at argument 1 in template parameter list for ‘template<class _Tp, class _Alloc> class std::vector’ vector<BASE::DerivedTemplate<T>::SW> BASE::DerivedTemplate<T>::SW__BIGGR = BASE::DerivedTemplate<T>::SW(0, 0, false); ^ [...] note: expected a type, got ‘BASE::DerivedTemplate<T>::SW’ When I do the same operation with a vector of simple type such as "int", everything works fine. What am I doing wrong? Thank you! EDIT: After adding "typename" before "BASE:: ..." as I was kindly told to do in a comment, I get this error: error: expected unqualified-id before ‘=’ token vector<typename BASE::DerivedTemplate::SW> typename BASE::DerivedTemplate::SW__BIGGR = typename BASE::DerivedTemplate::SW(0, 0, false); ^ Obviously, the vector cannot be initialized like that (as I am doing without problem with an "int" or "double" vector), but how can it? EDIT 2: After deleting "typename" before " ... SW__BIGGR" as kindly suggested, I now get this error for which I could not find an answer googling ("sgnl__01" is a struct based on the struct template "DerivedTemplate"): "error: conversion from ‘BASE::DerivedTemplateBASE::sgnl__01::SW’ to non-scalar type ‘std::vectorBASE::DerivedTemplate<BASE::sgnl__01::SW, std::allocatorBASE::DerivedTemplate<BASE::sgnl__01::SW> >’ requested vector<typename BASE::DerivedTemplate::SW> BASE::DerivedTemplate::SW__BIGGR = typename BASE::DerivedTemplate::SW(0, 0, false);" Lost again :-( | In templates, where and why do I have to put typename and template on dependent names? What exactly are dependent names anyway? I have the following code: template <typename T, typename Tail> // Tail will be a UnionNode too. struct UnionNode : public Tail { // ... template<typename U> struct inUnion { // Q: where to add typename/template here? typedef Tail::inUnion<U> dummy; }; template< > struct inUnion<T> { }; }; template <typename T> // For the last node Tn. struct UnionNode<T, void> { // ... template<typename U> struct inUnion { char fail[ -2 + (sizeof(U)%2) ]; // Cannot be instantiated for any U }; template< > struct inUnion<T> { }; }; The problem I have is in the typedef Tail::inUnion<U> dummy line. I'm fairly certain that inUnion is a dependent name, and VC++ is quite right in choking on it. I also know that I should be able to add template somewhere to tell the compiler that inUnion is a template-id. But where exactly? And should it then assume that inUnion is a class template, i.e. inUnion<U> names a type and not a function? |
“Bullshit” is often a slang verb used when writing essays to mean that you are writing things without much deep thought or care. I'm looking for a more formal definition of the word “Bullshit”. I need something that means the same thing as “to Bullshit” but for a more formal setting. That actual use-case is that I’m trying to tell a professor in a teacher evaluation that “it’s not an easy class where you can just bullshit your way through it”, but I want to use a more formal synonym and something less explicit/slang-like. Thanks | What is a reasonable formal alternative to 'bullshit'? For example: Bob isn't making a very good argument. In fact everything he says is bullshit. What can 'bullshit' be replaced with that is a reasonable facsimile of what is intended without being tendentious? Bullshit - "eloquent and insincere rhetoric," 1915, American English slang; see bull (n.1) + shit (n.), probably because it smells. But bull in the sense of "trivial or false statements" (1914), which usually is associated with this, might be a continuation of Middle English bull "false talk, fraud" (see bull (n.3)). spending the first 20 of 67 pages not even coming to a definition. His definition of 'bullshit' was statements of potential facts about which the utterer does not care of its truth. That is, bullshit is somewhere off to the side from truth and lies, where the speaker knows what is correct and either says something concordant or not with that. Bullshit can be true or false; the point, to the speaker, is that they don't know or care about its truth value, just that it convinces someone (it may end up convincing the speaker!). Others have slightly different ontologies for the word, maintaining the lack of knowledge, but instead of trying to convince others, it is merely uttered to sound a certain way, to sound like it is has import, but fails to do so on inspection. Late-night THC enhanced pseudo-intellectual conversations, Sokal hoax texts, and AI chatbot conversations. Meaningful at first glance but meaningless on inspection. Either way, the term bullshit is used to call someone out on their statements without accusing them of something so intentionally heinous as lying. The difficulty with the term 'bullshit' is that it points to very useful concepts but is somewhat taboo. I am looking for a term that captures the meaning but not the taboo, can be used in formal or otherwise taboo-adverse situations. There are many possible alternatives but they all seem to fall short in There are the quaint folksisms and minced oaths of: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , . These are all nonsense words - they don't just mean nonsense, they -are- nonsense. They stand out like twee bowdlerizations of nothing that take you right out of the discourse into a drunk undertaker at a wedding's cash free bar. They all sound like they're from the same Lewis Carroll poem, but if he grew up in Kansas in the 1890's. There are the waste/offal/excrement metaphors of: , , , , , , , , , , , , , , , , , , , . implying empty worthlessness, which bullshit certainly is, but these words connote something less taboo but still noticeably informal. And then there is the single, literal: . The latter is the go-to for replacing 'bullshit' in polite company. It certainly fits the second definition, words that sound meaningful but on reflection are not. But many things called bullshit these days is of the first kind, intended to convince whatever the truth value. Very meaningful, just not with any belief on the speaker's part. Is there an alternative to 'bullshit' that fills all these (admittedly negative) criteria? Works in formal situations, is not cutesy or metaphorical, is truth-agnostic, is not one of the above words? Of course, one may suggest one of the above words in case I am wrong about them, but in any case give a justification as to why. And noun, verb, adjective, interjection, whatever, is OK as long as it fits in meaning. Please, no malarkey. That is, no words from the malarkey list. They are awful. As usual a single word is nice but not necessary, but a proverb is too much. |
(cnt1 == 0) ? { maj1 = arr[i]; cnt1++; } : {maj2 = arr[i]; cnt2++; } basically it's same as writing (expression) : { statement 1; statement 2 } : { statement 3; statement 4 }; can I use ternary operator in this way actually when I am running this an error is appearing. Can't we use multiple statements for one condition enclosed within {} or () in ternary operator in C++. | I've always wondered how to write the "A ? B : C" syntax in a C++ compatible language. I think it works something like: (Pseudo code) If A > B C = A Else C = B Will any veteran C++ programmer please help me out? |
I am looking for coordinates (longitude and latitude) of each state of Brazil. Where can I find that? I have found a file for the US states here: , I am now looking for something similar for Brazil. | After learning about the datasets I've working with the following layers, from the USA data Country boundaries State boundaries County boundaries City boundaries ZipCode/Postcode boundaries What I am trying to find is the equivalent (where appropriate) of the same data for various countries. Is there any free administrative boundaries available as shapefiles for other countries? |
Let's assume: the feather has a mass of $0.006$kg the mountain has a mass of $6 \times 10^{15}$kg the earth has a mass of $6 \times 10^{24}$kg no air resistance both objects released at the same time with an initial velocity of $0$ both objects released at a height of $10,000$m Would the mountain hit first, as it itself would exert a gravitational pull on the earth? | The common understanding is that, setting air resistance aside, all objects dropped to Earth fall at the same rate. This is often demonstrated through the thought experiment of cutting a large object in half. The halves clearly can't then fall more slowly just by being sliced in two. However, I believe the answer is that when two objects fall together, attached or not, they do "fall" faster than an object of less mass alone does. This is because not only does the Earth accelerate the objects toward itself but the objects also accelerate the Earth toward themselves. Considering the formula: $$ F_{\text{g}} = \frac{G m_1 m_2}{d^2} $$ Given $F = ma$ thus $a = F/m$, we note that the mass of the small object doesn't seem to matter as when calculating acceleration the force is divided by the $m$ term, its mass. However, this overlooks that the force is actually applied to both objects, not just to the smaller one. The acceleration on the second, larger object is found by dividing $F$, in turn, by the larger object's mass. The two objects' acceleration vectors are exactly opposite, so closing acceleration is the sum of the two: $$ a_{\text{closing}} = \frac{F}{m_1} + \frac{F}{m_2} $$ Since the Earth is extremely massive compared to everyday objects, the acceleration imparted on the object by the Earth will radically dominate the equation. As the Earth is $\sim 5.972 \times {10}^{24} \, \mathrm{kg} ,$ a falling object of $5.972 \, \mathrm{kg}$ (just over 13 pounds) would accelerate the Earth about $\frac{1}{{10}^{24}}$ as much, which is one part in a trillion trillion. Of course in everyday situations, we can for all practical purposes treat objects as falling at the same rate because of this negligible difference—which our instruments probably couldn't even detect. But I'm hoping not for a discussion of practicality or what's measurable or observable, but what we think is actually happening. Am I right or wrong? What really clinched this for me was considering dropping a small Moon-massed object close to the Earth and a small Earth-massed object close to the Moon. This made me realize that falling isn't one object moving toward some fixed frame of reference, but that the Earth is just another object, and thus "falling" consists of multiple objects mutually attracting in space. |
Let $f:\mathbb{C}\to\mathbb{C}$ be an analytic function. Show that $g(z)=\overline{f(\overline{z})}$ is analytic and find its derivative. $f$ is analytic then C-R equations hold. Suppose $f=u+iv$. Then $g(z)=u(x,-y)+i(-v(x,-y))$. We can observe that C-R equations hold for $g$ as well since if we set $\hat{u}(x,y):=u(x,-y)$ and $\hat{v}(x,y)=-v(x,-y)$ we get $$ \hat{u}_x=u_x=-v_y=-\hat{v}_y \\-\hat{u}_y=u_y=v_x=-v_x $$ But this is not enough for to show that $g$ is analytic. | I'm doing a bit of self study, but I'm uncomfortable with a certain idea. I want to show that $f(z)$ is analytic if and only if $\overline{f(\bar{z})}$ is analytic, and by analytic I mean differentiable at each point. Here $f$ is a complex valued function. What I do is write $f(z)=u(x,y)+iv(x,y)$, where $u$ and $v$ are real functions of two variables. Then $\overline{f(\bar{z})}=u(x,-y)-iv(x,-y)$. These two forms look very similar, in the sense the one function being differentiable should immediately imply the other is differentiable, since the only thing really changing might be a $-$ sign popping out due to the chain rule. How can I more rigorously express that $f(z)$ is analytic iff $\overline{f(\bar{z})}$ using this? Many thanks. |
I have a few objects with the same structure; some of them have null values for some fields, whereas one of the objects (here obj2) has values for the field which has null values in other objects; I want ro merge them and cosider the one which has value: var obj2 = { options: [ null ], name: "name1", } var obj1 = { options: [ {"option": "option1"} ], name: "name1", } desiredOutput = { options: [ {"option": "option1"} ], name: "name1", } My attempt: I tried lodash; but the prpoblem with lodash is that the order has effects; that is, whichever object comes last that one overwrites the previous ones for the mentioned field: I tried lodash; here myArray is an array of obj1, obj2,... var newResults = {}; for (var i = 0; i < myArray.length; i++) { newResults = lodash.extend(newResults, myArray[i]); } What is the cleanest solution for this one? Thanks | I need to be able to merge two (very simple) JavaScript objects at runtime. For example I'd like to: var obj1 = { food: 'pizza', car: 'ford' } var obj2 = { animal: 'dog' } obj1.merge(obj2); //obj1 now has three properties: food, car, and animal Does anyone have a script for this or know of a built in way to do this? I do not need recursion, and I do not need to merge functions, just methods on flat objects. |
The world population is ~7 billion Social Classes: Top .001% is ~70,000 Second .01% is ~700,000 Next .1% is ~7 million Rest 99.9% is ~6,993,000,000 (billion) The odds of 1 person in the Rest grp meeting 1 person from the Top grp is it approx: 1 in 100,000 meets? What are the odds of 1 person in the Rest grp meeting 2 people from the Top grp? is it: 1 in 100,000^2 or 1 in 10,000,000,000? What are the odds of 1 person in the Rest grp meeting 2 people from the Top grp on the same year? (Assuming in a lifetime of 100 years.) | The world population is ~7 billion Social Classes: x: Top .001% is ~70,000 y: Second .01% is ~700,000 z: Next .1% is ~7 million r: Rest 99.9% is ~6,993,000,000 (billion) p: population ~7,000,000,000 The odds of 1 person in the Rest grp meeting 1 person from the Top grp is it approx: 1 in 100,000 meets? What are the odds of 1 person in the Rest grp meeting 2 people from the Top grp? is it: 1 in 100,000^2 or 1 in 10,000,000,000? What are the odds of 1 person in the Rest grp meeting 2 people from the Top grp on the same year? (Assuming in a lifetime of 100 years.) |
Why wouldn't Picard have his male pattern baldness cured? Surely they can do this in the 24th Century. Maybe people are way less vain in the 24th Century, but I think I remember Picard showing Beverly a picture of his younger self in Nemesis, and he was very bald in it. So it seems he was afflicted by unusually early pattern baldness. So why wouldn't he have had that corrected? | Was the fact that Captain Picard has no hair just a random artefact of the fact that Patrick Stewart was the best/chosen actor for the role? Or was the choice of Patrick Stewart influenced in any way by the fact that the show creators/casters preferred the bald look for some reason before Stewart was cast? I'm looking for authoritative info, not guesses. |
I want to connect to an external hard drive. It's an easystore HDD. I'd like to run desktop-style files on it thru Ubuntu. I'm new to Ubuntu, though, and not very computer savvy, but I'm really interested in learning. Any suggestions on what I should use for operating systems on it? This is the machine I have Samsung - Galaxy 13.3" 4K Ultra HD Touch-Screen Chromebook Intel Core i5 8GB Memory 256GB SSD | For a given hardware configuration, how do I find out if Ubuntu will run on it? What considerations should I take into account when choosing an Ubuntu version and such as: with a lighter desktop than the usual Gnome and Unity with the even lighter LXDE desktop Obviously Ubuntu does not run on some processor architectures. So how do I go about choosing the right version and derivate. How can I find out the minmal system requirements? |
I was given an argument in a conversation today and I don't know how to respond to it: H( k || m || k ) should be a better choice of MAC than the traditional HMAC. The person's rationale was that: "You don't know where to pick up extending from, and you don't know what to finish extending into. Sure using k twice looks ugly, but HMAC also uses the key twice, except it also hashes twice. This only hashes once and therefor is faster." I couldn't refute this on the spot and now the more I think about it the more it bothers me. Are they right? I'd imagine that the cryptographers who decided on HMAC had way more experience when they made their decision. But then why? | I understand how for hash functions which are vulnerable to length extension attacks (such as SHA1 and SHA2) it is safer to use a HMAC construction. What I don't understand is, how or why is $\operatorname{HMAC\_SHA256}_\mathrm{key}(\mathrm{message})$ safer (in terms of resistant against certain attacks) than $\operatorname{SHA256}(\mathrm{key}_1 \mathbin\| \mathrm{message} \mathbin\| \mathrm{key}_2)$, assuming that all key strings are sufficient in length and entropy? |
I edited a wiki on Woodworking.SE Meta. It was an old post so I got the excavator badge for it. The notification for the badge came while I was reading a Science Fiction & Fantasy post. So I checked my notification and saw that I got the badge for WW but it had the SF logo. Refreshing the page then displayed the beta badge icon which was correct. No, I don't think we need to torch and pitchfork the doors of StackOverflow to get this fixed. Just thought it was worth bringing up. If it matters I am using Chrome Version 46.0.2490.86 m | It's so cool that the notification reminds you of the colour of badge you've earned. But I am a little puzzled by the symbols: Is it feasible to use the symbol from the earned site? At the moment it uses the symbol from the site I happen to be on (as you can see by looking to the left of the dropdown in each case.) |
I need to install Tally.Server 9 on a Ubuntu 12 server. Tally is a accounting software and a multi user application where the main application is installed on the server and users have the client side version installed in the users PC. | I am looking for a step by step instruction to guide me in the ways of installing, configuring and debugging many of the issues new users have when dealing with Wine in Ubuntu. What is the recommended way of installing Wine, some of the key issues that it has and how to solve them? If I have a specific problem with an App in Wine, how do I go about solving it? What are the recommended steps to ensure that I can fix a problem related to an app I wish to use? |
Is there any explanation about how the paintings are connected, so that people can walk from one painting to another? How can these imprints of dead people be transferred between paintings? If imprints can be moved away from their painting (frame as physical object), can they be bound to other objects as well (which are not paintings)? Must they be moved by a wizard/witch or is there a space (in another dimension) that connects them? | I'm not sure whether this happens in the books - it's been a while since I've read them - but in the films at least, there's occasions when subject(s) of a given painting venture outside of its frame. In Prisoner of Azkaban, the Fat Lady goes into another painting after being scared off by Sirius Black. In Order of the Phoenix, Filch 'empties' paintings of their subjects, by shaking the frames hard enough. In Deathly Hallows - Part 2, subjects are seen rushing from painting to painting, seemingly 'getting out of the way' as the preparations take place for what is about to be the Battle of Hogwarts. But how does this work? Is there any explanation given by JK Rowling inside the canon, or in interviews on this? Where did the subjects go during Umbridge's time as Headmistress - where did they 'hang out' during this short-lived exile from Hogwarts? Are they in their own alternate 'world' or 'space' and can travel to any adjacent painting and thus theoretically wherever they want to, within the painting 'world'? To find some other home, if kicked out of their (original) portrait? Thanks. |
I am trying to write a code that compares the users string to the string 'm' or 'f' and repeating the loop if the users answer doesn't match either letter public static void main(String[] args) { String om = JOptionPane.showInputDialog("I will calculate the number of chocolate bar you should eat to maintain your weigth\n" + "Please enter letter 'M' if you are a Male\n" + "'F' if you are a Female"); JOptionPane.showMessageDialog(null, om.equalsIgnoreCase("m")); // if i don't do this, it says the variables have not been initialized boolean m = true; boolean f = true; if (om == "m"){ m = om.equalsIgnoreCase("m"); } else if ( om == "f"){ f = om.equalsIgnoreCase("f"); } JOptionPane.showMessageDialog(null, "The m is: " + m); JOptionPane.showMessageDialog(null, "The f is: " + f); //if the user enters one variable the other variable becomes false, thus // activating the while loop while (m == false || f == false){ om = JOptionPane.showInputDialog("Please enter letter 'M' if you are a Male\n" + "'F' if you are a female"); } /* i tried using '!=' to compare the string that doesn't work, i tired converting the strings to number to make it easier something like the code below: int g = 2; if (om = "m"){ g = 0 } while (g != 0){ } that doesn't work either So i tried using boolean which worked but if the user doesn't enter one letter the other letter becomes false and activates the while loop | I've been using the == operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug. Is == bad? When should it and should it not be used? What's the difference? |
package Practice_KingAllProg; import java.util.concurrent.TimeUnit; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; public class Crmpro_Iframe_King2410 { public static void main(String[] args) { // TODO Auto-generated method stub try { System.setProperty("webdriver.chrome.driver", "C:\\Users\\Sahil\\selelniumPratice\\Webdriver_PracticeKing\\src\\test\\resources\\BroWser_PracticeKing\\chromedriver.exe"); WebDriver driver = new ChromeDriver(); driver.get("https://www.crmpro.com/index.html"); Thread.sleep(5000); driver.manage().timeouts().pageLoadTimeout(30, TimeUnit.SECONDS); driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS); driver.manage().window().maximize(); driver.findElement(By.name("username")).sendKeys("sa12"); driver.findElement(By.name("password")).sendKeys("vi123"); driver.findElement(By.xpath("//*[@id=\'loginForm\']/div/div/input")).click(); driver.switchTo().frame("leftpanel"); Thread.sleep(5000); driver.switchTo().defaultContent(); String Actualtext = driver.findElement(By.xpath("//html//body//table[1]//tbody//tr[1]//td//table//tbody//tr//td[1]")).getText(); //html/body/table[1]/tbody/tr[1]/td/table/tbody/tr/td[1] System.out.println(Actualtext); String Exceptedtext="sanjay spear"; if(Actualtext.equalsIgnoreCase(Exceptedtext)) { System.out.println("Pass"); }else { System.out.println("Fail"); } driver.quit(); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } | How to Handle Dynamic Changing IDs In XPath? for example : //div[@id='post-body-3647323225296998740']/div[1]/form[1]/input[1] In this xpath id "3647323225296998740" is changing every time when reloading the page. Is there any way to handle this type of situation in Selenium? |
Complex numbers contain imaginary numbers as we all know but often it is used for solving real life practical problems such as taking the impedance of a capacitor, inductor etc. Even in Signals and systems we use complex form of Fourier series,in AC circuit analysis we use complex numbers and i guess there are still more applications to come in my coming semesters. How an imaginary number in real life can have a practical significance? So what really makes complex numbers such a powerful tool in electronics? In layman's term why do we use it?How does it helps us? | I was just wondering how complex numbers can be applied in electrical engineering and why we use complex numbers over regular, real numbers for this application (e.g what capabilities does the complex number have that real numbers do not in electrical engineering)? I have done some research concerning impedances and understand how they are written in complex form, however I am still confused why complex numbers are necessary in this field over regular numbers. |
When I plot two curves on the same graph with Pgfplots, I would like the second to be placed above the first. However, if the first has lines+points and the second only lines, then the point from the first go above the lines of the second. Here is a MWE \documentclass[crop,tikz]{standalone} \usepackage{tikz} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[] \addplot[red,mark=*,line width=2pt] coordinates {(0,0) (1,1) (2,2)}; \addplot[blue,line width=2pt] coordinates {(0.5,0) (1.5,2) (2,0)}; \end{axis} \end{tikzpicture} \end{document} The output is As you see, the blue lines goes above the red one, but the red point is above the blue line. I would like all that is in red to be placed below the blue. I think I can do what I want with two axis environments overlaying, each one with one curve. But is there a solution in the same axis environment? | I have gone through previous questions [,,], but I still couldn't figure out how to draw plots on different layers and change their order of drawing. For this MWE, I would be grateful if I could figure out how to change the order of appearance of the three plots in such a way that the legend entries have the same order while keeping the plots commands/definitions in the same order as much as possible. \RequirePackage{luatex85} \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=newest} \begin{document} \begin{tikzpicture} \begin{axis}[ legend style={ at={([yshift=30pt]0.5,1)}, anchor=north}, legend columns=-1, xmin=0, xmax=10, ymin=0, ymax=10, ] % \addplot [red, line width = 5pt, domain=0:10] {x}; \addlegendentry{$x$} \addplot [black, line width = 5pt, domain=0:10] {(x-5)^2}; \addlegendentry{$(x-5)^2$} \addplot [yellow, line width = 5pt, domain=0:10] {10-(x-5)^2}; \addlegendentry{$10-(x-5)^2$} \end{axis} \end{tikzpicture} \end{document} |
I play minecraft on PC, I have two accounts and I am giving one to my friend. She loves minecraft but only plays on xbox at the moment, but I want to play with her and I refuse to play on xbox. How can you make the PC version closer to the XBox version. I am specifically looking for controller support and an easy crafting method. like the example below | Am I able to use a controller to play the PC version of Minecraft? If so, can I just plug it in and play or do I have to do something else before being able use one? |
There seems to be a lot of question regarding Pantheon, but they all somewhat contradict each other. Is there a simple way to install it? | Pantheon desktop doesn't install on recent versions of Ubuntu, but is there a way to install it now? Are there any workarounds? |
this is my code: private void Method1() { int i = 1; foreach (string file in Directory.EnumerateFiles(ImagesPath)) { if (Path.GetExtension(file).EndsWith(".png")) { string image = (Path.GetFullPath(file)); i += 1; } } } The imagesPath is a string that binds to a folder which contains images, Image1.png, Image2.png . . . . Image10.png, Image11.png . . I want to iterate from Image1.png--->Image2.png, but the foreach iterates Image1.png-->Image10.png-->Image11.png and so forth. Is there any way to override this? | Anyone have a good resource or provide a sample of a natural order sort in C# for an FileInfo array? I am implementing the IComparer interface in my sorts. |
Suppose $A, B\in S^n$ and $A\succeq B$. Further suppose the eigenvalues of $A$ in non-increasing order are $\lambda_1, \lambda_2, ..., \lambda_n$, and $B$'s are $\mu_1, ..., \mu_n$. Does it imply $\lambda_1\ge\mu_1, ..., \lambda_n\ge\mu_n$? By $A\succeq B$ I mean $A-B\succeq 0$, i.e. $A-B$ is positive semi-definite. | If $B\succeq A$, show that $\lambda_n(B)\ge\lambda_n(A)$, where $\lambda_n$ is the $n$th largest eigenvalue. It is Theorem 6 in but the proof is only given as "by characterization." Do they mean the min/max characterization of eigenvalues, $$\lambda_k=\min\max\frac{x^TAx}{x^Tx}$$ and if so, how is that applied? Thanks. |
Is the model $$ y = \gamma_0 + \gamma_1 + \sqrt x + \varepsilon $$ linear in parameters? ( $\varepsilon$ is the error term.) | If polynomial regression models nonlinear relationships, how can it be considered a special case of multiple linear regression? Wikipedia notes that "Although polynomial regression fits a nonlinear model to the data, as a statistical estimation problem it is linear, in the sense that the regression function $\mathbb{E}(y | x)$ is linear in the unknown parameters that are estimated from the data." How is polynomial regression linear in the unknown parameters if the parameters are coefficients for terms with order $\ge$ 2? |
I have a table in Excel. There are a few attribute columns for each "thing", the "thing" being the first column. I want to quickly just add colours to everything of the same type to help visually differentiate them. For numbers, I'll add a Conditional Formatting rule with a colour scale, and that's sufficient. In this case though, the attribute field is text. Sample values include: "Active", "Inactive", "Needs Review". I don't care what value gets which colour. I'm just looking for a simple option to automatically apply some colours without having to add a new Conditional Formatting rule for each possible text value. The following table should have 3 colours for the Status column. Client, Status Bob's Burgers, Active Lucy's Salad Bar, Inactive George's Existential Crisis, Active Other George's Pub, Needs Review EDIT: I reference Conditional Formatting twice in my question. This question is specifically to do it automatically for a spread of text values, without one rule per text value - no updates for new possible values, no picking individual colours, etc. This is an optimization for the Conditional Formatting rules already described, and not a question about how to use the feature itself. | I have a column of cells where each cell contains one of the following text values Optimal Normal High-Normal Mild Moderate Severe I would like the cell colour to be a set depending on what the value in the cell is. For Optimal I'd like a green and for Severe I'd like a red, and for the others I'd like a different colour in between. How do I do that? |
I have an undergrad in mechanical engineering. My Masters, PhD was in Mechanical too. However, I have never been academically strong (grades were majorly C and B+). I had to retake advanced mathematics, continuum mechanics and Finite element analysis course during my undergrad as I had flunked the courses. However, I always enjoyed the field of computational mechanics, how materials behave is something I enjoy thinking about. I pursued the field in my Masters and PhD, inspite of not taking any grad level course during the programmes. My committee never instructed me to take the courses, I thought self study would suffice. I have a PhD in application of computational mechanics, I have 3 first authored papers in materials science journals, not mathematics intensive journals. I am worried about my future in the field. I am continuing with a postdoc under my PhD advisor for a year and am searching for other positions. I shouldn't have pursued higher studies, atleast not in a field I have theoretical deficiency. I still love my field, but I am still afraid of the theoretical papers in my field. My work (application focused) is not mathematically intensive and is pretty straightforward. I can argue that given a direction, one doesn't need a masters or PhD to do what I do. I know, there won't be anyone who had experiences similar to mine. It is always expected that people go for highers studies in subjects they are good in. I did the other way round. What should be my course of action now to have a potential academic career? I think I am up for a dissappointing career outcome, but still I want to give it a try. | I did my PhD in computational materials science. I used molecular dynamics simulations and finite element method to carry out my research investigations. I have published several publications and about to defend my thesis next month. But, I did not take any classes on finite element analysis or molecular dynamics during my undergraduate or graduate school. Whatever theory I know about them is through self study and through work experience. I understand the concepts of the methods, but I never got a chance to have a formal course with exams and assignments on the subjects. So, my self study hasn't been very meticulous. Now, I feel like a charlatan, and don't feel like I deserve a PhD degree. I am also feeling lost and like a loser. Saddest thing is that, I passed all my qualifiers, proposals and no one questioned my abilities. I don't know what can I do to feel confident again. I am 31 years old. I always thought that by the end of PhD I will be a confident researcher. |
Consider this question on Super User: Essentially, mapping an exported list towards creating a whitelist for cookie management. Should I formulate an approach/ script/ program via...? It could possibly be a mix/ mid point between them? Or another Stack Exchange site? | There seems to be more than a few computer science/programming Stack Exchange networks (is that the correct term?). Stack Overflow, being the first, has by far the most users, questions, and answers. What is the reasoning for creating the others, and are there clear guidelines for which kinds of questions should be posted? I can see a large amount of potential overflow, many cases of people not getting a good answer to their question, because the person who has the answer isn't browsing that particular network at the moment. I understand that they were probably created for organizational purposes, but wouldn't it almost make more sense to just have them as categories under Stack Overflow, keep them separated but still connected, instead of making people have to create multiple 'account's, one for each network? I am sure there was a very good reason to break them up, but as someone that is new to SE, it can be somewhat intimidating to decide which one to post in to ensure you get a good answer. For example, if I am a computer science student, my first instinct might to be to post in the computer science network, until I see that it literally has 1% of the users as the Stack Overflow network, which still seems to be for programming/computer science related questions. So my second instinct would then to be to post it into the Stack Overflow site on the basis that I have a significantly higher chance of my question being seen and getting a good answer. Then I notice that there is also a 'programmers' network, and I don't even begin to know where that fits in. I, and I am assuming most people, will probably just post on Stack Overflow to be safe. My question is, other than the short little description blurb of each one, is there a clear cut set of guidelines which what each network is intended for, what kinds of questions should go to each one, and is anything being done to encourage people to post in these newer, smaller (more specialized?) networks as opposed to just posting in big daddy Stack Overflow? Now again, this is for computer science/programming/"why isn't this code doing what I want?" related questions, I am not saying that if I had a question about Linux or WordPress or something I would have the same confusion. |
I confuse that the difference of Residuals deviance between binary and count data of the same data, by logistic regression in R. I'd like to know the way to calculate the both Residual deviance. Please give me some advice. binary data x<-c(2,2,2,2,2,3,3,3,3,3,5,5,5,5,5,6,6,6,6,6) yesno<-c(1,1,0,0,0,1,0,0,0,0,1,1,1,0,0,1,1,1,1,0) modelb<- glm(yesno~x,family=binomial) (resultb<-summary(modelb)) # Estimate Std. Error z value Pr(>|z|) #(Intercept) -2.0608 1.3486 -1.528 0.126 #x 0.5152 0.3147 1.637 0.102 # Null deviance: 27.726 on 19 degrees of freedom #Residual deviance: 24.744 on 18 degrees of freedom #AIC: 28.744 deviance(modelb) #[1] 24.74444 -2*logLik(modelb) #'log Lik.' 24.74444 (df=2) count data x<-c(2,3,5,6) yes<-c(2,1,3,4) no<-c(3,4,2,1) modelc<- glm(cbind(yes,no)~x,family=binomial) (resultc<-summary(modelc)) # Estimate Std. Error z value Pr(>|z|) #(Intercept) -2.0608 1.3486 -1.528 0.126 #x 0.5152 0.3147 1.637 0.102 # Null deviance: 4.2576 on 3 degrees of freedom #Residual deviance: 1.2762 on 2 degrees of freedom #AIC: 13.096 deviance(modelc) #[1] 1.276154 -2*logLik(modelc) #'log Lik.' 9.096343 (df=2) | In R, there are three methods to format the input data for a logistic regression using the glm function: Data can be in a "binary" format for each observation (e.g., y = 0 or 1 for each observation); Data can be in the (e.g., y = cbind(success, failure)) with each row representing one treatment; or Data can be in a weighted format for each observation (e.g., y = 0.3, weights = 10). All three approach produces the same coefficient estimates, but differ in the degrees of freedom and resulting deviance values and AIC scores. The last two methods have fewer observations (and therefore degrees of freedom) because they use each treatment for the number of observations whereas the first uses each observation for the number of observations. My question: Are there numerical or statistical advantages to using one input format over another? The only advantage I see is not having to reformat one's data in R to use with the model. I have looked at the , searched on the web, and this site and found one tangentially related , but no guidance on this topic. Here is a simulated example that demonstrates this behavior: # Write function to help simulate data drc4 <- function(x, b =1.0, c = 0, d = 1, e = 0){ (d - c)/ (1 + exp(-b * (log(x) - log(e)))) } # simulate long form of dataset nReps = 20 dfLong <- data.frame(dose = rep(seq(0, 10, by = 2), each = nReps)) dfLong$mortality <-rbinom(n = dim(dfLong)[1], size = 1, prob = drc4(dfLong$dose, b = 2, e = 5)) # aggregate to create short form of dataset dfShort <- aggregate(dfLong$mortality, by = list(dfLong$dose), FUN = sum) colnames(dfShort) <- c("dose", "mortality") dfShort$survival <- nReps - dfShort$mortality dfShort$nReps <- nReps dfShort$mortalityP <- dfShort$mortality / dfShort$nReps fitShort <- glm( cbind(mortality, survival) ~ dose, data = dfShort, family = "binomial") summary(fitShort) fitShortP <- glm( mortalityP ~ dose, data = dfShort, weights = nReps, family = "binomial") summary(fitShortP) fitLong <- glm( mortality ~ dose, data = dfLong, family = "binomial") summary(fitLong) |
I just created a bootable USB Linux Mint image. Everything worked fine but now i cannot format my USB pend drive. I tried to use dd if=/dev/zero of=/dev/sdb and udo mkfs -t vfat /dev/sdb but these gives me an error:unable to open /dev/sdb: Read-only file system. I also tried to use the command sudo hdparm -r0 /dev/sdb , and this gave me the following output: /dev/sdb: setting readonly to 0 (off) readonly = 0 (off) But didn't solve the problem. Do you have any suggestion to help me? | I recently made my pen-drive bootable with Ubuntu 14.04. But I need to unboot my pen-drive now. I formatted my pen-drive once,But the size of the pen-drive still shows 2.25 MB. Whereas,this is an 8GB pen-drive. How can I get rid of this problem. I'm still using Windows 7. |
vector erase function brings up an error whereas clear function works. What is the reason for this..? #include <algorithm> #include <vector> #include <iostream> struct person_id{ person_id() = default; person_id(int id) : p_id (id) {} bool operator==(const person_id& other) { return p_id == other.p_id; } int p_id; }; using std::cout; using std::endl; int main(int argc, char* argv[]) { std::vector<person_id> people; person_id tmp_person; tmp_person.p_id = 5; people.push_back(tmp_person); people.erase(5); // error : “No matching function for call 'erase' people.clear(); // works return 0; } | I want to clear a element from a vector using the erase method. But the problem here is that the element is not guaranteed to occur only once in the vector. It may be present multiple times and I need to clear all of them. My code is something like this: void erase(std::vector<int>& myNumbers_in, int number_in) { std::vector<int>::iterator iter = myNumbers_in.begin(); std::vector<int>::iterator endIter = myNumbers_in.end(); for(; iter != endIter; ++iter) { if(*iter == number_in) { myNumbers_in.erase(iter); } } } int main(int argc, char* argv[]) { std::vector<int> myNmbers; for(int i = 0; i < 2; ++i) { myNmbers.push_back(i); myNmbers.push_back(i); } erase(myNmbers, 1); return 0; } This code obviously crashes because I am changing the end of the vector while iterating through it. What is the best way to achieve this? I.e. is there any way to do this without iterating through the vector multiple times or creating one more copy of the vector? |
I've written a proof that $f\left(x\right)=\frac{1}{x}$ is not uniformly continuous on the interval $(0,1)$ and would like to know if it is correct. Here's what I've got. In order to show a function $f$ is not uniformly continuous on $A$, it suffices to show there exist two sequences $(x_n)$ and $(y_n)$ in $A$ and an $\epsilon_0>0$ satisfying $\lim(|x_n-y_n|)=0$ but $|f(x_n)-f(y_n)|\ge\epsilon_0$. Let $x_n=\frac{1}{n}$ and $y_n=\frac{2}{n}$, with $n\ge3$, and set $\epsilon_0=\frac{3}{2}$. Then $\lim(|x_n-y_n|)=0$, but $\left|\frac{1}{x_n}-\frac{1}{y_n}\right|=\left|n-\frac{n}{2}\right|=\frac{n}{2}\ge\epsilon_0=\frac{3}{2}$, as desired. | My questions are about the reasoning made in the note (which is in Norwegian). To prove that $f(x)=\frac{1}{x}$ is not uniformly continuous, the authors use the following "result" (Sats 2.12 in the note, which I translate below): Result 2.12: If for every $h>0$ we have that $|f(x+h)-f(x)|$ is unbounded on $I$, then $f$ is not uniformly continuous on $I$. Proof: The result follows directly from the definition of uniform continuity. In Example 2.14 (Eksempel 2.14), the authors look at $$|f(x+h)-f(x)|=\left|\frac{1}{x+h}-\frac{1}{x}\right|=\left|\frac{h}{x(x+h)}\right|.$$ They then claim that the above quantity is not bounded for any $h>0$, since $$\lim_{x\rightarrow 0}\left|\frac{h}{x(x+h)}\right|=\infty.$$ Question 1: Is it not possible to choose $h=x^2$, thereby obtaining $$\frac{h}{x(x+h)}=\frac{1}{\frac{x}{h}(x+h)}=\frac{1}{x(1/x+1)}=\frac{1}{x(1/x+1)}=\frac{1}{1+x}\rightarrow1 \text{ as }x\rightarrow 0.$$ Therefore, |f(x+h)-f(x)| is not unbounded, so we cannot use the result "Result 2.12". Is my argumentation correct?? Is it OK to choose $h$ like I have done? Question 2: However, it seems correct to me that my argumentation is all you need to prove that $f(x)=\frac{1}{x}$ is not uniformly continuous on (0,1). Here $x_1=x,x_2=x+x^2$, so that $|x_1-x_2|$ can be made arbitrarily small. However $|f(x_1)-f(x_2)|=1$, which stays the same regardless of how small we make $|x_1-x_2|$. Is this correct? |
Can I run this on a usb hard drive on my desktop that is currently running windows xp I do not have enough space to partition my drive ? | I am new to ubuntu and i would like some help. I have a laptop with windows 7 installed but i would love to have ubuntu too because it's a great OS. So i would like to install ubuntu on an external usb hard drive (320 - 500 GB) and i have some questions about that : Do i need a usb external hard drive which will be compatible with ubuntu - linux ? or i can do it with any hard drive If i make a partition on it for ubuntu staff will i be able to use it and save other staff in the usb hard drive (movies,songs,documents etc) ? If i have ubuntu installed on the usb hard drive will i be able to boot ubuntu from any pc ? Are my changes going to be saved normally or my settings will be lost after shut down ? Waiting for your answers, if something is not explain well tell me to try explain it better . Thank you! |
Two point masses m1 and m2, separated initially by distance d, move towards each other under mutual gravitational force. Find the time they take to collide? The main problem I'm having is to solve the differential equation... | My friend and I have been wracking our heads with this one for the past 3 hours... We have 2 point masses, $m$ and $M$ in a perfect world separated by radius r. Starting from rest, they both begin to accelerate towards each other. So we have the gravitational force between them as: $$F_g ~=~ G\frac{Mm}{r^2}$$ How do we find out at what time they will collide? What we're having trouble with is this function being a function of $r$, but I have suspected it as actually a function of $t$ due to the units of $G$ being $N(m/kg)^2$. I've tried taking a number of integrals, which haven't really yielded anything useful. Any guidance? No, this is not an actual homework problem, we're just 2 math/physics/computer people who are very bored at work :) |
(Note: another similar question from a few years ago yielded nought but speculation. I have at provided some detailed observations in the hope that the community can come up with something rigorous as an explanation...) We disassembled an electronic product and found this interesting pattern of dust on the plastic (ABS, HDPE or similar material)... Observations: The dust is easily wiped off. There is no cooling fan in the product and it was situated in an unventilated cupboard. Any airflow would be a result of thermal convection for the most part. It's an old broadband/DSL router which ran from a 12V wall wart ("double insulated" so no Earth-ground connection). The patterns seem to congregate around some of the minor injection-moulding features (known as "ejector marks", the 4 small circular features are almost co-planar with the main surface surrounding them, they are extremely shallow and have a slightly different surface finish to the rest of the plastic). The appearance of the features ("lightning" springs to mind) suggests to my mind that this is some sort of electromagnetic / electrostatic effect. The plastic is not coated with any kind of electrically conductive EMC coating. The circuitry housed within doesn't seem to indicate any particular correlation between the placement of electronic components and the locations of the dust patterns. The features of the plastic case seem to be a more significant catalyst for the formations. Questions: How do these interesting patterns form? What is the composition of the dust likely to be (e.g. metallic or something else?). Why does the shape of the plastic seem to catalyse these weird shapes? Why the lightning / fractalline appearance? | I took apart my cooling platform Something like this : And I found something like this inside : I wonder why around the hollows are the "canyon like" structures. PS: I also drop this platform on the floor, maybe this could be a reason ? EDIT : Everybody seems (except Brandon Enright answer) to ignore the word "dust" in this question. Those structures are not in the plastic itself. It is dust ON the plastic. Proof : Completely wiped out with my finger : |
I have a btn that when clicked its open popover with three other btn. One of them should trigger Ajax. I'm using data-html="true" in order to set the btn inside the popover. I added a onclick to the delete btn in the popover, but when running the page its just wont appear in the tag, the same with href="javascript:function()". Any Idea what I can do to call Js function from the btn inside the popover? Html: <a href="#" class="secondary" role="button" id="mealbtn" data-toggle="popover" data-placement="top" data-content='<div class="btn-group btn-group-sm" style="padding:0px;"><a href="/Meal/[email protected]&[email protected](c => c.mealId == item.mealId).First().RecipeId" class="btn btn-info btn-sm"><span class="glyphicon glyphicon-info-sign"></span></a><a href="/Meal/DinnerMeal/@item.id" class="btn btn-warning btn-sm"><span class="glyphicon glyphicon-pencil"></span></a><a class="btn btn-danger" id="delete-meal-btn" href="#@item.id"><span class="glyphicon glyphicon-trash"></span></a></div>' data-html="true" title="@Model.recipesCon.Where(c => c.mealId == item.mealId).First().Recipe.name" ><span class="glyphicon glyphicon-apple"></span></a> Js try: $('#delete-meal-btn').click(function () { alert('btn clicked'); }); | I have a bit of code where I am looping through all the select boxes on a page and binding a .hover event to them to do a bit of twiddling with their width on mouse on/off. This happens on page ready and works just fine. The problem I have is that any select boxes I add via Ajax or DOM after the initial loop won't have the event bound. I have found this plugin (), but before I add another 5k to my pages with a plugin, I want to see if anyone knows a way to do this, either with jQuery directly or by another option. |
I had a lot of opportunities to meet many different people and listen to their stories. Always I am confused whether I have to use "to Verb" or "Verb+ing". I guess that sentence is the past tense, so I have to use meeting instead of to meet? And could you tell me if you have a better idea to make that sentence sounds more natural? | As a native speaker of English, the gerund version of this sentence sounds better: infinitive: When used together in chains, extension methods are an unprecedented tool to produce extremely concise code. gerund: When used together in chains, extension methods are an unprecedented tool for producing extremely concise code. But how can I explain to someone learning English how to decide in situations like these whether to use the infinitive or the gerund? |
I have to draw a table where I need to color the cells brown and the borders with red. After reading a few similar questions, I have figured out how to properly color the cells and have resolved some issued with my pdf viewer. But I have not found a way to change the borders from black to red. Please suggest a way to do this. Thank you. Edit: Adding the packages I have used. For writing my document I saw a YouTube video and just copied all the packages they had used: \usepackage[latin1]{inputenc} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{graphicx} \usepackage[table]{xcolor} \usepackage{array} \usepackage{multirow} | how to make some border lines of a table thick and colored (either vertical lines or horizental lines)?I tried Xcline but could not color it. Also I tried make the cline thick but failed. |
As I place an image texture onto a cube, the cube renders transparent, you know those black & white checkerboards. | As I place an image texture onto a cube, the cube renders transparent, you know those black & white checkerboards. |
I have a wordpress with 47 unique posts, also adding new posts 2 times in weeks. Unfortunately my impression and clicks are very low which they use to be higher. I have to mention 2 months ago we were hacked and every page that google crawled was getting redirected to another site which we recovered from that situation but those links are all 404 now (around 3k links) which I made my 404 page to return a 410 header. After we recovered our impression and clicks were growing but then suddenly they start to fall. now my impression is never higher than 100 and clicks are around 2 , 3 MAX. Google and other search engine bots are checking the site, I am asking google to crawl each new post manually and we do have a sitemap too. for plugins I use yoast seo,wordfence,wp super cache and some irrelevant plugins. does these plugins effect my seo in any negative way ? where should I start to look ? are we penalized by google ? if so how can I know for sure and how I can fix it ? I'm completely clueless at this point Thanks for any help | There has been a significant drop (90%) in traffic from Google to one of my well-established sites (6+ years) in the last week. Searches show that the top 3 wide keywords all dropped 4 spots. Searches for other keywords do not show ANY results in the first 10 to 25 pages of results, while previously one 1st or 2nd page at most. Since there are , the question really is: What steps are necessary to figure out what caused such a drop? There have been no major changes during this period or the last month on the site and certainly not in the homepage which has dropped in rank. Over all the years of running this site and plenty of others, I have never experienced this. There are is duplicate content on my site and I have rigorously used canonical links for the last few years to ensure it is not misinterpreted as such. |
Is it intentionnal that the chatroom 'frame' eats any text around? | Whenever you post some link that usually converts into one-box, if there's any text after it (space character between the link and text) then it doesn't get converted. Except for chat room links. Try posting http://chat.meta.stackexchange.com/rooms/89/tavern-on-the-meta asdfasd I think it's a bug that has to do with user-friendly room titles included in the link, which gets cut off with the rest of the message, without checking first if there is text after the link. |
Which one is the better choice at the beginning of a sentence: Imagine there is ... or Imagine that there is ... | He will understand that I was not joking. He will understand I was not joking. Which of the sentences is correct? Are there any specific rules about the use of "that" in the sentences I reported as example? |
I have this string var a = toNormal("sdf45sdf4sdf45sd4f5s4df"), b = toNormal("fg45df4g5dfg5df"), c = toNormal("s5d4f5sd4fsdfdd5c"); ... other code how to get "sdf45sdf4sdf45sd4f5s4df", "fg45df4g5dfg5df" and "s5d4f5sd4fsdfdd5c"? my try $pattern = '/a = toNormal("(.*)");/'; preg_match($pattern, $html, $matches); | I am tired of always trying to guess, if I should escape special characters like '()[]{}|' etc. when using many implementations of regexps. It is different with, for example, Python, sed, grep, awk, Perl, rename, Apache, find and so on. Is there any rule set which tells when I should, and when I should not, escape special characters? Does it depend on the regexp type, like PCRE, POSIX or extended regexps? |
In my answer . - How can I have "long =" so that the length of the word "de morgan" is equal the length of "="? Thank you. | I have a command that has been floating around in my standard preamble for a while: \newcommand{\xeq}[1]{\stackrel{\;#1}{\cleaders\hbox{=\!}\hfill}\:} It is meant to mimic the AMS-LaTeX extendible arrow symbols \xleftarrow and \xrightarrow. It's not perfect for two reasons: It does not take the optional lower argument like the AMS \xrightarrow[down]{up} The overlap of the constituent equals signs is slightly visible. Does anyone have a better command or know of a package with such a command? |
This is returned as the last row, the group record ID looks cut off Group_Member__c:{Id=a181K000005jd11QAA, Contact__c=0031K00002tTqaQQAS, Group__c=a171K00000 Query is list<group_member__c> gmm = ([SELECT id, contact__r.mobilePhoneString__c, group__c from group_member__c where (is_sms_group__c = true and status__c = 'Active')]); system.debug(gmm); Maybe the ID is correct and the discrepancy is at system.debug? Edit - just realized the query isn't returning all of the records I need. Double-checked data by creating an equivalent report. Very weird | For the longest time I have been using System.debug(JSON.Serialize(o)) to output objects to the debug log for troubleshooting purposes. This has worked up until my most recent project. Even existing code seems to be having this behavior. I've tested API versions 41-45 with no luck. The actual line of code I'm using is: system.debug(json.serialize(accountsToInsert)); // This is a map I have also tried: system.debug(json.serialize(accountsToInsert.get(Key))); AND Account test = accountsToInsert.get(Key); system.debug(json.serialize(test)); The code is called from a method defined in a VF page action attribute. Is this just a thing that we have to live with now? Is there another way to get a full look into the state of an object at run time? |
I using typeof to identify the type of an element. Here is my code: <script> alert("before = " + typeof test); function test(i) {} alert("after = " + typeof test); </script> In output I am seeing as: before = function after = function When the page loads then the function is not yet defined, then the first alert should say undefined. So why it says function in my output? | I've recently started maintaining someone else's JavaScript code. I'm fixing bugs, adding features and also trying to tidy up the code and make it more consistent. The previous developer used two ways of declaring functions and I can't work out if there is a reason behind it or not. The two ways are: var functionOne = function() { // Some code }; function functionTwo() { // Some code } What are the reasons for using these two different methods and what are the pros and cons of each? Is there anything that can be done with one method that can't be done with the other? |