body1
stringlengths
20
4.1k
body2
stringlengths
23
4.09k
In PHP I can do like: $arrayname[] = 'value'; Then the value will be put in the last numerical key eg. 4 if the 3 keys already exists. In JavaScript I can’t do the same with: arrayname[] = 'value'; How do you do it in JavaScript?
How do I append an object (such as a string or number) to an array in JavaScript?
I was wondering how Euclid showed that there are infinitely many primes by generating a prime number from finitely many primes, and if it could be used to answer if there are infinitely many pairs of primes whose difference is 2. I show my approach in my - short - article (I know I should copy here the relevant bits, but the article is really short). My question: why is it not proved like this already? Am I missing something? Update: It seems I was too lazy to check for counterexamples. I removed my article. Thank you for the lot of feedbacks.
what's the wrong when we use Euclid logic to prove the twin prime conjecture ? $$Q1=p1*p2*p3*.....*pn+1$$ $$Q2=p1*p2*p3*.....*pn-1$$ where: $$Q1-Q2=2$$ Euclid's proof considers any finite set S of primes
I have a method readFromFile like this: private static ArrayList<ArrayList<Integer>> readFromFile(String name) { ArrayList<ArrayList<Integer>> inputs = new ArrayList<ArrayList<Integer>>(); try { InputStream in = ReadWriteFile.class.getClass().getResourceAsStream(name); BufferedReader reader = new BufferedReader(new InputStreamReader(in)); String line; while ((line = reader.readLine()) != null) { ArrayList<Integer> input = new ArrayList<Integer>(); for (int i=0; i<line.length(); i++) { int value = 0; try { value = Integer.parseInt(String.valueOf(line.charAt(i))); } catch (Exception e) { input.add(value); } inputs.add(input); } reader.close(); } } catch (IOException e) { e.printStackTrace(); } return inputs; } and I use this method here to read a folder of txt files. I need it to put the names of files in an arraylist (the files are an alphabet): public static ArrayList<TrainingSet> readTrainingSets() { ArrayList<TrainingSet> trainingSets = new ArrayList<TrainingSet>(); for (int i=0; i<26; i++) { char letterValue = (char) (i+26); String letter = String.valueOf(letterValue); for (ArrayList<Integer> list : readFromFile("C:\\Users\\hp\\Desktop\\resources\\" + letter + ".txt")) { trainingSets.add(new TrainingSet(list, GoodOutputs.getInstance().getGoodOutput(letter))); } } return trainingSets; } The source folder includes files like: A.txt, B.txt, etc. When I try to run the code I get an error. Exception in thread "main" java.lang.NullPointerException at java.io.Reader.<init>(Unknown Source) at java.io.InputStreamReader.<init>(Unknown Source) at data.ReadWriteFile.readFromFile(ReadWriteFile.java:34) at data.ReadWriteFile.readTrainingSets(ReadWriteFile.java:22) at network.Train.<init>(Train.java:16) at gui.MainGui.<init>(MainGui.java:38) at gui.MainGui.main(MainGui.java:32) I guess the method can't find the files on my computer. But I don't know why. Is the form wrong? Can you help me?
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 had to prove this: Let $A$, $B$, and $C$ be sets. Then, $A \times (B \Delta C) = (A \times B) \Delta (A \times C)$. By the definition of symmetric difference, we know that $$B \Delta C= (B \Delta C) \cup (C \Delta B).$$ So, we can expand the LHS of this theorem to get $$A \times ( (B \Delta C) \cup (C \Delta B) ).$$ Therefore, \begin{align} A \times (B \Delta C) &= A \times ( (B \Delta C) \cup (C \Delta B) ) \\ &= (A \times (B \Delta C)) \cup (A \times (C \Delta B)) \\ &= ((A \times B) \Delta (A \times C)) \cup ((A \times C) \Delta (A \times B)) \\ &= (A \times B) \Delta (A \times C). \end{align} So, the LHS = RHS. But I'm not sure how to show that cartesian products are actually distributive over unions and intersections?
I've figured out the following statement is true but I was wondering how you actually go about proving something like this? $A \times (B \triangle C) = (A \times B) \triangle (A \times C)$
Hi I'd like to know why the number next to the review link on top of the website page always indicate the number of available suggested edits and not the number of all the review tasks available. I doubt StackOverflow is a bugged website so my guess would be that there must be a reason for it. However I can't make myself a reason why it would still show up the available suggested edits when I reviewed my daily 20. Why for instance it is not showing me the number of available late answers to review, since it is most of the time 0 I think that would be useful.
Since a , I see more than I should: I see no reason to see 134 posts are awaiting review, when there is literally nothing I can do about them. I think it is a bug, because notification is meant as something that will make me act. When I know I usually can't, obviously I will start to ignore it. If it's not a bug, please remove bug tag and explain how it is supposed to be useful, or how can I switch to only seeing notifications about things I can act on. Note that apaprently there are no flags for me, neither. I see only stats, migrated, close, delete, there, as if there was no flags waiting: If you expect us to click on it every few minutes just to see personalized numbers next to queues, why don't you simply query for personalized numbers every few minutes and cache them for us? It should cost you similar, in database usage, and will save us a lot of clicking and frustration. If all this number means is "there might be reviews, or not" or "for sure there are none" it would be simpler just to hide "review" link in the second case. We don't need two links with the same function next to each other, thank you, one is enough, and meaningless numbers are only irritating.
I'm a Blender newbie and I'm trying to use it to make a simple model for a 3D project. I'm trying to edit a cube with a mirror modifier to make a symmetrical shape, but when I drag some vertices to a side in edit mode it creates new vertices on the other side instead of moving the symmetrical equivalent: What am I doing wrong?
When I add a mirror modifier it sometimes doesn't mirror correctly, giving me an overlapping mesh. How can I fix this?
I'm trying to make the input maze of Astar algorithm(alogorithm to find the shortest path between start and destination and there can be some blockages within the maze, which takes input a maze representing blockages only, as shown below). From the GUI using the Click1 command in each button, I intend to get an output like this(where I inserted a blockage at [3][2]). 1 represents blockage which is to avoided to find the path from start to end. [[0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 1, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0]] but I get a output as following,I can't understand why it's blocking the same column of each and every row [[0, 1, 0, 0, 0], [0, 1, 0, 0, 0], [0, 1, 0, 0, 0], [0, 1, 0, 0, 0], [0, 1, 0, 0, 0]] I created the maze in the init(): of class App() using this: def __init__(self, master,dimension,indexes): self.maze=[[0]*self.dimension]*self.dimension this entire thing is within a class App(): for creating the grid of buttons, and storing their reference self.gid = [] for i in range(self.dimension): row = [] Grid.rowconfigure(self.frame1, i + 1, weight=3) for j in range(self.dimension): Grid.columnconfigure(self.frame1, j + 1, weight=3) btn=Button(self.frame1,command=lambda i=i, j=j: self.Click1(i, j)) btn.grid(sticky=N+S+E+W,padx=2,pady=2,ipadx=1,ipady=1) row.append(btn) row[-1].grid(row=i + 1, column=j+1) self.gid.append(row) the Click1 method/Command that also within this class: def Click1(self, i, j): self.indxes.append((i,j)) if len(self.indxes)==1: self.gid[i][j]["bg"]="blue" #indicates start elif len(self.indxes)==2: self.gid[i][j]["bg"]="green" #indicates destinations else: self.gid[i][j]["bg"] = "black" self.maze[i][j] = 1 #how I insert blockage within the maze
I needed to create a list of lists in Python, so I typed the following: my_list = [[1] * 4] * 3 The list looked like this: [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]] Then I changed one of the innermost values: my_list[0][0] = 5 Now my list looks like this: [[5, 1, 1, 1], [5, 1, 1, 1], [5, 1, 1, 1]] which is not what I wanted or expected. Can someone please explain what's going on, and how to get around it?
Someone who loves learning and knowing and saying random facts??
Is there a term that means "a person who enjoys learning"? This term might be used to describe someone who: Is a self-motivated learner. Is curious, wants to understand many things. I understand the term "philosopher" might be a good fit, in terms of its root words, however, the general population has an inconsistent understanding of this term, so I am looking for a more precise term.
I am writing my first presentation slides with Latex using beamer. But I run into a silly problem. It is similar to the code below: \documentclass{beamer} \begin{document} \begin{frame} \tableofcontents \end{frame} \begin{frame}[<+->] \section{First Section} \begin{itemize} \item <1-> First item \item <2-> Second item \item <3-> Third item \item <4-> Forth item \end{itemize} \end{frame} \end{document} This results in four sections named First Section. How can you tell Latex that this is only one section? Thank you in advance!
I'm trying to create my first presentation with the beamer class. I saw that is possible to change the color (for example) of a part of text with overlays. I'm using {\alert{<...>}{text}} to highlight some constants inside a formula, and I noticed some issues: To have the frame title in the index on the right (for the Goettingen theme) I have to insert a \section{...} with the same title. Is it correct? Because this section seems "useless" to me, since there is already the frame title (however, if this is the case, I'll stick with it). When I use {\alert{<2->}{text}} it produce another slide inside the frame; this is fine, since it works in the presentation. However, this command creates another title in the index on the right, and this will be shown even in the presentation. Is there a way to have only one item per, let's say, frame in the index created by the theme? This is my code: \documentclass{beamer} \let\Tiny=\tiny \usetheme{Goettingen} \title{Title} \author{Me} \date{\today} \begin{document} \begin{frame} \titlepage \end{frame} \begin{frame} \frametitle{First frame} \section{First frame} \begin{itemize} \item Item 1 \[{\alpha = \alert<2->{k_1}}\] \item Item 2 \[{\alpha = \alert<2->{k_2}}\] \end{itemize} \end{frame} \begin{frame} \frametitle{Second frame} \section{Second frame} \begin{itemize} \item Item 1 \[{\alpha = \alert<2->{k_1}}\] \item Item 2 \[{\alpha = \alert<2->{k_2}}\] \end{itemize} \end{frame} \end{document} Thanks to everyone!
I bought some issues of the Linux Format magazine on the Ubuntu Software Center. I now reinstalled Ubuntu and would like to redownload the magazines. In the list, they correctly appear as "Previously Purchased", but if I try to install them, I see: There isn't a software package called lxf171 in your current software sources. Also, the magazines do not appear when I click on reinstall previous purchases in the menu. If I try to buy a new issue, everything works perfectly. Does anyone know how can I download the magazines that I already paid and donwloaded in the past?
After a reinstall of Ubuntu 12.04 ,it's impossible to install commercial games, e.g Oil Rush. It gives this error: Failed to fetch https://private-ppa.launchpad.net/commercial-ppa-uploaders/oilrush/ubuntu/dists/oneiric/main/binary-amd64/Packages The requested URL returned error: 401 Failed to fetch https://private-ppa.launchpad.net/commercial-ppa-uploaders/oilrush/ubuntu/dists/oneiric/main/binary-i386/Packages The requested URL returned error: 401 Some index files failed to download. They have been ignored, or old ones used instead. I bought these games in 11.10, but I installed these games in 12.04 before... How can I solve this problem?
I am trying to send email through OpenSSL as below : Client > openssl s_client -crlf -connect smtp.mail.yahoo.com:465 SERVER > 220 smtp.mail.yahoo.com ESMTP ready Client > HELO localhost SERVER > 250 smtp.mail.yahoo.com Client > auth login SERVER > 334 VXNlcm5hbWU6 Client > aC5rYW1yYXZh SERVER > 334 UGFzc3dvcmQ6 Client > bXlQYXNz // It's not my real password :) SERVER > 235 2.0.0 OK Client > MAIL FROM: <h.kamix@yahoo.com> SERVER > 250 OK , completed Client > rcpt to: <h.kamix1@gmail.com> SERVER > 250 OK , completed Client > data SERVER > 354 Start Mail. End with CRLF.CRLF Client > subject: Test title Client > Hello this is a test email. Client > . Client > SERVER > 250 OK , completed Client > quit SERVER > 221 Service Closing transmission SERVER > closed Everything looks fine, but it doesn't send any email and gets me Service Closing transmission error at the last step! I think it's clear enough. Please tell me what am I missing here?
This is a about how to handle email sent from your server being misclassified as spam. For additional information you may find these similar questions helpful: Sometimes I want to send newsletters to my customers. The problem is, that some of the emails get caught as spam messages. Mostly by Outlook at the client (even in my own Outlook 2007). Now I want to know what should be done to create "good" emails. I know about reverse lookup etc., but (for example), what about a unsubscribe link with an unique ID? Does that increase a spam rating?
I was constructing a proof through inequalities, but I am having a bit of problem showing the following step: $$\sum_{k=N+1}^\infty \frac {1}{k!} < \frac {1}{N!}$$ Is there any quick way to show this?
$$\sum_{k=n}^\infty{\frac{1}{k!}} \leq \frac{2}{n!}$$ Can someone show why this estimate holds true? I tried quite a bit but couldn't really find a way to approach this. says it is true but I don't know what the gamma function is. $$ \sum_{k=n}^\infty{\frac{1}{k!}} = \frac{1}{n!} + \sum_{k = n+1}^\infty \frac{1}{k!}$$ So then I need to show that$$ \sum_{k=n+1}^\infty{\frac{1}{k!}} \leq \frac{1}{(n+1)!} ~~\Big[\leq \frac{1}{n!}\Big]$$ Is it possible to do this by induction? I don't really know how to approach this now.
Suppose $A$ be an $n×n$ real matrix be such that $A^k= O$ for some $k \in \Bbb N$ then prove that $I+A$ is invertible. Please do not use eigenvalues.
If $ua = au$, where $u$ is a unit and $a$ is a nilpotent, show that $u+a$ is a unit. I've been working on this problem for an hour that I tried to construct an element $x \in R$ such that $x(u+a) = 1 = (u+a)x$. After tried several elements and manipulated $ua = au$, I still couldn't find any clue. Can anybody give me a hint?
The publisher requires that I have captions and references of resp. to figures that include the chapter number. So in chapter 27 it has to be figure 27.1, 27.2, ... in the captions. \refhas to be adapted as well. How can this be done?
Some document elements (e.g., figures in the book class) are numbered per chapter (figure 1.1, 1.2, 2.1, ...). How can I achieve continuous numbering (figure 1, 2, 3, ...)? And vice versa: Some document elements (e.g., figures in the article class) are numbered continuously. How can I achieve per-section numbering? \documentclass{book}% for "vice versa" variant, replace `book` with `article` \begin{document} \chapter{foo}% for "vice versa" variant, replace `\chapter` with `\section` \begin{figure} \centering \rule{1cm}{1cm}% placeholder for graphic \caption{A figure} \end{figure} \end{document} Bonus question: Is it possible to adjust the numbering of the sectioning headings themselves? Can I, e.g., switch from per-chapter to continuous numbering of sections in the book class?
I've considered the equation by modulo 9 and tried the binomial theorem $$4^n=(6-2)^n$$ but I still cannot prove it. Maybe there is a clever solution but so far I have been unable to spot it. Can anyone help me?
Prove that for all $n\in\mathbb N$, $9 \mathrel| (4^n+6n-1)$. I have shown the base case if $n=0$ (which is a natural number for my course). I'm now trying to prove that $9k=4^n+6n-1$. I substituted $n+1$ for $n$, and have $4^{(n+1)}+6(n+1)-1$, which equals $4*4^n+6n+5$. I'm stuck. Is that not the right way to go? I don't know how to get from the “$+5$” to “$-1$” so I can substitute $9k$ to the right side of the equation. Any help would be greatly appreciated.
Prove that if $x_n$ goes to x, then $(x_1x_2\ldots x_n)^{\frac{1}{n}}$ goes to $x$.
This is not a duplicate of this . The linked question says that it suffices to show that if $(x_n)\to x$ then $(\frac{x_1+\cdots+x_n}{n})\to x$ to prove my question, but how so? I tried using the same strategy as how one proves that if $(x_n)\to x$ then $(\frac{x_1+\cdots+x_n}{n})\to x$, by "splitting" the product in th $N$th term: $$\sqrt[n]{x_1x_2\cdots x_n}=\sqrt[n]{x_1x_2\cdots x_Nx_{N+1}\cdots x_n}=\sqrt[n]{x_1x_2\cdots x_N} \sqrt[n]{x_{N+1}\cdots x_n}$$ but it seems I can't use for now the definition of convergence of $(x_n)$ because of the $n$th root. I also tried to use a result: if $(x_n)\to x$ then $(\frac{x_n}{n})\to 1$ but don't know if this is true. Sadly I've had no real progress. Any help will be greatly appreciated, thanks in advance!
I made a program that writes a structure into a binary file, and then reads that binary file into a different variable. Writing into file and reading from it works fine, however the program crashes on exit. I tried using the same variable for reading which works, but is not the solution I'm looking for. I want to know why the program crashes when I read structure from binary file into a different variable. Here's the code: #include <iostream> #include <fstream> #include <ctime> #include <stdlib.h> using namespace std; struct t_student{ string name; string lastname; int mark; }; int main(){ t_student student[30], student_read[30]; int n, i; srand(time(0)); fstream dat("student.dat", ios::in | ios::out | ios::binary | ios::trunc); cout << "Input number of students (up to 30): "; cin >> n; if(n > 30) n = 30; cout << endl; cin.ignore(); for(i = 0; i < n; i++){ cout << "Input first name: "; getline(cin, student[i].name); cout << "Input last name: "; getline(cin, student[i].lastname); student[i].mark = rand()%5+1; cout << endl; dat.write((char *) &student[i], sizeof(student[i])); } dat.clear(); dat.seekg(0); i = 0; while(!dat.eof()){ dat.read((char *) &student_read[i], sizeof(student_read[i])); if(dat.eof()) break; cout << endl << student_read[i].name << " " << student_read[i].lastname << " - " << student_read[i].mark; i++; } dat.close(); cin.get(); //exit(0); } As you might notice, I also added exit(0) function, which prevents the program from crashing, but I want to know why the program crashes in the first place. Thanks for your help.
I have a small hierarchy of objects that I need to serialize and transmit via a socket connection. I need to both serialize the object, then deserialize it based on what type it is. Is there an easy way to do this in C++ (as there is in Java)? Are there any C++ serialization online code samples or tutorials? EDIT: Just to be clear, I'm looking for methods on converting an object into an array of bytes, then back into an object. I can handle the socket transmission.
As an undergraduate I'm relatively new to academia. I was wondering if publishing a paper on arXiv could potentially be an issue if I were to want to get the same paper in, say, Nature, for why would Nature be okay with their material being openly available online? Isn't there a copyright issue here?
If I publish a pre-print paper on arXiv, how can I guarantee exclusive rights to the publisher afterwards? Am I unable to publish on non-open access journals after I publish a pre-print on arXiv ?
I was recently browsing through Meta, when I came across which was made a Community wiki. When I was looking through it, I realized that the user who had asked the question, () had changed his username from "Sonic the Masked Werehog" to "Sonic the Curiouser Hedgehog" (presumably) after the question that they asked was made Community Wiki. Is this a bug? or a feature that was left as-is like the "feature" that usernames mentioned in comments do not change after the user has changed their name?
On a whim the other day, I changed my meta name from Lord Torgamus to Popular Demand. I just noticed that the old name has "stuck" to the author tag of ; everywhere else on meta, my new name displays as expected. Is this a feature? Is it a bug? Mostly I'm just curious, as I can't think of a strong reason in favor of keeping this behavior or a strong reason for changing it. A question somewhat like this has been raised before as , but the previous poster implied that the issue had something to do with migration, which my situation shows is not the case.
Let us consider $(X,\tau)$ a Hausdorff topological space y let $\infty$ an element such that $\infty \notin X$. Then $(\hat X, \hat \tau)$ is topological space, where $\hat X= X \cup \lbrace \infty \rbrace$ and $\hat \tau=\tau \cup \lbrace \hat X-C :$ C is a compact subset of $(X, \tau) \rbrace$. Well. Now I have to show that: Be $(X_1,\tau_1)$ and $(X_2,\tau_2)$ Haussdorf spaces, locally compact and are not compact. If $(X_1,\tau_1)$ and $(X_2,\tau_2)$ are homeomorphic then $(\hat X_1,\hat \tau_1)$ and $(\hat X_2,\tau_2)$ are homeomorphic. My attempt. If $f$ is a homeomorphism between $X_1$ and $X_2$ then we define $\hat f : (\hat X_1,\hat \tau_1)\rightarrow (\hat X_2, \hat \tau_2)$ by $\hat f(x)=f(x),\forall x \in X_1$ and $\hat f(\infty_1)=\infty_2$. Clearly this function is bijective but I can't show that $\hat f$ is continuos and an open (or closed) map. Any hint can be useful. Thanks
Say $X^{*}$ represents the one-point compactification of a space $X$ that is locally compact, non-compact, and Hausdorff. Also suppose that $Y$ is compact Hausdorff and $Y-\{p\}$, for a single point $p$, is homeomorphic to $X$. So then would $Y$ be homeomorphic to $X^{*}$? I think it is, but I'm not sure how it can be shown. My attempt so far: Correct me if I'm wrong, but I started with inclusions $i: X \rightarrow X^{*}$ and $j: Y-\{p\} \rightarrow Y$, along with the homeomorphism $h: X \rightarrow Y-\{p\}$. So we need to find a homeomorphism $g: X^{*} \rightarrow Y$. So I tried using a commutative diagram and so far, I've concluded that $g$ (if it is to exist) would have to be continuous since the continuous image of a compact space is compact (I think this follows from $X^{*}$ being compact), but then one of my inclusions, i.e. $i$, can't possibly be continuous, can it (since $X$ is not compact)? How can this be fixed?
I am trying to find a hidden file that I know the name, but no the location of. The name is "message", and I have tried sudo locate *message*, but I have not found it. I have too much output, plus I do not think locate is showing the hidden files. Any ideas?
I wanted to add classpath to my JDK. While searching a way to do it I noticed everyone open .profile file using terminal. But when I want to open and edit it with a text editor I couldn't see that file in Home folder. Can someone tell me why is this. And also if possible how can I access .profile in home folder the GUI way.
Usually, the prediction interval has this shape in the image. I don't know why the end of the interval is wider than the center.
I have noticed that the confidence interval for predicted values in an linear regression tends to be narrow around the mean of the predictor and fat around the minimum and maximum values of the predictor. This can be seen in plots of these 4 linear regressions: I initially thought this was because most values of the predictors were concentrated around the mean of the predictor. However, I then noticed that the narrow middle of the confidence interval would occur even if many values of were concentrated around the extremes of the predictor, as in the bottom left linear regression, which lots of values of the predictor are concentrated around the minimum of the predictor. is anyone able to explain why confidence intervals for the predicted values in an linear regression tend to be narrow in the middle and fat at the extremes?
I have a table created with the following T-SQL: CREATE TABLE [dbo].[TableName]( [id] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY CLUSTERED ( [id] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] I took a look at this table today and noticed the id column was skipping values: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 1027, 1028, 1029, 1030, 1031, 1032, 1033, 1034, 1035, 2034, 2035, 3034 I'm not worried about this or anything (my application doesn't care what the primary key is), I was just curious about what might cause this to occur. It does seem there's a sort of pattern, of jumping 1000 every time a "jump" happens. My application using entity framework to insert these rows, if that makes any difference.
I'm trying to generate unique purchase order numbers that start at 1 and increment by 1. I have a PONumber table created using this script: CREATE TABLE [dbo].[PONumbers] ( [PONumberPK] [int] IDENTITY(1,1) NOT NULL, [NewPONo] [bit] NOT NULL, [DateInserted] [datetime] NOT NULL DEFAULT GETDATE(), CONSTRAINT [PONumbersPK] PRIMARY KEY CLUSTERED ([PONumberPK] ASC) ); And a stored procedure created using this script: CREATE PROCEDURE [dbo].[GetPONumber] AS BEGIN SET NOCOUNT ON; INSERT INTO [dbo].[PONumbers]([NewPONo]) VALUES(1); SELECT SCOPE_IDENTITY() AS PONumber; END At the time of creation, this works fine. When the stored procedure runs, it starts at the desired number and increments by 1. The strange thing is that, if I shut down or hibernate my computer, then the next time the procedure runs, the sequence has advanced by almost 1000. See results below: You can see that the number jumped from 8 to 1002! Why is this happening? How do I ensure that numbers aren't skipped like that? All I need is for SQL to generate numbers that are: a) Guaranteed unique. b) increment by the desired amount. I admit I'm not a SQL expert. Do I misunderstand what SCOPE_IDENTITY() does? Should I be using a different approach? I looked into sequences in SQL 2012+, but Microsoft says that they are not guaranteed to be unique by default.
I was wondering if anyone could recommend some books for studying topics such as abstract manifolds, differential forms on manifolds, integration of differential forms, Stokes' theorem, de Rham cohomology, Hodge star operator? Our text is A Comprehensive Introduction to Differential Geometry by Spivak, but I think this book is very difficult for a beginner to learn. Thanks in advance.
I have a hazy notion of some stuff in differential geometry and a better, but still not quite rigorous understanding of basics of differential topology. I have decided to fix this lacuna once for all. Unfortunately I cannot attend a course right now. I must teach myself all the stuff by reading books. Towards this purpose I want to know what are the most important basic theorems in differential geometry and differential topology. For a start, for differential topology, I think I must read Stokes' theorem and de Rham theorem with complete proofs. Differential geometry is a bit more difficult. What is a connection? Which notion should I use? I want to know about parallel transport and holonomy. What are the most important and basic theorems here? Are there concise books which can teach me the stuff faster than the voluminous Spivak books? Also finally I want to read into some algebraic geometry and Hodge/Kähler stuff. Suggestions about important theorems and concepts to learn, and book references, will be most helpful.
I have an internal SSD containing a single partition with Ubuntu on it. I am currently booting from this partition. However, to actually boot a second (HDD) drive is required which has an EFI partition on it. I want to remove the HDD and continue to boot Ubuntu from its location on the SSD, without having to reinstall anything. I am thinking what I need to do is to resize the partition on the SSD to allow space for an EFI partition, move it (the start of the existing partition ahead/up), create an EFI partition before it, and then install something on the new EFI partition so it will boot from the existing Ubuntu install on what would now be the second partition. I have bits and pieces of what I think I need to do (for instance, I think GParted can do the moving and resizing) but I don't have a clear enough picture of exactly what I need to do in order to avoid risking data loss. Also, it seems like this is an uncommon procedure, as I see these various activities mentioned as parts of other processes, but never creating an EFI partition from scratch. Exactly what steps do I need to do to safely modify my single partition SSD to boot by itself?
A while back I installed Linux on my SSD, sdb1. I also have a 1 terabyte drive for my home directory, sdc1. I have Windows on another hard drive, sda1, which I haven’t booted into in over 2 years. It is a terabyte in size. I would like to get rid of Windows and utilize that extra space without reinstalling Linux, but Grub is on the Windows hard drive, sda1. What I would like to do is put Grub onto my SSD, sdb1, if possible in order to format the Windows drive, sda1, and have extra space. It is Legacy BIOS on the computer.
I started to have problems with my Ubuntu application switcher (Alt + Tab) this morning. When I press Alt + Tab, not only one, but two application switchers show up. Last night I customized some stuff using the Unity Tweak Tool. I thought I didn't touch the application switcher. So now it looks like this:
I have two Alt+Tab window switchers. It's super confusing to try to use them. This screenshot shows it pretty well: How can I get back to the regular switcher (the one in the background)? I'm guessing the one in the front is the older switcher. It seems the current behavior is that both switchers are functioning, but the one on top get's the "last word." So the selected window in the bottom switcher will be second to the top, while the one in the top switcher will be in front. Background: I lost Unity and finally got it back, after trying a lot of things. What finally worked was solution #1 from : sudo rm -fr ~/.cache/compizconfig-1 sudo rm -fr ~/.compiz Shortly before Unity disappeared (possibly the previous time the computer was on) I ran sudo apt-get dist-upgrade, which I am suspecting may have caused the problem. What I've tried: sudo apt-get install --reinstall compiz and then log out.
Let $h:X\to X$ denote an endomorphism of a module $X$ over $R$ satisfying $h\circ h = h$. Prove $$X = Im(h)\oplus Ker(h)$$ I have this theorem: If the composition $h=g\circ f$ of two homomorphisms $f:X\to Y$ and $g:Y\to Z$ of modules $X,Y,Z$ over $R$ is an isomorphism, then the following statements hold: i) $f$ is a monomorphism ii) $g$ is an epimorphism iii) The module $Y$ is decomposable into the direct sum of $Im(f)$ and $Ker(g)$ Wel, the composition $h\circ h$ is surely a bijection, and since i'ts an endomorphism, it's a homomorphism. So should it follow directly from this theorem?
If $f:A\rightarrow A$ is an $R$-module homomorphism such that $ff=f$, show that $$A=\ker f\oplus{\rm im}~f$$ Here is a part of what I made as a proof. Let $a\in A$. $f(a)\in{\rm im}~f$, $f(a)\in A$ since $f$ is from $A$ to $A$, $a-f(a) \in A$ since $A$ is a module. Consider $f(a-f(a))$. Since $f$ is a module homomorphism, $$f(a-f(a))=f(a)-ff(a)=f(a)-f(a)=0,$$ therefore $a-f(a)\in\ker f$. We have $a-f(a)\in\ker f$ and $f(a)\in{\rm im}~f$. $$(a-f(a))+f(a)=a-f(a)+f(a)=a$$ So $a\in A$ can be written as the sum of an element in $\ker f$ and an element in ${\rm im}~f$ and since $\ker f$ and ${\rm im}~f$ are submodules of $A$, we have $$A=\ker f+{\rm im}~f.$$ I was also able to show that the intersection of $\ker f$ and ${\rm im}~f$ is $\{0\}$. I showed this proof to one of my senior and he said that what I actually did in my proof was show that $A$ is the Internal Direct Sum of $\ker f$ and ${\rm im}~f$. Looking back at the problem, what is asked is to prove that $A$ is the External Direct Sum of $\ker f$ and ${\rm im}~f$. I got the internal and external direct sum wrong but I understand them now. Now how would I go on proving the problem? Here are some of my questions/ideas: Since I'm trying to prove that $A$ is an external direct sum may I assume that $A=X\oplus Y$ where $X$ and $Y$ are modules? Then try to prove that that $\ker f=X$ and ${\rm im}~f=Y$? Also, if $A$ is the external direct product of $\ker f$ and ${\rm im}~f$ then that means that an element in $A$ is of the form $(x,y)$ where $x\in\ker f$ and $y\in{\rm im}~f$ right? Does that mean that I have to define $f$ in $X$ and $Y$? Is it possible to salvage my proof above? When does the internal direct sum equal to the external direct sum? I know that it is always the case that the two are isomorphic. If I remember correctly in groups it is possible for the internal direct product and the external direct product to be equal. I hope you guys could clarify some things to me and point me in the right direction. Thank you!
There is a wrapper for a tuple, it describes the function of access to the elements of the tuple. This wrapper is used in the template function of a class that performs the search for a specified type. Here is the code template function: template < Calculating::CalculateTypes calculateType, class SourceDataType = typename calculating_list_type::template strategy_type_selector<calculateType>::source_data_type > auto calculate(const SourceDataType & sourceData) -> decltype(typename calculating_list_type::template strategy_type_selector<calculateType>::result_type()) { auto& strategy = _calculates.lookup<calculateType>(); //error in this place... strategy.setSourceData(sourceData); strategy.calculate(); return strategy.getResult(); } In this context, _calculates is a member of the class, which we call the function, the type of data: calculating_list_type Here's the code to access the wrapper function tuple: template<CalculateTypes calculateType> inline auto lookup() -> decltype(std::get<Private::IndexOfList<calculateType, StrategyTypes...>::value>(_calculatingTuple)) { return std::get<Private::IndexOfList<calculateType, StrategyTypes...>::value>(_calculatingTuple); } What is most interesting is that a template function access function works perfectly for example: std::cout << es.getCalculateList().lookup<Calculating::CalculateTypes::MAIN_VOLUME>().getName() << std::endl;// works great... What did I do wrong?
In templates, where and why do I have to put typename and template on dependent names? What exactly are dependent names anyway? I have the following code: template <typename T, typename Tail> // Tail will be a UnionNode too. struct UnionNode : public Tail { // ... template<typename U> struct inUnion { // Q: where to add typename/template here? typedef Tail::inUnion<U> dummy; }; template< > struct inUnion<T> { }; }; template <typename T> // For the last node Tn. struct UnionNode<T, void> { // ... template<typename U> struct inUnion { char fail[ -2 + (sizeof(U)%2) ]; // Cannot be instantiated for any U }; template< > struct inUnion<T> { }; }; The problem I have is in the typedef Tail::inUnion<U> dummy line. I'm fairly certain that inUnion is a dependent name, and VC++ is quite right in choking on it. I also know that I should be able to add template somewhere to tell the compiler that inUnion is a template-id. But where exactly? And should it then assume that inUnion is a class template, i.e. inUnion<U> names a type and not a function?
i am new to JQuery.I need to convert the below string into following dateTime format.How to achieve this? string value: var w = "/Date(1388514600000)/" Expected Date format Example:- "Wed Jan 01 2014 00:00:00 GMT+0530 (India Standard Time)" I need to achieve above without jQuery DatePicker UI and anyother UI? Is this possible to achieve my Expected value in given string? i am tried like this:- var d=date.parse(w); console.log(d); output:- NaN Any help or an idea will be more helpful? Thank you.Please give me a suggestion! how to achieve above in JQuery?
I'm taking my first crack at with jQuery. I'm getting my data onto my page, but I'm having some trouble with the JSON data that is returned for Date data types. Basically, I'm getting a string back that looks like this: /Date(1224043200000)/ From someone totally new to JSON - How do I format this to a short date format? Should this be handled somewhere in the jQuery code? I've tried the jQuery.UI.datepicker plugin using $.datepicker.formatDate() without any success. FYI: Here's the solution I came up with using a combination of the answers here: function getMismatch(id) { $.getJSON("Main.aspx?Callback=GetMismatch", { MismatchId: id }, function (result) { $("#AuthMerchId").text(result.AuthorizationMerchantId); $("#SttlMerchId").text(result.SettlementMerchantId); $("#CreateDate").text(formatJSONDate(Date(result.AppendDts))); $("#ExpireDate").text(formatJSONDate(Date(result.ExpiresDts))); $("#LastUpdate").text(formatJSONDate(Date(result.LastUpdateDts))); $("#LastUpdatedBy").text(result.LastUpdateNt); $("#ProcessIn").text(result.ProcessIn); } ); return false; } function formatJSONDate(jsonDate) { var newDate = dateFormat(jsonDate, "mm/dd/yyyy"); return newDate; } This solution got my object from the callback method and displayed the dates on the page properly using the date format library.
Evaluate $$\sum_{n=0}^\infty (n+1)\left(\frac13\right)^n.$$ $$1 + 2\left(\frac{1}{3}\right) + 3\left(\frac{1}{3}\right)^2 + 4\left(\frac{1}{3}\right)^3 + 5\left(\frac{1}{3}\right)^4 +\cdots$$ Show using ‘Techniques of Convergence of Geometric Series’ only that it converges to 9/4?
How can I evaluate $$\sum_{n=1}^\infty\frac{2n}{3^{n+1}}$$? I know the answer thanks to , but I'm more concerned with how I can derive that answer. It cites tests to prove that it is convergent, but my class has never learned these before. So I feel that there must be a simpler method. In general, how can I evaluate $$\sum_{n=0}^\infty (n+1)x^n?$$
Basically I am creating a simply game, I want circles to appear but they can not overlap each other when they are printed on the screen. The objects are created and then put into an arraylist and when ever another is created it needs to check its coordinates with all the others already in the arraylist to make sure its not the same. The method to check is called isCollidingWith and there is a setPosition method that actually sets the position. This is what I have. This is how the object is created, I can't even get one to be created, once I get it working I would create more of these objects, hence the whole point of this. Circle circle = new Circle(rng,circles); circles.add(circle); This is the constructor for the object takes in a random number and and arraylist of circles. It starts with a while loop and sets a position for this circle it then goes into a for loop and checks if it is colliding with and of the other ones, if it is, it breaks and goes back to the top of the while loop and sets a different positions and then repeats checking if it is colliding with any of the other ones already in the arraylist. public Planet(Random rng, ArrayList<Circle> circles){ boolean key = true; while(key){ this.graphic.setPosition(rng.nextFloat()*GameEngine.getWidth(),rng.nextFloat()*GameEngine.getHeight()); for(int i = 0; i<circles.size();i++){ if(this.graphic.isCollidingWith(circles.get(i).graphic)){ key = true; break; } else key = false; } } } The problem is I keep getting a NullPointerException at the line in the constructor where it says this.graphic.setPosition. But I am guessing it has to do with the arraylist, because eclipse usually isn't that accurate with error positioning. If anyone could tell me what looks to be wrong here that would be great.
What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them? What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?
Is it possible to make an hyperlink like on a comment?
Across the Stack Exchange network you may leave comments on a question or answer. How do comments work? What are comments for, and when shouldn't I comment? Who can post comments? Who can edit comments? How can I format and link in comments? My comment doesn't contain some of the text I typed in it; why? My comment appears to be long enough, but I can't post it because it's too short; why? Who can delete comments? When should comments be deleted? Why can't I comment on specific posts even if I have enough reputation to comment? When can comments be undeleted? What are automatic comments? How can I link to comments? Anything else I should know about comments? Also see the FAQ articles on and .
I wanted to challenge the Pumpkin Moon. I keep getting to Wave 8 and the night ends. The problem might be that I'm not killing them fast enough. I tried an arena but it either fails, kills me, or is very slow. I have a lot of really good Items. I currently wear Dragon Armour, Spectral Armour and Titan Armour. If that makes a difference. I got the Horsemans Blade. I was able to get Red's Wings before they updated it. How do I get to wave 15 of the pumpkin moon? What strategy do I use?
I have fought the pumpkin moon and died like 3 times and made it to wave 7 or 6 whenever the pumpking first appears. I have full turtle armor and my primary melee weapon is a demon sickle. I also have the possessed hatchet, magnet sphere, and sniper rifle. I also have other gear like the Uzi. What should I replace, what should I take out, and what should I add? Thanks!
I just received the second upvote for my question, I got only 5 reputation points whereas for my previous upvote for the same question I got 10 reputation points. I observed the same problem for some other questions also.
After thinking about which I declined for the reasons , and I have a proposal. How about if question upvotes were only worth +5 rep instead of +10? And this was applied retroactively? (answer upvotes would be unchanged from the current behavior, so this would be question specific.) This seems to be a better solution to the particular problem without all the rather serious negative repercussions of increasing the punitive value and/or cost of downvotes across the board.
# tar -jxvf compat-wireless-2010-06-26-p tar (child): compat-wireless-2010-06-26-p: Cannot open: No such file or directory tar (child): Error is not recoverable: exiting now tar: Child returned status 2 tar: Error is not recoverable: exiting now please i need help
But when I try to run it using tar zxvf jre-8u151-linux-i586 I get tar (child): jre-8u151-linux-i586: Cannot open: No such file or directory tar (child): Error is not recoverable: exiting now tar: Child returned status 2 What is wrong? The name and place matches prefectly.
First, I'm sorry to create a post for this question, but I'm not able to find the awser by myself. I have a idea to improve a little the modeling / sculpting work flow in blender, but I don't know how can I send the ideia to the developeres, so they can judge and do it, or not. Any help is welcome, TYVM.
The only place I am aware of is the .
Let $V_{n}(F)$ be a vector space over the field $F=\mathbb Z_{p}$ with $\dim V_{n} = n$, i.e., the cardinality of $V_{n}(\mathbb Z_{p}) = p^{n}$. What is a general criterion to find the number of bases in such a vector space? For example, find the number of bases in $ V_{2}(\mathbb Z_{3})$. Further, how can we find the number of subspaces of dimension, say, $r$? I need a justification with proof. I have a formula, but I am unable to understand the basic idea behind that formula.
I am asked to find how many there are $k$-dimensional subspaces in vector space $V$ over $\mathbb F_p$, $\dim V = n$. My attempt: 1) Let's find a total number of elements in $V$: assume that $\{v_1, v_2, \cdots, v_n\}$ is a basis in $V$. Then, for every $v \in V$ we can write down $$ v = a_1 v_1 + a_2 v_2 + \cdots + a_n v_n $$ and since the coordinates ($a_1, \cdots, a_n$) are from $\mathbb F_p$ there are $p^n$ vectors in $V$; $p-1$ without the zero vector. 2) Let's look at a situation where $k=1$. Let's call this 1-dimensional space $V'$. $$\forall v' \in V'. v' = a_1 v_1$$ where $v_1$ is a basis in $V'$. We know that if there are two non-zero vectors $u \in V'_1$ and $v \in V'_2$, they are not linear dependant. So, every 1-dimensional subspace has $(p-1)$ basises. Therefore, there are $\frac{p^n - 1}{p-1}$ possible 1-dimensional subspaces in $V$ 3) k-dimensional subspace is defined by the set of it's basises. Since basis can not contain zero vectors we can write down the formula for selecting $k$ linear independent vectors: $C^k_m (p-1)^k$, where $m = \frac{p^n - 1}{p-1}$. Here we first choose $k$ 1-dimentioanl subspaces and then we choose one of $(p-1)$ non-zero vectors from each of the subspaces. 4) .. unfortunately, this is where I am stuck. My intuition says that the answer may be $\frac{p^n - 1}{(p-1)^k}$, but this might be completely wrong and I don't know how to go about finishing the problem. Thanks in advance.
In a uniform perpendicular magnetic field , force on charged particle cause change in direction of momentum. How do we explain it using conservation of momentum? I don't know what is Hamilton or canonical or something like that.
is a question about the canonical momentum that I had asked some days ago, but I still have one point that I am not understand. Considering a particle moves in a magnetic field with charge $q$ and mass $m$, its hamiltonian is $$H=\frac{\vec{P}^2}{2m}=\frac{(\vec{p}+q\vec{A})^2}{2m}$$ where $\vec{p}$ is the momentum of the particle, $\vec{A}$ is the vector potential of the magnetic field and $\vec{P}$ is the canonical momentum of the particle. I think, because of the expression of the hamiltonian, the canonical momentum $\vec{P}$ is a conserved quantity. But by the answer in , it seems that the canonical momentum is not conserved even in a simple example that a particle moves in a homogeneous magnetic field. I am confused about this question. Is the canonical momentum conserved when a particle moves in magnetic field?
I found a way to earn reputation by downvoting. Specifically: If I downvote a post, then wait a while, then un-downvote the post, my net reputation count increases by 1. Here's why it's happening. Two days ago, I posted an answer to question on math.SE. It became a "hot" network question and I quickly reached my daily reputation limit. Thus, the question kept getting upvoted, but I wasn't earning reputation for it (as it should be). Today, I once again reached my daily reputation limit. After reaching this limit, I downvoted a post on math.SE. So, my daily earned reputation was effectively 199. The next time somebody upvoted my question, I gained +1 reputation. But then, I retracted the downvote. To my surprise, I gained another +1 reputation. Here is the data on the reputation I gained today: Usually, I would have earned 215 in total: 200 reputation from upvotes and 15 from one accepted answer. But instead I earned 216 because I gained the extra +1 from retracting the downvote after already being "reimbursed". Obviously, this trick isn't widely applicable. A user has to already have reached their reputation cap. And due to the limit of 40 votes per day, they would only be able to use this trick to earn a maximum of 40 bonus reputation points per day. I realize I'm not the first to point out inconsistencies in the voting system (see , , ). But as far as I can tell, this is the first instance where it is possible for a user to reliably game the system to earn 40 reputation per day without making any contributions. Is this a bug? Should it be addressed?
I just experienced a minor visual bug. I had an answer that earned 2 down votes and 22+ upvotes, earning me the daily maximum of +200. Upon making some edits to the answer at the behest of the comments, one of the users who down voted changed their vote. Now my reputation meter shows that I gained +202 for the day. This correctly did NOT affect my reputation, as I still only gained 200, so it is merely a minor display bug. This appears in the achievements drop down and my reputation tab on my profile.
I have been told to avoid using Environment.TickCount() as it overflows in about a month of uptime and can mess up my code, so I was wondering if DateTime.Now.Ticks() would be a safer choice for long terms ? I mean when will it overflow ?
Is it ever OK to use Environment.TickCountto calculate time spans? int start = Environment.TickCount; // Do stuff int duration = Environment.TickCount - start; Console.WriteLine("That took " + duration " ms"); Because TickCount is signed and will rollover after 25 days (it takes 50 days to hit all 32 bits, but you have to scrap the signed bit if you want to make any sense of the math), it seems like it's too risky to be useful. I'm using DateTime.Now instead. Is this the best way to do this? DateTime start = DateTime.Now; // Do stuff TimeSpan duration = DateTime.Now - start; Console.WriteLine("That took " + duration.TotalMilliseconds + " ms");
There is a sign at my work that says "Join the fight for Alzheimer's first survivor" and I am wondering about the use of "Alzheimer's" here. They are not reffering to a survivor of Alzheimer, they are referring to a survivor of Alzheimer's disease and using Alzheimer's as a short form of the disease. What would the possessive form of Alzheimer's be? I don't think it should be Alzheimer's's but i also don't think that it is correct as is. When searching for "double possessive" rules I can only find articles saying to avoid phrases like "St Paul's Cathedral's arches" is the only correct form to rearrange the syntax to be "Join the fight for the first survivor of Alzheimer's?"
If the cricket ground Lord's is a possessive, what if you want to describe something belonging to Lord's? Would you say: I was very impressed by Lord's's customer services. It doesn't look right, so what is the correct way of writing it?
In the Android app, if I start writing a comment, then change the screen orientation (usually because I'm commenting while running for a bus), I can no longer continue typing in the comment box. I can focus on the box, and bring the keyboard up, but typing does nothing. Refreshing the question doesn't fix it either. The only way around it is to completely exit the question, and go back in.
There's a bug in the Android app where a comment can be typed in but not posted, meaning the post button does nothing and I have to back out of the question and go back in to post the comment. This definitely happens when the screen rotates, and also other times but I haven't identified them exactly. I have version 1.0.78. Edit: This had stopped happening but now started happening again when I updated to Android 6.0.1, now with version 1.0.85.
I am plotting data with pgfplots using semilogxaxis that use base 10 logarithm. Is there a way to change the base of logarithmic-axes (I need an axis where power of 2 values are separated by the same amount of pixels) ?
I have made a chart using pgfplots as written below and I want to have the y-axis in logarithmic scale. This code works fine but the base of the logarithm is 10. How can I change it to base 2? \begin{tikzpicture} \begin{axis}[ height=0.5\textwidth, width=\textwidth, xlabel=LabelX, xtick={1,...,10}, ylabel=LabelY, ymode=log, ] \addplot[mark=*,blue] table[x=V,y=R] {data1.data}; \addplot[mark=x,red] table[x=V,y=E] {data2.data}; \end{axis} \end{tikzpicture}
I'm writing a program in Java. They say to not use String functions - so how can I get characters in a String using the index but not using charAt()? other question has answer but they all are using charAt() I also want to get characters one by one using a loop.
StringTokenizer? Convert the String to a char[] and iterate over that? Something else?
I have downloaded Ubuntu onto a bootable usb. I want to dual boot my laptop to run Ubuntu, so I turn off my laptop and turn it back on with the usb in the laptop. I am not given the option to dual boot or even run Ubuntu. It would be great if someone could help me, thanks.
I have a laptop with Ubuntu installed as the only OS. I also have a USB stick with a Windows 7 installation on it. I want to install Windows from the USB stick on my laptop but when I try to restart the laptop to get access to BIOS, I can't seem to find the command for it, its like it skips everything and just says Ubuntu and then takes me to the login screen. How do I change the boot priority to USB in Ubuntu?
I noticed following difference in behavior when I use map, select, and other methods. Let's assume we have a hash like below: h = {a: 1} Below code prints the output of select as expected. p h.select { |k, v| true } #=> {:a=>1} However, below code shows that output is an Enumerator, even when a block has been provided. p h.select do |k, v| true end #=> #<Enumerator: {:a=>1}:select> Any idea why this difference of behavior? I run into this issue often as I keep using inspect p while working, and this behavior derails my thought process quite often.
I extracted simple example: require 'pp' x = 1..3 pp x.map do |i| {:value => i, :double => (i*2)} end pp x.map { |i| {:value => i, :double => (i*2)} } pp(x.map do |i| {:value => i, :double => (i*2)} end) pp(x.map { |i| {:value => i, :double => (i*2)} }) I am wondering why first pp produces: [1, 2, 3] While all the oders are giving: [{:value=>1, :double=>2}, {:value=>2, :double=>4}, {:value=>3, :double=>6}] I assume it has something to do with operator precedence. Where can I find good explanation?
How do i screenshot on samsung galaxy s~3 Model number GT-S5280 Android Version4.1.2
Is there a way to take a screenshot of an Android device and save it as an image file?
I ask if I can to use a variable condition on PYTHON like PHP : <?php $var = (5 = 5) ? true : false; ?>
If Python does not have a ternary conditional operator, is it possible to simulate one using other language constructs?
I want to buy a new "compact" (in terms of size) camera to replace my ageing Canon S90. I have a Canon 6D which I use for travel and dedicated "photo walks", but I also use my S90 quite often when I'm not in the situation where my DSLR is with me or when it's unsuitable, a casual night out with friends, concerts, dinners, on the street commuting, spontaneous trips, etc. So size is one of the biggest priority, second is it should be better than my S90 in all specs. I would want to know if I were to stick with my new purchase for at least 5 years, would a large sensor compact like the Sony RX100 II, Ricoh GR, etc (preferably with zoom as it's much more flexible imo) be a better choice over the currently smallest (as Panasonic puts it) micro 4/3s camera the with kit lens? Is there any obvious advantages of high end compacts compared to the smallest mirrorless camera, of which the only one that fits the category of smallest is the GM1 and the Pentax Q (but the sensor's a bit too small).
What would be a reason for one to pick the compact (whatever it'd be P&S or something more advanced) over mirrorless compact system camera ? Right now market is quite confusing — we have huge market of tiny-sensor compacts, we have mirrorless that use sensors in a size of these from P&S cameras (Nikon 1 being notable example), we have compacts with sensors bigger than most popular mirrorless system (Canon G1X vs m4/3), we have lot of APS-C sensor mirrorless which are matched by some of the compacts (Fuji X100 being most notable example, but even Leica has its X2), and to make it even more confusing — Sony released RX1 with full frame sensor, beating crap out of every mirrorless on a market. So what are your arguments to pick compact over a mirrorless? Why are they better, what's the reason behind logic of companies like Fujifilm which at the same time offers P&S and X-mount mirrorless using same sensor size?
I have a batch script that backs up a folder to another folder etc and names the backed up folder to %date% %time% etc(only shows date currently) and I want it to show only hours and minutes. if I use %time::=.% i get 21.46.56.26 etc but I want only the 21.46 and nothing else. Script: title Backing up the universe.. echo Backing up the universe.. set savedate=%date:/=.% set savetime=%time::=.% echo Set Variable 'savedate' to %savedate% echo Set Variable 'savetime' to %savetime% pause md Universe-Backup\"%savedate%" echo Created backup folder. pause echo %savedate% robocopy %CD%\Universe\ %CD%\Universe-Backup\\"%savedate%" /e title The universe has been backedup! echo The universe has been backedup! title Starting server.. echo Starting server.. START %CD%\Server.exe
Update: Now that it's 2016 I'd use PowerShell for this unless there's a really compelling backwards-compatible reason for it, particularly because of the regional settings issue with using date. See @npocmaka's What's a Windows command line statement(s) I can use to get the current datetime in a format that I can put into a filename? I want to have a .bat file that zips up a directory into an archive with the current date and time as part of the name, for example, Code_2008-10-14_2257.zip. Is there any easy way I can do this, independent of the regional settings of the machine? I don't really mind about the date format, ideally it'd be yyyy-mm-dd, but anything simple is fine. So far I've got this, which on my machine gives me Tue_10_14_2008_230050_91: rem Get the datetime in a format that can go in a filename. set _my_datetime=%date%_%time% set _my_datetime=%_my_datetime: =_% set _my_datetime=%_my_datetime::=% set _my_datetime=%_my_datetime:/=_% set _my_datetime=%_my_datetime:.=_% rem Now use the timestamp by in a new ZIP file name. "d:\Program Files\7-Zip\7z.exe" a -r Code_%_my_datetime%.zip Code I can live with this, but it seems a bit clunky. Ideally it'd be briefer and have the format mentioned earlier. I'm using Windows Server 2003 and Windows XP Professional. I don't want to install additional utilities to achieve this (although I realise there are some that will do nice date formatting).
I lost my iPhone after I checked it in find my phone it shows that the device is offline. I want to know it means that the phone is 100% switched off or find my iPhone was not kept on in my iPhone [because I don't remeber correctly it was on or not] Does find my iPhone works on International Mobile Equipment identity number or Subscriber Identity Module?
My phone was stolen last night. I made sure it was in Lost Mode in iCloud and it was immediately in Offline status when I open iCloud. I am positive the thief switched it off. Now I am 100% certain the Find my iPhone option was turned on on my iPhone, but will the "Lost Mode" be of any help if it was not turned on on the iPhone? Would it be showing "Offline" if I did not turn on the option?
I want a list of applications which I have installed only using sudo apt-get install and nothing else. I came across this post: but the answer lists all installed packages (including ones which were pre-installed and weren't installed using sudo apt-get install ).
I'd like to get a list of packages installed manually by apt or aptitude and be able to find out whether a foobar package was installed manually or automatically. Is there any neat way of doing that from the command line?
I am a beginner. I have a dataset of 1700 samples with 4 features and I have to perform Hierarchical Clustering (the agglomerative version) and I need to decide whether or not to scale the data and perform PCA. If I scale the data (I tried almost all the "scalers") and then perform PCA, the clustering seems to be incorrect, while if I perform PCA without data scaling, it seems correct. Why is this? Or do you think I am probably doing something wrong?
What are the main differences between performing principal component analysis (PCA) on the correlation matrix and on the covariance matrix? Do they give the same results?
Windows 10 One Drive is a nuisance and difficult to control when one has gigabytes of photos. I need to remove it from my computer and not get errors afterwards. Help would be appreciated.
I don't use or want to use OneDrive, but after upgrading to Windows 10 it's been installed automatically and added to the sidebar of every explorer window: I can't seem to figure out how to get rid of it. I can't uninstall it like a normal app, and I can't seem to unpin it in Explorer's options. I tried following to getting rid of it, but that seems to only remove stored OneDrive files. I've also tried following another and , but I can't seem to edit group policies on my computer (maybe because I upgraded from Win7 Home Premium?). All I would really like is to be able to remove the OneDrive shortcut from my explorer sidebar, though being able to uninstall OneDrive would be a bonus. I'm not sure what I should try now. Is there a way to remove OneDrive from Windows 10?
I am looking for a way to create a permanent keyboard short cut to paste a text. Example: Whenever I press strg+shift+F1 I would like to paste "Quod erat demonstrandum." Maybe there is way to do this with the default Ubuntu settings or CompizConfig?
There are lots of websites which only allow signing in with email address and password and I am tired of typing a long email address. I don't want my browser to remember my email. Can I assign a keyboard shortcut to print this email address so that every time I press the key I get my email address on current text field? I am using Ubuntu 14.04 and I have very little knowledge about Ubuntu. I'm not talking about snippets. Just a defined text to paste when the key is pressed.
I'm trying to find a way to scroll through the suggestions made by the auto-complete feature in the gnome terminal. For example if I type sudo apt-get install xserver- and use double tab, there are large amounts of suggetions going over a page. Is there a set of keys to scroll back and forth though these suggestions?
If I have several directories, like: afoo abar sometimes my terminal will refuse autocomplete when I press tab (e.g. "cd a" then tab), and print the list of directories instead. Sometimes it even throws a noisy, annoying sound. Any idea how to make it autocomplete in cases like this? E.g it can show abar first, and then afoo if I press tab again. I saw this is the case in windows, or some applciation in Ubuntu
The online university where I study is constantly experiencing data loss, including students’ files and literature, so I want to recommend them an effective solution.
This question exists because it has historical significance, but it is not considered a good, on-topic question for this site, so please do not use it as evidence that you can ask similar questions here. While you are encouraged to help maintain its answers, please understand that "big list" questions are not generally allowed on Ask Ubuntu and will be closed per the . Backup is incredibly important. Obviously there's no best backup tool, but a comparison of the options would be very interesting. Graphical Interface? Command line? Incremental backups? Automatic backups? Install method: In standard repositories? PPA?
The question is whether we can find a correlation between two sets of grades (categorical data). Let’s say we have a dog competition and there are 1000 dogs participating. There are two rounds of assessment first round dog owners give their assessment on the scale from A to C. Where A is excellent and C is bad. There are four criteria for assessment during both tours (behaviour etc). second round one judge gives his assessment of one dog based on the same assessment criteria as in round 1. however, grades vary from M - meeting expectation, E - exceeding expectation, B - Bellow expectation. We understand that M is B, E is A and B is C. After two rounds our table would look like: | dog | round one | round two | | --------------- | --------- | --------- | | Dog1_criteria1 | A | B | | Dog1_criteria2 | A | E | | Dog1_criteria3 | A | E | | Dog1_criteria4 | B | M | | Dog2_criteria1 | A | E | | Dog2_criteria2 | B | M | | Dog2_criteria3 | A | E | | Dog2_criteria4 | C | B | .... How do we find a correlation between the two sets of answers? Thank you!
I am building a regression model and I need to calculate the below to check for correlations Correlation between 2 Multi level categorical variables Correlation between a Multi level categorical variable and continuous variable VIF(variance inflation factor) for a Multi level categorical variables I believe its wrong to use Pearson correlation coefficient for the above scenarios because Pearson only works for 2 continuous variables. Please answer the below questions Which correlation coefficient works best for the above cases ? VIF calculation only works for continuous data so what is the alternative? What are the assumptions I need to check before I use the correlation coefficient you suggest? How to implement them in SAS & R?
I am using C# & VS2013 and VSTO. My code executes to perfection, but the one issue I have is that when I go to Task Manager and look at Details, Excel is still showing as running even after, I feel like I have properly cleaned up. This is the syntax I use to cleanup and close all references to Excel. Just the references to Excel & VSTO, I left out the meat and gravy that does the leg work or this post would be to long. Do I have something set-up improperly? Why does Excel still show up in Task Manager? namespace ReleaseExcel { public partial class Form12 : Form12 { public static Excel.Worksheet newSeet; public static Excel._Worksheet currentsheet; public static Excel._Workbook oWB; public static Excel.Application xlApp; public static Excel.Workbook xlWorkBook; public static Excel.Worksheet xlWorkSheet; public static Excel.Workbook activeworkbook; public Form1() { InitializeComponents(); } private void DoThis() { //Showing Declerations to Excel xlApp = new Excel.Application(); xlWorkBook = xlApp.Workbooks.Add(misValue); xlWorkSheet = (Excel.Worksheet)xlWorkBook.Worksheets.get_Item(1); //Do some more stuff here //Showing a few more Declerations to Excel currentsheet = (Excel._Worksheet)(xlWorkBook.ActiveSheet); Excel.Range last = currentsheet.Cells.SpecialCells(Excel.XlCellType.xlCellTypeLastCell, Type.Missing); //Do a bit more stuff ClearExcel(); while (System.Runtime.InteropServices.Marshal.ReleaseComObject(xlWorkSheet) != 0) { } while (System.Runtime.InteropServices.Marshal.ReleaseComObject(currentsheet) != 0) { } while (System.Runtime.InteropServices.Marshal.ReleaseComObject(xlWorkBook) != 0) { } while (System.Runtime.InteropServices.Marshal.ReleaseComObject(xlApp) != 0) { } } private static void ClearExcel() { GC.Collect(); GC.WaitForPendingFinalizers(); } } } EDIT I added in GC.Collect() & GC.WaitForPendingFinalizers() but now my syntax hangs on while (System.Runtime.InteropServices.Marshal.ReleaseComObject(xlWorkBook) != 0) { } It has been sitting on this line for about 5 minutes now, what causes the freeze? EDIT # 2 Still no such luck. This is code namespace ReleaseExcel { public partial class Form12 : Form12 { public static Excel.Worksheet newSeet; public static Excel._Worksheet currentsheet; public static Excel._Workbook oWB; public static Excel.Application xlApp; public static Excel.Workbook xlWorkBook; public static Excel.Worksheet xlWorkSheet; public static Excel.Workbook activeworkbook; public Form1() { InitializeComponents(); } public void btnPush_Click(object sender, EventArgs e) { DoThis(); GC.Collect(); GC.WaitForPendingFinalizers(); } private void DoThis() { //Showing Declerations to Excel xlApp = new Excel.Application(); xlWorkBook = xlApp.Workbooks.Add(misValue); xlWorkSheet = (Excel.Worksheet)xlWorkBook.Worksheets.get_Item(1); //Do some more stuff here //Showing a few more Declerations to Excel currentsheet = (Excel._Worksheet)(xlWorkBook.ActiveSheet); Excel.Range last = currentsheet.Cells.SpecialCells(Excel.XlCellType.xlCellTypeLastCell, Type.Missing); } } }
I'm using the Excel interop in C# (ApplicationClass) and have placed the following code in my finally clause: while (System.Runtime.InteropServices.Marshal.ReleaseComObject(excelSheet) != 0) { } excelSheet = null; GC.Collect(); GC.WaitForPendingFinalizers(); Although this kind of works, the Excel.exe process is still in the background even after I close Excel. It is only released once my application is manually closed. What am I doing wrong, or is there an alternative to ensure interop objects are properly disposed of?
There's a specific word I'm looking for and I even remember it being from Philip Roth's novel 'American Pastoral'. I just can't think of what the actual word is, but its meaning is to focus on the specifics of something to the detriment of the whole.
I am looking for a word that would describe being obsessed with the details of a larger entity such that the "looker" neglects to see the whole or (perhaps more importantly) the purpose of the whole. Basically, "not seeing the big picture". What can [more] succinctly describe this? Edit: I just found this post: . I think I want the exact opposite.
I am editing a translation of a book on Colossians. Should the sub-heading be 'A discussion of Colossians 1:1-23, or on Colossians 1:1-23?
“A discussion of”, “a discussion on”, and “a discussion about”: When is each phrase used in preference to the other? If context is important, I want to use it as a subheading on a piece of non-fiction.
A white vertical stripe appeared on my laptop's screen today. Luckily it is on the side of the screen. My screen is 1366 x 768 I would like to force system to use only 1300 x 768(don't use 66 vertical lines on the left side). Is this is manageable? The graphics card is the Intel HD4000.
I want to re-position the display on my ASUS K53SM laptop's screen because I somehow managed to damage some portion of it (and I don't want to spend on this laptop for the time being). Please refer the following image: I changed the resolution from 1366x768 to 1280*768 to avoid the bad portion of the screen, but the screen is now centered and the right portion of my screen is now rendered useless. What I want to do is, set a custom resolution of my laptop and re-position it in a way that is utilizes all the working area of my screen. How do I re-position the displayed image on my laptop?
In Java you can invoke a private method like so: Method m = obj.getClass().getDeclaredMethod("foo", null); m.setAccessible(true); m.invoke("bar"); What is the equivalence in C#? I need to call a private method in the Unit Test.
There are a group of private methods in my class, and I need to call one dynamically based on an input value. Both the invoking code and the target methods are in the same instance. The code looks like this: MethodInfo dynMethod = this.GetType().GetMethod("Draw_" + itemType); dynMethod.Invoke(this, new object[] { methodParams }); In this case, GetMethod() will not return private methods. What BindingFlags do I need to supply to GetMethod() so that it can locate private methods?
Consider the following code: .container { display: flex; flex-direction: column; } .header { flex: 1; background-color: red; } .content { flex: 1; background-color: blue; height: 100%; } <div class="container"> <div class="header"> <h1>HEADER</h1> </div> <div class="content"> <h1>CONTENT</h1> </div> </div> Why is my CONTENT not getting full available height (from HEADER bottom to the bottom of page) ? How to solve it ?
I am working on a web application where I want the content to fill the height of the entire screen. The page has a header, which contains a logo, and account information. This could be an arbitrary height. I want the content div to fill the rest of the page to the bottom. I have a header div and a content div. At the moment I am using a table for the layout like so: CSS and HTML #page { height: 100%; width: 100% } #tdcontent { height: 100%; } #content { overflow: auto; /* or overflow: hidden; */ } <table id="page"> <tr> <td id="tdheader"> <div id="header">...</div> </td> </tr> <tr> <td id="tdcontent"> <div id="content">...</div> </td> </tr> </table> The entire height of the page is filled, and no scrolling is required. For anything inside the content div, setting top: 0; will put it right underneath the header. Sometimes the content will be a real table, with its height set to 100%. Putting header inside content will not allow this to work. Is there a way to achieve the same effect without using the table? Update: Elements inside the content div will have heights set to percentages as well. So something at 100% inside the div will fill it to the bottom. As will two elements at 50%. Update 2: For instance, if the header takes up 20% of the screen's height, a table specified at 50% inside #content would take up 40% of the screen space. So far, wrapping the entire thing in a table is the only thing that works.
Suppose $Q$ is a $P$-primary ideal and $Q'$ is a $P'$-primary ideal such that $P$ and $P'$ are comaximal in the Noetherian ring $R$. Show that $Q$ and $Q'$ are comaximal. Proof. Since $Q$ is a $P$-primary ideal and $Q'$ is a $P'$-primary ideal, then $P=\sqrt{Q}$ and $P'=\sqrt{Q'}$. Since $P$ and $P'$ are comaximal, then $P+P'=R$. I also have a proposition that says if $R$ is a Noetherian ring, then for any ideal $I$ some positive power of $(\sqrt{I})$ is contained in $I$. That is, for positive $p$, $(\sqrt{I})^p \subset I$. I want to show $Q+Q'=R$. Here's what I have so far: $Q+Q'\subset\sqrt{Q}+\sqrt{Q'}=P+P'=R$ As for the other direction I'm having a bit of trouble. I have: $R=P+P'=\sqrt{Q}+\sqrt{Q'}$ I want this to be a subset of $(\sqrt{Q} )^q +(\sqrt{Q'})^{q'} \subset Q+Q'$ and then I would be done. I'm studying the section about Dedekind domains right now in class so I don't know if that helps?
Let $R$ be a commutative ring and $I_1, \dots, I_n$ pairwise comaximal ideals in $R$, i.e., $I_i + I_j = R$ for $i \neq j$. Why are the ideals $I_1^{n_1}, ... , I_r^{n_r}$ (for any $n_1,...,n_r \in\mathbb N$) also comaximal?
After plugging in a memory stick, the laptop can take up to 2 minutes to discover and show up in explorer. I have tried 3 different makes of stick so far, Transcend, Kingston & Corsair. All are USB 2.0 compliant. All work fine in various other boxes. All of them contain nothing but data (MS docs, pdfs, images & text files). No autoruns, clever encryption or utilities. All are eventually discovered and usable. Laptop is an ASUS X71Q running Windows 7 32-bit Home Premium, 3GB of RAM. (Out of warranty) Norton Internet Security is installed, however, with it temporarily disabled I still get the delay. I am not asking about data transfer rates. There is no problem with USB mice or keyboards. This happens at any time, not just straight after booting. There is no "installing device drivers" message. I have removed or stopped all ASUS bloatware/utilities. It happens on all USB ports. USB drivers are from MS (recommended by ASUS) and have been removed/reinstalled. It makes no difference if it is running on battery or adapter. It also happens in safe mode. Memory usage is sat at 1-1.25GB before I plug in the stick and doesn't change after. Disk cache increases by 6MB when the stick is recognised and drops back down when it's removed. None of the sticks are readyboost compliant. Defrag of the HDD has made no difference. There is no delay when using a Kubuntu LiveCD
I reattach dozens of USB devices to my Windows 7 across the day, such as printers, flash drives, mice, modems, midi keyboards, and scanners. The computer has seen them all before; all have been set up previously. Yet in most cases, Windows takes 20-60 seconds to finish initialising the device and get it ready for use. Is there a way via software to cut this time short?
I have a three bulb light fitting that worked fine with 40 watt golf ball bulbs. On removing the bulbs and inserting the first 5.5 watt led the bulb illuminated while the fitting was turned off. This only happened in the one bulb holder the other two worked fine. The fitting now has 2 leds and 1 40 watt bulb and is working fine, any ideas? Cheers
I have two LED lamps in my corridor, and when I switch them off, they keep emitting light (not very strong, but it's annoying at night). What can it be? How can I fix it?
(Post has been edited ) So I am reading the proof of this statement: Let G be a group of order $pq$ with $p,q$ primes and $p<q$. If $p \nmid (q-1)$, then $G\simeq \mathbb{Z}_{pq}$ if $p \nmid (q-1)$ then thre are two isomorphism classes: $\mathbb{Z}_{pq}$ and a certain non-abelian group. So, here is part of the proof (until the part that I have problems with): Supposing that $p \mid (q-1)$, let $P \in Syl_p(G), Q \in Syl_q(G)$, since $\mid G:Q\mid = p$, which is th least prime number that divides $\mid G \mid$, then $Q \unlhd G$. Because $(\mid P \mid, \mid Q \mid)=1$, then $P \cap Q = \{e\}$, so $G=QP$. Then $G$ is a semidirect product $Q \rtimes_{\theta} P$ for a certain morhpism $\theta : P \to Aut(Q)$. Now they assert that $Aut(Q) \simeq \mathbb{Z}_{q-1}$. Why is this? I am pretty sure this is not true for any group since complete groups are isomorphic to their automorphim group by definition. Any help would be appreciated.
I don't know about the Sylow Theorems. But I have been wondering about a proof of the fact that a group or order $pq$ where $p$ and $q$ are distinct primes must be cyclic. I can't quite work out the details, but here is the general idea. I would like help with filling in details. I assume that it is already known that $G$ has subgroup(s) of order $p$ and subgroup(s) of order $q$. If $G$ is a group of order $pq$ ($p\neq q$), then I know that $G$ has a subgroup $H$ of order $p$ and a subgroup $K$ of order $q$. Then $H\simeq \mathbb{Z}_p$ and $K\simeq \mathbb{Z}_q$. But then $H\oplus K \simeq \mathbb{Z}_{pq}$, so I would think that $H\oplus K \simeq G$. I guess one could do an internal direct product instead of an external direct product, but I don't know that $H$ and $K$ are normal subgroups. I am asking for help completing this argument. Edit: I see from the comments below that I might need to assume that the smaller prime does not divide the larger prime minus $1$. Or maybe it is enough to assume that the primes are greater than or equal to $3$ (Still distinct).
My Table and Figures in Chapter 4 of my thesis are appearing at the end of chapter instead of within the text where I want them to appear. Before these table and figure everything is fine in this chapter and also in the previous chapters. The rest of the tables and figures (only from this chapter) are also appearing at the end of Chapter 4. Tables and figures in Chapter 5 and rest of the thesis are fine and they are appearing where I want them to be. Given below is the code for my table and figure which are causing trouble. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %Table 4.3 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{table}[!t] \centering % used for centering table \caption{Abc..} % title of Table {\normalsize}\setlength{\tabcolsep}{4pt} \begin{tabular}{| c || p{5.25cm} | c || p{5.25cm} |} \hline %inserts double horizontal lines abc & abc & abc & abc \\ \hline \hline $a$ & b & c & d \\ $a$ & b & c & d \\ $a$ & b & c & d \\ [1ex] % [1ex] adds vertical space \hline %inserts single line \end{tabular} \label{table:nonlin} % is used to refer this table in the text \end{table} \begin{sidewaysfigure}[!t]%[htbp] \centering \makebox[\textwidth][c]{\includegraphics[width=0.85\textwidth, height=0.50\textwidth]{./Figures/Chapter4/4point7.pdf}} \caption{xyz..} \label{fig:awesome_image} \end{sidewaysfigure} Any help would be appreciated. Thank you.
For some reason, my figures get pushed to the end of the document. I tried begin{figure}[t], [h] and other options, but none helped. Any ideas how to get the figures to appear much earlier in the document, where they are approximately first mentioned in the .tex file?
Prove that the series $a_n = $ $2^n \over n!$ converges to 0. I am trying to find a variable that will be bigger than $2^n\over n$ , with no luck. Any help, besides using binoms? Thanks in advance!!!
Why is $$\lim_{n \to \infty} \frac{2^n}{n!}=0\text{ ?}$$ Can we generalize it to any exponent $x \in \Bbb R$? This is to say, is $$\lim_{n \to \infty} \frac{x^n}{n!}=0\text{ ?}$$ This is being repurposed in an effort to cut down on duplicates, see here: Coping with duplicate questions. and here: .
In this app I'm dynamically creating a counter object with a LinearLayout, TextView , and two Buttons, I want the onClickListener inside the class since that seems like the best solution. The only thing I can think of is that I'm somehow getting the ID creation wrong. What are the best practices when dynamically creating things? A screenshot of the app and all code is included. public class Counter implements View.OnClickListener { private final int subButtonId = View.generateViewId(); ... private void createSubButton() { subButton = new Button(context); subButton.setLayoutParams(new LinearLayout.LayoutParams(buttonWidth, LinearLayout.LayoutParams.MATCH_PARENT, 0.5f)); subButton.setText("-"); subButton.setTextSize(buttonTextSize); subButton.setId(subButtonId); subButton.setGravity(Gravity.CENTER | Gravity.CENTER_HORIZONTAL); container.addView(subButton); sub = mainContainer.findViewById(subButtonId); sub.setOnClickListener(new MyOnClickListener() { @Override public void onClick(View v) { subCount(); disp.setText(count.toString()); } }); } } class MyOnClickListener implements View.OnClickListener { public MyOnClickListener() { } @Override public void onClick(View v) { } } Counter Class: Main Class: Logcat: Image of App:
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?
The Rutherford experiment proved that the Thomson model was incorrect and the Rutherford model was the right one, this because the $\alpha$ particles were deflected by the nucleus and in the Thomson model this was not possible. The question is: since in the Thomson model we have the electrons, which have negative charge, why an $\alpha$ particle shouldn't be deflected? I know that the total charge in Thomson model is $0$ so there is no Coulomb interaction, but $\alpha$ particles maybe could touch the electrons and like a classical collision change their trajectory. Is it possible that $\alpha$ particles and electrons touch each other and change their trajectories not only beacuse of Coulomb interaction but also beacuse they "touch", like a neutron against another neutron? All this not considering MQ which did not exist at the time of Rutherford experiment, so particles were just particles and not waves.
Geiger and Marsden's experiment led Rutherford to believe that the positive charge and most of the mass of the atom was concentrated in a small region. I understand what led him to conclude the way the positive charge is positioned in the atom. But how did he conclude that most of the mass was in a small region (the nucleus)? How did the distribution of the mass matter after all? Given that the electric force is greater than the gravitational force by many magnitudes, the force between the positice charge and the electrons was predominantly electric. So how did Rutherford conclude that most of the mass is in the nucleus?
I am developing an application that will collect journals from academicians, review it, and publish it on the site for the world to see. There would also be a blog, forum, and some form of social network. Users would be allowed to submit documents, photos, and video. I am estimating that on an average a user will use up 1gb a year and we expect to host about 350 users on the site during the first year. What hosting technology and requirements do you think i may need? Please are there any other considerations i should take into account?
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?
Hi i have total 3 partition in windows7 (C) Windows OS (D) erase all content for ubuntu (E) For files I want to install Ubuntu on D drive. How to install Ubuntu here? And after installing Ubuntu here is the left partition become 2 only in Windows. Please help me.
I need my pre-installed version of Windows 7 (or any other version of Windows), how could I install Ubuntu without erasing it?
Let $g:[1, \infty)\rightarrow \mathbb R$ a continuous non-negative function, such that $\int_{1}^{\infty} g(x)\ dx$ converges. Is it true that $\lim\limits_{x\to \infty}g(x)=0$ ? I tried to find a counter-example but I can't figure a trivial one. I also tried to prove it by the definition of the convergence of $g(x)$ but couldn't show that limit is really $0$.
Is there a continuous function such that $\int_0^{\infty} f(x)dx$ converges, yet $\lim_{x\rightarrow \infty}f(x) \ne 0$? I know there are such functions, but I just can't think of any example.
Protecting questions is a privilege awarded at 3,500 reputation on you're average SE site (of course it's different here, because unlike most SE sites, Meta SE and Stack Overflow have different reputation requirements for privileges). After a question has been protected, it requires 10 reputation to answer. But what's the point? There are still hundreds of new users that have >10 reputation, and they can do very similar things to what the newest users do. And it's also a little unfair and useless. What's the point? Why is this a privilege? If we had to keep it, should we raise the reputation required to answer a protected question?
Questions can be protected (i.e. marked "highly active"). What does it mean for a question to be protected? Why are some questions protected? Who can protect and unprotect questions? Who can answer a protected question? How are protected questions displayed? When should I protect or unprotect a question? When does the Community user protect a question?
For $a_1=\sqrt a , a_2=\sqrt{a-\sqrt{a}}, a_3=\sqrt{a-\sqrt{a+\sqrt {a}}} ,\ldots $ , We have $a_n$ as $$\lim_{n\rightarrow\infty}a_n=\frac {A-1}6+\frac 23\sqrt{4a+A}\sin\left(\frac 13\arctan\frac {2A+1}{3\sqrt3}\right)\tag1$$ where $A=\sqrt{4a-7}$ Note: We have $- , + , +$ every three terms. How we can prove this relation? (I want to prove it in general not only $a=2$ and period is $3$ not $4$)
Supposedly, the infinitely nested radical $$\sqrt{a-\sqrt{a+\sqrt{a+\ldots}}}\tag1\label{1}$$ converges to $$\frac {A-1}{6}+\frac 23\sqrt{4a+A}\sin\left(\frac 13\arctan\frac {2A+1}{3\sqrt 3}\right)\tag2$$ where $A=\sqrt{4a-7}$. In fact, that's how Ramanujan arrived at the famous nested radical $$\sqrt{2-\sqrt{2+\sqrt{2+\ldots}}}=2\sin\left(\frac {\pi}{18}\right)\tag3$$ So I'm wondering how you would prove $\ref{1}$. My best try was to set $(1)$ equal to $x$ and substitute to get $$x=\sqrt{a-\sqrt{a+\sqrt{a+x}}}$$to get an octic polynomial. But I'm not too sure how the trigonometry made its way into the generalization. And I also wonder if there is a way to generalize this even further to possible $$\sqrt{a-\sqrt{a-\sqrt{a+\sqrt{a+\ldots}}}}$$ which has period $4$ instead of $3$.
I've been using the new shadier in 2.79's test builds but a while ago it just stopped working. When I try to use an image the material just turns to a flat color. Any ideas as to why this is as I can see it loading properly on the side?
Because I am pretty new to blender I watched the tutorial from BlenderCookie.com. I loaded onto a sphere but then in all views the texture is just some kind of blurry with no details.
If I have this text blob "merchants":[{"name":"Berlins - Venice","description":"LA\'s Most Authentic German Döner Experience.","should_show_ajax_etas":true,"id":3916 ,"fulfillment_types_allowed":["DELIVERY"],,"name":"Clutch CaliMex", "description":"Northern Mexican Cuisine."name":"LocaliVenice", "description":"If 7-Eleven and Whole Foods Had A Love Child...","should_show_ajax_etas":true,"id":1743 I am trying to parse the name value between the quotes. So in case, I am trying to return Berlins - Venice, Clutch CaliMex, and LocaliVenice. This is the regex that I am using on regex = re.compile(r'?<=\"name\":\")(.*)(?=\"description\"'). which is mostly inspired by However, it appears to return EVERYTHING from Berlins to the very last instance of description even though there are two more instances of description in the text blob. Berlins - Venice","description"..(truncated).."name":"Locali Venice", Again, I only need the name of the restaurants in between the quotes
I have this gigantic ugly string: J0000000: Transaction A0001401 started on 8/22/2008 9:49:29 AM J0000010: Project name: E:\foo.pf J0000011: Job name: MBiek Direct Mail Test J0000020: Document 1 - Completed successfully I'm trying to extract pieces from it using regex. In this case, I want to grab everything after Project Name up to the part where it says J0000011: (the 11 is going to be a different number every time). Here's the regex I've been playing with: Project name:\s+(.*)\s+J[0-9]{7}: The problem is that it doesn't stop until it hits the J0000020: at the end. How do I make the regex stop at the first occurrence of J[0-9]{7}?
I have created a trigger which should create a task on opportunities only when opportunity's owner is active.Here is my trigger and helper class: Trigger trigger AutoTaskCreation on Opportunity (before insert, before update, after update) { if (Trigger.isAfter) { if (Trigger.isUpdate) { TaskServices.createTaskforOpp(Trigger.new); } } } Helper Class public with sharing class TaskServices { public static void createTaskforOpp(List<Opportunity> oppList) { List<Task> taskList = new List<Task>(); For(Opportunity opp : oppList) { if(opp.Owner.isActive == false) { Task newTask = new Task( WhatId = opp.Id, OwnerId = opp.OwnerId, ActivityDate = Date.today(), Subject = 'Test Subject', Description = 'This a Test' ); taskList.add(newTask); } } insert taskList; } } The above code is creating task for both active and inactive opportunity owners. Why if(opp.Owner.isActive == false) is not working?
I am populating a junction object on from Events and want to capture info from the Event but getting the Account from Account field pulls null. Same who the name via the Who. But if I query the Event record, the AccountId field is populated. And of course, the code compiles properly. Can someone explain how to grab this related info? trigger TripMeetingFromMeeting on Event (after insert, after update) { Set<id>EventId = new Set <ID>(); List <Trip_Meeting__c> TMS = new List <trip_meeting__c>(); for (Event E:trigger.new){ if (e.Business_Trip__c!=null){ TMS.add(new Trip_Meeting__c(Meeting__c =e.id, Business_trip__c=e.Business_Trip__c, Meeting_Date__c=e.ActivityDate, Meeting_subject__c=e.Subject, TripNameDELETE__c=e.Business_Trip__r.name, mWhatID__c=e.Whatid, Meeting_Company__c=e.Account.name, Meeting_Name__c=e.Who.name) ); } } system.debug('TMS!!!============================'+TMS); Database.insert(tms, false); }
If I move the mouse or use the keyboard to do anything that would require redrawing the screen, it flickers, and then often goes black for a second or so. I found a number of similar problems, but I have not found this combination: using a single monitor AMD R9 380 graphics card (not nVidia) independent of Google Chrome I am using Legacy, not UEFI mode. I did not have this problem on 15.10 on the same machine. I have the same problem when booting into the 16.04 live CD. I installed the latest upgrades. $ uname -a Linux <machine-name> 4.4.0-36-generic #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux $ lsb_release -a No LSB modules are available Destributor ID: Ubuntu Description: Ubuntu 16.04.1 LTS Release: 16.04 Codename: xenial $ lspci -nn | grep VGA 03:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Hawaii Pro [Radeon R9 290/390] [1002:67b1] (rev 80) $ lshw -c video *-display description: VGA compatible controller product: Hawaii PRO [Radeon R9 290/390] vendor: Advanced Micro Devices, Inc. [AMD/ATI] physical id: 0 bus info: pci@0000:03:00.0 version: 80 width: 64 bits clock: 33 MHz capabilities: pm pciexpress msi vga_controller bus_master cap_list rom configuration: driver=radeon latency=0 resources: irq: 128 memory:c0000000-cfffffff memory:d0000000-d07fffff ioport:e000(size=256) memory:dfd000000-dfd3ffff memory:dfd40000-dfd5ffff I am a bit confused because says for my graphics card, amdgpu is installed but the last command says driver=radeon. I tried installing amdgpu: $ sudo apt-get install xserver-xorg-video-amdgpu libdrm-amdgpu1 xserver-xorg-video-amdgpu is already the newest version (1.1.0-1). xserver-xorg-video-amdgpu set to manually installed. libdrm-amdgpu1 is already the newest verison (2.4.67-1ubuntu0.16.04.2). libdrm-amdgpu1 set to manually installed. Booting with nomodeset works fine, but I understand then I have no 3D acceleration which would be unfortunate. My mainboard is an ASRock H170M Pro4 with latest BIOS (2.20) in case it matters. Any ideas what I could try?
I have 14.04.5/16.04 or newer and an AMD GPU. I'm not getting the performance I want, and some programs say they need things like OpenCL. I've heard about fglrx, but if I try to install it on my machine, it breaks and I have no GUI. Is there anything I can do to get my AMD card working to its full potential?
how to render a radiation pattern like following with blender? Here a short video: Thanks for your support. LS
I've been researching for a while now and I can't seem to find any way to make radio or transmission waves in blender. I'm looking for an effect sort of like this, but coming from a point in the animation. I am using Cycles and I am trying to create an internet of things animation, but it is very hard to portray what is happening without waves. I have already tried to use a particle system, but was unable to achieve this effect. Maybe something like would work but I'm not sure how to do it without the plane still being there. I also don't have after effects so that isn't really an option for me. Any help of ways to make waves or to portray them would be greatly appreciated! Thanks!
I know those Equations but I cannot show the standard error of fitted value, please help me out, much appreciated. $$ SE(\hat{\beta_1})=\hat{\sigma}\sqrt{\frac{1}{(n-1)s_x^2}}\\ SE(\hat{\beta_0})=\hat\sigma\sqrt{\frac{1}{n}+\frac{\bar{x}^2}{(n-1)s_x^2}}\\ \hat\sigma=\sqrt{\frac{\sum_i(Y_i-\hat{Y})}{n-2}} $$ How do I show the $SE(\hat{\beta_0}+\hat{\beta_1}x_0)=\hat{\sigma}\sqrt{\frac{1}{n}+\frac{(x_0-\bar{x})^2}{(n-1)s_x^2}}$
If the best linear approximation (using least squares) of my data points is the line $y=mx+b$, how can I calculate the approximation error? If I compute standard deviation of differences between observations and predictions $e_i=real(x_i)-(mx_i+b)$, can I later say that a real (but not observed) value $y_r=real(x_0)$ belongs to the interval $[y_p-\sigma, y_p+\sigma]$ ($y_p=mx_0+b$) with probability ~68%, assuming normal distribution? To clarify: I made observations regarding a function $f(x)$ by evaluating it a some points $x_i$. I fit these observations to a line $l(x)=mx+b$. For $x_0$ that I did not observe, I'd like to know how big can $f(x_0)-l(x_0)$ be. Using the method above, is it correct to say that $f(x_0) \in [l(x_0)-\sigma, l(x_0)+\sigma]$ with prob. ~68%?
This is MY demo Work in JSFIDDLE NB without using table property I want to make the class .box should be vertically centered CSS .main{ height:300px; border:1px red solid;position:relative} .box{width:40px; height:40px; background:red; } /* for centering */ .box{ display: inline-block;position:relative; top:50% } .main{ text-align: center; } HTML <div class="main"> <div class="box"></div> </div>
I want to center a div vertically with CSS. I don't want tables or JavaScript, but only pure CSS. I found some solutions, but all of them are missing Internet Explorer 6 support. <body> <div>Div to be aligned vertically</div> </body> How can I center a div vertically in all major browsers, including Internet Explorer 6?
I'm using the Vagrant box. When I vagrant up with the default Vagrantfile I'm able to log in and get to work without needing to input a password via vagrant ssh. I land in the home directory by default: ubuntu@ubuntu-xenial:~$ pwd /home/ubuntu I'd like to be able to have my /home/ubuntu directory synced with the project root on my host machine (like the /vagrant directory is). I read up in the and added the following to my Vagrantfile: config.vm.synced_folder ".", "/home/ubuntu" Now I'm being asked for a password which I don't want. Also I tried "vagrant" and "ubuntu" for the password and wasn't able to log in anyways. How do I sync my /home/ubuntu directory in my Vagrant box with my host project root while still not being required to input a password? Note: My current workaround is to continue working from /vagrant in my Vagrant box.
I would like to run vagrant without being prompted for a password. As this post suggests, I used visudo to add the following line to my sudoers file. john-moz ALL=(ALL) NOPASSWD: /usr/bin/vagrant This does not seem to work. I am still prompted for a password when using vagrant. Am I doing something wrong?
The Question Solve for $(x,y,z)$ $$\left\{\begin{matrix} x+\left \lfloor y \right \rfloor + \left \{ z > \right \}=1,1\\ z+\left \lfloor x \right \rfloor + \left \{ y \right > \}=2,2\\ y+\left \lfloor x \right \rfloor + \left \{ z \right \}=3,3 \end{matrix}\right.$$ My Understanding From the definition of floor function we know that $n = \left \lfloor n \right \rfloor + \left \{n \right \}$ and if you play with equation a bit $(1,1+,2,2=3,3)$ and do some cancelling it's easy to see that $$x+z=0 \Rightarrow x = -z.$$ After that you set $z=-x$ and rewrite the equation. You'll see from $[2(1,1)=2,2]$ and a bit cancelling $\left \{ y \right \} - \left \{ x \right \}=2,2$. Also an important note that $\left \lfloor x \right \rfloor \neq \left \lfloor -x \right \rfloor , \left \{ x \right \} \neq \left \{ -x \right \}$ example: $\left \lfloor 5,35 \right \rfloor = 5$ but $\left \lfloor -5,35 \right \rfloor = -6$. I got this so far and need help.
The equation system is — $x + \lfloor y \rfloor + \{ z \} = 13.2$ $\{ x \} + y + \lfloor z \rfloor = 15.1$ $\lfloor x \rfloor + \{ y \} + z = 14.3$ Now I've tried substituting $n$ with $\lfloor n \rfloor + \{ n \}$ everywhere possible and then gone on with algebraic manipulations. But everything gets messy from there. I tried solving the problem more than thrice over the past few days, but always ended up with different answers.
root@xxx:~# aptitude show gcc Package: gcc New: yes State: installed Automatically installed: no Version: 4:5.2.1-3ubuntu1 Priority: optional Section: devel Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com> Architecture: i386 Uncompressed Size: 45.1 k Depends: cpp (>= 4:5.2.1-3ubuntu1), gcc-5 (>= 5.2.1-12~) Recommends: libc6-dev | libc-dev Suggests: gcc-multilib, make, manpages-dev, autoconf, automake, libtool, flex, bison, gdb, gcc-doc Conflicts: gcc-doc (< 1:2.95.3) Provides: c-compiler Description: GNU C compiler There is an option for 'apt-get' which is --install-suggest, and there are also an option -r (--with-recommends) for aptitude, Are those two the some thing?
I've checked the man/info page, but there is no reference to some aspects of the output fomat of apt-cache depends The man/info page tried to be helpful (in an obtuse manner); quote: "For the specific meaning of the remainder of the output it is best to consult the apt source code" Now in fairness to the info page, that quote was in regards to the 'showpkg' option which it had reasonably explained, but my option had no such explanation... I understand that Linux info comes from many sources (not just man/info pages), and I don't particularly want to rummage through the source (altough somtimes I do), so here is an example of what I'd like to know the meaning of. # I can assume what these mean, but... # What does | mean? (probably means 'or'???) # What does <pkg> and the following indentations mean? # At the end, the interaction(?) of Suggest and Recommends puzzles me. $ apt-cache depends solr-common solr-common Depends: debconf |Depends: openjdk-6-jre-headless |Depends: <java5-runtime-headless> default-jre-headless gcj-4.4-jre-headless gcj-jre-headless gij-4.3 openjdk-6-jre-headless Depends: <java6-runtime-headless> default-jre-headless openjdk-6-jre-headless Depends: libcommons-codec-java Depends: libcommons-csv-java Depends: libcommons-fileupload-java Depends: libcommons-httpclient-java Depends: libcommons-io-java Depends: libjaxp1.3-java Depends: libjetty-java Depends: liblucene2-java Depends: libservlet2.5-java Depends: libslf4j-java Depends: libxml-commons-external-java Suggests: libmysql-java |Recommends: solr-tomcat Recommends: solr-jetty
In Fantastic Beasts And Where To Find Them, when Tina disarms Graves, (Grindelwald) does she then become the owner of the Elder Wand?
We know that the movie Fantastic Beasts is set in 1926. From the movie, we learn that at this time, Dumbledore is a teacher at Hogwarts and Grindelwald is lose after escaping a previous arrest. In the movie we learn that Mr Graves is in fact Grindelwald in disguise. Grindelwald is shown to be at least in his forties, maybe fifties so he should already be the owner of the wand since he stole it from Gregorovitch as a teen. We know that Dumbledore won the wand from Grindelwald after defeating him in their historic duel. That duel is always described as being “the end of the dark wizard Grindelwald” so I’m assuming that it didn’t happen prior to the movie and that he didn’t escape after that duel, please correct me if you have cannon evidence stating the contrary. In the movie, we see Graves’ wand a few time and it isn’t the (very recognizable) one used in DH as the Elder Wand. This could of course be a prop error but since David Yates was also the director on DH and a lot of the visuals are similar I’m assuming it wasn’t. Graves could of course be using another wand in the fear that someone could recognize it but he would still be the rightful master of the Elder Wand. At the end of the movie, Newt is the one that disarms Graves/Grindelwald. In all logic, he should have been made the new owner of the wand, whether Grindelwald was actually using it or not. That would have made it impossible for Dumbledore to win it from Grindelwald later. So my question is: What wand is that character using at that specific time? Is he already the owner of the Elder Wand? And if so, why wasn’t Newt made the new owner of the wand?
Why is it so that a charged particle when accelerated radiates energy? I tried to think if it might be violating the law of conservation of energy but the energy transferred by the external agent may simply be absorbed by the electron and it can go on with increasing amount of kinetic energy and it does not need to radiate energy. There was another question on this website which had an answer that provided an account of this phenomenon in terms of field lines in some inner and outer ring. But, why should we consider field lines? They are merely paths of a charged particle which it will follow when left in an electric field.
The gives the recoil force, $\mathbf{F_{rad}}$, back on a charged particle $q$ when it emits electromagnetic radiation. It is given by: $$\mathbf{F_{rad}} = \frac{q^2}{6\pi \epsilon_0 c^3}\mathbf{\dot{a}},$$ where $\mathbf{\dot{a}}$ is the rate of change of acceleration. If a particle has a constant acceleration, $\mathbf{\dot{a}}=0$, then there is no reaction force acting on it. Therefore the particle does not lose energy. Does this mean that a constantly accelerating charged particle does not emit electromagnetic radiation?
What does 50va mean on a 24 volt transformer.
What exactly goes into a transformer's VA rating? At a fundamental level it seems that there has to be a limit to what the VA rating can represent. For example if I draw 2 Amps-RMS from the secondary of a 30VA rated transformer at 15 Vrms this makes sense as the maximum Complex Power I can draw. Still, at a power factor of 1 my maximum current in the transformer would be sqrt(2) * 2 Amps. But what if my power factor is abysmally low (ie in a DC rectifier) due to harmonic distortion and while I still draw 2A-RMS I have brief current spikes of 15 Amps? Surely the transformer's magnetics couldn't handle these spikes as I'd expect the core would saturate. My question is what is the practical limit for VA ratings of transformers? Would brief current spikes that reduce to only 2A-RMS in this case be fine? Obviously the secondary/primary copper losses play a part in the rating but how do the magnetics factor in? I ask this because I am designing a simple bench power supply using a 125VA transformer with a 24Vrms secondary and am trying to figure out how much power I can draw before the current spikes into the inductor are too much for the transformer. I also don't want to have to resort to active PFC as I don't want to risk messing up any HVAC PCB design. Thank you
I have a delegate defined in my code: public bool delegate CutoffDateDelegate( out DateTime cutoffDate ); I would like to create delegate and initialize with a lambda or anonymous function, but neither of these compiled. CutoffDateDelegate del1 = dt => { dt = DateTime.Now; return true; } CutoffDateDelegate del2 = delegate( out dt ) { dt = DateTime.Now; return true; } Is there way to do this?
The following method does not compile. Visual Studio warns "An out parameter may not be used within an anonymous method". The WithReaderLock(Proc action) method takes a delegate void Proc(). public Boolean TryGetValue(TKey key, out TValue value) { Boolean got = false; WithReaderLock(delegate { got = dictionary.TryGetValue(key, out value); }); return got; } What's the best way to get this behavior? (Please refrain from providing advice on threadsafe dictionaries, this question is intended to solve the out parameter problem in general).
For three days straight, I have connected to the public WiFi network at my local library. Each day, I have seen a different prompt in Terminal. Here are some of the prompts I've seen: zp-pc:~ russell$ mary-pc:~ russell$ normob05:~ russell$ I have check under System Preferences -> Sharing, and my computer name is "Russell's Mac". Also, I set the DHCP Client ID to "RUSSMAC" under System Preferences -> Network -> Advanced -> TCP/IP, but I still see the random host names at the Terminal prompt. Why is my computer name changing every day?
My computer name in System Preferences > Sharing is set to "archos", but is showing as "iphone" on Terminal. It just started doing this after I loaded Xcode for doing iPhone development: Last login: Mon Nov 7 14:46:55 on ttys001 iphone:~ travis$ Any ideas what could be causing this?
while creating child record need to get data from Grand parent. i wrote a trigger but not updating fields. here my working. trigger Registration on Opportunity (after Update) { list<Registration__c> NewReg = new list<Registration__c>(); list<Registration__c> oldReg = new list<Registration__c>(); for(opportunity o : Trigger.new){ if(o.Registration_Raised__c==true) { oldReg = [select id,Name from Registration__c where Opportunity__c=:o.id]; if(oldReg.size()==0){ registration__C reg = new registration__c(); reg.Opportunity__c = o.id; reg.GHMC_Approved_Date__c = O.Unit_Number__r.Tower__r.GHMC_Approved_Date__C; NewReg.add(reg); } } } if(NewReg.size()>0){ insert NewReg; } } i wrote the above trigger on opportunity and registration__C is the child object. when registraion raised check box is true the child record will create and need some inform Gran parent object. those are, Unit__C and tower__C.
I am populating a junction object on from Events and want to capture info from the Event but getting the Account from Account field pulls null. Same who the name via the Who. But if I query the Event record, the AccountId field is populated. And of course, the code compiles properly. Can someone explain how to grab this related info? trigger TripMeetingFromMeeting on Event (after insert, after update) { Set<id>EventId = new Set <ID>(); List <Trip_Meeting__c> TMS = new List <trip_meeting__c>(); for (Event E:trigger.new){ if (e.Business_Trip__c!=null){ TMS.add(new Trip_Meeting__c(Meeting__c =e.id, Business_trip__c=e.Business_Trip__c, Meeting_Date__c=e.ActivityDate, Meeting_subject__c=e.Subject, TripNameDELETE__c=e.Business_Trip__r.name, mWhatID__c=e.Whatid, Meeting_Company__c=e.Account.name, Meeting_Name__c=e.Who.name) ); } } system.debug('TMS!!!============================'+TMS); Database.insert(tms, false); }
Saw some questions here which asks for what a student should know but couldn't find a complete list of recommended books for the maths and physics one needs to know. The answers can serve as a journey to a college fresher where to start from and how to go ahead.
What are some good books for learning general relativity?
Question was already asked before..
Let $r$ be a root of the polynomial $p(x)=(\sqrt{3}-\sqrt{2})x^3 + \sqrt{2}x-\sqrt{3}+1$. Find another polynomial $q(x)$, with all integer coefficients, such that $q(r)=0$.
Ok, since SQL Server 2016 we have new server-level permissions that allow to grant connect and select to/on any exising or future databases on the server instance use master grant connect any database to [Login] grant select all user securables to [Login] Tried to run below command: grant insert all user securables to [Login] But it throws an error Is there any permission or role, or other method that grants permission to insert, update, delete (db_datawriter), or create objects inside user databases (db_ddladmin) on a server level - so it applies to all existing and future user databases ? So DBA does not have to go in and update permissions whenever new database is added ?
When I setup my database I create a sql user that my application runs as. The sql user gets read only access to all the databases on the server. The problem is the user won’t have read only access to any new created databases in the future. There is another app that creates these new databases for users and I don’t have a way to add my user script into the templates database created. Is there a way to automatically update the sql user for read only for the future ones? SQL server 2014.
This started as me trying to find the right dropbox version for my system, but now i'm mostly just generally curious and confused because i can't find a clear answer on this.
I am developing an offline installer for all versions of Ubuntu, and I need Ubuntu's default installed packages list. Is there a way to get this information from any server (web server)? Any script to fetch any Ubuntu version's default installed packages list. I will give the Ubuntu version, and the script will fetch the packages list. Note: I need at least a server address. I can write a script for this.
Problem: I have an escaped string saved within a variable: escapedFileName='/dbDumps/Mon\ Oct\ \ 1\ 15\:22\:50\ UTC\ 2018.sql' but whenever I try to use this file name within the following command, I get an error message saying that this path does not exist (even though it does). /usr/bin/mysql -u root -pmypassword system < "$escapedFileName"; When i use the path and not the string it works : /usr/bin/mysql -u root -pmypassword system < /dbDumps/Mon\ Oct\ \ 1\ 15\:22\:50\ UTC\ 2018.sql What am I doing wrong ?
I'm trying to escape the space char for a path in Bash, but neither using a or works. .sh script: ROOT="/home/hogar/Documents/files/" FILE=${ROOT}"bdd.encrypted" DESTINATION="/home/hogar/Ubuntu\ One/folder" mv ${FILE} ${DESTINATION} After execute the script (./file) this is the result: mv: target 'One/folder' is not a directory Why does the mv command split the string, and how do I stop this from happening?
I have an array of strings, and I'm trying to define a function where imputing string "xyz" will search the array and return the index. "xyz" will be different each time the function is called. I have tried this (JavaScript): var data = ["abc","def","ghi","jkl","mno"]; \\ this array is actually much longer look = function(a){return a = this;} \\ at first I was trying data.findIndex("xyz") \\ but Chrome Dev. tools said "xyz" is not a function Params = function(x="abc"){ y = data.findIndex(look,x); return y; } \\ Params("abc") should return 0 \\ Params("def") should return 1 \\ Params("ghi") should return 2 \\ etc. I know I could do this with a for-loop, and cycle through all of the values in "data" but this seems inefficient. Is there a better way? Am I misunderstanding the "findIndex" method?
What is the most concise and efficient way to find out if a JavaScript array contains a value? This is the only way I know to do it: function contains(a, obj) { for (var i = 0; i < a.length; i++) { if (a[i] === obj) { return true; } } return false; } Is there a better and more concise way to accomplish this?
How can I render using these skyboxes? Thanks!
I know that I can use default HDRI maps in Rendered mode in Blender right now, but the problem is when I wan to render the image by F12 (or render movie), my settings are changed to use "scene world". Is there a hidden button somewhere in rendering tab or somewhere else? If I have HDRI correct in rendered mode, why I can't have the same result after F12 render?