qid
int64
1
74.7M
question
stringlengths
15
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
4
30.2k
response_k
stringlengths
11
36.5k
68,219,903
I've dataset as in following format : ``` df = pd.read_csv("data_processing.csv") df user_id volume 0 a {"BTCUSDT":1000,"USDTINR":20} 1 b {"BTCINR":30,"USDTINR":10,"ETHINR":15} 2 c {"XRPINR":10,"ETHUSDT":500,"XRPUSDT":200} 3 d {"ETHINR":5} ``` I want to convert the above dataset i...
2021/07/02
[ "https://Stackoverflow.com/questions/68219903", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3367506/" ]
First you can convert the volume dict to a list of key-value pairs like `[(BTCUSDT, 1000), (USDTINR, 20)]` for each row, then you use `explode` to put them on different rows and convert them to 2 columns. Finally join it back to the original df. ``` ( df.drop('volume', 1) .join(df.volume.apply(lambda x: list(x...
You can also use `pd.DataFrame()` to expand the dict into columns. Then, use [.`stack()`](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.stack.html) to convert the expanded columns into rows, as follows: ``` df_out = (df.drop('volume', axis=1).join(pd.DataFrame(df['volume'].tolist(), index...
7,583,304
I have a repository which was moved, path renamed and then logs truncated. So I don't have old path in it. When I try to do svn switch <https://new.repo/new/path> svn complains "Cannot replace a directory from within". How do I avoid this? P.S. Recreating old path is not an option.
2011/09/28
[ "https://Stackoverflow.com/questions/7583304", "https://Stackoverflow.com", "https://Stackoverflow.com/users/184491/" ]
If it's still the same repo, and it's just the path to the repo that's changed, then you should be passing the `--relocate` option to `svn switch`. Does that help? i.e. ``` svn switch --relocate https://new.repo/new/path ``` (Warning: If it's not the same repo, then using `--relocate` will break things)
checkout from new location and copy the contents of old working copy over your new Working copy
7,583,304
I have a repository which was moved, path renamed and then logs truncated. So I don't have old path in it. When I try to do svn switch <https://new.repo/new/path> svn complains "Cannot replace a directory from within". How do I avoid this? P.S. Recreating old path is not an option.
2011/09/28
[ "https://Stackoverflow.com/questions/7583304", "https://Stackoverflow.com", "https://Stackoverflow.com/users/184491/" ]
If it's still the same repo, and it's just the path to the repo that's changed, then you should be passing the `--relocate` option to `svn switch`. Does that help? i.e. ``` svn switch --relocate https://new.repo/new/path ``` (Warning: If it's not the same repo, then using `--relocate` will break things)
Problem was solved. I've created a script that changed path in all .svn/entries. Everything works.
7,583,304
I have a repository which was moved, path renamed and then logs truncated. So I don't have old path in it. When I try to do svn switch <https://new.repo/new/path> svn complains "Cannot replace a directory from within". How do I avoid this? P.S. Recreating old path is not an option.
2011/09/28
[ "https://Stackoverflow.com/questions/7583304", "https://Stackoverflow.com", "https://Stackoverflow.com/users/184491/" ]
If it's still the same repo, and it's just the path to the repo that's changed, then you should be passing the `--relocate` option to `svn switch`. Does that help? i.e. ``` svn switch --relocate https://new.repo/new/path ``` (Warning: If it's not the same repo, then using `--relocate` will break things)
Well, already solved but ``` svn --relocate https://old.repo/old/path https://new.repo/new/path ``` should do the trick nicely
7,583,304
I have a repository which was moved, path renamed and then logs truncated. So I don't have old path in it. When I try to do svn switch <https://new.repo/new/path> svn complains "Cannot replace a directory from within". How do I avoid this? P.S. Recreating old path is not an option.
2011/09/28
[ "https://Stackoverflow.com/questions/7583304", "https://Stackoverflow.com", "https://Stackoverflow.com/users/184491/" ]
If it's still the same repo, and it's just the path to the repo that's changed, then you should be passing the `--relocate` option to `svn switch`. Does that help? i.e. ``` svn switch --relocate https://new.repo/new/path ``` (Warning: If it's not the same repo, then using `--relocate` will break things)
I had this same issue and was not able to get it to work with either "switch" or "switch --relocate". As the original question states, I got the error "Cannot replace a directory from within" with the former and with the latter "Relocate can only change the repository part of an URL" As I am on CentOS I was able to us...
10,199,769
I recently built a J2SE chatting application, but I think I should take a consideration about data transmission encryption. But I cannot code it from scratch. I don't know if there is a existing encryption application can help me to achieve the goal? The key point is: it should supprt Java application. Thank you!
2012/04/17
[ "https://Stackoverflow.com/questions/10199769", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1262659/" ]
You should be using SSL for this. Java has built-in support for SSL via SSLSocketFactory: ``` import javax.net.ssl.SSLSocketFactory; ... SocketFactory factory = SSLSocketFactory.getDefault(); Socket s = factory.createSocket( host, port ); ``` From that point, use the socket just as you normally would.
Yes, it's called the Java API ;-) <http://www.oracle.com/technetwork/java/javase/tech/index-jsp-136007.html> You might use the transport layer security (https and friends) or encrypt your data through JCA (Java cryptography architecture).
24,668,672
I have written a bat file to install mysql. It works well when executing by double clicking but when it executed by java program it prompted and vanishes, nothing happens. Any suggestions? this is my bat file: ``` set cur=%cd% set pro=%PROGRAMFILES(x86)% pause if exist "%pro%" goto yes86 set pro=%PROGRAMFILES% :yes...
2014/07/10
[ "https://Stackoverflow.com/questions/24668672", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2341815/" ]
``` function option() { $return=array(); $return['error'] = true; switch(getData()){ case false: return $return; break; case true: if(getValue()==false){return $return;} else{ if(getVar()==false){return $return;} else{ $return['error'] = false; $return['message'] = 'congrat!';} } break; default: re...
A neater option would be to make the 3 functions throw an exception when there's an error instead of returning boolean false. That's what exceptions are for anyway. Then in your function you can just wrap the calls in a try-catch block. ``` function option { $return = array(); try { $a = getData(); $b = ge...
50,111,338
I want to write a constraint to make sure `r_addr` is only allowed when the same address has been used as `w_addr` before, but the following constraint doesn't work. Do you have any suggestion? ``` class try; rand int w_addr; rand int r_addr; int ua[$]; int aa[int]; constraint unique_addr_c{ ...
2018/05/01
[ "https://Stackoverflow.com/questions/50111338", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9724103/" ]
You want to use the `inside` operator. ``` class try; rand bit [31:0] w_addr; rand bit [31:0] r_addr; bit [31:0] ua[$]; constraint unique_addr_c{ ua.size() >0 -> r_addr inside {ua}; } function void post_randomize(); ua.push_back(w_addr); endfunction endclass module test; ...
This uses a queue instead of an associated array. ``` class try; rand int w_addr; rand int r_addr; int q[$]; function void post_randomize(); int sz; int idx; q.push_back(w_addr); sz = q.size(); idx = $urandom_range(0, sz-1); r_addr = q[idx]; endfunction endclass module test; try a; ...
50,111,338
I want to write a constraint to make sure `r_addr` is only allowed when the same address has been used as `w_addr` before, but the following constraint doesn't work. Do you have any suggestion? ``` class try; rand int w_addr; rand int r_addr; int ua[$]; int aa[int]; constraint unique_addr_c{ ...
2018/05/01
[ "https://Stackoverflow.com/questions/50111338", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9724103/" ]
You want to use the `inside` operator. ``` class try; rand bit [31:0] w_addr; rand bit [31:0] r_addr; bit [31:0] ua[$]; constraint unique_addr_c{ ua.size() >0 -> r_addr inside {ua}; } function void post_randomize(); ua.push_back(w_addr); endfunction endclass module test; ...
The following code works in mentor but not in synopsys ``` class bus; rand bit [31:0] address; rand bit rd_wr_en; rand bit [1:0] interleaving; endclass class my_bus; rand bus b1[20]; function new(); foreach(b1[n]) b1[n] = new(); endfunction constraint c { foreach (b1[n]) if (n>0) if(b1[n-b1[n].interle...
50,111,338
I want to write a constraint to make sure `r_addr` is only allowed when the same address has been used as `w_addr` before, but the following constraint doesn't work. Do you have any suggestion? ``` class try; rand int w_addr; rand int r_addr; int ua[$]; int aa[int]; constraint unique_addr_c{ ...
2018/05/01
[ "https://Stackoverflow.com/questions/50111338", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9724103/" ]
This uses a queue instead of an associated array. ``` class try; rand int w_addr; rand int r_addr; int q[$]; function void post_randomize(); int sz; int idx; q.push_back(w_addr); sz = q.size(); idx = $urandom_range(0, sz-1); r_addr = q[idx]; endfunction endclass module test; try a; ...
The following code works in mentor but not in synopsys ``` class bus; rand bit [31:0] address; rand bit rd_wr_en; rand bit [1:0] interleaving; endclass class my_bus; rand bus b1[20]; function new(); foreach(b1[n]) b1[n] = new(); endfunction constraint c { foreach (b1[n]) if (n>0) if(b1[n-b1[n].interle...
19,753,297
I want to print an asterisk when `i + j` equals a specified number, but my code never prints one: ``` public class A{ public static void main(String[]args){ for (int i = 5; i < 10; i++) { for (int j = 5; j < 10; j++) { if ( i == j || ( i+j == 7 )) { System...
2013/11/03
[ "https://Stackoverflow.com/questions/19753297", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2949823/" ]
Multiply a tuple with a tuple as its item. Don't forget a trailing `,`. ``` >>> ((0, 1),) * 5 ((0, 1), (0, 1), (0, 1), (0, 1), (0, 1)) ```
You might also be interested in a generator. ``` >>> def f(): ... for i in range(10): ... yield (0, 1) ... >>> tuple(f()) ((0, 1), (0, 1), (0, 1), (0, 1), (0, 1), (0, 1), (0, 1), (0, 1), (0, 1), (0, 1)) ```
2,067,821
From Topology with Tears, "A topological space $(X,Ƭ)$ is not connected (that is, it is disconnected) if and only if there are non-empty open sets $A$ and $B$ such that $A\cap B = \emptyset$ and $A \cup B = X$" Thus, I believe the "A topological space $(X,Ƭ)$ is disconnected if it has at least one nonempty, proper sub...
2016/12/21
[ "https://math.stackexchange.com/questions/2067821", "https://math.stackexchange.com", "https://math.stackexchange.com/users/287565/" ]
The statement that you believe incorrect is, in fact, correct. Let $\emptyset \ne Y \subset X$ be closed and open. Since $Y$ is closed and proper, it follows that $X \setminus Y$ is open and nonempty. Therefore $X = Y \cup (X \setminus Y)$, the union of two non-empty, disjoint, open subsets. Then, according to your def...
The statement is correct. To see this take proper subset $A\neq\emptyset$ both open and closed. Then since $A$ closed $A^c$ open. Note that it is non-empty because $A$ is proper. Hence, we have two open sets $A,A^C\neq\emptyset$ and $A\cup A^c=X$. This statement propose a quick way to check disconnectedness for a topol...
32,330,017
I uploaded my app.ipa to diawi. When I install the app on iPhone 4s, 5s it works correctly. When I install it on iPhone 6 with UDID which starts with FFFFFF.. it says can not install the application on this iPhone this time . I found that these UDID's called fake . How can I solve this .
2015/09/01
[ "https://Stackoverflow.com/questions/32330017", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4871914/" ]
You can get the value of the radiobutton by using following code: `$this->input->post('balance')` Now you can do a simple check in your backend: ``` if ($this->input->post('balance') === 'Yes'){ //execute when true } else{ // execute other action } ``` When you want to get the value of a radiobutton and the n...
you can check the selected radio button in this way: ``` <?php $selected_radio=$_POST['yes']; if($selected_radio=='checked'){ //deduct 5 euros; } ?> ```
1,153,513
I was wondering what `grep -v "grep"` does and what it means?
2019/06/24
[ "https://askubuntu.com/questions/1153513", "https://askubuntu.com", "https://askubuntu.com/users/968950/" ]
`grep -v "grep"` takes input line by line, and outputs only the lines in which `grep` does not appear. Without `-v`, it would output only the lines in which `grep` *does* appear. See [`man grep`](http://manpages.ubuntu.com/manpages/bionic/en/man1/grep.1.html) for details. As far as the `grep` utility is itself concern...
`grep --help` tells us what `-v` flag does: ``` -v, --invert-match select non-matching lines ``` You can use `-v` flag to print inverts the match; that is, it matches only those lines that do not contain the given word. For example print all line that do not contain the word bar: ``` $ grep -v bar /path/to/f...
46,784,888
I have a collection view in which the cell we place image from gallery. On a cell there is a button which rotate an image when we click it. Now when I click the image it rotates the image but when I send it to the server it does not goes in the rotated angle as I selected, it goes as it is coming from gallery or camera...
2017/10/17
[ "https://Stackoverflow.com/questions/46784888", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8675882/" ]
Yes, take a look at [implicit classes](https://docs.scala-lang.org/overviews/core/implicit-classes.html) in Scala. Something like this: ``` object Helpers { implicit class SeqWrap[T](seq: Seq[T]) { def foo: Unit = { println("BLA") } } } import Helpers._ Seq(1,2).foo // prints "BLA" ```
You can "pimp" `Seq[T]` using implicit class like: ``` implicit class SeqEx[T](val seq: Seq[T]) extends AnyVal { def foo: Seq[T] = ... } ``` See: <https://alvinalexander.com/scala/scala-2.10-implicit-class-example>
46,784,888
I have a collection view in which the cell we place image from gallery. On a cell there is a button which rotate an image when we click it. Now when I click the image it rotates the image but when I send it to the server it does not goes in the rotated angle as I selected, it goes as it is coming from gallery or camera...
2017/10/17
[ "https://Stackoverflow.com/questions/46784888", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8675882/" ]
Yes, take a look at [implicit classes](https://docs.scala-lang.org/overviews/core/implicit-classes.html) in Scala. Something like this: ``` object Helpers { implicit class SeqWrap[T](seq: Seq[T]) { def foo: Unit = { println("BLA") } } } import Helpers._ Seq(1,2).foo // prints "BLA" ```
Yes, it's possible if you implement extension method via implicit conversion or implicit class: ``` object Main { def foo[T](a: Seq[T]): Seq[T] = ??? implicit class SeqWithFoo[T](a: Seq[T]) { def foo = Main.foo(a) } def main(args: Array[String]): Unit = { trait T val a: Seq[T] = ??? a.foo }...
46,784,888
I have a collection view in which the cell we place image from gallery. On a cell there is a button which rotate an image when we click it. Now when I click the image it rotates the image but when I send it to the server it does not goes in the rotated angle as I selected, it goes as it is coming from gallery or camera...
2017/10/17
[ "https://Stackoverflow.com/questions/46784888", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8675882/" ]
Yes, take a look at [implicit classes](https://docs.scala-lang.org/overviews/core/implicit-classes.html) in Scala. Something like this: ``` object Helpers { implicit class SeqWrap[T](seq: Seq[T]) { def foo: Unit = { println("BLA") } } } import Helpers._ Seq(1,2).foo // prints "BLA" ```
You can create implicit method that translates `Seq` to `RichSeq` which will have extra method you want. ``` class RichSeqSpecs extends FunSuite with Matchers { test("richSeq") { class RichSeq[T] (val seq: Seq[T]) { def foo = "do something" } implicit def seqToRichSeq[T](seq: Seq[T]) = new RichS...
7,033,589
how to import a Text file content to a JTextArea in a Java application using JFileChooser?
2011/08/11
[ "https://Stackoverflow.com/questions/7033589", "https://Stackoverflow.com", "https://Stackoverflow.com/users/877490/" ]
should be something like the following code: ``` JFileChooser chooser = new JFileChooser(); int returnVal = chooser.showOpenDialog(null); //replace null with your swing container File file; if(returnVal == JFileChooser.APPROVE_OPTION) file = chooser.getSelectedFile(); } JTextArea text = new JTextArea(); Bu...
Determine the filename given from the FileChooser, read the contents of the file into a String (e.g. using a [`StringBuilder`](http://download.oracle.com/javase/6/docs/api/java/lang/StringBuilder.html)), set the contents of the JTextArea to the contents of the buffer using [`JTextField#setText(String)`](http://download...
7,033,589
how to import a Text file content to a JTextArea in a Java application using JFileChooser?
2011/08/11
[ "https://Stackoverflow.com/questions/7033589", "https://Stackoverflow.com", "https://Stackoverflow.com/users/877490/" ]
should be something like the following code: ``` JFileChooser chooser = new JFileChooser(); int returnVal = chooser.showOpenDialog(null); //replace null with your swing container File file; if(returnVal == JFileChooser.APPROVE_OPTION) file = chooser.getSelectedFile(); } JTextArea text = new JTextArea(); Bu...
To import the contents of a file into a JTextArea you simply follow these steps! 1. Create a frame and add a JTextArea to it. 2. You declare and initialize a JFileChooser. 3. You add a listener to the JFileChooser. 4. In your actionPerformed, you should take the file that was selected and pass it to a method that woul...
7,033,589
how to import a Text file content to a JTextArea in a Java application using JFileChooser?
2011/08/11
[ "https://Stackoverflow.com/questions/7033589", "https://Stackoverflow.com", "https://Stackoverflow.com/users/877490/" ]
should be something like the following code: ``` JFileChooser chooser = new JFileChooser(); int returnVal = chooser.showOpenDialog(null); //replace null with your swing container File file; if(returnVal == JFileChooser.APPROVE_OPTION) file = chooser.getSelectedFile(); } JTextArea text = new JTextArea(); Bu...
![Document Viewer](https://i.stack.imgur.com/IUXmd.png) ``` import java.awt.BorderLayout; import java.awt.event.*; import javax.swing.*; import java.io.File; class DocumentViewer { public static void main(String[] args) { SwingUtilities.invokeLater(new Runnable() { public void run() { ...
7,033,589
how to import a Text file content to a JTextArea in a Java application using JFileChooser?
2011/08/11
[ "https://Stackoverflow.com/questions/7033589", "https://Stackoverflow.com", "https://Stackoverflow.com/users/877490/" ]
should be something like the following code: ``` JFileChooser chooser = new JFileChooser(); int returnVal = chooser.showOpenDialog(null); //replace null with your swing container File file; if(returnVal == JFileChooser.APPROVE_OPTION) file = chooser.getSelectedFile(); } JTextArea text = new JTextArea(); Bu...
``` private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { JFileChooser jf = new JFileChooser(); final JEditorPane document = new JEditorPane(); int returnval=jf.showDialog(this, null); File file = null; if(returnval == JFileChooser.APPROVE_O...
7,033,589
how to import a Text file content to a JTextArea in a Java application using JFileChooser?
2011/08/11
[ "https://Stackoverflow.com/questions/7033589", "https://Stackoverflow.com", "https://Stackoverflow.com/users/877490/" ]
To import the contents of a file into a JTextArea you simply follow these steps! 1. Create a frame and add a JTextArea to it. 2. You declare and initialize a JFileChooser. 3. You add a listener to the JFileChooser. 4. In your actionPerformed, you should take the file that was selected and pass it to a method that woul...
Determine the filename given from the FileChooser, read the contents of the file into a String (e.g. using a [`StringBuilder`](http://download.oracle.com/javase/6/docs/api/java/lang/StringBuilder.html)), set the contents of the JTextArea to the contents of the buffer using [`JTextField#setText(String)`](http://download...
7,033,589
how to import a Text file content to a JTextArea in a Java application using JFileChooser?
2011/08/11
[ "https://Stackoverflow.com/questions/7033589", "https://Stackoverflow.com", "https://Stackoverflow.com/users/877490/" ]
![Document Viewer](https://i.stack.imgur.com/IUXmd.png) ``` import java.awt.BorderLayout; import java.awt.event.*; import javax.swing.*; import java.io.File; class DocumentViewer { public static void main(String[] args) { SwingUtilities.invokeLater(new Runnable() { public void run() { ...
Determine the filename given from the FileChooser, read the contents of the file into a String (e.g. using a [`StringBuilder`](http://download.oracle.com/javase/6/docs/api/java/lang/StringBuilder.html)), set the contents of the JTextArea to the contents of the buffer using [`JTextField#setText(String)`](http://download...
7,033,589
how to import a Text file content to a JTextArea in a Java application using JFileChooser?
2011/08/11
[ "https://Stackoverflow.com/questions/7033589", "https://Stackoverflow.com", "https://Stackoverflow.com/users/877490/" ]
Determine the filename given from the FileChooser, read the contents of the file into a String (e.g. using a [`StringBuilder`](http://download.oracle.com/javase/6/docs/api/java/lang/StringBuilder.html)), set the contents of the JTextArea to the contents of the buffer using [`JTextField#setText(String)`](http://download...
``` private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { JFileChooser jf = new JFileChooser(); final JEditorPane document = new JEditorPane(); int returnval=jf.showDialog(this, null); File file = null; if(returnval == JFileChooser.APPROVE_O...
7,033,589
how to import a Text file content to a JTextArea in a Java application using JFileChooser?
2011/08/11
[ "https://Stackoverflow.com/questions/7033589", "https://Stackoverflow.com", "https://Stackoverflow.com/users/877490/" ]
To import the contents of a file into a JTextArea you simply follow these steps! 1. Create a frame and add a JTextArea to it. 2. You declare and initialize a JFileChooser. 3. You add a listener to the JFileChooser. 4. In your actionPerformed, you should take the file that was selected and pass it to a method that woul...
``` private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { JFileChooser jf = new JFileChooser(); final JEditorPane document = new JEditorPane(); int returnval=jf.showDialog(this, null); File file = null; if(returnval == JFileChooser.APPROVE_O...
7,033,589
how to import a Text file content to a JTextArea in a Java application using JFileChooser?
2011/08/11
[ "https://Stackoverflow.com/questions/7033589", "https://Stackoverflow.com", "https://Stackoverflow.com/users/877490/" ]
![Document Viewer](https://i.stack.imgur.com/IUXmd.png) ``` import java.awt.BorderLayout; import java.awt.event.*; import javax.swing.*; import java.io.File; class DocumentViewer { public static void main(String[] args) { SwingUtilities.invokeLater(new Runnable() { public void run() { ...
``` private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { JFileChooser jf = new JFileChooser(); final JEditorPane document = new JEditorPane(); int returnval=jf.showDialog(this, null); File file = null; if(returnval == JFileChooser.APPROVE_O...
40,463,023
I want to use Stanford NLP server with German text. I tested <http://corenlp.run/> and it works fine in German. If I try it on my own machine using > > java -mx4g -cp "\*" edu.stanford.nlp.pipeline.StanfordCoreNLPServer > [port] [timeout] > > > it just works in English. If I select German I get the error messa...
2016/11/07
[ "https://Stackoverflow.com/questions/40463023", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5798201/" ]
This is what finally worked for me. Basically I just overwrote the `get_success_url` to have access to the `page` parameter from the request. ``` class Orders_update(UpdateView): model = Order form_class = Order_UpdateForm template_name = "orders/orders_update.html" def get_success_url(self): ...
I just got finished pulling my hair out with this same problem. Here is what I did. Start in views.py in your ListView, Order\_list, and add context data: ``` def get_context_data(self, **kwargs): kwargs['current_page'] = self.request.GET.get('page', 1) return super().get_context_data(**kwargs) ``` T...
127,032
This is a second question about the same world described in [this question about human reaction to an alien world](https://worldbuilding.stackexchange.com/q/127031/11664). So here's the idea: human beings travel to and land on an Earth-like world with the intention of colonizing it. This world is remarkably Earth-lik...
2018/10/08
[ "https://worldbuilding.stackexchange.com/questions/127032", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/11664/" ]
Scientifically speaking, plants are [Autotrophs](https://en.wikipedia.org/wiki/Autotroph), and they do not require life to thrive. They don't need DNA, proteins, or anything else produced by life. After all, life must have begun with **something** that required no prior life to exist. Those things were molds, algae, p...
I am not an expert on the matter, but I would think that so long as earth plants can get access to the nutrients and sunlight they need to survive they will thrive. Bacteria and fungi are not important for plants to grow, they're important to decompose dead organice matter (including plants). I think the danger will b...
12,841
I have a website that needs to be PCI compliant. I have coded it using the guidelines but to be safe i wanted to get a third party audit done where this individual who runs a IT security firm and does individual projects will look at the source code and will also do penetration tests, etc. Now while it will make me f...
2012/03/18
[ "https://security.stackexchange.com/questions/12841", "https://security.stackexchange.com", "https://security.stackexchange.com/users/8071/" ]
I'd echo what the other answers have said in that what you're describing is a fairly standard security review process and if done properly you shouldn't have much to worry about in terms of the audit company having access to your data. A couple of points which may be of use * In choosing the company if there are any ...
I think your fears are overblown. My recommendation is to choose a third-party auditor you trust and give them full access to your site (your code, everything). Sure, have them sign a NDA, that's entirely reasonable. But be realistic: they're not going to steal your IP. They're professionals, and their career and their...
12,841
I have a website that needs to be PCI compliant. I have coded it using the guidelines but to be safe i wanted to get a third party audit done where this individual who runs a IT security firm and does individual projects will look at the source code and will also do penetration tests, etc. Now while it will make me f...
2012/03/18
[ "https://security.stackexchange.com/questions/12841", "https://security.stackexchange.com", "https://security.stackexchange.com/users/8071/" ]
I'd echo what the other answers have said in that what you're describing is a fairly standard security review process and if done properly you shouldn't have much to worry about in terms of the audit company having access to your data. A couple of points which may be of use * In choosing the company if there are any ...
For an accurate penetration test / security assessment and code review the context of the website need to be known and will help identify what may be the vulnerabilities. If are you are not open with these details the assessment may not find everything. **Promote it** Going through a security assessment is nothing to...
25,579,905
It is possible to hide get value from url (rozgaarexpress.com/profile.php?id=22) using .Htaccess.I want to hide ?id=22. Then URL Looks like rozgaarexpress.com/profile.php ``` My first page demo.php I am just passing this url <a href="profile.php?id=22">HTACCESS</a> second page profile.php <?php $id=$_GET['id']; ...
2014/08/30
[ "https://Stackoverflow.com/questions/25579905", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2922393/" ]
You can't hide the ID parameter, even if you use `.htaccess` to achieve that. I mean you can do it but you will be able to use a single ID when accessing profile.php page which I don't think is the case you want. You can do it by using sessions like: **demo.php** ``` session_start(); $_SESSION['id'] = 22; echo '<a...
im sure you asked this question to find a way to avoiding show ID to public. you can use session in this case like this: ``` <?php session_start(); $_SESSION['session_name']=$id; // Set the value of the id you want to pass. ?> ``` and in profile.php page you need this: ``` <?php session_start(); $id = ...
25,579,905
It is possible to hide get value from url (rozgaarexpress.com/profile.php?id=22) using .Htaccess.I want to hide ?id=22. Then URL Looks like rozgaarexpress.com/profile.php ``` My first page demo.php I am just passing this url <a href="profile.php?id=22">HTACCESS</a> second page profile.php <?php $id=$_GET['id']; ...
2014/08/30
[ "https://Stackoverflow.com/questions/25579905", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2922393/" ]
You can't hide the ID parameter, even if you use `.htaccess` to achieve that. I mean you can do it but you will be able to use a single ID when accessing profile.php page which I don't think is the case you want. You can do it by using sessions like: **demo.php** ``` session_start(); $_SESSION['id'] = 22; echo '<a...
I would rather take the desired profile ID from the Client. This allows the end-user the option to open two different profiles from the same page: ``` <script type="text/javascript"> function setInputAndSubmit(input) { var form=document.getElementById("skfrom"); var inputEl=document.getElementById("LANG"); input...
52,626,879
I would like to use the Stream approach, but I feel that it is somewhat sub-optimal. I would like to avoid the confusing ``` .map(Optional::of) ``` Is it possible to make the method #2 below to avoid this extra confusion, is there a optional method I could use to achieve what I want? ``` // Either map can be null, ...
2018/10/03
[ "https://Stackoverflow.com/questions/52626879", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2170968/" ]
you don't need ``` .map(map -> map.get(key)) .map(Optional::of) ``` `Optional.map` also returns `Optional`. you can just write ``` Optional.ofNullable(map1) .map(map -> map.get(key)) .orElseGet(() -> Optional.ofNullable(map2) ...
There is a fundamental design error in letting the map variables ever become `null`. If you can’t fix the source of the maps, you should at least introduce local variables holding non-`null` maps as early as possible in your processing. ``` Map<String,String> m1 = map1 == null? Map.of(): map1, m2 = map2 == null? Map....
973,785
Why every time I reboot my Windows 10, the icons on the desktop are reverted on their default position? I have searched for a solution on Google but without find anything useful.
2015/09/16
[ "https://superuser.com/questions/973785", "https://superuser.com", "https://superuser.com/users/284852/" ]
I often switch the HDMI from my TV to my Monitor or vice versa. Doing this, the icons are always mixed. Therefore I installed the program '**DesktopOK**', in which you can create profiles for different resolutions and save the state. There are alternative programs, too, when you google 'saving position desktop icons' ...
My fix was to right click the desktop where there is no other icons, Select View, and then uncheck Auto arrange icons. Works even after a reboot. I must admit it took me a while since upgrading to Windows 10. It definately works for me. Thanks, Tom
973,785
Why every time I reboot my Windows 10, the icons on the desktop are reverted on their default position? I have searched for a solution on Google but without find anything useful.
2015/09/16
[ "https://superuser.com/questions/973785", "https://superuser.com", "https://superuser.com/users/284852/" ]
I often switch the HDMI from my TV to my Monitor or vice versa. Doing this, the icons are always mixed. Therefore I installed the program '**DesktopOK**', in which you can create profiles for different resolutions and save the state. There are alternative programs, too, when you google 'saving position desktop icons' ...
The solution: Lay out your desktop icons to your preference, then right click on any open area of the desktop to bring up "View", then select a different icon size, Large Medium or Small, I chose Medium from my preferred small. Once they've changed in size, re-start the PC, and all should be exactly as you left it!
834,401
I need to find the splitting field of the polynomial $f(x)=x^4-2$ over $\mathbb Z\_3[x]$ and $\mathbb Z\_7[x]$. I know that if it's irreducible over $\mathbb Z\_3[x]$, then $\mathbb Z\_3 [x]/ \langle f(x) \rangle$ is the splitting field. The problem is that I don't know how to determine whether it's irreducible or not...
2014/06/14
[ "https://math.stackexchange.com/questions/834401", "https://math.stackexchange.com", "https://math.stackexchange.com/users/91974/" ]
Regarding your second, more specific question: since $f^\*s$ is a section of $ mK\_X$ which vanishes along $E$, it lies in $\mathcal O(m K\_X - E)$. --- In general, if $D$ is a Cartier divisor, then $\mathcal O(D)$ can be thought of as: an invertible sheaf whose meromorphic sections have divisors of zeroes and poles ...
One point that may help is that $K\_X$ is the divisor of zeroes *minus poles* of $\omega$. The concrete case to always bear in mind is $\mathbb{P}^n$, where we have an $n$-form $dx\_1/x\_1\wedge...\wedge dx\_n/x\_n$. This is nondegerate, i.e. has no zeroes, but has poles along hyperplanes $x\_i=0$. So sections of $O(K\...
2,754,164
I've been using J for a few months now, and I find that reading unfamiliar code (e.g. that I didn't write myself) is one of the most challenging aspects of the language, particularly when it's in tacit. After a while, I came up with this strategy: 1) Copy the code segment into a word document 2) Take each operator fr...
2010/05/02
[ "https://Stackoverflow.com/questions/2754164", "https://Stackoverflow.com", "https://Stackoverflow.com/users/330826/" ]
Try breaking the verb up into its components first, and then see what they do. And rather than always referring to the vocab, you could simply try out a component on data to see what it does, and see if you can figure it out. To see the structure of the verb, it helps to know what parts of speech you're looking at, and...
(I'm putting this in the answer section instead of editing the question because the question looks long enough as it is.) I just found an excellent paper on [the jsoftware website](http://www.jsoftware.com/jwiki/Guides/Reading%20Tacit%20Verbs) that works well in combination with Jordan's answer and the method I descri...
2,754,164
I've been using J for a few months now, and I find that reading unfamiliar code (e.g. that I didn't write myself) is one of the most challenging aspects of the language, particularly when it's in tacit. After a while, I came up with this strategy: 1) Copy the code segment into a word document 2) Take each operator fr...
2010/05/02
[ "https://Stackoverflow.com/questions/2754164", "https://Stackoverflow.com", "https://Stackoverflow.com/users/330826/" ]
Try breaking the verb up into its components first, and then see what they do. And rather than always referring to the vocab, you could simply try out a component on data to see what it does, and see if you can figure it out. To see the structure of the verb, it helps to know what parts of speech you're looking at, and...
Personally, I think of J code in terms of what it does -- if I do not have any example arguments, I rapidly get lost. If I do have examples, it's usually easy for me to see what a sub-expression is doing. And, when it gets hard, that means I need to look up a word in the dictionary, or possibly study its grammar. Rea...
2,754,164
I've been using J for a few months now, and I find that reading unfamiliar code (e.g. that I didn't write myself) is one of the most challenging aspects of the language, particularly when it's in tacit. After a while, I came up with this strategy: 1) Copy the code segment into a word document 2) Take each operator fr...
2010/05/02
[ "https://Stackoverflow.com/questions/2754164", "https://Stackoverflow.com", "https://Stackoverflow.com/users/330826/" ]
Try breaking the verb up into its components first, and then see what they do. And rather than always referring to the vocab, you could simply try out a component on data to see what it does, and see if you can figure it out. To see the structure of the verb, it helps to know what parts of speech you're looking at, and...
I just want to talk about how I read: <.@-:@#{/:~ First off, I knew that if it was a function, from the command line, it had to be entered (for testing) as (<.@-:@#{/:~) Now I looked at the stuff in the parenthesis. I saw a /:~, which returns a sorted list of its arguments, { which selects an item from a list, # wh...
2,754,164
I've been using J for a few months now, and I find that reading unfamiliar code (e.g. that I didn't write myself) is one of the most challenging aspects of the language, particularly when it's in tacit. After a while, I came up with this strategy: 1) Copy the code segment into a word document 2) Take each operator fr...
2010/05/02
[ "https://Stackoverflow.com/questions/2754164", "https://Stackoverflow.com", "https://Stackoverflow.com/users/330826/" ]
Try breaking the verb up into its components first, and then see what they do. And rather than always referring to the vocab, you could simply try out a component on data to see what it does, and see if you can figure it out. To see the structure of the verb, it helps to know what parts of speech you're looking at, and...
Just wanted to add to [Jordan's Answer](https://stackoverflow.com/a/2777186/40745 "Jordan's answer") : if you don't have box display turned on, you can format things this way explicitly with `5!:2` ``` f =. <.@-:@#{/:~ 5!:2 < 'f' ┌───────────────┬─┬──────┐ │┌─────────┬─┬─┐│{│┌──┬─┐│ ││┌──┬─┬──┐│@│#││ ││/:│~││ ││...
2,754,164
I've been using J for a few months now, and I find that reading unfamiliar code (e.g. that I didn't write myself) is one of the most challenging aspects of the language, particularly when it's in tacit. After a while, I came up with this strategy: 1) Copy the code segment into a word document 2) Take each operator fr...
2010/05/02
[ "https://Stackoverflow.com/questions/2754164", "https://Stackoverflow.com", "https://Stackoverflow.com/users/330826/" ]
(I'm putting this in the answer section instead of editing the question because the question looks long enough as it is.) I just found an excellent paper on [the jsoftware website](http://www.jsoftware.com/jwiki/Guides/Reading%20Tacit%20Verbs) that works well in combination with Jordan's answer and the method I descri...
Personally, I think of J code in terms of what it does -- if I do not have any example arguments, I rapidly get lost. If I do have examples, it's usually easy for me to see what a sub-expression is doing. And, when it gets hard, that means I need to look up a word in the dictionary, or possibly study its grammar. Rea...
2,754,164
I've been using J for a few months now, and I find that reading unfamiliar code (e.g. that I didn't write myself) is one of the most challenging aspects of the language, particularly when it's in tacit. After a while, I came up with this strategy: 1) Copy the code segment into a word document 2) Take each operator fr...
2010/05/02
[ "https://Stackoverflow.com/questions/2754164", "https://Stackoverflow.com", "https://Stackoverflow.com/users/330826/" ]
Just wanted to add to [Jordan's Answer](https://stackoverflow.com/a/2777186/40745 "Jordan's answer") : if you don't have box display turned on, you can format things this way explicitly with `5!:2` ``` f =. <.@-:@#{/:~ 5!:2 < 'f' ┌───────────────┬─┬──────┐ │┌─────────┬─┬─┐│{│┌──┬─┐│ ││┌──┬─┬──┐│@│#││ ││/:│~││ ││...
(I'm putting this in the answer section instead of editing the question because the question looks long enough as it is.) I just found an excellent paper on [the jsoftware website](http://www.jsoftware.com/jwiki/Guides/Reading%20Tacit%20Verbs) that works well in combination with Jordan's answer and the method I descri...
2,754,164
I've been using J for a few months now, and I find that reading unfamiliar code (e.g. that I didn't write myself) is one of the most challenging aspects of the language, particularly when it's in tacit. After a while, I came up with this strategy: 1) Copy the code segment into a word document 2) Take each operator fr...
2010/05/02
[ "https://Stackoverflow.com/questions/2754164", "https://Stackoverflow.com", "https://Stackoverflow.com/users/330826/" ]
I just want to talk about how I read: <.@-:@#{/:~ First off, I knew that if it was a function, from the command line, it had to be entered (for testing) as (<.@-:@#{/:~) Now I looked at the stuff in the parenthesis. I saw a /:~, which returns a sorted list of its arguments, { which selects an item from a list, # wh...
Personally, I think of J code in terms of what it does -- if I do not have any example arguments, I rapidly get lost. If I do have examples, it's usually easy for me to see what a sub-expression is doing. And, when it gets hard, that means I need to look up a word in the dictionary, or possibly study its grammar. Rea...
2,754,164
I've been using J for a few months now, and I find that reading unfamiliar code (e.g. that I didn't write myself) is one of the most challenging aspects of the language, particularly when it's in tacit. After a while, I came up with this strategy: 1) Copy the code segment into a word document 2) Take each operator fr...
2010/05/02
[ "https://Stackoverflow.com/questions/2754164", "https://Stackoverflow.com", "https://Stackoverflow.com/users/330826/" ]
Just wanted to add to [Jordan's Answer](https://stackoverflow.com/a/2777186/40745 "Jordan's answer") : if you don't have box display turned on, you can format things this way explicitly with `5!:2` ``` f =. <.@-:@#{/:~ 5!:2 < 'f' ┌───────────────┬─┬──────┐ │┌─────────┬─┬─┐│{│┌──┬─┐│ ││┌──┬─┬──┐│@│#││ ││/:│~││ ││...
Personally, I think of J code in terms of what it does -- if I do not have any example arguments, I rapidly get lost. If I do have examples, it's usually easy for me to see what a sub-expression is doing. And, when it gets hard, that means I need to look up a word in the dictionary, or possibly study its grammar. Rea...
2,754,164
I've been using J for a few months now, and I find that reading unfamiliar code (e.g. that I didn't write myself) is one of the most challenging aspects of the language, particularly when it's in tacit. After a while, I came up with this strategy: 1) Copy the code segment into a word document 2) Take each operator fr...
2010/05/02
[ "https://Stackoverflow.com/questions/2754164", "https://Stackoverflow.com", "https://Stackoverflow.com/users/330826/" ]
Just wanted to add to [Jordan's Answer](https://stackoverflow.com/a/2777186/40745 "Jordan's answer") : if you don't have box display turned on, you can format things this way explicitly with `5!:2` ``` f =. <.@-:@#{/:~ 5!:2 < 'f' ┌───────────────┬─┬──────┐ │┌─────────┬─┬─┐│{│┌──┬─┐│ ││┌──┬─┬──┐│@│#││ ││/:│~││ ││...
I just want to talk about how I read: <.@-:@#{/:~ First off, I knew that if it was a function, from the command line, it had to be entered (for testing) as (<.@-:@#{/:~) Now I looked at the stuff in the parenthesis. I saw a /:~, which returns a sorted list of its arguments, { which selects an item from a list, # wh...
33,799,496
I am working with the BTYD plus code given in <https://github.com/mplatzer/BTYDplus/blob/master/R/pareto-nbd-mcmc.r> . This code uses the MCMC technique to estimate the Pareto/NBD parameters of the BTYD Model. So, If you see line 224-228 of the code, it uses the function 'mclapply'- which I found can run only on Linux...
2015/11/19
[ "https://Stackoverflow.com/questions/33799496", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5554443/" ]
Use `parLapply`: ``` Sys.info()["sysname"] # sysname #"Windows" library(parallel) cl <- makeCluster(getOption("cl.cores", 2)) l <- list(1, 2) system.time( parLapply(cl, l, function(x) { Sys.sleep(10) }) ) #user system elapsed #0 0 10 stopCluster(cl) ``` You might want to look into the doRNG pac...
In the documentation of the parallel package i found the following: > > "As analogues of lapply there are > > > parLapply(cl, x, FUN, ...) > > > mclapply(X, FUN, ..., mc.cores) > > > where mclapply is not available on Windows ..." > > > Page 3 of <https://stat.ethz.ch/R-manual/R-devel/library/parallel/doc/p...
692,443
This pertains to my Raspberry Pi, on which I have Raspbmc installed. I do realize that there is a Raspberry Pi StackExchange site, but I figured I might get more eyes on this problem here. The issue is that I modified `/etc/sudoers` in an attempt to grant `NOPASSWD` permissions to one of the users, but I guess somewh...
2013/12/24
[ "https://superuser.com/questions/692443", "https://superuser.com", "https://superuser.com/users/149613/" ]
You should still be able to boot up the Pi in Single User mode to get access to root. Using another computer, modify `cmdline.txt` and add `single` to the end of the line Then when you boot up the Pi from the SD card, it should automatically dump you to a root prompt which well allow you to update `/etc/sudoers`
The easiest solution is to boot up another OS on a LiveDVD or LiveUSB (ideally a LiveUSB, and ideally a Linux OS) then mount the disc and manually change the file. I've done similar things before and fixed it in this manner. All of your files will be visible and editable from the Live system. Unless you've encrypted th...
692,443
This pertains to my Raspberry Pi, on which I have Raspbmc installed. I do realize that there is a Raspberry Pi StackExchange site, but I figured I might get more eyes on this problem here. The issue is that I modified `/etc/sudoers` in an attempt to grant `NOPASSWD` permissions to one of the users, but I guess somewh...
2013/12/24
[ "https://superuser.com/questions/692443", "https://superuser.com", "https://superuser.com/users/149613/" ]
After two days of research and browsing the web I have finally found a solution and been able to save my own Raspberry Pi system (not having to reformat the SD card and start from scratch)! **NOTE:** This answer is pretty long. If you want to get to the actual solution quickly, I've added a header that you can scroll ...
The easiest solution is to boot up another OS on a LiveDVD or LiveUSB (ideally a LiveUSB, and ideally a Linux OS) then mount the disc and manually change the file. I've done similar things before and fixed it in this manner. All of your files will be visible and editable from the Live system. Unless you've encrypted th...
692,443
This pertains to my Raspberry Pi, on which I have Raspbmc installed. I do realize that there is a Raspberry Pi StackExchange site, but I figured I might get more eyes on this problem here. The issue is that I modified `/etc/sudoers` in an attempt to grant `NOPASSWD` permissions to one of the users, but I guess somewh...
2013/12/24
[ "https://superuser.com/questions/692443", "https://superuser.com", "https://superuser.com/users/149613/" ]
You should still be able to boot up the Pi in Single User mode to get access to root. Using another computer, modify `cmdline.txt` and add `single` to the end of the line Then when you boot up the Pi from the SD card, it should automatically dump you to a root prompt which well allow you to update `/etc/sudoers`
After two days of research and browsing the web I have finally found a solution and been able to save my own Raspberry Pi system (not having to reformat the SD card and start from scratch)! **NOTE:** This answer is pretty long. If you want to get to the actual solution quickly, I've added a header that you can scroll ...
12,084,746
Not sure whats going on, trying to pull a simple image HTML ``` <div></div> ``` JS ``` $.getJSON("http://api.dribbble.com/shots/popular?callback=?", function(data) { $('div').append('<img src="+data.shots[0].image_url+" />'); }); ``` in the console it will pull the link find but when I try to displ...
2012/08/23
[ "https://Stackoverflow.com/questions/12084746", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
You missed the single quotes. ``` $('div').append('<img src="' + data.shots[0].image_url + '" />'); ```
Try this: ``` $.getJSON("http://api.dribbble.com/shots/popular?callback=?", function(data) { $('div').append('<img src="' + data.shots[0].image_url + '" />'); }); ```
12,084,746
Not sure whats going on, trying to pull a simple image HTML ``` <div></div> ``` JS ``` $.getJSON("http://api.dribbble.com/shots/popular?callback=?", function(data) { $('div').append('<img src="+data.shots[0].image_url+" />'); }); ``` in the console it will pull the link find but when I try to displ...
2012/08/23
[ "https://Stackoverflow.com/questions/12084746", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
You missed the single quotes. ``` $('div').append('<img src="' + data.shots[0].image_url + '" />'); ```
If you want you can use this simples Javascript Dribbble API library: [Dribbble.js](https://github.com/evandroeisinger/dribbble) You can see a example here: [Dribbble API Example](https://evandroeisinger.com/dribbble) Its simple tu use: ``` // get the most popular shots Dribbble.list( 'popular', function( response ...
47,540,782
[Environment: macOS 10.12.6, RStudio 1.1.383, R 3.4.2 (via homebrew)] **Please note this is *not* a duplicate of [this question](https://stackoverflow.com/questions/40682615/cannot-install-xml-package-in-r) - solutions there do not work for me.** I am getting install errors when I attempt to install the XML package i...
2017/11/28
[ "https://Stackoverflow.com/questions/47540782", "https://Stackoverflow.com", "https://Stackoverflow.com/users/610090/" ]
(Naturally, I discovered the answer immediately after posting. :) The solution is to remove ``` LIBXML_INCDIR=/usr/local/opt/libxml2 LIBXML_LIBDIR=/usr/local/opt/libxml2 ``` from `~/.Renviron` and add ``` XML_CONFIG=/usr/local/bin/xml2-config ``` this allowed the XML package to compile and install.
I had this problem for a long time. only in RStudio. Install the package on R and Library it. Go to RStudio and require the package.
47,540,782
[Environment: macOS 10.12.6, RStudio 1.1.383, R 3.4.2 (via homebrew)] **Please note this is *not* a duplicate of [this question](https://stackoverflow.com/questions/40682615/cannot-install-xml-package-in-r) - solutions there do not work for me.** I am getting install errors when I attempt to install the XML package i...
2017/11/28
[ "https://Stackoverflow.com/questions/47540782", "https://Stackoverflow.com", "https://Stackoverflow.com/users/610090/" ]
(Naturally, I discovered the answer immediately after posting. :) The solution is to remove ``` LIBXML_INCDIR=/usr/local/opt/libxml2 LIBXML_LIBDIR=/usr/local/opt/libxml2 ``` from `~/.Renviron` and add ``` XML_CONFIG=/usr/local/bin/xml2-config ``` this allowed the XML package to compile and install.
please set PKG\_CONFIG\_PATH, it should contain a ***libxml-2.0.pc*** file. For me, I installed libxml2 by brew, and this code works: ``` export PKG_CONFIG_PATH="/usr/local/Cellar/libxml2/2.9.8/lib/pkgconfig" ```
47,540,782
[Environment: macOS 10.12.6, RStudio 1.1.383, R 3.4.2 (via homebrew)] **Please note this is *not* a duplicate of [this question](https://stackoverflow.com/questions/40682615/cannot-install-xml-package-in-r) - solutions there do not work for me.** I am getting install errors when I attempt to install the XML package i...
2017/11/28
[ "https://Stackoverflow.com/questions/47540782", "https://Stackoverflow.com", "https://Stackoverflow.com/users/610090/" ]
please set PKG\_CONFIG\_PATH, it should contain a ***libxml-2.0.pc*** file. For me, I installed libxml2 by brew, and this code works: ``` export PKG_CONFIG_PATH="/usr/local/Cellar/libxml2/2.9.8/lib/pkgconfig" ```
I had this problem for a long time. only in RStudio. Install the package on R and Library it. Go to RStudio and require the package.
20,259,440
I have created a tabbed application in Xcode 5 by using storyboard with 5 different tabs. Now I want to access the fifth view controller to pragmatically modify some fields, so i wish to access the view controller automatically created by the storyboard. I have given the view controller a identifier and in my viewDi...
2013/11/28
[ "https://Stackoverflow.com/questions/20259440", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1722027/" ]
I finally got it working with almost any kind of tile. And since the algorithm is just used to generate configuration files for another application, I'll fix the remaining tiles manually :) Here is my solution for anyone interested: 1. Raise the contrast and lower the brightness of the image in order to easily distin...
I don't think that edge detection will help you here. If the floor plans are always regular grids, the task is easier: You just have to loop through all border tiles and identify whether they are wall tiles or floor tiles. If it is a door tile, draw the door as rectangle. (This means that in your example, there are re...
25,094,232
How to get greatest or least value of two columns or some arithmatic done? Same can be done in MYSQL. [Greatest in mysql](http://dev.mysql.com/doc/refman/5.1/en/comparison-operators.html#function%5Fgreatest) [Least in mysql](http://dev.mysql.com/doc/refman/5.1/en/comparison-operators.html#function_least) I don't wa...
2014/08/02
[ "https://Stackoverflow.com/questions/25094232", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1045444/" ]
The compiler automatically generates a copy constructor `Foo(const Foo&)` and possibly also move constructor depending on exact version/settings `Foo(Foo&&)`. This has nothing to do with operator new, or any pointer magic. Your code simply calls a perfectly normal copy/move constructor defined for you by the compiler. ...
The constructor you are observing is the copy constructor. Every class has a copy constructor. If you do not declare any copy constructor in your class definition, a copy constructor is *implicitly declared* for you. The particular signature of the implicitly declared copy constructor depends on your class definition,...
1,094,744
I do have a GKE k8s cluster (k8s 1.22) that consists of preemptible nodes *only*, which includes critical services like kube-dns. It's a dev machine which can tolerate some broken minutes a day. Every time a node gets shut down which hosts a kube-dns pod, I run into DNS resolution problems that persist until I delete t...
2022/02/25
[ "https://serverfault.com/questions/1094744", "https://serverfault.com", "https://serverfault.com/users/956533/" ]
This is happening for me as well: FATAL[09/03/22 09:20:45] Could not create environment: rpc error: code = Unavailable desc = connection error: desc = "transport: authentication handshake failed: x509: certificate is not valid for any names, but wanted to match " Doesn't matter if I supply --vault-cert-sans Vault is ...
As workaround I manualy created certs in vault and put them to k8s hosts. But it should be done by OLCNE, works it for anyone?
93,623
How is it that lead can block radiation, and things are lead lined. In the Indiana Jones 4 movie he climbs inside a lead-lined fridge and he somehow survives the blast and radiation?
2014/01/14
[ "https://physics.stackexchange.com/questions/93623", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/36235/" ]
Lead is used to block radiation because: 1. It is very dense. This means that the number of interactions that a radiation particle will undergo is higher over a fixed distance which causes the radiation to [attenuate](http://en.wikipedia.org/wiki/Attenuation). 2. It has a high proton number Z. This means that the char...
Some additional information about shielding with high Z materials: According to Table 3 in <http://iopscience.iop.org/0022-3700/8/12/014/pdf/jbv8i12p2015.pdf>, there is a strong relationship between the atomic number of a material, and the photoelectric cross section (the probability of a PE interaction). Plotting th...
45,802,097
I am aware of `this` scopes but I am new to TypeScript and classes in JavaScript. I am trying to access class properties within a function which is bound to a class property (to be more specific it's bound to a Socket object). ``` export class BrawlStarsClient { credentials:object dataBuffers:Array<Buffer> pingI...
2017/08/21
[ "https://Stackoverflow.com/questions/45802097", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3924219/" ]
This probably means it was incorrectly added to the git repository at some point and then ignored afterwards. git will continue to track changes to gitignored files if they are present in the index ("checked in"). If you don't want the file checked in at all, you can remove it from the index by running ``` git rm pat...
I'm using SourceTree(<https://www.sourcetreeapp.com/>) to manage my git commits. With it you can right click your changes and have an option of Stop Tracking.I used it for the same files you are trying to ignore as myself also just upgraded to 15.3.0 and that was the last time i saw those pending changes
45,802,097
I am aware of `this` scopes but I am new to TypeScript and classes in JavaScript. I am trying to access class properties within a function which is bound to a class property (to be more specific it's bound to a Socket object). ``` export class BrawlStarsClient { credentials:object dataBuffers:Array<Buffer> pingI...
2017/08/21
[ "https://Stackoverflow.com/questions/45802097", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3924219/" ]
This probably means it was incorrectly added to the git repository at some point and then ignored afterwards. git will continue to track changes to gitignored files if they are present in the index ("checked in"). If you don't want the file checked in at all, you can remove it from the index by running ``` git rm pat...
the following seems to have solved the issue for me. ``` # Visual Studio 2015/2017 cache/options directory *.vs/ ``` it ignores everything in it.
45,802,097
I am aware of `this` scopes but I am new to TypeScript and classes in JavaScript. I am trying to access class properties within a function which is bound to a class property (to be more specific it's bound to a Socket object). ``` export class BrawlStarsClient { credentials:object dataBuffers:Array<Buffer> pingI...
2017/08/21
[ "https://Stackoverflow.com/questions/45802097", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3924219/" ]
To fix this, if you got to the Team Explorer tab and click on the Manage Connections button (the green one a the top) you will see a list of local Git Repositories. Right click on the repository you want to stop tracking the storage.ide file on and select Open Command Prompt. You should then be able to type the foll...
This probably means it was incorrectly added to the git repository at some point and then ignored afterwards. git will continue to track changes to gitignored files if they are present in the index ("checked in"). If you don't want the file checked in at all, you can remove it from the index by running ``` git rm pat...
45,802,097
I am aware of `this` scopes but I am new to TypeScript and classes in JavaScript. I am trying to access class properties within a function which is bound to a class property (to be more specific it's bound to a Socket object). ``` export class BrawlStarsClient { credentials:object dataBuffers:Array<Buffer> pingI...
2017/08/21
[ "https://Stackoverflow.com/questions/45802097", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3924219/" ]
This probably means it was incorrectly added to the git repository at some point and then ignored afterwards. git will continue to track changes to gitignored files if they are present in the index ("checked in"). If you don't want the file checked in at all, you can remove it from the index by running ``` git rm pat...
I just had the same issue. I solved it by making a whole new `.gitignore` file from visual studio's team explorer (Team Explorer => Some git directory => Settings => Repository Settings => Gitignore file Add). Then I deleted my `.vs` in my project folder and manually committed by git bash with the following lines: ``...
45,802,097
I am aware of `this` scopes but I am new to TypeScript and classes in JavaScript. I am trying to access class properties within a function which is bound to a class property (to be more specific it's bound to a Socket object). ``` export class BrawlStarsClient { credentials:object dataBuffers:Array<Buffer> pingI...
2017/08/21
[ "https://Stackoverflow.com/questions/45802097", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3924219/" ]
the following seems to have solved the issue for me. ``` # Visual Studio 2015/2017 cache/options directory *.vs/ ``` it ignores everything in it.
I'm using SourceTree(<https://www.sourcetreeapp.com/>) to manage my git commits. With it you can right click your changes and have an option of Stop Tracking.I used it for the same files you are trying to ignore as myself also just upgraded to 15.3.0 and that was the last time i saw those pending changes
45,802,097
I am aware of `this` scopes but I am new to TypeScript and classes in JavaScript. I am trying to access class properties within a function which is bound to a class property (to be more specific it's bound to a Socket object). ``` export class BrawlStarsClient { credentials:object dataBuffers:Array<Buffer> pingI...
2017/08/21
[ "https://Stackoverflow.com/questions/45802097", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3924219/" ]
To fix this, if you got to the Team Explorer tab and click on the Manage Connections button (the green one a the top) you will see a list of local Git Repositories. Right click on the repository you want to stop tracking the storage.ide file on and select Open Command Prompt. You should then be able to type the foll...
I'm using SourceTree(<https://www.sourcetreeapp.com/>) to manage my git commits. With it you can right click your changes and have an option of Stop Tracking.I used it for the same files you are trying to ignore as myself also just upgraded to 15.3.0 and that was the last time i saw those pending changes
45,802,097
I am aware of `this` scopes but I am new to TypeScript and classes in JavaScript. I am trying to access class properties within a function which is bound to a class property (to be more specific it's bound to a Socket object). ``` export class BrawlStarsClient { credentials:object dataBuffers:Array<Buffer> pingI...
2017/08/21
[ "https://Stackoverflow.com/questions/45802097", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3924219/" ]
I just had the same issue. I solved it by making a whole new `.gitignore` file from visual studio's team explorer (Team Explorer => Some git directory => Settings => Repository Settings => Gitignore file Add). Then I deleted my `.vs` in my project folder and manually committed by git bash with the following lines: ``...
I'm using SourceTree(<https://www.sourcetreeapp.com/>) to manage my git commits. With it you can right click your changes and have an option of Stop Tracking.I used it for the same files you are trying to ignore as myself also just upgraded to 15.3.0 and that was the last time i saw those pending changes
45,802,097
I am aware of `this` scopes but I am new to TypeScript and classes in JavaScript. I am trying to access class properties within a function which is bound to a class property (to be more specific it's bound to a Socket object). ``` export class BrawlStarsClient { credentials:object dataBuffers:Array<Buffer> pingI...
2017/08/21
[ "https://Stackoverflow.com/questions/45802097", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3924219/" ]
To fix this, if you got to the Team Explorer tab and click on the Manage Connections button (the green one a the top) you will see a list of local Git Repositories. Right click on the repository you want to stop tracking the storage.ide file on and select Open Command Prompt. You should then be able to type the foll...
the following seems to have solved the issue for me. ``` # Visual Studio 2015/2017 cache/options directory *.vs/ ``` it ignores everything in it.
45,802,097
I am aware of `this` scopes but I am new to TypeScript and classes in JavaScript. I am trying to access class properties within a function which is bound to a class property (to be more specific it's bound to a Socket object). ``` export class BrawlStarsClient { credentials:object dataBuffers:Array<Buffer> pingI...
2017/08/21
[ "https://Stackoverflow.com/questions/45802097", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3924219/" ]
the following seems to have solved the issue for me. ``` # Visual Studio 2015/2017 cache/options directory *.vs/ ``` it ignores everything in it.
I just had the same issue. I solved it by making a whole new `.gitignore` file from visual studio's team explorer (Team Explorer => Some git directory => Settings => Repository Settings => Gitignore file Add). Then I deleted my `.vs` in my project folder and manually committed by git bash with the following lines: ``...
45,802,097
I am aware of `this` scopes but I am new to TypeScript and classes in JavaScript. I am trying to access class properties within a function which is bound to a class property (to be more specific it's bound to a Socket object). ``` export class BrawlStarsClient { credentials:object dataBuffers:Array<Buffer> pingI...
2017/08/21
[ "https://Stackoverflow.com/questions/45802097", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3924219/" ]
To fix this, if you got to the Team Explorer tab and click on the Manage Connections button (the green one a the top) you will see a list of local Git Repositories. Right click on the repository you want to stop tracking the storage.ide file on and select Open Command Prompt. You should then be able to type the foll...
I just had the same issue. I solved it by making a whole new `.gitignore` file from visual studio's team explorer (Team Explorer => Some git directory => Settings => Repository Settings => Gitignore file Add). Then I deleted my `.vs` in my project folder and manually committed by git bash with the following lines: ``...
55,326,837
I have a carousel that is centered and only takes half the screen by adding this to the class "w-50". When the browser resizes to a smaller screen, like a mobile device, I want that carousel to take up the whole width of the screen. To do this I'm sure I'll need to find a way to change that to "w-100", but I'm not sure...
2019/03/24
[ "https://Stackoverflow.com/questions/55326837", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8741710/" ]
Your problem is that you are using `or` instead of `and`. If you think about how the code is interpreted: Let's say that `mode="encrypt"`. Step by step: `mode != 'encrypt'` evaluates to `false`. All good so far. `mode != 'decrypt'`, however, evaluates to `true`. This is a problem. The final expression sent to the `...
`n != 2 or n != 3` will always be true. If `n` is `2` then it's not `3`. All other values are not `2`. You intended `n != 2 and n != 3`.
55,326,837
I have a carousel that is centered and only takes half the screen by adding this to the class "w-50". When the browser resizes to a smaller screen, like a mobile device, I want that carousel to take up the whole width of the screen. To do this I'm sure I'll need to find a way to change that to "w-100", but I'm not sure...
2019/03/24
[ "https://Stackoverflow.com/questions/55326837", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8741710/" ]
`n != 2 or n != 3` will always be true. If `n` is `2` then it's not `3`. All other values are not `2`. You intended `n != 2 and n != 3`.
You need to use `and`, not `or`. Because `n` will never be equal to both 3 and 4, the `if` statement that incorporates `or` will always resolve to `True`
55,326,837
I have a carousel that is centered and only takes half the screen by adding this to the class "w-50". When the browser resizes to a smaller screen, like a mobile device, I want that carousel to take up the whole width of the screen. To do this I'm sure I'll need to find a way to change that to "w-100", but I'm not sure...
2019/03/24
[ "https://Stackoverflow.com/questions/55326837", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8741710/" ]
Your problem is that you are using `or` instead of `and`. If you think about how the code is interpreted: Let's say that `mode="encrypt"`. Step by step: `mode != 'encrypt'` evaluates to `false`. All good so far. `mode != 'decrypt'`, however, evaluates to `true`. This is a problem. The final expression sent to the `...
You need to use `and`, not `or`. Because `n` will never be equal to both 3 and 4, the `if` statement that incorporates `or` will always resolve to `True`
25,293,171
This question requires some php, some jquery, and some general programming logic. With generous help in [previous questions](https://stackoverflow.com/questions/25220874/combine-two-similar-jquery-scripts-into-an-if-then-script) here, I have built a script that scans WordPress posts for image attachments and, if it fi...
2014/08/13
[ "https://Stackoverflow.com/questions/25293171", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2654408/" ]
You can use **UrlReferrer**. However, it is not a secure way of detecting where the user comes from. For example, ``` if (string.Equals(Request.UrlReferrer.AbsoluteUri, "YOUR_REFERRER_URL", StringComparison.InvariantCultureIgnoreCase)) { } ``` If it is redirecting between pages inside your application, I ...
You could use the [`Request.UrlReferrer`](http://msdn.microsoft.com/en-us/library/system.web.httprequest.urlreferrer(v=vs.110).aspx) property to check what page the user is coming from.
42,091,600
I have the following array of object: ``` Objs[0] = {Name : "ABC"}; Objs[1] = {Roll : 123} ``` I'm trying to make it as the following: ``` Objs { Name : "ABC", Roll : 123 } ``` I attempted to make it with the following code: ``` var Objs = [{ Name: "ABC" }, { Roll: 123 }]; console.log( Object.assign.a...
2017/02/07
[ "https://Stackoverflow.com/questions/42091600", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6474292/" ]
IE11 does not support [`Object.assign`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign#Browser_compatibility). You could iterate the array and the keys and take the values as new property of the result object. ```js var objs = [{ Name: "ABC" }, { Roll: 123 }], resu...
If you are using TypeScript, try to replace `Object.assign({}, ...Objs)` to `{...Objs};` the browser will automatically replace it to `__assign({}, Objs);` and this notacion works in IE11.
42,091,600
I have the following array of object: ``` Objs[0] = {Name : "ABC"}; Objs[1] = {Roll : 123} ``` I'm trying to make it as the following: ``` Objs { Name : "ABC", Roll : 123 } ``` I attempted to make it with the following code: ``` var Objs = [{ Name: "ABC" }, { Roll: 123 }]; console.log( Object.assign.a...
2017/02/07
[ "https://Stackoverflow.com/questions/42091600", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6474292/" ]
If you are using TypeScript, try to replace `Object.assign({}, ...Objs)` to `{...Objs};` the browser will automatically replace it to `__assign({}, Objs);` and this notacion works in IE11.
If you use TypeScript you can use ``` let newObject = { ...existingObject } ``` This creates a shallow copy of the existing object.
42,091,600
I have the following array of object: ``` Objs[0] = {Name : "ABC"}; Objs[1] = {Roll : 123} ``` I'm trying to make it as the following: ``` Objs { Name : "ABC", Roll : 123 } ``` I attempted to make it with the following code: ``` var Objs = [{ Name: "ABC" }, { Roll: 123 }]; console.log( Object.assign.a...
2017/02/07
[ "https://Stackoverflow.com/questions/42091600", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6474292/" ]
You can use jQuery method [$.extend()](https://api.jquery.com/jquery.extend/) which work in IE 11. ```js var object = {name: 'John', surname: 'Rowland'}; var newObject = $.extend({}, object); newObject.age = '30'; console.log(object); console.log(newObject) ``` ```html <script src="https://ajax.googleapis.com/a...
I think best thing to do, if you are using lodash util library in your project, is lodash's **assign** method, which works same as Object.prototype.assign for all browsers, including IE (at least IE11): <https://lodash.com/docs/4.17.4#assign> If you are not using lodash yet, consider it. It has many util functions whi...
42,091,600
I have the following array of object: ``` Objs[0] = {Name : "ABC"}; Objs[1] = {Roll : 123} ``` I'm trying to make it as the following: ``` Objs { Name : "ABC", Roll : 123 } ``` I attempted to make it with the following code: ``` var Objs = [{ Name: "ABC" }, { Roll: 123 }]; console.log( Object.assign.a...
2017/02/07
[ "https://Stackoverflow.com/questions/42091600", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6474292/" ]
IE11 does not support [`Object.assign`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign#Browser_compatibility). You could iterate the array and the keys and take the values as new property of the result object. ```js var objs = [{ Name: "ABC" }, { Roll: 123 }], resu...
I think best thing to do, if you are using lodash util library in your project, is lodash's **assign** method, which works same as Object.prototype.assign for all browsers, including IE (at least IE11): <https://lodash.com/docs/4.17.4#assign> If you are not using lodash yet, consider it. It has many util functions whi...
42,091,600
I have the following array of object: ``` Objs[0] = {Name : "ABC"}; Objs[1] = {Roll : 123} ``` I'm trying to make it as the following: ``` Objs { Name : "ABC", Roll : 123 } ``` I attempted to make it with the following code: ``` var Objs = [{ Name: "ABC" }, { Roll: 123 }]; console.log( Object.assign.a...
2017/02/07
[ "https://Stackoverflow.com/questions/42091600", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6474292/" ]
Install: ``` npm i -s babel-polyfill ``` And at the top of entry **index.js** file add: ``` import 'babel-polyfill' ``` This will solve some issues that Babel did not. **Object.assign** is one of them. > > This means you can use new built-ins like Promise or WeakMap, static > methods like Array.from or Object....
Even with babel: ``` const newObj = Object.assign({}, myOtherObject) ``` was destroying us in IE11. We changed it to: ``` const newObj = { ...myOtherObject } ``` and that worked in conjunction with babel.
42,091,600
I have the following array of object: ``` Objs[0] = {Name : "ABC"}; Objs[1] = {Roll : 123} ``` I'm trying to make it as the following: ``` Objs { Name : "ABC", Roll : 123 } ``` I attempted to make it with the following code: ``` var Objs = [{ Name: "ABC" }, { Roll: 123 }]; console.log( Object.assign.a...
2017/02/07
[ "https://Stackoverflow.com/questions/42091600", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6474292/" ]
You can use jQuery method [$.extend()](https://api.jquery.com/jquery.extend/) which work in IE 11. ```js var object = {name: 'John', surname: 'Rowland'}; var newObject = $.extend({}, object); newObject.age = '30'; console.log(object); console.log(newObject) ``` ```html <script src="https://ajax.googleapis.com/a...
In addition to @vladatr, in case you're using Wepack: In your webpack.config.js ``` const path = require("path"); module.exports = { entry: ["babel-polyfill", path.resolve(__dirname, "../src/index.js")], . . ``` In my entry point `src/index.js` file: ``` import "babel-polyfill"; ```
42,091,600
I have the following array of object: ``` Objs[0] = {Name : "ABC"}; Objs[1] = {Roll : 123} ``` I'm trying to make it as the following: ``` Objs { Name : "ABC", Roll : 123 } ``` I attempted to make it with the following code: ``` var Objs = [{ Name: "ABC" }, { Roll: 123 }]; console.log( Object.assign.a...
2017/02/07
[ "https://Stackoverflow.com/questions/42091600", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6474292/" ]
Use a polyfill like this; [Ref: MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign#Polyfill) ``` if (typeof Object.assign != 'function') { // Must be writable: true, enumerable: false, configurable: true Object.defineProperty(Object, "assign", { value: function...
In addition to @vladatr, in case you're using Wepack: In your webpack.config.js ``` const path = require("path"); module.exports = { entry: ["babel-polyfill", path.resolve(__dirname, "../src/index.js")], . . ``` In my entry point `src/index.js` file: ``` import "babel-polyfill"; ```
42,091,600
I have the following array of object: ``` Objs[0] = {Name : "ABC"}; Objs[1] = {Roll : 123} ``` I'm trying to make it as the following: ``` Objs { Name : "ABC", Roll : 123 } ``` I attempted to make it with the following code: ``` var Objs = [{ Name: "ABC" }, { Roll: 123 }]; console.log( Object.assign.a...
2017/02/07
[ "https://Stackoverflow.com/questions/42091600", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6474292/" ]
I think best thing to do, if you are using lodash util library in your project, is lodash's **assign** method, which works same as Object.prototype.assign for all browsers, including IE (at least IE11): <https://lodash.com/docs/4.17.4#assign> If you are not using lodash yet, consider it. It has many util functions whi...
If you are using TypeScript, try to replace `Object.assign({}, ...Objs)` to `{...Objs};` the browser will automatically replace it to `__assign({}, Objs);` and this notacion works in IE11.
42,091,600
I have the following array of object: ``` Objs[0] = {Name : "ABC"}; Objs[1] = {Roll : 123} ``` I'm trying to make it as the following: ``` Objs { Name : "ABC", Roll : 123 } ``` I attempted to make it with the following code: ``` var Objs = [{ Name: "ABC" }, { Roll: 123 }]; console.log( Object.assign.a...
2017/02/07
[ "https://Stackoverflow.com/questions/42091600", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6474292/" ]
Install: ``` npm i -s babel-polyfill ``` And at the top of entry **index.js** file add: ``` import 'babel-polyfill' ``` This will solve some issues that Babel did not. **Object.assign** is one of them. > > This means you can use new built-ins like Promise or WeakMap, static > methods like Array.from or Object....
This javascript only solution works in IE. Loop through the array, and within that loop through each key in the object and add it to a new object. The new object contains the data you want. ```js var Objs = []; Objs[0] = {Name : "ABC"}; Objs[1] = {Roll : 123}; console.log(Objs); var newObject = {}; for(var i=0; i<O...
42,091,600
I have the following array of object: ``` Objs[0] = {Name : "ABC"}; Objs[1] = {Roll : 123} ``` I'm trying to make it as the following: ``` Objs { Name : "ABC", Roll : 123 } ``` I attempted to make it with the following code: ``` var Objs = [{ Name: "ABC" }, { Roll: 123 }]; console.log( Object.assign.a...
2017/02/07
[ "https://Stackoverflow.com/questions/42091600", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6474292/" ]
Use a polyfill like this; [Ref: MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign#Polyfill) ``` if (typeof Object.assign != 'function') { // Must be writable: true, enumerable: false, configurable: true Object.defineProperty(Object, "assign", { value: function...
This javascript only solution works in IE. Loop through the array, and within that loop through each key in the object and add it to a new object. The new object contains the data you want. ```js var Objs = []; Objs[0] = {Name : "ABC"}; Objs[1] = {Roll : 123}; console.log(Objs); var newObject = {}; for(var i=0; i<O...
223,115
Having difficulty articulating this correlated subquery. I have two tables fictitious tables, foo and bar. foo has two fields of foo\_id and total\_count. bar has two fields, seconds and id. I need to aggregate the seconds in bar for each individual id and update the total\_count in foo. id is a foreign key in bar for...
2008/10/21
[ "https://Stackoverflow.com/questions/223115", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
``` UPDATE foo f1 SET total_count = (SELECT SUM(seconds) FROM bar b1 WHERE b1.id = f1.foo_id) ``` You should have access to the appropriate foo id within the sub-query, so there is no need to join in the table.
I hope I understood your question right. You have the following tables: * table `foo` - columns: `id` and `total_count` * table `bar` - columns: `foo_id` (references `foo.id`) and `seconds` The following query should work (update all `total_count` rows in table `foo`): ``` UPDATE foo AS f1 SET total_count = ( SEL...
223,115
Having difficulty articulating this correlated subquery. I have two tables fictitious tables, foo and bar. foo has two fields of foo\_id and total\_count. bar has two fields, seconds and id. I need to aggregate the seconds in bar for each individual id and update the total\_count in foo. id is a foreign key in bar for...
2008/10/21
[ "https://Stackoverflow.com/questions/223115", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
In larger data sets, correlated subqueries can be very resource-intensive. Joining to a derived table containing the appropriate aggregates can be much more efficient: ``` create table foo ( foo_id int identity, total_count int default 0 ) create table bar ( foo_id int, seconds int ) insert into foo default values i...
I hope I understood your question right. You have the following tables: * table `foo` - columns: `id` and `total_count` * table `bar` - columns: `foo_id` (references `foo.id`) and `seconds` The following query should work (update all `total_count` rows in table `foo`): ``` UPDATE foo AS f1 SET total_count = ( SEL...
223,115
Having difficulty articulating this correlated subquery. I have two tables fictitious tables, foo and bar. foo has two fields of foo\_id and total\_count. bar has two fields, seconds and id. I need to aggregate the seconds in bar for each individual id and update the total\_count in foo. id is a foreign key in bar for...
2008/10/21
[ "https://Stackoverflow.com/questions/223115", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
``` UPDATE foo f1 SET total_count = (SELECT SUM(seconds) FROM bar b1 WHERE b1.id = f1.foo_id) ``` You should have access to the appropriate foo id within the sub-query, so there is no need to join in the table.
This really opens the door to consistency issues. You might consider creating a view rather than mutating the foo table: ``` CREATE VIEW foo AS SELECT id, sum(seconds) from bar group by id; ```
223,115
Having difficulty articulating this correlated subquery. I have two tables fictitious tables, foo and bar. foo has two fields of foo\_id and total\_count. bar has two fields, seconds and id. I need to aggregate the seconds in bar for each individual id and update the total\_count in foo. id is a foreign key in bar for...
2008/10/21
[ "https://Stackoverflow.com/questions/223115", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
``` UPDATE foo f1 SET total_count = (SELECT SUM(seconds) FROM bar b1 WHERE b1.id = f1.foo_id) ``` You should have access to the appropriate foo id within the sub-query, so there is no need to join in the table.
Just to offer an alternative, I like to use MySQL's nifty multi-table updates feature: ``` UPDATE foo SET total_count = 0; UPDATE foo JOIN bar ON (foo.foo_id = bar.id) SET foo.total_count = foo.total_count + bar.seconds; ```
223,115
Having difficulty articulating this correlated subquery. I have two tables fictitious tables, foo and bar. foo has two fields of foo\_id and total\_count. bar has two fields, seconds and id. I need to aggregate the seconds in bar for each individual id and update the total\_count in foo. id is a foreign key in bar for...
2008/10/21
[ "https://Stackoverflow.com/questions/223115", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
``` UPDATE foo f1 SET total_count = (SELECT SUM(seconds) FROM bar b1 WHERE b1.id = f1.foo_id) ``` You should have access to the appropriate foo id within the sub-query, so there is no need to join in the table.
In larger data sets, correlated subqueries can be very resource-intensive. Joining to a derived table containing the appropriate aggregates can be much more efficient: ``` create table foo ( foo_id int identity, total_count int default 0 ) create table bar ( foo_id int, seconds int ) insert into foo default values i...
223,115
Having difficulty articulating this correlated subquery. I have two tables fictitious tables, foo and bar. foo has two fields of foo\_id and total\_count. bar has two fields, seconds and id. I need to aggregate the seconds in bar for each individual id and update the total\_count in foo. id is a foreign key in bar for...
2008/10/21
[ "https://Stackoverflow.com/questions/223115", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
In larger data sets, correlated subqueries can be very resource-intensive. Joining to a derived table containing the appropriate aggregates can be much more efficient: ``` create table foo ( foo_id int identity, total_count int default 0 ) create table bar ( foo_id int, seconds int ) insert into foo default values i...
This really opens the door to consistency issues. You might consider creating a view rather than mutating the foo table: ``` CREATE VIEW foo AS SELECT id, sum(seconds) from bar group by id; ```
223,115
Having difficulty articulating this correlated subquery. I have two tables fictitious tables, foo and bar. foo has two fields of foo\_id and total\_count. bar has two fields, seconds and id. I need to aggregate the seconds in bar for each individual id and update the total\_count in foo. id is a foreign key in bar for...
2008/10/21
[ "https://Stackoverflow.com/questions/223115", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
In larger data sets, correlated subqueries can be very resource-intensive. Joining to a derived table containing the appropriate aggregates can be much more efficient: ``` create table foo ( foo_id int identity, total_count int default 0 ) create table bar ( foo_id int, seconds int ) insert into foo default values i...
Just to offer an alternative, I like to use MySQL's nifty multi-table updates feature: ``` UPDATE foo SET total_count = 0; UPDATE foo JOIN bar ON (foo.foo_id = bar.id) SET foo.total_count = foo.total_count + bar.seconds; ```
40,151
I am a beginner, given an advice to underexpose when shooting sunsets. I did, and, well, what was underexposed, kind of looks underexposed. Can I tease out any more out of my material? My camera does not shoot raw. The best I could do was to shoot the largest files it would record. I know I can open them as "camera raw...
2013/06/17
[ "https://photo.stackexchange.com/questions/40151", "https://photo.stackexchange.com", "https://photo.stackexchange.com/users/20141/" ]
Digital picture frames typically suffer from: 1. Odd aspect ratios for photos. While some cameras shoot 16:9 or 4:3 aspect ratios, a 3:2 is universal for photography. What the means is that you either crop to it or have black bars on screen. 2. Most are low resolution. 1024x768? That's pretty small and they'll put tha...
I know all about digital frames and there are some really good ones out there. I have a 10" Toshiba that has been running 24 hours a day for 5 years now. I have a couple of Ceivas to send pictures either by wi-fi or over the phone and even a Kodak Pulse (Kodak doesn't support them but the Kodak Pulse website is still g...
180,819
Trying to find out if a particular user is logged into the machine, specifically the user *using* the graphical user interface. Is this possible via command line?
2010/08/26
[ "https://superuser.com/questions/180819", "https://superuser.com", "https://superuser.com/users/6708/" ]
GUI: * Open the Accounts preference pane in *System Preferences*. The pre-selected user account will be the active user account. * If fast user switching is active its menu extra (the menu on the right side of the menu bar) can be configured to show the name of the active user. Command Line: * Check the owner of `/d...
Via the command line, `who` and `users` should work.
19,677,196
i have this query in nhibernate ``` var fdata = (from p in _session.Query<WfTask>() join d in _session.Query<WfTaskDetail>() on p.WfTaskDetail.Id equals d.Id orderby p.ActionDate descending //(order) where (_session.Query<WfTask>()...
2013/10/30
[ "https://Stackoverflow.com/questions/19677196", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1251552/" ]
There are two ways, either one can use the generic method, so it works with other RNGs, if you decide to stop using the task-local one: ``` fn fTest03<R: Rng>(iMax: i64, oRandom: &mut R) { ... } ``` Or, you can just use the return type of `task_rng` directly: ``` fn fTest03(iMax: i64, oRandom: @mut IsaacRng) { ... ...
task\_rng() is not a type, it's a function that returns a task local random number generator (TaskRng). The signature of task\_rng function is: ``` pub fn task_rng() -> @mut TaskRng ``` So if you change line 53 to: ``` fn fTest03(iMax : i64, oRandom : &mut std::rand::Rng) {... ``` things should work nicely.
45,756,230
I have a playbook I want to convert into a template, and include it using `include` elsewhere, and override a few variables, like this: ``` $ cat env_demo.yml --- - include: template_standalone.yml vars: hosts: demo.example.com environment_name: "Demo environment" ``` This works fine, but then I'd like to ...
2017/08/18
[ "https://Stackoverflow.com/questions/45756230", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1210797/" ]
`vars_files` is not supported for included playbooks (as of Ansible 2.3) You may opt to use extra variables file: ``` ansible-playbook -e @secrets/demo.example.com.yml env_demo.yml ``` Or use group variables file for `all` group – place your encrypted file into `./group_vars/all/demo.example.com.yml`.
Another option you can use is using a list for the `vars_files` value like this: ``` - hosts: foo vars_files: - [ "secrets/demo.example.com.yml", "/dev/null" ] ``` If the `secrets/demo.example.com.yml` file exists, it will be included. Otherwise ansible will read `/dev/null`, get an EOF, and go on its merry wa...
69,111,458
I want to check if a string **only** contains: 1. Letters 2. Numbers 3. Underscores 4. Periods in Flutter, I tried the following to get only the letters but even if other characters are there it returns true if it contains a letter: ``` String mainString = "abc123"; print(mainString.contains(new RegExp(r'[a-z]')));...
2021/09/09
[ "https://Stackoverflow.com/questions/69111458", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13998599/" ]
The problem with your `RegExp` is that you allow it to match substrings, and you match only a single character. You can force it to require that the entire string be matched with `^` and `$`, and you can match against one or more of the expression with `+`: ```dart print(RegExp(r'^[a-z]+$').hasMatch(mainString)); ```...
the basic way of doing this is as follow: 1. define a list of acceptable characters: ``` // for example List<String> validChar = ["1", "2", "3", "t"]; ``` 2. loop through all character of your string and check its validity: ``` // given text String x = "t5"; bool valid = true; for(int i=0; i<x.length; i++...
10,973
When attempting to watch purchased older material on iTunes I have been receiving a prompt stating that my MacBook is not authorized to view material. As the material was purchased unsing my original Apple ID - having since changed ID's twice - I am not able to view this material without entering the password for the o...
2011/03/29
[ "https://apple.stackexchange.com/questions/10973", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/-1/" ]
If you remember the old id and still have access to the email account associated with it, you can definitely reset the password and then authorize your macbook to play these files. iForgot will prompt you for information, but it should allow a password reset via email, not just questions. If you still cannot remember/...
The issue is the built in DRM in these files, specifically intended to keep you from playing music that you didn't purchase. Your best bet is to re-activate those older Apple ID's and enter them in, authorizing your computer. That will be the simplest way. The only other ways that I know of are to re-encode the data t...
1,233,884
I'm trying to use the OpacityMask property combined with a VisualBrush so that when you drag an image over another control (such as another image, rectangle, or any other control), the part of the image that is over the second control has a different opacity. That is, the image has some non-zero base opacity, and any p...
2009/08/05
[ "https://Stackoverflow.com/questions/1233884", "https://Stackoverflow.com", "https://Stackoverflow.com/users/94824/" ]
In addition to ima's answer, I have figured this out using an opacity mask. I use the following code hooked into the LayoutUpdated event for the image. ``` // Make a visual brush out of the masking control. VisualBrush brush = new VisualBrush(maskingControl); // Set desired opacity. brush.Opacity = 1.0; // Get the off...
* No masks * Define visual brush for the control * Paint shape right on top of the control with that brush * Drag image *between* the shape and the control * Set opacity of the brush to achieve desired effect
57,197
I have a question about the preposition to use with "*threat*": > > 1. He made threats ***against*** her. > 2. He made threats ***at*** her. > 3. He made threats ***toward*** her. > > > Should it be "*against*", "*at*", or "*toward*"?
2015/05/20
[ "https://ell.stackexchange.com/questions/57197", "https://ell.stackexchange.com", "https://ell.stackexchange.com/users/6362/" ]
Out of those three, I think it's the first one with 'against'. Because you are using 'make' there. [OALD](http://www.oxfordlearnersdictionaries.com/definition/english/threat#threat__4) gives us an example with it: > > to *make threats **against*** somebody > > > A headline from [CBS LA](http://losangeles.cbsloc...
Each can mean something different (though the distinctions below might not always be strictly observed) and is valid with *to make a threat*: > > He made threats at her. > > > This implies that he was in the vincinity of her (he was "at" her). *X at Y* means X and Y are in the same place. So there's a chance this...
57,197
I have a question about the preposition to use with "*threat*": > > 1. He made threats ***against*** her. > 2. He made threats ***at*** her. > 3. He made threats ***toward*** her. > > > Should it be "*against*", "*at*", or "*toward*"?
2015/05/20
[ "https://ell.stackexchange.com/questions/57197", "https://ell.stackexchange.com", "https://ell.stackexchange.com/users/6362/" ]
All three are possible, and well-attested.
Each can mean something different (though the distinctions below might not always be strictly observed) and is valid with *to make a threat*: > > He made threats at her. > > > This implies that he was in the vincinity of her (he was "at" her). *X at Y* means X and Y are in the same place. So there's a chance this...
9,095,582
I recently followed Googles Advice on Bitmap Caching in Android and added my own [LruCache](http://developer.android.com/reference/android/util/LruCache.html) from the support library. The LruCache works best if the size of the images in bytes is known to the cache. The problem ist the getByteCount for bitmaps is onl...
2012/02/01
[ "https://Stackoverflow.com/questions/9095582", "https://Stackoverflow.com", "https://Stackoverflow.com/users/114066/" ]
From the android.graphics.Bitmap source code: ``` public final int getByteCount() { // int result permits bitmaps up to 46,340 x 46,340 return getRowBytes() * getHeight(); } ``` Both `getRowBytes()` and `getHeight()` are since API Level 1, so you can implement your own own `getByteCount()` for al...
Depends on the [Bitmap.Config](http://developer.android.com/reference/android/graphics/Bitmap.Config.html) you are using, doesn't it. ARGB\_8888 - that should end up somewhere around width \* height \* 4 bytes unpacked.
224,434
I am using gnu make and in a Makefile I have, I see below rule. I want to add a similar rule with a recipe, but when I add a rule and its receipe on the next line by giving a tab or space for the recipe, I get make error. ``` dummy : @echo $(OBJS) ``` When i turned on the vim command :set list , i see: ``` dumm...
2010/12/21
[ "https://superuser.com/questions/224434", "https://superuser.com", "https://superuser.com/users/4143/" ]
Recipies in a makefile *must* be preceeded by a single standard `tab` character, nothing else. `^I` is the representation of the tab character (see the table on the Wikipedia [ASCII](http://en.wikipedia.org/wiki/ASCII#ASCII_control_characters) page), and therefore this should be correct. So you should be able to ente...
In light of the accepted answer: recipes must be preceded by a `tab` character, which is automatically replaced if `set expandtab` is enabled in your `.vimrc`. Overwriting your `.RECIPEPREFIX` is not recommended, as this breaks makefiles in codebases you downloaded. The naive approach is to simply remove `set expandtab...