body1
stringlengths
20
4.1k
body2
stringlengths
23
4.09k
I'm trying to associate a button with a dynamic url with the following javascript: <script type="text/javascript"> var name = {{pp.name}}; var url = "{% url 'editproject' %}"; document.getElementById("myButton").onclick = function () { location.href = url + "/" + name }; </script> But I am getting an error when I try to click on the button. pp.name is a django variable that would return the name of the project, and the url I'm trying to access is path('editproject/<str:name>/', p.update, name="editproject"),
When I render a page using the Django template renderer, I can pass in a dictionary variable containing various values to manipulate them in the page using {{ myVar }}. Is there a way to access the same variable in Javascript (perhaps using the DOM, I don't know how Django makes the variables accessible)? I want to be able to lookup details using an AJAX lookup based on the values contained in the variables passed in.
Hi Can anyone tell me the regex for the below condition. "" or "" is valid. this should not allow any spaces before "http" , "https" and after "ef". There can be any text after "ef". but the validation should not match in the below case. " k" --> since space is present between j and k-> validation should fail " "-> since space is present in starting or trail -> validation should fail. simply to put [No spaces allowed][https:// or text or symbol].[any text or symbol for 2 words][optional text without no spaces in start or between or ending ]
How can I check if a given string is a valid URL address? My knowledge of regular expressions is basic and doesn't allow me to choose from the hundreds of regular expressions I've already seen on the web.
as a new user in ubuntu I cannot find the sleep mode in my ubuntu 18.04 so please tell me how can I do it!!!!!
In 17.04 I could suspend\hibernate from the power off menu button. I can't find how to do this in Ubuntu 17.10 GNOME Shell.
How can I check if a physical file is located in index file? For example: Let's say we have 5 files in the folder C:\Users. I have a file with a link to this location C:\Users\1.txt C:\Users\2.txt C:\Users\3.txt C:\Users\4.txt We can see that we are missing 1 file from C:\Users in that index file? How can I do it? If you could give me some way to do it, it would be great. Is it even possible to do such thing?
How do I check whether a file exists or not, without using the statement?
I'm new to SalesForce. What happens when the Convert button on the Lead Details page is clicked? I've read that The lead is marked as 'closed'. An Account object is created. An Opportunity tied to the Account is also created. Where is this workflow documented? Where can I see the code that does it? How can I intercept or extend this to create/re-parent other objects that need to lose their association to the lead and be associated with the new Account and Opportunity. When I explore Customize > Leads, there are no validation rules, triggers, assignment rules, processes, or whatnot that would lead me in the right direction (excuse the pun). I've also explored create > Workflow and Approvals to no avail. Is this covered in any of the Force.com Workbooks, or perhaps any 3rd party books. Mucho Puzzled. Edit (1): I found the following: which covers the general process. and this: This may help someone else looking for the same thing. Edit (2): Marked as duplicate I checked the referenced question regarding the order of trigger execution. In the context of this question, I do not care about the order of trigger execution; my question attempts to elicit what changes when a lead is connverted and how the process might be extended. The two links in Edit (1) answer the process side of the question and the mechanism by which the process can be extended.
I've got a project where I'm looking to tweak the standard lead conversion process. Triggers and lead conversion has always been funky in past projects so I was hoping to start the design off by reviewing the order of execution, but after a long google search I'm coming up empty handed. Anyone out there know the specific trigger order for lead conversion? Edit: I'm not asking about trigger execution order for any object, but all the objects created in the lead conversion process. I'd think it would be something like this: Lead Before Update Triggers (isConverted = false, convertedAccountId = null, convertContactId = null, convertedOpportunityId = null) Account Before Insert Triggers (not fired if merged with existing account) Account After Insert Triggers (not fired if merged with existing account) Contact Before Insert Triggers (not fired if merged with existing contact) Contact After Insert Triggers (not fired if merged with existing contact) Opportunity Before Insert Triggers (not fired if no opportunity) (OpportunityContactRoles null) Opportunity After Insert Triggers (not fired if no opportunity) (OpportunityContactRoles = convertedContactId) Lead After Update Triggers (isConverted = true, convertedAccountId = XXX, convertedContactId = XXX, convertedOpportunityId = XXX)
I am aware that questions related to the title of this post have already been posted but I think that the proof I'm looking for is a bit different. This proof uses the two following results which I was not able to prove either: 1) If $L$ is a finite algebraic extension of $\mathbb{Q}$ and $R \subseteq L$ a finitely generated $\mathbb{Z}$-algebra, there exist positive integers $n_1,...,n_k$ such that $R$ is integral over $\mathbb{Z}[\frac{1}{n_1},...,\frac{1}{n_k}]$. 2) If $\mathfrak{m}$ is a maximal ideal of $\mathbb{Z}[X_{1},...,X_k]$ it must contain a prime number $p\in \mathbb{Z}$. And then deduce the theorem from the title.
Suppose $k$ is a field that is finitely generated as a ${\mathbb Z}$-algebra. (That is, $k$ is a quotient of ${\mathbb Z}[X_1,\dots,X_n]$ for some $n$). Does it follow that $k$ is finite?
For how many distinct congruence classes $[a]$ modulo $631$ will there be integer solutions $x$ to the congruence $x^2 \equiv a \pmod{631}$?
So I'm trying to find all solutions of $x^2 \equiv$ $a$ mod $p$ and for some reason the formulas that are suggested everywhere online (for example, ) say that, if p is an odd prime and you have a congruence like this: Then you can find the solutions with this (if there are any): That's what I was taught as well, but when entering examples into Wolfram Alpha, I've noticed that there are actually more solutions - these formulas just give you one of them! For example: If I need to find the solutions of: x^2 ≡ 8 (mod 23) and I use the above formulas, I get the solution: x = +- 13, but (and it does). So why is that? Why do these formulas only give you 1/2 of the answer and why can't I find a way to find the whole answer (excluding the way where you draw the table with x^2 mod p for x from 0 to p and)? I realize that I'm probably doing something wrong and I'm not very good at this in the first place, but I've spent hours searching for an answer and couldn't really find anything (that I could understand, at least).
We have a sequence: $$a_n=\frac{1}{1}+\frac{1}{2}+\frac{1}{3}+...+\frac{1}{n}$$ We need to show that it is rising and above unbounded. So I did the following: $$a_{n+1}=a_n+\frac{1}{n} $$ $$a_{n+1}>a_n $$ $$a_n+\frac{1}{n}>a_n $$ $$\frac{1}{n}>0$$ $$n>0$$ Which holds. First question: Is the upper proof enough to satisfy that the sequence is rising As far as I understand, I need to also now show that supremum doesn't exist. So I have done the following: $$ \sup{a_n}=\lim{a_n} = M $$ $$M>0$$ $$M>a_n$$ for every $n$ $$a_n+\frac{1}{n}<M$$ $$1<(M-a_n)n $$ Because $M>a_n$ we can divide without sign direction change So we get: $$\frac{1}{M-a_n}<n$$ Which I think isn't the end of the proof. I do not know how to continue.
Can someone give a simple explanation as to why the $$\sum_{n=1}^\infty\frac1n=\frac 1 1 + \frac 12 + \frac 13 + \cdots $$ doesn't converge, on the other hand it grows very slowly? I'd prefer an easily comprehensible explanation rather than a rigorous proof regularly found in undergraduate textbooks.
Count the number of topological sorts for each partially ordered set $(A,|)$, where (a) $A = (3, 5, 7, 11, 13, 16, 17)$ (b) $A = (1, 3, 9, 27, 81, 243)$ That is, you have to find the number of ways to order the elements of the set A so that the partial order imposed by divisibility is preserved. Edit: I got the answer 7 choose 1 which is 7 for a) and 6 choose 6 which is 1 for b), is that correct?
can someone please explain to me how to count the number of topological sorts for poset(A|) where A = {2,3,4,8,9,16,27,81} ? Quick example would be nice. Please help...I have an exam in several hours. Thanks !
, and the comments to it, had me read the to figure out whether /dev/stdin, /dev/stdout and /dev/stderr were actually needed for conformance to the POSIX standard. It turns out they are not: The system may provide non-standard extensions. These are features not required by POSIX.1-2008 and may include, but are not limited to: [...] Additional character special files with special properties (for example, /dev/stdin, /dev/stdout, and /dev/stderr) As far as I can find, this is the only mentioning of these files in the standard. I have access to only one "system" (environment, really) which does not implement them, and that's MinGW on Windows (no /dev at all as far as I can see). As far as I know, all the free Unices have them, and so does Cygwin, Windows' new Linux environment and Darwin/macOS. I'm not well versed with the commercial Unices though. Is there a POSIX system, Unix, or a Unix-like environment of some description, alive today, that does not implement /dev/stdin, /dev/stdout, and /dev/stderr as files in the filesystem?
Occasionally I need to specify a "path-equivalent" of one of the standard IO streams (stdin, stdout, stderr). Since 99% of the time I work with Linux, I just prepend /dev/ to get /dev/stdin, etc., and this "seems to do the right thing". But, for one thing, I've always been uneasy about such a rationale (because, of course, "it seems to work" until it doesn't). Furthermore, I have no good sense for how portable this maneuver is. So I have a few questions: In the context of Linux, is it safe (yes/no) to equate stdin, stdout, and stderr with /dev/stdin, /dev/stdout, and /dev/stderr? More generally, is this equivalence "adequately portable"? I could not find any POSIX references.
I have made a rig for a model, however the main torso piece does not attach to the rig due to this error. I have sought out various solutions but none seem to work. Does anyone know the issue?
Here is the . Picture: It's nothing special but I cant figure out why I get problems rigging this mesh. It would be important and a great Help! Thanks for reading and I know there are a lot of guides answering this question but I tried all and it doesn't seem to work.
I noticed something funny. If you differentiate $x^x$ treating the exponent as a constant, you get $xx^{x-1}=x^x$. If you treat the base as a constant, you get $x^x \ln{x}$. If you add these two bizzare and incorrect derivatives of $x^x$, you get $x^x(1+\ln{x})$, which is correct! Is it merely a weird and funny coincidence or is it a part of a deeper result? (I'm checking it for $(x^x)^x$, but it will take a while :) )
Suppose we're tying to differentiate the function $f(x)=x^x$. Now the textbook method would be to notice that $f(x)=e^{x \log{x}}$ and use the chain rule to find $$f'(x)=(1+\log{x})\ e^{x \log{x}}=(1+\log{x})\ x^x.$$ But suppose that I didn't make this observation and instead tried to apply the following differentiation rules: $$\frac{d}{dx}x^c=cx^{c-1} \qquad (1)\\ \frac{d}{dx}c^x = \log{c}\ \cdot c^x \quad (2)$$ which are valid for any constant $c$. Obviously neither rules are applicable to the form $x^x$ because in this case neither the base nor the exponent are constant. But if I pretend that the exponent is constant and apply rule $(1)$, I would get $f'(x)\stackrel{?}{=}x\cdot x^{x-1}=x^x.$ Likewise, if I pretend that the base is constant and apply rule $(2)$ I obtain $f'(x)\stackrel{?}{=}\log{x}\cdot x^x$. It isn't hard to see that neither of the derivatives are correct. But here's where the magic happens: if we sum the two “derivatives” we end up with $$x^x+ \log{x}\cdot x^x=(1+\log{x})\ x^x$$ which is the correct expression for $f'(x)$. This same trick yields correct results in other contexts as well. In fact, in some cases it turns out to be a more efficient way of taking derivatives. For example, consider $$g(x)=x^2 = \color{blue} x\cdot \color{red} x.$$ If we pretend the blue $\color{blue} x$ is a constant we would get $g'(x)\stackrel{?}{=}\color{blue}x\cdot 1=x$. Now if we pretend the red $\color{red}x$ is constant we get $g'(x)\stackrel{?}{=}1\cdot \color{red} x=x$. Summing both expressions we end up with $2x$ which is of course a correct expression for the derivative. These observations have led me to the following conjecture: Let $f(x,y)$ be a differentiable function mapping $\mathbb{R}^2$ to $\mathbb{R}.$ Let $f'_1 (x,y)=\frac{\partial}{\partial x} f(x,y)$ and $f'_2 (x,y)=\frac{\partial}{\partial y} f(x,y)$. Then for any $t$ we have: $$\frac{d}{dt}f(t,t)=f'_1 (t,t) + f'_2 (t,t).$$ (I apologise for the somewhat awkward notation which I could not seem to get around without causing undue ambiguity.) This formulation also seems to lend itself to following generalisation: Let $f:\mathbb{R}^N \to \mathbb{R}$ be a function differentiable in each of its variables $x_1,x_2,\ldots,x_N$. For $n=1,2,\ldots,N$ define $f'_n(x_1,x_2,\ldots,x_N)=\frac{\partial}{\partial x_n}f(x_1,x_2,\ldots,x_N)$. Let $t$ be any real number and define the $N$-tuple $T=(t,t,\ldots,t)$. Then one has: $$\frac{d}{dt} f(T)=\sum_n f'_n(T).$$ Thus my question is: Is this true? How can it be proven? (Specifically in the case $N=2$ but also in the general case.)
All the new communities that I join are using my oldest profile (Tex/LateX.SE) but I would rather they link to my profile at Math.SE. Is there a simple way to accomplish that? I navigated the site but could not find a way to do so. This is not the same as as this one here does not ask about the Network Profile, but rather creating new "ordinary" accounts across Stack Exchange.
My oldest account on the network is Area 51, followed by Mi Yodeya. I recently filled out the "about me" section on Mi Yodeya (but nowhere else) and did not choose the "update all sites" option because my blurb is pretty specific to that site. I intended to have that blurb on exactly one site. I was surprised tonight to discover that that blurb is now on my network profile, where I see no "edit" link. Am I stuck with either having a site-specific blurb as my network blurb (because it's my first non-Area-51 site) or rewriting it to be more general? Or is there some way that I can independently edit the network profile? (Or designate a different site as the default?) shows that someone else had this problem too, but I'm asking for support, not for a new feature, so I'm asking this separately.
How to center text vertically in this table? \begin{center} \begin{tabularx}{\linewidth}{ | c | X | X | } \hline \textbf{Date} & \textbf{Name} & \textbf{Sign} \\ \hline 31.03.2013 & & \\ \hline \end{tabularx} \end{center} Changing package is not a solution for me. How to do it in tabularx?
I'd like to create a new column type which works exactly like a X column from tabularx but that also has the text vertically centered. I tried with the newcolumntype command but I can't figure out where to put the second column type? Example: \newcolumntype{n}{>{\centering\arraybackslash}X} Where should I put the mto specify that the cells content should be vertically centered?
Steps: Search via tag search for something Touch into a question Press system back key Results: Search is cleared out. Tag list displayed Expected results: Same search displayed prior to reading a question App Version: 1.0.95 Device Manufacturer: Samsung Device Model: SM-G950U OS Version: 7.0 (G950USQU1AQGA)
This looks a little bit like a variation on but specific to the tags view. Reproduction (app version 1.0.71): Select any site (say Meta) from the sidebar Switch to the tags view using the top bar Choose a tag, any tag ( is nice) optionaly refine your search with more terms Go to any question found, go back you end on the unfiltered tags view Go back again lucky you, your search is here
I'm a little confused over which way to install Ubuntu 12. I've been running it in a virtual machine for a while now and I want to make the switch from Windows. I'd like to have a dual boot, with a large portion of disk space given over to Ubuntu so I can wean myself off Windows. There seem to be so many ways to install it that I'm getting a bit lost. A link to the correct page would be much appreciated.
I need my pre-installed version of Windows 7 (or any other version of Windows), how could I install Ubuntu without erasing it?
I'm just putting the finishing touches on the 9th iteration of my self-designed RPG system (with its own setting), and though it was woefully rocky in its early days I think that it's really coming together well. I'm running a handful of pbp games in v8.3, and have collected some encouraging data, and v9.0 is really feeling close to my initial vision. Now, however, I'd like to see the game tested from a GM's point of view. When 9.0 is fully written up I'd like to find a group to pick up and use the materials with my input being limited to observation, and question fielding. Do groups exist who like to playtest different systems? I can't imagine it's the world's most attractive pitch to try someone's homebrew pet project, but I also think this one stands up. If so, how or where do I find them? Again, I'm keen to hand off the entire system to another GM with his/her own players, observe, and be available in whatever capacity becomes necessary. I'd consider this the next step after GMing playtests myself. And I'd be looking specifically for an online venue, as being based in New Zealand doesn't lend itself to large-scale conventions or the like.
Obviously the first tester group would be your own group. But beyond that? It would seem to make sense to have at least more than one group test out your game, as different groups want different things and play differently. Fresh eyes find different bugs, etc. etc. Are there resources out there to help aspiring game designers without a lot of contacts find people willing and eager to test out their game? Or is this in essence a "" issue? To clarify my own situation: I have the mechanics finished. The setting is still under development, but in accordance with the motto "fail faster" I want to go ahead and test the mechanics (in a different setting for now) to see if they work and are fun or if I need to go back to the drawing board. I have a sort-of group, but I don't know them very well and they don't meet often, and so I'm not excited about the prospect of presenting the mechanics to them right now (as I'm sure there are a dozen issues I've overlooked). Also, I'd like to test the game (including the setting, later) on more than one group, as mentioned above. I've put out some feelers among my current friends and acquaintances, but nobody's really been excited about playtesting or even really giving in-depth feedback, and I don't want to be that person who's always shoving their project in your face. I'm willing to run something online as well. I'm also interested in having others run a game without me present, and giving me their feedback. Also, I'm looking for something of a guide-type answer that might help someone besides just me.
doesn't show questions. The page loads, it stops downloading, it looks like the normal page, but no questions. Actually, a few stackexchange sites have this problem. Sometimes it works, sometime it doesn't.
On Stack Overflow the last question was asked approx 1 hour ago. It is not getting updated. Since the volume of the users are a lot, I can't believe that nobody has asked question since last 1 hour. I think there is some problem. Please look into it. Edit : Now it is showing lastest question as 30 mins ago. But on the other hand same kind of problem is started on meta site. The active tab is not getting refresh with current discussing question.
I encountered a problem decoding text files. Encryption works, but when the program is restarted, decryption throws an exception. The same similar Exception was thrown with apache.common.Base64. Maybe someone knows how to solve this? private String decrypt(String encrypted) throws Exception { Cipher cipher = getCipher(Cipher.DECRYPT_MODE); //byte[] plainBytes = cipher.doFinal(Base64.decodeBase64(encrypted)); /*this line throw an exception*/ byte[] plainBytes = cipher.doFinal(Base64.getDecoder().decode(encrypted)); return new String(plainBytes); } private Cipher getCipher(int cipherMode) throws Exception { String encryptionAlgorithm = "AES"; SecretKeySpec keySpecification = new SecretKeySpec( encryptionKey.getBytes("UTF-8"), encryptionAlgorithm); Cipher cipher = Cipher.getInstance(encryptionAlgorithm); cipher.init(cipherMode, keySpecification); return cipher; } Exception in thread "main" java.lang.NullPointerException at java.util.Base64$Decoder.decode(Base64.java:549) at edmaker.EdMaker.decrypt(EdMaker.java:148) Listening on javadebug Not able to submit breakpoint MethodBreakpoint [fsiteratetest.FsIterateTest$1].visitFile '(Ljava/nio/file/Path;LBasicFileAttributes;)Ljava/nio/file/FileVisitResult;', reason: Breakpoint belongs to disabled source root 'C:\Users\win7p\Documents\NetBeansProjects\FsIterateTest\src'. See Window/Debugging/Sources. User program running User program stopped Debugger stopped on uncompilable source code. User program running User program finished
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?
This is related to , I want to find the values for the two resistors so that the led will get 100mA. Vcc will be 5V and I have either 2N2222 or 2N3904 transistors. Let's say I use the 2N3904. They mention the equation: hFE(VCC-VBE)/RB. (Is the full equation hFE(VCC-VBE)/RB = ICC?) I tried to plug in the values: Vcc = 5, Hfe = 30 (from the sheet), VBE = 40*10^-3R since the arduino's pwm output is 40mA and from ohm's law, ICC = 100mA (the desired current for the led). so we get: 30*(5-40*10^-3R)/R = 100*10^-3 => R = 3.3/(100*10^-3/30 + 80*10^-3) = 39.6. This is not even close to 1000 like in the answer, so I'm doing something wrong here. So how are you supposed to find the B line resistor value? Also, how do you find the C line resistor value? This is the led I will use btw: "Arduino" is Arduino UNO for now (Wemos D1 mini later). I don't think it's a duplicate since my circuit is a little different and what I ask for is different. I also have no idea what is that ...
I have 3 12VDC/40A automotive relays () that I want to use with my Arduino. Based on the tutorial I am following () I need transistor, resistor, and diode. I am not an electrical engineer therefore I am unsure about the parts and calculations I made. For the start, relay coil resistance is 90+-10% Ohm per datasheet. So I proceed by calculating the current flow. Voltage=Resistance*Current Current=Voltage/Resistance Current=12V/90 Ohm Current = 133mA For the transistor I can get 2N3904 or 2N4401. At this point I have to calculate resistance for the base of transistor. In tutorial its as following hfe = Ic / Ib Ib = Ic / hfe Ib = 0.03 A / 75 Ib = 0.0004 A => 0.4 mA R1 = U / Ib R1 = 5V / 0.0004 A R1 = 12500 Ohm 2N3904 datasheet states the H(fe) is 30-300 when lc = 100mA (mine is 130mA) and Vce = 1V. At this point I have no clue what is going on, thus I need help. Edit: Here is what I ended up with. RLY1 in the picture is 12VDC/40A ()
Do you have a euro? I saw the above sentence and do not understand why you say "a" instead of "an"? You say Do you have "an" umbrella?, but Do you have "a" pound?
In the following example, is it appropriate to use a or an as the indefinite article, and why? He ate __ green apple. I know that in the case of just "apple", it would be "an apple," but I've heard conflicting answers for "green apple," where the noun is separated from the article by an adjective. Also, which is more appropriate in this case: He ate __ enormous Pop-Tart.
Is a length padding technique in a hash function used to avoid length extension attacks ?
I understand the need for padding in MD5. But why do we append the message length to the padding? I heard it strengthens the hash but how? Please provide an example if possible and how it applies to this quote: The inclusion of the length-block effectively encodes all messages such that no encoded input is the tail end of any other encoded input. Why a message being the tail of another message is bad (if it is)?
To show this proposition holds, I need to assume $\phi$ is a theorem, i.e. there is a derivation where the set of hypothesis is empty and its conclusion is $\phi$. I need to prove $\psi \to \phi$ is a theorem, i.e. there is a derivation where the set of hypothesis is empty and its conclusion is $\psi \to \phi$. Is my understanding correct ? How can I start filling the details of this proof ? P.D.: The book I am using is "Logic and Structure" by Dirk Van Dalen.
Apparently, according to the Conditional Introduction rule, this is valid: Prove $C \to A$ Source: Page 5 So before this, the way I viewed the CI rule, was that it allowed us to prove that if we assume the antecedent is true, we can prove the consequent can derived from the antecedent, by referring to the premises which lead to the consequent. If later we find that the antecedent is true, then we can conclude what we already done so before when we just assumed. So basically, sub derivations are inactive at first, but activated if the assumption of said sub derivation is confirmed. In this example, it's basically stating that the mere assumption of some proposition is enough to state that it applies to some other already proven proposition. It's like you might as well skipped over the sub derivation and said, 'Given $A, C \to A$ because I want it to'. Personally, I think this is a mistake, though if not, I can't see how you could justify that $C \to A$ given $A$ and assuming $C$ is true alone.
I have created a custom Git Hook for "commit-msg" which says I should add a specific text for the commit message, I want this hook to be a part of my git repo centrally so that whoever clones the repo should get this hook in his local. I am not able to push this hook as part of the git add/commit/push command, could anyone let me know if it possible to add hook? how to push git hook to remote repo? Thanks, Abhishek
We'd like to make a few basic hook scripts that we can all share -- for things like pre-formatting commit messages. Git has hook scripts for that that are normally stored under <project>/.git/hooks/. However, those scripts are not propagated when people do a clone and they are not version controlled. Is there a good way to help everyone get the right hook scripts? Can I just make those hook scripts point to version controlled scripts in my repo?
Using QGIS 2.14.2 after installing qgis2web, the app doesn't appear in the plugin tab, even though all the files were successfully downloaded and verified in the python plugin directory. Other plugins I downloaded have installed just fine. Tried uninstall and install again, tried reinstalling, tried quitting and restarting qgis, still no app.
I would like to know how and where I can download qgis2web Plugin. I use QGIS with 2.10.1 version.
I'm trying to implement a Splash Screen on my application but I'm getting this error: A first chance exception of type 'System.InvalidOperationException' occurred in System.Windows.Forms.dll from this function: (if matter, it's part of a single instance application implmentation, take from ) protected override void WndProc(ref Message m) { if (m.Msg == NativeMethods.WM_SHOWME) { ShowMe(); } base.WndProc(ref m); } I modified my program.cs to like this: Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new SplashScreen(new Form1())) And here's SplashScreen class: public partial class SplashScreen : Form { Form1 mainForm; public SplashScreen(Form1 mainForm) { InitializeComponent(); this.mainForm = mainForm; backgroundWorker1.RunWorkerAsync(); } private void SplashScreen_Load(object sender, EventArgs e) { } private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e) { if (mainForm.InvokeRequired) mainForm.BeginInvoke(new Action(initMainForm)); else initMainForm(); //mainForm.Show(); } private void backgroundWorker1_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { this.Close(); } void initMainForm() { mainForm.Show(); } } UPDATE: stack trace: System.InvalidOperationException: DragDrop registration did not succeed. ---> System.Threading.ThreadStateException: The current thread must be defined in STA mode (single thread apartment) before OLE calls can be made. Check if the Main function has STAThreadAttribute marked. em System.Windows.Forms.Control.SetAcceptDrops(Boolean accept) (note: the error message isn't written in english but in my native language so I translated it myself. Sorry for any error.) Why am I getting that error and hwo do I fix this?
I still have a problem with the splash screen. I don't want to use the property SC.TopMost=true. Now my application scenario is as follows: in progeram.cs: [STAThread] static void Main() { new SplashScreen(_tempAL);// where _tempAL is an arrayList Application.Run(new Form1(_tempAL)); } in SplashScreen class: public SplashScreen(ArrayList _Data) { DisplaySplash() } private void DisplaySplash() { this.Show(); this.TopMost = true; this.CenterToScreen(); this.SetTopLevel(true); _allServerNarrators = new string[10]; for (int i = 0; i < _allServerNarrators.Length; i++) _allServerNarrators[i] = null; GetFromServer(); this.Hide(); _serverData = new ArrayList(); _thisData.Add(_allServerNarrators); _thisData.Add(_serverNarrators); } private void GetFromServer() { _serverNarrators = new ArrayList(); string _file = "Suras.serverNar"; if (!Directory.Exists("c:\\ASGAQuraan")) Directory.CreateDirectory("c:\\ASGAQuraan"); while (counter < 4 && _serverFiles == null) { if (Download("c:\\ASGAQuraan", _ftpServerIP, _file)) { StreamReader _strReader = new StreamReader ("c:\\ASGAQuraan\\"+_file,System.Text.Encoding.Default); string _line = _strReader.ReadLine(); string _word; while (true) { while (_line != null) { _word = _line.Substring(0, _line.IndexOf("*")); int _narId = Convert.ToInt32(_word); _line = _line.Substring(2); int k = 0; _serverNarratorNode = new ArrayList(); while (true) { int ind = _line.IndexOf("*"); if (ind > 0 && ind < _line.Length) { string str = _line.Substring(0, (ind)); if (k == 0) { _allServerNarrators[_narId] = str; _serverNarratorNode.Add(str); } else { _serverNarratorNode.Add(str); } _line = _line.Substring(ind + 1); k++; } else { _line = null; break; } } _serverNarrators.Add(_serverNarratorNode); _serverFiles = "added"; } _line = _strReader.ReadLine(); if (_line == null) { break; } } } else counter++; } } What I want is something in the splash screen class which waits until the thread finishes. For more details, please tell me what I need to tell you.
I was wondering if anybody else wanted to create a Stack Exchange site on Cubing.
I have an idea or subject that should have a Q&A, and want to propose a new site. How can I do this? Related:
I need to restart my machine which I do not have physical access due to COVID. I enabled disk encryption on my Ubuntu when I installed it back when things were normal. Every-time I needed to restart the machine I was in the office to enter the password to decrypt the disk. I now work from home and I do not have the luxury to go the office any time soon. Because of Nvidia driver mismatch, I need to restart my machine for that problem to go away. As you might know, I will lose my machine due to the disk password prompt which holds the machine from completing the booting process. Is there a way to disable the disk encryption password prompt remotely? I have full access from my SSH and I also have root permissions. Thanks in advance
I recently installed Ubuntu 12.10 and it requires a passphrase to boot up (I installed it with an encrypted file system). Do I have to reinstall to change to a standard unencrypted file system?
I have a Debian 10.0 system. It has GNU bash, version 5.0.3(1)-release (x86_64-pc-linux-gnu). In Bash prompt, I type foo bar baz Then I type alt + backspace two times. The words baz and bar get deleted and only foo remains. Then I type ctrl + / two times to undo the deletions. The words baz and bar reappear. How is ctrl + / working as the undo command? I don't see it defined anywhere? $ echo / | grep -E "/|undo" # just testing my regex / $ bind -p | grep -E '/|undo' "\e/": complete-filename "\C-x/": possible-filename-completions "/": self-insert "\C-x\C-u": undo "\C-_": undo
I have a Debian 10.0 system. It has zsh 5.7.1 (x86_64-debian-linux-gnu). In ZSH prompt, I type foo bar baz Then I type alt + backspace two times. The words baz and bar get deleted and only foo remains. Then I type ctrl + / two times to undo the deletions. The words baz and bar reappear. How is ctrl + / working as the undo command? I don't see it defined anywhere? $ echo / | grep -E "/|undo" # just testing my regex / $ bindkey -l .safe command emacs isearch main vicmd viins viopp visual $ bindkey -M .safe | grep -E "/|undo" $ bindkey -M command | grep -E "/|undo" $ bindkey -M emacs | grep -E "/|undo" "^X^U" undo "^Xu" undo "^_" undo I also have a macOS Catalina 10.15.7 with zsh 5.7.1 (x86_64-apple-darwin19.0) and ctrl + / does not do anything there.
A certain police officer stops cars for speeding. The number of red sports cars she stops in one hour is a Poisson process with rate 4, while the number of other cars she stops is a Poisson process with rate 1. Assume that these two processes are independent of each other. Find the probability that this police officer stops at least 2 ordinary cars before she stops 3 red sports cars. How do you solve it by binomial or by poisson? My initial response was to consider p = 1/5 How do you solve poisson process problems in which you need to calculate the probability of one event before another? In this case, the probability of 2 ordinary cars before 3 sports cars. By poisson, I tried calculate the event of 2 ordinary cars and event of 3 red sports cars. What I can't understand is one event before another logic. Can we do these problems by binomial?
Next weekend you will be participating in 12km cross country race on a mountain.The average time between two successive wild animal sightings on the mountain is reported to be 5 minutes (a) What is the probability that you see at least one wild animal in the 11th minute of the race given that you will see 3 wild animals since the start of the race? (b) What is the probability that it will take more than a quarter of a hour before you see a wild animal after ten minutes of running? Now I have attempted (a) , but I don't know whether my thinking is correct. (b) on the other hand makes little sense to me. My attempt: (a)$ X~ Poisson(\frac{1}{5})$ and $Y~Exponential(\frac{1}{5})$ $Pr(X>4) = Pr(X>1)$ (I am thinking that this is some variation of the memoryless property) $Pr(X>1) =Pr(Y<1)$ $Pr(Y<1)= 1 - (e^{(\frac{-1}{5})})$ Perhaps, I was a bit to vague in my attempt of (a). So here goes my attempt of(b).From my understanding of the question , it is asking what it the probability that the time between events(in this case animal sightings) is more than 25 minutes given you have been running for ten minutes Now from what I know the fact that you have been running ten minutes is irrelevant this is due to memory-less property of the exponential distribution so without further ado I present my attempt at (b) let $X $ be exponentially distributed random variable with $\lambda = 1/5$ then $Pr(X >15) = 1 - Pr(X <= 15)$
I am replacing string content as: re.sub(all, val, parsedData['outData']) where all contains some round braces and might contain other characters. >>> print all PICDSPVERS="DspFw:1.0008(1.0008),Fpga1:2.0925(2.0925),Fpga2:1.0404(1.0404),Mcu:1.0000(1.0000)" Because of which matching fails. The pattern is coming from some interface, so I don't want to put \\ in the data. I tried with 'r' and re.U option also, but still the match fails. re.search('PICDSPVERS="DspFw:1.0008(1.0008)', parsedData['outData']) How can we direct Python to treat a matching pattern as a string? I am using Python 2.x.
I want to use input from a user as a regex pattern for a search over some text. It works, but how I can handle cases where user puts characters that have meaning in regex? For example, the user wants to search for Word (s): regex engine will take the (s) as a group. I want it to treat it like a string "(s)" . I can run replace on user input and replace the ( with \( and the ) with \) but the problem is I will need to do replace for every possible regex symbol. Do you know some better way ?
I have a top down game. The player moves the avatar with WASD where W rotates the avator to 180, S rotates to 0, A rotates to 90 and D rotates to 270. I also do diagonal movement so if they hold SA it rotates to 45, WA it rotates to 135, WD it rotates to 225, and SD it rotates to 315. I smoothly rotate from the current rotation to the hardcoded desired rotation based on those key combo's. Of course what happens is if I'm rotating from anything > 180 to 0 it goes the long way back to 0. So if I'm at 270 rotation and I press S key it sends it back to 0 but that goes from 270 to 0 vs going from 270 to 360 which would result in the same end result but how it got there would be shorter. I was looking at this () and trying to translate it but it's not working. Below is my translation. function Script:CalcShortestRot(current, target) --if current == target then return from end local dist = target - current + 180 dist = dist - math.floor(dist / 2 / 180) * 2 * 180 - 180 System:Print("Dist = "..dist) if dist < 0 then System:Print("Value 1 = "..target - current) return current - dist else System:Print("Value 2 = "..current + target) return current + dist end end The usage is: -- determine the model rotation based on direction we are going if move > 0 then if strafe > 0 then self.targetRot = self:CalcShortestRot(self.targetRot, 225) --self.targetRot = 225 elseif strafe < 0 then --self.targetRot = 135 self.targetRot = self:CalcShortestRot(self.targetRot, 135) else --self.targetRot = 180 self.targetRot = self:CalcShortestRot(self.targetRot, 180) end elseif move < 0 then if strafe > 0 then --self.targetRot = 315 self.targetRot = self:CalcShortestRot(self.targetRot, 315) elseif strafe < 0 then --self.targetRot = 45 self.targetRot = self:CalcShortestRot(self.targetRot, 45) else --self.targetRot = 0 self.targetRot = self:CalcShortestRot(self.targetRot, 0) end elseif strafe > 0 then --self.targetRot = 270 self.targetRot = self:CalcShortestRot(self.targetRot, 270) elseif strafe < 0 then --self.targetRot = 90 self.targetRot = self:CalcShortestRot(self.targetRot, 90) end self.rot = Math:Curve(self.targetRot, self.rot, self.damping) EDIT: updated my CalcShortestRot() function per comments below but still not working. It spins all around
Below is a section of my code which handles a player's sprite rotating towards an angle after a user touches the screen: touchState = TouchPanel.GetState(); Vector2 touchPosition; if (touchState.Count > 0) { touchPosition = new Vector2(touchState[0].Position.X, touchState[0].Position.Y); targetPosition = Math.Atan2(player.Position.X - touchPosition.X, player.Position.Y - touchPosition.Y); if (angle_radians < targetPosition) { angle_radians += 2 * fps; } if(angle_radians > targetPosition) { angle_radians -= 2 * fps; } player.Angle = angle_radians * -1; } The problem I'm having is that when the angle goes past a certain point (I believe 3.15 radians?), the logic no longer functions correctly and the sprite reverses direction in a 360 circle until it meets the target position again. I know there is something I'm missing from this logic, and I can see the problem, but I'm not sure how to approach handling it. How would I prevent the sprite from reversing direction? Thanks EDIT: I tried the solution below but I only receive a positive number from 0-6 for angle_distance, what have I done wrong? if (touchState.Count > 0) { touchPosition = new Vector2(touchState[0].Position.X, touchState[0].Position.Y); targetPosition = Math.Atan2(player.Position.X - touchPosition.X, player.Position.Y - touchPosition.Y); angle_distance = targetPosition - angle_radians + Math.PI; angle_distance = angle_distance - Math.Floor(angle_distance / 2 / Math.PI) * 2 * Math.PI; if (angle_distance < 0) { angle_radians -= 2 * fps; } if (angle_distance > 0) { angle_radians += 2 * fps; } player.Angle = angle_radians * -1; } EDIT: I now realise my mistake, correct solution is below if (touchState.Count > 0) { touchPosition = new Vector2(touchState[0].Position.X, touchState[0].Position.Y); targetPosition = Math.Atan2(player.Position.X - touchPosition.X, player.Position.Y - touchPosition.Y); angle_distance = targetPosition - angle_radians + Math.PI; angle_distance = angle_distance - Math.Floor(angle_distance / 2 / Math.PI) * 2 * Math.PI; if (angle_distance < Math.PI) { angle_radians -= 2 * fps; } if (angle_distance > Math.PI) { angle_radians += 2 * fps; } player.Angle = angle_radians * -1; }
Suppose square matrix $A$ with order-n, and $A^*$ is it's adjugate matrix, when $n>2$, prove: $\left(A^*\right)^*=\left|A\right|^{n-2}A$ Proof: when $A$ is invertible, $A^{-1}=\frac{1}{|A|}A^*$, so $A^*=|A|A^{-1}$, and then \begin{align} \left(A^*\right)^* = \left|\left(|A|A^{-1}\right)\right| \left(|A|A^{-1}\right)^{-1} = \left|A\right|^n\left|A\right|^{-1}A|A|^{-1} = \left|A\right|^{n-2}A \end{align} how about the case $A$ is not invertible? $|A|=0$, then seems we should show $\left(A^*\right)^*=0$
I had my exam of linear algebra today and one of the questions was this one. Given $ A \in \mathbb{R}^{n \times n}$, prove that: $$\mathrm{adj}(\mathrm{adj}(A)) = (\mathrm{det}(A))^{n-2} \cdot A.$$ Of course I was not able to prove this identity, otherwise I wouldn't post it here. But I'm still curious how one can prove this identity. Could someone point me in the right direction?
Consider $5x+3y=4$ and $3x+6y=1.$ List the set of primes for which this system of linear equations does not have a solution in the field $Z_p.$
Let $p$ be a prime and consider the field $\Bbb Z_p$. List the primes for which the following system of linear equations does not have a solution in $\Bbb Z_p$: $$ \begin{align} 5x + 3y &= 4 \tag{1}\\ 3x + 6y & = 1\tag{2} \end{align}$$ My try is as follows: Determinant of the coefficient matrix is $21$. $21$ will be 0 if $p=3$ or $7$. So the answer will be $3$ and $7$. is it correct?
I have a Java task where I have to create a splay tree which requires me to find the parent and grandparent node of the node I am accessing. To do this, I've chosen to create a findParent method. Here is my Node class. public class Node<T> { public T elem = null; public Node<T> left = null; public Node<T> right = null; public Node(T elem) { this.elem = elem; } public String toString() { String out = elem.toString(); out += " [L: "+ (left == null ? "null" : left.elem) + "] "; out += " [R: "+ (right == null ? "null" : right.elem) + "] "; return out; } } I am not allowed to change the Node class. My SplayTree class is made up of these nodes and inside the SplayTree class, I have my findParent function. public Node<T> findParent(Node<T> A) { Node<T> P = root; if (P.left == A || P.right == A) { return P; } else if (A.elem.compareTo(P.elem) < 0) { P = P.left; } else { P = P.right; } return null; } To test the code, I've entered the following numbers in order into the tree "50, 25, 100, 5, 110, 115, 75, 42, 101, 112". The insert method follows the normal BST insert rules of having larger elements on the right and smaller elements on the left. I tested my findParent method using the node containing 110 as the target so theoretically, it should return 100 as the parent and to get the grandparent, I would use findParent(parent) which should return 50 but instead, I get a nullptr exception. I've tested my insert function to see if I am populating my tree correctly, however, that is not the case as the insert method works correctly.
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?
Using Vandermonde's identity, I can have $$ \sum_{i=0}^{n} \binom{n}{i}^2=\binom{2n}{n} $$ Is there a closed expression for $$ \sum_{i=0}^{n} \binom{n}{i}^2 x^{i}. $$ If we define a function $$ f(x)=\sum_{i=0}^{n} \binom{n}{i}^2 x^{i} $$ Then $f(1)=\binom{2n}{n}$. Can the expression of $f(x)$ be simplified?
I've got the following finite sum: $s_{n}=\sum\limits_{k=0}^{n}\binom{n}{k}^2p^k$ (esp. if $p$ is a function of $n$, like $p=\frac1{n}$), which can be rewritten as $s_{n}=\sum\limits_{k=0}^{n}\binom{n}{k}\sqrt p^k\binom{n}{k}\sqrt p^k$. Using the generating function approach (from Graham, Knuth and Patashnik) with each of the polynomials in the sum, I get the expression $(1+\sqrt p x)^{2n}$ and the coefficient at the n-th term $x$ turns out to be $\binom{2n}{n} \sqrt p^n$. But comparing this result to the computational value, it turns out to be incorrect. Where did I make a mistake? Are there certain limitations on the generating function method?
I have two objects and I want to merge them, but it should not replace the object. var x = {'one':1, 'two': {'b': 2, 'c': 3}} var y = {'two': {'b': 4}} When I merge them The out put should be : {'one':1, 'two': {'b': 4, 'c': 3}}
I need to be able to merge two (very simple) JavaScript objects at runtime. For example I'd like to: var obj1 = { food: 'pizza', car: 'ford' } var obj2 = { animal: 'dog' } obj1.merge(obj2); //obj1 now has three properties: food, car, and animal Does anyone have a script for this or know of a built in way to do this? I do not need recursion, and I do not need to merge functions, just methods on flat objects.
A few weeks ago, I noticed that whenever I save a bookmark in Firefox, it goes to the Other Bookmarks folder not the the main bookmark menu. Is it possible to set a default location for newly saved bookmarks, so that I can set it to save in the main bookmarks menu? Is this a bug in some version of Firefox that Mozilla isn't aware of?
Recently, Firefox has changed the default folder for newly created bookmarks (using Ctrl+D) from the Bookmarks Menu to "Other Bookmarks". Is there some way to change that back? Or some alternate method instead of Ctrl+D? EDIT A native way to do this (without an add-on) would be best.
I'm a high-school senior attempting to make sense of the zeta function. I know Riemann regularized it to include complex numbers. Apparently, from this we could obtain that the sum of natural numbers may be assigned the value '-1/12' (zeta of -1) What I don't get is how did extending the domain to complex numbers help in getting this result. Thanks,
$\displaystyle\sum_{n=1}^\infty \frac{1}{n^s}$ only converges to $\zeta(s)$ if $\text{Re}(s) > 1$. Why should analytically continuing to $\zeta(-1)$ give the right answer?
public static void getSolve(Scanner s) { boolean validInput = false; while(validInput == false) { System.out.println("Would you like to try to solve the word? (yes or no)"); String input = s.nextLine(); if(input == "yes" || input == "Yes") { validInput = true; System.out.println("Enter your full guess: "); String guess = s.nextLine(); if (guess == secretWord) { System.out.println("You guessed the word!"); displayString = secretWord; } else { System.out.println("Sorry, that is not the word"); NUM_LIVES --; } } else if (input == "no" || input == "No") { validInput = true; } else { System.out.println("Sorry, that is not a valid input"); } } } This is the code that I am using for a solve method for a java project for my class in which I am coding a hangman game. I am trying to add a feature that asks the user if they would like to try to solve the word and then checks to see if they got that guess correct. Right now what is happening is that no matter what the user puts in, even if it is "yes" or "no", the program thinks that it is an invalid input and asks the question again, putting the code into an infinite loop. I'm not quite sure how to fix this and I'm not sure what I am doing wrong. Any help is greatly appreciated!
I've been using the == operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug. Is == bad? When should it and should it not be used? What's the difference?
I was wondering a bit after I got a Santa Lucia Hat from several different SE-pages. For getting the SL-Hat you have to vote on 15th of december, but for example I got the SL-Hat on meta, even if I created the account here on 16th of december (according to my time zone). So, what is the relevant time zone for hats? And even if the time zone is UTC, I am in UTC +1, so that should not be the answer...
During Winter Bash, users can earn hats. But sometimes it seems that a hat was awarded even though its requirements weren't (yet) met, or vice versa. What could be the reason for this?
How can I compare mean of subpopulation with mean of entire population? I want to compare mean of specific method with mean of all methods in a proficiency testing(PT) program. A PT program is a program in which an organisation which executes PT, sends samples to multiple participants and ask them to measure some characteristics in sent sample. After a deadline participants send their results to PT provider. Provider analyse results in all and different groups. Groups are those who used same methods for measuring that characteristic.
It is possible to compare a variable, for example age, between an entire group of patients and a subgroup of patients (a part of the entire group)?
I have file, and I have absolutely no idea what kind of file it is. When I open it in Notepad++ it reads as ð X döS or How can I figure out what this is, and how to modfiy it?
I sometimes get files from my clients that have the wrong file extension. For example, the name is image.jpg but the file is actually a TIFF image. In many cases I can clarify it by opening the file in a text editor, looking at the first few bytes, then deducing which file type it is. This works for me with JPEG, TIFF, GIF and PDF files. However there are many more file types out there. Is it possible to automate identification of the correct file type by analyzing the containing data?
I'm just looking for ideas for this. Say we want to predict the presence of a certain "thing" in a country by each postcode - let's take the UK, so there could be around 1.7 million postcodes - and you want to build a model where for each postcode, you're outputting either a 1 or a 0. A constraint could be the "thing" has uptake in 400k postcodes. You can imagine typical demographic data for predictor variables: population, income data, age range... However I feel independence between the outputs is too strong of an assumption - or at least, I'd like to this before applying models that assume it. I'm not really sure where to start so perhaps someone could give me some guidance - It wouldn't quite be logistic regression since the output variable would have some spatial correlation. There's also possibly enough training data with this large a set of postcodes - the model could be built using post sectors first, perhaps, but we'd still like a level of spatial correlation included... Any ideas or food for thought welcome, I'm kind of stumbling around in the dark so far. Am I right for instance in saying that multivariate regression would not work here, because the binary output variables are not independent?
I am using a binomial regression model for presence/absence, with 20 independent variables to test. The data has x and y coordinates and I would like to understand how can I take into account the spatial autocorrelation. I already studied the correlation between the variables and run the same model for 1000 different samples (I have a big dataset that allows me to do this) to understand the distribution of each parameter and check for variables that might be introducing problems in my model. glm_model <- glm(PA ~ Var1 + Var2 + Var3 + Var4 + Var5,family=binomial(link=logit)) However I believe I also need to account for spatial autocorrelation. I saw that there is a package that might help me (spdep), however I am not sure I completely understand if I can use my model or not. My question is what are my options ?
If you are on a touch spell, will getting hit by melee, ranged attack, or spell dissipate the spell you're holding? If it's a melee attack, does the attacker feel the effects of the spell you are holding?
For spells such as , there is a ranged touch attack to target the spell. Other spells activate after a touch attack, such as . If a victim was otherwise unaware that the spell was being cast, or not in any way resisting, could you target them by (say) just shaking their hand? This may be applicable to other versions of AD&D, but Pathfinder and 3.5 are the ones I know have this.
Two apples are plural. When I refer to a number of items only by their count, is the count singular? For example: "Two is enough." Is that correct?
I just came across the phrase "Two are better than one", but I had always heard it in my head as "Two is better than one". This is partially due to the Boys Like Girls song. Which one of these is actually correct?
I have an array of Button objects that I want to pass a function with different arguments into. This function takes an int argument. I've tried the following: public void ButtonClick(int i){ //do things with value of i } public void FillButtonClicks(){ for(int i = 0; i < 3; i++){ ButtonArray[i].AddListener(delegate{ButtonClick(i);}); } } This "works" in that the buttons receive the appropriate delegates, but it does NOT work in that the garbage collector is holding onto the value of 'i' in the for loop, i.e., when I click any of the three buttons, they all execute ButtonClick(3). Is there a way to enforce the passing of values, or do I have to just do something dumb like: ButtonArray[0].AddListener(delegate{ButtonClick(0);}); ButtonArray[1].AddListener(delegate{ButtonClick(1);}); ButtonArray[2].AddListener(delegate{ButtonClick(2);});
I met an interesting issue about C#. I have code like below. List<Func<int>> actions = new List<Func<int>>(); int variable = 0; while (variable < 5) { actions.Add(() => variable * 2); ++ variable; } foreach (var act in actions) { Console.WriteLine(act.Invoke()); } I expect it to output 0, 2, 4, 6, 8. However, it actually outputs five 10s. It seems that it is due to all actions referring to one captured variable. As a result, when they get invoked, they all have same output. Is there a way to work round this limit to have each action instance have its own captured variable?
In C++, what's an easy way to turn: This std::string \t\tHELLO WORLD\r\nHELLO\t\nWORLD \t Into: HELLOWORLDHELLOWORLD
What is the preferred way to remove spaces from a string in C++? I could loop through all the characters and build a new string, but is there a better way?
I have a button which adds rows to my table. but the property of Delete button dose work as it has been added after readyFucntion have been called enter code here
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.
Let $f(x)$ be a real valued function whose first, second derivatives are continuous in $[0,2\pi]$. Also, $f''(x)\geq0$. Show that $\int_{0}^{2\pi}f(x)\cos{x} dx\geq 0$. I tried using Integration by parts twice, by which I got $I= \int_{0}^{2\pi}f(x)\cos{x} dx\geq 0$ $\implies f'(2\pi)-f'(0)\geq\int_{0}^{2\pi}f''(x)\cos{x}dx$ I know that this LHS should be $\geq0$, but how do I compare it with RHS? Any hints, solutions or suggestions would be really helpful. Thank you!
Let $f(x)$ be a continuous function, whose first and second derivatives are continuous on $[0,2π]$ and $f''(x)≥0\:\:∀\:x∈[0,2π]$. Show that$$ \int _0^{2\pi} f(x) \cos x dx \ge 0$$
I have tried all the tricks in the book - setting connection as a metered connection (through registry), but there is no difference. I have already used up 1.1Gb in the last 24 hours as I try to fight this update process. There is no option to set connection as a metered connection in the control panel. If I search on start I set "Set up data usage limit" and from that window I get this:
So windows 10 has this annoying habit of downloading updates over WiFi connections not marked as metered connections. I have to connect to a limited WiFi hotspot, and by the time I set the connection to metered, some updates had already started downloading. So I went to services.msc and stopped windows updater. Now when I go to Settings->Update and Security->Windows Update, It says "Updates are ready to download". That is just fine, but when I click on "Details" of the updates, some updates still shows 'Downloading'. My bandwidth is not getting used up by this, but a process called "From Microsoft Download/Upload host" is constantly using high amounts of my CPU power, causing heating and battery drain. How can I solve this problem? I believe totally cancelling all ongoing updates will solve this, but don't know how to do it.
#include<stdio.h> #include<malloc.h> struct node { int data; struct node* left; struct node* right; }; struct node* newNode(int data) { struct node* node=(struct node*)malloc(sizeof(struct node)); node->data=data; node->left=NULL; node->right=NULL; return (node); }; int height(struct node* root) { static int lheight,rheight; if(root==NULL) return; else { lheight=height(root->left)+1; rheight=height(root->right)+1; if(lheight>rheight) return lheight; else return rheight; } } int main() { struct node* root=newNode(1); root->left=newNode(2); root->right = newNode(3); root->left->left = newNode(4); root->left->right = newNode(5); printf("%d",height(root)); return 0; } This program gives two different result. One is 2 for the above program where I use static and 3 if static is not used. Please explain the reason for the change in output using static.
I've seen the word static used in different places in C code; is this like a static function/class in C# (where the implementation is shared across objects)?
I am using LibGDX to build a game for android. I am getting a null pointer exception in this class but I dont know why (check the comments). public class ScoreFont { private Texture _numbers[]; private int _number; public ScoreFont(){ //Load font for(int i = 0; i <= 9; i++){ _numbers = new Texture[10]; _numbers[i] = new Texture("font_"+i+".png"); /*the line above works fine. if I use if(_number[i] != null) System.out.println("loaded"); it will print*/ } _number = 0; } public void setNumber(int number){ _number = number; } public void draw(SpriteBatch sb, float x, float y, float width, float height){ String numberString = Integer.toString(_number); int numDigits = numberString.length(); float totalWidth = width * numDigits; //Draw digits for(int i = 0; i < numDigits; i++){ int digit = Character.getNumericValue(numberString.charAt(i)); /*I get a null pointer exception when this method or the dispose() method are called. The _numbers[digit] == null, or even if I switch it for _numbers[0] it is still null. Why?*/ sb.draw(_numbers[digit], x - totalWidth/2 + i*width, y - height/2, width, height); } } public void dispose(){ //I get null pointer exception for(Texture texture: _numbers){ texture.dispose(); } } } What may be happening here? The constructor of this function has to be called always before any method and this will guarantee that the textures are always loaded right? So why am I getting a null pointer exception? Thanks!
What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them? What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?
A newspaper of the ruling Communist Party ( said Saturday ) that no religion is above the law in China, urging officials to stay firm while dealing with a rare protest over the planned demolition of a massive mosque in the northwest. is it said on Saturday ?
When I'm talking about habit or custom, can I say: "The king comes on Sunday and goes Monday." without using the preposition "on" before "Monday"?
When I am using my phone and searching for anything and then press the search button sometimes two loading sprites show sometimes just one I assume there is only many to be one? App version: 1.0.52
This confirms that the Android app is using two different loaders since last year, but just today I've noted that, at the questions page, it is using them simultaneously. I've never noted this, so I believe this bug was recently created. I hope the following gif is clear enough to show the issue. Also, note that the bigger loader is "freezing". SE Android App Version: 1.0.60 My Android OS Version: 5.0.2 Still observed in version 1.0.89
I am trying to send SMS from java web application using Twillo app. But I am getting the following error at Glassfish server 4.1.1 java.lang.NoClassDefFoundError: org/apache/http/conn/HttpClientConnectionManager at Message message = Message.creator(new PhoneNumber(""), I have added Twilio 7.41.2 jar in my netbeans ide library folder. But I have not added any maven dependency in pom.xml as this is not maven enabled the project, is this the error due to missing maven dependency? index.jsp <form action="sms" method="post"> <input type ="submit"/> </form> Servlet sms.java import com.twilio.Twilio; import com.twilio.rest.api.v2010.account.Message; import com.twilio.type.PhoneNumber; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { PrintWriter out = response.getWriter(); try{ final String ACCOUNT_SID = "myaccountsid"; final String AUTH_TOKEN = "my string authtoken"; Twilio.init(ACCOUNT_SID, AUTH_TOKEN); Message message = Message.creator(new PhoneNumber("recipient phone no"), new PhoneNumber("recipient phone no"),"Hello This is Tom").create(); out.println(message.getSid()); processRequest(request, response); } catch(IOException | ServletException e){ } } Any help is much appreciated.
I am getting a NoClassDefFoundError when I run my Java application. What is typically the cause of this?
I am facing a interesting issue in SharePoint Online: when I view detail of a list item, it's created by field is showing blank. This is how I see it: What could be the possible reason? How can I find who created that item?
I have an issue whereby users can't see the 'Modified By' or 'Created By' columns on my SharePoint site (the columns are blank). This issue affects all users, even those with full control. I've found a quick fix by going into Central Administration > Application Management > Policy for Web Application, then ensuring the users have the following permissions: Manage Lists View Items Edit Items View Items View Pages Open Manage Personal Views This however makes the site extremely slow for all users. Does anyone know how to fix this please?
I am using Lubuntu on a virtual machine and have many files on here. Months ago, I kept getting pop-ups which asked me to update to Lubuntu 13.10 (I believe it was 13.10) Saucy Salamander but I kept saying 'Remind me later'. Now, I can't apt-get install anything and I keep getting these type of errors: 404 Not Found [IP: 91.189.92.201 80] This post () suggested that I upgrade (I should upgrade to Lubuntu Saucy Salamander). I don't want to download anything from here () because I am afraid I will lose all my important files. Instead, I kept waiting till I got that pop-up again asking if I want to upgrade but I never get that popup anymore. I tried restarting my VM but still no popup. I then tried starting up the Software Updater but it keeps giving me an error saying: Failed to download repository information. Check your internet connection. even though I can access the internet with no problems. I tried installing packages from Synaptic Package Manager but it also gave me the 404 Not Found [IP: 91.189.92.201 80] errors. How do I upgrade to Lubuntu 13.10 Saucy Salamander? Or how do I get Lubuntu to send me that 'upgrade to Saucy Salamander' pop up again? The one time I want to get the popup, I'm not getting it anymore -.-.
Recently I have installed an older version of Ubuntu on my old machine. Whenever I try to install any software, I get an error saying it couldn't be found: $ sudo apt-get install vlc Reading package lists... Done Building dependency tree Reading state information... Done E: Couldn't find package vlc
I have been using LaTeX for quite a while now, but I have not found out how to determine the rules for the compilation steps needed to create the document yet. A couple of questions come up. Please do not hesitate to provide a really short answer, I just do not know where to start. texify belongs to MikTeX and runs pdflatex plus what else is needed. What is the equivalent for MacTeX? When I would like to launch a recompilation script, it would probably make sense to run texify only once so that I do not have to take care of running BibTeX, pdflatex and others multiple times. Is that correct? What would be the best approach to write a simple script that compiles everything that is needed in the correct order? There is a grunt plugin that compiles latex, but looking at the , I do not understand how a simple pdflatex call could correctly compile everything. Is that possible?
A lot of people write makefiles that say something like paper.pdf: paper.tex pdflatex paper bibtex paper pdflatex paper pdflatex paper To handle re-running TeX to get new/changed references and so forth. Is there a better way to do this?
Let $A_n =\sum \limits_{j=1}^n\frac{\sin j}{j}$. How can I prove that $A_n$ converges as $n$ approaches infinity? I know that if we think of it as an infinite series, it can be proved by applying appropriate convergence tests(for example, Abel's convergence test(or Dirichlet test). But I want a proof not using convergence tests of an infinite series, and think of this as a 'sequence' $A_n$ instead of a 'series'. I read and other answers related to this question, but most of them used convergence tests and I don't know about Riemann-Lebesgue lemma or Fourier series. Actually I am taking an elementary analysis course, and this is an exercise on the textbook's 'sequence' part, not 'series'.
Question: Find the sum of the series: $$\lim_{n \to \infty}\frac{\sin1}{1}+\frac{\sin2}{2}+\frac{\sin3}{3}+...+\frac{\sin n}{n}$$ I have no clue how to find this. Obviously I can see the sum will be convergent as the denominator gets increasingly bigger while the numerator is bound between $1$ and $-1$.
I know using turn command and a sample code like this: \usepackage{rotating} \begin{turn}{90} Supervised Learning \end{turn}} we can rotate a text inside a cell, however, I couldn't find a way to vertically center this rotated text when we have multirow. Any suggestions is appreciated. \begin{table} \centering \caption{A Classification } \begin{tabular}{|c|>{\centering\arraybackslash}m{2.2cm}|>{\centering\arraybackslash}m{10.5cm}|} \hline \multicolumn{2}{|c|}{Classification} & References \\ \hline \multirow{2}{*}{{\begin{turn}{90}Supervised Learning\end{turn}}} % \multirow{2}{*}{\rotatebox[origin=c]{90}{\parbox{.6cm}{\centering{Supervised Learning}}}} & Bayesian & \\ \cline{2-3} & Linear & \\ \cline{2-3} & Decision Trees & \\ \cline{2-3} & Neural Networks / Genetic Algorithm & \\ \cline{2-3} & Others & \\ \cline{2-3} \hline \multirow{2}{*}{{\begin{turn}{90} Unsupervised \end{turn}}} & Clustering & \\ \cline{2-3} \hline \multirow{2}{*}{{\begin{turn}{90} Others \end{turn}}} & Reinforcement Learning & \\ \cline{2-3} & Graph-based & \\ \cline{2-3} & Statistical Methods & \\ \cline{2-3} \hline %\multicolumn{2}{|l|}{Statistical Methods} & \\ \hline \end{tabular} \label{tab:Machine_Learning_models} \end{table}
I know using turn command and a sample code like this: \usepackage{rotating} \begin{turn}{90} Supervised Learning \end{turn}} we can rotate a text inside a cell, however, I couldn't find a way to vertically center this rotated text. Any suggestions is appreciated. Here is the sample MWE: \begin{table}[] \centering \begin{tabular}{|>{\centering\arraybackslash}m{0.5cm}|c|>{\centering\arraybackslash}m{8cm}|} \hline \multicolumn{2}{|c|}{Classification} & References \\ \hline %\multirow{2}{*}{{\begin{turn}{90}Supervised Learning\end{turn}}} \multirow{2}{*}{\rotatebox[origin=c]{90}{Supervised Learning}} \end{tabular} \caption{A Classification} \label{tab:Machine_Learning_models} \end{table}
I want to write currency in the format: ₽ 3 812.23 But if I select Russia as region in the table settings and format the string ₽ 0.00 result formatted number like ₽ 3 812,23 with a comma, because the comma is default separator in Russian locale. How to change comma to dot?
'₴' is a currency sign used for the Ukrainian Hryvnia. It's in Unicode since 2004. I want to use it in spreadsheets as a sign for money values, but Google Spreadsheets doesn't understand it as a number if I add it after or before my value in the cell. How do I make Google Spreadsheets understand it's currency and display it as a number in my desired format?
At the end of Skyfall, M wills an ugly porcelain pug to James Bond. When it is suggested to Bond that it was M's way of telling him to take a desk job, Bond affirms that it was just the opposite. What is the significance of the gift?
When Bond is given the at the end of Skyfall, he smiles as if he understands the meaning of this figurine. During the movie, we can see the camera focusing on that figurine at least three times: When we first see M at her desk. After the MI6 explosion on M's desk. When Bond opens the box at the end. What is the meaning of this figurine, and what is the purpose of giving it to Bond?
I have spent days trying to get an Lenovo ideapad S340 boot from a USB. Would someone care to walk me through step by step? I have searched on the internet, changed BIOS settings, created USBs (universal usb installer, unetbootin ) and am going round in circles. I do have technical background and can follow instructions, but need some guidance to avoid the pitfalls. I am stuck with getting this USB to work.
I would like to see a full how-to guide on how to install Ubuntu.
I would like to delete the account on Stack Overflow? I have not found any option there after changing the profile page design. How do I delete the account on Stack Overflow?
How can I delete my Stack Exchange account(s)? Also, What happens to my content? Can I request it be deleted as well? What if I'm suspended, rate-limited, or banned from posting questions or answers? What will happen to my votes? Will other users be impacted? Why wasn't my account deleted immediately after the timer expiring? What will happen to my pending bounties and close, reopen, delete, or undelete votes? I want my account deleted on all Stack Exchange sites. How do I do this? Will my profile on chat be removed once I delete my site account? For more information, see "" in the .
Between 2005-2008, I entered a Barnes and Noble and came across a book in the New Releases section that I regretted not purchasing. I remember only the following from the back-panel summary of the book: Humanity was more or less wiped out. The remains of humanity were put into a deep sleep on one (or more) large spaceship(s). When they arrived a new planet, they had a society where religion was/wasn't outlawed (can't remember anymore). A lot of bad stuff went down after humanity rebuilt itself on this new planet.
Shortly before his death, my father spoke to me about a series of novels that he had just finished reading which had a fascinating concept. However I soon forgot the title(s) and author and I've been absolutely desperate to find out what they were. The premise (as I understood) was that humanity had expanded out from the solar system into the local star systems before coming into contact with an incredibly aggressive species which was focused on wiping out the entire species. Earth and her colonies were lost as remnants of the species fled. Eventually it was decided by the military leadership to set up a colony in order to rebuild the human race. However, in order for this colony to escape detection and to keep humanity from going back out into space and thus potentially running into this hostile alien race again, a series of satellites were set up around the planet chosen that would lock onto and destroy any form of technology (and usually the surrounding city) that went beyond pre-industrial standards. One of the series protagonist is a long living android who possesses the consciousness of a human who was present at the original founding of the colony (and who seems shielded from detection) which observes as civilization is repeatedly regrown and torn down again and who attempts to try and reverse humanities self imposed lot in life. From what I understood this was a series of novels, but I could be wrong. I've been trying to find this for years on my own with only a rough plot line as a guide and it's gotten me nowhere.
I am looking to write a 'house style' guide for my organisation. As a house style we want to continually be updating and maintaining it (perhaps with a new edition every year or so). I want to write it in LaTeX (of course!), but I am having trouble finding out how to organise it. (I could do this by hand, but then where's the fun of LaTeX in automation?). As many organisations and universities have a house style guide these days, I hope this question is of general use. A style guide (at least as I write one) is organised first by theme, and then alphabetically. The theme sections I can do as ordinary chapters, but I am having trouble figuring out how to organise my sections alphabetically. glossaries and similar aren't really for writing a style guide—they are designed to be additional matter to a main text, rather than (as I want) the main text is itself alphabetised. Perhaps a package for making a dictionary could be adapted? To give a concrete example, I would like to find a way to organise the 'sections' below alphabetically automatically. (Of course, there's no reason they have to be 'sections' \documentclass{book} \begin{document} \chapter{Spelling and Punctuation} \section{Commas} \section{Full Stops} \section{Exclamation marks} \chapter{Names} \section{Universities} \section{Surnames} \section{Cities} \end{document}
Is it possible to tell latex, that it should sort the sections you used in your document according to their alphabetical order in the final pdf document? I.e. I want to have something like this \begin{document} \section{A} \section{C} \section{B} \end{document} and in the pdf I get the result as A B C Is that possible, and if yes, how? Putting the sections into separate files is not preferred (but possible if scripted) due to having ~300 sections. Edit: I can also rewrite it as \begin{sortEnvironment}{Title} Content \end{sortEnvironment} if that makes it easier.
Counterspell: Casting Time: 1 reaction, which you take when you see a creature within 60 feet of you casting a spell What does "you see" refer to, the creature or the casting of a spell? In other words, can you Counterspell for example, if you hear a creature within 60 feet of you casting a spell, and see the creature? Example: You are looking at someone with full-face helmet, and they cast a verbal-only spell at someone else next to them. Can you Counterspell?
Counterspell requires the following: [a reaction], which you take when you see a creature within 60 feet of you casting a spell The Flameskull's spellcasting block reads the following: [The Flameskull] requires no somatic or material components to cast its spells. If the Flameskull requires no visible components, can its spells be counterspelled?
FYI I am using eclipse CDT on ubuntu. I am getting started with c++. I don't know what the issue is. One of my friends has shown me how to create a generic class with a different example. This is how he did it. I tried going through many other Stack Overflow questions but all of them had errors that my program didn't have. Thanks in advance. Set.h: #ifndef SET_H_ #define SET_H_ #include <vector> template <typename T> class Set { private: std::vector<T> _set_arr; public: Set(); ~Set(); void Add(T); void Remove(int); // FRIENDS template <typename S> friend Set<S>& operator +(Set<S>, Set<S>); }; #endif /* SET_H_ */ Set.cpp: #include "Set.h" template <typename T> Set<T>::Set() : _set_arr{} {} template <typename T> Set<T>::~Set() {} /** * Adds a value to the Set */ template <typename T> void Set<T>::Add(T val) { _set_arr.push_back(val); } /** * Removes a value from the Set */ template <typename T> void Set<T>::Remove(int index) { _set_arr.erase(_set_arr.begin() + index); } template <typename S> Set<S>& operator +(Set<S> &a, Set<S> &b) { Set<S> *_set_1 = new Set<S>; // Pre-reserve _set_1->_set_arr.reserve( a._set_arr.size(), b._set_arr.size() ); // Insert _set_1->_set_arr.insert(_set_1->_set_arr.end(), a._set_arr.begin(), a._set_arr.end() ); _set_1->_set_arr.insert(_set_1->_set_arr.end(), b._set_arr.begin(), b._set_arr.end() ); return *_set_1; } Driver: #include <iostream> #include "Set.h" using namespace std; int main() { Set<int> *s1 = new Set<int>; return 0; } Error Messages: /home/ajay/code/eclipse_workspace/GenericSet/Debug/../src/main.cpp:14: undefined reference to `Set<int>::Set()' makefile:45: recipe for target 'GenericSet' failed /home/ajay/code/eclipse_workspace/GenericSet/Debug/../src/main.cpp:14: undefined reference to `Set<int>::~Set()'
Quote from : The only portable way of using templates at the moment is to implement them in header files by using inline functions. Why is this? (Clarification: header files are not the only portable solution. But they are the most convenient portable solution.)
When I run the emulator, it woks perfectly with no errors, but when I press the Login button, I get error "java.lang.NullPointerException: Attempt to invoke interface method". This is my code: public class MainActivity extends ActionBarActivity { Button add; TextView errorlbl; EditText name, address, pincode; Connection connect; PreparedStatement preparedStatement; Statement st; String ipaddress, db, username, password; @SuppressLint("NewApi") private Connection ConnectionHelper(String user, String password, String database, String server) { StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder() .permitAll().build(); StrictMode.setThreadPolicy(policy); Connection connection = null; String ConnectionURL = null; try { Class.forName("net.sourceforge.jtds.jdbc.Driver"); ConnectionURL = "jdbc:jtds:sqlserver://" + server + ";" + "databaseName=" + database + ";user=" + user + ";password=" + password + ";"; connection = DriverManager.getConnection(ConnectionURL); } catch (SQLException se) { Log.e("ERRO", se.getMessage()); } catch (ClassNotFoundException e) { Log.e("ERRO", e.getMessage()); } catch (Exception e) { Log.e("ERRO", e.getMessage()); } return connection; } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); add = (Button) findViewById(R.id.btnadd); errorlbl = (TextView) findViewById(R.id.lblerror); name = (EditText) findViewById(R.id.txtname); address = (EditText) findViewById(R.id.txtaddress); pincode = (EditText) findViewById(R.id.txtpincode); ipaddress = "92.244.93.250:3306"; db = "lokal"; username = "lokal"; password = "12lokal34"; connect = ConnectionHelper(username, password, db, ipaddress); add.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { try { st = connect.createStatement(); preparedStatement = connect .prepareStatement("insert into studentRecord(Name,Address,Pincode) values ('" + name.getText().toString() + "','" + address.getText().toString() + "','" + pincode.getText().toString() + "')"); preparedStatement.executeUpdate(); errorlbl.setText("Data Added successfully"); } catch (SQLException e) { errorlbl.setText(e.getMessage().toString()); } } }); } } Logcat error says: 2182-2182/app.mysqlapp E/AndroidRuntime﹕ FATAL EXCEPTION: main Process: app.mysqlapp, PID: 2182 java.lang.NullPointerException: Attempt to invoke interface method 'java.sql.Statement java.sql.Connection.createStatement()' on a null object reference
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 upgrade the current OS X El Capitan (10.11.6)to “ high Sierra” As the current os ( X El Capitan) is very old not supporting few features. Anandarao n
Sometimes it's hard to search for older versions of macOS & OS X on the App Store. This is an attempt to provide the canonical QA for this issue, as per the Meta QA - I expect it to be modified over time to hopefully become a complete information resource. How can I get any older version of a Mac OS to be able to run as a VM, or to reinstall on my Mac?
First of all, I'm 16, and I've been using Adobe applications for 6 years. Since 2014, I've been "working" as a freelancer. When it comes to pricing, I have a lot of problems: I haven't developed a portfolio yet My age doesn't help I'm too kind Recently I made a logo and a badge for 13$. By now, I'm developing a book cover for 10$. I consider theses prices to be really low, sorry if you don't agree Why? Because when I try to charge my real price, people refuse to pay. " Too young and too high " " I know a guy that does it for less " " I can only pay X$ " (this one refers to kindness)" What should I do?
I was hoping I would find some people in the industry that could help me decide what's the best price to charge to design (in this case) business cards. What are standard prices for professional designers? From a firm point of view? From a freelancer? I don't want to overcharge clients but I don't want to ruin the industry by underselling my services.
If a women from Ghana wants to visit the US and she is a first time traveler,will she have to have $5000.00 travelers check in her possession before she can come?
On Travel.SE we often see questions about a person (usually a love interest) asking for money to pay for airfare, visas, permits and other expenses. For example What general advice can be given in such situations to the person asking the question? Is it all a scam or can there be legitimate situations in which an online friend could be asking for money?
I am using a footnote inside makecell inside a longtable and while the footnote's counter is displayed, the text does not appear at the end of the page. Here's a MWE \documentclass{article} \usepackage{longtable} \usepackage{makecell} \title{A longtable example} \begin{document} \begin{center} \begin{longtable}{|l|l|l|} \caption{A sample long table.} \label{tab:long} \\ \hline \multicolumn{1}{|c|}{\textbf{First column}} & \multicolumn{1}{c|}{\textbf{Second column}} & \multicolumn{1}{c|}{\textbf{Third column}} \\ \hline \endfirsthead One & \makecell{abcdef\footnote{Test2} \\ ghjijklmn} & 123.456778 \\ \end{longtable} \end{center} \end{document}
\documentclass{report} \begin{document} Text\footnote{text1} Text\footnote{text2} \vbox{% \begin{itemize} \item X\footnotemark{} \item Y\footnotemark{} \item Z\footnotemark{} \end{itemize} } \footnotetext{a} \footnotetext{b} \footnotetext{c} \end{document} generates: Text^1 Text^2 * X^3 * Y^4 * Z^5 ------------- 1 text1 2 text2 5 a 5 b 5 c How to recover \footnotetext numbering without manual numbering? I assume, I know that I used \footnotemark n times, so I would like solution like (It is "pseudocode" of draft of an idea) : \newcounter{tempcounter := footnotecounter - n} \footnotetext[ ++tempcounter ]{a} \footnotetext[ ++tempcounter ]{b} \footnotetext[ ++tempcounter ]{c} Or other authomatic numbering solution. I don't want to manually correct this list each time I change footnotes in chapter. P.S. I know putting list into vbox might look strange, please assume it's just a toy-example of environment that needs usage of \footnotemark+\footnotetext.
I came across the following example that explains the Law of Implication, which I cannot wrap my head around. How is it that:$$p \Rightarrow q$$ Is logically equivalent to: $$\neg p \lor q$$?
This question comes from from my algebra paper: $(p \rightarrow q)$ is logically equivalent to ... (then four options are given). The module states that the correct option is $(\sim p \lor q)$. That is: $$(p\rightarrow q) \iff (\sim p \lor q )$$ but I could not understand this problem or the solution. Could anybody help me?
An electron absorb a photon and jumps to the last energy level.Now when it goes done,How does it choose which level it will step down to?.Also I've come to now that it can omit one step(e.g from 5th level to the 3rd level without going by the 4th) is that true and how come ?!.
I was watching the Cosmos documentary where Neil deGrasse Tyson explained how certain energy photons get absorbed by an atom, which causes the electrons of that atom to climb into a higher energy state. He then says that an atom produces a photon when those electrons drop to a lower energy state, but that we don't know why this happens. I understood that as 'we don't know what triggers this to happen'. Is that true? And if so, are there any feasible theories that explain this phenomenon?
I know that the series representation of $\tan(x)$ is: $x+\frac{x^3}{3}+\frac{2x^5}{15}+\frac{17x^7}{315}...$ I can derive this by using the fact that $\tan(x)=\dfrac{\sin(x)}{\cos(x)}$. But I don't know how to find the general sigma formula for this function. I have seen the general formula here: But I don't know how the Bernoulli number is involved. Can you explain this further so I can understand?
I found the following formula here: . Taylor series of $\tan x$: $$\tan x = \sum_{n\,=\,1}^\infty \frac {(-1)^{n-1}2^{2n} (2^{2n}-1) B_{2n}} {(2n)!} x^{2n - 1} $$. I do not understand what the Bernoulli number means in this formula. My problems are the following ones: I do not know anything about Bernoulli numbers. I do not know how to expand the Bernoulli number in the formula you see further up. What expansion will be the final result? How did you arrive there? Why did you arrive there? How did you know that you should use the specific Bernoulli-related terms that you used in your answer? What is the purpose of the Bernoulli number in this formula? A great deal of thanks.
Here is the complete error log 03-27 08:08:30.264 D/SubSettings( 7079): Launching fragment com.sakura.settings.fragments.BatterybarSettings 03-27 08:08:30.275 D/AndroidRuntime( 7079): Shutting down VM 03-27 08:08:30.275 E/AndroidRuntime( 7079): FATAL EXCEPTION: main 03-27 08:08:30.275 E/AndroidRuntime( 7079): Process: com.android.settings, PID: 7079 03-27 08:08:30.275 E/AndroidRuntime( 7079): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.settings/com.android.settings.SubSettings}: java.lang.NullPointerException: Attempt to invoke virtual method 'void androidx.preference.Preference.setOnPreferenceChangeListener(androidx.preference.Preference$OnPreferenceChangeListener)' on a null object reference 03-27 08:08:30.275 E/AndroidRuntime( 7079): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3270) 03-27 08:08:30.275 E/AndroidRuntime( 7079): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409) 03-27 08:08:30.275 E/AndroidRuntime( 7079): at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83) 03-27 08:08:30.275 E/AndroidRuntime( 7079): at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) 03-27 08:08:30.275 E/AndroidRuntime( 7079): at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) 03-27 08:08:30.275 E/AndroidRuntime( 7079): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016) 03-27 08:08:30.275 E/AndroidRuntime( 7079): at android.os.Handler.dispatchMessage(Handler.java:107) 03-27 08:08:30.275 E/AndroidRuntime( 7079): at android.os.Looper.loop(Looper.java:214) 03-27 08:08:30.275 E/AndroidRuntime( 7079): at android.app.ActivityThread.main(ActivityThread.java:7355) 03-27 08:08:30.275 E/AndroidRuntime( 7079): at java.lang.reflect.Method.invoke(Native Method) 03-27 08:08:30.275 E/AndroidRuntime( 7079): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:491) 03-27 08:08:30.275 E/AndroidRuntime( 7079): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930) 03-27 08:08:30.275 E/AndroidRuntime( 7079): Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void androidx.preference.Preference.setOnPreferenceChangeListener(androidx.preference.Preference$OnPreferenceChangeListener)' on a null object reference 03-27 08:08:30.275 E/AndroidRuntime( 7079): at com.sakura.settings.fragments.BatterybarSettings.onCreate(BatterybarSettings.java:110) 03-27 08:08:30.275 E/AndroidRuntime( 7079): at androidx.fragment.app.Fragment.performCreate(Fragment.java:2596) 03-27 08:08:30.275 E/AndroidRuntime( 7079): at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:831) 03-27 08:08:30.275 E/AndroidRuntime( 7079): at androidx.fragment.app.FragmentTransition.addToFirstInLastOut(FragmentTransition.java:1197) 03-27 08:08:30.275 E/AndroidRuntime( 7079): at androidx.fragment.app.FragmentTransition.calculateFragments(FragmentTransition.java:1080) 03-27 08:08:30.275 E/AndroidRuntime( 7079): at androidx.fragment.app.FragmentTransition.startTransitions(FragmentTransition.java:119) 03-27 08:08:30.275 E/AndroidRuntime( 7079): at androidx.fragment.app.FragmentManagerImpl.executeOpsTogether(FragmentManagerImpl.java:1853) I am unable how should I initialize onPreferenceChangeListener, I also tried looking for code references to other places but couldn't figure out how they are initializing it. My whole code is at . Thanks a lot in advance.
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 would one derive $\lim_{x\rightarrow0}\left(\frac{\sin(x)}{x}\right)$ without using any derivatives?
How can one prove the statement $$\lim_{x\to 0}\frac{\sin x}x=1$$ without using the Taylor series of $\sin$, $\cos$ and $\tan$? Best would be a geometrical solution. This is homework. In my math class, we are about to prove that $\sin$ is continuous. We found out, that proving the above statement is enough for proving the continuity of $\sin$, but I can't find out how. Any help is appreciated.
I am working on an application wherein I want to track clients public IP address. I don't want to use as its an insecure connection. Is it possible to get clients public IP address using core javascript? Thanks
I need to somehow retrieve the client's IP address using JavaScript; no server side code, not even SSI. However, I'm not against using a free 3rd party script/service.
I just want to install the operating system on to a USB and boot into that. The try Ubuntu option isn't what I'm looking for. I always would have to install a driver just to get wifi access and I would like to be able to write and create files that won't be gone as soon as I'm done "trying Ubuntu".
If you are hurrying to reply, System → Administration → StartUp Disk Creator -- no, that's not what I'm talking about. I want to try Ubuntu 11.04's Unity without touching my existing Ubuntu install. To do this, I need to install the nVidia drivers first (sigh). To do this, I need changes to persist a reboot. To do this, I need to really install Ubuntu on a USB key. How do you do that? What I tried I tried to make a USB key from , then boot from it, then choose "Install Ubuntu." The installer refused to install to the installation media itself. I tried, from my installed copy of Ubuntu: sudo kvm /dev/sdb --cdrom .cache/testdrive/iso/ubuntu_natty-desktop-i386.iso ...but the installer didn't detect the disk properly.
In a formal academic writing (in the everyday sense), is it appropriate to use phrases such as "step out on" to titillate the reader? Since I am not a native English speaker, and since I have not yet accurately catched the general range of humor in the US, I wonder if using such phrases would be instead considered as a disrespect?
I was reading titled "Optimal Symmetric Rendezvous Search on Three Locations." While talking about the history of search problems, the author mentions the following anecdote in passing. In 2007 a letter writer to the Guardian newspaper queried, “I lost my wife in the crowd at Glastonbury (a music festival). What is the best strategy for finding her?” A reader replied, “Start talking to an attractive woman. Your wife will reappear almost immediately.” While I found it quite amusing to read this, I do not often come across papers with such witticisms. Is there an unwritten rule about the tone of sobriety that is considered appropriate in academic papers? Are jokes or anecdotes fine as long as they do not appear forced?
I am writing a library for mixed-languages and so we have to stick to a C interface. I need to call this API function: void getproperty(const char * key, /* in */ char * value /* out */) { I need to set value with the contents of an std::string. std::string stdString = funcReturningString(); // set value to contents of stdString I've seen lots of answers on possible strategies, but none for this specific use-case and neither were any considered the "best" or "standard." We are using C++11, for what its worth. Some of the answers vaguely recommended copying the contents of the string to a buffer and using that. But how to do it? I would like some more opinions on this conversation so I can finally pick a strategy and stand by it. Thank you! UPDATE: Here is the solution I used I am using uint32_t to keep consistent with the other API functions. bufferSize is a reference because FORTRAN calls everything by reference. void getproperty(const char * key, /* in */ const uint32_t & bufferSize, /* in */ char * value, /* out */ uint32_t & error /* out */) { std::string stdString = funcReturningString(); if (bufferSize < str.size() + 1) { // Set the error code, set an error message, and return } strcpy(value, stdString.c_str()); } I chose strcpy() to keep everything standard and I chose a bufferSize parameter so that I wouldn't have to worry about some of problems of double indirection mentioned in the comments.
How can I convert an std::string to a char* or a const char*?
I've been trying to get this working for far too long. I am to use an array of strings to construct an array of "sentence" classes by using the string as part of the constructor. Can anyone help me out? public class FileConverter { private final String input; private final String output; private boolean inputEncrypted; private ArrayList<Sentence> y; public FileConverter(String input, String output, boolean inputEncrypted) { this.input = input; this.output = output; this.inputEncrypted = inputEncrypted; } // this method creates an array of sentences from input public boolean readInput() { String[] x = input.split("\\."); for(String x1:x){ Sentence a = new Sentence(x1); y.add(a); } return false; } y.add(a) is giving me a null pointer exception. I've tried a few different ways to do this and I can't seem to figure it out.
What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them? What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?
I have 3 cells, VALUE, DOWNPAYMENT, DOWNPAYMENT %. The 3rd cell "DOWNPAYMENT %" calculates the percentage of "DOWNPAYMENT" over "VALUE" Is there a way for the user to have the function to input a number in "DOWNPAYMENT %" cell and get a figure in "DOWNPAYMENT". What I mean is that if both cells could be used at the same time for input of data and for output of calculation.
I'm making a worksheet where the wind speed defines the potential energy of the location. This value is the basis of a few sheets in the same Excel file. I'm trying to write a code that where I10 is the wind speed and I12 is the potential kWh on that location. I want both I10 as I12 to be input cells where you can either say: I want to know what wind speed I need to generate 4000 kwh i.e. or my wind speed is 4.2 m/s what will my potential energy be? This is what I made so far, but I don't get the power function to work. At the moment I defined the cell I12 (The kWh's) without VBA as =(2208,5/(54,872))*I10^3 where I10 is the windspeed. VBA code behind sheet which doesn't work: Private Sub Worksheet_Change(ByVal Target As Excel.Range) If Target.Address = "$I$10" Or Target.Address = "$I$12" Then WIND = Range("I10") KWH = Range("I12") Application.EnableEvents = False If Target.Address = "$I$10" Then Range("I12").Value = (2208.5 / (54.872)) POWER(WIND,3) Else Range("I10").Value = POWER( KWH (2208.5 / (54.872)),(1/3) End If End If Application.EnableEvents = True End Sub Potential solution, but not working at the moment. Function MyPower(Number As Double, Exponent As Double) As Double MyPower = Number ^ Exponent End Function
If $H$ is a subgroup of $S_n$ and if H is not contained in $A_n$ prove that precisely one half of the elements of H are even permutations. I know that multiplying two odd permutations gives a even, and that one even and one odd return an odd permutation but i have no idea where to go from there.
Let $H<S_{n}$ and suppose $H$ is not contained in $A_{n}$. Write $H$ as $$H=E\cup O$$ where $E$ and $O$ represent the sets of even and odd elements, respectively. Let $E=\{{\alpha_1,...,\alpha_n}\}$ and $O=\{{\beta_1,...,\beta_m}\}$. Since $O$ is non-empty, it contains at least one element, say $\beta_1$. The same goes for $E$ because $e\in E$. Our goal is to prove $m=n$. The products $\beta_1\alpha_i$, $i=1,...n$, are all distinct elements in $O$, and it follows that $O$ has at least $n$ elements, i.e. $m\geq n$. In the case of strict inequality, $m>n$, add at least one extra odd element ($\beta_{n+1}$) to the list $$\beta_1\alpha_1,...,\beta_1\alpha_n,\beta_{n+1}$$ This is where I find myself stuck. Any help appreciated. Can this route work?
Is there an easy way to uninstall an update to Thunderbird in Ubuntu 13.04?
The latest xorg update was a big regression for me on a dual display setup. Is there a simple way to revert to the previous version? I'm on Lucid Lynx.
Find the limit of the function $f(x,y)=\frac{x^2 y^2}{x^2 y^2 + > (x-y)^2}$ whenever $x^2 y^2 + (x-y)^2 \not= 0$ as $(x,y) \to (0,0) $ I thought I can split this question into 4 limit question like $$\lim_{(x,y) \to (0^+, 0^+)} f(x,y)$$ $$\lim_{(x,y) \to (0^+, 0^-)} f(x,y)$$ $$\lim_{(x,y) \to (0^-, 0^+)} f(x,y)$$ $$\lim_{(x,y) \to (0^-, 0^-)} f(x,y)$$ Logically, this way of looking the question should not be a problem, but it is to a efficient way to do it, especially if f(x,y) is more complicated than the one in this question. So, how can I solve this question more efficiently ? and what is the correct solution ?
Find the limit of $$\lim\limits_{(x,y)\to (0,0)} \frac{x^2y^2}{x^2y^2+(x-y)^2}$$ So, I know that $$\lim\limits_{x \to x_0} f(x)=c \Leftrightarrow \forall (x_n)\subseteq D\setminus\{x_0\}, x_n\to x_0: f(x_n)\to c \, (n\to \infty)$$ Let $x_n=\left(\frac{1}{n},\frac{1}{n}\right), y_n=\left(\frac{1}{n},0\right):$ $$f(x_n)=\frac{\frac{1}{n}^4}{\frac{1}{n}^4}=1\\ f(y_n)=\frac{0}{...}=0\\ \Rightarrow f(x_n)\neq f(y_n)\, (n\to \infty)$$ So the limit doesn't exist. Correct?
I've just put a new web page live, and now one of my sentences is bugging me. The sentence in question is: It was developed internally and made available for the world. The part that I'm not sure about is made available for the world. Is for correct here, or would the appropriate word be to? It sounds right to me, but I'm not sure if I'm breaking a rule.
First of all, English is not my first language. I have a question, maybe a basic one, about this phrase: The situation highlights the mismatch between some areas of training and available jobs to/for them. Should it be "available jobs to them" or "available jobs for them"? Sorry if the question is really basic.
How can we interpret the transpose of a matrix, that represents the cordinates of a vector with respect to a basis, geometrically?
I can follow the definition of the transpose algebraically, i.e. as a reflection of a matrix across its diagonal, or in terms of dual spaces, but I lack any sort of geometric understanding of the transpose, or even symmetric matrices. For example, if I have a linear transformation, say on the plane, my intuition is to visualize it as some linear distortion of the plane via scaling and rotation. I do not know how this distortion compares to the distortion that results from applying the transpose, or what one can say if the linear transformation is symmetric. Geometrically, why might we expect orthogonal matrices to be combinations of rotations and reflections?
I am trying to improve upon this, which is just really horrible I think. I want the sorted grouped index like layout, but it seems to be quite a fight to get rid of the page numbers which are kind of meaningless in this case, since I just want an index that gives the persons name, and a date associated with them in a kind of book of anniversaries. \documentclass[twoside, 12pt]{book} \RequirePackage[a5paper,includehead,top=0.5in,inner=0.75in,outer=0.5in,bottom=0.5in]{geometry} \usepackage{imakeidx} % this hides the commar \begin{filecontents*}{necrology-book.ist} delim_0 " " delim_1 " " delim_2 " " \end{filecontents*} \makeindex[name=persons,title={Table of Names in Alphabetical Order}, options=-s necrology-book] \def\todayentrydate{} \usepackage[]{idxlayout} \newcommand*{\nop}[1]{} % this eats pages numbers \makeatletter \renewcommand{\index}[2][]{ \imki@wrindexentry{#1}{#2 \todayentrydate|nop}{0} } \makeatother \begin{document} \def\todayentrydate{2000 May 19} \index[persons]{Member!Joe Blow} Joe Blow did a lot of nice stuff. \index[persons]{Boss!Jane Doe} Jane Doe was the boss. \printindex[persons] \end{document}
I want to create a collection of exercises. For this I constructed an environment for the exercises: \documentclass[12pt,a4paper]{article} \usepackage[utf8]{inputenc} \newcounter{wf} \setcounter{wf}{0} \newcounter{Aufg} \setcounter{Aufg}{0} \newcommand{\Punkte}{0} \newenvironment{Aufgabe}[1]{% \renewcommand*{\Punkte}{#1}% \nopagebreak% \begin{list}{}{} \item[]% \makebox[0pt][l]{% \hspace{-1cm}\refstepcounter{Aufg}\textbf{\arabic{Aufg}}}%}% \ignorespaces}{ \ifnum \Punkte>0 \hspace*{0pt} \hfill \mbox{(\Punkte\ BE)} \fi% \end{list}% } \begin{document} \begin{Aufgabe}{5} This is exercise number one. Topic: Alpha \end{Aufgabe} \begin{Aufgabe}{4} And here we have exercise number two. Topic: Beta \end{Aufgabe} \begin{Aufgabe}{2} Finally exercise number three. Topic: Gamma \end{Aufgabe} \end{document} I also have substructures for the exercises (exercise A2.1.1 or so) but I want to keep it simple here and just take a look on the exercise numbers. For an index normally I would write \index{Alpha} in exercise number one (and Beta in two and gamma in three) and this would give me: Alpha 1 Beta 1 Gamma 1 Because it refers to the page number. But what I really want is an index which gives me the exercise number. So for example using \myindex{Alpha} in exercise one (and Beta in two and Gamma in three) and it should result to Alpha 1 Beta 2 Gamma 3 Or if there is a more complex structure and exercises with the same topic it should be like this: Alpha A2.2; A3.4 Beta B1.1; B1.2.1; B1.2.2 Gamma A1; B5.4 and so on. Do you have any ideas for this special problem? Thank you in advance for your help.
I can change the background and text color in Preferences, but there is not an option to change the prompt text color, it's always green! Anyway to change it to red?
Is it possible to change the colors in the command prompt for the user@computer, as well as the the current directory and command parts of the prompt display? I've already seen something like this done by OSX users, but I don't know how to do the same thing in gnome terminal (I can only change foreground and background colors). It'd be very useful when, for example, trying to compile programs that have errors, since long, unformatted messages make it hard to distinguish which lines are commands and which are output.
We are looking of moving our hosting solution over to Azure (we are a microsoft dev house so it makes sense). It just seems difficult to estimate costing for our hosting solution. To give a simple rundown of our scenario. Our application is a simple asp.net frontend that backs onto an SQL Server database. We have a two tier setup on a VPS provider with 1 VM for the web box and 1 VM for the SQL box. When a customer comes onto our hosting solution they get a web application setup in IIS on the web box and a database connected on the sql box which talk to each other and the user is provided a web link to use (multi tenant setup isnt in the pipeline at this point). Currently we pay a one of monthly cost to the VPS provider and that covers everything. Now moving to azure when we are looking at more of pay for what we use setup this changes the game a bit. What im wanting to do is to add a test company to the azure setup (we have a proof of concept copy in azure now) and simulate a days usage through it and than want to check the costs that it racks up on our account. Than create another test company and simulate a days usage and see what costs come from that. I was thinking once we've got so many test companies on the box we could than check the costs and average out that across the amount of companies and give us an estimate of how much an average company will cost us per day. Let me know if I'm being silly at this point? I would think this kind of cost forecasting would be pretty common. The problem is that the only thing we seem to be able to do is check our account every morning and see what the cost was for the previous day, it seems very difficult if not impossible to drill down more costs. We can see each thing that we use on our account page (storage, cpu, input output) but it's hard to tie these back to actual daily costs. Can anybody give advice on achieving what we are looking for?
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?
First of all, I'd like to make it clear that I've tried to post it on the Math-meta site, since this question could fit better there, but I'm not allowed because I'm new and don't have enpugh reputation yet. 11 days ago I signed up in Math-SE, with my e- mail. I've been using it,asking and answering questions without any problem; but it seems that I forgot to confirm my e-mail by clicking the link that is given by mail when you sign up. So yesterday, when I opened Chrome, I was logged out, and when I tried to log in, the page would say :" We could not find an account with that e-mail". I don't know what to do to get my account back; since the options for recovery of your account assumes your mail is registered, and mine's not. thanks!
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)
When I insert my pendrive I am given this error: Error mounting: mount: unknown filesystem type 'exfat' This is the VX-EDU version.
When trying to mount an exfat filesystem, I get the following error: Error mounting /dev/sda6 at /media/gkp/Backup: Command-line `mount -t "exfat" -o "uhelper=udisks2,nodev,nosuid" "/dev/sda6" "/media/gkp/Backup"' exited with non-zero exit status 32: mount: unknown filesystem type 'exfat' Exfat is used on some USB sticks and camera sd cards. What can I do to mount this type of filesystem?
I was reading . It looks as though this only works with ArcGIS 10. I would like to do this, but am unable to install things on the computer that has ArcGIS. Is there a way to import to QGIS without using mxd2qgis (that requires ArcGIS 10)?
I recently tried to use QGIS and I wondered if you can convert a draft ArcGIS map (*.mxd file) into a QGIS project (*.qgs file). This would avoid thematize the entire project.
I had to reinstall Ubuntu twice; is it possible there is still some left behind data? I only have one hard drive, but System Monitor shows as if I have 2? What's with the second one?
I have recently installed Ubuntu 14.04 on my dual boot PC with Windows 8.1. On Ubuntu I have seen a 524 MB drive popped up. As I take a look at it, its not swap or anything. Its contents are as follows: Can I delete the partition and extend the 104 GB partition? Or I should leave it as it is?
A letter home from daycare may be sensitive to the fact that some children have a single parent like this: Dear Parent(s), And if that same letter home wanted to be sensitive to the fact that I may have more than one child enrolled: This letter is concerning your child(ren)... But what if I have twin infants? (twinfants) This letter is about your baby(ies)... I believe the parentheses indicate that the letters within are optional, but do they also indicate that you should remove the y? EDIT: The suggested duplicate has many suggestions, none of which is backed by a guideline or rule. Is there no rule governing this behavior?
I guess “optional plural” is the correct term. I’m referring to things like It can be found at the following location(s). Please pick up your ticket(s). But how do I do that to a word that ends in ‑y? Take category for example: “category(s)” doesn’t seem correct, because categorys is a misspelling. But everything else I have tried looks ridiculous. What’s the correct approach here?
This example compiles without warnings/errors (gcc 4.8.2 -Wall): #include <stdio.h> int main() { char c; int i; printf("%p %02x\n",&i,c[&i]); printf("%p %02x\n",&c,c[&c]); // important to note that this line DOESN'T compile: //printf("%p %02x\n",&i,c[i]); // which makes sense as c is NOT an array, it is a char. return 1; } Why does the syntax c[&i] compile ? Is it intentional or an accident? Is the syntax c[&i] semantically valid ? (Does it have any useful meaning?) Example of output for me: (pointers change each time) 0xbfb2577c b7718cea 0xbfb2577b 08 This question originated from a strange bit of code 'ch2[&i]' in question here: NOTE#0 (updated, upon reflection) on duplicates/similar questions: This question is not a duplicate of the linked questions on c array references. It is related so it is useful to refer to them. The related questions discuss the valid a[b] and b[a] case where one of a or b is a pointer and the other is an int. This question deals with the more weird and maybe should be invalid case where one of a or b is a char. With C arrays, why is it the case that a[5] == 5[a]? 14 answers String as an array index 3 answers NOTE #1: This happens with compiler as the type of variable c is char and that can be used as index into array when combined with pointer. NOTE #2: for some reason, type of c[<ptr>] evaluates to type of <ptr>. E.g.: the resulting types of c[&pi] and c[&pc] cause warnings in the following code: int *pi; char *pc; pi=&i; pc=&c; printf("%p %02x\n",&pi,c[&pi]); printf("%p %02x\n",&pc,c[&pc]); Warnings on type 'int *' or 'char *' instead of 'unsigned int': c/so_cweirdchar2.c: In function ‘main’: c/so_cweirdchar2.c:13:5: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 3 has type ‘int *’ [-Wformat=] printf("pi %p %02x\n",&pi,c[&pi]); ^ c/so_cweirdchar2.c:14:5: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 3 has type ‘char *’ [-Wformat=] printf("pc %p %02x\n",&pc,c[&pc]); ^
As Joel points out in , in (aka: K & R), there is mention of this property of arrays in C: a[5] == 5[a] Joel says that it's because of pointer arithmetic but I still don't understand. Why does a[5] == 5[a]?
i'm currently learning python3 and my knowledge is basic in the broad scheme of things. I play a lot of computer games but one in particular, if there are enough friends on line we do a custom game between ourselves, so i made a program that randomises the players we have onto teams. my current code works just fine, but theres a lot of repertivness. I was wondering if there is something i can do in python3 that allows me to splice a list of names in half or half + 1 no matter the amount of names input? so it finds the amount in list, halfs it (or if its odd + 1 to a side) and randomises the names and puts them into either orange or blue team. Heres the current code: from random import shuffle players = [''] print("\nA minimum of 6 players is required to use this script") inputPlayers = str(input("Enter player names seperated by a comma: ")) players = inputPlayers.split(", ") shuffle(players) while len(players) < 6: print("\nERROR!!! A minimum of 6 players is required to use this script") inputPlayers = str(input("Enter player names seperated by a comma: ")) players = inputPlayers.split(", ") shuffle(players) starts off with importing shuffle, tells the user what to do and input wise and runs a while loop to make sure its done properly, after that comes the repetertiveness, which works just fine, i just dont like it if len(players)==6: print('Orange teams is: ') for i in players[:3]: print(i) print() print('Blue team is: ') for i in players[3:]: print(i) this then carrys on for if len(players)==7: then 8 then 9 then 10! So all in all 40 lines of repeated code. I've tried using start:end but as the list isn't and interger i get an error and my knowledge doesn't cover index method it talks about using. I know it looks silly to wanna fix something thats not broke, its more im learning and would rather do better code! any help would be great cheers Dan
I have a list of arbitrary length, and I need to split it up into equal size chunks and operate on it. There are some obvious ways to do this, like keeping a counter and two lists, and when the second list fills up, add it to the first list and empty the second list for the next round of data, but this is potentially extremely expensive. I was wondering if anyone had a good solution to this for lists of any length, e.g. using generators. I was looking for something useful in itertools but I couldn't find anything obviously useful. Might've missed it, though. Related question: