body1
stringlengths 20
4.1k
| body2
stringlengths 23
4.09k
|
---|---|
I am trying to install Ubuntu 16.04 on a new Dell XPS 15, 16gb Ram, i7 7700 CPU, 512gb SSD. Windows is already preinstalled which I want to keep for the odd admin task so I added a partition of 220gb for my main Ubuntu machine. I have tried installing using the same boot drive I used on my new PC about 2 weeks ago which worked fine on there but I am just getting numerous errors when trying to install on this new machine. I also tried installing the latest elementary OS with similar issues. As the console was mentioning CPU I downloaded and ran the intel processor test and everything came out fine. Windows is also running well, or as well as it does so hardware seems fine. Any ideas on how to resolve this? I have tried three different usb drives all with the same result and also multiple ports on the machine itself. | I get this error message NMI watchdog: BUG: soft lockup - CPU#2 stuck for 23s! [plymouthd:305] on the startup of my system (even with live-cd). My PC is a dell inspiron 7559 with intel graphic and nvidia. UPDATE - this issue also happens when attempting to install ubuntu 18.10 using LiveUSB |
I have received the following error after rebooting my virtual machine: Error: Invalid magic number. alloc magic is broken as 0x7e92a4a0: 7e845c0 Aborted. Press any key to exit. I have scoured the internet to no avail. | I cannot boot into GRUB. I see this: Alloc magic is broken at XXXXXX Press any key but when I do nothing happens. Holding shift doesn't do anything either. The last time I could use my machine I changed stuff in /etc/grub.d, but I chrooted into the system, reverted everything and successfully ran update-grub. What can I try? If anyone wondering: Ubuntu 12.04.1, Installation media was (I guess) 11.10, it's an i5-first generation kernel, 4GB RAM, memtest was okay. |
I'm working on a question below: Let $H(n,k)$ denote the number of ways to partition a set with $n$ elements into $k$ subsets of the same size. Derive a formula for $H(n,k)$. Thanks in advance for any hints! :D | Let's have 2 numbers, N and K, where K divides N. The number of K-combinations from a given set S of N elements is a well known formula. Let's concatenate N/K groups (resulting in N elements) such as the resulting set is N. How many possibilities are there, i.e. what's the formula? For instance: N=4, K=2, C(4, 2) = 6 {1,2},{1,3},{1,4},{2,3},{2,4},{3,4} The 3 possibilities are: {1,2},{3,4} {1,3},{2,4} {1,4},{2,3} I generated these combinations and I think the number goes like this: (4, 2): 3 (6, 3): 10 (6, 2): 15 (10, 5): 126 (9, 3): 280 (10, 2): 945 (14, 7): 1716 (12, 4): 5775 (15, 5): 126126 (15, 3): 1401400 Apparently, the result always divides with (N-1). |
I can't believe I have to ask this, but where do I find an actual API reference for Blender scripting? I just can't seem to find one. I see but no proper reference documentation. For instance, feels like it should be giving me a list of all the members of bpy.data but I don't see any way to get that information. The "next" button just takes me to the next section, and "modules" takes me somewhere else entirely. What am I missing? EDIT: The linked dupe DOES NOT answer the question. Clearly you did not read my question. I can't find the ACTUAL API REFERENCE. I don't understand why this is so complex to answer. How do I know what each "class" (or whatever the python equivalent is) member variable and function is? | Some of my scripts scripts are broken e.g. bpy.ops.pose.armature_layers(layers=sel_layers) # 2.6 api has been (unnecessarily) renamed to bpy.ops.pose.bone_layers(layers=sel_layers) # 2.7 In the 2.71 RC1 bpy.ops.anim.keyframe_insert(type='BUILTIN_KSI_LocRot') leads to an error: TypeError: Converting py args to operator properties: enum "BUILTIN_KSI_LocRot" not found in ('Available', 'WholeCharacter') And seems no longer to respect the bone/armature layers. The latest documentation I found is: which is not accessible from the navigation pages from blender.org, manipulating the version part of the URL neither works (tried 2_71, 2_71RC1, 2_71_RC1). Where can the 2.71 API be found? |
I have this simple script on crontab (root): (centos 6.5) if ! ping -c 1 172.20.1.1; then echo "NOT OK" >> /root/log ifconfig eth3 down sleep 5 ifconfig eth3 up else echo OK >> /root/log fi The script works fine if I run it from directly from terminal and restarts the interfaces but not when run through crontab. I wanted to see if the crontab is actually running as expected and put the echo lines and I'm 100% sure the script is running because I see the OK and NOT OK lines on the log. What do you think is wrong with this? | 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 ask myself what is the more performance method when you join table and use JOIN in clause FROM and when you need to use BETWEEN : Use Between in the FROM or Use between in the WHERE Exemple : SELECT * FROM Tab1 a inner join Tab2 b on (a.pk=b.fk_1 AND a.date between b.date1 and b.date2) Versus SELECT * FROM Tab1 a inner join Tab2 b on a.pk=b.fk_1 WHERE a.date between b.date1 and b.date2 Which one is the best? Thank P.S : sorry for my bad english | After reading it, this is not a duplicate of . The answer may be related (or even the same) but the question is different. What is the difference and what should go in each? If I understand the theory correctly, the query optimizer should be able to use both interchangeably. |
My code is A = \left[\begin{matrix} 1&\underbrace{\begin{matrix} 1&\dotsb&1 \end{matrix}}_N \end{matrix}\right] and the outcome is but I want the following outcome How can I get this? | I would like to put an underbrace below the matrix like this: $$\left(\underbrace{ \left[\begin{array}{ccc} a&b&c\\ d&e&f\\ g&h&i \end{array}\right]}_{A} \left[\begin{array}{c} x_1\\ x_2\\ x_3 \end{array}\right]\right)$$ But I don't want the outer brackets \left( and \right) to stretch vertically. I want them to remain as if there was no underbrace. How to achieve that behaviour? |
Greeting fellas. I was performing the algorithm intended to obtain the number of partitions of a integer. When I tested my program, margin errors started to occur when n > 257. I actually had the same problem on another matter while working with factorials, but my thoughts were on the algorithm itself having some flaws. I know that python 3.5.x doesn't really have limits on number size. I even tried to do the sum the old fashioned way with every sum being from: from decimal import Decimal but it didn't change the result (only added a longer computational time). #! /usr/bin/python3.5 from unittest import TestCase as Test def number_partition(n): """ Building the 'Euler' triangle such as n p(n,j) = sum p(n-j,i) i=j """ if n < 0: return 0 if n is 0: return 1 p = [] for i in range(n): p.append([]) for j in range(i+1): if j is i: p[i].append(1) ; break p[i].append(sum(p[i-j-1][j:])) return sum(p[n-1]) if __name__ == '__main__': # number_partition(257) Test.assertEqual(Test(), number_partition(257), 394723676655357) # Pass Test.assertEqual(Test(), number_partition(258), 425933084409356) # returns 425933084409355 Test.assertEqual(Test(), number_partition(259), 459545750448675) # returns 459545750448673 So is the algorithm flawed, or is there a Python functionnality I didn't get ? Thank you in advance for your time. | My has failed me. In Python, are the following two tests for equality equivalent? n = 5 # Test one. if n == 5: print 'Yay!' # Test two. if n is 5: print 'Yay!' Does this hold true for objects where you would be comparing instances (a list say)? Okay, so this kind of answers my question: L = [] L.append(1) if L == [1]: print 'Yay!' # Holds true, but... if L is [1]: print 'Yay!' # Doesn't. So == tests value where is tests to see if they are the same object? |
I think he's a human astronaut. His boots have germs he is not aware of, which prove fatal to the aliens. It might be by Arthur C. Clarke. | In the 70's or 80's I read a short story in which 2 astronauts looking for a nice place to eat lunch choose a spot at the pole of a small desolate planet, overlooking the world's only pool of surface water. Due to the harsh extremes of heat, and lack of water, this is the home of the planet's single living organism, which has grown slowly over eons, surviving the daily extremes, moving slowly over the bare rock, dissolving it with acidic digestive juices to get the nutrients it needs for survival. The men watch the organism while eating their lunch, then depart, unknowingly leaving death behind them in their garbage - cigarette butts, tin cans, wrappings - a bonanza that the creature moves over to dissolve and ingest, along with the human-based microscopic organisms that will destroy the alien being. The theme of the story is that although we reach out to the stars to seek life, we are much more connected to the lowest forms of life on Earth, than to any life we may find on other planets. I don't remember the author and title. Can someone identify the story? |
There is a menu on bottom left corner of my screen which shows a chrome icon in it. How do I disable it? I am running gnome shell 3.18.5 on ubuntu 16.04LTS. | The legacy tray (see the screenshot below) will be removed in GNOME 3.26. I want to wean myself off it before the change arrives in Ubuntu (17.10 or 18.04). Can I disable the legacy tray in Ubuntu GNOME 17.04? |
Let's say I have a keycode doorlock which accepts 4 digit passcodes. In order to enter, you must type the 4 digits of the passcode in a row, but there is no "Enter", and it doesn't reset after 4 digits. Thus, if you entered "11112222", the lock wouldn't just unlock if the passcode was "1111" or "2222", but also if it was "1112", "1122", and "1222". Given this, what is the most efficient series of digits to enter to go through all possible passcodes? | Suppose you have a computer with a password of length $k$ in an alphabet of $n$ letters. You can write an arbitrarly long word and the computer will try all the subwords of $k$ consecutive letters. What is the smallest word that contains all combinations of $k$ letters as subword? (i.e. the fastest way to hack the computer :) ) The smallest word that contains $n^k$ subwords of size $k$ has length $k-1+n^k$ and based on some easy cases, we would like to prove that it is in fact possible to find a word of such length that contains all possible passwords. The problem can be translated into a problem in graph theory, by taking as vertices all words of length $k$. We tried $k=2$, where you can prove the conjecture by induction. For $n=2$ and small $k$ it also works. |
new to LaTeX and BibDesk. Hoping to somehow figure out how to get it to work! I've entered all the required information into a bib file called Chapterbib.bib and saved it in the same folder as my file. In order to cite a source in my document, I copy the citation key into my document where I'd like to cite a source - however, rather than putting a citation in I simply get [?] after my sentence. I'm not sure what sort of packages or commands I should be using so any advice as to how to get moving from here would be much appreciated. Thank you for your help! | I've browsed the forums and found a number of posts that have addressed this issue, but none of the solutions seem to work for me. I have the following script that I just copied from the bibtex home page to get familiar with it. Instead of the citation number I get a question mark. I compile using Latex+Bibtex+Latex+Latex+PDFLatex+ViewPDF just as has been previously suggested and the problem persists. \documentclass[11pt]{article} \usepackage{cite} \begin{document} \title{My Article} \author{Nobody Jr.} \date{Today} \maketitle Blablabla said Nobody ~\cite{Nobody06}. \bibliography{mybib} \bibliographystyle{plain} \end{document} My bibliography (Bib.bbl) @misc{ Nobody06, author = "Nobody Jr", title = "My Article", year = "2006" } Looking at previous posts one thing that is concerning is that my .bbl looks empty as shown below. Further, I don't have a .blg \begin{thebibliography}{} \end{thebibliography} |
How I can prove that if $A$ is a ring and $f\in A$ is not nilpotent then $A_f\cong A[T]/(Tf-1)$? My attempt is the following. I define the homomorphism $\phi : A[T]\longrightarrow A_f$ in this way: $\phi(a):=a/1$ and $\phi(T^n)=1/f^n$. Now, of course $(Tf-1)\subseteq \ker \phi$, but I'm not able to prove the reverse inclusion. | I am having trouble with the following problem. Let $R$ be an integral domain, and let $a \in R$ be a non-zero element. Let $D = \{1, a, a^2, ...\}$. I need to show that $R_D \cong R[x]/(ax-1)$. I just want a hint. Basically, I've been looking for a surjective homomorphism from $R[x]$ to $R_D$, but everything I've tried has failed. I think the fact that $f(a)$ is a unit, where $f$ is our mapping, is relevant, but I'm not sure. Thanks |
I'm bit of noob when it comes to blender so I was wondering why when I import .fbx models into blender the textures do not appear even when I select the texture option? | I'm a new blender user, but have used other modelling programs before. I've downloaded a and unzipped it. When I import the obj into blender, it is my understanding (from here: ) that the mtl should just import itself with it. However, when I import the obj, I just get a grey model with no texture. Is it actually importing the mtl but I'm not seeing it? Also for the record, I have changed no settings in blender. Picture for reference: |
i was upgrading to 15.10 with these two commands that i found on ubuntu forums: sudo sed -i 's/vivid/wily/g' /etc/apt/sources.list sudo apt-get update && sudo apt-get dist-upgrade but at some point it showed network failure and it stopped so i tried this command: apt-get update but the problem i encountered is that even on rebooting on screen it flashes 15.04 now if i redo the upper two commands will it create duplicate repositories that i will have to take care of? because i dont have enough space on my laptop to waste. and any other detail for my upgrade to 15.10 would be highly appreciated! | How do I upgrade to the unreleased version of Ubuntu for testing? |
I have a dictionary: D = {'N':5, 'S':0, 'W':6, 'E':1} and I want to get key with maximum value among D['N'] and D['S']. For example I tried code print(lambda k: max(k['N'], k['S'])(k=D.keys())) but it returns lambda object like this <function <lambda> at 0x000002C7B060C1E0>. Although I wanna get N in output. Need help. Thanks! | I have a dictionary: keys are strings, values are integers. Example: stats = {'a':1000, 'b':3000, 'c': 100} I'd like to get 'b' as an answer, since it's the key with a higher value. I did the following, using an intermediate list with reversed key-value tuples: inverse = [(value, key) for key, value in stats.items()] print max(inverse)[1] Is that one the better (or even more elegant) approach? |
On the website, the top tags number only shows your answer score, whereas on the apps it shows the combined score of questions+answers. This is pretty confusing. | I checked yesterday and today the new homepage in the Android app. Very surprised I saw that I would almost reach a silver tag badge, that confused be because I always take a look on possible badges I can get. However I compared the score with the website and I got a total different results. See this two screenshots: |
Using ArcGIS Desktop 10.7 I want to substring numbers as text out of a string field into a new string field with field calculator so that I can use them for layer symbology. The field contains highway names such as 'I- 280' and 'State Rte 25' and I want only the '280' and '25' for a new field. Is there a Python conditional statement I can use that will substring the number regardless of digit length, placement (end or between text, eg, "State Rte 25 Bus")? | I am trying to calculate field test2 with only the numeric values from a string field test. The entire script is like: def makestr(test) list=[] for s in test: if s.isdigit(): list.append(s) for a in list: str=''.join(list) But I keep getting an error: Any ideas? |
I am using USB cable to charge my phone, however, ubuntu auto mount my phone and show the files in it. How could I stop this? | I am using Ubuntu 11.10 (64 bits) and I do not want to mount automatically USB thumb drives in my system. I tried the command dconf-editor and gconf-editor but there isn't the icon to disable it in nautilus preferences (apps|nautilus|preferences|media_automount). Thanks. |
I have setup a machine for a relative that have children, I made myself an account on the computer which is the only administrator account. I have forgotten the password that I had setup the administrator account on the machine. I did not create a recovery disk on setup nor did I associate any MS account with my user account. Is there any way to reset the password on this account? Or make another administrator account? | I installed Windows 8 on my mother's notebook, she typed a new password for her and she lost it, she can't remember what she typed and no notes about it were made(my fault), now her Windows 8 installation just keep locked on logon/password screen. How can I change the Windows 8 password for her account, reset the password or recovery the password without needing to reinstall entire Windows 8? Could I just create another new account on the same computer from the safe mode or something like this? PS: No live account was related to her Windows 8 account as far no account was registered on Windows 8 Store. |
I am creating a simple static application in android studio. When I tried to run the application using USB debugging option, It crashed and showed two errors in logcat: I am new to android studio and it is my first project, please help me in debugging this error. Here is the screenshot for the MainActivity Java code where the error is supposed to be: | What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them? What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely? |
I'd like to create compact itemized lists within a column of a table that are vertically alligned with non-itemized text from the same column. I'm using enumitem to get more control over these environments, but I can't figure out how to completely remove the vertical spacing above and below the itemize environment. Consider this simple example: \documentclass[12pt]{report} \usepackage{enumitem} \usepackage{booktabs} \begin{document} \begin{tabular}{p{3cm}p{3cm}} \toprule Column one & Column two \\ \midrule First group & \begin{itemize}[noitemsep,topsep=0ex,partopsep=0ex,leftmargin=2ex] \item First item \item Second item \end{itemize} \\ Second group & \begin{itemize}[noitemsep,topsep=0ex,partopsep=0ex,leftmargin=2ex] \item First item \item Second item \end{itemize} \\ \bottomrule \end{tabular} \end{document} I have set topsep and partopsep to zero to try and remove the vertical spacing, but this does not seem to work as expected. Is there additional spacing outside the itemize environment that I'm overlooking? | If I create a table with several (short) lists, currently I'm using a table construction with enumitem to (almost) remove the left margin. Now I still have a rather large margin at the top and the bottom (above and below) of the itemize lists. Is there any way I can instruct either the itemize list or the table to remove this margin as well? Code example: \begin{tabular}{|m{3cm}|p{5.5cm}|p{5.5cm}|} \hline Category 2 & \begin{itemize}[leftmargin=*] \item A \item B \end{itemize} & \begin{itemize}[leftmargin=*] \item C \item F \end{itemize} \\ \hline \end{tabular} |
Sean Carroll states the Einstein's Equivalence Principle (EEP) as "In small enough regions of spacetime, the laws of physics reduce to those of special relativity; it is impossible to detect the existence of a gravitational field by means of local experiments." Local flatness theorem says that there exists a class of coordinate transformations such that any general metric can be brought into the Minkowskian form (special relativity form). So isn't a proof of the local flatness theorem is (almost) a proof of the EEP? | I'm looking for a rather intuitive explanation (or some references) of the difference between the metric of a curved space-time and the metric of non-inertial frames. Consider an inertial reference frame (RF) with coordinates $\bar x^\mu$, in flat spacetime $\eta_{\mu \nu}$ (Minkowski metric). If I have well understood, on one hand, I can go to an accelerated RF by change of coordinates $x^\mu(\bar x)$. The metric is given by: $$\tag{1}g_{\mu \nu}(x) = \frac{\partial \bar x^{\alpha}}{\partial x^{\mu}} \frac{\partial \bar x^{\beta}}{\partial x^{\nu}} \eta_{\alpha \beta}$$ On the other hand, I know that a curved space-time with metric $q_{\mu \nu}$ cannot be transformed to Minkowski $\eta_{\mu \nu}$ by coordinate transformation. In other words there does NOT exist any coordinate $x^\mu(\bar x)$ such that (in the whole coordinate patch): $$\tag{2}q_{\mu \nu}(x) = \frac{\partial \bar x^{\alpha}}{\partial x^{\mu}} \frac{\partial \bar x^{\beta}}{\partial x^{\nu}} \eta_{\alpha \beta}\qquad \leftarrow \text{(does not exists in curved space)}$$ So far, everything is more or less ok... But my question is: What is the difference between $q_{\mu \nu}$ and $g_{\mu \nu}$? I mean, in both cases a particle would "feel" some fictitious forces (in which I include the weight force due to the equivalence principle). What physical situation can $q_{\mu \nu}$ describe and $g_{\mu \nu}$ cannot? I additionally know that by change of coordinates $q_{\mu \nu}$ is locally Minkowski. But still, I can't see clearly the difference. |
I have a read-only file, F. A program, P, that I'm not the author of, needs to read F. I want the content of F to come from another 'generator' program, G, whenever P tries to read F (taking F to be an ordinary file) and not any earlier. I tried doing the following: $ mkfifo /well-known/path/to/F # line #1 $ G > /well-known/path/to/F # line #2 Now, when P starts up and tries to read F, it appears to be able to read the output generated by G just as I wished it to. However, it can do so only once, since G after all gets to run only once! So, if P had a need to read F again later in its execution, it would end up blocking on the fifo! My question is, other than bracketing line #2 above in some sort of an infinite loop, is there any other (elegant) alternative for the above? What I'm hoping for is, some way of registering a 'hook' program into the file-open system call such that the file-open would result in the launching of the hook-program and the file-read in the reading of the hook-program output. Obviously the assumption here is: the read will happen sequentially from file beginning to file end, and never in random seeks. | Is there any way to create a virtual file, such that reading from the file actually reads from the stdout of a command; writing to the file is acually writing to the stdin of a command? So far I have kludged this with an inotifywait on a file, which calls a command when the file is modified, taking it's input from the file and writing back to it. I don't like that the inotifywait has to be constantly restarted though (and I have to ensure that it is always running). I only use this file perhaps twice a week. |
I've followed to install phpMyAdmin on the server which uses ubuntu 14.04. I've entered all commands and restarted apache, but when I open this path through the browser: http://domain_name_or_IP/phpmyadmin // I replace my real IP with domain_name_or_IP It throws: Not Found The requested URL /phpmyadmin was not found on this server. Apache/2.4.7 (Ubuntu) Server Also here is the result of this command: root@ubuntu:/etc/apache2/conf-available# ls See? there is not any file related to phpMyAdmin. Does anybody know what's wrong? | When I go to localhost/phpmyadmin I get the apache "Not Found" error (404). However, I can load html pages, and run php pages (such as <?php phpinfo(); ?>). And phpmyadmin is installed. balter@homedevbox:~$ aptitude search phpmyadmin i phpmyadmin - MySQL web administration tool I also installed the standard ubuntu LAMP stack and set passwords for mysql and all that. What could be the problem? EDIT: Here is where my phpmyadmin files are. balter@homedevbox:/var$ cd / balter@homedevbox:/$ sudo find . -type d -name phpmyadmin ./var/lib/mysql/phpmyadmin ./var/lib/phpmyadmin ./etc/phpmyadmin ./usr/share/phpmyadmin ./usr/share/dbconfig-common/scripts/phpmyadmin ./usr/share/dbconfig-common/data/phpmyadmin ./usr/share/doc/phpmyadmin |
I am running into an issue when trying to run apt update on 19.10. I am getting the following error: E: http://us.archive.ubuntu.com/ubuntu eoan-security/multiverse amd64 c-n-f Metadata is not (yet) available (Could not open file /var/lib/apt/lists/partial/us.archive.ubuntu.com_ubuntu_dists_eoan-security_multiverse_cnf_Commands-amd64.xz - open (13: Permission denied) [IP: xxx.xxx.xxx.xxx 80]) I checked that file and it is owned by root with 644 permissions. Any pointers? EDIT I am running this as root, for those who asked. | Greetings from Bangladesh. I am an intermediate user of Ubuntu OS. I am facing problem with apt update. I have searched online but could not find any answer to my problem so I am posting this question please help me. Err:20 http://archive.ubuntu.com/ubuntu eoan-updates/restricted amd64 c-n-f Metadata Could not open file /var/lib/apt/lists/partial/archive.ubuntu.com_ubuntu_dists_eoan-updates_restricted_cnf_Commands-amd64.xz - open (13: Permission denied) [IP: 91.189.88.152 80] Ign:35 http://archive.ubuntu.com/ubuntu eoan-updates/multiverse amd64 c-n-f Metadata Err:37 http://archive.ubuntu.com/ubuntu eoan-backports/main amd64 c-n-f Metadata Could not open file /var/lib/apt/lists/partial/archive.ubuntu.com_ubuntu_dists_eoan-backports_main_cnf_Commands-amd64.xz - open (13: Permission denied) [IP: 91.189.88.152 80] Reading package lists... Done E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/eoan-updates/restricted/cnf/Commands-amd64 Could not open file /var/lib/apt/lists/partial/archive.ubuntu.com_ubuntu_dists_eoan-updates_restricted_cnf_Commands-amd64.xz - open (13: Permission denied) [IP: 91.189.88.152 80] E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/eoan-backports/main/cnf/Commands-amd64 Could not open file /var/lib/apt/lists/partial/archive.ubuntu.com_ubuntu_dists_eoan-backports_main_cnf_Commands-amd64.xz - open (13: Permission denied) [IP: 91.189.88.152 80] E: Some index files failed to download. They have been ignored, or old ones used instead. I have tried with removing partial folder's content completely. Cleaning apt by sudo apt clean moving the lists to lists.old then updating the apt But without luck. |
I have the following AWK command which works well. awk -v RS="\n+?[$]{4}\n+?" '/HMDB0000008/' test.xt However what I want is to be able to call it from the command line and pass an argument so that it can find what I want. For example, something like this: awk -f var=HMDB0000008 RS="\n+?[$]{4}\n+?" '/$var/' test.txt However this does not seem to work. Can you tell me what would be the best way? Thank you | Having the following in one of my shell functions: function _process () { awk -v l="$line" ' BEGIN {p=0} /'"$1"'/ {p=1} END{ if(p) print l >> "outfile.txt" } ' } , so when called as _process $arg, $arg gets passed as $1, and used as a search pattern. It works this way, because shell expands $1 in place of awk pattern! Also l can be used inside awk program, being declared with -v l="$line". All fine. Is it possible in same manner give pattern to search as a variable? Following will not work, awk -v l="$line" -v search="$pattern" ' BEGIN {p=0} /search/ {p=1} END{ if(p) print l >> "outfile.txt" } ' ,as awk will not interpret /search/ as a variable, but instead literally. |
In the movie Predestination: Jane is born as a result of John and Jane having sex. John and Jane are the same people from different timeline. Is Jane's birth because of a predestination paradox or bootstrap paradox? which one is it? | In Predestination starring Ethan Hawke, the idea is plain and simple. However, I do find something very hard to digest: How could the loop about Ethan Hawke the time travel agent, could meet himself and then conceive himself without some sort of help to initialize the loop? What I want to say is that, in the first loop of the story, there is only one Ethan Hawke. He then travels back in time and after meeting his past self, he gives birth to himself. But who was responsible for the birth of the first Ethan Hawke? As a developer this bugs me more than it should. Any theories? |
I just learn one theorem which says If "$f^{'}$ exists and is monotonic on an open interval (a,b),then $f^{'}$ is continuous on (a,b)."I got the proof but now I am looking for one example in which if I relaxe the hypothesis of monotonic-ness then resulting $f^{'}$ is not continuous.I am thinking but unable to get such example. Thanks. | Could someone give an example of a ‘very’ discontinuous derivative? I myself can only come up with examples where the derivative is discontinuous at only one point. I am assuming the function is real-valued and defined on a bounded interval. |
If we treat a column vector $a$ as an $n \times 1$ matrix, or a row vector $a^T$ as a $1 \times n$ matrix, how would one write out the reduced singular value decomposition of $a$? | (a) Given the column vector $a$ as an $n\times 1$ matrix. Write out its singular value decomposition, showing the matrices $U, \sum$, and $V$ explicitly. (b) Given the row vector $a^T$ as an $1\times n$ matrix. Write out its singular value decomposition, showing the matrices $U, \sum$, and $V$ explicitly. I currently get stucked on this question, since I couldn't find the eigenvalues of the $n\times n$ matrix $aa^T$ in part (a), and $a^Ta$ in part (b) to find the columns of $U$ and $V$, respectively. Can someone please help me on this problem? |
About six years ago, UK interest rates hit the historic low of 0.5%. In keeping with all the finiancial advice at the time that this was a once in a lifetime circumstance I rushed out and got a fixed rate mortgage. For ten years. The interest rates have not increased at all that whole time, and I've lost money every single month. The terms of this mortgage are very strict. There is a substantial penalty (£1,000 per year remaining) to get out of it. I can only overpay up to double the monthly amount of the mortgage. If I do it makes zero difference to the actual amount I will pay overall - the only result will be to end the mortgage early. I could afford to overpay each month if I wanted to. However, to my mind this is the least logical thing to do in this situation. As I said, I've lost money on this every month. The only chance I have to make up what I've lost is if interest rates rise during the remaining term of the mortgage. It seems likely this is going to happen within the next 12 months, and it's possible there may be further rises in the remaining 3 years. When friends and family quiz me about this, they seem amazed that I'm not overpaying. And when I explain the above, they seem unable to understand why I think overpaying is the last thing I should be doing. It's happened so many times now that I'm starting to doubt the wisdom of my decision. So - am I right not to overpay? | My mortgage came up for renewal right at the time in 2009 when UK interest rates hit rock bottom. This was unprecidented, and most financial advice was to take out a fixed-rate mortgage. So I perhaps went overboard and got one for ten years. Five years on, interest rates haven't moved and I'm losing money on it to the tune of £100 a month. Obviously, this is ongoing: so that decision has cost me about £5000 in real terms so far. It'll come to a lot more by the end of the mortgage, unless interest rates rise. Being fixed rate, it's been designed so you can't get out early. If I decide to end the mortage, it'll cost me £1,000 per year of the mortgage remaining - which is roughly what I'm losing anyway, so that seems a bad idea. I can overpay by up to £500 per month. However, doing this doesn't help pay down the mortgage at all: the total is just added up and will cause the mortgage to end early, by a period dependent on the overpayment total. This seems to me to be a very bad idea because hoping interest rates rise over the next five years is the only hope I have of making good on some of the losses that I've made. Is this sensible thinking? If so, is there anything at all I can do to try and ameliorate the financial pain this product is causing me? |
I installed a Wordpress plugin "All In One Schema.org Rich Snippets." To show rich snippets in search results. When I publish items, it shows a rich snippet area below the article. Can I hide that area and Google will still show rich snippets? Thanks. | I want to add some piece of data to rich snippets (for example, breadcrumps), but this information is not visible on the page (for example, because the designer has not yet prepared the sketches) Is there a way to tell search engines to index this data? |
I have defined an environment called \equ, which is an aligned equation environment to save time when writing a thesis with lots of equations. However, after using this environment there is a small indent, which is not there if I just use the \begin{equation} and \begin{aligned} commands directly (see MWE): \documentclass{book} \usepackage{mathtools} \newenvironment{equ}[1] {\begin{equation} \label{equation:#1} \begin{aligned} } { \end{aligned} \end{equation} } \begin{document} \chapter{Test Chapter} This is the first paragraph of text in the document. It is not indented, as expected. This is the second paragraph of text in the document. It is indented, as expected. \begin{equation}\label{equation:1} \begin{aligned} F &= m a\\ E &= m c^{2} \end{aligned} \end{equation} This is the paragraph after an equation. It is not indented, as expected. \begin{equ}{1} F &= ma\\ E &= m c^{2} \end{equ} This is the paragraph after an equ. It is indented with a small indent, and the vertical spacing around the equation looks slightly different, but I don't know why?! \end{document} I am fairly new to this; I'm sure it's something obvious so any help would be appreciated! | If I create a custom environment based on the equation environment, I get a spacing issue: the next line of text after my environment closes doesn't start on the left margin. Example code: \documentclass{article} \begin{document} \newenvironment{myenv}{\begin{equation}}{\end{equation}} \noindent $| \leftarrow$ this is the left margin. \begin{myenv} e ^{i \pi} + 1 = 0 \end{myenv} $| \leftarrow$ this isn't the left margin. \end{document} Output: Removing the newline after \end{myenv} solves the spacing problem, but the resulting code is not readable. Of course, in this example I could just use the equation environment itself. My real issue involves a more complex custom environment that suffers from the same problem, and which also includes an equation environment within it. |
I'm trying to find if my database has a column named sort_method. I have had a look around the forums but don't seem to be able to find the right answer. My database has over 300 tables so manually looking for it is not an option. I'm using phpMyAdmin - SQL query | I have 2-3 different column names that I want to look up in the entire DB and list out all tables which have those columns. Any easy script? |
The patient had been waiting in the emergency room for almost an hour before a doctor finally treated her. (an) goes with a,e,i,o,u (a) goes with the other letters why do we use an hour ? instead of a ? | Which indefinite article should precede hour — a or an? an hour a hour Does the usage of an vs a depend on the pronunciation — a history, a hobby, but an hour, an honor? |
CREATE TABLE emp ( empno NUMBER (4, 0), ename VARCHAR2 (10), job VARCHAR2 (9), mgr NUMBER (4, 0), hiredate DATE, sal NUMBER (7, 2), comm NUMBER (7, 2), deptno NUMBER (2, 0), CONSTRAINT pk_emp PRIMARY KEY (empno) ); This is the table creation, obviously This is the table output Now what i need to do is find the sum of Sal + Comm for the Salesman rows, and then find the max of those sums, then display that max plus the corresponding ename Here is my code SELECT ename, MAX (SUM (sal + comm)) max_sal FROM emp WHERE job = 'SALESMAN' GROUP BY ename I know this nowhere near correct, but I'm brand new to SQL so I'm very stuck (using SQL live btw) | Table: UserId, Value, Date. I want to get the UserId, Value for the max(Date) for each UserId. That is, the Value for each UserId that has the latest date. Is there a way to do this simply in SQL? (Preferably Oracle) Update: Apologies for any ambiguity: I need to get ALL the UserIds. But for each UserId, only that row where that user has the latest date. |
I just bought a Google Chromebook HP 14 and I am very happy to be honest. But I do miss my Ubuntu OS :), and the options available to use aren't a real native OS system but adaptations that sometimes do not work :( Does anyone have an idea how to install with dual boot Ubuntu alongside Chrome OS? | I have installed Ubuntu 13.04 on my desktop (runs like a charm). Then I used Crouton to install Ubuntu 12. 04 on my chromebook samsung (ARM). It also works quite well. Here comes my question. Can we have a true Ubuntu (preferably 13.04) on my ARM chromebook? It seems that the Crouton/Ubuntu is not 100% the real thing. The best option would be to have the full Ubuntu 13.04 and remove the Chrome OS. |
I need to create generic method which returns greater of two params. Operators > and < don't work. Here is signature of my method: public static T Greater<T>(ref T a, ref T b) { if (a > b) { return a; } else { return b; } } I'm quite rookie in C# and totally new in generic types. | Possible Duplicate: I've coded something like this: public bool IsDataChanged() { T value1 = GetValue2; T value2 = GetValue1(); return (valueInDB != valueFromView); } Right now the function doesn't compile with the error "Operator '!=' cannot be applied to operands of type 'T' and 'T'". What do I have to do to make this function work ? |
Is $$\sum^\infty_{n=1}\frac{2n^2}{5n^2+2n+1}$$ Convergent or Divergent? If convergent, find the sum. If Divergent, explain why. Since it is continuous, positive, and decreasing I used the integral test: $$\int^\infty_1\frac{2n^2}{5n^2+2n+1}\Rightarrow \int^\infty_1 \frac25dn +\int^\infty_1ndn+2\int^\infty_12n^2$$ $$\frac25\bigg[n\bigg]^\infty_1+\frac25\bigg[\frac{n^2}{2}\bigg]^\infty_1+2\bigg[\frac{n^3}{3}\bigg]^\infty_1$$ $$\infty+\infty+\infty=\infty; \text{Divergent by the Integral Test}$$ Did I do this correctly? | Is this convergent or divergent? if convergent, find the sum. If divergent explain why. $$\sum _{n=1}^{\infty }\:\frac{2n^2}{5n^2+2n+1}$$ I want to use the divergent test which is $\mathrm{If\:}\lim _{n\to \infty }a_n\ne 0\mathrm{\:then\:}\sum a_n\mathrm{\:diverges}$ $\frac{2n^2}{5n^2+2n+1}$ I would assume to take out the largest $n$ in both the top and bottom $\lim _{n\to \infty }\left(\frac{n^2}{n^2}\cdot \frac{2}{5+\frac{2}{n}+\frac{1}{n^2}}\right)\:$ having the $n^2$ cancel $\lim _{n\to \infty }\frac{2}{5+\frac{2}{n}+\frac{1}{n^2}}$ after taking the limit $\frac{2}{5+0+0}$ so $\frac{2}{5}$$\ne $ $\:0\:$ so it's divergent? |
I need to convert existing MP4 files to the XVID format with the .AVI extension. Specifically to something like this: I've tried Camtasia, Handbrake and VLC, but they don't seem to support this format - I guess its really old. Everything else I've googled seems like something that will install a ton of spyware on my PC. | What is the best way to reencode a video with Xvid? I used FFmpeg in the past (I havent tried using FFmpeg with Xvid however - does FFmpeg keep up with Xvid releases?). With FFmpeg I either need to figure out the bitrate of the video then reencode it slightly below or I use -sameq (I think it's same quality), however - that produces a file thats bigger and not better then a slightly less bitrate file. Whats a good way to reecode these videos? (By the way - they are all on my HD as FLV1) |
Given positive $a$ and $b$ with $a < b$, define two sequences recursively with $x_0 = a$, $y _0 = b$, $y_{n+1} = G(x_n, y_n)$, $x_{n+1} = H(x_n, y_{n+1})$. Prove that both sequences converge. $G$ and $H$ are the geometric mean and harmonic mean, respectively. Probably need to start off with proving both sequences are monotone and have an upper bound, but have no idea where to take the proof from that point. Any hints would be greatly appreciated. | Let $a_1$ and $b_1$ be any two positive numbers, and define $\{ a_n\}$ and $\{ b_n\}$ by $$a_n = \frac{2a_{n-1}b_{n-1}}{a_{n-1}+b_{n-1}},$$ $$b_n = \sqrt{a_{n-1}b_{n-1} }.$$ Prove that the sequences $\{a_n\}$ and $\{b_n\}$ converge and have the same limit. Source: Problem Solving Through Problems by Loren C. Larson. Hint: Use the squeeze principle. |
On 18/06/2015 I bought a windows 7 ultimate key. I activated it, connected to microsoft, updated, and everything was nice. However, to my surprise, today it started saying that its not genuine. My first reaction was "I'm going to contact the seller! I'm sure he can help me!". Nope. Website doesn't exist anymore. I now think my Windows is actually not genuine indeed. If I try to apply the activation backup, it doesn't work. If I try to insert the key again, it says that the key is blocked by microsoft. If I say I want to buy a new license, it doesn't offer me the option for windows 7, only windows 10. I use some acessibility things, so I can update for free to windows 10. However when I try to install it, it says my windows need to be activated in order to install it. What are my other options? 2016 is here to say "I'm not over yet". Dammit. I'm from Brazil, and the automated call is not an option. | I've set up a Windows 7 guest machine under Windows 7 using oracle virtualbox 4.2. This Windows Guest has its own product key which corresponds to the boxed set I purchased for the sole purpose of running it in virtualbox. A few months ago I backed up my Windows 7 virtual box virtual disk image on an external hard drive. Now that the Windows 7 started to malfunction, I deleted it, and copied it back from my external hard drive. However now it's telling me that the version of windows is not genuine. How can it be. There is nothing else using the same product key, unless someone hacked into my backup folders and stole the protuct key from there and used it on a machine of their own. Thanks. |
I am using this Power Resistor and I am trying to put it in my layout. The Problem is I can't find any .lib (TO-263 or D2PK) file in Eagle or at least a similar package. Any Help? | I'm making a PCB in Eagle. First I found my components, and now I have to put them in Eagle so I can draw the actual board. Now the problem is, I have found power resistor (I need 0.5 Ohm dissipating at least 4.5W. This one dissipates more, but is apparantly the cheapest I could choose from). As you can see, there is no CAD design associated with this component. In the there is a recommended pad layout, but this would mean that the resistor is layed down on the pcb, whilst al other transistors that might need a heat sink are placed vertical on the PCB. So my question is - how must I orient this component (horizontal/vertical/doesn't matter), and how an I find a CAD design to add this to Eagle? |
Hi I am Ashraf from Eygpt I have schengen visa type c multiple entry from Switzerland for 5 years I already used it 2 time for going to Switzerland but now I need to go for Germany to Hanover and its long traveling from Swiss so my question is that if I can go directly to German or I need to go throw Swiss? | In case, if I get a multiple-entry Schengen visa in one of the embassies in Ukraine, Kyiv - should my first trip be to the country which issued the visa? Any there any requirements of this sort? Does this condition vary depending on embassy which issued the visa? What are the possible consequences on not visiting that country first? Does it somehow depend on country where the embassy is (i.e. non-Schengen and not EU members)? |
I am trying to install debconf since it seems to be broken on my computer. I ran the command: apt-get -f install debconf I got the following error message: dpkg: error: unable to create new file '/var/lib/dpkg/info/format-new': No such file or directory E: Sub-process /usr/bin/dpkg returned an error code (2) I don't understand this error message and I don't know what to do. Thank you for your help. | When I try to sudo apt-get upgrade I get: Preconfiguring packages ... dpkg: error: unable to create new file '/var/lib/dpkg/info/format-new': No such file or directory E: Sub-process /usr/bin/dpkg returned an error code (2) What should I do to fix it? |
Find all integer pairs $(x,y)$ that satisfy the following equation: $$ 21x+47y=1. $$ I know the solution with modular arithmetic: \begin{align} 0x + 5y &= 1 \pmod{21} \\ 5y &= -20 \pmod{21}\\ y = -4 \pmod{21} &\Longleftrightarrow y = -4 + 21c \\ 21x + 47(-4 + 21c) &= 1\\ 21x &= 189 - 21 * 47c \\ x &= 9 - 47c. \\ \end{align} Therefore $$(x, y) = (9 - 47c, -4 + 21c)$$ Is there a way to do this without modular arithmetic? Thanks in advance! | Can you help me to prove? Should I prove it by contradiction and suppose that $x$, y are solutions ? |
Is it possible to remove a known password from an excel sheet if excel isn't installed on the machine? We receive uploaded excel files (2007 and 2010 format) and we know the password for those excel files. Is it possible to remove the KNOWN password on the webserver without having to install Excel there? | I am going to get batches of 200+ Excel files with a blank password, one just needs to press enter when asked for the password. The system I am loading these files into cannot handle password protected Excel sheets. Is there a command line or other solution where I can just open those Excel sheets with the known blank password and then re-save them without a password? This password is to open the file. UPDATE: I followed the recommendation in and used DocRecrypt. I am no longer prompted for a password for these files when opening them. Awesome. |
I have a that I want to convert from flat bars to drops. Can anyone suggest brake levers that: will be compatible with the BR-M355 calipers that came with the bike will be compatible with the hoses fitted to the bike are of standard brake hood construction and can be used as a comfortable hand position on drops (i.e. I'm not looking to somehow bodge installation of MTB levers) are easily available in the UK are not crazy expensive (< £200) don't involve/require a cable to hydraulic conversion mechanism Ideally, I'd prefer the levers don't include an derailleur gear shift mechanism, because the bike has an Alfine hub, for which I'll make separate provision for shifting. However, provided any derailleur shift system can be left disconnected without impacting comfort and braking performance, I could live with it. If I absolutely have to, I could replace the levers, hoses, calipers and disks, but I'd rather not spend the money replacing the whole brake system if I can get away with only replacing the levers. I understand the geometry of drops on this bike might not be ideal, and some may feel I would be better off simply replacing this bike with a road bike. That's not an option for me, and neither is owning a second bike. Thanks! | I have a gravel bike with an MTB setup. SRAM GX rear mech, SRAM XO shifter, 1x11 system, Shimano disc brakes. How would I go about replacing my flat handlebars with road bars? Alternative 1 Get a hold of a Shimano 11-speed shifter, a brake lever and a Jtek Shiftmate to convert from Shimano ratio to SRAM. Alternative 2 Get a hold of SRAM 11-speed road shifter and brake lever. Also need new hydraulic brakes which are not compatible. Alternative 3 Get new mechanical disc brakes. Get SRAM shifters with mechanical levers. So what is the best alternative? Or do I have more options? And can I use SRAM GX rear mech with SRAM Apex or Rival shifters without a ratio adapter like Jtek Shiftmate? Much appreciated. Cheers! |
While digging in a C++ project, I encountered a strange usage of C++'s new operator: int arr[5]; ClassA* a = new(arr) ClassA(); Would you please help me understand this syntax? | Has anyone here ever used C++'s "placement new"? If so, what for? It looks to me like it would only be useful on memory-mapped hardware. |
While I don't doubt that this question is covered somewhere else I can't seem to find it, or anything close enough to which I can springboard. I however am trying to prove $$\frac{1}{1^2} +\frac{1}{2^2} + \cdots + \frac{1}{n^2} + \cdots = \sum_{n=1}^\infty \frac{1}{n^2} < 2$$ by induction. I have seen it many times and proved it before but can't remember what it was I did. I see that for the first two terms $n = 1, n=2$ I get: for $n = 1$, $\frac{1}{1^2} = 1 < 2$ for $n = 2$, $\frac{1}{1^2} + \frac{1}{2^2} = \frac{5}{4} < 2$ Now I am stumped, I know I want to show this works for the $n+1$ term and am thinking, let the series $\sum_{n=1}^\infty \frac{1}{n^2} = A(n)$ Then look to show the series holds for $A(n+1)$ But $A(n+1) = A(n) + \frac{1}{(n+1)^2}$ But now what? If I tried $A(n+1) - A(n) = \frac{1}{(n+1)^2}$ , but would have to show that this is less than $2 - A(n)$. I am stuck. Thanks for your thoughts, Brian | I need to prove that the sequence $a_n=1+\frac{1}{2^2}+\frac{1}{3^2}+\cdots+\frac{1}{n^2}$ converges. I do not have to find the limit. I have tried to prove it by proving that the sequence is monotone and bounded, but I am having some trouble: Monotonic: The sequence seems to be monotone and increasing. This can be proved by induction: Claim that $a_n\leq a_{n+1}$ $$a_1=1\leq 1+\frac{1}{2^2}=a_2$$ Need to show that $a_{n+1}\leq a_{n+2}$ $$a_{n+1}=1+\frac{1}{2^2}+\frac{1}{3^2}+\cdots+\frac{1}{n^2}+\frac{1}{(n+1)^2}\leq 1+\frac{1}{2^2}+\frac{1}{3^2}+\cdots+\frac{1}{n^2}+\frac{1}{(n+1)^2}+\frac{1}{(n+2)^2}=a_{n+2}$$ Thus the sequence is monotone and increasing. Boundedness: Since the sequence is increasing it is bounded below by $a_1=1$. Upper bound is where I am having trouble. All the examples I have dealt with in class have to do with decreasing functions, but I don't know what my thinking process should be to find an upper bound. Can anyone enlighten me as to how I should approach this, and can anyone confirm my work thus far? Also, although I prove this using monotonicity and boundedness, could I have approached this by showing the sequence was a Cauchy sequence? Thanks so much in advance! |
i am dividing the number & want output only with one decimal like 4.1 or 4.2 "SELECT count(*)/6 as s from t1 "; <td class = "inp"><% out.print(rs.getDouble("s")); %></td> Please help, I am new to jsp | What I would like is a method to convert a double to a string which rounds using the half-up method - i.e. if the decimal to be rounded is 5, it always rounds up to the next number. This is the standard method of rounding most people expect in most situations. I also would like only significant digits to be displayed - i.e. there should not be any trailing zeroes. I know one method of doing this is to use the String.format method: String.format("%.5g%n", 0.912385); returns: 0.91239 which is great, however it always displays numbers with 5 decimal places even if they are not significant: String.format("%.5g%n", 0.912300); returns: 0.91230 Another method is to use the DecimalFormatter: DecimalFormat df = new DecimalFormat("#.#####"); df.format(0.912385); returns: 0.91238 However as you can see this uses half-even rounding. That is it will round down if the previous digit is even. What I'd like is this: 0.912385 -> 0.91239 0.912300 -> 0.9123 What is the best way to achieve this in Java? |
Find an example of a unital commutative ring $R$ and an $R$-module $M$ such that $\text{Ass}(M)=\emptyset$. Recall that $\text{Ass}(M)=\{p\in\text{spec}(R):\exists 0\ne m\in M:\text{ann}(m)=p\}$. $\text{ann}(m)=\{r\in R:rm=0\},\forall m\in M$. I thought of $R=\mathbb Z$ and $M=\mathbb Z/n\mathbb Z$, which doesn't work. | I'm currently reading up on Associated Primes and localization. I came across the following theorem. Let $M$ be an $R$ module. If $M = 0$ then $Ass(M)$ is empty. The converse is true if $R$ is a Noetherian ring. I understood the proof of this result. Now I'm trying to come up with an example of $M$ being a non-zero $R$ module with $R$ NOT Noetherian but $Ass(M)$ is empty. Is there an easy example to show that the converse fails to hold when $R$ is not Noetherian? Thank you so much for any assistance! :) |
I have to detect outliers on 3 variables. On the internet I found the mahalanobis distance but I understood I can use it only on multivariate normally distributed data, and my data isn't. So, do you have any suggestions? And, for you is a correct way detect univariate outliers first, then bivariate and then trivariate outliers? Thanks in advance for any suggestions :) | Robust PCA (as developed by or better yet ) is , but Mahalanobis distance can also be used for outlier detection given a . I'm curious about the (dis)advantages of using one method over the other. My intuition tells me that the greatest distinction between the two is the following: When the data set is "small" (in a statistical sense), robust PCA will give a lower-rank covariance while robust covariance matrix estimation will instead give a full-rank covariance due to the Ledoit-Wolf regularization. How does this in turn affect outlier detection? |
This question has already been asked but the solution was not satisfactory Suppose $f$ is a function satisfying the equation $$f(x+y)=f(x)+f(y)+x^2y+xy^2$$ for all real numbers $x$ and $y$ Suppose also that $\lim \limits_{x \to 0}\frac{f(x)}{x}=1$ Find $f'(x)$ By using the definition of derivative,I obtained $f(0)=0$ and $f'(0)=1$ How will I get $f'(x)$? | How can I find $f(0)$, $f'(0)$, and $f'(x)$ given that $f(x+y)=f(x)+f(y)+x^2y+xy^2$ and $\lim_{x\to0}\frac{f(x)}{x}=1$. |
I'm thinking of installing kernel 5.8 on my 20.04 build. Currently I'm running kernel 5.4. Does Canonical's Livepatch service support hwe kernel 5.8 on 20.04 LTS? | Since live patching has been released only LTS kernels were supported with a note that live patching for HWE is in the works and likely to be available in 2017. I thought there would be an announcement when HWE support is ready but I must have missed it. I'm certain that there was no support for the 17.04 based HWE kernel, but I had to use mainline kernels for a while on this machine in the past months. I just installed 4.13.0-16.19~16.04.3-generic through linux-image-generic-hwe-16.04-edge but I'm not exactly sure if this kernel is supported by canonical-livepatch: $ canonical-livepatch status client-version: "7.23" architecture: x86_64 cpu-model: Intel(R) Core(TM) i7-7700 CPU @ 3.60GHz last-check: 2017-11-08T21:16:29.971688844+01:00 boot-time: 2017-11-08T19:16:12+01:00 uptime: 2h54m26s status: - kernel: 4.13.0-16.19~16.04.3-generic running: true livepatch: checkState: checked patchState: nothing-to-apply version: "" fixes: "" How do I know if a kernel is supported? Is there a support or wiki page where I can look this up? Or did someone find a URL in their networking logs showing some kind of hierarchy where these updates are fetched from? |
We know that inverse limit is a "left" exact functor on the category of modules in the sense that whenever $r:(A_i,α_j^i )→(B_i,β_j^i )$ and $s:(B_i,β_j^i )→(C_i,γ_j^i )$ are transformations of inverse systems over an index set $I$ between modules, and $0→A_i→B_i →C_i→0$ is exact for each $i∈I$, where the first function is $r_i$ and the second is $s_i$, then there is an induced (left) exact sequence $0→\varprojlim A_i→\varprojlim B_i→\varprojlim C_i$ . I search for a counterexample to the latter to be not "right" exact. Thanks very much in advance! | Let $A_n, B_n, C_n$ be directed systems in some abelian category. Denote by $A \times_C B$ the fibre product of $A$ and $B$ over $C$. Is it true that $(\varprojlim A_n) \times_{\varprojlim C_n} (\varprojlim B_n) = \varprojlim (A_n \times_{C_n} B_n)$, if $\varprojlim (A_n \rightarrow C_n)= (A \rightarrow C)$ and similarly for $B$? I know that "morally" limits preserve limits, but I don't know the exact statement I need here (i.e. limits in which categories?) Edit: Analogously, what can we say after replacing filtered limits with filtered colimits? Edit2: I think in the case of filtered colimits, I just checked the universal property of a colimit. In case I didn't make a mistake, the statement holds. The other case (filtered limits), and arbitrary colimits/limits are not as important for my purposes, but if you have a nice statement, please feel free to post it. |
I am trying to validate date in js ("yyyy/mm/dd") format. After googling I found other date format checked but I can't get in this format. Any one plz can help me out. Here is my code. function dateChecker() { var date1, string, re; re = new RegExp("\d{4}/\d{1,2}/\{1,2}"); date1 = document.getElementById("visitDate").value; if(date1.length == 0) { document.getElementById("showError").innerHTML = "Plz Insert Date"; document.getElementById("showError").style.color = "red"; } else if(date1.match(re)) { document.getElementById("showError").innerHTML = "Ok"; document.getElementById("showError").style.color = "red"; } else { document.getElementById("showError").innerHTML = "It is not a date"; document.getElementById("showError").style.color = "red"; } } | I saw a potential answer here but that was for YYYY-MM-DD: I modified the code code above for MM-DD-YYYY like so but I still can't get it to work: String.prototype.isValidDate = function() { var IsoDateRe = new RegExp("^([0-9]{2})-([0-9]{2})-([0-9]{4})$"); var matches = IsoDateRe.exec(this); if (!matches) return false; var composedDate = new Date(matches[3], (matches[1] - 1), matches[2]); return ((composedDate.getMonth() == (matches[1] - 1)) && (composedDate.getDate() == matches[2]) && (composedDate.getFullYear() == matches[3])); } How can I get the above code to work for MM-DD-YYYY and better yet MM/DD/YYYY? Thanks. |
This is what I remember from the blurb on the back- two teens come back from a vacation or outing and find at first nobody in their hometown, evenutally they 'find the whole world empty' (I think that's how it's phrased). The only other live people they come across are a group of other teens; the only thing all of them have in common is they once knew a girl who wrote dark poetry and eventually committed suicide- the end of the blurb suggests there might have been something supernatural about this girl, questioning whether she was even human. | I have vague memories of reading this in the 90s. It was a paperback, possibly an R.L. Stine book (it seems like the right sort of plot and I have this vague memory of it being similar cover art). The main character is a girl who's pregnant. She and her boyfriend go to an abortion clinic (a legal one, not back-alley). That's where things get a little jumbled in my head. I remember the girl bleeding out on the operation chair due to a botched procedure. I also remember her and her boyfriend being stalked by a girl of the same age including a part where the protagonist gets stabbed through the stomach with a pitchfork. I want to say that the sequence of events was that they got stalked by the girl, she got stabbed, and the scene then cut to her bleeding out on the chair with the implication being that it was either just a dying dream, or that the girl who killed her was the unborn baby trying to get revenge. The reason I see it as either sci-fi or fantasy was that the scene played out like a nightmare where no matter where they turned, their pursuer was behind them with the scenery changing malevolently against them. I want to say that they died a few times during the story, each time with them waking up from a seeming nightmare only to get killed again in a different way. |
iam making easy battleship game. but there is something that doesnt make sense for me. when there is strictly append in the first loop it has different output than if i wrote the same thing with variable.. import random BOARD = [] for i in range(5): BOARD.append(["O"]*5) x = random.randint(1,5) y = random.randint(1,5) while True: for i in BOARD: print(" ".join(i)) row = int(input(": ")) column = int(input(": ")) if x == row and y == column: print("you win") else: BOARD[x - 1][y - 1] = "X" in case of miss there is output like this O O O O O O X O O O O O O O O O O O O O O O O O O but if i wrote this code.. which is similar to previous.. only difference is a variable in the first loop... it has totaly different output.. import random BOARD = [] Q = ["O"]*5 for i in range(5): BOARD.append(Q) x = random.randint(1,5) y = random.randint(1,5) while True: for i in BOARD: print(" ".join(i)) row = int(input(": ")) column = int(input(": ")) if x == row and y == column: print("you win") else: BOARD[x - 1][y - 1] = "X" but there is output like this.. it doesnt make sense for me O x O O O O X O O O O x O O O O x O O O O x O O O is there on this site anyone who can explain this ??? nobody can help | I needed to create a list of lists in Python, so I typed the following: my_list = [[1] * 4] * 3 The list looked like this: [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]] Then I changed one of the innermost values: my_list[0][0] = 5 Now my list looks like this: [[5, 1, 1, 1], [5, 1, 1, 1], [5, 1, 1, 1]] which is not what I wanted or expected. Can someone please explain what's going on, and how to get around it? |
In my opinion, auto-conversion to community wiki status has a nasty habit of ruining great posts on Stack Overflow. You pose an interesting question, and people post a bunch of copycat answers hoping to catch a ride on the reputation train. You work to maintain an answer over time, and you're punished by having it expropriated by "community wiki." As I understand it (and I may very well misunderstand it, since the whole feature has never made sense), community wiki is to encourage more collaboration on posts by lowering the reputation threshold for editing. However, the suggested edits feature provides a better mechanism for allowing low reputation users to contribute to existing posts. I think community wiki is obsolete. Could we have some data on how many edits on community wiki posts were made by users under the normal reputation requirement? How do those compare to the number of suggested edits? There are still plenty of problems with auto-conversion to community wiki. I'd like to see it go away. | The FAQ says that Community Wiki works: by transferring ownership of the post from the original author to the community. They make the post easier to edit and maintain by a wider group of users, but they do not contribute to any user's reputation. But using the new edit suggestion system, everyone can edit. It's no longer true that community wiki makes a post easier to edit. Does community wiki still serve a function? What are good examples of community wiki mode doing what it's supposed to do? |
Can any one help me with the code for adding some number of days to any date..? For example today is 11-04-2014. I want 15-04-2014 + 3 days output:18-04-2014. My question is not adding dates to current date.. | I'm working with a date in this format: yyyy-mm-dd. How can I increment this date by one day? |
I have an issue with UTF-8 symbols, such as ☃ - this is being displayed as ˜Ƒ on the site. The database, table and column charset is UTF8 and utf8_unicode_ci collation. I have a header Content-Type => text/html; charset=utf-8 and a meta tag <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> php.ini has a default encoding of utf-8 I have the following lines in my my.cnf file [mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock user=mysql # Disabling symbolic-links is recommended to prevent assorted security risks symbolic-links=0 default-character-set=utf8 default-collation=utf8_general_ci character-set-server=utf8 collation-server=utf8_general_ci init-connect='SET NAMES utf8' [client] default-character-set=utf8 [mysqld_safe] log-error=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid All files are with a UTF-8 encoding. When I output the same data in the Mysql Cli everything's OK, but when its displayed on the page, symbols are messed up. I'm out of options here, please help :( | I'm setting up a new server and want to support UTF-8 fully in my web application. I have tried this in the past on existing servers and always seem to end up having to fall back to ISO-8859-1. Where exactly do I need to set the encoding/charsets? I'm aware that I need to configure Apache, MySQL, and PHP to do this — is there some standard checklist I can follow, or perhaps troubleshoot where the mismatches occur? This is for a new Linux server, running MySQL 5, PHP, 5 and Apache 2. |
I am getting  characters in my HTML page where a space should be even though I have included: <meta charset="UTF-8"> in my <head> tag; which seems to be the common solution to this issue. I have googled around a lot and have been unable to reach any solution. I have seen a few people run into this issue due to their IDE or editor saving their project with the wrong encoding. I use IntelliJ on this project but I have been unable to find a reason to believe that the IDE is causing my issue. Has anyone seen or resolved this issue before? | I'm setting up a new server and want to support UTF-8 fully in my web application. I have tried this in the past on existing servers and always seem to end up having to fall back to ISO-8859-1. Where exactly do I need to set the encoding/charsets? I'm aware that I need to configure Apache, MySQL, and PHP to do this — is there some standard checklist I can follow, or perhaps troubleshoot where the mismatches occur? This is for a new Linux server, running MySQL 5, PHP, 5 and Apache 2. |
I've seen some previous posts on return 1 and return 0, and here is what I understand: For the user (someone who won't look at the source code) of the program, there is no distinction between return 1 and return 0. For the programmer, return 1 implies error, and return 0 implies normal execution. Am I understanding this correctly? Hi, sorry, I didn't think this mattered, but I am talking about in the context of main(). | What is the correct (most efficient) way to define the main() function in C and C++ — int main() or void main() — and why? And how about the arguments? If int main() then return 1 or return 0? There are numerous duplicates of this question, including: — For C++, with a very good answer indeed. Related: |
I had created an abbreviation (abv) shortcut using the newcommand. However the command did not render as expected. Specifically, there is a gap between the abv and punctuation marks (See line 1 of the attached Figure). To address this, I manually add spacing between the last two curly bracket. While this did solved the aforementioned problem, but it removed spacing between the abv and text, especially in the middle of sentence (See line 2 of the attached Figure). May I know how to solve this issue. Thanks in advance Updated: Solved using \usepackage{xspace} \newcommand{\STTbSpace}{STT\textsubscript{b}\xspace} &&&&&&&&&&&&&&&&&&&&&&& \documentclass[a4paper,12pt]{report} \newcommand{\STTbSpace}{STT\textsubscript{b} } % Spacing between the last two curly bracket \newcommand{\STTbNoSpace}{STT\textsubscript{b}} % No spacing between the last two curly bracket \newcommand{\Fm}{F\textsubscript{1}-m } \begin{document} When the \STTbSpace in the mid of sentence versus at the end \STTbSpace. When the \STTbNoSpace in the mid of sentence versus at the end \STTbNoSpace. Similarly \Fm. \end{document} | I have a definition: \newcommand{\arnold}{Arnold Schwarzenegger} When I refer to it by: \arnold is a it is rendered as: Arnold Schwarzeneggeris a In order to have a space in front of "is" I would need to write \arnold\ is a Is there some other shorter way? |
I want to read a text file line by line. I found how to read line by line by searching but not how to call a specific line in a text file. Basically, i want to do something with particular lines( like the first line, the second line, the third line, etc): if particular_line is something: .... Also, how can i do something like this: if return_from_another_function in file: .... Basically, i want an example of how i could do that if it's possible. | Are there any alternatives to the code below: startFromLine = 141978 # or whatever line I need to jump to urlsfile = open(filename, "rb", 0) linesCounter = 1 for line in urlsfile: if linesCounter > startFromLine: DoSomethingWithThisLine(line) linesCounter += 1 If I'm processing a huge text file (~15MB) with lines of unknown but different length, and need to jump to a particular line which number I know in advance? I feel bad by processing them one by one when I know I could ignore at least first half of the file. Looking for more elegant solution if there is any. |
Recently, the number of visits per day on Beta sites dropped extremely down from thousands to units. Here are examples from and . Is it a bug? It seems like the values are missing the last three digits. | In the , can monitor some things like the total traffic on the site. However, it seems to be broken at the moment, all figures are almost zero. This is how it looks for Meta Stack Exchange (other sites show similar pictures): |
I have tried several solutions that I found on this forum, but I still haven't been able to install the 32-bit packages that I need for Android Studio. I get the following errors: The following packages have unmet dependencies: lib32bz2-1.0 : PreDepends: libc6-i386 (>= 2.9-18) but it is not going to be installed lib32ncurses5 : Depends: lib32tinfo5 (= 5.9+20140118-1ubuntu1) but it is not going to be installed Depends: libc6-i386 (>= 2.4) but it is not going to be installed lib32z1 : Depends: libc6-i386 (>= 2.4) but it is not going to be installed E: Unable to correct problems, you have held broken packages. I tried most of the suggestions described in here and several other places already - I am looking for answers that might not have been captured in that article. | After upgrading from 10.04 to 12.04 I am trying to install different packages. For instance ia32-libs and skype (4.0). When trying to install these, I am getting the 'Unable to correct problems, you have held broken packages' error message. Output of commands: sudo apt-get install -f Reading package lists... Done Building dependency tree Reading state information... Done 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. After running this: sudo dpkg --configure -a foo@foo:~$ sudo apt-get install -f Reading package lists... Done Building dependency tree Reading state information... Done 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. |
What if the dimensionality was something like 3.0001 or 2.999? Would we be able to tell the difference? I heard about fractional dimensionality in 3b1b and was wondering about its implications for physics | The following image serves to aid the reader in understanding the "privileged character" of $3+1$-spacetime. The wikipedia article on , and the "The priveleged character of $3+1$-dimensional spacetime" in particular, made me think a bit about the possibility that we might live in a non-integer amount of spatial and/or time dimensions. The notion of attaching a non-negative real number to a metric space has at least mathematically already been described by such concepts as "" and "". This may sound silly/ignorant/absurd to professional practicing theoretical physicists. To me (a layman), however, it doesn't sound much stranger than the idea of wrapping up six extra dimensions (which is, from what I understand, considered to be a serious possibility by those who study $10$-dimensional String Theory) into intricate shapes called "Calabi-Yau Manifolds". Has any research on $(a +b)$-dimensional spacetime (where $a,b \in \mathbb{R}_{\geq 0} $) ever been done? If so, what where the findings? If not, why not? |
Let $B$ be an $n \times n$ matrix. Does $B^3 = O_n$ imply $B = O_n$? If so, why? | This is a proof question and I am not sure how to prove it. It is obviously true if you start with $A = 0$ and square it. I was thinking: If $ A^2 = 0 $ then $ A A = 0 $ $ A A A^{-1} = 0 A^{-1}$ $I\,A = 0 $ but the zero matrix is not invertible and that it was not among the given conditions. Where's a good place to start? |
How is it better to say Sometimes it's hard to believe that you could ever achieve your goal... Or Sometimes it's hard to believe that you would ever achieve your goal... | could have vs would have I know could means indicating a possibility or ability, and would means the past of will or something about that is uncertain. Which of the following is correct? If you had told me, I would have used the other route. If you had told me, I could have used the other route. Both of the above sound correct and similar to me. Are these also possible? If you had told me, I would use the other route. If you tell me, I would use the other route. Please clear my confusion. |
Specification: Ram2B ,BIOS A06 | I'm thinking about installing Ubuntu Desktop, but I don't know what flavor is the best for my system. What are the minimum and recommended hardware requirements? What kind of CPU? How much memory? Should I have Hardware Acceleration? What flavor should I use? This is an attempt of a canonical answer. My answers have the "official requirements", the recommended are a mix of official sources and opinion based (along with the answer it's told the source). You can comment or edit if you feel that the information is obsolete or incomplete. It is a good rule of thumb that any system capable of running Windows Vista, 7, 8, x86 (Intel) OS X will almost always be a lot faster with any Ubuntu flavor even if they are lower-spec than described below. |
<div class="cast"> <p id="addnew"> <input type="text"><b id="add">ADD</b> </p> </div> $(document).ready(function(){ $("#add").click(function(){ $("#addnew").append("<p><input type=\"text\"><u id=\"del\">delete<u></p>"); }); $('#ab').click(function(){ alert(); }); }); I clicked #add. Append <p><input type=\"text\"><u id=\"del\">delete<u></p> later click #del. No function. I have two ajax functions. Call PHP include html code | 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. |
The book "The Dancing Wu Li Masters" page 189 talking about General Relativity says "A geodesic is not always a straight line". Is that true? What is a definition of "straight line" that makes sense in this context? The naive definition of "straight" is a three dimensional Euclidean sense. However, that is problematic. You'd need to project our four dimensional universe onto a "flat" three dimensional space. Presumable this would be done by choosing a pretty big inertial frame of reference and setting the Time axis to a constant. But choose a different frame, or different constant, and suddenly "straight" means something different. Perhaps it makes more sense to define "straight" by projecting our four dimensional universe onto a four dimensional Euclidean space. But I think this will not work. Consider how difficult it is to project a curved 2D space onto a flat 2D space, such as making a map of the Earth. Except in special cases, the "straight lines" on the map do not correspond to any useful concept of "straight" on the globe. So I think in 4D the result will be not any better. I am starting to think that the statement "A geodesic is not always a straight line" is simply nonsense, because there is no concept of "straight" except for the geodesic itself. Perhaps five dimensions? Is there a projection of our four dimensional universe onto a five dimensional Euclidean space that would give us a sensible definition of "straight"? Sorry if this is off-topic or too "philosophical". | With only a limited knowledge of , I usually explain space-time curvature (to myself and others) thus: "If you throw a ball, it will move along a parabola. Initially its vertical speed will be high, then it will slow down, and then speed up again as it approaches the ground. "In reality, the ball in moving in a straight line at constant velocity, but the space-time curvature created by the Earth's gravitation makes it appear as if the ball is moving in a curved line at varying velocity. Thus the curvature of space-time is very much visible." Is this an accurate description, or is it complete nonsense? |
It has been confusing me for a long time. Say, an Intel 4th Gen dual-core i5-4200U which clocks at 1.6 GHz and up to 2.6 GHz and an Intel 4th Gen dual-core i3-4160 which clocks at 3.6 GHz. As I see that they are both 4th Gen (Haswell), dual-core processors. Can I judge their processing speed based on the GHz given? I was told that i5 would be faster than i3, but it wasn't explained in detailed. Each of the core of i5 has a maximum of 1.3 GHz while each of the core of i3 has a speed of 1.8 GHz. If they can't represent the precise speed, what are they for? | 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. |
Let $X$ be a completely regular Hausdorff space. Such a space is also known as , or a $T_{3.5}$-space. Furthermore, let's assume that $X$ is not compact. Question. Does $X$ admit a continuous function $f: X\to \mathbb{R}$ with unbounded image? Context. It is known that if $X$ is a non-compact metric space, then $X$ admits an unbounded continuous real-valued function. This was discussed thoroughly in . Note that the same conclusion holds if $X$ is a non-compact normal space (also known as $T_4$-space). This is because the proof using Tietze extension theorem (see the answer in the linked MSE thread by the user Espace' etale) still works. This is the motivation for asking the current question. In general, Tietze extension theorem fails for $T_{3.5}$-spaces (for example, consider ), so one cannot apply the trick above; of course, it is possible that the question has a negative answer, in which case I'd love to see a counter-example. | It is well known that compactness implies pseudocompactness; this follows from . I know that the converse does not hold, but what is a counterexample? (A is a topological space $S = \langle X,{\mathfrak I}\rangle$ such that every continuous function $f:S\to\Bbb R$ has bounded range.) |
Hi I would like to write a python script so that if i run that script it should open couple of applications and run some commands in console.Can any one guide me through it. Like example scripts and location to place it etc . P.S: I use Ubuntu as 17 as my OS. Thankyou | How do you call an external command (as if I'd typed it at the Unix shell or Windows command prompt) from within a Python script? |
Show that the series $$\sum_\text{p prime}\frac{1}{p}$$ is divergent. I know that $\sum_{p=1}^\infty \frac{1}{p}$ is a p-series with $p=1$, it is a Harmonic series and is divergent, but in this case $p$ are only the prime numbers. Is it still valid? | Is this series known to converge, and if so, what does it converge to (if known)? Where $p_n$ is prime number $n$, and $p_1 = 2$, $$\sum\limits_{n=1}^\infty \frac{1}{p_n}$$ |
I'm trying to come up with an example of a curve that has constant curvature and torsion, both exactly 1. Let $\vec{r(t)}$ be a parametrization for the curve $\gamma$. By calculating with formulas for curvature $\kappa$ and torsion $\tau$ I got that the length of the second derivative $\dot{\vec{r}} $ must be the square of the length of the first derivative. Similarly, I got that the length of the third derivative must be a cube of the first derivative. But I couldn't get this any further. I'm guessing it could be something like a spiral... that would give us a constant curvature. And this spiral should bend... What would be such an example? (For definition of the curvature and torsion: ) | I need some help on the following problem: Given that a curve $\mathbf r:I\to \Bbb R ^3$ has constant curvature $k(s)=k$, for all $s$, and constant torsion $\tau(s)=\tau$, for all $s$. Find the curve $\mathbf r$. I only know that, according to the fundamental theorem, this curve exists and is unique. But, how practically find the parametric equation of the curve? Thanks. |
It was the first time we had been to Brasil or It was the first time we had been in Brasil. | In the following two examples, what is the difference between the usage of been to and been in? They seem like they have the same meaning but I’m not sure. -Have you ever been to Florida? -Yes, I’ve been to Florida many times. -Have you ever been in Florida? -Yes, I’ve been in Florida many times. |
I am drawing a figure which shows several tetrahedrons in Illustrator. I have drawn all the line segments and connected them at the endpoints. Now the figure has been like this. Now I want to fill the areas surrounded by the line segments. I did this as follows: first selected 3 line segments, join them and fill the color. However, I found another problem. Since there are dashed lines in this figure, if the 3 line segments contains one which is dashed, the join operation will cause all the lines dashed. That is what I don't want. So What is the correct operation if I want to meet my purpose? | In Illustrator, if you want to fill in areas surrounded by multiple line segments, you can first select all the line segments and use Live Paint Bucket (K) to fill the color. However, if you want to change the opacity of the area, you may find the borders also become transparent, like this: My question is, is there any way to avoid the border changing its transparency when we change the transparency of its internal area? Note: there are 3 line segments, with endpoints connected. An extended question, what if one of the line is dashed? This question originally comes from the fact that I want to fill the triangles as the bottom figure shows. |
My attempt: If we take $n$ to be finite, since $\mathbb Z/n\mathbb Z$ is cyclic, there is a distinct subgroup of order $d$ for each divisor $d$ of $n$. Any subgroup of a cyclic group is cyclic. Any subgroup of order $d$ is isomorphic to $\mathbb Z/d\mathbb Z$, as it is a cyclic group of order $d$. Cyclic groups are abelian, and $gh=hg$ leads to $gH = Hg$, so all subgroups are normal. Thus we can view $\mathbb Z/d\mathbb Z$ as the kernel of some homomorphism from $\mathbb Z/n\mathbb Z$ to a group $H$. By the first isomorphism theorem, we have $(\mathbb Z/n\mathbb Z)/(\mathbb Z/d\mathbb Z)$ is isomorphic to the image of that homomorphism. It is at this point I've become stuck, as I'm not sure what I can say about the image of this homomorphism. I feel like it should be $\mathbb Z/k\mathbb Z$, where $k$ is the integer such that $kd = n$, and this would prove the quotient group is cyclic, as it is isomorphic to a cyclic group. However, I am not sure if this is right or how to justify this? Any direction is greatly appreciated! | If $G$ is cyclic, then $G/H$ is cyclic? The proof I got goes like this: $G$ is cyclic, so $G=<g>$ for some $g\in G$. So any coset in $G/H$ would be of the form $Hg'=Hg^n$ for some $n$. So $Hg$ is an generator of $G/H$. Thus, $G/H$ is cyclic. I might just be confusing myself, but we have only shown that $Hg'$ is in form of $(Hg)^n$. But what if we are missing some $n\in\mathbb{N}$? That is, there is no quotient group of the form $Hg^2$, for example. To make myself a little bit clearer, I think what the above proof has done was showing that $\forall Hg'\in G/H, Hg'\in <Hg>$, thus $G/H \subset <Hg>$. I feel that this is not a complete proof. |
I was playing around with setuid perl for command execution (insecure). I learned from another question, that env - /usr/bin/perl -e 'system("...")' doesn't reset the EUID to RUID, like it's the case for modern implementations of /bin/sh. However, I cannot execute multiple commands, separated by && or ;, using the above command without perl resetting the EUID? kube@ctf4-deploy1-65d9686c54-7x2zh:~$ ls -la /usr/bin/perl -rwsr-xr-x 1 root root 3197768 Mar 31 2019 /usr/bin/perl kube@ctf4-deploy1-65d9686c54-7x2zh:~$ env - /usr/bin/perl -e 'system("id")' uid=1000(kube) gid=1000(kube) euid=0(root) groups=1000(kube) kube@ctf4-deploy1-65d9686c54-7x2zh:~$ env - /usr/bin/perl -e 'system("id && id")' uid=1000(kube) gid=1000(kube) groups=1000(kube) uid=1000(kube) gid=1000(kube) groups=1000(kube) | I'm hardening a Linux system and wanted to test (setuid-based) shell escapes using common binaries, like awk, vim, etc., supporting command executing. However, all binaries I've tested except sh and bash don't respect their setuid bit. In particular, awk continues to execute as a normal user: $ ls -lL /usr/bin/awk -rwsr-xr-x 1 root root 121976 Mar 23 2012 /usr/bin/awk $ id uid=1000(bob) gid=1000(bob) groups=1000(bob) $ awk 'BEGIN{system("id")}' uid=1000(bob) gid=1000(bob) groups=1000(bob) In contrast, bash executes as root when given the -p option: $ ls -la /bin/bash -rwsr-xr-x 1 root root 1168776 Apr 18 2019 /bin/bash $ /bin/bash -p # id uid=1000(bob) gid=1000(bob) euid=0(root) groups=1000(bob) Is there any way to make awk, vim, less, etc. respect the setuid bit and execute the command as root? OS: # cat /etc/os-release PRETTY_NAME="Debian GNU/Linux 10 (buster)" NAME="Debian GNU/Linux" VERSION_ID="10" VERSION="10 (buster)" VERSION_CODENAME=buster ID=debian HOME_URL="https://www.debian.org/" SUPPORT_URL="https://www.debian.org/support" BUG_REPORT_URL="https://bugs.debian.org/" Update: parallels@debian-gnu-linux-vm:~$ ls -la /proc/self/fd/0 /dev/fd/0 /dev/stdin lrwx------ 1 parallels parallels 64 Mar 26 08:15 /dev/fd/0 -> /dev/pts/1 lrwxrwxrwx 1 root root 15 Mar 20 19:56 /dev/stdin -> /proc/self/fd/0 lrwx------ 1 parallels parallels 64 Mar 26 08:15 /proc/self/fd/0 -> /dev/pts/1 |
Let $f(x)=x+\frac{x^2}{2}+\frac{x^3}{3}+\frac{x^4}{4}+\frac{x^5}{5}$, and $g(x)=f^{-1}(x)$. Compute $g^{(3)}(0)$ (the 3rd derivative of g). I have a solution but its not giving the correct answer. My question is not how to solve the problem but what I did wrong in my solution. First $g(0)=f^{-1}(0)=0$ $g^{'}(x)= (f^{'}(f^{-1}(x)))^{-1}$, so $g^{'}(0)=1$ $g^{(2)}(x)=-(f^{'}(f^{-1}(x)))^{-2} \cdot f^{(2)}(f^{-1}(x)) \cdot g^{'}(x)= -(g^{'}(x))^{-3} \cdot f^{(2)}(f^{-1}(x))$, so $g^{(2)}(0)=-1$ Finally $g^{(3)}(x)=3(g^{'}(x))^{-4} \cdot g^{(2)}(x) \cdot f^{(2)}(f^{-1}(x))+ f^{(3)}(f^{-1}(x)) \cdot g^{'}(x) \cdot -(g^{'}(x))^{-3}$, so $g^{(3)}(0)=-3-2=-5$. The correct answer is 1, however. I've checked my work so many times but still can't figure out what I did incorrect. | Is my way of solving and my answer correct? Let $f(x)=x+\frac{x^2}{2}+\frac{x^3}{3}+\frac{x^4}{4}+\frac{x^5}{5}$ And $g(x)=f^{-1}(x)$ Find $g'''(0)$ My attempt: We know that $g'(x)=\frac{1}{f'(g(x))}$ $f'(x)=1+x+x^2+x^3+x^4=\frac{x^5-1}{x-1}$ $f'(g(x))=\frac{(g(x))^5-1}{(g(x))-1}$ $\Rightarrow g'(x)=\frac{(g(x))-1}{(g(x))^5-1}$ $\Rightarrow g'(x)[(g(x))^5-1]=g(x)-1$ Similarly differentiating again, $\Rightarrow g'(x)[5(g(x))^4]+[(g(x))^5-1]g''(x)=g'(x)$ Similarly differentiating again, $\Rightarrow g'(x)[20(g(x))^3g'(x)]+[5(g(x))^4]g''(x)+[(g(x))^5-1]g'''(x)+g''(x)[5(g(x))^4]=g''(x)$ Putting $x=0$, $g(0)=f^{-1}(0)=0$ $g'(0)=\frac{1}{f'(g(0))}=\frac{1}{f'(0)}=1$ similarly,$g''(0)=-1$ $\Rightarrow g'''(0)=1$ |
How I can list all packages a apt repository serves? Specifically before adding the repository to my system would be preferred. | I want to list all the files from a source, say from the command line. What is the command for that? dpkg --list lists all files or just the filename. |
First I would just like to clarify I understand that the Riemann Zeta Function is only defined for $s>1$ and that we have to use other formulas that use analytic continuation to "define" the other values of $s$. What I don't understand however is why does the analytically continued function give us zero when $s$ is a negative even integer. I couldn't seem to find any proofs online and I would love to know the answer. | A question that has been puzzling me for quite some time now: Why is the value of the Riemann Zeta function equal to $0$ for every even negative number? I assume that even negative refers to the real part of the number, while its imaginary part is $0$. So consider $-2$ for example: $f(-2) = \sum_{n=1}^{\infty}\frac{1}{n^{-2}} = \frac{1}{1^{-2}}+\frac{1}{2^{-2}}+\frac{1}{3^{-2}}+\dots = 1^2+2^2+3^2+\dots = \infty$ What am I missing here? |
The title is horrible, sorry. I´m redding form a text file that has a bunch of dates in this format: 30/5/2015 and also can appear obviously with 2 numbers in the month: 21/12/2014 this is pure text, is not formatted as a date. What i have to do is to control that the month section does not exceds the number 12. This is because sometimes the date changes it´s format and appear like : 2/15/2015--- meaning that the second place turns to days and the first one to months This are the dates that i do not need. From the text i´m getting all this dates like this: fechas = list(set(re.findall(r'\b(\d+/\d+/\d{4})\b', data))) --- i use set() because sometimes the dates appear more than one time I tried something like this: for fecha in fechas: month = fecha[2:3] trying to slice the string, but this wouldn´t work because of the fact that if i do this i´m getting 1 number and sometimes i need 2 Does anyone have any idea on how o do this? Any help will be really appreciated | I've got a huge list of date-times like this as strings: Jun 1 2005 1:33PM Aug 28 1999 12:00AM I'm going to be shoving these back into proper datetime fields in a database so I need to magic them into real datetime objects. This is going through Django's ORM so I can't use SQL to do the conversion on insert. |
I have noticed that when I'm using the Stack Overflow mobile website, it is impossible to tap number of votes to get more details about it (upvotes & downvotes). I don't know if this feature is not implemented, or the size of votes count element is too small to be tapped. | It seems we can't view the number of up-votes and down-votes a question has from the mobile site. Can this be added or is there a reason it isn't available? |
I am not sure. I want to say 'Jane's and Sarah's etc' but the 'etc' being both's, is it written 'Jane and Sarah's etc.'? And is this always the case or are there exceptions? Thanks | Which option is grammatical? There will be readings from Nikki Giovanni’s and Alice Walker’s writings. There will be readings from Nikki Giovanni and Alice Walker's writings. Saying it out loud the latter sounds right, but looking at it the former looks better. |
After installing Steam in Ubuntu 15.04 x64 it won't start. After trying this command in terminal steam I get this output: Running Steam on ubuntu 15.04 64-bit STEAM_RUNTIME is enabled automatically Installing breakpad exception handler for appid(steam)/version(0_client) libGL error: unable to load driver: radeonsi_dri.so libGL error: driver pointer missing libGL error: failed to load driver: radeonsi libGL error: unable to load driver: swrast_dri.so libGL error: failed to load driver: swrast And also steam --reset command gave this output: mv: cannot stat ‘/home/[USER]/.steam/registry.vdf’: No such file or directory Installing bootstrap /home/[USER]/.local/share/Steam/bootstrap.tar.xz Reset complete! I tried this and nothing else. I have AMD graphic card with Xorg drivers. | Actually I have installed the new Ubuntu 15.04 64bit, and when I'm trying to install Steam on it, there is a problem. In fact I have downloaded the deb package from steam website, installed it and when I start it nothing happens. I tried to start it from terminal and what I've got $ steam Running Steam on ubuntu 15.04 64-bit STEAM_RUNTIME is enabled automatically Installing breakpad exception handler for appid(steam)/version(0_client) libGL error: unable to load driver: r600_dri.so libGL error: driver pointer missing libGL error: failed to load driver: r600 libGL error: unable to load driver: swrast_dri.so libGL error: failed to load driver: swrast |
I think I just observed a glitch which I'm unable to reproduce. I was watching and the answer was edited. When I clicked the notification to reload the answer, the migration notice disappeared. | I've come across a small issue which occurs when a question has been closed but the question itself or one of its answers are being edited. Steps to reproduce: Visit a closed question. (even closed years ago) In a different tab or browser, edit the question or one of its answers. "an edit has been made to this post; click to load" message will appear above the edited post in the first tab/browser, click it. The .question-status div becomes hidden, which includes the closed notice below a question and, for a duplicate-closed question, the list of duplicates above the question body. This gives the appearance that the question is no longer closed (until you refresh). Some screenshots: I know it isn't common/important but it did confuse me when looking at a particularly bad question - I thought it had been reopened. Is this an intentional feature? If so, what was the thinking behind it? Another example Before After |
As a newcomer to StackOverflow, I recently asked my first . I wanted to start with a fairly safe general question, to get the feel for how the site worked. My question was intended to be programming-related, but my original wording was not clear enough, so another user decided to close it. I've re-phrased my question, and had received one useful answer before the question was closed, but I'm not sure what the procedure is after your question is closed to allow people to post answers again... I've checked the FAQ and About pages, searched the SO questions, but have had no luck. Could someone point me in the right direction as to how I get my question re-opened, or if it is possible to do at all? | To reopen a closed question, must agree that the question is suitable for the site and cast votes to reopen the question. But: How does one actually vote to reopen? Is there a reputation level that you must have before you can see this function? Or do I just leave a comment along the lines of, "I vote to reopen"? What happens if someone with less than 3000 reputation leaves a comment that they wish to vote to reopen? How can one draw attention to their closed questions? Is it done via a posting new question? Or do you edit the closed question? Related: For more information, see "" in the . |
I understand the classic definition of a sentence is one that contains a predicate and a subject, but is it okay to have shorter sentences that don't follow this structure for effect? For example, if I was to write something like the following: Inside was something ancient. Something powerful. Something mysterious. Something that... I realize I could put the 'Something ancient' and 'Something mysterious' between commas, but would it be okay to use them as stated (between periods) for a kind of more dramatic effect even though they don't fit the classic definition of a full sentence? | One of the interesting aspects of the Maori language, as I understand it, is that it includes a class of sentences which not only have no verb, it is positively wrong to form them with a verb. Does standard English include any non-trivial sentences which have no verb, and are not simply ellipses of sentences which do include a verb? African-American Vernacular English includes sentences like, "Where you at?", that have no verb. The corresponding sentence, "Where are you at?", doesn't sound like African American Vernacular English. Adding the verb "are" seems to transform it into White American English. Phrases like, "Hey!" are interjections, and don't meet my threshold of being non-trivial. Answers like "Tomorrow." to "When will you file your story?" seem to be ellipses; in this case, of the verb-laden "I will file my story tomorrow." I found a related question here in in EL&U, . The title notwithstanding, the question actually seemed to be asking for an explanation why a certain phrase was in fact not grammatical. I realise that "standard English" is a bit of a contradiction. Sorry. I refer to any of the mainstream English language dialects, steering clear of pidgins and creoles, where no doubt lurk all manner of interesting grammatical structures. |
This is my . I feel my sub-question's answer is best fit for me. But this question did not include my title. I am not sure if I should accept this answer because both answer are suitable for acceptance. If I accept my title-related answer, I guess my sub question's answer is more important then my original question's answer. How can I do it? | For the apple.stackexchange question a 2nd answer was given, which relates to the question, but IMHO does not answer a majority portion of the question. Here some details: The question is about, how to set the PATH variable in a unified manner. The details how to change the file /etc/launch.conf. It is to note, that changing this file is needed for the overall answer. The author of the answer does make the valid point that, when he searched for, how to change /etc/launch.conf, the question came up. The does not detail the change of /etc/launch.conf enough. So, the general problem is: What to do when an additional answer explains only a small (but unique portion) of the question, while an earlier answer explains more (but not what the additional question explains). Finally, I think I should note that I am the initial asker and poster of the 1st answer. |
I'm having issues trying to extract values from object list, this is the flow: button gets clicked click calls a callout function get response from response.getBody() at this point, I have two options: Use JSON2Apex, that for some reason always return: "Apex Type unsupported in JSON: Object if (response.getStatusCode() == 200) { //Where, TicketJson is JSON2Apex class TicketJson ticketResponse = TicketJson.parse(response.getBody()); System.debug(ticketResponse); Use JSON.deserializeUntyped(), this my favorite approach, but when I manage to reach the Object List that I need, I'm unable to get it's Object values as MAP if (response.getStatusCode() == 200) { Map<String, Object> obj = (Map<String, Object>) JSON.deserializeUntyped(response.getBody()); Object ticketTypeData = obj.get('ticket_group'); Map<String, Object> TicketData = (Map<String, Object>)ticketTypeData; List<Object> Data = (List<Object>) TicketData.get('_data'); Any help is welcome. Best regards. JSON2Apex class public class TicketJson { public Integer x_total {get;set;} // in json: _total public Event_template event_template {get;set;} public Ticket_group ticket_group {get;set;} public Ticket_type ticket_type {get;set;} public class Ticket_group { public Integer x_count {get;set;} // in json: _count public List<Data_Z> x_data {get;set;} // in json: _data public Integer x_total {get;set;} // in json: _total public Ticket_group(JSONParser parser) { while (parser.nextToken() != System.JSONToken.END_OBJECT) { if (parser.getCurrentToken() == System.JSONToken.FIELD_NAME) { String text = parser.getText(); if (parser.nextToken() != System.JSONToken.VALUE_NULL) { if (text == '_count') { x_count = parser.getIntegerValue(); } else if (text == '_data') { x_data = arrayOfData_Z(parser); } else if (text == '_total') { x_total = parser.getIntegerValue(); } else { System.debug(LoggingLevel.WARN, 'Ticket_group consuming unrecognized property: '+text); consumeObject(parser); } } } } } } JSON Example { "ticket_group": { "_count": 21, "_data": [ { "_rank": 1, "additional_info_spec": null, "admission_end_offset": "2h", "admission_start_offset": "-10m", "capacity": -1, "description": "", "duration": null, "duration_new": null, "event_template_id": "4549294f-bc7a-1679-7797-90c5a9180c90", "exclude_from_event_capacity": false, "handler": "tickets", "hidden_type": "public_browsable", "id": "0e038e0e-24f2-5186-3c6c-adae2727d29d", "max_redemptions": 1, "max_tickets_per_order": 15, "member_role_id": null, "min_tickets_per_order": 1, "name": "Free Admission by PNC", "oversell_capacity": 0, "portal_id": "605f5cc3-3892-4c6f-bed0-4910cecd82b0", "sales_end_offset": null, "sales_start_offset": null, "sells_out_event": false, "start_policy": "immediate" }, } | This is a canonical question and answer developed by the community to help address common questions. If you've been directed here, or your question has been closed as a duplicate, please look through the resources here and use them to shape more specific questions. To browse all canonical questions and answers, navigate to the tag. This question and answer is owned by the community! If you can improve it and make it more useful, you're welcome to edit it. I have a specific JSON structure in mind. I need to either deserialize this structure that's coming in from a web service, or I need to serialize data into this structure to transmit it to another system. How should I get started on this project in Apex? |
function MyFunc() { var msg = 'hello'; this.speak = function() { console.log(msg); } } var obj = new MyFunc(); obj.speak(); The weird thing about the above code is that it works. Yet 'msg' is not part of the object. So how is 'msg' kept in memory. I would more understand if I did: this.msg = 'hello'; console.log(this.msg); because then it's a part of the instantiated object. but how are regular variables like 'var msg' getting saved with this object? edit: this question is not the same as closure because this is a specific use case. | How would you explain JavaScript closures to someone with a knowledge of the concepts they consist of (for example functions, variables and the like), but does not understand closures themselves? I have seen given on Wikipedia, but unfortunately it did not help. |
We know that it was he. Is this sentence correct? Or should I swap 'he' by 'him'? | When telling a story about myself from the past, I have found myself in an internal debate over whether the correct way to segue into the present is: That was me twelve years ago. Or: That was I twelve years ago. My instincts tell me the first is correct (object pronoun after a verb and it sounds better to my ears). But, I'm not sure if pronouns after linking verbs should be object pronouns. Which is correct? |
The question basically explains itself. I want to take an audio file (I can use any format really) and have Java output sound from it when called on. | I want to be able to play sound files in my program. Where should I look? |
I am looking for a simple screenshot annotation tool with the following features: Crop Resize Blur Draw shapes and lines Add text | I have noticed that many people use images in their Ask Ubuntu answers. What software are people using? |
I just changed my Minecraft gamertag and it was all ok, then when I try to join a server it says this "Failed to join server Error: Authentication to Minecraft.net Failed" | I don't understand this and I'm now worried as I have donated to a lot of servers and I don't want to lose this account. On the launcher it says my new username but when I log on it says "Account not Authenticated with minecraft.net" and "Non-Valid Username". How can I regain the ability to use my account online? |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.