body1
stringlengths 20
4.1k
| body2
stringlengths 23
4.09k
|
---|---|
So I am making a wheat beer and am adding lemons and oranges into the second stage of fermenting. I have heard through the beer vine that shandy's are lemonade and beer. Can I just add the lemonade or the soda pop before the bottling, and can it substitute the priming sugar? Also what would you recommend pop or lemonade? | So I was told I can add lemonade or orange juice to my wheat beer to make a summer shandy, can I just put fruit in the second fermentation stage instead? |
I'm relatively new to Linux (coming from Windows) and one thing that always bugs me is how restrictive the system is. For example I'm trying to install Sublime Text 2 into /opt/ right now, but when I open the tar archive and try to extract the folder, I get the following error: You don't have the right permissions to extract archives in the folder "file:///opt" In Windows or Mac I usually would have some sort of option "As Administrator..", which would elevate the privileges instantly (possibly prompting a password) and then perform the operation. With Linux I seem to be stuck to somehow figure out the Archive Manager's exact name and then run it with sudo from the terminal. In the menu there isn't even a right-click "Run as root.." option or anything similar. Isn't there an easier way of handling this in general? I'm running Xubuntu with XFCE but I had this problem with every desktop distribution I tried so far. | Say I have a folder open in Nautilus that's in my /home/user/temp directory. I'd like to move a folder from there to my /opt directory (it's a program). Is there a way I can elevate the copy command up to a sudo so that I can copy the folder without having to start a new instance of Nautilus from the command line? |
I've received an offer for admission next year. I would very much like to accept the offer, but I'm not sure the 50% TA position will be enough to cover the costs of commuting and an apartment near the university. During the interviews last weekend, one of my likely advisors stressed the point that when an offer was made (they didn't come out and tell me then, but were very clear that my chances were good) it would be negotiable, but he didn't elaborate and I didn't feel comfortable asking what he meant. How should I broach the subject of receiving more funding without coming across as ungrateful, and is there any way to know what kinds of additional aid the university might have available? | I have been fortunate enough to get accepted with 5 years guaranteed funding to my 2nd choice graduate school. While the guarantee is great, the funding is only for 9/months out of the year. Would it be rude to ask them to guarantee summer funding to me for the first year until I can write a grant to get on a RAship? I know I should be more appreciative, since not everyone gets funding, but just an increase of about ~3k a year would make living there so much better and I do not want to accept an offer at a lesser institution just because of money. What would be the most polite way of doing this? I want to make it clear that I am not trying to get more money for the sake of getting more money, moreover that I am just not comfortable with so little money and such a high living cost in that area. Thank you for your time. |
I'm looking to see what serial ports, USB and ethernet ports are available and what they are labeled as. | Is there any built-in software or terminal method allowing me to view the hardware profiles on my system? Windows equivalent of such a feature would be Device Manager. |
I have a input that only allows number. but if I do copy paste something else then number it will allow it. How can I make sure that he only allows number and nothing else (even after copy paste) <input type="text" name="people" onkeypress='return event.charCode >= 48 && event.charCode <= 57'/> | Is there a quick way to set an HTML text input (<input type=text />) to only allow numeric keystrokes (plus '.')? |
I'm just wondering if there is a configuration to automatically switch between perspectives when one gets out of focus. Example: I'm in the Scala Perspective and start debugging from there. Eclipse automatically switches to the Debugger Perspective as soon as I reach a breakpoint. But when my app terminates, Eclipse does not switch back to the Scala Perspective but stays in Debugger. I have to do it manually. I already know about the hotkey F8, but that still requires some interaction. | Eclipse by default automatically switches to the Debug perspective when you hit a breakpoint. However, it is annoying me that it doesn't automatically switch back to the previous perspective (say, Java) when terminating the process. It just stays in the debug perspective even though there is nothing to debug because nothing is running. |
A couple weeks ago I received that warning about the disk being likely to fail soon. I ran smartctl and got the following: As you can see, it claims that my drive has actually passed the test. Also the disk utility no longer claims that my disk is going to fail but it does show a serious amount of bad sectors. What I want to know is: Is my hard drive really going to fail soon? P/s: I'm running Ubuntu on my Mac because I kept having boot problems with the original OS. Also, recently I had some problems copying a file which prompt the following error: Error splicing file: Input/output error. I bring this up because some have mentioned it indicates problems with the drive. | I have a dual boot of Windows 10 and Ubuntu 16.04. Recently I upgraded it to 18.04. As soon as I did it, it started showing DISK IS LIKELY TO FAIL SOON (37° C / 99° F). I checked the status of my disk via Windows and it shows it’s perfectly healthy. I assumed the error occurred because my partition size of Ubuntu was 64GB (which I now increased to 86GB). Please help me out with this. Edit: The results of smartctl - attributes |
I have looked for an answer but can't seem to find what I'm looking for so thought I'd ask here. We have decided to get a connection from a local ISP offering an upload speed of 15Mbps to serve a site we've developed. We expect that the site will have a decent about of traffic after about 5 or 6 months. During the initial 6 months, I don't plan to have any more than maybe 100 to 200 people a day coming to the site. The site is all image based, so a single pageload may be around 3Mb each. I'm concerned that maybe 15Mbps may not be able to serve very many nodes simultaneously. Is there a formula to figure this out? Or maybe even a calculator that can address this question? | This is a about Related: I have a question regarding capacity planning. Can the Server Fault community please help with the following: What kind of server do I need to handle some number of users? How many users can a server with some specifications handle? Will some server configuration be fast enough for my use case? I'm building a social networking site: what kind of hardware do I need? How much bandwidth do I need for some project? How much bandwidth will some number of users use in some application? |
I have an outdated and unsupported version. I have been racking my brain trying to figure out how to download the latest version, I have run into one brick wall after another. Please help a non-tech savy ubuntu fan. | I would like to see a full how-to guide on how to install Ubuntu. |
I have read in multiple places that it is a good practice as an academic to keep a research journal. For example, Marie desJardins' paper says: Keeping a journal of your research activities and ideas is very useful. Write down speculations, interesting problems, possible solutions, random ideas, references to look up, notes on papers you've read, outlines of papers to write, and interesting quotes. Read back through it periodically. My first attempt was to write my ideas in a log book. I soon gave that up because the book would not always be with me when I wanted to write something in it, and because I knew eventually I would lose it and not be able to retrieve information from it. My current approach is to write a huge LaTeX file which I store in the cloud. In it, I chronicle my daily thoughts about my research project, to take notes of what is discussed in meetings with my adviser. However, I simply feel overwhelmed by the volume of writing and the amount of repetition that I find in my research journal. I also have other files which serve similar purposes. For example, I have a file called results.pdf where I write out all my theorems and propositions and their proofs. What have you tried and how has a research journal been of benefit to you? Do you do all your "rough work" in a research journal, so that you can refer to it later? What system do you use as your research journal? Do you log all your experimental results into a chronologically organized research notebook? (Since I am not from a biology/chemistry/experimental background, I am curious as to how people who do lots of experiments manage to organize their results and ideas.) | Question: Are there any guidelines, sources, or examples of good practices for maintaining theorist's research notebook? Motivation and context: Maintaining a is a much advised (if not a vital) tool for doing research. Many do that nowadays also in . While the methods for writing and maintaining a labbook might differ in details, in "dirty-hands" (no offense!) experimental, or field disciplines, the basics are relatively straightforward and clear. The advice tends to boil down to keep a labbook per single topic one works on and then record all the experiments and thoughts related to those experiments into the notebook. Simplifying a lot, in the end, the researcher (team) would compile a paper from the notes in the notebook. Now situation of a researcher in a more theoretical discipline is strikingly different. Usually one engages in research on several topics at the same time. The problems a researcher works on are often intertwined and one's view on them changes over time, often merging originally separate streams of thought into a single one, or vice-versa. The work revolves not around experiments which would have a clear objective, but rather around currently prepared papers and then "a cloud of ideas". In summary, theorist's workstyle tends to be very non-linear. Maintaining some kind of a notebook is still a good thing, if for nothing else, then for not forgetting about stuff. My question is about how to go about doing it. I am after a practical tool helping me to archive my thought process for long-term, as well as efficiently manage and keep an overview of the evolution of the several interacting topics I engage in. |
Given a smooth map $f:S^1\to S^1$, there is a smooth map $g:\Bbb R\to\Bbb R$ such that $f(\cos t,\sin t)=(\cos g(t),\sin g(t))$ and $g(2\pi)=g(0)+2\pi q$ for some $q\in\Bbb Z$. I'm fairly sure one can prove this without using algebraic topology/path lifting. The idea is that $g$ measures the "signed distance along $S^1$" that the image of $f$ travels (at least on $[0,2\pi]$). One then extends $g$ to $\Bbb R$ by setting $g(t+2\pi)=g(t)+2\pi q$. I don't know how to measure that in a smooth manner (I can't even get it to be continuous). Is there an elementary proof of this? | Let $f\colon S^1\to S^1$ be any smooth map. Prove that there exists a smooth map $g\colon\mathbb{R}\to\mathbb{R}$ such that $f(\cos(t),\sin(t))=(\cos(g(t)),\sin(g(t)))$ and satisfying $g(2π)=g(0)+2\pi q$. The book told me to show that $g(2\pi)=g(0)+2\pi q$, then extend $g(t+2\pi) =g(t)+2\pi q$. But I don't understand what they mean. How can I get function $g$ from $f(\cos(t),\sin(t))=(\cos(g(t)),\sin(g(t)))$, and what is $g$? |
How can I do this? I'm using a Samsung Galaxy Ace I've tried this method I confirmed that it was indeed set to 2. But it wouldnt work. Then I rooted my phone, installed an app with which I could modify the default installation path, but it also wouldnt work. What can I do? | I would like to know whether there is a way to tell Android to install applications on the micro SD card by default instead of having to download applications to internal memory first and then having to move them to the SD card manually. Thanks |
I am having an issue that I can't work out. Another set of eyes on it would be handy. I have already looked at this question and , I have checked to make sure I am doing as they say and I believe I am as the text input exists in the xml with the correct id, and I can see the declaration of the object, and there is no spelling mistake. I even get the smart popups giving me options when I place the . I have checked over my code and it seems right to me. I am creating the variable and passing it an element that exists on the view it is referencing. Below is my code. As you can see I am creating an edit text object that has the value of the text input element -- that line seems to run, then it errors on the next line saying that getText() cannot be called on a null object reference. I am entering text before pressing the click so it should not be null. The click is happening in a fragment; I don't see that being the issue but I could be wrong. @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment final View view = inflater.inflate(R.layout.fragment_ping, container, false); Button pingButton = (Button) view.findViewById(R.id.pingButton); pingButton.setOnClickListener(this); return view; } public void onClick(View v) { switch(v.getId()) { case R.id.pingButton: EditText text = (EditText) v.findViewById(R.id.editText); String value = text.getText().toString(); String s = ping(value); TextView result = (TextView) v.findViewById(R.id.textView); result.setText(s); break; } } I am at a bit of a loss with this now. I can't see why it is happening. What can I do to resolve this? Traceback: 01-05 12:35:49.323 10966-10966/uk.aperture.pinger E/AndroidRuntime: FATAL EXCEPTION: main 01-05 12:35:49.323 10966-10966/uk.aperture.pinger E/AndroidRuntime: Process: uk.aperture.pinger, PID: 10966 01-05 12:35:49.323 10966-10966/uk.aperture.pinger E/AndroidRuntime: java.lang.NullPointerException: Attempt to invoke virtual method 'android.text.Editable android.widget.EditText.getText()' on a null object reference 01-05 12:35:49.323 10966-10966/uk.aperture.pinger E/AndroidRuntime: at uk.aperture.pinger.Ping.onClick(Ping.java:112) 01-05 12:35:49.323 10966-10966/uk.aperture.pinger E/AndroidRuntime: at android.view.View.performClick(View.java:5198) 01-05 12:35:49.323 10966-10966/uk.aperture.pinger E/AndroidRuntime: at android.view.View$PerformClick.run(View.java:21147) 01-05 12:35:49.323 10966-10966/uk.aperture.pinger E/AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:739) 01-05 12:35:49.323 10966-10966/uk.aperture.pinger E/AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:95) 01-05 12:35:49.323 10966-10966/uk.aperture.pinger E/AndroidRuntime: at android.os.Looper.loop(Looper.java:148) 01-05 12:35:49.323 10966-10966/uk.aperture.pinger E/AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5417) 01-05 12:35:49.323 10966-10966/uk.aperture.pinger E/AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method) 01-05 12:35:49.323 10966-10966/uk.aperture.pinger E/AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 01-05 12:35:49.323 10966-10966/uk.aperture.pinger E/AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) EDIT: For some reason this question has been marked as duplicate -- which it is not -- and then IMHO erroneously closed. This question is perfectly valid; you can see that I have both an assignment and accessing of the assignment. I believe I am passing the whole view through as shown in the extended code I posted. | 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? |
Is it possible to obtain a list of the user-supplied functions (functions which are not Matlab toolbox functions) called by a Matlab script? | In order to distribute a function I've written that depends on other functions I've written that have their own dependencies and so on without distributing every m-file I have ever written, I need to figure out what the full list of dependencies is for a given m-file. Is there a built-in/freely downloadable way to do this? Specifically I am interested in solutions for MATLAB 7.4.0 (R2007a), but if there is a different way to do it in older versions, by all means please add them here. |
I i just bought a new dynabook with windows 10 installed on it. I achieved to install Ubuntu 19 alongside windows 10, but after it it's impossible to boot into ubuntu. I tried changing in the bios were ubuntu appears in the boot order, but it keeps booting into windows. I've also executed the bcdedit command in windows and still grub is not appearing. Any help would be appreciated, maybe it's already solved this problem, but i didn't find a solution yet :( Edit based on additional information provided as answer: I'm attaching here some screenshots asked above for further help. My computer is a Dynabook Tecra X40-F-140. I also notice that list partition is not detecting Ubuntu's partition. I created a 600 GB partition and a 1 GB swap space in the missing space (it is a 1TB HDD), the partitions created would be between partition 3 and partition 4. Boot options: Current HDD boot options: list partition output: Thanks in advance! | I installed Ubuntu on a Dell XPS 13 laptop that had Windows 10 preinstalled on it. I installed it from a USB flash drive on a partition. When I boot my computer I can only boot into Windows 10 and Ubuntu is nowhere to be seen. If I boot into my USB then I can see that Ubuntu is installed, but I can't get to it from the BIOS boot menu. |
In my HP Laptop, I use both password and fingerprint for login. Unfortunalely i did not use my laptop long while. now I forgot my password. still i can able to access my system using my fingureprint. The issue is some times the fingureprint not working properly. Now I forced to reset my password or recover my old password. Even I prefere to recover my old password. Any one help me here please? I use Windows7 64 bit. Thanks in Advance. | I got a brand new Windows 7 machine, installed the operating system, created one account and forgot its password. What can I do? There is no external CD, the operating system is loaded from somewhere inside the machine. I already tried to remember passwords and tried all candidates with all possible combinations of caps lock, num lock etc. |
I want to add more than 20 digits in an Excel cell. The current format of the cell is general, and it converts the number to an exponential format. I tried with a number format and accounting, but when I enter more than 15 digits, it gets converted to 0's. What are the steps for stopping Excel from converting data to exponential Format for 20 digits when in the general format? Example: 12345678901234567890 Excel converts it to 1.23457E+19 in general format. Excel converts it to 12345678901234500000 in number & accounting format. | I want to add more than 20 digits in an Excel cell. The current format of the cell is general, it converts the number to an exponential format. I tried with a number format and accounting, but when I enter more than 15 digits it gets converted to 0's. What are the recommended steps for stopping Excel from converting data to exponential Format for 20 digits when in the general format? Example: 12345678901234567890 Excel converts it to 1.23457E+19 in general format. Without using ' before the value, is there any other way to keep value same? |
I'm trying to make an armorstand have the same rotation as the player. I've done this with storing the data Rotation[0], but you should be able to do it with data merge right? I tried /data modify entity @e[tag=Armorstand,limit=1] {} merge from entity @p Rotation[0] but it doesn't work. Anyone know what I am doing wrong? I couldn't get any info on the minecraft wiki about sourcepaths. I'm assuming the sourcepath is different from the one you use when using data get since /data modify entity @e[tag=Armorstand,limit=1] {} merge from entity @p Rotation[0] works if I remove "Rotation[0]", but then the armorstand gets all the data from the player and I only want the rotation. Thanks for any help | Okay, so I've been searching all over the internet for an explanation of data modify ever since I heard Sethbling passively mention it in one of his videos. The only thing I could find on it was the wiki and the update log for the 1.14 snapshot. So, I checked these, and they hardly explained it at all. I can get /data modify block 123 20 123... and that's as far as I get. Minecraft wiki does not at all define clearly what is (the thing meant to go after coords), nor does it specify what each operation does to what. Operations include (without explanation, and excluding set (which it does explain)): append, insert, merge, and prepend. Then, it has from|value as the next option, which aren't explained either. After this, it just has block/entity and coords/id. So, I know the format (mostly), but I haven't the slightest idea what any of it means. And nothing I've seen on the internet even mentions the command save for Minecraft wiki itself. Please explain if you know what data modify is. Thanks! |
Imagination can't be counted. But I have seen some people using the indefinite article in front of imagination. For example, "Everyone has an imagination." What makes that correct, grammatically? | I'm getting confused about these two sentences: The government should provide education to its citizens. She has received a great education since high school. I think education is an uncountable noun. Why does the second sentence use the article a before education? It might be a stupid question, but I really want to understand this topic clearly. I looked on many websites but there was no related answer to this. |
The is often said to be about $60\,\mathrm{Hz}$ for humans, meaning that humans tend to perceive cycling events happening faster than 60-times-per-second as a blur rather than as a discrete set of motions. Obviously light bulbs tend to have a flicker rate faster than $60\,\mathrm{Hz}$ such that they don't look like strobe lights to humans, though I'm concerned about the comfort of other animals, e.g. falcons, who may have a faster flicker fusion threshold than humans. Question: For the layperson who knows nothing of this beyond the basic light spectrum, how would I find out the flicker rate of different kinds of light bulbs? | What waveform does the light coming off different types of artificial light sources have and (of course) what are the underlying physical reason for them? I was inspired to ask this question because of several things I have been hearing lately. Firstly, there was a recent TED talk about how . Researchers have been working on the problem for a little while now and they've made a fairly impressive product, but it was only recently made possible by the LED technology, which has such a fast response that it can easily compare to the transfer rates of electric information condiuits that we normally use. My understanding is that incandescent bulbs flicker because they have 60 Hz AC power being pulsed through them. In fact, I think 60 Hz was chosen in the first place because it was a threshold that was unnoticeable to humans. Looking at a demonstrates that it has a very significant lag time responding to both the normal electrical phasor and being turned off. In other words, it flickers but it doesn't go dark at any point in the AC waveform. Looking for more information, however, I was a little disappointed, since nothing seemed to give a graph of lumens emitted over time for all different kinds of bulbs. Of course, there isn't just one relevant time scale. A light could flicker with 60 Hz and also flicker with 2000 Hz (I just made that up). I'm interested in the complete picture of what lights exhibit what patterns. |
I am going to install Ubuntu on my laptop/desktop, but I am already using another OS on my computer. After that how can I remove Ubuntu permanently from my computer and still keep my old operating system and data? | I have absolutely no experience with Linux, and I desperately need to get my computer back up and running again with Windows. How do I remove Ubuntu and reinstall Windows? Editor's note: many of the answers are about removing Ubuntu from dual-boot but keeping Windows (which is a bit complicated), while other answers are about removing Ubuntu from single-boot (which is easy: basically just format the disk while installing Windows). The question as written is ambiguous between dual-boot or single-boot. |
I have a machine with two hard drives. One hard drive is dual-boot, and has both Ubuntu 14.04 and Windows 10 installed. The other hard drive is reserved for storage. Until recently, this storage hard drive was accessible from both the Windows and Ubuntu partitions. To do this in Ubuntu, I would open Nautilus and then on the left, there are three items under Devices, which are: 250 GB Volume, Storage, and Computer. Clicking on Storage used to give me access to this second hard drive. However, for some unknown reason, recently I have been receiving the following error message when I try to click on Storage: Unable to access “Storage” Error mounting /dev/sdb5 at /media/karnivaurus/Storage: Command-line `mount -t "ntfs" -o "uhelper=udisks2,nodev,nosuid,uid=1000,gid=1000,dmask=0077,fmask=0177" "/dev/sdb5" "/media/karnivaurus/Storage"' exited with non-zero exit status 14: The disk contains an unclean file system (0, 0). Metadata kept in Windows cache, refused to mount. Failed to mount '/dev/sdb5': Operation not permitted The NTFS partition is in an unsafe state. Please resume and shutdown Windows fully (no hibernation or fast restarting), or mount the volume read-only with the 'ro' mount option. Please could somebody explain this message to me? I have tried booting into Windows and shutting down fully as suggested, but this did not help. Thank you. | Whenever I boot Ubuntu, I get a message that it cannot mount my windows partition, and I can choose to either wait, skip or manually mount. When I try to enter my Windows partition through Nautilus I get a message saying that this partition is hibernated and that I need to enter the file system and properly close it, something I have done with no problem so I don't know why this happens. Here's my partition table, if any more data is needed please let me know. Device Boot Start End Blocks Id System /dev/sda1 2048 20000767 9999360 83 Linux /dev/sda2 20002814 478001151 228999169 5 Extended /dev/sda3 * 478001152 622532607 72265728 7 HPFS/NTFS/exFAT /dev/sda4 622532608 625141759 1304576 82 Linux swap / Solaris /dev/sda5 20002816 478001151 228999168 83 Linux |
I know that the speed of light, the universal constant of gravitation and the Planck's constant are considered to be the three fundamental constants of the universe. But, why is speed of light considered as a fundamental constant? The speed of light changes from medium to medium for satisfying Fermat's principle then, how can it be a constant? | Does it make sense to say, "The speed of light varies?" Some may say right off the bat "Yes, it changes as a wave passes through a different medium." However, I'd like to say no, because when I hear someone say the speed of light, I always think of the constant $c$ (unless the medium is specified to not be a vacuum, but then it isn't $c$ anymore), not the speed of a particular wave. To me, it makes more sense to say something like, "The speed of a particular wave varies." What is the correct way to state this in the professional world? And in general, when professional physicists say "the speed of light," are they referring to the constant or the actual speed of the wave? |
I create a chart with many (actually 10) lines in different colors (see example). I want to make it as easy as possible to differentiate the different lines. Some possibilities I have in mind: Take most different colors Avoid light colors (e.g. yellow - on prints the line are hard to see) Use patterns (dashed, dotted, different dash pattern) Use different thickness (I don't believe this is a good idea) Are there best practices, rules or guides for this task? My example code: \documentclass[border=5mm] {standalone} \usepackage{pgfplots, pgfplotstable} \begin{document} \pgfplotstableread[col sep=&, header=true]{ description&A&B&C&D&E&F&G&H&I&K 2009&46&0&33&3&0&74&3&7&2&7 2010&35&0&22&1&0&90&2&5&3&3 2011&38&0&33&3&1&77&1&9&2&8 2012&25&0&15&0&4&55&4&5&0&1 2013&18&0&8&0&0&46&5&4&0&3 2014&37&0&54&1&3&54&5&12&10&2 2015&29&0&63&8&1&77&0&8&7&5 }\datatableentry \begin{tikzpicture} \begin{axis}[ title={My Chart}, enlarge y limits ={value=0.2,upper}, xtick=data, xticklabels ={2009,2010,2011,2012,2013,2014,2015}, x tick label style={rotate=-45,anchor=west,font=\tiny}, legend style={font=\tiny,legend pos=north west,legend cell align=left}, ] \addlegendentry{A}; \addplot [color=blue] table [y=A, x expr=\coordindex] {\datatableentry}; \addlegendentry{B}; \addplot [color=cyan] table [y=B, x expr=\coordindex] {\datatableentry}; \addlegendentry{C}; \addplot [color=gray] table [y=C, x expr=\coordindex] {\datatableentry}; \addlegendentry{D}; \addplot [color=yellow] table [y=D, x expr=\coordindex] {\datatableentry}; \addlegendentry{E}; \addplot [color=green] table [y=E, x expr=\coordindex] {\datatableentry}; \addlegendentry{F}; \addplot [color=lime] table [y=F, x expr=\coordindex] {\datatableentry}; \addlegendentry{G}; \addplot [color=black,loosely dashed] table [y=G, x expr=\coordindex] {\datatableentry}; \addlegendentry{H}; \addplot [color=red,densely dashed] table [y=H, x expr=\coordindex] {\datatableentry}; \addlegendentry{I}; \addplot [color=blue,dotted] table [y=I, x expr=\coordindex] {\datatableentry}; \addlegendentry{K}; \addplot [color=cyan,dashed] table [y=K, x expr=\coordindex] {\datatableentry}; \end{axis} \end{tikzpicture} \end{document} Disclaimer: I'm not sure if this question belongs to . The main problem is a design question, but the solution is needed in Tikz. | Tufte advocates to "minimize the ink-to-data ratio" for charts. I am trying to style a multi data series bar chart, that can have a grid and axes as shown below (chart at the left is from the Economist and on the right my attempt). Here is the code: \documentclass[justified]{tufte-book} \usepackage{pgfplots,lipsum} \pgfplotsset{compat=newest} \begin{document} \section{Bar Charts} \lipsum[1-2]\vfill \begin{figure*}[htbp] \fbox{ \begin{tikzpicture} \centering \begin{axis}[ ybar, title={Cumulative Progress of Works}, height=8cm, width=15.5cm, bar width=0.4cm, ymajorgrids, tick align=inside, enlarge y limits={value=.2,auto}, % see the upper ymin=0, ymax=100, axis x line=bottom, axis y line=right, %enlarge x limits =e, legend style={at={(0.5,-0.2)}, anchor=north,legend columns=-1}, ylabel={Percentage (\%)}, symbolic x coords={ Sep-11,Oct-11,Nov-11,Dec-11, Jan-12,Feb-12, Mar-12, Apr-12}, xtick=data, nodes near coords, every node near coord/.append style={ anchor=mid west, rotate=70 } ] \addplot coordinates { (Sep-11,75.4064) (Oct-11, 72.7961) (Nov-11,94.4597) (Dec-11,66.6786) (Jan-12,67.5600) (Feb-12,88.2339) (Mar-12,78.6138) (Apr-12,58.9129) }; \addplot coordinates { (Sep-11,75.4064) (Oct-11, 89.7961) (Nov-11,94.4597) (Dec-11,76.6786) (Jan-12,77.5600) (Feb-12,78.2339) (Mar-12,88.6138) (Apr-12,78.9129) }; \addplot coordinates { (Sep-11,75.4064) (Oct-11, 89.7961) (Nov-11,94.4597) (Dec-11,76.6786) (Jan-12,77.5600) (Feb-12,78.2339) (Mar-12,88.6138) (Apr-12,78.9129) }; \legend{First Fix,Second Fix,Third Fix} \end{axis} \end{tikzpicture} } \caption{\protect\raggedright Cumulative progress for all MEP works. Notice the slower rate of production during the last three months.} \end{figure*} \lipsum[1-3] \end{document} I have moved the y-axis to the right, but cannot get rid of the axis line. The plot is also not fitting within the plot width, despite using \enlarge. Edit And thanks to Jake the ugly duckling has been transformed to the following, with minor variations to the code as suggested by Jake. I have only added a stronger color for one of the bars in order to highlight it: |
So I have a class A and there are multiple classes that extend from class A. I create an instance of this class, is there a way to get all the other classes that extend A? Something like: A a = new A(); a.getAllSubclasses(); Only way I tought of doing this is scanning the entire project for all the classes and storing them in a list and then checking manuall if each class extends from A with instanceOf. List<Class> classList; classList.each{ if(it instanceOf a) //do stuff } This seems bad especially for a huge project with hundred of classes. | How does one go about and try to find all subclasses of a given class (or all implementors of a given interface) in Java? As of now, I have a method to do this, but I find it quite inefficient (to say the least). The method is: Get a list of all class names that exist on the class path Load each class and test to see if it is a subclass or implementor of the desired class or interface In Eclipse, there is a nice feature called the Type Hierarchy that manages to show this quite efficiently. How does one go about and do it programmatically? |
Before I just wrote \usepackage{name} and the package with the according name downloaded successfully. Now that I need to download cyrtimes package, it fails. I use TexWorks editor running on Windows 7. Could you give me any hint please? | I'm new to LaTeX, investigating using it for some work projects. I'm using MiKTeX on Windows. My employer's locked-down network blocks the application's automatic installation function. I can take my laptop home and successfully install from there, but if I need a package in the middle of the day I'm stuck. I am able to access the CTAN website and download the package files (.dtx or .ins?), but I don't know what do do with them. How can I do a manual package installation? |
I want to loop throgh all the column of all the tables available in my database to check which column containts string "Kroki Homes". I have approx. 56 tables in my database. So it is hard to check in all the columns of these 56 tables. is there any easy way to achieve this in sql server? | Given a number, how do I discover in what table and column it could be found within? I don't care if it's fast, it just needs to work. |
FileProvider.getUriForFile is returning a nullobject reference and I have no idea why. This worked before. The following error is what I get. I also added my code below the error. Process: com.example.joche.mywarranty, PID: 2522 java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.XmlResourceParser android.content.pm.ProviderInfo.loadXmlMetaData(android.content.pm.PackageManager, java.lang.String)' on a null object reference at android.support.v4.content.FileProvider.parsePathStrategy(FileProvider.java:584) at android.support.v4.content.FileProvider.getPathStrategy(FileProvider.java:558) at android.support.v4.content.FileProvider.getUriForFile(FileProvider.java:400) at com.example.joche.mywarranty.InputScreen$2.onClick(InputScreen.java:74) at android.view.View.performClick(View.java:5610) at android.view.View$PerformClick.run(View.java:22265) at android.os.Handler.handleCallback(Handler.java:751) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6077) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756) Code: imageUri = FileProvider.getUriForFile(context, context.getApplicationContext().getPackageName() + ".my.package.inputName.provider", new File(fileinputName)); AndroidManifest.xml file: <provider android:name=".GenericFileProvider" android:authorities="${applicationId}.my.package.name.provider" android:exported="false" android:grantUriPermissions="true"> <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/provider_paths"/> </provider> And ofcours the xml file with the path: <?xml version="1.0" encoding="utf-8"?><paths xmlns:android="http://schemas.android.com/apk/res/android"> <external-path name="my_images" path="."/></paths> | 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? |
Let $x, y \in \mathrm{R^n}$. Show that det$(I - xy^T) = 1 - y^{T}x$. I test several cases for this problem, and it holds true when $n = 2, 3$, but when it comes to proof, I tried two ways and both failed: Write $x, y$ explicitly in the form of $a_{ij}, b_{ij}$, and tried to find the relationship between the left and right side. But the left side could not be reduced to a relatively clearer form and turns out to add more complexity. Try to transform $I - xy^T$ into something similar to the right side. I think the difficulty of this problem lies in the transformation from matrix $(I - xy^T)$ into scalar $1 - y^{T}x$, and I do not have a good way to make such transformation. This question could be answered with matrix determinant lemma (the proof could be found . Even though this is pretty easy to understand, it lacks the reasoning process, which I find very unsatisfying. | Let be $u,v\in\mathbb{R}^n$, then $\det(I+uv^\intercal)=1+v^\intercal u $ where $I$ denotes the identity matrix of order $n$. How to prove this? what I did: let be $A=\{n\in\mathbb{N}: \forall u,v \in \mathbb{R^n}, \det(I+uv^\intercal)\neq1+v^\intercal u \} $, and suppose $A\neq \varnothing $, then for the well-orderer-principle there exists $n_0\in A$ such $n_0\leq n,\;\forall n\in A$. since $1\notin A,\; n_0\neq 1 \rightarrow n_0-1\in\mathbb{N}\setminus A $ so: $$\forall u,v\in\mathbb{R^{n_0-1}}: \det(I+uv^\intercal)=1+v^\intercal u $$ Then, let be $u,v\in\mathbb{R}^{n_0}$, so $$\det(I+uv^\intercal)= \displaystyle\sum_{j=1}^{n_0}(-)^{1+j}a_{1j}\det(A_{1j})$$ where $a_{ij}=\begin{cases} u_iv_j+1 & i=j \\ u_iv_j & i\neq j \end{cases}$, and $A_{1j}$ is the submatrix of $I+uv^\intercal$ that results deleting the i-file and j-column. Then I try to open the term for $j=1$ and try to use the relation for the new matrix of $n_0-1$ order with the determinant because it holds the same form but I have other terms which difficult me the work. Do you know other method?. Ps. , in page 2 I've found something similar but I don't understand what it means PS. I'm taking a course of numerical analisys |
I'm working on a RHEL 6.7 machine. I'd like to make a script which is owned by root BUT could be launched by other users. However I still want the actions inside the script to be launched as root. So I want to set the suid bit on this script. Right now I have the following results: [root@devmachine BACKUP]# chmod a+s fix_properties.sh [root@devmachine BACKUP]# ls -halt fix_properties.sh -r-sr-s-r-x 1 root root 42 May 12 00:08 fix_properties.sh This is not good enough since a lambda user would be able to execute it but wouldn't benefit from the root permissions. After some digging I learned that it could be due to the way the FS is mounted. When I check the fstab file I see the following: /dev/mapper/systemvg-op /opt ext3 defaults,nosuid,nodev 1 2 ... /dev/systemvg/opt_backup /opt/BACKUP ext4 acl,user_xattr 1 2 Does this mean that the nosuid will be also de rigueur on the /opt/BACKUP partition? As a work-around, I guess I could assign this file to a particular group from which my target user is part of? | How to make a script execute as root, no matter who executes it? I read about setuid but I'm not sure how to do this. I'm using Linux, Ubuntu 12.04 LTS. |
What is a good adage for saying one thing matches another in quality? For example, I want to say someone rude deserves to be treated accordingly and just as rudely and without respect. | Is there an idiom for someone who gets what he deserved? Like someone receiving punishment for his evil deeds or someone getting awarded for his good deeds? |
In vector calculus I understand how div is kind of a measure of how much a point acts as a source or sink of the field lines or a measure of the flux through a closed shape at a point in a sense. The curl is a measure of how much rotation the surrounding vector field causes at a point (Please correct if this is wrong). Just wanted to know if there was also a geometric meaning for the triple product ∇ · (∇ × a). I cant seem to reason it out. | I am aware of an intuitive explanation for $\operatorname{curl} \operatorname{grad} F = 0$ (a block placed on a mountainous frictionless surface will slide to lower ground without spinning), and was wondering if there were a similar explanation for $\operatorname{div} \operatorname{curl} F = 0$. |
The word setup (as a noun), I feel, has become an acceptable part of the English language, at least insofar as technical manuals or computer textbooks are concerned. However I find that the word is used very often in verb form like so: "You can setup the program quite easily ..." when in fact my understanding is that the actual sentence should be: "You can set up the program quite easily ..." I would like to know if setup can be used as a verb. The situation seems be very similar to the word output (as a noun). Output is a purely technical word and its use is restricted solely to technical texts or at least in a technical context within non-technical books. However it is also used in verb form now like so: "The system will output the signal ..." I would be very grateful if this question is answered. Thank you | I know that words like login and payoff are properly nouns but I increasingly notice many (not at all uneducated) people use them as verbs: Will you payoff your credit card this month? and Please check this when you login. To me (a non-native English user), that seems incorrect because separating the core noun from a preposition is what I was taught: Please check this when you log in. (My emphasis) Is this use proper or not? |
The circuit was pulled from a SBC schematic. VBUS_5V is the input power from the micro USB port. Ultimately I am attempting to figure out if there is current limiting between VBUS_5V and VDD_5V. | The Raspberry Pi B+ models have a protection circuit between the USB connector and the 5V net on the board. They recommend putting a similar protection circuity on a Pi HAT before 'backpowering' the pi through its GPIO header along with a polyfuse. I understand why this is the recommendation, but I'd like to understand more about how this circuit works. I did some searching before posting this question and found information on using a MOSFET as a low voltage drop diode, but they all had the gate wired directly to ground without the pair of PNP's and the resistors. What are they doing for this circuit? Also, is this primarily using the body diode? In which case, what's the relevant info on the datasheet that qualifies DMG2305UX for this application? In the other circuits I found, it appeared low Rdson and Vgsth compatible with the circuit seemed like the relevant characteristics. |
When Arya Stark first meets Jaqen H'ghar, he is in a cell described as a dangerous criminal whom Yoren takes from the capital's dungeons and is recruited into the Night's Watch. Seeing how this character plays a major role in Arya's journey in Season 5, was him being captured in Kings Landing unrelated, or is he there to specifically guide Arya onto a path that is certain to bring her to the Faceless Men for training? After seeing the events in the Season 5 finale, it just seems like a very convenient coincidence for them to meet in such a way. | Following a recent 9gag post: Did Jaqen H'ghar end up in that cage because he knew that he would meet and "recruit" Arya, or was it some strange coincidence? Is it described somewhere in the books, or left unexplained? |
I have wifi and Bluetooth modules RT3290. Wifi is working fine but Bluetooth is shown as disabled under Bluetooth settings. Can anyone help me fix this? | I have found that there is a large community suffering from the problems with the WiFi-Bluetooth card Ralink RT-3290. It has been a problem since 2012-2013. None of the solutions I've found is simple, effective and durable. I managed, with great effort, some results. But when there is a kernel update, the problems return. Can anyone provide a simple , effective and lasting solution? Is there a project from Ubuntu's developers to attack the problem? |
Where $ F_{\mu \nu}= \partial_{\mu} A_{\nu}-\partial_{\nu} A_{\mu}$, $A$ being the four-potential. I'm interested in whether or not it's possible to show from this: $$ \frac{1}{\epsilon_0 \mu_0} E_{xx} = E_{tt}$$ Lower index meaning partial derivative. Sticking to (1+1) dimensions for simplicity. | Spacetime of special relativity is frequently illustrated with its spatial part reduced to one or two spatial dimension (with light sector or cone, respectively). Taken literally, is it possible for $2+1$ or $1+1$ (flat) spacetime dimensions to accommodate Maxwell's equations and their particular solution - electromagnetic radiation (light)? |
I'm reading a theorem about the order of a finite field: Here is the proof: At the end, the author said It follows that $\mathbb{F}$ is a vector space over $\mathbb{F}_{p}$, implying that its size $q$ is equal to $p^{m}$ for some $m>0$. I do not understand how $\mathbb{F}$ is a vector space over $\mathbb{F}_{p}$ implies that its size $q$ is equal to $p^{m}$. Could you please elaborate on it? | Are there any galois fields which consist of product of two primes, as in $\mathrm{GF}(2\cdot 3) = \mathrm{GF}(6)$? |
I want install Ubuntu13.04 from dvd. Is it possible without current windows xp os? If yes Please tell me the procedure in steps. If it is not possible then I will have to first install Ubuntu13.04 & uninstall windows xp professional. In this case please tell procedure in steps | I would like to see a full how-to guide on how to install Ubuntu. |
This question comes from seeing that the triangle addition rule for quantum mechanics comes out of groups/representation theory; I thought this was odd as we haven't used any group ideas in QM up to this point. After thinking about it I realised/belive that it comes from the use of a tensor product. In quantum mechanics if we have 2 systems (2 particles, a particle with spin and orbital wavefunctions etc) why do we join them as a tensor product and not a direct sum or cartesian product or a new 'quantum product'? | Why are states describing composite systems given by tensor products and not Cartesian products? They both belong in spaces of equal dimension, what are the differences between the two? |
here is the query i am using: bilan1 = [select id,valider__c,poste__c,Statut__c,Poste__r.Date_dernier_bilan__c, date_bilan__c, moyenne_du_bilan__c from Bilan_de_positionnement__c where poste__c in: collID and date_bilan__c =:Poste__r.Date_dernier_bilan__c order by date_bilan__c asc]; i get this error: Variable does not exist: Poste__r.Date_dernier_bilan__c when i remove the condition and date_bilan__c =:Poste__r.Date_dernier_bilan__c the error disappears even though the Poste__r.Date_dernier_bilan__cfield is fetched in the query meaning that the variable Poste__r.Date_dernier_bilan__c does exist, am i messing something ? | I think I may be hitting some sort of SOQL limitation in the WHERE clause. I am trying to return fields from two parent objects, after comparing two date fields on both Objects. The goal is to have a list of contacts with associated opportunity fields where the opportunity date field is equal to some contact field. NOTE: We have a custom junction between Opportunity and Contact named "Opportunity_Contact__c" due to the limits on the standard OCR sObj. Specifically: SELECT NAME, Con_Custom_Date__c, (SELECT Opportunity__r.Name FROM Opportunity_Contacts__r WHERE Contact__r.Con_Custom_Date__c = Opportunity__r.Opp_Custom_Date__c) FROM Contact This returns a parsing error. However, if I try switching the query to something like: SELECT NAME, Con_Custom_Date__c, (SELECT Opportunity__r.Name FROM Opportunity_Contacts__r WHERE Contact__r.Con_Custom_Date__c = TODAY and Opportunity__r.Opp_Custom_Date__c = TODAY) FROM Contact This works. So the date fields are working and I am able to use them in the WHERE clause. However, when I compare one field directly to the other, I get a parsing error.. Why would WHERE Contact__r.Con_Custom_Date__c = TODAY and Opportunity__r.Opp_Custom_Date__c = TODAY work while WHERE Contact__r.Con_Custom_Date__c = Opportunity__r.Opp_Custom_Date__c triggers a parsing error? Thanks! |
work with MSVC and GCC but not Clang. Is there a standard way of reversing the bytes in a number? It seems to me I have two options as of now: either to use a lot of #ifdef statements, or write out the implementation myself. | How do I convert between big-endian and little-endian values in C++? For clarity, I have to translate binary data (double-precision floating point values and 32-bit and 64-bit integers) from one CPU architecture to another. This doesn't involve networking, so ntoh() and similar functions won't work here. Note: The answer I accepted applies directly to compilers I'm targeting (which is why I chose it). However, there are other very good, more portable answers here. |
How do I cut a free form object (curve converted to mesh) along the edge? The goal is to create the smaller (blue outline) object, which looks like it has been sawn off the original one using a defined offset. | With text, you have a really handy control called 'offset', which allows you to easily increase/decrease the size of your letters from their centres not by changing the shape proportionally but by adding/detracting from its outline, which looks like this (border remains uniform): By contrast, when trying to scale down a mesh object using the 's' it looks like this (borders not uniform): Is there a similar 'offset' control that allows similar for mesh objects or any other way of achieving the same result? Seems odd that such a useful tool would be exclusive to text. |
Reading STM32 examples I've met code that cannot understand. /** * @brief This function writes a data buffer in flash (data are 32-bit aligned). * @note After writing data buffer, the flash content is checked. * @param FlashAddress: start address for writing data buffer * @param Data: pointer on data buffer * @param DataLength: length of data buffer (unit is 32-bit word) * @retval 0: Data successfully written to Flash memory * 1: Error occurred while writing data in Flash memory * 2: Written Data in flash memory is different from expected one */ uint32_t FLASH_If_Write(__IO uint32_t* FlashAddress, uint32_t* Data ,uint16_t DataLength) { uint32_t i = 0; for (i = 0; (i < DataLength) && (*FlashAddress <= (USER_FLASH_END_ADDRESS-4)); i++) { /* Device voltage range supposed to be [2.7V to 3.6V], the operation will be done by word */ if (HAL_FLASH_Program(FLASH_TYPEPROGRAM_WORD, *FlashAddress, *(uint32_t*)(Data+i)) == HAL_OK) { /* Check the written value */ if (*(uint32_t*)*FlashAddress != *(uint32_t*)(Data+i)) { /* Flash content doesn't match SRAM content */ return(2); } /* Increment FLASH destination address */ *FlashAddress += 4; } else { /* Error occurred while writing data in Flash memory */ return (1); } } return (0); } What is the metter of volatile argument? And another part. I think volatile has no reason in it. // Check if valid stack address (RAM address) then jump to user application if( ((*(__IO uint32_t*)MAIN_PROGRAM_START_ADDRESS) & 0x2FFE0000 ) == 0x20000000 ) { /* Jump to user application */ uint32_t jumpAddress = *(__IO uint32_t*) (MAIN_PROGRAM_START_ADDRESS + 4); /* Initialize user application's Stack Pointer */ __set_MSP(*(__IO uint32_t*) MAIN_PROGRAM_START_ADDRESS); ((pFunction)jumpAddress)(); /* do nothing */ while(1); } ST uses __IO to hide volatile. #define __IO volatile // from main uC header, i.e. "stm32f4xx.h" | Why is volatile needed in C? What is it used for? What will it do? |
I added content by html() function. The contents have elements like images and links, but I can't use click or any function for the added content using its id. Example: $("#container").mouseover (function(){ $("#container").html('<a id="button1" href="#"><img src="images/button1.gif"></a>'); }); $("#button1").click(function(){ $("#container").html ('any content'): }); | 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. |
Since start of this summer, I think that Google removed the option of using backspace for returning to previous page or so. I was wondering, if there exist any chance, of undo-ing this thing? Is there such thing that would help me, such as downgrading Chrome or using any additional add-ons or something such as this for getting this glorious function back? It's nearly impossible for me to forget this shortcut (as old habits die hard, lol) and keep pressing it and later on using the mouse to go back. | The latest version of Google Chrome has changed the hotkey for 'back' from backspace to alt + backspace. The new combination doesn't work on my laptop, however I would actually rather stick with the older key anyway. I've read in other questions that Chrome doesn't allow you to customise shortcuts, however is there any way to either re-enable the original shortcut or to override it back to being just backspace? I'm running Windows 10. |
consecutive sum Given an integer N, you have to find the number of ways you can express N as sum of consecutive integers. You have to use at least two integers. For example, N = 15 has three solutions, (1+2+3+4+5), (4+5+6), (7+8). | All the positive numbers can be expressed as a sum of one, two or more consecutive positive integers. For example $9$ can be expressed in three such ways, $2+3+4$, $4+5$ or simply $9$. In how many ways can a number be expressed as a sum of consecutive numbers? In how many ways can this work for $65$? Here, for $9$ answer is $3$, for $10$ answer is $3$, for $11$ answer is $2$. |
I am creating a script and when I try to capture a command return, I have an error of command not found, if I use this command on the terminal: gcloud -q compute snapshots list --format='csv(NAME)' It works fine. The script is: #!/bin/sh CSV_SNAPSHOTS= $(gcloud -q compute snapshots list --format='csv(NAME)') IFS=$'\n' for i in $CSV_SNAPSHOTS do echo "$i" done | What is the difference between below variables assignments? var=23 var =23 var= 23 var = 23 Is there any difference in space around the assignment operator? |
I'm trying to make a sign that you can right click and it will clear cacti from your inventory, then give you 18 cookies named "$100 Cookie" with the lore "$100". But when I put it in a command block and power it, the command block says this: [04:23:51] Data tag parsing failed: Unexpected token '$' at: $100 Cookie\",Lore:[$100]}}\"}}",Text3:"{\"text\":\"iIiIiIi\",\"color\":\"light_purple\",\"strikethrough\":true,\"obfuscated\":true}",Text4:"{\"text\":\"[Sell]\",\"color\":\"dark_purple\",\"bold\":true}" The command I'm using is: /give @p sign 1 0 {BlockEntityTag:{Text1:"{\"text\":\"[Sell]\",\"color\":\"dark_purple\",\"bold\":true,\"clickEvent\":{\"action\":\"run_command\",\"value\":\"clear @p[name=rainbowlack,r=3] cactus 0 2304\"}}",Text2:"{\"text\":\"2304 Cacti\",\"color\":\"red\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"give @p[name=rainbowlack,r=3] minecraft:cookie 18 0 {display:{Name:\"$100 Cookie\",Lore:[$100]}}\"}}",Text3:"{\"text\":\"iIiIiIi\",\"color\":\"light_purple\",\"strikethrough\":true,\"obfuscated\":true}",Text4:"{\"text\":\"[Sell]\",\"color\":\"dark_purple\",\"bold\":true}"},display:{Name:"Custom Sign"}} What's wrong with this command? I've tried backslashes and stuff. Can you please try to fix the command and test out your potential fix in-game? Thank you! You'll have to change the [name=rainbowlack,r=3] parts to whatever your username is (example: [name=playerplayer123,r=3]). | I need help with a specific command that I am using in a new game that I am creating inside of Minecraft. The command is: /give @p sign 1 0 {BlockEntityTag:{Text1:"{"text":" [MF2]","color":"gold","clickEvent": {"action":"run_command","value":"tellraw @a [""{"text":"[MF2] ","color":"gold"},{"selector":"@p","color":"dark_aqua"},{"text":" is now an admin of the server!","color":"white"}]"}}",Text3:"{"text":"Click to join Admin","color":"dark_aqua","clickEvent": {"action":"run_command","value":"scoreboard teams join admin @p"}}"},display: {Name:"Custom Sign"}} If I take out the /tellraw command then the command works fine, but I need the command in there to announce to the game that a new admin has joined. With the tellraw command, the error message is the following: Data tag parsing failed: Unexpected token 't' at: text":" [MF2]","color":"gold","clickEvent":{"action":"run_command","value":"tellraw @a [""{"text":"[MF2] ","color":"gold"}, {"selector":"@p","color":"dark_aqua"},{"text":" is now an admin of the server!","color":"white"}]"}}",Text3:"{"text":"Click to join Admin","color":"dark_aqua","clickEvent": {"action":"run_command","value":"scoreboard teams join admin @p"}}" If anyone knows how to fix this, please let me know. |
I want to write an Event listener function that needs to be called when any element in my <ul> tag gets edited. For example for elements in given ul <ul class="container"> <h4 contenteditable="true">hi</h4> <h5 contenteditable="true">hi</h5> <label> <input id="indeterminate-checkbox" type="checkbox" /> <span contenteditable="true">Indeterminate Style</span> </label> <p contenteditable="true">hi</p> <blockquote contenteditable="true">sup</blockquote> </ul> I want to use element.addEventListener() only once (I cannot just declare contenteditable for ul and add listener for same as that produces undesirable UI changes). Also, if possible I want to declare onchange for all these element at once(like from css). I want to do this because I am adding elements dynamically and want to remove redundant 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. |
I'm a bit confused about the usage of "the" in a list. Even after , it's not clear to me which of the following is grammatically correct. "Is the [object] at the top or bottom?" "Is the [object] at the top or the bottom?" Or should "at" be distributed as well? (In which case, it seems clear that "the" should appear twice.) "Is the [object] at the top or at the bottom?" | I sometimes find myself writing something like this: XXX is a project I admire and am very interested in. The "I <verb> and am <something>" feels strange here. It somehow sounds more natural in the third person: "He admires and is very interested in...." Am I just imagining things – is it OK to use this construction, or should I use something completely different? |
I have a dilemma. I can't log in to Ubuntu Forums using my user name. When I try to recover my password. It says my email is not in the system. It says I can contact the administrator. When I click on the link to contact the administrator, it says I have to be logged in. I believe I was in the midst of setting up and account after signing in with Launchpad. The process never completed, so I don't have a password. I'm pretty sure the user name I'm trying to use does not belong to anyone else. | I would like to contact a forum administrator and I don't want to log to my Ubuntu One account because I'm closing it. So I can't log to my forum account and I'd like to close it too. So, what can I do? :) Thank you for your help. |
Formating USB(pendrive) after installing done in Dell laptop. | More specifically, I want to know if when I put the Ubuntu OS on my flash drive if it is permanent or not. As in,can I delete the Ubuntu installation files after I install it on my computer and use it as a regular USB again? I just want to install Ubuntu on a unformatted hard drive and then be able to use my USB like normal again. Sorry, I know I must sound very redundant. Thank you for the help. |
I wanted to make a 4-in-a-row game board in python, where the player can choose the number of rows and columns. I wrote this: num_rows = 6 num_cols = 7 temp_board = [] board = [] for i in range (num_cols): temp_board += " " print ("the temp_board is:\n", temp_board) for i in range(num_rows): board.append(temp_board) print("the board is:") for i in range(num_rows): print (board[i]) The output was the temp_board is: [' ', ' ', ' ', ' ', ' ', ' ', ' '] the board is: [' ', ' ', ' ', ' ', ' ', ' ', ' '] [' ', ' ', ' ', ' ', ' ', ' ', ' '] [' ', ' ', ' ', ' ', ' ', ' ', ' '] [' ', ' ', ' ', ' ', ' ', ' ', ' '] [' ', ' ', ' ', ' ', ' ', ' ', ' '] [' ', ' ', ' ', ' ', ' ', ' ', ' '] Until here it is fine, but when I wanted to change a single space in the board board[0][0] = "R" This was the output ['R', ' ', ' ', ' ', ' ', ' ', ' '] ['R', ' ', ' ', ' ', ' ', ' ', ' '] ['R', ' ', ' ', ' ', ' ', ' ', ' '] ['R', ' ', ' ', ' ', ' ', ' ', ' '] ['R', ' ', ' ', ' ', ' ', ' ', ' '] ['R', ' ', ' ', ' ', ' ', ' ', ' '] How can I change it, so the R will appear only in the first line in the first column? | 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? |
Let $$X(n)=\frac{2^n-1}n;n\in\Bbb N; n>1$$ Prove that $X(n)\notin\Bbb N$. My try: check this for $n=2$. Then $$X(n+1)=\frac{2^n-1}{n+1}+\frac{2^n}{n+1}$$ So if $n+1$ is odd then $\frac{2^n}{n+1}$ can't be integer, if $n+1$ is even $\frac{2^n-1}{n+1}$ can't be integer. And then I thought proof is over, however, I realized – this doesn't cover cases where sum of remainders of both fractions is equal to 1. | Here is a problem which i have not been able to do for quite sometime. For $n \geq 2$, show that $n \nmid 2^{n}-1$. I have thought of proving this in two ways: One by using induction which didn't actually work. Next by Fermat's little theorem we have $2^{p-1} \equiv 1 \ (\text{mod} \ p)$, which actually says that for $p \mid 2^{p}-2$. But i couldn't proceed more than this. Any ideas by which i can actually solve the problem? |
EDIT: The cause for the problem described below was that I'm attempting to add my renamed bibliography as an unnumbered top-level (chapter) entry to the table of contents (TOC) in my document, but so far all of my attempts have been unsuccessful. Below is an MWE for my latest and tidiest attempt, plus the output. Does anyone know what my code is missing? I'm using MiKTeX 2.9, Biblatex 2.8, Biber 1.8, and I've made sure all my other packages are up to date as well. I'm using the pdflatex compiler. Main document \documentclass[bibliography=totoc]{scrreprt} \usepackage[backend=biber]{biblatex} \addbibresource{test.bib} \begin{document} \tableofcontents \chapter{Chapter} Lorem ipsum dolor sit amet \cite{entry}. \printbibliography[heading=bibintoc,title=References] \end{document} test.bib @article{entry, author = {John Doe}, journal = {TeX Monthly}, pages = {1----10}, title = {{How do I get this to work?}}, volume = {99}, year = {1234} } Output I tried working around the problem by adding the line \addcontentsline{toc}{chapter}{References} just after the printbibliography command, but this causes the TOC to reference the bibliography one page early. And besides, it is only a workaround, not a solution. | I'm trying out biblatex for the document I'm compiling, using the biber backend on my miktex distribution. Everything, including biber, should be up to date, assuming the MiKTeX repository currently holds the latest versions of everything. This is what the biblatex documentation (p. 101) says about how often I have to run biber to update my .bbl file: Whenever a reference to a work which has not been cited before is added, this procedure must be repeated. This is also the case if the last reference to a work which has been cited before is removed because some citation labels may change in this case. So if I make changes to my document (which is a very common activity in the process of writing a document), but leave the citations unchanged, I should not have to re-run biber before compiling the changes. However, every time I compile my document, regardless of the compiler or documentclass, the .bbl file is emptied. Consequently, the next time I compile the document without running biber, the bibliography is removed (seeing as the .bbl file contains nothing), and all my citations are broken. For this reason, I have to run biber before every time I compile the document, which largely counters the benefit of externalizing the bibliography in the first place. How can I make the compilers stop overwriting my .bbl file and make everything behave as described in the biblatex manual? Upon investigating the contents of the auxiliary files, I found that the .bbl file (after running biber, before compiling) begins with the following lines: % $ biblatex auxiliary file $ % $ biblatex bbl format version 2.3 $ Does the biblatex version 2.8 still mark the .bbl files as version 2.3? If not, could this be the problem? And if so, why does my 2.8 version of biblatex (partly) behave as version 2.3? Any help solving this problem would be much appreciated. |
Today I tried to look up a question on Stack Overflow. I had two popovers on the page, one inviting me to take a short survey (which didn't even load!) and one inviting me to learn how the review queue works. In addition, the GDPR cookie consent dialog doesn't seem to remember its settings, and reappears periodically. Perhaps it's using the old "only remember the setting properly if it was 'Accept All'" dark pattern? This visual clutter makes the site less usable. Please don't keep going down the road of "every other site spams people with popovers so it's OK for us to do it". It's not. There should be an easy way to turn off all this intrusive rubbish and just show the question, the answers, the answer box, and the linked/related/hot network questions — and this method should be configurable even when logged out (if I'm linked to an SE site I don't normally participate in, I shouldn't have to log in just to have a usable experience). Ideally, every site would be a subdomain of stackexchange.com so people could set one set of overrides in a custom stylesheet, or configure their adblockers once, and the work needed at the SE end would be to continue not using randomly-generated class names and IDs in the CSS. But I don't suppose there's much appetite for moving SO to stackoverflow.stackexchange.com :) | There have been for a while, but this is ridiculous. It reminds me of , but this time it's network-wide. The banner must be scrolled past (or dismissed) on every page unless both first-party JavaScript and first-party cookies are enabled. If first-party JavaScript is enabled, and the banner is visible, the rest of the page jumps up and down every so often. Under certain circumstances (not quite sure what they are, yet – a direct link to an answer, maybe? I'm seeing it ) the entire page jumps up and down a line every few seconds even when the banner is off-screen. The cookie banner keeps coming back unless both third-party JavaScript are enabled (and is solved). The cookie box occludes the “Learn more about Teams” link in the banner (with default Firefox window sizes) and the Job / Teams link in the sidebar. As it stands, – a site for hobbyists and researchers, whose audience is not very likely to purchase Teams – is much, much harder to use, for no benefit that I can see. Can you roll back this change, please? |
I am trying to implement my own use of bit flags in C/C++. I have three functions: getBool, setBool, and printBools. All of my current code except one part: I can't set bits to false. They set to true just fine, they read back just fine, but I can't set true bits to false. Here is my code: #include <iostream> #define uint unsigned int #define BIT1 1 #define BIT2 2 #define BIT3 4 #define BIT4 8 #define TRUE 1 #define true 1 #define FALSE 0 #define false 0 int getBool(uint boolSet, uint bit){ return ((boolSet&bit)==bit); } void setBool(uint &boolSet, uint bit, short tf){ if(getBool(boolSet, bit)) return; else if(tf == 1) boolSet += bit; else if(tf == 0) boolSet -= bit; } void printBools(uint boolSet, uint j){ uint i = 1, count = 1; while(count <= j){ std::cout<<"Bool "<<count<<": "<<getBool(boolSet, i)<<std::endl; i*=2; count++; } } int main(){ uint boolSet = 0; printBools(boolSet, 4); //make sure bits are false setBool(boolSet, BIT1, 1); //set bit 1 to true setBool(boolSet, BIT3, 1); //set bit 3 to true printBools(boolSet, 4); //check set bits setBool(boolSet, BIT3, 0); //set bit 3 to false setBool(boolSet, BIT4, 1); //set bit 4 to true printBools(boolSet, 4); //check set bits } Additionally, if you would like to see the output really quickly, here is a link: Thank you for your help! | How do you set, clear, and toggle a bit? |
I posted a question (which is deleted now) on Stack Overflow, but it got closed as off-topic, but nobody answered my comment about the appropriate Stack Exchange site. Where should I post a question about the copyright/license of a random number generator? | Is it appropriate to ask questions about software licenses/licensing on ? Or is the appropriate place ? Or is there no appropriate site currently and we should suggest such a site on ? |
I am trying to find a way that I can define/initialize some static string arrays in a struct inside a class definition. These string arrays are always to be initialized with string literals. I tried doing the following and it initializes the parameterTypes[] fine and i can access the strings using eg. MethodNaming_bla::parameterTypes[2], but if I pass the parameterTypes as a const char* const * const i get a linker error :( Also if i pass it to a constructor using MethodNaming_bla::parameterTypes. struct MethodNaming_bla { static constexpr const char* const parameterTypes[] = { "afd","qwer","zvc" }; static const char* const * const parameterTypes_d = parameterTypes; }; However if i do the same in a function, it works for some reason. int main(int, char* []) { static constexpr const char* const parameterTypes[] = { "afd","qwer","zvc" }; static const char* const * const parameterTypes_d = parameterTypes; } Is there a way where I can define and initialize a string array in a struct from string literals, inline? Thanks in advance, Martin | Can anyone explain why following code won't compile? At least on g++ 4.2.4. And more interesting, why it will compile when I cast MEMBER to int? #include <vector> class Foo { public: static const int MEMBER = 1; }; int main(){ vector<int> v; v.push_back( Foo::MEMBER ); // undefined reference to `Foo::MEMBER' v.push_back( (int) Foo::MEMBER ); // OK return 0; } |
Hearthstone has a variety of themed game boards. Each board features various interactive components and Easter Eggs. Among other things the Goblins vs. Gnomes board features a teleportation chamber that seems to be controlled by the position of the levers to the left of the chamber. Does the position of the levers effect the items which will be teleported? What items can a player teleport into the chamber? | When playing against slow opponents I spend most of my time clicking the interactive areas of to boards like the catapult, bonfire and farm. I have multiple times though I had found them all but then found a new place to click. So what are the places you can click on each board to have something happen? |
I am reading some xml files from an ibm queue and when updating to version 9 I started getting exception when trying to convert the xml to csv using the code below at the line (transformer.transform(source, outputTarget); File stylesheet = new File("src/howto.xsl"); File xmlSource = new File("src/howto.xml"); DocumentBuilderFactory factory1 = DocumentBuilderFactory.newInstance(); DocumentBuilder builder1 = factory1.newDocumentBuilder(); Document document1 = builder1.parse(xmlSource); StreamSource stylesource = new StreamSource(stylesheet); Transformer transformer = TransformerFactory.newInstance().newTransformer(stylesource); Source source = new DOMSource(document); Result outputTarget = new StreamResult(new File("/temp/howto.csv")); transformer.transform(source, outputTarget); System.out.println("Done."); used same jdk and ibm libs from the queue server on the client File stylesheet = new File("src/howto.xsl"); File xmlSource = new File("src/howto.xml"); DocumentBuilderFactory factory1 = DocumentBuilderFactory.newInstance(); DocumentBuilder builder1 = factory1.newDocumentBuilder(); Document document1 = builder1.parse(xmlSource); StreamSource stylesource = new StreamSource(stylesheet); Transformer transformer = TransformerFactory.newInstance().newTransformer(stylesource); Source source = new DOMSource(document); Result outputTarget = new StreamResult(new File("/temp/howto.csv")); transformer.transform(source, outputTarget); System.out.println("Done."); I am able to read the xml file and save it locally, but getting the below exception: Could not initialize class com.sun.org.apache.xml.internal.serializer.EncodingsJul 10, 2019 11:24:00 AM MST, ERROR](ItemMasterMQRawMat.java:read():388) - read() - XPathExpressionException --> java.lang.NoClassDefFoundError: Could not initialize class com.sun.org.apache.xml.internal.serializer.Encodings | I am getting a NoClassDefFoundError when I run my Java application. What is typically the cause of this? |
I just remembered that I made an old account 2 years and 5 months ago. For some reason, I stopped using that login, and now I have my main account (the one I'm using to post this question). I went through the , and after confirming that I own both accounts, I came to a page stating: Thank you for confirming ownership of your accounts. The account DJ McMayhem will be removed, and all rep and votes will be transferred to account user2874724 as a result of this merge. Please click OK to confirm. I don't want to delete DJMcMayhem! That's the one I have been active on, with my correct email and settings and contributions and network profiles! Is there anyway I can merge the old one into my new one? | I accidentally posted a question without being logged in. Is there a way to associate that question with my account? For more information, visit "" in the . a.k.a. How can you link a registered account to a cookie-based account? a.k.a. How do I merge an unregistered account with a registered account a.k.a. Merging users a.k.a. How do I associate anonymous questions I’ve asked with my registered account? a.k.a. Is there a way to claim an unregistered user? (in case anyone searches with those terms) |
If $(X,d)$ is a metric space, then we have the following equivalent description of the compactness of $X$: $X$ is compact $\Leftrightarrow$ $ \forall f : X \to \mathbb R$, we have $f(X)$ is bounded. The "$ \Rightarrow$" part is obvious, but how can I check the "$\Leftarrow$" part? | Let $X$ be a metric space. Prove that if every continuous function $f: X \rightarrow \mathbb{R}$ is bounded, then $X$ is compact. This has been asked before, but all the answers I have seen prove the contrapositive. Realistically, this may be the way to go, but is there way to exhibit an unbounded continuous function (under the assumption $X$ is not compact) without appealing to results beyond introductory real analysis (e.g., the solution I've seen involves the Tietze Extension theorem)? Because we're working with metric spaces, it's clear that the assumption that $X$ is noncompact (towards proving contrapositive) will lead us to extract a sequence of points in the space with no convergent subsequences. But how can we infer the existence of an unbounded continuous on the space knowing only about some sequence of points in this space (without using anything too advanced)? |
The title is pretty much self explanatory. Does the speed of light vary depending on what it is traveling through? The speed of light through vacuum is 299792458 meters per second but does it change if it would say travel through air or water? If so why and if not why? | So light travels slower in glass (for example) than in a vacuum. What causes light to slow down? Or: How does it slow down? If light passes through the medium, is it not essentially traveling in the "vacuum" between the atoms? |
Got my first script working and very excited about it. Modifying it to work with functions and running into issues. Appreciate help with this so I can better understand. As I understand I can define a function and then I can call it again. So I created a function below "sh_ap_sum". I'm trying to run that so that it dumps the output of the command to a file. Then I am calling that function again with "sh_ap_sum(cdp)" and trying to display the output of the file in the terminal window. Am I completely doing it wrong any hints will be appreciated greatly. Thank you. from netmiko import ConnectHandler import sys def sh_ap_sum(ap_sum): ipaddr = input('IP:''') net_connect = ConnectHandler(ip = ipaddr,port = 22,username = 'admin',password = 'mypassword',device_type = 'cisco_wlc_ssh') net_connect.find_prompt() '(Cisco Controller) >' output = net_connect.send_command('show ap summary') sys.stdout = open('wlccon.txt', 'w') net_connect.disconnect() sh_ap_sum(cdp) output = net_connect.send_command('show ap cdp ne all') print(output) | What exactly are the Python scoping rules? If I have some code: code1 class Foo: code2 def spam..... code3 for code4..: code5 x() Where is x found? Some possible choices include the list below: In the enclosing source file In the class namespace In the function definition In the for loop index variable Inside the for loop Also there is the context during execution, when the function spam is passed somewhere else. And maybe pass a bit differently? There must be a simple reference or algorithm somewhere. It's a confusing world for intermediate Python programmers. |
I am trying to find the sum $${100\choose 0}^2-{100\choose 1}^2+{100\choose 2}^2- \dots+ {100\choose 100}^2$$ After the first few examples for small numbers this appears to be $$\sum_{k=0}^{n}{(-1)^k {n\choose k}^2}=(-1)^\frac{n}{2}{n\choose \frac{n}{2}}$$ for all even $n$s. (For odd $n$ this is obviously $0$ because of the symmetry ${n\choose k}={n\choose{n-k}}$). I tried to prove it by induction, but it is too messy and I am not sure that's the right direction. What I did is write it in terms of $m=\frac{n}{2}$ so then the induction step will be just $+1$, although that didn't help very much. Thanks in advance for any help. | I know that the sum of squares of binomial coefficients is just ${2n}\choose{n}$ but what is the closed expression for the sum ${n\choose 0}^2 - {n\choose 1}^2 + {n\choose 2}^2 + \cdots + (-1)^n {n\choose n}^2$? |
Thank you for taking the time to help me out. I've got 3 classes which are interacting with eachother: Score, Golfer, and GolferTester. Golfer contains an array of Score objects. My issue is with adding singular Score objects to the array via Golfer.addScore(String, int, double, int, String) when running GolferTester. I have tried to rearrange Golfer.addScore() many times now and am still receiving NullPointerException when executing Golfer.findScore(String). I think the most important aspect here is that everything runs smoothly so long as I refrain from prematurely ending the Golfer.addScore() for loop with return. But not stopping the loop fills the entire array with nextScore, and renders my method for finding which array slot to fill (by locating null slots), useless after one call. I'll show the code below. Thank you for your assistance! Golfer.addscore(String newCourse, int newScore, double newCourseRating, int newSlope, String newDate) : public void addScore(String newCourse, int newScore, double newCourseRating, int newSlope, String newDate) { Score nextScore = new Score(newCourse, newDate, newScore, newCourseRating, newSlope); for (int i = 0; i < scores.length; i++) { if (scores[i] == null) { scores[i] = nextScore; return; } } } Golfer.findScore(String date) : private int findScore(String date) { int ans = 0; for (int i = 0; i < scores.length; i++) { String iDate = scores[i].getDate(); if (iDate.equals(date)) ans = i; } if (ans == 0) return -1; else return ans; } Golfer.getScore(String date) : public Score getScore(String date) { int a = findScore(date); return scores[a]; } class GolferTester : public class GolferTester { public static void main (String[] args) { Golfer golfer1 = new Golfer("John", "homecourse", 4); golfer1.addScore("course1", 75, 68.5, 105, "05/03/2017"); System.out.println(golfer1.getScore("05/03/2017")); } } As mentioned, simply removing the return aspect from the for loop within Golfer.addScore() makes everything run properly. I've tried workarounds that don't involve using "return" specifically, but to no avail. Thanks again for any input. | 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? |
Say I have a class like this: public class MyTestClass<T> { public void DoSomething(object o) { Logger.Debug("Non-generic version called."); } public void DoSomething(T o) { Logger.Debug("Generic version called."); } public void DoOtherThing(object o) { Logger.Debug("DoOtherThing called."); } } If I create an instance with type:MyTestClass<Object>, I can get "DoOtherThing" method use following code: var t = typeof(MyTestClass<object>); var doOtherThingMethod = t.GetMethod("DoOtherThing"); but there are two method named "DoSomeThing",how could I call its generic version using reflection? To describe my question clearly,I give the following example. public void TestGenericClass() { var o = new MyTestClass<object>(); var t = o.GetType(); var methodInfos = t.GetMethods(); //GetMethod will throw System.Reflection.AmbiguousMatchException here: Ambiguous matching in method resolution. var m = t.GetMethod("DoSomething"); //there are two MethodInfo in methods. var methods = t.GetMethods("DoSomething"); var m1 = methods[0]; var m2 = methods[1]; } The question is, which one is the method using generic type, m1 or m2? | What's the best way to call a generic method when the type parameter isn't known at compile time, but instead is obtained dynamically at runtime? Consider the following sample code - inside the Example() method, what's the most concise way to invoke GenericMethod<T>() using the Type stored in the myType variable? public class Sample { public void Example(string typeName) { Type myType = FindType(typeName); // What goes here to call GenericMethod<T>()? GenericMethod<myType>(); // This doesn't work // What changes to call StaticMethod<T>()? Sample.StaticMethod<myType>(); // This also doesn't work } public void GenericMethod<T>() { // ... } public static void StaticMethod<T>() { //... } } |
I have seen a mistake in one of a series of seven videos I've uploaded to YouTube. They have been recently posted and don't have "likes", comments etc, so I am perfectly happy to start from scratch. All I want to do is delete number five in the series and upload a new number 5. How can I do this? | I need to make a small correction in a video I uploaded to YouTube. Googling shows that this is not possible. However, I remember seeing it done before. I posted a comment on a video saying that a certain part of the video was missing. I got a reply back that it was fixed, and when I went to see the video again, it was changed. How was this done? |
While changing direct to indirect speech, we generally back shift the tense. Example - "I have finished my work." (Direct speech) He said that he had finished his work. (Indirect speech) In this example present perfect tense is back shifted to past perfect tense. NOTE : There is an exception to this rule : At the time of reporting, if the reported words are still true or still relevant then back shifting is optional. For example: "He said that he has lost his keys." Here present perfect tense is not back shifted because at the time of reporting situation is still relevant. By relevant I mean that the consequence of losing his key can still be seen or heard. Now my main question(s) is: Context: Recently an earthquake came in India and Nepal. Thousands of people have lost their lives. Rescue operation is on its way. Now consider the example which is not an indirect speech: "The President learned that this earthquake has caused destruction all across Nepal and India." First: tell me, here is it correct to use "has caused" under the context that situation is still relevant, i.e. the aftermath of the earthquake can still be seen? Second: Here is back shifting optional or obligatory? Another question: You see, my intention of asking question is - In sentence structure of indirect speech like - (He said +........... , He informed +....... , He claimed + .......... ), I am aware that if the situation is still relevant then back shifting of present perfect tense is optional. But what if the sentence structure is something like - ( He learned + ........... , He noticed +.......... , He found +....... ) here also is back shifting of present perfect tense optional if the situation is still relevant ? P.S. : My question concerns only present perfect tense. | In news reports, we often read or hear events introduced with the present perfect, and then the past simple like this: The film star Jim Cooper has died of cancer. He was 68 and lived in Texas. What's wrong if we use both first and second sentence in past simple? The film star Jim Cooper died of cancer. He was 68 and lived in Texas. |
What's the easiest way to play a sound file (.wav) in Python? By easiest I mean both most platform independent and requiring the least dependencies. pygame is certainly an option, but it seems overkill for just sound. | How can I play audio (it would be like a 1 second sound) from a Python script? It would be best if it was platform independent, but firstly it needs to work on a Mac. I know I could just execute the afplay file.mp3 command from within Python, but is it possible to do it in raw Python? I would also be better if it didn't rely on external libraries. |
I am really having a problem understanding the proof of this question. Let me write the proof and i will explain my question Let $p$ be the smallest prime factor of $n$. Assume that $p > n^{\frac{1}{3}}$ Then $p > n^{\frac{1}{3}} \Rightarrow p^{-1} < n^{-\frac{1}{3}} \Rightarrow np^{-1} < nn^{-\frac{1}{3}} \Rightarrow \frac{n}{p} < n^{\frac{2}{3}}$. Let $m = \frac{n}{p}$, and assume that it is greater than $1$. Notice that $m$ cannot have a prime factor less than $n^{\frac{1}{3}}$. However $n^{\frac{1}{3}} = \sqrt{n^{\frac{2}{3}}} > \sqrt{m}$ Therefore, $m$ does not have a prime factor less than $\sqrt{m}$. Hence, $m$ is a prime. I really dont understand this proof and Why does $m$ not have a prime factor less than $n^{\frac{1}{3}}$? If someone can explain to me this proof i would really appreciate it ! thanks | Show that if the smallest prime factor $p$ of the positive integer $n$ exceeds $\sqrt[3]{n}$, then $\frac{n}{p}$ must be prime or 1. I'm stuck trying to prove this. I tried this using contradiction, but I haven't been able to prove it. My approach: Let $p$ be the smallest prime factor of the positive integer $n$. Let $p > \sqrt[3]{n}$ Then we must show that $\frac{n}{p}$ is either a prime number or 1. We know that $n = pe$ for some $e \in \mathbb{Z}$. Thus, $\frac{n}{p} = e$ We also know that $p$ > $\sqrt[3]{n}$, so $p^3 > n$, and $p^2 > \frac{n}{p}$ So, assume $\frac{n}{p} = e$ is not prime nor 1, meaning it's a composite number. Let's try to get a contradiction. If $\frac{n}{p}$ is composite, then $\exists a,b \neq 1: \frac{n}{p} = ab $ Now, here's where I get stuck. What can I do with this info? $\frac{n}{p} = ab $ and $p^2 > \frac{n}{p}$. |
I am a little confused at the moment I am trying to setImageResource to some Images in an ImageView Array. I replicated the error in a simpler project so here is the code. I am sure this must be a silly mistake but I have tried a lot and could not figure out the proper execution. I can't understand why images is a null object reference since I already initialised it in every way I could think of. I am getting this error in the line mentioned in the code. java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.ImageView.setImageResource(int)' on a null object reference. package com.example.test; import android.media.Image; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.widget.ImageView; public class MainActivity extends AppCompatActivity { private ImageView image1; private ImageView image2; private ImageView image3; private ImageView image; private ImageView[] images = {image1, image2, image3, image}; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); image1 =(ImageView) findViewById(R.id.image1); image2 = (ImageView) findViewById(R.id.image2); image3 = (ImageView) findViewById(R.id.image3); image = (ImageView) findViewById(R.id.image); setImages(); } public void setImages() { //This is where I am getting the error images[0].setImageResource(R.drawable.a); images[1].setImageResource(R.drawable.b); images[2].setImageResource(R.drawable.c); images[3].setImageResource(R.drawable.d); } } | 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? |
How to export an image from Photoshop CC with dimensions (15300 x 10500) to one PNG without scaling down? I have multiple images at 15300 x 10500 pixel and created them at this size. However, I can not export it at this ratio to PNG. No matter which way I try "export as ...", "For Web" or "Fast export", I can not put the scaling to 100%. At "Export as ..." maximum is 78%, at "For Web" it is 53,54%. Different images (at the same original pixel dimensions) give the same maximum. There is a white background and many areas with the same color, so file size is not an issue. The actual file size on the smaller ratios is <2MB. If i "export layers" the background layer is at its full size, but if I create a merged layer and try to export that single layer it is scaled down, too. At Illustrator I don't have trouble exporting to full size. Any help appreciated! | I have a huge image (1024*256000) which I want to slice horizontally into 100 images of 1024*256. I'm using Adobe Photoshop CS6. I created the horizontal slices with the Slice tool and the Divide option. Save for web allows me to save the images, but only at a 32.03% scale. If I try to change the Percent field to 100%, it gives me the following error: A value between 0.01 and 32.03 is required. Closest value inserted. Is there any way around this? |
I frequently come across questions that don't actually read like questions, for example, "How to ask a question?" which to me, reads more like a direction than an actual question. I mostly see it when the writer is either from Europe or Asia. It's something I see often enough that I'm wonder if it is correct in certain contexts. If not, I would appreciate alternative phrasings. My first thought in this example would be something like, "How do you ask a question?" or "How should you ask a question?" But in certain contexts, the use of the second person is inappropriate and I have no idea what to do there. Any help or insight will be greatly appreciated. Thank you. | This question is inspired by comments on . The original poster wrote: How to correct this error? And comments say that it's an incorrect question. Better is How do I correct this error? I am not a native English speaker, so the fact that both versions sound natural to me is quite irrelevant. But I would like to ask anyway whether the first version is really bad. I have seen a lot of questions starting with How to, so if you say that the first version is incorrect, could you please summarize when it is OK to use How to and when it is preferable to say How do I. |
I have a local string (file path) which I need to retrieve from a function only once and I'd like to make sure it's never modified again. I cannot use the const keyword because the value of my string is determined at runtime rather than compile time. So I tried using the readonly keyword instead, but Visual Studio is telling me that it is not valid for my item. How can I achieve the level of protection I want, preferably without making another class? For simplicity and company policy, I've (drastically) shrunk down and renamed my classes and functions, but the concept is the same. public class myClass { private void myFunction() { readonly string filePath = HelperClass.getFilePath("123"); //do stuff } } public static class HelperClass { public static string getFilePath(string ID) { switch(ID) { case "123": return "C:/123.txt"; case "234": return "C:/234.txt"; default: throw new Exception(ID + " is not supported"); } } } === Edit For PS2Goat ==== public class myClass { protected SomeObject o; private virtual readonly string path; public myClass(someObject o) { this.o = o; path = HelperClass.getFilePath(o.getID()); } private virtual void myFunction() { //do stuff } } public class myDerivedClass { private override virtual readonly string path; public myDerivedClass(someObject o) : base(o) { path = HelperClass.getFilePath(o.getID()); //ID will be different } private override void myFunction() { //do different stuff } } public static class HelperClass { public static string getFilePath(string ID) { switch(ID) { case "123": return "C:/123.txt"; case "234": return "C:/234.txt"; default: throw new Exception(ID + " is not supported"); } } } See, so this issue I'm having is that if I want to throw an exception, I'd have to catch it in the parent class' constructor for now (until that class is supported) because the parent constructor will be called before the derived constructor. So the wrong ID will be set once before the child constructor (which has the correct ID) is called. | Having a friendly debate with a co-worker about this. We have some thoughts about this, but wondering what the SO crowd thinks about this? |
I am trying to debug my Python program so I apt-get install python3.6-dbg. But when I run python3.6-dbg and I try to do import numpy I get: >>> import numpy Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/numpy/core/__init__.py", line 16, in <module> from . import multiarray ImportError: cannot import name 'multiarray' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python3.6/dist-packages/numpy/__init__.py", line 142, in <module> from . import add_newdocs File "/usr/local/lib/python3.6/dist-packages/numpy/add_newdocs.py", line 13, in <module> from numpy.lib import add_newdoc File "/usr/local/lib/python3.6/dist-packages/numpy/lib/__init__.py", line 8, in <module> from .type_check import * File "/usr/local/lib/python3.6/dist-packages/numpy/lib/type_check.py", line 11, in <module> import numpy.core.numeric as _nx File "/usr/local/lib/python3.6/dist-packages/numpy/core/__init__.py", line 26, in <module> raise ImportError(msg) ImportError: Importing the multiarray numpy extension module failed. Most likely you are trying to import a failed build of numpy. If you're working with a numpy git repo, try `git clean -xdf` (removes all files not under version control). Otherwise reinstall numpy. Original error was: cannot import name 'multiarray' If I do that with regular python3.6 it works. numpy was installed through pip3 system-wide before I installed python3.6-dbg. | Python3.4.0 on Ubuntu 14.04.01 LTS. We can use it by typing on Terminal `python3. I want to use Numpy for Python3.4.0. I run import numpy but I had anImportError.So sudo apt-get install python-numpy. Then I typed on Terminal:python3`. Then import numpy. I got this error: >>> import numpy Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named 'numpy' >>> Nevertheless, Numpy is now working for Python-2.7: begueradj@begueradj-Bill:~$ python Python 2.7.6 (default, Mar 22 2014, 22:59:38) [GCC 4.8.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import numpy >>> How can I make Numpy work for Python 3.4.0 ? |
I have been working with Eclipse for quite some time and recently got several recommendations to use IntelliJ. As I just saw that questions of the format of "Which IDE is better?" are frowned upon (not without a good reason) - I wanted to know objectively what are the advantages of IntelliJ over Eclipse. I know what Eclipse does and frankly I'm not missing anything. But this is exactly what I said about Visual Studio 2005 (C#) before starting to work on Eclipse - and now I can't even write a Hello World in VS without getting annoyed ... I'll narrow the question down to the world of Java SE and Java EE only. No Android, no GUI. I'm looking for: What does IntelliJ give me that Eclipse lacks? What does Eclipse give me that IntelliJ lacks? Try to be objective, and please only answer if you had substantial experience with both tools. Thanks. Edit: The scope of work I'm looking for is both for working on private projects and as part of a team of several developers working on the same product. But if I have to choose - I'll focus on teams only. JUnit is a crucial part of the work (personally I started working in TDD several months ago - but lets not open that). I'll also be interested to know about ANT/Maven related benefits if there are - although my prime motives are to know if I can benefit from things like: Quicker development (e.g. code generation, templates, auto complete etc.), Easier AUT, simpler Java EE application deployment during development (for UT) etc. | I have heard from people who have switched either way and who swear by the one or the other. Being a huge Eclipse fan but having not had the time to try out IntelliJ, I am interested in hearing from IntelliJ users who are "ex-Eclipsians" some specific things that you can do with IntelliJ that you can not do with Eclipse. Note: This is not a subjective question nor at all meant to turn into an IDE holy war. Please downvote any flamebait answers. |
I was given a laptop in 2008 that had both XP Professional and Ubuntu. I only ever used XP, so I left Linux alone. Now, I'd like to remove it. I tried going to Disk Management to delete the partition, but it doesn't seem like there is one. I have the C: drive and a volume with no name that's 7.5 GB. At first I thought this might be it, but turns out it's my Active partition. Maybe my friend installed XP and Ubuntu on the same partition? I also don't see wubi installed, so I don't think that's how he got Ubuntu on there. For what it's worth, it's Ubuntu 7.10, kernel 2.6.22-14-generic. Any help would be appreciated. | I have installed Ubuntu 11.10 on my Acer netbook as a dual boot with the default Windows XP on said netbook. Now I need only Windows XP and want to completely uninstall Ubuntu 11.10, there is no cd drive in my netbook. Any help would be greatly appreciated. |
I am very new to the databases just have basic knowledge about it. I want to learn sql language and dont know where to start. Please help me to start with it. And what is the difference between sql and PostgreSQL? What are the different languages to maintain databases. Any help will be appreciated. | I am trying to find some database tutorials,books and similar, since I have started this course in college, and received some material, but it is really hard to manage through all the info on the net. I searched through the questions on the site but didn't find any. Thankfull for all your input. |
I need to schedule a shell script execution with crontabs to execute it every 5 hours starting from 01:00 and daily. sample execution times: 2020-05-29 01:00 2020-05-29 06:00 2020-05-29 11:00 2020-05-29 16:00 2020-05-29 21:00 2020-05-30 02:00 2020-05-30 07:00 ..... please note that the interval is rolled forward per the day. I have tried the following expression but crontab is giving an error saying "bad hour". 0 1/5 * * * path_to_shell_script Can anyone suggest a way accomplish this if it is possible with crontabs? | Can I use below code to set cron job for every 5 hours? 0 */5 * * * script.sh What time my script.sh will be executed? 0000, 0500, 1000, 1500, 2000, 0100, 0600, 1100, 1600, 2100 and so on... OR 0000, 0500, 1000, 1500, 2000, 0000, 0500, 1000, 1500, 2000 and so on... If we can not set cron job for every 5 hours with this traditional method, is there any other way to set such job? |
I'm talking with someone and I want to know what they think about a specific topic (which was discussed priviously), which of the following should I use: What are your thoughts on that or What are your thoughts on this | Learning and using English I'm always confused about what word to use for referring to things that have been described by me a few sentences earlier: "that" or "this". Confusion comes from the fact that only the equivalent of "this" is always used in my native language for such referring. But I've noticed that in English for such referring "that" is used as often as "this" (or maybe even more often). Some examples for illustrating (just tried to google something appropriate to convey my idea better): We assess local... the demographics of the local population. What are the natural traffic drivers in the area. Things like cinemas and pubs and retail and office and all that type of things and we now put together a bit of a matrix and actually give a weighted score to each of the things we know help our business. That helps us decide in a more scientific fashion. or: The problem of Cervantes' origin became after that into a tough matter. Some experts believed that the Cervantes from Alcázar, in the times of the Lepanto Battle, was in the age of a child, more concerned about gathering nests and that type of things than about fighting as a soldier. and for "this": I believe lot of people who involved fishery industries in Mexico Gulf are suffering now but as for economic issues, U.S government and other countries will support them and give an utmost response to it. Important thing is that we learn from this mistake and make sure this type of things will never happen in the future and protect nature environment thus we have to take this technology to get energy from water very seriously. I really hope this technology will be available and used for everybody as soon as possible. Is there a rule describing proper usage of these words in cases like this? (or should I have written "..in cases like that"?) |
Hi I am trying to append url from the server and show the link to the user to click it but the 'click' doesn't work. Can you help me fix it? Thank you! $("#uurl").append("<p><a target='_blank' href="+data[1]+">"+data[1]+"</a></p>") | 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. |
Guys: I'm tearing my hair out on this problem. I have 2 .deb files ready to install, and when I do sudo apt-get install *.deb I get: E: Unable to locate package discord-0.0.14.deb E: Couldn't find any package by glob 'discord-0.0.14.deb' E: Couldn't find any package by regex 'discord-0.0.14.deb' E: Unable to locate package XnViewMP-linux-x64.deb E: Couldn't find any package by glob 'XnViewMP-linux-x64.deb' E: Couldn't find any package by regex 'XnViewMP-linux-x64.deb' My ls -lah shows: drwxr-xr-x 2 root root 4.0K Mar 24 08:56 . drwxr-xr-x 10 root root 4.0K Mar 2 20:57 .. -rwxrwxr-x 1 kcredden kcredden 69M Mar 24 08:54 discord-0.0.14.deb -rwxrwxr-x 1 kcredden kcredden 52M Mar 24 08:52 XnViewMP-linux-x64.deb There was one fix that said some app wasn't installed, which I did and it fixed it then. But now I've got the same problem, so any help? NAME="Ubuntu" VERSION="20.04.2 LTS (Focal Fossa)" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Ubuntu 20.04.2 LTS" VERSION_ID="20.04" HOME_URL="https://www.ubuntu.com/" SUPPORT_URL="https://help.ubuntu.com/" BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" VERSION_CODENAME=focal UBUNTU_CODENAME=focal | How do I install a .deb file via the command line? |
Let $P = \{A \in \mathbb{N} : A \neq \emptyset, |A|<\infty, |A| = 2k, k\in \mathbb{Z}^{+}\}$. Consider $X = \{ A \in P: 1 \in P \}$. Does $X$ have a lower bound in $(P,\subseteq)$. We can see that $X\subseteq P$, which contains the element $1$ of $P$. By definition, an element $p\in P$ is a lower bound for $X$ iff $\forall x \in X$ we have $p\subseteq x$. Let $p = \{ 1 , a_2, a_3,\cdots,a_{2k}\}$ be the elements of $P$ which contain $1$ and are organized in ascending order, and let $x = \{ 1 , b_2, b_3,\cdots,b_{2m}\}$, where $m\in \mathbb{Z}^+$, and organized in ascending order. By comparing terms, it is not necessarily that $a_{i} = b_{i}$, then, there does not exist a $p\in P: p\subseteq x, \forall x\in X$, so $X$ does not have a lower bound. I am right or wrong, Thanks | Let $P=\{A \subseteq \mathbb N: A$ is non-empty, finite and has an even number of elements$\}$. Consider $X=\{A \in P : 1 \in A\}$. Does $X$ have a lower bound in $(P,\subseteq)$? I think that there is a lower bound. |
Why electron does not fall into nucleus from orbit of an atom? As accelerated charged particle radiates energy, it should lose energy. | One of the problems with Bohr's theory to describe the hydrogen atom, was that the electron orbiting around the nucleus has an acceleration. Therefore it radiates and loses energy, until it would collapse with the nucleus. Now Schrödinger describes the electron as a wave function. His theory is able to describe all atoms (in contrast to Bohr's model), but how is the radiation problem solved? I understand that the wave has not an exact position in the time anymore. But the electron still "moves", so it has an acceleration anyway (because of vibrations or so). Why is in this theory the electron not radiating anymore? And if it is, why doesn't the atom collapse? |
I am running Linux Mint 17 on my Laptop. Through the System Info GUI program, I found that the processor is Inter Core i3-2328M. When checking the System Monitor GUI program, it shows four CPUs numbered from 1 to 4. The say there are only two cores. What is the reason for the mismatch between the specs and the System Monitor? | When I go to the task manager I see 8 processors but I know that I have 4. Why? |
While importing a full database on a remote server : mysql -h foo < dump_file.sql, it returns ERROR 1153 ... Got a packet bigger than 'max_allowed_packet' bytes. But I don't have admin rights on that server to change my.cnf settings. The limit is 16Mb I tried to optimize the dump like following, without result : mysqldump --skip-extended-insert --net_buffer_length=10000 DATABASE_NAME > dump_file.sql Would it be helpful to use LOAD DATA INFILE Is there any possible syntax to use it without specifying INTO TABLE ... ? LOAD DATA INFILE dump_file.sql Or any other way to turn around that issue ? EDIT : previous question asks : Where do I change max_allowed_packet to be able to import the dump? Is there anything else I should set? when I merely know where to change max_allowed_packet, but I have not enough rights to do it. So I specifically asked how to do it with CLI only, and if it would be helpful or not to use LOAD DATA INFILE in my case, which is not at all in the other question. Whatever, duplicated or not, I got an answer who solved the issue. | I'm importing a MySQL dump and getting the following error. $ mysql foo < foo.sql ERROR 1153 (08S01) at line 96: Got a packet bigger than 'max_allowed_packet' bytes Apparently there are attachments in the database, which makes for very large inserts. This is on my local machine, a Mac with MySQL 5 installed from the MySQL package. Where do I change max_allowed_packet to be able to import the dump? Is there anything else I should set? Just running mysql --max_allowed_packet=32M … resulted in the same error. |
I have process explorer on my desktop, ho can I run it ALWAYS as Administrator? I read , and in particular, but it doesn't seem to work in this case. To run as Administrator all my apps as that OP was suggesting, is an overkill for me. I have Windows 8.1 64 bits. EDIT: As suggested by @Overmind I tried with a short cut, but it does not work; this is what I have in its Properties: In Avanzate (read Advanced), I have: Probably I should have written it before: I have an Home Edition, not a Pro. | The problem is, when I open applications I need to always right click, select run as admin. When I don't do it getting unexpected application errors. BTW, I turned off UAC. It's annoying. Is there any way to change behavior of double left-click to act as "Run as administrator" action? I mean to make "Run as administrator" action by default. Thx in advance |
I am trying to create a script whereby I have list of numerical test folders and want users to be able to cd into one of them after inputting the folder number. The script correctly concatenates the input but on running the script it does not actually execute the cd command to the required directory? It echo's to the screen but then just sits there as if awaiting a further prompt? Can anyone advise what I am missing please? Script 'chgdir' is as below: #!/bin/bash # # Script to move to test##dir (using input from user for dir number) echo "Enter test directory number as ## and hit Return" read dirnum echo "cd /home/John/test$dirnum""dir" However on running the script outputs the command to the screen but does not 'cd' and just remains in ~/bin? cd /home/John/test01dir John@John-PC ~/bin P.S I am completely new to bash scripting as you can tell so any help really appreciated. | I'm trying to write a small script to change the current directory to my project directory: #!/bin/bash cd /home/tree/projects/java I saved this file as proj, added execute permission with chmod, and copied it to /usr/bin. When I call it by: proj, it does nothing. What am I doing wrong? |
According to the formula $λ=h/mv$ for the De Broglie wavelength, as the mass increases, it becomes a greater coefficient to multiply the velocity by, and the larger number in the denominator makes the wavelength so small that it can't be detected for high mass objects. My physics teacher used this reasoning to explain how even large macroscopic objects may have their own wave functions, but are so small we can't really detect them. However, aren't all larger objects made of smaller ones? Like how molecules are made of atoms, and atoms are made of the elementary particles, and etc. Since this is the case, why can't we apply the λ=h/mv formula to all the particles that make up the atoms and molecules that are inside of say, a baseball, and average find the average of those waves? Since on average, half of those waves should be constructive, and the other half destructive, shouldn't the average of all the waves of the particles that make up the larger object be the true wavelength of the object? This obviously isn't the case though, since a baseball doesn't exhibit wave-like behavior. What's the flaw in my reasoning? Why don't high-mass objects behave like I expect them to? I tried to read the Wikipedia page on the wave-particle duality, but I still haven't been able to come to a conclusion. | Many introductory quantum mechanics textbooks include simple exercises on computing the de Broglie wavelength of macroscopic objects, often contrasting the results with that of a proton, etc. For instance, this example, taken from a textbook: Calculate the de Broglie wavelength for (a) a proton of kinetic energy 70 MeV (b) a 100 g bullet moving at 900 m/s The pedagogical motivation behind these questions is obvious: when the de Broglie wavelength is small compared to the size of an object, the wave behaviour of the object is undetectable. But what is the validity of the actual approach of applying the formula naively? Of course, a 100g bullet is not a fundamental object of 100g but a lattice of some $10^{23}$ atoms bound by the electromagnetic force. But is the naive answer close to the actual one (i.e. within an order of magnitude or two)? How does one even calculate the de Broglie wavelength for a many body system accurately? |
So, when I move (lets use a cube as an example,) I move two of the bottom vertices in said cube, it pushes the two vertices above it, causing the entire model to deform. My question, can I lock the two top vertices in place so there is no "pushing" when I move the bottom two? | My problem is that I sometimes lose the ability to independently translate or otherwise transform any parts of a single mesh. If I try, for example, to just translate several faces, edges, or vertices, then the entire mesh will stretch and displace itself in order to follow the translation. Or, alternatively, if I try to translate just one face then the whole mesh will move as if I'm translating in Object Mode. I'm not really sure I know how to describe this problem properly. I don't even know how to reliably reproduce it. It seems to happen to any given mesh at random, and it doesn't stop happening to that mesh unless I delete and remake it. I assume that I must be doing something wrong to cause this to happen. Does anyone have any ideas? Thanks. |
I'm new to Blender and I am making that famous doughnut. I seem to have accidentally made the icing layer transparent, meaning that it doesn't show up in Edit Mode and I cannot sculpt in Sculpt Mode. Instead, it ends up altering the doughnut underneath. How do I get my icing back? | I tried to follow the new Blender 2.8 tutorial from Blender Guru. When entering "Sculpting" with the icing there were suddenly alot of holes in it. Why is this? |
How to print the "A" and "D" that looks like the graphs? I tried to use \textit but it does not work? | I know what my symbol or character looks like, but I don't know what the command is or which math alphabet it came from. How do I go about finding this out? |
I have a 1990s vertik 2 it's the mountain bike one and I am wondering if I could convert the rim brakes to disc brakes if so what are good budget options | I've got an older, about 1991, model Cannondale SM1000 mountain bike purchased new. Would it be worth it to convert to disk brakes and if so what would be the process? |
If a proper noun (e.g. Google) is converted into a verb (e.g. Let me (G/g)oogle that for you), should it still be capitalized when used as a verb? I recognize that English has no such concept as a "proper verb," but writing a brand name like Google in lower case seems odd to me. | When a proper noun like "Skype" is used as a verb ("Skyping"), should it be capitalized? My thinking is that it should be capitalized because the root is a proper noun. Does anyone know of a rule about this question? |
We're using a custom preference center. Within the Cloudpage Landingpage I want to add a button to optout. I do understand I need to use the LogUnsubEvent function () to unsubscribe. I'm just not sure how to generate the needed JobId to pass to the function, when the click does not come from an actual email but from a landingpage button, which doesn't have a jobId? | In Salesforce Marketing Cloud (SFMC), I want to unsubscribe a contact from a single publication list by using a form on a landing page. I also want to create an Unsub event in SFMC when they submit the form. There is some sample code from SFMC Help documents that seems to do that for external sites. Will it work in a SFMC hosted landing page? Do I need to edit the code much? |
I have problem with documents generated in LaTeX with Cyrillic symbols. I created the following file: \documentclass{article} \usepackage[utf8]{inputenc} \usepackage[T2A]{fontenc} \begin{document} ЛаТеХ\\LaTeX \end{document} And when I copy text in Cyrillic alphabet, I obtain some gibberish on the clipboard, This makes my articles quite hard to quote. So my first question is, can I fix this and have proper copying process? Also if I anyway type certain text and look for it in the document, it is not found in the document, being absolutely clear, that this text is there: My second question is, can I make the document in such a way, that I can obtain returned the Cyrillic string, that I seek? All this doesn't happen, if the letters are Latin. The Cyrillic letters, however, cause these problems and at this point I cannot use LaTeX due to these restrictions. I will be happy to give further details, when needed. PS: I use "MikTex", pdfLatex+MakeIndex+BibTex. | One frequent aspect of pdflatex output that could be improved is to what extent one can select text output from the generated pdf-file and copy-and-paste it. This is essentially an issue of having the right output encoding. There are at least two important aspects to this: In the ideal case, Unicode would be the output encoding. Ligature glyphs (such as fi) are ideally de-ligated in the output (here: "fi"). It seems that output encodings are specified through the fontenc package. What is the range of possible output encodings, and most importantly: Is there a way to specify a Unicode output encoding and one that deals with ligatures in the intended way? (Note: It is important to distinguish output from input encodings. How to use different input encodings in LaTeX has been documented widely. My understanding is that this is best handled by the inputenx package, as it supersedes the inputenc package.) Quick guide to the solutions: The information in the answers and answer threads is a bit distributed, so here the short summary: one approach is to use \input glyphtounicode together with \pdfgentounicode=1; the other approach is to use cmap/mmap. Addendum: Sometimes one will need to load the package accsupp and enclose one's macro definition in \BeginAccSupp{method=hex,unicode,ActualText=<codepoint>}[...]\EndAccSupp{} to generate a specific code point. See the caveat about non-BMP code points and the fix (starting from accsupp version v0.4, 2012/11/18) , which provides the new unichar package option. |
in admin panel when I add a widget to the page the javascript doesn't execute. Here is code for my plugin: class Mosaic extends WP_Widget { // class constructor public function __construct() { $widget_ops = array( 'classname' => 'Mosaic', 'description' => 'Widget provides mosaic jquery.', ); parent::__construct( 'mosaic', 'mosaic', $widget_ops ); } // output the widget content on the front-end public function widget( $args, $instance ) { echo $args['before_widget']; echo $args['after_widget']; } // output the option form field in admin Widgets screen public function form( $instance ) { wp_enqueue_media(); ?> <ul id="sortable123"> <li class="ui-state-default">test1</li> <li class="ui-state-default">test12</li> <li class="ui-state-default">test122</li> </ul> <?php } // save options public function update( $new_instance, $old_instance ) {} } add_action( 'widgets_init', function(){register_widget( 'Mosaic' );}); function my_enqueue() { wp_enqueue_script( 'mosaic-js', 'mymosaic.js' ); } add_action( 'admin_enqueue_scripts', 'my_enqueue' ); wp_enqueue_script( 'mosaic-js', '/wp-content/plugins/mosaic/mymosaic.js', array( 'jquery' ), '0.0.1', true ); and javascript is simple, based on Jquery: jQuery( document ).ready( function( $ ) { $('.ui-state-default').click(function() { alert( "Handler click called." ); }); }); If I put it in javascript alert function, it works fine. But everything else, like click doesn't work, could you help me with the issue? | I have a bit of code where I am looping through all the select boxes on a page and binding a .hover event to them to do a bit of twiddling with their width on mouse on/off. This happens on page ready and works just fine. The problem I have is that any select boxes I add via Ajax or DOM after the initial loop won't have the event bound. I have found this plugin (), but before I add another 5k to my pages with a plugin, I want to see if anyone knows a way to do this, either with jQuery directly or by another option. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.