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
19,084,382
Using RStudio --> CompilePDF In a .Rnw document to be processed with pdflatex, I'd like to get a list of all user (me) packages loaded via library() or require() in the document. I tried to use sessionInfo(), as in ``` \AtEndDocument{ \medskip \textbf{Packages used}: \Sexpr{names(sessionInfo()$loadedOnly)}. ...
2013/09/29
[ "https://Stackoverflow.com/questions/19084382", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1873697/" ]
The problem with this approach is that the \Sexpr{} within the \AtEndDocument{} block in the preamble is evaluated at knit-time (the beginning of the .Rnw file, so it returns an empty list. In the generated .tex file, this appears as ``` \AtEndDocument{ \medskip \textbf{Packages used}: . } ``` The only way this will...
A somewhat different, perhaps more explicit and detailed approach, expanding on answers given previously. This would appear in the `\backmatter` of a book. The value `nColOut` is the number of columns of the printed table containing the list of packages used. ``` \cleardoublepage \printindex \cleardoublepage \chapte...
32,990,711
In Emacs, when a buffer is killed, it is still displayed on the buffer list (though it's empty after opening it from the list). Is is possible to remove the buffer from the buffer list?
2015/10/07
[ "https://Stackoverflow.com/questions/32990711", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1853300/" ]
Just refresh the buffer list by pressing `g`.
You can define a function to achieve it automatically: ``` (defun my-kill-buffer () (interactive) (kill-buffer) (if (get-buffer "*Buffer List*") (save-excursion (set-buffer "*Buffer List*") (revert-buffer)) )) ```
40,172
A friend in the business sector recently asked me for advice on "IT security in a large charity". Being a developer not specialized in security, I could see his difficulty in finding someone qualified to hire to counsel him. Struggling for answers, the only example I could advance was the following: if you're serious...
2013/08/06
[ "https://security.stackexchange.com/questions/40172", "https://security.stackexchange.com", "https://security.stackexchange.com/users/21642/" ]
**No**, *longer* is not *stronger*. What makes a password strong is its *entropy*: how much unknown the password is to the attacker. Adding a "non-entropic" suffix to the password does not add to the entropy (by definition) so it does not increase the hardness of the task for the attacker. It *does* increase the hardn...
Length does complicate brute force attacks; a longer password is stronger. High entropy passwords are stronger than low entropy passwords. Even if the attack is based on rainbow tables, rainbow tables for short passwords are cheaper to calculate, store, and manage. If the attacker is stealing the password from some ...
36,540
Just as we have the genesis block which is block 0, is there a special name for the block currently at the head of the chain? Obviously such a block would be observer dependent and never absolute but I am curious all the same.
2015/03/21
[ "https://bitcoin.stackexchange.com/questions/36540", "https://bitcoin.stackexchange.com", "https://bitcoin.stackexchange.com/users/24780/" ]
The Bitcoin source code refers to it as the 'tip,' e.g., `UpdateTip`, `SetTip`, `ConnectTip`. It's sometimes referred to as the latest block; that's not totally accurate, since the latest block is not always the tip.
Nothing formal, but "latest block" pretty much describes it.
33,369,748
I want to define a one-to-many relationship between my Student model and my Formation model: 1 student belongs to 1 formation and a formation can be composed of N students. My needs are: * be able to populate a Formation document with its students * easily retrieve the Formation of a Student So I wrote: ``` let stu...
2015/10/27
[ "https://Stackoverflow.com/questions/33369748", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25888/" ]
Having `students` on the Formation model is both bad practice and redundant. Potentially infinite arrays are a poor design as they can lead to hitting document size limits. In regards to being redundant, you only have two queries in this situation: 1) You have a `student` in memory, and you want to find their formatio...
It is in fact redundant because the way you have defined your schemas is redundant. The array of students should be a property of the formation, **but not the other way around**. Subdocuments can be searched like normal collections. If you change your schema to: ``` let student = new Schema({ firstName: { ...
4,240,184
I've got a little problem, and i don't see it. I retrieve Json data (the `JSONArray`) and i wanted to make a `List` of all the names in the `JSONArray`, something like this. ``` List list = new ArrayList<String>(); for(int i=0;i < data.length();i++){ list.add(data.getJSONObject(i).getString("names").toString());...
2010/11/21
[ "https://Stackoverflow.com/questions/4240184", "https://Stackoverflow.com", "https://Stackoverflow.com/users/439058/" ]
Your problem has nothing to do with ASCII or character sets. In Java, a `char` is just a 16-bit integer. When casting ints (which are 32-bit integers) to chars, the only thing you are doing is keeping the 16 least significant bits of the int, and discarding the upper 16 bits. This is called a *narrowing conversion*. ...
The conversion between characters and integers uses the [Unicode](http://en.wikipedia.org/wiki/Unicode) values, of which ASCII is a subset. If you are handling binary data you should avoid characters and strings and instead use an integer array - note that Java doesn't have unsigned 8-bit integers.
4,240,184
I've got a little problem, and i don't see it. I retrieve Json data (the `JSONArray`) and i wanted to make a `List` of all the names in the `JSONArray`, something like this. ``` List list = new ArrayList<String>(); for(int i=0;i < data.length();i++){ list.add(data.getJSONObject(i).getString("names").toString());...
2010/11/21
[ "https://Stackoverflow.com/questions/4240184", "https://Stackoverflow.com", "https://Stackoverflow.com/users/439058/" ]
The conversion between characters and integers uses the [Unicode](http://en.wikipedia.org/wiki/Unicode) values, of which ASCII is a subset. If you are handling binary data you should avoid characters and strings and instead use an integer array - note that Java doesn't have unsigned 8-bit integers.
What you search for in not a cast, it's a conversion. There is a String constructor that takes an array of byte and a charset encoding. This should help you.
4,240,184
I've got a little problem, and i don't see it. I retrieve Json data (the `JSONArray`) and i wanted to make a `List` of all the names in the `JSONArray`, something like this. ``` List list = new ArrayList<String>(); for(int i=0;i < data.length();i++){ list.add(data.getJSONObject(i).getString("names").toString());...
2010/11/21
[ "https://Stackoverflow.com/questions/4240184", "https://Stackoverflow.com", "https://Stackoverflow.com/users/439058/" ]
The conversion between characters and integers uses the [Unicode](http://en.wikipedia.org/wiki/Unicode) values, of which ASCII is a subset. If you are handling binary data you should avoid characters and strings and instead use an integer array - note that Java doesn't have unsigned 8-bit integers.
> > I'm working on a project in which I > read in a string of binary characters, > convert it into chunks, and convert > the chunks into their values in > decimal, ints, which I then cast as > chars. I then need to be able to > "expand" the resulting compressed > characters back to binary by reversing > the pr...
4,240,184
I've got a little problem, and i don't see it. I retrieve Json data (the `JSONArray`) and i wanted to make a `List` of all the names in the `JSONArray`, something like this. ``` List list = new ArrayList<String>(); for(int i=0;i < data.length();i++){ list.add(data.getJSONObject(i).getString("names").toString());...
2010/11/21
[ "https://Stackoverflow.com/questions/4240184", "https://Stackoverflow.com", "https://Stackoverflow.com/users/439058/" ]
Your problem has nothing to do with ASCII or character sets. In Java, a `char` is just a 16-bit integer. When casting ints (which are 32-bit integers) to chars, the only thing you are doing is keeping the 16 least significant bits of the int, and discarding the upper 16 bits. This is called a *narrowing conversion*. ...
What you search for in not a cast, it's a conversion. There is a String constructor that takes an array of byte and a charset encoding. This should help you.
4,240,184
I've got a little problem, and i don't see it. I retrieve Json data (the `JSONArray`) and i wanted to make a `List` of all the names in the `JSONArray`, something like this. ``` List list = new ArrayList<String>(); for(int i=0;i < data.length();i++){ list.add(data.getJSONObject(i).getString("names").toString());...
2010/11/21
[ "https://Stackoverflow.com/questions/4240184", "https://Stackoverflow.com", "https://Stackoverflow.com/users/439058/" ]
Your problem has nothing to do with ASCII or character sets. In Java, a `char` is just a 16-bit integer. When casting ints (which are 32-bit integers) to chars, the only thing you are doing is keeping the 16 least significant bits of the int, and discarding the upper 16 bits. This is called a *narrowing conversion*. ...
> > I'm working on a project in which I > read in a string of binary characters, > convert it into chunks, and convert > the chunks into their values in > decimal, ints, which I then cast as > chars. I then need to be able to > "expand" the resulting compressed > characters back to binary by reversing > the pr...
10,996,461
Spring 3 has such a nice feature as type conversion. It provides a converter SPI(`Converter<S, T>`) to be used to implement differenet conversion logic. The subclass of Converter type allow to define one-way conversion(only from S to T), so if I want a conversion also to be performed from T to S I need to define anoth...
2012/06/12
[ "https://Stackoverflow.com/questions/10996461", "https://Stackoverflow.com", "https://Stackoverflow.com/users/491790/" ]
You are correct, if you want to use the `org.springframework.core.convert.converter.Converter` interface directly, you'll need to implement two converters, one for each direction. But spring 3 has a couple of other options: 1. If your conversion is not object-to-object but rather object-to-string (and back), then you...
Spring has just such an interface for this purpose: TwoWayConverter. see the following: <http://static.springsource.org/spring-webflow/docs/2.0.x/javadoc-api/org/springframework/binding/convert/converters/TwoWayConverter.html>
10,996,461
Spring 3 has such a nice feature as type conversion. It provides a converter SPI(`Converter<S, T>`) to be used to implement differenet conversion logic. The subclass of Converter type allow to define one-way conversion(only from S to T), so if I want a conversion also to be performed from T to S I need to define anoth...
2012/06/12
[ "https://Stackoverflow.com/questions/10996461", "https://Stackoverflow.com", "https://Stackoverflow.com/users/491790/" ]
Spring has just such an interface for this purpose: TwoWayConverter. see the following: <http://static.springsource.org/spring-webflow/docs/2.0.x/javadoc-api/org/springframework/binding/convert/converters/TwoWayConverter.html>
You can use [Spring Formatter](http://docs.spring.io/spring/docs/current/spring-framework-reference/html/validation.html#format-Formatter-SPI) to format object of type T to String and vice versa. ``` package org.springframework.format; public interface Formatter<T> extends Printer<T>, Parser<T> { } ``` Using thi...
10,996,461
Spring 3 has such a nice feature as type conversion. It provides a converter SPI(`Converter<S, T>`) to be used to implement differenet conversion logic. The subclass of Converter type allow to define one-way conversion(only from S to T), so if I want a conversion also to be performed from T to S I need to define anoth...
2012/06/12
[ "https://Stackoverflow.com/questions/10996461", "https://Stackoverflow.com", "https://Stackoverflow.com/users/491790/" ]
You are correct, if you want to use the `org.springframework.core.convert.converter.Converter` interface directly, you'll need to implement two converters, one for each direction. But spring 3 has a couple of other options: 1. If your conversion is not object-to-object but rather object-to-string (and back), then you...
You can use [Spring Formatter](http://docs.spring.io/spring/docs/current/spring-framework-reference/html/validation.html#format-Formatter-SPI) to format object of type T to String and vice versa. ``` package org.springframework.format; public interface Formatter<T> extends Printer<T>, Parser<T> { } ``` Using thi...
3,437,537
I was wondering if some one enters a tag like `ruby on rails` is there a way I can add a hyphen to the white spaces between the words for example `ruby-on-rails` using PHP.
2010/08/09
[ "https://Stackoverflow.com/questions/3437537", "https://Stackoverflow.com", "https://Stackoverflow.com/users/414611/" ]
I suspect you're asking a different question, but lacking more context ... ``` $string = 'ruby on rails'; $string_with_dashes = str_replace(' ','-',$string); ``` should get you where you want to go.
It's as simple as this: ``` $tag = 'ruby on rails'; $newTag = str_replace(' ', '-', trim($tag)); ```
3,437,537
I was wondering if some one enters a tag like `ruby on rails` is there a way I can add a hyphen to the white spaces between the words for example `ruby-on-rails` using PHP.
2010/08/09
[ "https://Stackoverflow.com/questions/3437537", "https://Stackoverflow.com", "https://Stackoverflow.com/users/414611/" ]
It's as simple as this: ``` $tag = 'ruby on rails'; $newTag = str_replace(' ', '-', trim($tag)); ```
Let me guess ``` $s = strtolower(trim($s)); $s = str_replace(" ","-",$s); $s = preg_replace('![^a-z0-9-]!',"",$s); $s = preg_replace('!\-+!',"-",$s); ```
3,437,537
I was wondering if some one enters a tag like `ruby on rails` is there a way I can add a hyphen to the white spaces between the words for example `ruby-on-rails` using PHP.
2010/08/09
[ "https://Stackoverflow.com/questions/3437537", "https://Stackoverflow.com", "https://Stackoverflow.com/users/414611/" ]
I suspect you're asking a different question, but lacking more context ... ``` $string = 'ruby on rails'; $string_with_dashes = str_replace(' ','-',$string); ``` should get you where you want to go.
``` $str = 'ruby on rails'; // your entered tag $myTag = trim($str); // remove extra spaces from beginning and end $hyphenTag = str_replace( ' ', '-', $myTag ); // place '-' between words echo $hyphenTag; // print result ```
3,437,537
I was wondering if some one enters a tag like `ruby on rails` is there a way I can add a hyphen to the white spaces between the words for example `ruby-on-rails` using PHP.
2010/08/09
[ "https://Stackoverflow.com/questions/3437537", "https://Stackoverflow.com", "https://Stackoverflow.com/users/414611/" ]
I suspect you're asking a different question, but lacking more context ... ``` $string = 'ruby on rails'; $string_with_dashes = str_replace(' ','-',$string); ``` should get you where you want to go.
Let me guess ``` $s = strtolower(trim($s)); $s = str_replace(" ","-",$s); $s = preg_replace('![^a-z0-9-]!',"",$s); $s = preg_replace('!\-+!',"-",$s); ```
3,437,537
I was wondering if some one enters a tag like `ruby on rails` is there a way I can add a hyphen to the white spaces between the words for example `ruby-on-rails` using PHP.
2010/08/09
[ "https://Stackoverflow.com/questions/3437537", "https://Stackoverflow.com", "https://Stackoverflow.com/users/414611/" ]
``` $str = 'ruby on rails'; // your entered tag $myTag = trim($str); // remove extra spaces from beginning and end $hyphenTag = str_replace( ' ', '-', $myTag ); // place '-' between words echo $hyphenTag; // print result ```
Let me guess ``` $s = strtolower(trim($s)); $s = str_replace(" ","-",$s); $s = preg_replace('![^a-z0-9-]!',"",$s); $s = preg_replace('!\-+!',"-",$s); ```
46,975,851
I've a dataframe with following schema - ``` |-- ID: string (nullable = true) |-- VALUES: array (nullable = true) | |-- element: struct (containsNull = true) | | |-- _v1: string (nullable = true) | | |-- _v2: string (nullable = true) ``` VALUES are like - ``` [["1","a"],["2","b"],["3","c"],["4","d"...
2017/10/27
[ "https://Stackoverflow.com/questions/46975851", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6419722/" ]
You don't need a UDF for that. Just use `sort_array` and pick the first element. ``` df.show +--------------------+ | data_arr| +--------------------+ |[[4,a], [2,b], [1...| | [[1,a]]| | [[3,b], [1,v]]| +--------------------+ df.printSchema root |-- data_arr: array (nullable = false) | ...
Using the same dataframe as in the example: ``` val findSmallest = udf((rows: Seq[Row]) => { rows.map(row => (row.getAs[String](0), row.getAs[String](1))).sorted.head }) df.withColumn("SMALLEST", findSmallest($"VALUES")) ``` Will give a result like this: ``` +---+--------------------+--------+ | ID| ...
1,040,563
I have this limit that I tried and failed to solve: $$ \lim\_{n \to \infty}\frac{\sqrt{n^2-n+2}-n}{\sqrt{1+\frac1n}}=\lim\_{n \to \infty}\frac{\sqrt{n^2(1-\frac1n+\frac{2}{n^2})}-n}{\sqrt{1+\frac1n}}=\lim\_{n \to \infty}\frac{n\times\sqrt{1-\frac1n+\frac{2}{n^2}}-1}{\sqrt{1+\frac1n}}=\infty\times0$$ My solution is un...
2014/11/27
[ "https://math.stackexchange.com/questions/1040563", "https://math.stackexchange.com", "https://math.stackexchange.com/users/189913/" ]
**Hint**: $$\sqrt{n^2-n+2}-n=\frac{(n^2-n+2)-n^2}{\sqrt{n^2-n+2}+n}\ .$$
The numerator is of the form $\infty - \infty$: that tells you that you need a better approximation. More precisely, it looks like $(n + \text{ smaller stuff}) - n$, and you need to cancel out the most significant terms. The simplest more precise approximation you can use is the differential approximation: $$f(x) = f...
1,040,563
I have this limit that I tried and failed to solve: $$ \lim\_{n \to \infty}\frac{\sqrt{n^2-n+2}-n}{\sqrt{1+\frac1n}}=\lim\_{n \to \infty}\frac{\sqrt{n^2(1-\frac1n+\frac{2}{n^2})}-n}{\sqrt{1+\frac1n}}=\lim\_{n \to \infty}\frac{n\times\sqrt{1-\frac1n+\frac{2}{n^2}}-1}{\sqrt{1+\frac1n}}=\infty\times0$$ My solution is un...
2014/11/27
[ "https://math.stackexchange.com/questions/1040563", "https://math.stackexchange.com", "https://math.stackexchange.com/users/189913/" ]
**Hint**: $$\sqrt{n^2-n+2}-n=\frac{(n^2-n+2)-n^2}{\sqrt{n^2-n+2}+n}\ .$$
Let us look at the different pieces of the expression $$\frac{\sqrt{n^2-n+2}-n}{\sqrt{1+\frac1n}}=\frac{\sqrt{n^2(1-\frac1n+\frac{2}{n^2})}-n}{\sqrt{1+\frac1n}}=n\frac{\sqrt{1-(\frac1n-\frac{2}{n^2})}-1}{\sqrt{1+\frac1n}}=n \frac AB$$ and now use the fact that for small values of $x$, $$\sqrt{1+x}=1+\frac{x}{2}-\frac{x...
1,040,563
I have this limit that I tried and failed to solve: $$ \lim\_{n \to \infty}\frac{\sqrt{n^2-n+2}-n}{\sqrt{1+\frac1n}}=\lim\_{n \to \infty}\frac{\sqrt{n^2(1-\frac1n+\frac{2}{n^2})}-n}{\sqrt{1+\frac1n}}=\lim\_{n \to \infty}\frac{n\times\sqrt{1-\frac1n+\frac{2}{n^2}}-1}{\sqrt{1+\frac1n}}=\infty\times0$$ My solution is un...
2014/11/27
[ "https://math.stackexchange.com/questions/1040563", "https://math.stackexchange.com", "https://math.stackexchange.com/users/189913/" ]
The numerator is of the form $\infty - \infty$: that tells you that you need a better approximation. More precisely, it looks like $(n + \text{ smaller stuff}) - n$, and you need to cancel out the most significant terms. The simplest more precise approximation you can use is the differential approximation: $$f(x) = f...
Let us look at the different pieces of the expression $$\frac{\sqrt{n^2-n+2}-n}{\sqrt{1+\frac1n}}=\frac{\sqrt{n^2(1-\frac1n+\frac{2}{n^2})}-n}{\sqrt{1+\frac1n}}=n\frac{\sqrt{1-(\frac1n-\frac{2}{n^2})}-1}{\sqrt{1+\frac1n}}=n \frac AB$$ and now use the fact that for small values of $x$, $$\sqrt{1+x}=1+\frac{x}{2}-\frac{x...
67,045,257
I try to create a new ASP.NET Core project that target the classic .NET Framework. The template [web](https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-new#web) and [webapi](https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-new#webapi) have the option `framework`, but this don't accept .NET Framework ...
2021/04/11
[ "https://Stackoverflow.com/questions/67045257", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2703673/" ]
I used this to create ASP.NET Core empty Web App that targets 4.7.1: ```sh dotnet new web --target-framework-override net471 ``` I saw it [there](https://github.com/dotnet/templating/issues/1406). The generated project file looks like this: ```xml <Project Sdk="Microsoft.NET.Sdk.Web"> <PropertyGroup> <Target...
There is no option to set .net frameworks with a default template. You can view the framework's options by running: **dotnet new web --help**: [image](https://i.stack.imgur.com/Voada.png)
36,591,802
In my project I am using WebView that show all page but not load this page, <https://sarathi.nic.in:8443/nrportal/sarathi/Browser/Help_LLNew.html> Need to know `android WebView` support JSP?
2016/04/13
[ "https://Stackoverflow.com/questions/36591802", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4590447/" ]
> > Is CTI still valid as approach? > > > I think that if the number of the categories are in the order of tenth, and not of hundredth, then yes. > > How could I assign the correct attributes set to a product? > > > You could add to each category row the table name of corresponding table of attributes, and f...
In almost all situations it is "wrong" to have 55 tables with identical schema. Making it 1 table is better. But then it gets you into the nightmare called "Entity-Attribute-Value". Pick a few "attributes" that you usually need to search on. Put the rest into a JSON string in a single column. [More details](http://mys...
157,116
After booting Ubuntu 12.04 64 bit, I am not able to connect to Wifi, until I disconnect and reconnect. This has been happening for a while but I am finally getting tired of reconnecting after a boot, so Im trying to fix it. In my efforts to troubleshoot here is what I have so far: * When Wifi is not working I can not...
2012/06/28
[ "https://askubuntu.com/questions/157116", "https://askubuntu.com", "https://askubuntu.com/users/54187/" ]
set default shell in vim ``` :set shell=/bin/bash ``` Thanks to [Ubuntu Forum](http://forum.ubuntu.org.cn/viewtopic.php?f=48&t=379312)
have you installed zsh? Install it from here [zsh](http://apt.ubuntu.com/p/zsh) [![Install zsh](https://hostmar.co/software-small)](http://apt.ubuntu.com/p/zsh)
157,116
After booting Ubuntu 12.04 64 bit, I am not able to connect to Wifi, until I disconnect and reconnect. This has been happening for a while but I am finally getting tired of reconnecting after a boot, so Im trying to fix it. In my efforts to troubleshoot here is what I have so far: * When Wifi is not working I can not...
2012/06/28
[ "https://askubuntu.com/questions/157116", "https://askubuntu.com", "https://askubuntu.com/users/54187/" ]
have you installed zsh? Install it from here [zsh](http://apt.ubuntu.com/p/zsh) [![Install zsh](https://hostmar.co/software-small)](http://apt.ubuntu.com/p/zsh)
How do you propose using Zsh if you don't have it installed?! You still do have to install it with: `sudo apt-get install zsh` even if you don't make it your default shell, which is what I suspect you meant.
157,116
After booting Ubuntu 12.04 64 bit, I am not able to connect to Wifi, until I disconnect and reconnect. This has been happening for a while but I am finally getting tired of reconnecting after a boot, so Im trying to fix it. In my efforts to troubleshoot here is what I have so far: * When Wifi is not working I can not...
2012/06/28
[ "https://askubuntu.com/questions/157116", "https://askubuntu.com", "https://askubuntu.com/users/54187/" ]
set default shell in vim ``` :set shell=/bin/bash ``` Thanks to [Ubuntu Forum](http://forum.ubuntu.org.cn/viewtopic.php?f=48&t=379312)
To install zsh type the following in a terminal ``` sudo apt-get update sudo apt-get install zsh ```
157,116
After booting Ubuntu 12.04 64 bit, I am not able to connect to Wifi, until I disconnect and reconnect. This has been happening for a while but I am finally getting tired of reconnecting after a boot, so Im trying to fix it. In my efforts to troubleshoot here is what I have so far: * When Wifi is not working I can not...
2012/06/28
[ "https://askubuntu.com/questions/157116", "https://askubuntu.com", "https://askubuntu.com/users/54187/" ]
To install zsh type the following in a terminal ``` sudo apt-get update sudo apt-get install zsh ```
How do you propose using Zsh if you don't have it installed?! You still do have to install it with: `sudo apt-get install zsh` even if you don't make it your default shell, which is what I suspect you meant.
157,116
After booting Ubuntu 12.04 64 bit, I am not able to connect to Wifi, until I disconnect and reconnect. This has been happening for a while but I am finally getting tired of reconnecting after a boot, so Im trying to fix it. In my efforts to troubleshoot here is what I have so far: * When Wifi is not working I can not...
2012/06/28
[ "https://askubuntu.com/questions/157116", "https://askubuntu.com", "https://askubuntu.com/users/54187/" ]
set default shell in vim ``` :set shell=/bin/bash ``` Thanks to [Ubuntu Forum](http://forum.ubuntu.org.cn/viewtopic.php?f=48&t=379312)
How do you propose using Zsh if you don't have it installed?! You still do have to install it with: `sudo apt-get install zsh` even if you don't make it your default shell, which is what I suspect you meant.
3,535,412
I've been using ComponentSoftware's [CS-RCS Basic](http://www.componentsoftware.com/products/docman/index.htm) for many years now to manage my various single-developer projects. It's worked very well for me, but now I want to migrate to a modern revision-control system, and after studying my options I decided on Mercur...
2010/08/20
[ "https://Stackoverflow.com/questions/3535412", "https://Stackoverflow.com", "https://Stackoverflow.com/users/264721/" ]
Here's the method I came up with, warts and all. It's a bit 'cargo culty', since I basically know nothing about CVS and not much (yet) about Mercurial: I have a Windows XP virtual machine that I can take snapshots of, so I did that and then installed CVSNT and the Windows command-line version of Mercurial (I use Torto...
If Mercurial has fast-import/fast-export support, and if your multi-file repositories do not use branches, you can probably try using my rcs-fast-export tool (available @ <http://git.oblomov.eu/rcs-fast-export> ). Although I've only used it to export from RCS to git so far, I am not aware of any git-specific fast-expor...
12,042,129
How do you pass an httpcontext.current object to a web service and use that object in the service, I get an error saying that it is expecting a string - surly this must be possible? ``` Imports System.Web Imports System.Web.Services Imports System.Web.Services.Protocols <WebService(Namespace:="http://tempuri.org/")> ...
2012/08/20
[ "https://Stackoverflow.com/questions/12042129", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1477816/" ]
The HttpContext is not serilazible, so it can't be sent as a string. HttpContext is an complex object with other complex properties, so it would be rather big if you would serialize it (which means it would be alot slower sending the data). I believe it's better to encapsulate the information you need in a custom clas...
You cannot pass an `HttpContext` `ByVal`. `ByVal` means by value, which means that the `HttpContext`'s value needs to be copied in order to be passed to your method. Since it's a [complex] object, you can't do that. Instead you need to pass it `ByRef`, which means pass a reference to the object to your method and work ...
21,666,196
So I am working on a problem set in a MIT Free Course. The problem is to create a word game and I have downloaded a list of 84,000 words that will serve as a dictionary. The file is located in my desktop and I have tried entering the specific location in PyCharm but for some reason it can not find the file. I have trie...
2014/02/09
[ "https://Stackoverflow.com/questions/21666196", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2423505/" ]
Try this instead: ``` import os WORDLIST_FILENAME = os.path.expanduser("~/Desktop/words.txt") ```
I agree with Cfreak. It's trying to open `words.txt`, which it interprets to be a relative path, and, because there are not directory specifications in the path, the script expects to be in the current working directory (often the same one as the script). Either modify the script the way wim suggests or move `words.txt...
13,639,219
This is for a computer science assignment using Python, does anybody know where I would begin to create an algorithm to create a square or box that rolls across the screen? And I do indeed mean roll, not slide. It does not necessarily have to be using python, I just need a general idea as to how the coordinates would w...
2012/11/30
[ "https://Stackoverflow.com/questions/13639219", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1859071/" ]
If a unit square starts out with one side resting on the x-axis, and the lower right corner at (xs, 0), then after a quarter turn clockwise it will again have one side resting on the x-axis, and the lower right corner now at (xs+1, 0). Before it turns, label the lower left corner a; the upper left, b; and the upper rig...
I would approach this by first thinking about the box pivoting on one corner from one side to the next, and then combine those steps in a sequence. That is, if you have a box like ``` A ---- B | | C ---- D ``` Rolling to the right, then first the whole thing pivots about D until you have ``` C - A ...
13,639,219
This is for a computer science assignment using Python, does anybody know where I would begin to create an algorithm to create a square or box that rolls across the screen? And I do indeed mean roll, not slide. It does not necessarily have to be using python, I just need a general idea as to how the coordinates would w...
2012/11/30
[ "https://Stackoverflow.com/questions/13639219", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1859071/" ]
If a unit square starts out with one side resting on the x-axis, and the lower right corner at (xs, 0), then after a quarter turn clockwise it will again have one side resting on the x-axis, and the lower right corner now at (xs+1, 0). Before it turns, label the lower left corner a; the upper left, b; and the upper rig...
You could alternatively completely break the spirit of the assignment by using pybox2d, pymunk or another physics engine to do all the calculations for you. Then you could have lots of boxes rolling around and bouncing off each other :D
13,361,335
So I have several .jsp files: one of the files has the head tag and has the title of the page: ``` <%@ page pageEncoding="UTF-8"%> <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>${param.title}</title> </head> ``` The other files include the first one and pas...
2012/11/13
[ "https://Stackoverflow.com/questions/13361335", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3485/" ]
Using JSTL worked here. It's more verbose though: "head": ``` <%@ page pageEncoding="UTF-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>${title}</title> </head> ``` "body": ``` <%@ page p...
Could the param value be dinamic? . If not, replace "í" for `&#237;`
13,361,335
So I have several .jsp files: one of the files has the head tag and has the title of the page: ``` <%@ page pageEncoding="UTF-8"%> <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>${param.title}</title> </head> ``` The other files include the first one and pas...
2012/11/13
[ "https://Stackoverflow.com/questions/13361335", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3485/" ]
I had a similar problem with jsp params and hacked it in the following way: main.jsp: ``` <%@ page pageEncoding="UTF-8"%> <html> <head/> <body> <jsp:include page="other.jsp"> <%-- í = &iacute; --%> <jsp:param name="title" value="T&iacute;tulo"/> </jsp:include> </body> </html> ``` other.jsp ...
Could the param value be dinamic? . If not, replace "í" for `&#237;`
41,209,578
Is there a concise way in Swift of creating an array by applying a binary operation on the elements of two other arrays? For example: ``` let a = [1, 2, 3] let b = [4, 5, 6] let c = (0..<3).map{a[$0]+b[$0]} // c = [5, 7, 9] ```
2016/12/18
[ "https://Stackoverflow.com/questions/41209578", "https://Stackoverflow.com", "https://Stackoverflow.com/users/125997/" ]
If you use [zip](https://developer.apple.com/reference/swift/1541125-zip) to combine the elements, you can refer to `+` with just `+`: ``` let a = [1, 2, 3] let b = [4, 5, 6] let c = zip(a, b).map(+) // [5, 7, 9] ```
**Update:** You can use `indices` like this: ``` for index in a.indices{ sum.append(a[index] + b[index]) } print(sum)// [5, 7, 9] ``` (Thanks to Alexander's comment this is better, because we don't have to deal with the `element` itself and we just deal with the `index`) **Old answer:** you can enumerate to g...
21,479,100
I have Bootstrap datepicker with default format **mm/dd/yyyy**, and I have select where I can change format **from mm/dd/yyyy** to **dd/mm/yyyy** and reverse. On select change I want to my datepicker change format. I tried ``` find('#options-date_format').on('change', function(){ $("#picker").datepicker({format:...
2014/01/31
[ "https://Stackoverflow.com/questions/21479100", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1548374/" ]
I think the below approach is working, 1, Whenever changing the format, de-attach and then re-attach back to the element. ``` $("#dp3").datepicker(); // initialization $('select').on('change', function () { var d = $('select option:selected').text(); if (d == 2) { $("#dp3").datepicker('remove'); //de...
Ok I resolve this extending bootstra-datepicker.js ``` setFormat: function(format) { this.format = DPGlobal.parseFormat(format); } ``` And call that function ``` find('#options-date_format').on('change', function(){ $("#picker").datepicker('setFormat', newFormat); }); ```
21,479,100
I have Bootstrap datepicker with default format **mm/dd/yyyy**, and I have select where I can change format **from mm/dd/yyyy** to **dd/mm/yyyy** and reverse. On select change I want to my datepicker change format. I tried ``` find('#options-date_format').on('change', function(){ $("#picker").datepicker({format:...
2014/01/31
[ "https://Stackoverflow.com/questions/21479100", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1548374/" ]
I think the below approach is working, 1, Whenever changing the format, de-attach and then re-attach back to the element. ``` $("#dp3").datepicker(); // initialization $('select').on('change', function () { var d = $('select option:selected').text(); if (d == 2) { $("#dp3").datepicker('remove'); //de...
When you have many date pickers, the you can use a class selector and reset all of them, and initialize using the class. Code sample below. In the example, all the input elements will have the class `date-picker` ``` function resetDatePickers(){ $('.date-picker').each(function(index){ $(this).datepicker('re...
21,479,100
I have Bootstrap datepicker with default format **mm/dd/yyyy**, and I have select where I can change format **from mm/dd/yyyy** to **dd/mm/yyyy** and reverse. On select change I want to my datepicker change format. I tried ``` find('#options-date_format').on('change', function(){ $("#picker").datepicker({format:...
2014/01/31
[ "https://Stackoverflow.com/questions/21479100", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1548374/" ]
Ok I resolve this extending bootstra-datepicker.js ``` setFormat: function(format) { this.format = DPGlobal.parseFormat(format); } ``` And call that function ``` find('#options-date_format').on('change', function(){ $("#picker").datepicker('setFormat', newFormat); }); ```
When you have many date pickers, the you can use a class selector and reset all of them, and initialize using the class. Code sample below. In the example, all the input elements will have the class `date-picker` ``` function resetDatePickers(){ $('.date-picker').each(function(index){ $(this).datepicker('re...
5,939
Prior to the events of the season 3 finale of *Fringe*, the Broyles from Over There (i.e. Col. Broyles) died. After the events of that finale, a character was wiped from history. Col. Broyles was killed and used as the mass sent Over Here to replace the Olivia from Over There (i.e. Fauxlivia) when they brought her back...
2011/10/01
[ "https://scifi.stackexchange.com/questions/5939", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/-1/" ]
This really bothers me because either way, Fauxlivia would have had to be replaced mass wise with something from the other side. There's no way Olivia could have escaped without col. Broyles help, so the events don't seem to have changed even with / without the missing character.
We know that 'Over There' they are far more advanced technologically and medically. In the first episode of season 4 we see Walter reanimate a dead bird which briefly flies around the lab. Perhaps they sent Colonel Broyles back soon enough so they were able to save him?
5,939
Prior to the events of the season 3 finale of *Fringe*, the Broyles from Over There (i.e. Col. Broyles) died. After the events of that finale, a character was wiped from history. Col. Broyles was killed and used as the mass sent Over Here to replace the Olivia from Over There (i.e. Fauxlivia) when they brought her back...
2011/10/01
[ "https://scifi.stackexchange.com/questions/5939", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/-1/" ]
Maybe, just maybe, Walternate replaced Broyles on his side with a shape shifter because I seem to recall his team thought he just disappeared As I watch the episode, SE4 The Consultant, the idea of shape shifters is viable ONLY if they take on the emotions of the 'bodies' they inhabit. Remember, in last week's episode...
We know that 'Over There' they are far more advanced technologically and medically. In the first episode of season 4 we see Walter reanimate a dead bird which briefly flies around the lab. Perhaps they sent Colonel Broyles back soon enough so they were able to save him?
5,939
Prior to the events of the season 3 finale of *Fringe*, the Broyles from Over There (i.e. Col. Broyles) died. After the events of that finale, a character was wiped from history. Col. Broyles was killed and used as the mass sent Over Here to replace the Olivia from Over There (i.e. Fauxlivia) when they brought her back...
2011/10/01
[ "https://scifi.stackexchange.com/questions/5939", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/-1/" ]
It's because he did not die in the alternate time line created at the end of the season 3. He is not alone, in "[Subject 9](http://fringepedia.net/wiki/Subject_9)" (episode 4 of season 4), they find Cameron James, a subject of Cortexiphan trials: > > Cameron and Olivia talk about the other test subjects from Jackson...
In S4E2, Walter mentioned that *Olivia* was kidnapped to the other side, not Peter being kidnapped and her following. I think that with that significant change, she probably did not interact with Broyles. Walternate would have kept her captive and experimented on her instead of trying to brainwash her into believing sh...
5,939
Prior to the events of the season 3 finale of *Fringe*, the Broyles from Over There (i.e. Col. Broyles) died. After the events of that finale, a character was wiped from history. Col. Broyles was killed and used as the mass sent Over Here to replace the Olivia from Over There (i.e. Fauxlivia) when they brought her back...
2011/10/01
[ "https://scifi.stackexchange.com/questions/5939", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/-1/" ]
It's because he did not die in the alternate time line created at the end of the season 3. He is not alone, in "[Subject 9](http://fringepedia.net/wiki/Subject_9)" (episode 4 of season 4), they find Cameron James, a subject of Cortexiphan trials: > > Cameron and Olivia talk about the other test subjects from Jackson...
Go to <http://tvovermind.zap2it.com/fox/fringe/review-fringe-season-4-puts-strange-world/92224> There is an article that states the existance of Broyles might be due to Peter not existing - the timeline may have changed, also the writers may have an explanation in an episode to come - either way people have noticed so ...
5,939
Prior to the events of the season 3 finale of *Fringe*, the Broyles from Over There (i.e. Col. Broyles) died. After the events of that finale, a character was wiped from history. Col. Broyles was killed and used as the mass sent Over Here to replace the Olivia from Over There (i.e. Fauxlivia) when they brought her back...
2011/10/01
[ "https://scifi.stackexchange.com/questions/5939", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/-1/" ]
In S4E2, Walter mentioned that *Olivia* was kidnapped to the other side, not Peter being kidnapped and her following. I think that with that significant change, she probably did not interact with Broyles. Walternate would have kept her captive and experimented on her instead of trying to brainwash her into believing sh...
How about this: what if Fauxlivia stayed Over Here until the bridge was created, thereby not needed an exit and not using Broyles as a mass-replacement? This plot hole is really bothering me.
5,939
Prior to the events of the season 3 finale of *Fringe*, the Broyles from Over There (i.e. Col. Broyles) died. After the events of that finale, a character was wiped from history. Col. Broyles was killed and used as the mass sent Over Here to replace the Olivia from Over There (i.e. Fauxlivia) when they brought her back...
2011/10/01
[ "https://scifi.stackexchange.com/questions/5939", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/-1/" ]
It's because he did not die in the alternate time line created at the end of the season 3. He is not alone, in "[Subject 9](http://fringepedia.net/wiki/Subject_9)" (episode 4 of season 4), they find Cameron James, a subject of Cortexiphan trials: > > Cameron and Olivia talk about the other test subjects from Jackson...
Well since Olivia was kidnapped I'm assuming they sent Olivia back at the same time as brining fauxlivia back which means they didn't have to replace her mass with the other broyles which means the other broyles didn't help her escape and never did anything wrong to be killed
5,939
Prior to the events of the season 3 finale of *Fringe*, the Broyles from Over There (i.e. Col. Broyles) died. After the events of that finale, a character was wiped from history. Col. Broyles was killed and used as the mass sent Over Here to replace the Olivia from Over There (i.e. Fauxlivia) when they brought her back...
2011/10/01
[ "https://scifi.stackexchange.com/questions/5939", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/-1/" ]
In S4E2, Walter mentioned that *Olivia* was kidnapped to the other side, not Peter being kidnapped and her following. I think that with that significant change, she probably did not interact with Broyles. Walternate would have kept her captive and experimented on her instead of trying to brainwash her into believing sh...
Maybe, just maybe, Walternate replaced Broyles on his side with a shape shifter because I seem to recall his team thought he just disappeared As I watch the episode, SE4 The Consultant, the idea of shape shifters is viable ONLY if they take on the emotions of the 'bodies' they inhabit. Remember, in last week's episode...
5,939
Prior to the events of the season 3 finale of *Fringe*, the Broyles from Over There (i.e. Col. Broyles) died. After the events of that finale, a character was wiped from history. Col. Broyles was killed and used as the mass sent Over Here to replace the Olivia from Over There (i.e. Fauxlivia) when they brought her back...
2011/10/01
[ "https://scifi.stackexchange.com/questions/5939", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/-1/" ]
It's because he did not die in the alternate time line created at the end of the season 3. He is not alone, in "[Subject 9](http://fringepedia.net/wiki/Subject_9)" (episode 4 of season 4), they find Cameron James, a subject of Cortexiphan trials: > > Cameron and Olivia talk about the other test subjects from Jackson...
We know that 'Over There' they are far more advanced technologically and medically. In the first episode of season 4 we see Walter reanimate a dead bird which briefly flies around the lab. Perhaps they sent Colonel Broyles back soon enough so they were able to save him?
5,939
Prior to the events of the season 3 finale of *Fringe*, the Broyles from Over There (i.e. Col. Broyles) died. After the events of that finale, a character was wiped from history. Col. Broyles was killed and used as the mass sent Over Here to replace the Olivia from Over There (i.e. Fauxlivia) when they brought her back...
2011/10/01
[ "https://scifi.stackexchange.com/questions/5939", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/-1/" ]
Maybe, just maybe, Walternate replaced Broyles on his side with a shape shifter because I seem to recall his team thought he just disappeared As I watch the episode, SE4 The Consultant, the idea of shape shifters is viable ONLY if they take on the emotions of the 'bodies' they inhabit. Remember, in last week's episode...
This really bothers me because either way, Fauxlivia would have had to be replaced mass wise with something from the other side. There's no way Olivia could have escaped without col. Broyles help, so the events don't seem to have changed even with / without the missing character.
5,939
Prior to the events of the season 3 finale of *Fringe*, the Broyles from Over There (i.e. Col. Broyles) died. After the events of that finale, a character was wiped from history. Col. Broyles was killed and used as the mass sent Over Here to replace the Olivia from Over There (i.e. Fauxlivia) when they brought her back...
2011/10/01
[ "https://scifi.stackexchange.com/questions/5939", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/-1/" ]
In S4E2, Walter mentioned that *Olivia* was kidnapped to the other side, not Peter being kidnapped and her following. I think that with that significant change, she probably did not interact with Broyles. Walternate would have kept her captive and experimented on her instead of trying to brainwash her into believing sh...
We know that 'Over There' they are far more advanced technologically and medically. In the first episode of season 4 we see Walter reanimate a dead bird which briefly flies around the lab. Perhaps they sent Colonel Broyles back soon enough so they were able to save him?
6,021,047
I have (what I hope is) a very simple question. I would like to use some javax.crypto classes from within a python script, so be able to do something like: ``` from javax.crypto import Cipher cipher = Cipher.getInstance('AES/CTR/NoPadding') ``` But I am not familiar with how to do this get python to be able to rec...
2011/05/16
[ "https://Stackoverflow.com/questions/6021047", "https://Stackoverflow.com", "https://Stackoverflow.com/users/744064/" ]
It's very completely wrong. Python and Java are separate languages, and CPython, the implementation you're using, has its own VM. Use [Jython](http://www.jython.org/) if you want to bridge the two.
Under jython you use the syntax you describe. Basic types(strings, ints, floats) are converted automatically by jython when going from some .py code into java. If you want to be processing your own objects you have to start writing interface wrappers. ``` C:\>SET PATH=C:\jython2.5.2\bin;%PATH% C:\>jython Jython 2.5.2...
69,222,704
What I want to do is following left corner in the container. I tried to do it putting another green container in it but, it does not fit with the border radius of original container. [![enter image description here](https://i.stack.imgur.com/NODtG.png)](https://i.stack.imgur.com/NODtG.png)
2021/09/17
[ "https://Stackoverflow.com/questions/69222704", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15751269/" ]
like this? ``` ClipRRect( borderRadius: BorderRadius.all(Radius.circular(16)), child: Row( mainAxisAlignment: MainAxisAlignment.start, children: [ Container( width: 10, height: 100, decoration: BoxDecoration( color: Colors.green, ), ...
You can achieve it by setting a `BorderSide` inside a `Border`. ``` Container( height: 100, width: 400, decoration: BoxDecoration( color: Colors.green[200], border: const Border( left: BorderSide( width: 16.0, ...
52,462,991
SQL table has the following data, with 3 columns Id, Name and Full Name. ``` | ID | Name | FullName | | 1 | a | a | | 2 | b | ab | | 3 | c | abc | | 4 | d | ad | | 5 | e | ade | | 6 | i | i | | 7 | g | ig | ``` For example, in the rows where ID =...
2018/09/23
[ "https://Stackoverflow.com/questions/52462991", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5028052/" ]
Here is a solution: ``` CREATE TABLE MyTable( ID INT, Name VARCHAR(45), FullName VARCHAR(90) ); INSERT INTO MyTable VALUES (1, 'a', 'a'), (2, 'b', 'ab'), (3, 'c', 'abc'), (4, 'd', 'ad'), (5, 'e', 'ade'), (6, 'i', 'i'), (7, 'g', 'ig'); SELECT * FROM MyTable WHERE ID NOT IN ( SE...
Here is a query which seems to be working. We can phrase a matching full name as one for which there are no parents of that full name. ``` SELECT t1.* FROM yourTable t1 WHERE NOT EXISTS (SELECT 1 FROM yourTable t2 WHERE t2.FullName LIKE '%' + t1.FullName + '%' AND LEN(t2.FullN...
73,990,693
How can i add three diagonal gradients on this section with the first gradient top left and the rest succeeding the next? ``` <section id='product'> <div className="container"> <div className="row justify-content-center"> <div className="col-md-8 mt-5"> ...
2022/10/07
[ "https://Stackoverflow.com/questions/73990693", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19943129/" ]
If there is no discernable speedup, then probably your code is not CPU-bound. In general, writing to a disk (even an SSD) is much slower than running code on the CPU. If several worker processes are writing significant amounts of data to disk, that might be the bottleneck. To diagnose the problem, you have to *measur...
The straggler effect can have a big impact on such jobs. straggler effect ================ Suppose you have N tasks for N cores, and each task has a different duration. Order by duration to find min\_time and max\_time. All N cores will be busy up through min\_time, but then they go idle, one by one. Just before max\...
38,418,504
I've been trying to implement image upload with the following requirements: 1. Drag and drop 2. Display dropped image in a popup with option to resize image 3. Upload image after preview and resize I'm trying to restrict my options to either [bass jobsen's jqueryupload](https://github.com/bassjobsen/jqueryupload). Us...
2016/07/17
[ "https://Stackoverflow.com/questions/38418504", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1597438/" ]
There are several issues at `javascript` at Question * `$file_input[0]files[0]` should select `File` object, instead of `$file_input[0][files][0]`, where brackets surrounding `files` property is syntax error; * it is not possible to set a `File` object to the [`FileList`](https://developer.mozilla.org/en-US/docs/Web/A...
I think,the cause of the error that `readAsDataUrl()` is async operation, and you must wait for it to finish before you do the rest of the work. You can try the following code: ``` file_reader.onload = function(e) { if(reader.readyState == FileReader.DONE) //You can remove this if not needed alert(file.nam...
897
In the [site FAQ](https://security.stackexchange.com/faq), it is written: > > Black Hat vs White Hat - This site is not intended to be a resource for Black Hats, or malicious hackers. While we understand discussion of exploits may require examples, if the question looks too much like a request for attack tools or mec...
2012/08/10
[ "https://security.meta.stackexchange.com/questions/897", "https://security.meta.stackexchange.com", "https://security.meta.stackexchange.com/users/414/" ]
After several discussions in chat, most notably ones involving @Gilles, I've learned a couple key points. To sum up, these add up to say that any truly undesirable or inappropriate "black hat" questions should already be getting handled per existing StackExchange policies. **For the TL;DR version, jump to the bolded p...
It's not hard to come up with a real question that's not too localized, that is clearly only for black hat purposes and in my opinion should get deleted. For example: > > **How do I do an ARP Spoofing Attack**: I'm trying to steal my neighbors passwords/credit card numbers. I set up a fake version of a popular shoppi...
897
In the [site FAQ](https://security.stackexchange.com/faq), it is written: > > Black Hat vs White Hat - This site is not intended to be a resource for Black Hats, or malicious hackers. While we understand discussion of exploits may require examples, if the question looks too much like a request for attack tools or mec...
2012/08/10
[ "https://security.meta.stackexchange.com/questions/897", "https://security.meta.stackexchange.com", "https://security.meta.stackexchange.com/users/414/" ]
I think in principle I agree...and in following @Gilles well researched argument on what we have previously removed as Black Hat it does look like we have pretty much only removed ones that are either rubbish questions, or ones that are blatantly aiming to cause 'bad things' I think I have been quite risk averse (it i...
It is the intent that matters. More often than not, you can tell with reasonable accuracy whether the poster is looking for help to do bad stuff or just trying to find vulnerabilities for purposes of system hardening. To paraphrase Justice Stewart, I may not be able to define black-hat questions, but I knows it when I...
897
In the [site FAQ](https://security.stackexchange.com/faq), it is written: > > Black Hat vs White Hat - This site is not intended to be a resource for Black Hats, or malicious hackers. While we understand discussion of exploits may require examples, if the question looks too much like a request for attack tools or mec...
2012/08/10
[ "https://security.meta.stackexchange.com/questions/897", "https://security.meta.stackexchange.com", "https://security.meta.stackexchange.com/users/414/" ]
It's not hard to come up with a real question that's not too localized, that is clearly only for black hat purposes and in my opinion should get deleted. For example: > > **How do I do an ARP Spoofing Attack**: I'm trying to steal my neighbors passwords/credit card numbers. I set up a fake version of a popular shoppi...
It seems to me that there is quite a bit of time wasted on the assumption that people on here (whitehat, blackhat, grey, yellow...) are actually telling the truth about who they are. Honestly, when I read a question I skim over personal details and all the 'fluff' just to figure out what the actual question or answer i...
897
In the [site FAQ](https://security.stackexchange.com/faq), it is written: > > Black Hat vs White Hat - This site is not intended to be a resource for Black Hats, or malicious hackers. While we understand discussion of exploits may require examples, if the question looks too much like a request for attack tools or mec...
2012/08/10
[ "https://security.meta.stackexchange.com/questions/897", "https://security.meta.stackexchange.com", "https://security.meta.stackexchange.com/users/414/" ]
I think the biggest problem in the security industry right now is that there are too many stuck up whitehats that are expected to break the exploitation process when they themselves have never written an exploit. So in the realm of security, making any topic taboo makes the process of learning into a vulnerability. Aft...
It is the intent that matters. More often than not, you can tell with reasonable accuracy whether the poster is looking for help to do bad stuff or just trying to find vulnerabilities for purposes of system hardening. To paraphrase Justice Stewart, I may not be able to define black-hat questions, but I knows it when I...
897
In the [site FAQ](https://security.stackexchange.com/faq), it is written: > > Black Hat vs White Hat - This site is not intended to be a resource for Black Hats, or malicious hackers. While we understand discussion of exploits may require examples, if the question looks too much like a request for attack tools or mec...
2012/08/10
[ "https://security.meta.stackexchange.com/questions/897", "https://security.meta.stackexchange.com", "https://security.meta.stackexchange.com/users/414/" ]
In my opinion to be sure that protection mechanisms work, you should know what attacks can be performed against them. Only if you know techniques that can be used to attack you, you can be sure whether you are protected. If you go to Sec.SE asking about attack protection without knowing full attack profile, you can't j...
It is the intent that matters. More often than not, you can tell with reasonable accuracy whether the poster is looking for help to do bad stuff or just trying to find vulnerabilities for purposes of system hardening. To paraphrase Justice Stewart, I may not be able to define black-hat questions, but I knows it when I...
897
In the [site FAQ](https://security.stackexchange.com/faq), it is written: > > Black Hat vs White Hat - This site is not intended to be a resource for Black Hats, or malicious hackers. While we understand discussion of exploits may require examples, if the question looks too much like a request for attack tools or mec...
2012/08/10
[ "https://security.meta.stackexchange.com/questions/897", "https://security.meta.stackexchange.com", "https://security.meta.stackexchange.com/users/414/" ]
It's not hard to come up with a real question that's not too localized, that is clearly only for black hat purposes and in my opinion should get deleted. For example: > > **How do I do an ARP Spoofing Attack**: I'm trying to steal my neighbors passwords/credit card numbers. I set up a fake version of a popular shoppi...
It is the intent that matters. More often than not, you can tell with reasonable accuracy whether the poster is looking for help to do bad stuff or just trying to find vulnerabilities for purposes of system hardening. To paraphrase Justice Stewart, I may not be able to define black-hat questions, but I knows it when I...
897
In the [site FAQ](https://security.stackexchange.com/faq), it is written: > > Black Hat vs White Hat - This site is not intended to be a resource for Black Hats, or malicious hackers. While we understand discussion of exploits may require examples, if the question looks too much like a request for attack tools or mec...
2012/08/10
[ "https://security.meta.stackexchange.com/questions/897", "https://security.meta.stackexchange.com", "https://security.meta.stackexchange.com/users/414/" ]
I think the biggest problem in the security industry right now is that there are too many stuck up whitehats that are expected to break the exploitation process when they themselves have never written an exploit. So in the realm of security, making any topic taboo makes the process of learning into a vulnerability. Aft...
After several discussions in chat, most notably ones involving @Gilles, I've learned a couple key points. To sum up, these add up to say that any truly undesirable or inappropriate "black hat" questions should already be getting handled per existing StackExchange policies. **For the TL;DR version, jump to the bolded p...
897
In the [site FAQ](https://security.stackexchange.com/faq), it is written: > > Black Hat vs White Hat - This site is not intended to be a resource for Black Hats, or malicious hackers. While we understand discussion of exploits may require examples, if the question looks too much like a request for attack tools or mec...
2012/08/10
[ "https://security.meta.stackexchange.com/questions/897", "https://security.meta.stackexchange.com", "https://security.meta.stackexchange.com/users/414/" ]
I think the biggest problem in the security industry right now is that there are too many stuck up whitehats that are expected to break the exploitation process when they themselves have never written an exploit. So in the realm of security, making any topic taboo makes the process of learning into a vulnerability. Aft...
It seems to me that there is quite a bit of time wasted on the assumption that people on here (whitehat, blackhat, grey, yellow...) are actually telling the truth about who they are. Honestly, when I read a question I skim over personal details and all the 'fluff' just to figure out what the actual question or answer i...
897
In the [site FAQ](https://security.stackexchange.com/faq), it is written: > > Black Hat vs White Hat - This site is not intended to be a resource for Black Hats, or malicious hackers. While we understand discussion of exploits may require examples, if the question looks too much like a request for attack tools or mec...
2012/08/10
[ "https://security.meta.stackexchange.com/questions/897", "https://security.meta.stackexchange.com", "https://security.meta.stackexchange.com/users/414/" ]
It seems to me that there is quite a bit of time wasted on the assumption that people on here (whitehat, blackhat, grey, yellow...) are actually telling the truth about who they are. Honestly, when I read a question I skim over personal details and all the 'fluff' just to figure out what the actual question or answer i...
It is the intent that matters. More often than not, you can tell with reasonable accuracy whether the poster is looking for help to do bad stuff or just trying to find vulnerabilities for purposes of system hardening. To paraphrase Justice Stewart, I may not be able to define black-hat questions, but I knows it when I...
897
In the [site FAQ](https://security.stackexchange.com/faq), it is written: > > Black Hat vs White Hat - This site is not intended to be a resource for Black Hats, or malicious hackers. While we understand discussion of exploits may require examples, if the question looks too much like a request for attack tools or mec...
2012/08/10
[ "https://security.meta.stackexchange.com/questions/897", "https://security.meta.stackexchange.com", "https://security.meta.stackexchange.com/users/414/" ]
After several discussions in chat, most notably ones involving @Gilles, I've learned a couple key points. To sum up, these add up to say that any truly undesirable or inappropriate "black hat" questions should already be getting handled per existing StackExchange policies. **For the TL;DR version, jump to the bolded p...
It is the intent that matters. More often than not, you can tell with reasonable accuracy whether the poster is looking for help to do bad stuff or just trying to find vulnerabilities for purposes of system hardening. To paraphrase Justice Stewart, I may not be able to define black-hat questions, but I knows it when I...
198,400
This is improved code from my [previous question.](https://codereview.stackexchange.com/questions/195112/android-game-inspired-by-space-invaders-and-moon-patrol) This mini game which we call ["Moon Buggy" is available in beta](https://play.google.com/store/apps/details?id=dev.android.buggy) from the google playstore. ...
2018/07/13
[ "https://codereview.stackexchange.com/questions/198400", "https://codereview.stackexchange.com", "https://codereview.stackexchange.com/users/6426/" ]
My answer will also be short as there are too many things to adress at one time. But there is exactly one thing I am able to say at this point of time: You mixed up model and view. So my suggestion is to first create a model of your game so it is runnable without ANY UI elements and connect the model to the UI afterwa...
You are probably using Android Studio, which is based on IntelliJ. This IDE offers really many inspections to improve your code. One of them is: ``` variable = variable + 3; ``` Can be replaced with: ``` variable += 3; ``` You should enable all these inspections and decide whether to apply them. Some of the inspe...
26,367
Currently car boosters (a portable unit charged of an outlet and then connected to the car electrical system to start a car when the car battery is dead) typically use batteries - lead-acid, Li-Ion or LiFePO4. Over several years a battery in the booster will wear out. Would it be practical to use a bank of supercapaci...
2012/02/09
[ "https://electronics.stackexchange.com/questions/26367", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/3552/" ]
I started this reply expecting the answer to be "not a chance" but a quick look at specs and prices suggests you could do something which was interesting and possible useful to some extent but that its really impractical and certainly not cost effective so far and is unlikely to be cost effective for a few cycles of Mo...
Batteries have a relatively flat curve of voltage over charge, up to a point. Capacitors have a linear curve of voltage over charge. With batteries, you can just set up the booster battery pack in a way the voltage fits your need over a wide range of charge percentage. With capacitors, this is not an option, because...
26,367
Currently car boosters (a portable unit charged of an outlet and then connected to the car electrical system to start a car when the car battery is dead) typically use batteries - lead-acid, Li-Ion or LiFePO4. Over several years a battery in the booster will wear out. Would it be practical to use a bank of supercapaci...
2012/02/09
[ "https://electronics.stackexchange.com/questions/26367", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/3552/" ]
I started this reply expecting the answer to be "not a chance" but a quick look at specs and prices suggests you could do something which was interesting and possible useful to some extent but that its really impractical and certainly not cost effective so far and is unlikely to be cost effective for a few cycles of Mo...
Very interesting discussion; I appreciate the thorough and detailed calculations. Even though the current technology seems to indicate that this is not a practical application, I found a tinkerer who seems to have had success: <http://www.youtube.com/watch?v=GPJao1xLe7w> Here is a commercial product designed for instal...
26,367
Currently car boosters (a portable unit charged of an outlet and then connected to the car electrical system to start a car when the car battery is dead) typically use batteries - lead-acid, Li-Ion or LiFePO4. Over several years a battery in the booster will wear out. Would it be practical to use a bank of supercapaci...
2012/02/09
[ "https://electronics.stackexchange.com/questions/26367", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/3552/" ]
I started this reply expecting the answer to be "not a chance" but a quick look at specs and prices suggests you could do something which was interesting and possible useful to some extent but that its really impractical and certainly not cost effective so far and is unlikely to be cost effective for a few cycles of Mo...
As part of my work, I have some tools that compare capacitor banks for a given starting voltage, end voltage, load power, and time. Takes ESR and EOL values into account, too. My databank doesn't have every ultracap in existence, of course, but it's got a number of the most likely suspects. So let's assume the battery...
54,128,277
I am having a problem with one of my table views. I am writing a messaging page for my app that uses a table view to display the messages sent and received. The table cells need to change height based on each cells content. I have the sizing working correctly but I now need to round the cells edges to fit the UI design...
2019/01/10
[ "https://Stackoverflow.com/questions/54128277", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9882015/" ]
It might be you also need to override the setter for frame and call it in there. Any any case this is not a good idea for multiple reasons. The thing is that table view cell has many views (including itself being a view) like content view and background view... I suggest that you add yet another view on the content vi...
Make sure you **RELOAD THE TABLEVIEW** after calling your function ``` yourTableView.reloadData() ```
54,128,277
I am having a problem with one of my table views. I am writing a messaging page for my app that uses a table view to display the messages sent and received. The table cells need to change height based on each cells content. I have the sizing working correctly but I now need to round the cells edges to fit the UI design...
2019/01/10
[ "https://Stackoverflow.com/questions/54128277", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9882015/" ]
It might be you also need to override the setter for frame and call it in there. Any any case this is not a good idea for multiple reasons. The thing is that table view cell has many views (including itself being a view) like content view and background view... I suggest that you add yet another view on the content vi...
You can use self sizing table view cell according to the content. Now you can follow the previous implementation for rounded corner cell. Place the below code inside viewDidLoad. tableView.estimatedRowHeight = YourEstimatedTableViewHeight tableView.rowHeight = UITableViewAutomaticDimension **Note**: You have to giv...
54,128,277
I am having a problem with one of my table views. I am writing a messaging page for my app that uses a table view to display the messages sent and received. The table cells need to change height based on each cells content. I have the sizing working correctly but I now need to round the cells edges to fit the UI design...
2019/01/10
[ "https://Stackoverflow.com/questions/54128277", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9882015/" ]
Make sure you **RELOAD THE TABLEVIEW** after calling your function ``` yourTableView.reloadData() ```
You can use self sizing table view cell according to the content. Now you can follow the previous implementation for rounded corner cell. Place the below code inside viewDidLoad. tableView.estimatedRowHeight = YourEstimatedTableViewHeight tableView.rowHeight = UITableViewAutomaticDimension **Note**: You have to giv...
39,442,554
So this one sounds very easy but I am getting some strange behavior. In my program there is the following code: ``` std::cout << "Would you like to generate a complexity graph or calculate global complexity? (graph/global)\n"; char ans[6]; std::cin >> ans; if (ans != "global") std::cout << ">>" << ans << "<<" << st...
2016/09/12
[ "https://Stackoverflow.com/questions/39442554", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1333797/" ]
1. You should use [`strcmp`](http://en.cppreference.com/w/cpp/string/byte/strcmp) or [`strncmp`](http://en.cppreference.com/w/cpp/string/byte/strncmp) for comparison of c-style strings. `ans != "global"` is just comparing the memory address pointed by the pointer, not the content of string. 2. `char ans[6];` should be ...
You declared `ans` as array of char, thus if `if (ans != "global")` expression, `ans` means pointer to the beginning of the string. So you compare two pointers which are obviously not equal and your expression evaluates to true. If you still want to declare `ans` as a C-style string, you may construct an `std::string` ...
12,938,344
I am just building a very simple application. Three buttons. The first opens a browser, the second opens the phone and the third opens the Maps application. The purpose is to learn more about intents triggering the start up of other applications. ``` public void openBrowser(){ //Create intent Intent i = new In...
2012/10/17
[ "https://Stackoverflow.com/questions/12938344", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1732515/" ]
``` select * from Table3 where id not in ( select id from Table1 --your subquery that returns 1,2,3 union all select id from Table2 --your subquery that returns 4,5 ) ```
``` select * from mytable where id not in ( select id from othertable union select id from othertable2 ) ```
8,363,759
Here is some C++ code: ``` namespace A { int f(int x) { return 0; } int f(long x) { return 1; } template<class T> int g(T x) { return f(x); } } namespace B { struct C {}; } namespace A { int f(B::C x) { return 2; } } void h() { A::g(B::C()); } ``` In namespace A, the code declares a few overloads of a func...
2011/12/02
[ "https://Stackoverflow.com/questions/8363759", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16480/" ]
Clang gives the following error message, which gives some clues to the problem: ``` $ clang -fsyntax-only test.cc -Wall test.cc:7:10: error: call to function 'f' that is neither visible in the template definition nor found by argument-dependent lookup return f(x); ^ test.cc:21:3: note: in instantiatio...
For instance ``` int f(int x) { return 0; } int f(long x) { return 1; } ``` functions are not template functions (i.e. they don't have a `template <class T>` before them. T is a template parameter.) Therefore they can be compiled on the fly when the templated code is reached.
57,973,941
I'm fairly new to android studio so I will try to explain as best as I can. I've made a menu using fragments, so my `activity_home` is a fragmented activity. Inside the fragmented activity I've created a button that, upon clicking, should open a new activity. The problem is that I don't know how to implement the `onCl...
2019/09/17
[ "https://Stackoverflow.com/questions/57973941", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7280627/" ]
Whenever you are dealing with date values, its always better to use Date object. **Note:** month in JS starts with `0` so Jan. is 0 and Sept. is 8 ```js var json = [{ "empId": 175, "Name": "Sai", "Sal": 37000, "doj": "2019-08-15 00:00:00" }, { "empId": 1751, "Name": "Pavan", "...
You could slice the wanted part from the timestamp and get a numerical value, then compare with the month. ```js var json = [{ empId: 175, Name: "Sai", Sal: 37000, doj: "2019-08-15 00:00:00" }, { empId: 1751, Name: "Pavan", Sal: 57000, doj: "2019-07-15 00:00:00" }], month = '8', empData = json.filter(({ doj ...
57,973,941
I'm fairly new to android studio so I will try to explain as best as I can. I've made a menu using fragments, so my `activity_home` is a fragmented activity. Inside the fragmented activity I've created a button that, upon clicking, should open a new activity. The problem is that I don't know how to implement the `onCl...
2019/09/17
[ "https://Stackoverflow.com/questions/57973941", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7280627/" ]
Whenever you are dealing with date values, its always better to use Date object. **Note:** month in JS starts with `0` so Jan. is 0 and Sept. is 8 ```js var json = [{ "empId": 175, "Name": "Sai", "Sal": 37000, "doj": "2019-08-15 00:00:00" }, { "empId": 1751, "Name": "Pavan", "...
Just use `parseInt(afterSplit[1],'10')` ``` var json = [{ "empId": 175, "Name": "Sai", "Sal": 37000, "doj": "2019-08-15 00:00:00" }, { "empId": 1751, "Name": "Pavan", "Sal": 57000, "doj": "2019-07-15 00:00:00" } ]; var month = '8'; let empData = json.filter(function(mgmtmrktshar...
57,973,941
I'm fairly new to android studio so I will try to explain as best as I can. I've made a menu using fragments, so my `activity_home` is a fragmented activity. Inside the fragmented activity I've created a button that, upon clicking, should open a new activity. The problem is that I don't know how to implement the `onCl...
2019/09/17
[ "https://Stackoverflow.com/questions/57973941", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7280627/" ]
Whenever you are dealing with date values, its always better to use Date object. **Note:** month in JS starts with `0` so Jan. is 0 and Sept. is 8 ```js var json = [{ "empId": 175, "Name": "Sai", "Sal": 37000, "doj": "2019-08-15 00:00:00" }, { "empId": 1751, "Name": "Pavan", "...
You can use the below code. ```js var json = [{ "empId": 175, "Name": "Sai", "Sal": 37000, "doj": "2019-08-15 00:00:00" }, { "empId": 1751, "Name": "Pavan", "Sal": 57000, "doj": "2019-07-15 00:00:00" } ]; var month = '8' function search(month, json){ for (var i...
29,792,555
In my iOS application (made in Objective-C) I print a pdf document in a `UIWebView`. This `PDF` is display by my php page using `"Content-type: application/pdf"` I want to get my `PDF` name for saving it in my device after this. How could I do this please ? Just below the code I use to connect to the `webservice` an...
2015/04/22
[ "https://Stackoverflow.com/questions/29792555", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3820640/" ]
No, you don't. Use [digest](http://en.wikipedia.org/wiki/SHA-1#Applications) for duplicates checking. SHA1 is good enough choice. It has constant and small footprint in comparing to base64. Base64 is good for transmitting or exchanging binary data but that's all. In addition, base64 is about 1/3 greater than binary dat...
You want to use hash functions for that, for example, Sha1. It always returns a 40 character wich you can use to compare.
29,792,555
In my iOS application (made in Objective-C) I print a pdf document in a `UIWebView`. This `PDF` is display by my php page using `"Content-type: application/pdf"` I want to get my `PDF` name for saving it in my device after this. How could I do this please ? Just below the code I use to connect to the `webservice` an...
2015/04/22
[ "https://Stackoverflow.com/questions/29792555", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3820640/" ]
Like the others have said, don't use Base64 as a means of comparing files, it would be much much less expensive to to use something like SHA1, particularly if you are using this for videos. [See the sha1\_file function](http://php.net/sha1_file "see the sha1_file function") For example if you already have a SHA1 sum, ...
You want to use hash functions for that, for example, Sha1. It always returns a 40 character wich you can use to compare.
65,372,060
I am trying to get GoogleSign in working with a webapp in flutter, and for that I have been following an article. This is the function they said to use there for the login: ``` Future<String> signInWithGoogle() async { // Initialize Firebase await Firebase.initializeApp(); final GoogleSignInAccount googleSignIn...
2020/12/19
[ "https://Stackoverflow.com/questions/65372060", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13860161/" ]
``` (letfn [(my-loop [f n result] (if (< n 1) result (recur f (dec n) (f result))))] (my-loop inc 2 1)) ```
Thanks for help, my solution is: ``` (defn my-loop [f n result] (if (< n 1) result (my-loop f (dec n) (f result)))) (my-loop inc 2 1) ```
25,927,521
*The above link to a possible duplicate is not a solution for this case, because the height will be a fixed value for several breakpoints.* I have some DIVs with `display:inline-block`, so they are floating nicely side by side. These DIVs all have the same height, e.g. `height:300px`. Later, I will load an image insid...
2014/09/19
[ "https://Stackoverflow.com/questions/25927521", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1107529/" ]
When running project with cloud9 runners there is Environment popup on the right side of the runner toolbar. You can use it to add environment variables the way you want, but make sure to not add a name to the config since configs with name are automatically saved in .c9/project.settings Another solution is to create ...
You can define environment variables in `~/.profile`. Files outside of the workspace directory `/home/ubuntu/workspace` are not accessible for read only users. You can do e.g. ``` $ echo "export SECRET=geheim" >> ~/.profile ``` to define the variable `SECRET` and then use it through `process.env.SECRET` from your ap...
55,424,709
I have this inside my render: ``` {this.availProps(this.state.data)} ``` `this.state.data` is updated with a fetch when componentOnMount ``` availProps = data =>{ if (data.length == 0) return ( <option>"hello"</option> ) else return ( <option> "hi" </option> ...
2019/03/29
[ "https://Stackoverflow.com/questions/55424709", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9474198/" ]
Setting the property directly on `this.state` does not invoke the render method. You will have to use `this.setState({ useData: useData })` so that react will that something has changed which runs the render method. And since the state that is being set is based on the previous state, it is better you use state upda...
A component will rerender by default if a value from `props` or `state` is changed, which is being used in the render or in a function that the render is calling. If you had a class-level variable, such as `this.example` and were using that in the render, changing that value wouldn't make the component rerender. You ...
47,640,963
I have a custom class in VBA that pulls historical data from Bloomberg. The class, and the Bloomberg objects it uses, are asynchronous and based on the RTD platform. The issue I'm having is that I run Subs that call this custom class, but the event handling code in the custom class only runs once my Sub is finished. ...
2017/12/04
[ "https://Stackoverflow.com/questions/47640963", "https://Stackoverflow.com", "https://Stackoverflow.com/users/558619/" ]
If it has a property to check to see if it's done, then you can just put a `DoEvents` in a `Do Until` loop, checking that property for its completion.
The problem is that the bbg handler waits. So the solution is to make your sub wait for the bbg query to end, and then call your processing data sub. There are plenty of solutions for that on stackoverflow so I'll let you look for that.
185,254
I am using Microsoft Dynamics NAV 2009's Role-Tailored Client (RTC), which utilizes a 3-tier architecture. The middle tier, which Microsoft calls the service tier, is a non-cluster-aware application that runs as a Windows service. I've identified through [another question](https://serverfault.com/questions/182725/) tha...
2010/09/28
[ "https://serverfault.com/questions/185254", "https://serverfault.com", "https://serverfault.com/users/43374/" ]
I think [Windows Network Load Balancing](http://technet.microsoft.com/en-us/library/cc736597(WS.10).aspx) (NLB) will work for you - it uses multicast to allow multiple servers to be accessed by the same IP address. The servers decide between themselves which one will handle a request. It can be configured to be sticky ...
How do the clients "find" the middle tier? Is [round robin DNS](http://en.wikipedia.org/wiki/Round_robin_DNS) an option for you?
51,746,687
Hi i am using SAP JCo3 connector along with .dll file provided with the jar. the destination is successfully connected. My problem is that when i am doing the function.execute(destination) the function.getTableParameterList().getTable("PART\_LIST") returns an empty table with zero rows My code to achieve the connectivi...
2018/08/08
[ "https://Stackoverflow.com/questions/51746687", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7516269/" ]
``` =IF(E3="SSCBB",(H3/2.4),IF(E3="SSTCB",(H3/3.2),"")) ``` This method seemed to work. just declaring through data validation list boxes and this IF.
Personaly i'am not sure why you searching for VBA solution but putting this formula to "count will be much better solution in my opinion : =if(A2="SSOBB";B2/2,4;if(A2="SSTCB";B2/2,4;"Nothing to calculate")) \*=if( [your combobox]="Beam type";[your cell with length] / [value you want to divide with]; [ now add another...
10,439,277
In my layout, I have a devise sign in / sign out link, like so: ``` =if user_signed_in? then link_to "_", destroy_user_session_path, :method => :delete else link_to "_", new_user_session_path, :method => :get end ``` This uses the rails helpers to build up the link, and resolves to the following HTML: ``` <a data-m...
2012/05/03
[ "https://Stackoverflow.com/questions/10439277", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1215687/" ]
Ok, I tried XMLHttpRequest, but couldn't get it to work. I ended up doing this, which is kind of hacktastic, but it works: ``` login = function(url) { $.ajax({ url: url, type: "GET" }).done(function(){ window.location.href = url; }); ``` } ``` logout = function(url) { $.ajax({ url: url, type: "...
Most browsers do not support the full gamut of HTTP verbs. As such Rails uses a hidden variable to specify the intended HTTP method. You'll need to update the `<input type="hidden" name="_method" ... />` field to alter the HTTP verb that Rails uses during RESTful routing.
8,358,584
For small size image what's (if any) the benefit in loading time using base64 encoded image in a javascript file (or in a plain HTML file)? ``` $(document).ready(function(){ var imgsrc = "../images/icon.png"; var img64 = "P/iaVYUy94mcZxqpf9cfCwtPdXVmBfD49NHxwMraWV/iJErLmNwAGT3//w3NB"; $('img.icon').attr(...
2011/12/02
[ "https://Stackoverflow.com/questions/8358584", "https://Stackoverflow.com", "https://Stackoverflow.com/users/220180/" ]
The benefit is that you have to make one less HTTP request, since the image is "included" in a file you have made a request for anyway. Quantifying that depends on a whole lot of parameters such as caching, image size, network speed, and latency, so the only way is to measure (and the actual measurement would certainly...
It saves you a request to the server. When you reference an image through the src-property, it'll load the page, and then do the additional request to fetch the image. When you use the base64 encoded image, it'll save you that delay.
8,358,584
For small size image what's (if any) the benefit in loading time using base64 encoded image in a javascript file (or in a plain HTML file)? ``` $(document).ready(function(){ var imgsrc = "../images/icon.png"; var img64 = "P/iaVYUy94mcZxqpf9cfCwtPdXVmBfD49NHxwMraWV/iJErLmNwAGT3//w3NB"; $('img.icon').attr(...
2011/12/02
[ "https://Stackoverflow.com/questions/8358584", "https://Stackoverflow.com", "https://Stackoverflow.com/users/220180/" ]
You need to make multiple server requests, lets say you download a contrived bit of HTML such as: ``` <img src="bar.jpg" /> ``` You already needed to make a request to get that. A TCP/IP socket was created, negotiated, downloaded that HTML, and closed. This happens for every file you download. So off your browser ...
It saves you a request to the server. When you reference an image through the src-property, it'll load the page, and then do the additional request to fetch the image. When you use the base64 encoded image, it'll save you that delay.
8,358,584
For small size image what's (if any) the benefit in loading time using base64 encoded image in a javascript file (or in a plain HTML file)? ``` $(document).ready(function(){ var imgsrc = "../images/icon.png"; var img64 = "P/iaVYUy94mcZxqpf9cfCwtPdXVmBfD49NHxwMraWV/iJErLmNwAGT3//w3NB"; $('img.icon').attr(...
2011/12/02
[ "https://Stackoverflow.com/questions/8358584", "https://Stackoverflow.com", "https://Stackoverflow.com/users/220180/" ]
The benefit is that you have to make one less HTTP request, since the image is "included" in a file you have made a request for anyway. Quantifying that depends on a whole lot of parameters such as caching, image size, network speed, and latency, so the only way is to measure (and the actual measurement would certainly...
You need to make multiple server requests, lets say you download a contrived bit of HTML such as: ``` <img src="bar.jpg" /> ``` You already needed to make a request to get that. A TCP/IP socket was created, negotiated, downloaded that HTML, and closed. This happens for every file you download. So off your browser ...
24,550,706
it is possible to change the url rewrite in a cake app ? Actually it's like this : > > <http://myapp.fr/myapp/admin/users/view/30> > > > I want to hide everything after the ".fr" in every page, like this : > > <http://myapp.fr/> > > > Thank you for your help.
2014/07/03
[ "https://Stackoverflow.com/questions/24550706", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2914289/" ]
A foreign key constraint is from one table's columns to another's columns, so, no. Of course the database should have a table COUNTRY(country\_id). Commenters have pointed out that your admin is imposing an anti-pattern. Good, you are aware that you can define a column and set it to the value you want and make the fo...
For Posrgres not having computed (or constant) columns, you can force them to a fixed value column, using `DEFAULT` plus (maybe) a check. This may be ugly, but it works: ``` CREATE TABLE dictionaries ( id integer primary key , typename varchar NOT NULL CHECK ( typename IN ('person' ,'animal' ,'plant' )) , conten...
10,532,001
Programming in C# I got an Xml.XpathNodeList object "ResultsPartRel.nodeList". Debugging it with Visual Studio I can read "Results View ; Expanding the Results View will enumerate the IEnumerable" **Questions:** 1.- Which is the best way to read those nodes? 2.- I program the next code but I dont get the expected re...
2012/05/10
[ "https://Stackoverflow.com/questions/10532001", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1214129/" ]
Well we really need to see the XML sample and a verbal explanation of which data you want to extract. Currently you do a `node.SelectSingleNode(...)` so that looks as if you want to select a path relative to `node` but then you use an absolute path starting with `//`, that is why you get the same result twice. So you ...
You can get the first element. (With the "//" means search for all following tags, so you will probably get more results).When you want the first element write "//related\_id/Item/keyed\_name\**[1](https://addons.mozilla.org/en-US/firefox/addon/xpath-checker/)*\*". Or you can write the exact path.(this is the safest w...
892
Is there a method for storing one-to-many relationships within a table? Say I had a Player, and the player had multiple Tickets. How could I store multiple ticket primary keys within one player?
2018/06/16
[ "https://eosio.stackexchange.com/questions/892", "https://eosio.stackexchange.com", "https://eosio.stackexchange.com/users/1195/" ]
> > I have bought some eos on Binance. Now i m looking a way to create a wallet on eos mainnet in order to get my eos from Binance. But There is no simple way and decentralized information about HOW to create a wallet and account. > > > Please confirm Binance are allowing withdrawals and that they aren't offering ...
If you don't have an EOS account yet, you need to go through an account creation service like the one I created: <https://eos-account-creator.com/> Once your new EOS account is created, you can withdraw your EOS tokens to it.
27,783,268
I have a php statement to insert a bit of information into my mySQL database. the connection works perfectly. The problem I am having is I am getting the following error code: > > Error: INSERT INTO tasks ('taskName', 'requestedBy', 'details', > 'dateAdded') VALUES ('test1' ,'test3' ,'test3', 2015-01-05') You have >...
2015/01/05
[ "https://Stackoverflow.com/questions/27783268", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3266752/" ]
``` $sql = "INSERT INTO tasks (taskName, requestedBy, details, dateAdded) VALUES ('$taskname' ,'$requestedby' ,'$details', '$datenow')"; // Removed quotes from columns, and added missing quote on datenow ``` Please note, this technique for adding values into the database is very insecure, and is prone to SQL injecti...
You must not enclose the field names in apostrophes or quotes. Either enclose them in back quotes (`) or use them as they are. ``` $sql = "INSERT INTO tasks (`taskName`, `requestedBy`, `details`, `dateAdded`) VALUES ('$taskname' ,'$requestedby' ,'$details', '$datenow')"; ``` or ``` $sql = "INSERT INTO tasks (taskNa...
3,469,669
I am planning to create a pricing matrix for a project in Rails. It's supposed to be a table of destinations and departure locations, and prices depending on where you came and are planning to go. I am kinda undecided on how to better do this: either making a table in the db for this matrix, or making a mega array of ...
2010/08/12
[ "https://Stackoverflow.com/questions/3469669", "https://Stackoverflow.com", "https://Stackoverflow.com/users/334545/" ]
Make it a db table. The only thing constant about prices is that they change. Added: Pricing (also called product factoring) is something that I have a lot of experience with. Your clients may also ask/or appreciate added pricing tools to help them get things right. Eg, your sw: * could have reports that show the...
I would add this to a 3-column table because it's not necessarily a matrix - you might not travel from all places to all other places. You want to be able to edit it. As soon as you are done with your hard-coded version, you'll be asked to edit it. ``` LeavingFrom, TravellingTo, Price ``` Also, as the list of destin...
3,469,669
I am planning to create a pricing matrix for a project in Rails. It's supposed to be a table of destinations and departure locations, and prices depending on where you came and are planning to go. I am kinda undecided on how to better do this: either making a table in the db for this matrix, or making a mega array of ...
2010/08/12
[ "https://Stackoverflow.com/questions/3469669", "https://Stackoverflow.com", "https://Stackoverflow.com/users/334545/" ]
Make it a db table. The only thing constant about prices is that they change. Added: Pricing (also called product factoring) is something that I have a lot of experience with. Your clients may also ask/or appreciate added pricing tools to help them get things right. Eg, your sw: * could have reports that show the...
I would use two tables, Location and TravelPrice. ``` Location ---------- LocationID --PK Name TravelPrice ------------- TravelPriceID --PK DepartureLocationID --FK to Location DestinationLocationID --FK to Location Price StartDate --date the price is effective from EndDate --date the price is effective to (or NULL) ...
3,469,669
I am planning to create a pricing matrix for a project in Rails. It's supposed to be a table of destinations and departure locations, and prices depending on where you came and are planning to go. I am kinda undecided on how to better do this: either making a table in the db for this matrix, or making a mega array of ...
2010/08/12
[ "https://Stackoverflow.com/questions/3469669", "https://Stackoverflow.com", "https://Stackoverflow.com/users/334545/" ]
I would use two tables, Location and TravelPrice. ``` Location ---------- LocationID --PK Name TravelPrice ------------- TravelPriceID --PK DepartureLocationID --FK to Location DestinationLocationID --FK to Location Price StartDate --date the price is effective from EndDate --date the price is effective to (or NULL) ...
I would add this to a 3-column table because it's not necessarily a matrix - you might not travel from all places to all other places. You want to be able to edit it. As soon as you are done with your hard-coded version, you'll be asked to edit it. ``` LeavingFrom, TravellingTo, Price ``` Also, as the list of destin...
182,932
I want to use Avahi tools for mDNS service discovery in CentOS 6.6. I have installed the following packages: avahi, avahi-tools, nss-mdns. I checked the Avahi daemon and it is running: ``` $ service avahi-daemon status avahi-daemon (pid 1365) is running... ``` But when I tried running the following avahi-browse com...
2015/02/04
[ "https://unix.stackexchange.com/questions/182932", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/33477/" ]
avahi-browse, avahi-discover is part of avahi-tools rpm in centos 6.x ``` sudo yum install avahi-tools avahi-ui-tools ``` to find out: ``` sudo yum provides avahi-browser ```
Make sure not just avahi-daemon works and is installed, but also avahi-utils. That was my problem. On debian its ``` sudo apt-get install avahi-utils ``` I've never used CentOS, so I don't know how the package manager works, but it should be something similar.
61,995,920
There is a file that is sometimes not owned by root I want my perl script in linux to basically check if a file is owned by root if it is delete it. Currently what I have `unlink("$File_Path/File_Name");` but this just deletes the file I want it to check if it's owned by root first then delete otherwise ignore. c...
2020/05/25
[ "https://Stackoverflow.com/questions/61995920", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13610996/" ]
The documentation for [stat](https://perldoc.perl.org/functions/stat.html) shows that the fifth element in the returned list is "*numeric user ID of file's owner*". The superuser account on \*nix *must* have uid of `0`, so ``` if ( (stat $fqn)[4] == 0 ) { unlink $fqn or die "Error with unlink($fqn): $!"; } ```
If you're doing this to a bunch of files in a folder somewhere, you might be better off by just one of these: ``` find /folder/somewhere/ -type f -user root -exec rm {} \; find /folder/somewhere/ -type f -user root -exec rm -i {} \; #interactive y/n each file find /folder/somewhere/ -type f -user root -print0 | xarg...
114,392
I have two Ghost 14 backups of my machine. One for the machine fully configured with apps after and XP install and one of the last update before i re-imaged it (it's XP, I re-image about once every six months). I recently wanted to try simply using my initial image in a virtual environment to do my testing that general...
2010/02/28
[ "https://superuser.com/questions/114392", "https://superuser.com", "https://superuser.com/users/23312/" ]
**SphereXP** - the world's number one three-dimensional desktop. ![alt text](https://i.stack.imgur.com/OJxbp.jpg) **[YODM 3D](http://yodm-3d.uptodown.com/en/)** - Virtual Desktop Manager featuring the Cube 3D effect ![alt text](https://i.stack.imgur.com/gCnS9.png) **[Matodate](http://madotate.en.softonic.com/)** - ...
Possibly [Shock 4Way3D](http://www.docs.kr/entry/Download-Shock-4Way3D-en)? ![alt text](https://i.stack.imgur.com/ntVWu.png)