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
70,339,544
I am learning how to use the R and ggplot library and got stucked with the challenge to change the colour of the following Histogram! I did manage to change the full colour from the graph but it was with solid colours! I wanted to get count with different colours and somehow I am not managing to find out the right way ...
2021/12/13
[ "https://Stackoverflow.com/questions/70339544", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17243168/" ]
You could use `scale_fill_gradient`: ```r df4 <- data.frame(rnorm(10000,100,10)) colnames(df4) <- c("Value") library(ggplot2) ggplot(df4, aes(x=Value)) + geom_histogram(binwidth = 1, alpha=0.8, aes(fill=..count..)) + scale_fill_gradient(low = "red", high = "green") + labs(title="My first Histogram") ``` [!...
Try: ``` df4 <- data.frame(rnorm(10000,100,10)) colnames(df4) <- c("Value") histi_base2 <- ggplot(df4, aes(x=Value)) histi5 <- histi_base2 + geom_histogram(binwidth = 1, alpha=0.8, fill="red", color="black") + labs(title="Your second Histogram", subtitle = "now in solid red") histi5 ``` With `fill` you're cha...
31,537,652
When configuring MongoDB in Spring, the reference sais: register MongoDB like this: ``` @Configuration public class AppConfig { /* * Use the standard Mongo driver API to create a com.mongodb.Mongo instance. */ public @Bean Mongo mongo() throws UnknownHostException { return new Mongo("localhost"); ...
2015/07/21
[ "https://Stackoverflow.com/questions/31537652", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4825559/" ]
Yes it returns a `Mongo` :-( But as `MongoClient` extends `Mongo` that'll be ok anyway, just `@Autowire` the bean as a Mongo ``` @Autowired private Mongo mongo; ``` Then use it ``` MongoOperations mongoOps = new MongoTemplate(mongo, "databaseName"); ``` Do you really need the `SimpleMongoDbFactory` ? See [this p...
In my case, I'm using the following code to create `MongoTemplate`. I'm using `MongoRespository`. As it only needs `MongoTemplate` I need to create the `MongoTemplate` bean only. ``` @Bean public MongoTemplate mongoTemplate() throws Exception { MongoClient mongoClient = new MongoClient("localhost"); MongoDbFac...
71,896,715
I have the following data: ``` structure(list(Name = c("A", "A", "A", "A", "A", "A", "B", "B", "B", "B", "B", "B", "C", "C", "C", "C", "C", "C"), Date = c("01.09.2018", "02.09.2018", "03.09.2018", "05.11.2021", "06.11.2021", "07.11.2021", "01.09.2018", "02.09.2018", "03.09.2018", "05.11.2021", "06.11.2021", "07.11...
2022/04/16
[ "https://Stackoverflow.com/questions/71896715", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18699883/" ]
Here is a possible solution using an `ifelse` statement: ``` library(dplyr) df %>% mutate(Sum_Size= ifelse(is.na(Category), NA_real_, Sum_Size)) ``` ``` Name Date Category Size Sum_Size <chr> <chr> <int> <int> <dbl> 1 A 01.09.2018 1 34 34 2 A 02.09.2018 1...
Another possible base R solution: ``` df <- within(df, Sum_Size[is.na(Category)] <- NA) ``` **Output** ``` Name Date Category Size Sum_Size <chr> <chr> <int> <int> <int> 1 A 01.09.2018 1 34 34 2 A 02.09.2018 1 23 23 3 A 03.09.2018 NA 1...
12,352,491
I have set up a clip path on a D3.js zoomable focus and context graph, but have a slight problem. <http://nestoria.darkgreener.com/v2/> The clip path is cutting off some circles from the edge of the focus graph - you'll see that the top and right-hand circles are only half there! It works well on zoom, though, as you...
2012/09/10
[ "https://Stackoverflow.com/questions/12352491", "https://Stackoverflow.com", "https://Stackoverflow.com/users/194000/" ]
If you don't want the clipping to not be applied when hovering you can use a stylerule like this: `circle:hover { clip-path: none; }`
I had the same problem and got around it using ``` .attr("transform", "translate(0,-20)") .attr("height", height+20) ``` The Idea is a bit hacky, but if you simply move the clipping window up and add the same amount to its height, it should show (in the above case) 20px more on top. (same for left side; concerning t...
12,352,491
I have set up a clip path on a D3.js zoomable focus and context graph, but have a slight problem. <http://nestoria.darkgreener.com/v2/> The clip path is cutting off some circles from the edge of the focus graph - you'll see that the top and right-hand circles are only half there! It works well on zoom, though, as you...
2012/09/10
[ "https://Stackoverflow.com/questions/12352491", "https://Stackoverflow.com", "https://Stackoverflow.com/users/194000/" ]
If you don't want the clipping to not be applied when hovering you can use a stylerule like this: `circle:hover { clip-path: none; }`
I've used "transform",and the circles were cut to quarter.So use cx and cy instead, problem solved..
12,352,491
I have set up a clip path on a D3.js zoomable focus and context graph, but have a slight problem. <http://nestoria.darkgreener.com/v2/> The clip path is cutting off some circles from the edge of the focus graph - you'll see that the top and right-hand circles are only half there! It works well on zoom, though, as you...
2012/09/10
[ "https://Stackoverflow.com/questions/12352491", "https://Stackoverflow.com", "https://Stackoverflow.com/users/194000/" ]
I had the same problem and got around it using ``` .attr("transform", "translate(0,-20)") .attr("height", height+20) ``` The Idea is a bit hacky, but if you simply move the clipping window up and add the same amount to its height, it should show (in the above case) 20px more on top. (same for left side; concerning t...
I've used "transform",and the circles were cut to quarter.So use cx and cy instead, problem solved..
436,715
Premise ------- Ceramic capacitors with Class 2 dielectrics (such as X5R and X7R) usually show a reduction of its capacitance value as the applied bias voltage increases. This behavior is more prominent in higher density capacitors that feature high values in small packages. How to deal with this behavior has been in...
2019/05/03
[ "https://electronics.stackexchange.com/questions/436715", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/70011/" ]
There are many reasons for selecting a capacitor's value, voltage, size, and technology. A design starts with understanding the requirements which include voltage, power, frequency, size limitations, temperature range, cost, etc. Then what are the limitations of the capacitor (or any component) which are found in the s...
*When design margin in cheap, put in a lot.* If there was one thing I always tried to teach junior engineers, this was it. Voltage margin on ceramics usually doesn't cost much. I never did it to reduce capacitance variations due to bias voltage. Now, I worked in aerospace, *cheap* has a much different meaning in the c...
3,999,975
How do I prove the following inquation using induction? $2^n>1+n\sqrt{2^{n-1}}$ , $n\geq 2$ I did the base case, but I'm stuck at the induction process. The induction: $2^{k+1}>1+(k+1)\sqrt{2^{k}}$ Now I used the hipothesis to prove the induction: $2\*2^{k}>2\*(1+k\sqrt{2^{k-1}})$ $2^{k+1}>2+2k\sqrt{2^{k-1}})$ I...
2021/01/26
[ "https://math.stackexchange.com/questions/3999975", "https://math.stackexchange.com", "https://math.stackexchange.com/users/878949/" ]
Hip: $2^n>1+n\sqrt{2^{n-1}}$. Then, $2 \cdot 2^n>2(1+n\sqrt{2^{n-1}})$ $2^{n+1}>2+2n\sqrt{2^{n-1}}=2+n\sqrt{2}\sqrt{2^{n}}>1+(n+1)\sqrt{2^{n}}$ since $n\sqrt{2}>n+1$, if $n>2$.
Shouldn't your induction hypothesis be $2^k > 1 + k\sqrt{2^{k-1}}$ for some integer $k \geq 2$? It looks like you assumed $2^k > 1 + k\sqrt{2^{k}}$ instead.
42,640,490
Hello Tensorflow users/developers, Even though I call initializer function, reporter tells me that none of my variable is initialized. I created them using **tf.get\_variable()**. Here is where my session and graph objects are created: ``` with tf.Graph().as_default(): # Store all scores (each score is a loss-per...
2017/03/07
[ "https://Stackoverflow.com/questions/42640490", "https://Stackoverflow.com", "https://Stackoverflow.com/users/687483/" ]
Thanks for the reply. Well I've figured it out. I shouldn't have executed the following assignment instruction before I build my model: ``` init = tf.global_variables_initializer() ``` *For anyone's information*: You may think that "**I'll execute and get the result of this operation called 'init' when I do so in ...
If it does not exist I suspect you accidentally downgraded you Tensorflow version. Can you try tf.initialize\_all\_variables ? If this does not work, can you post what version you are using?
42,640,490
Hello Tensorflow users/developers, Even though I call initializer function, reporter tells me that none of my variable is initialized. I created them using **tf.get\_variable()**. Here is where my session and graph objects are created: ``` with tf.Graph().as_default(): # Store all scores (each score is a loss-per...
2017/03/07
[ "https://Stackoverflow.com/questions/42640490", "https://Stackoverflow.com", "https://Stackoverflow.com/users/687483/" ]
Thanks for the reply. Well I've figured it out. I shouldn't have executed the following assignment instruction before I build my model: ``` init = tf.global_variables_initializer() ``` *For anyone's information*: You may think that "**I'll execute and get the result of this operation called 'init' when I do so in ...
I got the same error. However this is my solution: just skip the init = tf.global\_variables\_initializer() and just use : sess = tf.Session sess.run(init = tf.global\_variables\_initializer())
52,285,950
I'm trying to print the values of a dictionary inside a for loop, currently this is what I'm getting: ``` Site 1 {'Port': '1/0/2', 'Link-Status': 'Up', 'Vlans': '81,1001,1101,1301,1303'} {'Port': '1/0/4', 'Link-Status': 'Down', 'Vlans': '1007'} {'Port': '1/0/11', 'Link-Status': 'Up', 'Vlans': '30,31,81...
2018/09/12
[ "https://Stackoverflow.com/questions/52285950", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10317686/" ]
Inside your `for-loop` you have the following lines ``` for element in input_site: i=0 # <--- print(list(new_site.values())[i]) i+=1 ``` At each iteration you assign i to be 0, then print the i-th element of `list(new_site.values())` and then increase its value by one. The same will happen for the nex...
Other than the `i=0` problem, there are some major issues with your for-loop: ``` for element in input_site: print(list(new_site.values())[i]) i+=1 processInput(element,type) ``` * Every time you iterate, you copy the ENTIRE list of values, just to access a single element. * `element` is a key in the `ne...
25,971,777
i have comma separated string with single quote 1. `select * from demoProject WHERE id IN(1,2,3);` 2. `set @ids := "'1,2,3'"; select * from demoProject WHERE id IN(@ids)` First query works fine but second query only fetch data with associated id '1'. Where am I wrong with second query?
2014/09/22
[ "https://Stackoverflow.com/questions/25971777", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1109169/" ]
Not really an answer, just my 0.02 cents. I think you'll spend as much time shoe-horning MembershipProvider into new Identity, as it would take to properly update to the new Idenitty framework. I've done upgrade in 2 different systems, both not small (one 200K, another 70K lines of code) with extended number of user...
This could be done by implementing your own UserStore. I think there would be a lot of dragons though. You would have to think through all those other scenarios and reconcile the two: forgot password, email confirmation, login failure counts and timespans, and so on. Basically everything that updates your user data wou...
25,971,777
i have comma separated string with single quote 1. `select * from demoProject WHERE id IN(1,2,3);` 2. `set @ids := "'1,2,3'"; select * from demoProject WHERE id IN(@ids)` First query works fine but second query only fetch data with associated id '1'. Where am I wrong with second query?
2014/09/22
[ "https://Stackoverflow.com/questions/25971777", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1109169/" ]
Not really an answer, just my 0.02 cents. I think you'll spend as much time shoe-horning MembershipProvider into new Identity, as it would take to properly update to the new Idenitty framework. I've done upgrade in 2 different systems, both not small (one 200K, another 70K lines of code) with extended number of user...
> > I'd like to leverage the existing user/role management functionality > in our application, to create and manage the API accounts. However > since the preferred option for WebAPI is to use ASP.NET Identity > (claims/bearer tokens etc...) I'm a bit confused about what the best > options would be. > > > It is...
44,910,624
I want to have a user type some words, and get them converted to an array. I want to split by word. Here is an example: `"15 17 21 46"` → `[15, 17, 21, 46]` Stuff like `split("")` and `scan` make an array out of every single letter. I would prefer doing it without using YAML. Also, take note in the example that it d...
2017/07/04
[ "https://Stackoverflow.com/questions/44910624", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8156202/" ]
[`String#split`](https://ruby-doc.org/core-2.2.0/String.html#method-i-split) doesn't actually need an argument if you want to split around whitespaces : ``` "15 17 21 46".split #=> ["15", "17", "21", "46"] ``` If you want to specify an argument, you need to use a space, not an empty string : ``` "15 17 21 46".split...
Eric Duminil's [answer](https://stackoverflow.com/a/44910887/298607) shows how to split the string on what the contents is not -- spaces. Perfectly valid if you know that your string contains only digits of interest and spaces. You can also gather the elements based on what you want -- digits vs what you don't want --...
59,054,080
At the moment I can draw rectangles using CustomPainter. Below the code inside the paint method of my CustomPainter. ``` for (var rectPoints in rectangles) { paint.color = rectPoints.color; paint.strokeWidth = rectPoints.strokeWidth; if (rectPoints.selected != null && rectPoints.selected == true) { paint.col...
2019/11/26
[ "https://Stackoverflow.com/questions/59054080", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3807961/" ]
You'll need to track the state of the rectangles' positions independent of the canvas drawing. The easiest way to do that is to use a StatefulWidget. You'll also need to use a GestureDetector to capture the pan events. Then you can wire up the gesture details to the position of the rectangles and call the painter to re...
I have developed a library called [touchable](https://pub.dev/packages/touchable) for the purpose of adding gesture callbacks to each individual shape you draw on the canvas. You can draw your shapes and add `onPanUpdate` or `onTapDown` callbacks to drag your shape around. Here's what you can do to detect touch and dr...
130,044
Is there an easy to use software that implements term-rewriting? Or do I need to write my own parser for it? I am looking for something that will take in a fixed set of user-specified rules and will be able to reduce arbitrary terms under those rules. Is there a standard tool for doing such rewrites?
2020/09/11
[ "https://cs.stackexchange.com/questions/130044", "https://cs.stackexchange.com", "https://cs.stackexchange.com/users/126327/" ]
[PLT Redex](https://redex.racket-lang.org/) has support for term rewriting. You'll find that most of the examples are focused on small-step operational semantics for programming languages, but in general the system allows for arbitrary rewriting, including non-determinism. It also has a bunch of nice features, like ran...
The computer language Prolog has a term parser built in, and you can represent re-write rules in Prolog clauses, see <https://www.youtube.com/watch?v=b2Px7cu2a68>
964,165
I try to compile Apache 2.4.28 from source, I can't use command ``` apt-get install apache2 ``` Because this command install Apache 2.4.18 only. Here is my install step: * Install dependency ``` apt-get install build-essential apt-get install libexpat1-dev apt-get install libpcre3-dev libssl-dev ``` * Download...
2017/10/12
[ "https://askubuntu.com/questions/964165", "https://askubuntu.com", "https://askubuntu.com/users/721594/" ]
I found my solution: 1. I booted on a live USB Ubuntu. 2. I could not see my hard drive, but switching on the BIOS the SATA Operations parameter from RAID to AHCI solved the problem. No idea why, maybe during the BIOS reset it switched the parameter, or maybe Ubuntu has trouble reading already-written-by-a-foreign-sou...
<https://help.ubuntu.com/community/Boot-Repair> 1. Boot your computer on a Ubuntu live-USB then choose "Try Ubuntu" 2. Connect to the Internet 3. Open a new Terminal, then type the following commands (press Enter after each line): ``` sudo add-apt-repository ppa:yannubuntu/boot-repair sudo apt-get update sudo apt-...
58,218,470
I've seen may answers to the same kind of question but I still doubt. UPDATE in SQL should be something like : ``` UPDATE *Table* SET *choose value* WHERE *what do we change* ``` I would like to know if there is possibilites to use a select instead of TABLE (an so instead of WHERE) Like ``` UPDATE *Select condit...
2019/10/03
[ "https://Stackoverflow.com/questions/58218470", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11499065/" ]
It appears that this is a bug in WordPress. I have found the source of the problem and a workaround. Workaround ========== If you're not interested in the cause, the workaround is to comment out this bit of cosmetic code in `wp-admin/includes/menu.php`: <https://github.com/WordPress/WordPress/blob/master/wp-admin/in...
I think I've found a workaround for this without having to edit the core files. As you said, the cause of this bug is that a empty menu that has no sub-menu items will cause access check to erroneously return false. So the workaround is to not make the list page a top-level menu. Instead, make it a sub-menu under an...
58,218,470
I've seen may answers to the same kind of question but I still doubt. UPDATE in SQL should be something like : ``` UPDATE *Table* SET *choose value* WHERE *what do we change* ``` I would like to know if there is possibilites to use a select instead of TABLE (an so instead of WHERE) Like ``` UPDATE *Select condit...
2019/10/03
[ "https://Stackoverflow.com/questions/58218470", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11499065/" ]
It appears that this is a bug in WordPress. I have found the source of the problem and a workaround. Workaround ========== If you're not interested in the cause, the workaround is to comment out this bit of cosmetic code in `wp-admin/includes/menu.php`: <https://github.com/WordPress/WordPress/blob/master/wp-admin/in...
I have found 2 Workarounds for this issue: First off I find it better to assign a specific capability for the custom\_post\_type create\_posts instead of using `do_not_allow` So I use: ``` ... 'capability_type' => 'books', 'capabilities' => array( 'create_posts' => 'add_new_books' ), 'map_meta_cap' ...
128,478
I've read the article about fixing bug in this post [What process do you normally use when attempting to debug a problem/issue/bug with your software?](https://softwareengineering.stackexchange.com/questions/37242/what-process-do-you-normally-use-when-attempting-to-debug-a-problem-issue-bug-wi). One of the answer which...
2012/01/05
[ "https://softwareengineering.stackexchange.com/questions/128478", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/44268/" ]
If you are on a tight deadline and decide to rewrite the code, how do you know you wouldn't introduce more bugs than what you are trying to fix? And after you go through the rewrite, for all you know, the same bug might still be there. What if the root cause of the problem happens to be your understanding of some exter...
A proper preparation before delving directly into code would never need you to rewrite it. If you are rewriting your code often it means that the method you have chosen is lacking proper analysis of requirement and/or technology and/or approach. Do not underestimate the art of Software Engineering. It saves lot of time...
128,478
I've read the article about fixing bug in this post [What process do you normally use when attempting to debug a problem/issue/bug with your software?](https://softwareengineering.stackexchange.com/questions/37242/what-process-do-you-normally-use-when-attempting-to-debug-a-problem-issue-bug-wi). One of the answer which...
2012/01/05
[ "https://softwareengineering.stackexchange.com/questions/128478", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/44268/" ]
Changing the code in any way imposes a risk of introducing new bugs into the code. The bigger the changes, the bigger the risk. You can mitigate that risk via unit (and integration/system/...) testing (but can't ever eliminate it completely). Obviously, a total rewrite has a significantly higher risk than just fixing ...
A proper preparation before delving directly into code would never need you to rewrite it. If you are rewriting your code often it means that the method you have chosen is lacking proper analysis of requirement and/or technology and/or approach. Do not underestimate the art of Software Engineering. It saves lot of time...
128,478
I've read the article about fixing bug in this post [What process do you normally use when attempting to debug a problem/issue/bug with your software?](https://softwareengineering.stackexchange.com/questions/37242/what-process-do-you-normally-use-when-attempting-to-debug-a-problem-issue-bug-wi). One of the answer which...
2012/01/05
[ "https://softwareengineering.stackexchange.com/questions/128478", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/44268/" ]
If you are on a tight deadline and decide to rewrite the code, how do you know you wouldn't introduce more bugs than what you are trying to fix? And after you go through the rewrite, for all you know, the same bug might still be there. What if the root cause of the problem happens to be your understanding of some exter...
Changing the code in any way imposes a risk of introducing new bugs into the code. The bigger the changes, the bigger the risk. You can mitigate that risk via unit (and integration/system/...) testing (but can't ever eliminate it completely). Obviously, a total rewrite has a significantly higher risk than just fixing ...
128,478
I've read the article about fixing bug in this post [What process do you normally use when attempting to debug a problem/issue/bug with your software?](https://softwareengineering.stackexchange.com/questions/37242/what-process-do-you-normally-use-when-attempting-to-debug-a-problem-issue-bug-wi). One of the answer which...
2012/01/05
[ "https://softwareengineering.stackexchange.com/questions/128478", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/44268/" ]
If you are on a tight deadline and decide to rewrite the code, how do you know you wouldn't introduce more bugs than what you are trying to fix? And after you go through the rewrite, for all you know, the same bug might still be there. What if the root cause of the problem happens to be your understanding of some exter...
> > My question is, when will you think it is better to rewrite the code > rather than fix it? > > > I'm tempted to say "never". The problem is: Rewriting may seem easier, but experience tells that usually new code will have new bugs. So you'll probably replace one bug with several new ones. Furthermore, if you ...
128,478
I've read the article about fixing bug in this post [What process do you normally use when attempting to debug a problem/issue/bug with your software?](https://softwareengineering.stackexchange.com/questions/37242/what-process-do-you-normally-use-when-attempting-to-debug-a-problem-issue-bug-wi). One of the answer which...
2012/01/05
[ "https://softwareengineering.stackexchange.com/questions/128478", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/44268/" ]
Changing the code in any way imposes a risk of introducing new bugs into the code. The bigger the changes, the bigger the risk. You can mitigate that risk via unit (and integration/system/...) testing (but can't ever eliminate it completely). Obviously, a total rewrite has a significantly higher risk than just fixing ...
> > My question is, when will you think it is better to rewrite the code > rather than fix it? > > > I'm tempted to say "never". The problem is: Rewriting may seem easier, but experience tells that usually new code will have new bugs. So you'll probably replace one bug with several new ones. Furthermore, if you ...
2,493,643
I have added a code which will include child jsp using jsp:include. The problem i am facing is that the code present in child code is not executing. Below is the code iam using it now JSPF File: ``` <jsp:include page="X.jsp" flush="true"> </jsp:include> ``` the above code is present in a file named "A....
2010/03/22
[ "https://Stackoverflow.com/questions/2493643", "https://Stackoverflow.com", "https://Stackoverflow.com/users/290509/" ]
If you want the string to be displayed in the client's browser, you should use this instead : ``` <%@ page import="java.util.*" %> <% out.println("********Child JSP"); %> ``` System.out.println() will output the string in your webserver's console, whereas out.println() will use the JSP's implicit "out" object th...
Try this in your child jsp: ``` <%="********Child JSP"%> ``` Use <%=..%> less verbose tag to print on your jsp. Check [this](http://www.cheat-sheets.org/saved-copy/card20.pdf) card for quick reference.
2,493,643
I have added a code which will include child jsp using jsp:include. The problem i am facing is that the code present in child code is not executing. Below is the code iam using it now JSPF File: ``` <jsp:include page="X.jsp" flush="true"> </jsp:include> ``` the above code is present in a file named "A....
2010/03/22
[ "https://Stackoverflow.com/questions/2493643", "https://Stackoverflow.com", "https://Stackoverflow.com/users/290509/" ]
If you want the string to be displayed in the client's browser, you should use this instead : ``` <%@ page import="java.util.*" %> <% out.println("********Child JSP"); %> ``` System.out.println() will output the string in your webserver's console, whereas out.println() will use the JSP's implicit "out" object th...
If you're modifying the child JSP, modify the parent JSP once and save it. It may be as trivial as adding/removing a space. This results in the servlet getting built again. When you make changes in a static include, it does not reflect until the parent jsp is compiled again.
2,493,643
I have added a code which will include child jsp using jsp:include. The problem i am facing is that the code present in child code is not executing. Below is the code iam using it now JSPF File: ``` <jsp:include page="X.jsp" flush="true"> </jsp:include> ``` the above code is present in a file named "A....
2010/03/22
[ "https://Stackoverflow.com/questions/2493643", "https://Stackoverflow.com", "https://Stackoverflow.com/users/290509/" ]
If you want the string to be displayed in the client's browser, you should use this instead : ``` <%@ page import="java.util.*" %> <% out.println("********Child JSP"); %> ``` System.out.println() will output the string in your webserver's console, whereas out.println() will use the JSP's implicit "out" object th...
`<%@ page import="java.util.*" %> <% System.out.println("Child JSP"); %>` If you run the above example you will notice the output from the **"System.out.prinltn"** on the server log.By itself a scriplet does not generate HTML.Using a scriplet if we want to generate HTML,then we can use a variable called **"out"**.NO ...
67,226,699
I know it can be hidden with the following code. ``` SystemChrome.setEnabledSystemUIOverlays([SystemUiOverlay.top]); ``` But as soon as I tap on the screen, the bottom action bar appears again. How can I solve this? Thank you very much
2021/04/23
[ "https://Stackoverflow.com/questions/67226699", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15325867/" ]
You are asking to chosse between "0" and "0", as the second number is excluded. Try ```py choice = random.randrange(0,2) ``` See Randrange documentation : <https://docs.python.org/3/library/random.html>
`randrange(0, 1)` is returns always 0. If you want to choose 0 or 1, you can use `randrange(0, 2)` or `randint(0, 1)`
49,668
I made chocolate chip cookies and added too much brown sugar. The cookies are too sweet. I've used real butter and real chocolate chips. Does anyone have any ideas?
2014/11/10
[ "https://cooking.stackexchange.com/questions/49668", "https://cooking.stackexchange.com", "https://cooking.stackexchange.com/users/29209/" ]
You might be able to overcome the sweetness by adding a tart glaze to the cookies (lemon or lime), but I don't know how well that'll go with the chocolate chips. Another option would be to crush them up to make a yogurt parfait (made with plain, unsweetned yogurt). You might also consider some of the options mentioned...
There is nothing that you can do with your current batch of cookies (or eat with milk). You just have to follow the recipe correctly and not add sugar as expected!!! If after properly following the recipe, switch to another low(er) sugar recipe. Use any internet search for "low sugar cookies" (or something similar).
49,668
I made chocolate chip cookies and added too much brown sugar. The cookies are too sweet. I've used real butter and real chocolate chips. Does anyone have any ideas?
2014/11/10
[ "https://cooking.stackexchange.com/questions/49668", "https://cooking.stackexchange.com", "https://cooking.stackexchange.com/users/29209/" ]
I'd try "deepening" the chocolate flavour, thus reducing the percieved total sweetness: Make a simple ganache with 2 parts very dark chocolate and 1 part cream and use it to sandwich two cookies together. If you really want to go from mistake to fabulous, you could add some additional flavoring to the ganache, ei...
There is nothing that you can do with your current batch of cookies (or eat with milk). You just have to follow the recipe correctly and not add sugar as expected!!! If after properly following the recipe, switch to another low(er) sugar recipe. Use any internet search for "low sugar cookies" (or something similar).
49,668
I made chocolate chip cookies and added too much brown sugar. The cookies are too sweet. I've used real butter and real chocolate chips. Does anyone have any ideas?
2014/11/10
[ "https://cooking.stackexchange.com/questions/49668", "https://cooking.stackexchange.com", "https://cooking.stackexchange.com/users/29209/" ]
Try "frosting" the cookies with plain (unsweetened) peanut butter -- it will offset the sweetness and be delicious!
There is nothing that you can do with your current batch of cookies (or eat with milk). You just have to follow the recipe correctly and not add sugar as expected!!! If after properly following the recipe, switch to another low(er) sugar recipe. Use any internet search for "low sugar cookies" (or something similar).
49,668
I made chocolate chip cookies and added too much brown sugar. The cookies are too sweet. I've used real butter and real chocolate chips. Does anyone have any ideas?
2014/11/10
[ "https://cooking.stackexchange.com/questions/49668", "https://cooking.stackexchange.com", "https://cooking.stackexchange.com/users/29209/" ]
You might be able to overcome the sweetness by adding a tart glaze to the cookies (lemon or lime), but I don't know how well that'll go with the chocolate chips. Another option would be to crush them up to make a yogurt parfait (made with plain, unsweetned yogurt). You might also consider some of the options mentioned...
I'd try "deepening" the chocolate flavour, thus reducing the percieved total sweetness: Make a simple ganache with 2 parts very dark chocolate and 1 part cream and use it to sandwich two cookies together. If you really want to go from mistake to fabulous, you could add some additional flavoring to the ganache, ei...
49,668
I made chocolate chip cookies and added too much brown sugar. The cookies are too sweet. I've used real butter and real chocolate chips. Does anyone have any ideas?
2014/11/10
[ "https://cooking.stackexchange.com/questions/49668", "https://cooking.stackexchange.com", "https://cooking.stackexchange.com/users/29209/" ]
You might be able to overcome the sweetness by adding a tart glaze to the cookies (lemon or lime), but I don't know how well that'll go with the chocolate chips. Another option would be to crush them up to make a yogurt parfait (made with plain, unsweetned yogurt). You might also consider some of the options mentioned...
Try "frosting" the cookies with plain (unsweetened) peanut butter -- it will offset the sweetness and be delicious!
70,102,142
Encountered a problem in react. There area two input `Textfield` in the same row with labels (A, B) having an initial `null` value. Then how we can achieve this? * if the user inputs value in text field "A", the values of text field B should be automatically zero * and then vice versa
2021/11/24
[ "https://Stackoverflow.com/questions/70102142", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15548760/" ]
Try this: ``` result = sum(number**i for i in range(1, exponent + 1)) ``` Another way to achieve the same result: ``` result = 0 for i in range(1, exponent + 1): result += number ** i ``` By the way, this is the so called [*geometric series*](https://en.wikipedia.org/wiki/Geometric_series), and there is a mat...
I'm wondering if you are trying to print a string or the sum. I guess the latter. Then, I think you should define an 'accumulator': a variable that is initialized with value 0 and stores the sum. Like the following: ``` number = int(input('Enter number: ')) exponent = int(input('Enter grade of the number: ')) accum =...
70,102,142
Encountered a problem in react. There area two input `Textfield` in the same row with labels (A, B) having an initial `null` value. Then how we can achieve this? * if the user inputs value in text field "A", the values of text field B should be automatically zero * and then vice versa
2021/11/24
[ "https://Stackoverflow.com/questions/70102142", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15548760/" ]
Try this: ``` result = sum(number**i for i in range(1, exponent + 1)) ``` Another way to achieve the same result: ``` result = 0 for i in range(1, exponent + 1): result += number ** i ``` By the way, this is the so called [*geometric series*](https://en.wikipedia.org/wiki/Geometric_series), and there is a mat...
You have to define a starting point (0) and to sum the value at each step: ``` number = int(input('Enter number: ')) exponent = int(input('Enter grade of the number: ')) numbers = 0 for i in range(1, exponent + 1): numbers += number ** i print(numbers) ```
40,578,753
I need to write a method for a leap year. So the method has to be called printleap and checks to see if the number is a leap year or not. So the the java program will test the method by reading a list of year number and only displays the leap years. Here is what I have done: import java.util.Scanner; public class Ex1...
2016/11/13
[ "https://Stackoverflow.com/questions/40578753", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7107190/" ]
Your curly braces are all over the place and don't line up. This would be a fixed version with properly matched braces: ``` public static void printleap() { try (Scanner sc1=new Scanner(System.in)) { System.out.println("This programe calculates leap year."); System.out.print("Enter the year:");...
your condition is wrong... it must be ``` if((year % 400 == 0) || ((year % 4 == 0) && (year % 100 != 0))) ```
40,578,753
I need to write a method for a leap year. So the method has to be called printleap and checks to see if the number is a leap year or not. So the the java program will test the method by reading a list of year number and only displays the leap years. Here is what I have done: import java.util.Scanner; public class Ex1...
2016/11/13
[ "https://Stackoverflow.com/questions/40578753", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7107190/" ]
Your curly braces are all over the place and don't line up. This would be a fixed version with properly matched braces: ``` public static void printleap() { try (Scanner sc1=new Scanner(System.in)) { System.out.println("This programe calculates leap year."); System.out.print("Enter the year:");...
Your logic (uses `if` and `else if`) should be as follows: ``` if ( year%400 == 0) System.out.println(year+ " is leap year"); else if ( year%100 == 0) System.out.println(year+ " is NOT leap year"); else if ( year%4 == 0 ) System.out.println(year+ " is leap year"); else System.out.println(year+ "...
40,578,753
I need to write a method for a leap year. So the method has to be called printleap and checks to see if the number is a leap year or not. So the the java program will test the method by reading a list of year number and only displays the leap years. Here is what I have done: import java.util.Scanner; public class Ex1...
2016/11/13
[ "https://Stackoverflow.com/questions/40578753", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7107190/" ]
Your curly braces are all over the place and don't line up. This would be a fixed version with properly matched braces: ``` public static void printleap() { try (Scanner sc1=new Scanner(System.in)) { System.out.println("This programe calculates leap year."); System.out.print("Enter the year:");...
Using java.time =============== There's a [class for that](https://docs.oracle.com/javase/8/docs/api/java/time/Year.html). ``` Year.now() .isLeap() ``` Better to always specify your desired/expected time zone rather than rely implicitly on the JVM’s current default zone. ``` Year.now( ZoneId.of( "Europe/Paris"...
40,578,753
I need to write a method for a leap year. So the method has to be called printleap and checks to see if the number is a leap year or not. So the the java program will test the method by reading a list of year number and only displays the leap years. Here is what I have done: import java.util.Scanner; public class Ex1...
2016/11/13
[ "https://Stackoverflow.com/questions/40578753", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7107190/" ]
your condition is wrong... it must be ``` if((year % 400 == 0) || ((year % 4 == 0) && (year % 100 != 0))) ```
Using java.time =============== There's a [class for that](https://docs.oracle.com/javase/8/docs/api/java/time/Year.html). ``` Year.now() .isLeap() ``` Better to always specify your desired/expected time zone rather than rely implicitly on the JVM’s current default zone. ``` Year.now( ZoneId.of( "Europe/Paris"...
40,578,753
I need to write a method for a leap year. So the method has to be called printleap and checks to see if the number is a leap year or not. So the the java program will test the method by reading a list of year number and only displays the leap years. Here is what I have done: import java.util.Scanner; public class Ex1...
2016/11/13
[ "https://Stackoverflow.com/questions/40578753", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7107190/" ]
Your logic (uses `if` and `else if`) should be as follows: ``` if ( year%400 == 0) System.out.println(year+ " is leap year"); else if ( year%100 == 0) System.out.println(year+ " is NOT leap year"); else if ( year%4 == 0 ) System.out.println(year+ " is leap year"); else System.out.println(year+ "...
Using java.time =============== There's a [class for that](https://docs.oracle.com/javase/8/docs/api/java/time/Year.html). ``` Year.now() .isLeap() ``` Better to always specify your desired/expected time zone rather than rely implicitly on the JVM’s current default zone. ``` Year.now( ZoneId.of( "Europe/Paris"...
37,594,023
With the java.time API it is possible to compare *two* dates using the following syntax: ``` date1.before(date2); ``` or ``` date2.after(date1); ``` This however becomes very verbose when comparing 3 or more dates. Is there a way of comparing a Date with multiple others, to see if the one provided is before/after...
2016/06/02
[ "https://Stackoverflow.com/questions/37594023", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2328039/" ]
All you're trying to do here is to compare the date to just *one* of your "3 or more" dates: you just have to work out which one that is, and then compare two dates. Since `Date` implements `Comparable<Date>`, you can use `Collections.min` and `Collections.max` to find the earliest and latest of them: ``` Date earlie...
How about if you put all in a collection, maybe it helps: Collections.max(dates); Collections.min(dates);
37,594,023
With the java.time API it is possible to compare *two* dates using the following syntax: ``` date1.before(date2); ``` or ``` date2.after(date1); ``` This however becomes very verbose when comparing 3 or more dates. Is there a way of comparing a Date with multiple others, to see if the one provided is before/after...
2016/06/02
[ "https://Stackoverflow.com/questions/37594023", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2328039/" ]
All you're trying to do here is to compare the date to just *one* of your "3 or more" dates: you just have to work out which one that is, and then compare two dates. Since `Date` implements `Comparable<Date>`, you can use `Collections.min` and `Collections.max` to find the earliest and latest of them: ``` Date earlie...
Since this question is about `Java 8`, here’s a “Java 8ish” solution: ``` boolean beforeEarliest = Stream.of(date1, date2, date3).allMatch(date::isBefore); boolean afterLatest = !beforeEarliest && Stream.of(date1, date2, date3).allMatch(date::isAfter); ``` This is not only a “Java 8 style...
37,594,023
With the java.time API it is possible to compare *two* dates using the following syntax: ``` date1.before(date2); ``` or ``` date2.after(date1); ``` This however becomes very verbose when comparing 3 or more dates. Is there a way of comparing a Date with multiple others, to see if the one provided is before/after...
2016/06/02
[ "https://Stackoverflow.com/questions/37594023", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2328039/" ]
Since this question is about `Java 8`, here’s a “Java 8ish” solution: ``` boolean beforeEarliest = Stream.of(date1, date2, date3).allMatch(date::isBefore); boolean afterLatest = !beforeEarliest && Stream.of(date1, date2, date3).allMatch(date::isAfter); ``` This is not only a “Java 8 style...
How about if you put all in a collection, maybe it helps: Collections.max(dates); Collections.min(dates);
20,155,215
I've been struggling to figure a way to make a styled `input type="file"` and I finally got it. But then I ran into another problem which is IE8 multiple file support. So I figured I could put an add field button. However, I ran into another problem once again. The file would display on the first field but the second o...
2013/11/22
[ "https://Stackoverflow.com/questions/20155215", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2435481/" ]
If you're using the latest and greatest `python` (>= 3.3), there's the [`yield from`](http://www.python.org/dev/peps/pep-0380/) construct. ``` yield from funB() ``` It does exactly what you want: you can invoke a function as a sub-generator, and yield back everything it yields to you. If you're using an earlier ver...
`itertools.chain` is the function you're looking for ``` import itertools def funA(): for x in range(10): yield x def funB(): for x in range(10,20): yield x def funC(): for x in range(20,30): yield x def funs(): for x in itertools.chain(funA(), funB(), funC()): yield...
17,474,299
I'm trying to do some deploy on my webb app project with Play! and Nginx. I followed the guide on Play! web site but it dosen't work. Sombody get to make it works? Wich are the differences? PS: My web app work, if I it localhost:9000 I get the page and if I hit only localhost I get the welcome message from Nginx, but...
2013/07/04
[ "https://Stackoverflow.com/questions/17474299", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2043278/" ]
The problem is that you have changed the default port to 9000. Only using `localhost/projectname` is going through port 80. In order to do it that way you should change your default port to port 80.
Here is my nginx configuration: ``` upstream play_app { server 0.0.0.0:9000; } server { listen 7000; location / { proxy_pass http://play_app; } } ``` And then you just need to visit your website via: IP:7000
17,474,299
I'm trying to do some deploy on my webb app project with Play! and Nginx. I followed the guide on Play! web site but it dosen't work. Sombody get to make it works? Wich are the differences? PS: My web app work, if I it localhost:9000 I get the page and if I hit only localhost I get the welcome message from Nginx, but...
2013/07/04
[ "https://Stackoverflow.com/questions/17474299", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2043278/" ]
I'd say you only need to do a proxy pass in nginx, replace the `example.com` with your website name. ``` server { server_name example.com; proxy_pass http://localhost:9000; } ``` if you don't want to create a separate server block, you can use a location block ``` location /webapp { proxy_pass http://lo...
Here is my nginx configuration: ``` upstream play_app { server 0.0.0.0:9000; } server { listen 7000; location / { proxy_pass http://play_app; } } ``` And then you just need to visit your website via: IP:7000
16,169,787
I want to add two edit text fields in an alert dialog box. As simple as the solution sounds I have not been able to gather a working one as of yet. I am not able to set the two (edit text) views simultaneously. Please comment in case you want to see any further code. ``` alertDialog.setTitle("Values"...
2013/04/23
[ "https://Stackoverflow.com/questions/16169787", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2006197/" ]
You should create a vertical LinearLayout on which you can add your EditTexts. Then use alertDialog.setView() with the LinearLayout. Look here for mor infos: [How to implement a custom AlertDialog View](https://stackoverflow.com/questions/2795300/how-to-implement-a-custom-alertdialog-view) or here [How to add two edit...
Why don't you make a entirely custom layout for it? Here is a custom pop up i use for showing a list of categorys and letting the user pick one. ``` public class CategoryPickerFragment extends DialogFragment implements OnItemClickListener{ private CategoryReceiver receiver; @Override public Dialog onCreateDialog(Bund...
16,169,787
I want to add two edit text fields in an alert dialog box. As simple as the solution sounds I have not been able to gather a working one as of yet. I am not able to set the two (edit text) views simultaneously. Please comment in case you want to see any further code. ``` alertDialog.setTitle("Values"...
2013/04/23
[ "https://Stackoverflow.com/questions/16169787", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2006197/" ]
See [Creating a Custom Layout](http://developer.android.com/guide/topics/ui/dialogs.html#CustomLayout) in android. ![enter image description here](https://i.stack.imgur.com/bB4WZ.png) **EDIT** ``` alertDialog.setTitle("Values"); final EditText quantity = new EditText(SecondScan.this); final EditText lot = new EditTe...
You should create a vertical LinearLayout on which you can add your EditTexts. Then use alertDialog.setView() with the LinearLayout. Look here for mor infos: [How to implement a custom AlertDialog View](https://stackoverflow.com/questions/2795300/how-to-implement-a-custom-alertdialog-view) or here [How to add two edit...
16,169,787
I want to add two edit text fields in an alert dialog box. As simple as the solution sounds I have not been able to gather a working one as of yet. I am not able to set the two (edit text) views simultaneously. Please comment in case you want to see any further code. ``` alertDialog.setTitle("Values"...
2013/04/23
[ "https://Stackoverflow.com/questions/16169787", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2006197/" ]
I used LinearLayout for a login pop-up: ``` public final String POPUP_LOGIN_TITLE="Sign In"; public final String POPUP_LOGIN_TEXT="Please fill in your credentials"; public final String EMAIL_HINT="--Email--"; public final String PASSWORD_HINT="--Password--"; AlertDialog.Builder alert = new AlertDialog.Builder(this); ...
You should create a vertical LinearLayout on which you can add your EditTexts. Then use alertDialog.setView() with the LinearLayout. Look here for mor infos: [How to implement a custom AlertDialog View](https://stackoverflow.com/questions/2795300/how-to-implement-a-custom-alertdialog-view) or here [How to add two edit...
16,169,787
I want to add two edit text fields in an alert dialog box. As simple as the solution sounds I have not been able to gather a working one as of yet. I am not able to set the two (edit text) views simultaneously. Please comment in case you want to see any further code. ``` alertDialog.setTitle("Values"...
2013/04/23
[ "https://Stackoverflow.com/questions/16169787", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2006197/" ]
See [Creating a Custom Layout](http://developer.android.com/guide/topics/ui/dialogs.html#CustomLayout) in android. ![enter image description here](https://i.stack.imgur.com/bB4WZ.png) **EDIT** ``` alertDialog.setTitle("Values"); final EditText quantity = new EditText(SecondScan.this); final EditText lot = new EditTe...
Why don't you make a entirely custom layout for it? Here is a custom pop up i use for showing a list of categorys and letting the user pick one. ``` public class CategoryPickerFragment extends DialogFragment implements OnItemClickListener{ private CategoryReceiver receiver; @Override public Dialog onCreateDialog(Bund...
16,169,787
I want to add two edit text fields in an alert dialog box. As simple as the solution sounds I have not been able to gather a working one as of yet. I am not able to set the two (edit text) views simultaneously. Please comment in case you want to see any further code. ``` alertDialog.setTitle("Values"...
2013/04/23
[ "https://Stackoverflow.com/questions/16169787", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2006197/" ]
I used LinearLayout for a login pop-up: ``` public final String POPUP_LOGIN_TITLE="Sign In"; public final String POPUP_LOGIN_TEXT="Please fill in your credentials"; public final String EMAIL_HINT="--Email--"; public final String PASSWORD_HINT="--Password--"; AlertDialog.Builder alert = new AlertDialog.Builder(this); ...
Why don't you make a entirely custom layout for it? Here is a custom pop up i use for showing a list of categorys and letting the user pick one. ``` public class CategoryPickerFragment extends DialogFragment implements OnItemClickListener{ private CategoryReceiver receiver; @Override public Dialog onCreateDialog(Bund...
16,169,787
I want to add two edit text fields in an alert dialog box. As simple as the solution sounds I have not been able to gather a working one as of yet. I am not able to set the two (edit text) views simultaneously. Please comment in case you want to see any further code. ``` alertDialog.setTitle("Values"...
2013/04/23
[ "https://Stackoverflow.com/questions/16169787", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2006197/" ]
See [Creating a Custom Layout](http://developer.android.com/guide/topics/ui/dialogs.html#CustomLayout) in android. ![enter image description here](https://i.stack.imgur.com/bB4WZ.png) **EDIT** ``` alertDialog.setTitle("Values"); final EditText quantity = new EditText(SecondScan.this); final EditText lot = new EditTe...
I used LinearLayout for a login pop-up: ``` public final String POPUP_LOGIN_TITLE="Sign In"; public final String POPUP_LOGIN_TEXT="Please fill in your credentials"; public final String EMAIL_HINT="--Email--"; public final String PASSWORD_HINT="--Password--"; AlertDialog.Builder alert = new AlertDialog.Builder(this); ...
5,474,163
While using reflection in C#, you're expected to pass an object[] of the parameters that are cast later on, I have a gui that lets the user input the parameters values in. I know what type of input they are expected to input, int, string, float, instance of custom object, etc... In the case of the argument being an arr...
2011/03/29
[ "https://Stackoverflow.com/questions/5474163", "https://Stackoverflow.com", "https://Stackoverflow.com/users/682251/" ]
Are you looking for [`Array.CreateInstance`](http://msdn.microsoft.com/en-us/library/system.array.createinstance.aspx)? That's useful if you only know the type *dynamically*. If you know it statically but within a generic method, you can just use `new T[10]` or whatever the type parameter name is.
This does not answer the question but I felt it might be an advice worth mentioning. If it is a method which can be called by passing an array of `int` as well as array of `object` it seems that you are implementing a type-free behaviour which can be expressed by generics. I suggest to change it to a generic method u...
49,084,955
I am trying to solve a problem where I want to find the max product of any 3 integers in an array. I tried my solution: ``` def maximumProduct(nums): """ :type nums: List[int] :rtype: int """ list_of_ints = nums t = sorted(list_of_ints[:4]) max_pos = t[2] max_pos_2 = t[1] max_p...
2018/03/03
[ "https://Stackoverflow.com/questions/49084955", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9151730/" ]
You can initialize to negative infinity: `min_neg = float('-inf')`
Try this: ``` arr = sorted(list_of_ints) def getMax(t): maxP = t[0] * t[1] * t[2] i = 0 while t[i] > -1: i += 1 maxN = t[i] * t[i + 1] * t[0] return max(maxP, maxN) print(getMax(arr)) ```
49,084,955
I am trying to solve a problem where I want to find the max product of any 3 integers in an array. I tried my solution: ``` def maximumProduct(nums): """ :type nums: List[int] :rtype: int """ list_of_ints = nums t = sorted(list_of_ints[:4]) max_pos = t[2] max_pos_2 = t[1] max_p...
2018/03/03
[ "https://Stackoverflow.com/questions/49084955", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9151730/" ]
You can initialize to negative infinity: `min_neg = float('-inf')`
You can use `itertools.combinations` to make doing it very easy. What you're calling an "array" is referred to as a "list" in Python, by-the-way. ``` from itertools import combinations def maximum_product(nums): return max(trio[0] * trio[1] * trio[2] for trio in combinations(nums, 3)) nums = [-1, -2, -3, 9] prin...
49,084,955
I am trying to solve a problem where I want to find the max product of any 3 integers in an array. I tried my solution: ``` def maximumProduct(nums): """ :type nums: List[int] :rtype: int """ list_of_ints = nums t = sorted(list_of_ints[:4]) max_pos = t[2] max_pos_2 = t[1] max_p...
2018/03/03
[ "https://Stackoverflow.com/questions/49084955", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9151730/" ]
Approach ======== To solve this kind of exercise efficiently, you need to recognize that there are only a few possible cases. Focus on the signs of the numbers and think what would be the sign of the result: ``` + * + * + = + (good) + * + * - = - (bad) + * - * - = + (good) - * - * - = - (bad) anything * 0 = 0 (ne...
You can initialize to negative infinity: `min_neg = float('-inf')`
49,084,955
I am trying to solve a problem where I want to find the max product of any 3 integers in an array. I tried my solution: ``` def maximumProduct(nums): """ :type nums: List[int] :rtype: int """ list_of_ints = nums t = sorted(list_of_ints[:4]) max_pos = t[2] max_pos_2 = t[1] max_p...
2018/03/03
[ "https://Stackoverflow.com/questions/49084955", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9151730/" ]
You can initialize to negative infinity: `min_neg = float('-inf')`
I tried kfx's O(n) solution but it was not taking into account possible negative ints for me. I added a few lines to adjust for that, and also two more possible combinations and it worked. Correct me if I am wrong but I think this is still O(n) notation right? ``` def maximum_product(nums): max3 = heapq.nlargest(...
49,084,955
I am trying to solve a problem where I want to find the max product of any 3 integers in an array. I tried my solution: ``` def maximumProduct(nums): """ :type nums: List[int] :rtype: int """ list_of_ints = nums t = sorted(list_of_ints[:4]) max_pos = t[2] max_pos_2 = t[1] max_p...
2018/03/03
[ "https://Stackoverflow.com/questions/49084955", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9151730/" ]
You can use `itertools.combinations` to make doing it very easy. What you're calling an "array" is referred to as a "list" in Python, by-the-way. ``` from itertools import combinations def maximum_product(nums): return max(trio[0] * trio[1] * trio[2] for trio in combinations(nums, 3)) nums = [-1, -2, -3, 9] prin...
Try this: ``` arr = sorted(list_of_ints) def getMax(t): maxP = t[0] * t[1] * t[2] i = 0 while t[i] > -1: i += 1 maxN = t[i] * t[i + 1] * t[0] return max(maxP, maxN) print(getMax(arr)) ```
49,084,955
I am trying to solve a problem where I want to find the max product of any 3 integers in an array. I tried my solution: ``` def maximumProduct(nums): """ :type nums: List[int] :rtype: int """ list_of_ints = nums t = sorted(list_of_ints[:4]) max_pos = t[2] max_pos_2 = t[1] max_p...
2018/03/03
[ "https://Stackoverflow.com/questions/49084955", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9151730/" ]
Approach ======== To solve this kind of exercise efficiently, you need to recognize that there are only a few possible cases. Focus on the signs of the numbers and think what would be the sign of the result: ``` + * + * + = + (good) + * + * - = - (bad) + * - * - = + (good) - * - * - = - (bad) anything * 0 = 0 (ne...
Try this: ``` arr = sorted(list_of_ints) def getMax(t): maxP = t[0] * t[1] * t[2] i = 0 while t[i] > -1: i += 1 maxN = t[i] * t[i + 1] * t[0] return max(maxP, maxN) print(getMax(arr)) ```
49,084,955
I am trying to solve a problem where I want to find the max product of any 3 integers in an array. I tried my solution: ``` def maximumProduct(nums): """ :type nums: List[int] :rtype: int """ list_of_ints = nums t = sorted(list_of_ints[:4]) max_pos = t[2] max_pos_2 = t[1] max_p...
2018/03/03
[ "https://Stackoverflow.com/questions/49084955", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9151730/" ]
Approach ======== To solve this kind of exercise efficiently, you need to recognize that there are only a few possible cases. Focus on the signs of the numbers and think what would be the sign of the result: ``` + * + * + = + (good) + * + * - = - (bad) + * - * - = + (good) - * - * - = - (bad) anything * 0 = 0 (ne...
You can use `itertools.combinations` to make doing it very easy. What you're calling an "array" is referred to as a "list" in Python, by-the-way. ``` from itertools import combinations def maximum_product(nums): return max(trio[0] * trio[1] * trio[2] for trio in combinations(nums, 3)) nums = [-1, -2, -3, 9] prin...
49,084,955
I am trying to solve a problem where I want to find the max product of any 3 integers in an array. I tried my solution: ``` def maximumProduct(nums): """ :type nums: List[int] :rtype: int """ list_of_ints = nums t = sorted(list_of_ints[:4]) max_pos = t[2] max_pos_2 = t[1] max_p...
2018/03/03
[ "https://Stackoverflow.com/questions/49084955", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9151730/" ]
You can use `itertools.combinations` to make doing it very easy. What you're calling an "array" is referred to as a "list" in Python, by-the-way. ``` from itertools import combinations def maximum_product(nums): return max(trio[0] * trio[1] * trio[2] for trio in combinations(nums, 3)) nums = [-1, -2, -3, 9] prin...
I tried kfx's O(n) solution but it was not taking into account possible negative ints for me. I added a few lines to adjust for that, and also two more possible combinations and it worked. Correct me if I am wrong but I think this is still O(n) notation right? ``` def maximum_product(nums): max3 = heapq.nlargest(...
49,084,955
I am trying to solve a problem where I want to find the max product of any 3 integers in an array. I tried my solution: ``` def maximumProduct(nums): """ :type nums: List[int] :rtype: int """ list_of_ints = nums t = sorted(list_of_ints[:4]) max_pos = t[2] max_pos_2 = t[1] max_p...
2018/03/03
[ "https://Stackoverflow.com/questions/49084955", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9151730/" ]
Approach ======== To solve this kind of exercise efficiently, you need to recognize that there are only a few possible cases. Focus on the signs of the numbers and think what would be the sign of the result: ``` + * + * + = + (good) + * + * - = - (bad) + * - * - = + (good) - * - * - = - (bad) anything * 0 = 0 (ne...
I tried kfx's O(n) solution but it was not taking into account possible negative ints for me. I added a few lines to adjust for that, and also two more possible combinations and it worked. Correct me if I am wrong but I think this is still O(n) notation right? ``` def maximum_product(nums): max3 = heapq.nlargest(...
17,771,344
In the constructor of my controller I checking whether there is a cookie, but i have a System.NullReferenceException, what is wrong? ``` public CartController() { if (Request.Cookies["cart"] != null) { //do something } } ```
2013/07/21
[ "https://Stackoverflow.com/questions/17771344", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2603956/" ]
My guess is that the `Request` object isn't properly initialized at that point in the life cycle of the controller. This code probably shouldn't go in the *constructor* of your controller. Rather try placing it in an action: ``` public ActionResult Index() { if (Request.Cookies["cart"] != null) { //do ...
If you use an Action Filter rather than place your code in the constructor, that might help you avoid repetition in your code. Add an attribute that derives from `ActionFilterAttribute` to your controller: ``` [MyActionFilter] public CartController() { } ``` This filter then intercepts every action. ``` public cl...
66,063,828
First of all, it might look duplicate to other post on stackoverflow, and I tried couple of solutions. But, none solving my issue. **Issue :** Springboot test getting failed due to UnsatisfiedDependencyException during jenkins build. But, interestingly, on local system I don't see same exception and I'm able to build...
2021/02/05
[ "https://Stackoverflow.com/questions/66063828", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10471045/" ]
One way would be to `pop` the values. ``` x = seen_once.pop() y = seen_twice.pop() return x * x * y ```
You have a bug in your code, this is a working piece: ``` def Missing_Values(arr): seen_once = set() seen_twice = set() seen_thrice = set() for i in arr: if i not in seen_once and i not in seen_twice and i not in seen_thrice: # Note this line! seen_once.add(i) elif i in se...
66,063,828
First of all, it might look duplicate to other post on stackoverflow, and I tried couple of solutions. But, none solving my issue. **Issue :** Springboot test getting failed due to UnsatisfiedDependencyException during jenkins build. But, interestingly, on local system I don't see same exception and I'm able to build...
2021/02/05
[ "https://Stackoverflow.com/questions/66063828", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10471045/" ]
One way would be to `pop` the values. ``` x = seen_once.pop() y = seen_twice.pop() return x * x * y ```
You can use `counter` from `collections` for better **performance** that also improves **readability**. Following is the code: ```py from collections import Counter arr = [1, 1, 1, 2, 2, 2, 3, 3, 4] d = Counter(arr) ans = 1 for x, cnt in d.items(): if cnt == 2: ans *= x elif cnt == 1: ans *=...
66,063,828
First of all, it might look duplicate to other post on stackoverflow, and I tried couple of solutions. But, none solving my issue. **Issue :** Springboot test getting failed due to UnsatisfiedDependencyException during jenkins build. But, interestingly, on local system I don't see same exception and I'm able to build...
2021/02/05
[ "https://Stackoverflow.com/questions/66063828", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10471045/" ]
You can use `counter` from `collections` for better **performance** that also improves **readability**. Following is the code: ```py from collections import Counter arr = [1, 1, 1, 2, 2, 2, 3, 3, 4] d = Counter(arr) ans = 1 for x, cnt in d.items(): if cnt == 2: ans *= x elif cnt == 1: ans *=...
You have a bug in your code, this is a working piece: ``` def Missing_Values(arr): seen_once = set() seen_twice = set() seen_thrice = set() for i in arr: if i not in seen_once and i not in seen_twice and i not in seen_thrice: # Note this line! seen_once.add(i) elif i in se...
371,473
I tried everything I think but still getting bad request 400 Ajax WordPress. I have try applying serialize and answers found in other thread but still getting 400 bad error. **Custom Page Template index.php** ``` add_action( 'wp_enqueue_scripts', 'myblog_ajax_enqueue' ); function myblog_ajax_enqueue() { wp_enqueue_...
2020/07/21
[ "https://wordpress.stackexchange.com/questions/371473", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/44422/" ]
Here is your problem: > > blogcontent.php > > > When WP is contacted to handle the Admin AJAX request, it doesn't load a page template. Remember, every request to WP loads WP from a blank slate. It doesn't know anything about the previous requests, only what it's told. So because you aren't requesting that page,...
1. Send is as object, not a JSON string 2. Remove content type, you should let is default ( `application/x-www-form-urlencoded`) 3. Remove dataType - you send response as text, not a json. ( for JSON response use `wp_send_json` ) 4. Ensure that you register you ajax actions in init files ( your plugin main file or func...
371,473
I tried everything I think but still getting bad request 400 Ajax WordPress. I have try applying serialize and answers found in other thread but still getting 400 bad error. **Custom Page Template index.php** ``` add_action( 'wp_enqueue_scripts', 'myblog_ajax_enqueue' ); function myblog_ajax_enqueue() { wp_enqueue_...
2020/07/21
[ "https://wordpress.stackexchange.com/questions/371473", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/44422/" ]
There's only one reason you get a 400 error with admin-ajax.php: The `wp_ajax_{$action}` or `wp_ajax_nopriv_{$action}` action has not been hooked with an `{$action}` that matches the `action` data parameter sent with your request. So either your callback is not hooked, or you're not sending the action correctly. Your c...
1. Send is as object, not a JSON string 2. Remove content type, you should let is default ( `application/x-www-form-urlencoded`) 3. Remove dataType - you send response as text, not a json. ( for JSON response use `wp_send_json` ) 4. Ensure that you register you ajax actions in init files ( your plugin main file or func...
257,855
I made a randomly chosen quiz machine using `LuaLaTeX` and `beamer` for audience part that produce a `pdf` containning one frame per question, one slide per second to show the count down: it make a `pdf` with multiple redundant pages. I'd like to produce in parallel a digest form of this quiz, in article A4 format, wi...
2015/07/30
[ "https://tex.stackexchange.com/questions/257855", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/45209/" ]
Lua has an `io` library that seems to work with LuaLaTeX. I don't really know what the recommended usage is though. ``` % !TeX program = lualatex \documentclass{article} \begin{document} Foo. \directlua{ out = io.open('somefile.tex','a') out:write('Hello world. ') out:write('This is different') io.close(out) } \inpu...
It's possible to use the standard `TeX` file handle routines such as `\newwrite` and `\newread` and `\openout` etc., letting `LuaLaTeX` write the code to the file as if should be written 'to' the current file (well, the TeX input processing assembly line ;-)) ``` \documentclass{article} \usepackage{luacode} \newwrite...
257,855
I made a randomly chosen quiz machine using `LuaLaTeX` and `beamer` for audience part that produce a `pdf` containning one frame per question, one slide per second to show the count down: it make a `pdf` with multiple redundant pages. I'd like to produce in parallel a digest form of this quiz, in article A4 format, wi...
2015/07/30
[ "https://tex.stackexchange.com/questions/257855", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/45209/" ]
Lua has an `io` library that seems to work with LuaLaTeX. I don't really know what the recommended usage is though. ``` % !TeX program = lualatex \documentclass{article} \begin{document} Foo. \directlua{ out = io.open('somefile.tex','a') out:write('Hello world. ') out:write('This is different') io.close(out) } \inpu...
Only the backslash needs to be escaped: ``` \documentclass{article} \usepackage{fancyvrb} \usepackage{luacode} \begin{luacode} function OpenFile(mode,name) out=io.open(name,mode) return end function CloseFile() io.close(out) return end \end{luacode} \newcommand\OpenFile[2][a]{\luaexec{OpenFile('#1','#2')}} ...
14,801,645
I have Windows, Linux and FreeBSD on my computer. But accidentally i "forgot" to allocate 17 gb of free disk space on the end of the disk(and "bad" Windows is using a little primary restore partition. Thus i have 4 primary partitions now). Can i resize my FreeBSD partition, to capture free space? There is my disk parti...
2013/02/10
[ "https://Stackoverflow.com/questions/14801645", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1063854/" ]
Have a look at gpart's `resize` command. That should enable you to grow the partition. You can then grow the UFS filesystem in the partition with growfs(8). Do make a backup of your filesystem before trying this!
growfs(8) works well for the UFS case. If you are using ZFS, you will want to `zpool online -e` the zpool after expanding the partition (slice).
2,816,914
We have an WPF Application build on .net framework 3.5. Some testers find if they uninstall .net framework 3.5, but install .net framework 4.0, our APP fails to launch itself. Dose this mean that .net framework 4.0 does not include all 3.5 libs, and users have to install .net 3.5 even though they have 4.0? I see her...
2010/05/12
[ "https://Stackoverflow.com/questions/2816914", "https://Stackoverflow.com", "https://Stackoverflow.com/users/339033/" ]
.Net 3.5/2.0 Applications do ***not*** automatically run on the .Net 4.0 runtime. You have to specify explicitly for your application that it should run on .Net 4.0 in your App.config by adding: ``` <configuration> <startup> <supportedRuntime version="v4.0" /> </startup> </configuration> ``` In case you hav...
the different version run side by side, so yes they need to install 3.5 even if they have already installed 4.0. But they will not interfere with each other, so your program will continue to use 3.5 unless you recompile it to target 4.0 (or configure it to use 4.0 - see edit below). As was pointed out in [this questio...
2,816,914
We have an WPF Application build on .net framework 3.5. Some testers find if they uninstall .net framework 3.5, but install .net framework 4.0, our APP fails to launch itself. Dose this mean that .net framework 4.0 does not include all 3.5 libs, and users have to install .net 3.5 even though they have 4.0? I see her...
2010/05/12
[ "https://Stackoverflow.com/questions/2816914", "https://Stackoverflow.com", "https://Stackoverflow.com/users/339033/" ]
.Net 3.5/2.0 Applications do ***not*** automatically run on the .Net 4.0 runtime. You have to specify explicitly for your application that it should run on .Net 4.0 in your App.config by adding: ``` <configuration> <startup> <supportedRuntime version="v4.0" /> </startup> </configuration> ``` In case you hav...
Thank you all, and thank you Foxfire, your method works. And there is one tricky thing that I would like to share is the order of nodes. When I set it like this below, it works both for 3.5 and 4.0. ``` <startup> <supportedRuntime version="v4.0" /> <supportedRuntime version="v2.0.50727"/> </startup> ``` An...
8,928,713
I am working on project. In my System when I run the project it is running nicely, but after uploading it to my domain when I check, then it displays the error like: "Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification...
2012/01/19
[ "https://Stackoverflow.com/questions/8928713", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1156368/" ]
You can't show dialog box **ON SERVER** from ASP.NET application, well of course tehnically you can do that but it makes no sense since your user is using browser and it can't see messages raised on server. You have to understand how web sites work, server side code (ASP.NET in your case) produces html, javascript etc ...
For Vb.Net Framework 4.0, U can use: ``` Alert("your message here", Boolean) ``` The Boolean here can be True or False. True If you want to close the window right after, False If you want to keep the window open.
8,928,713
I am working on project. In my System when I run the project it is running nicely, but after uploading it to my domain when I check, then it displays the error like: "Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification...
2012/01/19
[ "https://Stackoverflow.com/questions/8928713", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1156368/" ]
You 100% can do this on the server side... ``` Protected Sub Button3_Click(sender As Object, e As System.EventArgs) MesgBox("Test") End Sub Private Sub MesgBox(ByVal sMessage As String) Dim msg As String msg = "<script language='javascript'>" msg += "alert('" & sMessage & "');" msg += "</scri...
For Vb.Net Framework 4.0, U can use: ``` Alert("your message here", Boolean) ``` The Boolean here can be True or False. True If you want to close the window right after, False If you want to keep the window open.
8,928,713
I am working on project. In my System when I run the project it is running nicely, but after uploading it to my domain when I check, then it displays the error like: "Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification...
2012/01/19
[ "https://Stackoverflow.com/questions/8928713", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1156368/" ]
This error can be resolved by adding [`MessageBoxOptions.ServiceNotification`](http://msdn.microsoft.com/en-us/library/system.windows.forms.messageboxoptions(v=vs.80).aspx). ``` MessageBox.Show(msg, "Print Error", System.Windows.Forms.MessageBoxButtons.YesNo, System.Windows.Forms.MessageBoxIcon.Error, Syst...
For Vb.Net Framework 4.0, U can use: ``` Alert("your message here", Boolean) ``` The Boolean here can be True or False. True If you want to close the window right after, False If you want to keep the window open.
8,928,713
I am working on project. In my System when I run the project it is running nicely, but after uploading it to my domain when I check, then it displays the error like: "Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification...
2012/01/19
[ "https://Stackoverflow.com/questions/8928713", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1156368/" ]
You can't show dialog box **ON SERVER** from ASP.NET application, well of course tehnically you can do that but it makes no sense since your user is using browser and it can't see messages raised on server. You have to understand how web sites work, server side code (ASP.NET in your case) produces html, javascript etc ...
This can also be caused if your code returns an additional pop-up or messagebox fail message that the window can't handle properly.
8,928,713
I am working on project. In my System when I run the project it is running nicely, but after uploading it to my domain when I check, then it displays the error like: "Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification...
2012/01/19
[ "https://Stackoverflow.com/questions/8928713", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1156368/" ]
You also encounter this if you run an Application on a Scheduled Task in Non-Interactive mode. As soon as you show a Dialog it throws the error: > > Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDeskt...
For Vb.Net Framework 4.0, U can use: ``` Alert("your message here", Boolean) ``` The Boolean here can be True or False. True If you want to close the window right after, False If you want to keep the window open.
8,928,713
I am working on project. In my System when I run the project it is running nicely, but after uploading it to my domain when I check, then it displays the error like: "Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification...
2012/01/19
[ "https://Stackoverflow.com/questions/8928713", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1156368/" ]
This error can be resolved by adding [`MessageBoxOptions.ServiceNotification`](http://msdn.microsoft.com/en-us/library/system.windows.forms.messageboxoptions(v=vs.80).aspx). ``` MessageBox.Show(msg, "Print Error", System.Windows.Forms.MessageBoxButtons.YesNo, System.Windows.Forms.MessageBoxIcon.Error, Syst...
This can also be caused if your code returns an additional pop-up or messagebox fail message that the window can't handle properly.
8,928,713
I am working on project. In my System when I run the project it is running nicely, but after uploading it to my domain when I check, then it displays the error like: "Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification...
2012/01/19
[ "https://Stackoverflow.com/questions/8928713", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1156368/" ]
You can't show dialog box **ON SERVER** from ASP.NET application, well of course tehnically you can do that but it makes no sense since your user is using browser and it can't see messages raised on server. You have to understand how web sites work, server side code (ASP.NET in your case) produces html, javascript etc ...
You also encounter this if you run an Application on a Scheduled Task in Non-Interactive mode. As soon as you show a Dialog it throws the error: > > Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDeskt...
8,928,713
I am working on project. In my System when I run the project it is running nicely, but after uploading it to my domain when I check, then it displays the error like: "Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification...
2012/01/19
[ "https://Stackoverflow.com/questions/8928713", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1156368/" ]
This error can be resolved by adding [`MessageBoxOptions.ServiceNotification`](http://msdn.microsoft.com/en-us/library/system.windows.forms.messageboxoptions(v=vs.80).aspx). ``` MessageBox.Show(msg, "Print Error", System.Windows.Forms.MessageBoxButtons.YesNo, System.Windows.Forms.MessageBoxIcon.Error, Syst...
You also encounter this if you run an Application on a Scheduled Task in Non-Interactive mode. As soon as you show a Dialog it throws the error: > > Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDeskt...
8,928,713
I am working on project. In my System when I run the project it is running nicely, but after uploading it to my domain when I check, then it displays the error like: "Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification...
2012/01/19
[ "https://Stackoverflow.com/questions/8928713", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1156368/" ]
You 100% can do this on the server side... ``` Protected Sub Button3_Click(sender As Object, e As System.EventArgs) MesgBox("Test") End Sub Private Sub MesgBox(ByVal sMessage As String) Dim msg As String msg = "<script language='javascript'>" msg += "alert('" & sMessage & "');" msg += "</scri...
This can also be caused if your code returns an additional pop-up or messagebox fail message that the window can't handle properly.
8,928,713
I am working on project. In my System when I run the project it is running nicely, but after uploading it to my domain when I check, then it displays the error like: "Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification...
2012/01/19
[ "https://Stackoverflow.com/questions/8928713", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1156368/" ]
You 100% can do this on the server side... ``` Protected Sub Button3_Click(sender As Object, e As System.EventArgs) MesgBox("Test") End Sub Private Sub MesgBox(ByVal sMessage As String) Dim msg As String msg = "<script language='javascript'>" msg += "alert('" & sMessage & "');" msg += "</scri...
You also encounter this if you run an Application on a Scheduled Task in Non-Interactive mode. As soon as you show a Dialog it throws the error: > > Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDeskt...
54,931,435
I have an example script below that I run on an excel file. Essentially **after** **line 6** I want to filter out rows that contain BFD and SFD in Column F( I know just assigned these values in the code above, and more of those values also existed in different rows prior to the script). After this is filtered just appl...
2019/02/28
[ "https://Stackoverflow.com/questions/54931435", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7587176/" ]
I agree with [Daniel Goldfarb](https://stackoverflow.com/users/1639359/daniel-goldfarb) comments. Don't look for help without trying. If you still couldn't get how to do that, then only read my remaining comment. Just print : str = string entered len(str) = string length ``` +-(len(str) * '-')-+ | str ...
So hopefully you can learn, don't want to just write the code for you. Basically break it into steps. First you need to accept user input. If you don't know how to do that, try googling, "python accept user input from stdin" or here is one of the results from that search: <https://www.pythonforbeginners.com/basics/gett...
54,931,435
I have an example script below that I run on an excel file. Essentially **after** **line 6** I want to filter out rows that contain BFD and SFD in Column F( I know just assigned these values in the code above, and more of those values also existed in different rows prior to the script). After this is filtered just appl...
2019/02/28
[ "https://Stackoverflow.com/questions/54931435", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7587176/" ]
So hopefully you can learn, don't want to just write the code for you. Basically break it into steps. First you need to accept user input. If you don't know how to do that, try googling, "python accept user input from stdin" or here is one of the results from that search: <https://www.pythonforbeginners.com/basics/gett...
I'm new to Python, and I've found this solution. Maybe is not the best solution, but it works! ``` test = input() print("+-", end='') for i in test: print("-", end='') print("-+") print("| " + test + " |") print("+-", end='') for i in test: print("-", end='') print("-+") ```
54,931,435
I have an example script below that I run on an excel file. Essentially **after** **line 6** I want to filter out rows that contain BFD and SFD in Column F( I know just assigned these values in the code above, and more of those values also existed in different rows prior to the script). After this is filtered just appl...
2019/02/28
[ "https://Stackoverflow.com/questions/54931435", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7587176/" ]
I agree with [Daniel Goldfarb](https://stackoverflow.com/users/1639359/daniel-goldfarb) comments. Don't look for help without trying. If you still couldn't get how to do that, then only read my remaining comment. Just print : str = string entered len(str) = string length ``` +-(len(str) * '-')-+ | str ...
I'm new to Python, and I've found this solution. Maybe is not the best solution, but it works! ``` test = input() print("+-", end='') for i in test: print("-", end='') print("-+") print("| " + test + " |") print("+-", end='') for i in test: print("-", end='') print("-+") ```
54,931,435
I have an example script below that I run on an excel file. Essentially **after** **line 6** I want to filter out rows that contain BFD and SFD in Column F( I know just assigned these values in the code above, and more of those values also existed in different rows prior to the script). After this is filtered just appl...
2019/02/28
[ "https://Stackoverflow.com/questions/54931435", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7587176/" ]
I agree with [Daniel Goldfarb](https://stackoverflow.com/users/1639359/daniel-goldfarb) comments. Don't look for help without trying. If you still couldn't get how to do that, then only read my remaining comment. Just print : str = string entered len(str) = string length ``` +-(len(str) * '-')-+ | str ...
Here is the solution, but I recommend to try it out by yourself, breakdown the problem into smaller pieces and start from there. ``` def format(word): #It declares all the necessary variables borders =[] result = [] # First part of the result--> it gives the two spaces and the "wall" result.append...
54,931,435
I have an example script below that I run on an excel file. Essentially **after** **line 6** I want to filter out rows that contain BFD and SFD in Column F( I know just assigned these values in the code above, and more of those values also existed in different rows prior to the script). After this is filtered just appl...
2019/02/28
[ "https://Stackoverflow.com/questions/54931435", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7587176/" ]
Here is the solution, but I recommend to try it out by yourself, breakdown the problem into smaller pieces and start from there. ``` def format(word): #It declares all the necessary variables borders =[] result = [] # First part of the result--> it gives the two spaces and the "wall" result.append...
I'm new to Python, and I've found this solution. Maybe is not the best solution, but it works! ``` test = input() print("+-", end='') for i in test: print("-", end='') print("-+") print("| " + test + " |") print("+-", end='') for i in test: print("-", end='') print("-+") ```
48
What is the link between Odin and Santa Claus? How does Santa trace his origins to the Norse god?
2015/04/28
[ "https://mythology.stackexchange.com/questions/48", "https://mythology.stackexchange.com", "https://mythology.stackexchange.com/users/58/" ]
Santa Claus is derived from the Dutch festival figure St Nicholas, or Sinterklaas. The story is that St Nicholas is a Roman Catholic bishop who rides over the rooftop on a white horse at night, accompanied by his black manservant. While the children are asleep they bring presents, throwing them through the chimney, or...
One of the original holidays that was merged together to create the modern Christmas is Yule (in Scandinavian languages, Christmas is still called "jul" or "jól"); this was apparently celebrated around midwinter; the term to "drink yule" appears in the poem [Hrafnsm%C3%A1l](https://en.wikipedia.org/wiki/Hrafnsm%C3%A1l)...
10,236
Near the beginning of my story, my main character loses an arm, and is going to get a prosthetic replacement. I've done some research on prosthetic limbs, and as one might expect, you're not good to go in a week. The problem is, I had intended for everything to be occurring during a serious winter storm, in order to l...
2015/02/13
[ "https://worldbuilding.stackexchange.com/questions/10236", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/7218/" ]
> > **TL;DR** > > > Screw an ITAP into the bone stub, reinforce it with some titanium > bands, take some drugs, and pet a kitty with your new cyborg arm. > > > Ah, *cyborgs*. Personally, I design the electronics (neurostimulators) for cyborgs (usually old people), but the mechanical stuff is pretty rad, so I fo...
Now available! **3D printing** for all your instant prosthetic needs. In just minutes your patient will be moving around with his new leg thanks to our patented technology. We are not responsible for broken prosthetics; pressure sores; nerve damage or bruises due to bad fit or misuse. Home-printed 3D prosthetics are ...
10,236
Near the beginning of my story, my main character loses an arm, and is going to get a prosthetic replacement. I've done some research on prosthetic limbs, and as one might expect, you're not good to go in a week. The problem is, I had intended for everything to be occurring during a serious winter storm, in order to l...
2015/02/13
[ "https://worldbuilding.stackexchange.com/questions/10236", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/7218/" ]
> > **TL;DR** > > > Screw an ITAP into the bone stub, reinforce it with some titanium > bands, take some drugs, and pet a kitty with your new cyborg arm. > > > Ah, *cyborgs*. Personally, I design the electronics (neurostimulators) for cyborgs (usually old people), but the mechanical stuff is pretty rad, so I fo...
Nueroscientist Miguel Nicolelis has been working on a brain machine interface. He claims this interface has allowed monkeys to control robotic arms. Here is a [Nicolelis TED talk](http://www.ted.com/talks/miguel_nicolelis_a_monkey_that_controls_a_robot_with_its_thoughts_no_really?language=en). Dr. Nicolelis is hoping ...
5,706,804
I am trying to update the database and send the users browser to a different page with one click. The Html looks like this: ``` <a id='updateLiveProgress' style='width:118px;' href='~link~'>Click here</a> ``` The Javascript looks like this: ``` $("#updateLiveProgress").live("click", function(e){ ...
2011/04/18
[ "https://Stackoverflow.com/questions/5706804", "https://Stackoverflow.com", "https://Stackoverflow.com/users/336384/" ]
Try doing this: ``` $("#updateLiveProgress").live("click", function(e){ e.preventDefault(); var href = this.href; var ajaxlink = "~ajaxlink~" $.post(ajaxlink, function(data, e){ window.location = href; }); return false; }); ``` As of jQuery 1.7 do t...
This is the inherent behavior of Ajax, in fact its what the `A` stands for: asynchronous. The ajax call is fired, and the click function returns before the ajax request has come back. You have 2 options: 1. Make the ajax call synchronous. I would not recommend this. 2. Manually follow the link when the ajax call retur...
5,706,804
I am trying to update the database and send the users browser to a different page with one click. The Html looks like this: ``` <a id='updateLiveProgress' style='width:118px;' href='~link~'>Click here</a> ``` The Javascript looks like this: ``` $("#updateLiveProgress").live("click", function(e){ ...
2011/04/18
[ "https://Stackoverflow.com/questions/5706804", "https://Stackoverflow.com", "https://Stackoverflow.com/users/336384/" ]
Try doing this: ``` $("#updateLiveProgress").live("click", function(e){ e.preventDefault(); var href = this.href; var ajaxlink = "~ajaxlink~" $.post(ajaxlink, function(data, e){ window.location = href; }); return false; }); ``` As of jQuery 1.7 do t...
2 ways to do this **First** ``` $("#updateLiveProgress").live("click", function(e){ var ajaxlink = "~ajaxlink~" $.post(ajaxlink, function(data, e){ return true; }); return false; }); ``` **Second** ``` $.ajax({ type: 'POST', url: "~ajaxlink~", data: data, ...
5,706,804
I am trying to update the database and send the users browser to a different page with one click. The Html looks like this: ``` <a id='updateLiveProgress' style='width:118px;' href='~link~'>Click here</a> ``` The Javascript looks like this: ``` $("#updateLiveProgress").live("click", function(e){ ...
2011/04/18
[ "https://Stackoverflow.com/questions/5706804", "https://Stackoverflow.com", "https://Stackoverflow.com/users/336384/" ]
Try doing this: ``` $("#updateLiveProgress").live("click", function(e){ e.preventDefault(); var href = this.href; var ajaxlink = "~ajaxlink~" $.post(ajaxlink, function(data, e){ window.location = href; }); return false; }); ``` As of jQuery 1.7 do t...
Depending on how you have your `AJAX` configured your most likely going to use a callback. In this case, the callback is the where the success `function` is specified. Here's some example code: ``` //assuming button is an anchor link $('#button').click(function(){ //do ajax request $.ajax{ url: 'http:...
5,706,804
I am trying to update the database and send the users browser to a different page with one click. The Html looks like this: ``` <a id='updateLiveProgress' style='width:118px;' href='~link~'>Click here</a> ``` The Javascript looks like this: ``` $("#updateLiveProgress").live("click", function(e){ ...
2011/04/18
[ "https://Stackoverflow.com/questions/5706804", "https://Stackoverflow.com", "https://Stackoverflow.com/users/336384/" ]
This is the inherent behavior of Ajax, in fact its what the `A` stands for: asynchronous. The ajax call is fired, and the click function returns before the ajax request has come back. You have 2 options: 1. Make the ajax call synchronous. I would not recommend this. 2. Manually follow the link when the ajax call retur...
2 ways to do this **First** ``` $("#updateLiveProgress").live("click", function(e){ var ajaxlink = "~ajaxlink~" $.post(ajaxlink, function(data, e){ return true; }); return false; }); ``` **Second** ``` $.ajax({ type: 'POST', url: "~ajaxlink~", data: data, ...
5,706,804
I am trying to update the database and send the users browser to a different page with one click. The Html looks like this: ``` <a id='updateLiveProgress' style='width:118px;' href='~link~'>Click here</a> ``` The Javascript looks like this: ``` $("#updateLiveProgress").live("click", function(e){ ...
2011/04/18
[ "https://Stackoverflow.com/questions/5706804", "https://Stackoverflow.com", "https://Stackoverflow.com/users/336384/" ]
Depending on how you have your `AJAX` configured your most likely going to use a callback. In this case, the callback is the where the success `function` is specified. Here's some example code: ``` //assuming button is an anchor link $('#button').click(function(){ //do ajax request $.ajax{ url: 'http:...
2 ways to do this **First** ``` $("#updateLiveProgress").live("click", function(e){ var ajaxlink = "~ajaxlink~" $.post(ajaxlink, function(data, e){ return true; }); return false; }); ``` **Second** ``` $.ajax({ type: 'POST', url: "~ajaxlink~", data: data, ...
56,444,962
I am struggling with async await try catch block for a couple of days. ``` async function executeJob(job) { // necessary variable declaration code here try { do { let procedureRequests = await ProcedureRequestModel.find(filter, options); // doing process here... } while (fetchedCount < tota...
2019/06/04
[ "https://Stackoverflow.com/questions/56444962", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7450482/" ]
You can refactor your code in smaller functions that return a promise for which you can locally wrap try-catch and handle it. ``` async function executeJob(job) { // necessary variable declaration code here try { await doProcedure(); providerNPIIds = [...providerNPIIds]; // Fetch provider details ...
This is basically the same what You have: ``` 1 function myFunctionPromise() { 2 return new Promise((response, reject) => { 3 setTimeout(() => reject("Reje...
55,418,780
The following code is another attempt to make a class with a channel. Here, I am passing a channel directly from the caller side rather than opening it inside a class. While the code gives the expected result, I am wondering if it is legitimate to do such a thing, particularly by calling `openwriter()` directly in the ...
2019/03/29
[ "https://Stackoverflow.com/questions/55418780", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3501546/" ]
Yes, this should continue to work because files and channels are reference counted. See also <https://chapel-lang.org/docs/modules/standard/IO.html#functions-for-closing-channels> Also, note that at the current time, temporary variables in Chapel are destroyed at the end of the enclosing block (rather than at the end...
I believe that your code should be fine as-is. The documentation for files and channels indicates that they are reference counted so that as long as some variable is referring to them, they should stay alive. The following quote is from the version 1.19 documents on [Functions for Closing Channels](https://chapel-lang....
43,295
I'm developing a open source software that (internally) uses font glyph identification. The glyphs I'd like to detect come from copyrighted fonts, to which I have personal use licenses. By font glyph detection, I mean the following: Let's say a user of my software has a font file. --- *A brief technical primer on f...
2019/07/30
[ "https://law.stackexchange.com/questions/43295", "https://law.stackexchange.com", "https://law.stackexchange.com/users/26865/" ]
The US does not provide copyright protection for font design. As long as you dont distribute font generating programs, that would themselves be copyrighted, you are not infringing. Your derived information is okay because it is derived from a non-copyrightable work and is therefore not a derivative work. <https://law....
Your overall question *"Would this constitute fair use?"* can only be guessed at; fair use cases can only be definitively decided in court. Probably the best thing to do is contact the copyright holder of the fonts and ask if your use would be infringement and if they would give an exception for open source, non-comme...
43,295
I'm developing a open source software that (internally) uses font glyph identification. The glyphs I'd like to detect come from copyrighted fonts, to which I have personal use licenses. By font glyph detection, I mean the following: Let's say a user of my software has a font file. --- *A brief technical primer on f...
2019/07/30
[ "https://law.stackexchange.com/questions/43295", "https://law.stackexchange.com", "https://law.stackexchange.com/users/26865/" ]
The US does not provide copyright protection for font design. As long as you dont distribute font generating programs, that would themselves be copyrighted, you are not infringing. Your derived information is okay because it is derived from a non-copyrightable work and is therefore not a derivative work. <https://law....
The process you have described is the generation of an approximate version of the original font data. Since your font is derived from the copyright font you have created a derived work, which is covered by the same copyright as the original.