qid
int64
1
74.7M
question
stringlengths
0
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
2
48.3k
response_k
stringlengths
2
40.5k
29,226,198
I'm looking for function that **Open window explorer in C language**. I have found this [answer]**([How can I open Windows Explorer to a certain directory from within a WPF app?](https://stackoverflow.com/questions/1746079/how-can-i-open-windows-explorer-to-a-certain-directory-from-within-a-wpf-app))**, but this is C# ...
2015/03/24
[ "https://Stackoverflow.com/questions/29226198", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4427613/" ]
The simplest way to open a certain directory in an explorer (here c:\program files) may be: ``` system("start \"\" \"c:\\program files\""); ```
Given the stslib.h library contains the system() function that let's you run shell commands, you should be able to run the command to open a new windows explorer window using the same command you would use in the terminal window. A guideline: <http://www.programmingsimplified.com/c-program-shutdown-computer>
155,822
I'm having some problems getting my table and caption formatting to look right. Below is a sample of the code from my thesis. I've included all the packages that I'm using in my thesis, so that you can get an idea of what else might be affecting the look of the table. I've also attached a picture of my output. The mai...
2014/01/24
[ "https://tex.stackexchange.com/questions/155822", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/44564/" ]
1. It's enough to load the [`caption`](http://www.ctan.org/pkg/caption) package (you could even set a bigger `skip`, if needed). 2. Redefine `\arraystretch` locally. 3. Build your table and its footnote using the [`ctable`](http://www.ctan.org/pkg/ctable) package. The code: ``` \documentclass[12pt,a4paper]{report} \u...
Another approach for the third problem is to use the »[threeparttable](http://ctan.org/pkg/threeparttable)« package. For formatting and alignment of the numbers it is suggestive to let »[siunitx](http://ctan.org/pkg/siunitx)« do that job. The isotopes can be formatted easier by `chemformula` (from the »[chemmacros](htt...
155,822
I'm having some problems getting my table and caption formatting to look right. Below is a sample of the code from my thesis. I've included all the packages that I'm using in my thesis, so that you can get an idea of what else might be affecting the look of the table. I've also attached a picture of my output. The mai...
2014/01/24
[ "https://tex.stackexchange.com/questions/155822", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/44564/" ]
1. It's enough to load the [`caption`](http://www.ctan.org/pkg/caption) package (you could even set a bigger `skip`, if needed). 2. Redefine `\arraystretch` locally. 3. Build your table and its footnote using the [`ctable`](http://www.ctan.org/pkg/ctable) package. The code: ``` \documentclass[12pt,a4paper]{report} \u...
A solution using the caption and floatrow packages, so that the caption width is equal to the table width: ``` \documentclass[12pt,a4paper]{report} \usepackage{amsmath} \usepackage{array} \usepackage{booktabs} \usepackage[justification = centerlast]{caption} \usepackage{floatrow} \floatsetup[table]{footnoterule = no...
801,940
I have a parameterized hibernate dao that performs basic crud operations, and when parameterized is used as a delegate to fulfil basic crud operations for a given dao. ``` public class HibernateDao <T, ID extends Serializable> implements GenericDao<T, ID> ``` I want to be able to derive Class from T at runtime to cr...
2009/04/29
[ "https://Stackoverflow.com/questions/801940", "https://Stackoverflow.com", "https://Stackoverflow.com/users/49854/" ]
You could have the Class passed as a constructor argument. ``` public class HibernateDao <T, ID extends Serializable> implements GenericDao<T, ID> { private final Class<? extends T> type; public HibernateDao(Class<? extends T> type) { this.type = type; } // .... } ```
There is the way how to figure out `class` of type argument `T` using reflection: ``` private Class<T> persistentClass = (Class<T>) ((ParameterizedType)getClass().getGenericSuperclass()).getActualTypeArguments()[0]; ``` Here is the way how I use it: ``` public class GenericDaoJPA<T> implements GenericDao<T> { ...
58,576,631
I want to learn to create a wrapper around a program in linux. How does one do this? A tutorial reference web-page/link or example will do. To clarify what I want to learn, I will explain with an example. I use **vim** for editing text files. And use **rcs** as my simple revision control system. **rcs** allows you to ...
2019/10/27
[ "https://Stackoverflow.com/questions/58576631", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4567351/" ]
There are a few missing dependencies in your `create-react-app` project. This probably happened because you tried to export the project from codesandbox (I'm not sure though) You have to fix those first. **Dependency 1** (`react-scripts`): ``` npm install react-scripts --save-dev ``` **Dependency 2** (`node-sass` ...
Here is what deploy script in your code: ``` "deploy": "gh-pages -d build" ``` Which is means gh-pages tool use build directory to make it deploy, so you need two things in order to make it work * Create a build folder properly with the following command: ``` npm run build ``` * now install gh-pages tool for you...
63,452,974
I am trying to install Pylucene on my WSL Ubuntu 20.04 clean installation. I tried to follow tutorial on [the official page but it looks outdated](https://lucene.apache.org/pylucene/install.html). So I was wondering if anyone here managed to make it work on Ubuntu 20.04 and python 3.8.2 The commands I run: ``` sudo a...
2020/08/17
[ "https://Stackoverflow.com/questions/63452974", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5594539/" ]
Here are the steps that lead to the successful installation of pylucene on Ubuntu 18.04 - this may work for you: 1. Install openjdk-8: `apt install openjdk-8-jre openjdk-8-jdk openjdk-8-doc` Ensure that you have ant installed, if you don't run `apt install ant`. Note that if you had a different version of openjdk inst...
Confirmed that the answer posted by @code-your-dream works also with Python3 (and in particular in a Ubuntu 18.04.1) For me was important to install jcc that way. I tried installing via conda and there were conflicts in the make of pylucene. In my case also was needed to modify the setup.py file from jcc changing 'li...
63,452,974
I am trying to install Pylucene on my WSL Ubuntu 20.04 clean installation. I tried to follow tutorial on [the official page but it looks outdated](https://lucene.apache.org/pylucene/install.html). So I was wondering if anyone here managed to make it work on Ubuntu 20.04 and python 3.8.2 The commands I run: ``` sudo a...
2020/08/17
[ "https://Stackoverflow.com/questions/63452974", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5594539/" ]
Here are the steps that lead to the successful installation of pylucene on Ubuntu 18.04 - this may work for you: 1. Install openjdk-8: `apt install openjdk-8-jre openjdk-8-jdk openjdk-8-doc` Ensure that you have ant installed, if you don't run `apt install ant`. Note that if you had a different version of openjdk inst...
I wrote this dockerfile for PyLucene 8.11.0, Python 3.9, JDK11 (default-jdk) and ubuntu 20.04 (focal). Do extend with your favorite python package manager such as Poetry, Pipenv or Conda etc. **Dockerfile** ``` FROM ubuntu:focal ARG PYTHON_VERSION=3.9 ARG PYLUCENE_VERSION=8.11.0 # Uncomment to install specific vers...
61,559,348
I am integrating JWT authorization from Cognito into my Nestjs application and I am running into a sort of a chicken vs egg situation. If a generate clientSecret for my Cognito client, I will get the following error: > > "Unable to verify secret hash for client {Client\_Id}" > > > If I uncheck clientScret genera...
2020/05/02
[ "https://Stackoverflow.com/questions/61559348", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10603880/" ]
The tutorial you shared let the back-end side handle the user register, sign in, and sign out. I want to delegate the access token getting to AWS Cognito. For a user to request protected resources, the backend side validates the access token passed as a bearer token in two ways: * Use middleware: <https://github.com/...
``` import { ExtractJwt, Strategy } from 'passport-jwt'; import { PassportStrategy } from '@nestjs/passport'; import { Injectable, Logger, UnauthorizedException } from '@nestjs/common'; import { passportJwtSecret } from 'jwks-rsa'; @Injectable() export class JwtStrategy extends PassportStrategy(Strategy) { construct...
24,491,420
Is there any difference between these 2 quesries? This is from test and one asnwer is right and accordingly another wrong. For me, both are valid and similar. ``` B. SELECT Cust_No, Cust_Name, Emp_Name, Emp_Loc FROM Customers, Employees WHERE Customers.Sales_Rep_No = Employees.Sales_Rep_No; C. SELECT Cust_No, Cust_Na...
2014/06/30
[ "https://Stackoverflow.com/questions/24491420", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2705336/" ]
Yes, they differ in their `WHERE`-clauses, but everything else (the Tables joined, the columns retrieved, is the same, and they also should really produce the same result): `WHERE Customers.Sales_Rep_No = Employees.Sales_Rep_No;` `WHERE Employees.Sales_Rep_No = Customers.Sales_Rep_No;`
There is no functional difference whatsoever.
18,753
My attendant and I met a year ago and had intercourse back then, we recently picked back up where we left off, but want to go about it the right way and get married. Is there a time frame that we have to be apart from each other sexually and not sexual before marriage? What is needed to be done for our marriage to be...
2014/11/25
[ "https://islam.stackexchange.com/questions/18753", "https://islam.stackexchange.com", "https://islam.stackexchange.com/users/9208/" ]
There's no time frame, but both of you must repent to Allah(SWT) and never commit that sin again. You and your potential cannot be alone together privately anywhere and at anytime. You must restrain your looks at each other. You must have a **Wali** involved to go about your business with him. You must be covered ...
If i understood what you said i think you write this advice to the person who will get married Yes that's right but i just add to your spaech or i can say in the other word ...... tray to don't do the sins than allah will help you ... And even you didn't have contact physical before get married , you will found the hap...
102,339
I want to buy the full version of Minecraft, but I'm one of those creative types. What are some of the differences in Creative mode in the full version of Minecraft?
2013/01/22
[ "https://gaming.stackexchange.com/questions/102339", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/41294/" ]
From [the wiki](http://www.minecraftwiki.net/wiki/Classic#Advantages_of_purchasing) about the classic version: > > Advantages of purchasing > > > Although this mode is free to the public, there are several advantages > made available to those who have purchased the game. Some of them are > the ability to: > > ...
You can play the free version, so I won't waste too many words about it. You have a small sandbox and a few kinds of blocks you can mess around and build with. You can explore the randomly generated world for caves, pockets of air, etc.; you can grief with water sources... It's the core of Minecraft. The paid version ...
102,339
I want to buy the full version of Minecraft, but I'm one of those creative types. What are some of the differences in Creative mode in the full version of Minecraft?
2013/01/22
[ "https://gaming.stackexchange.com/questions/102339", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/41294/" ]
You can play the free version, so I won't waste too many words about it. You have a small sandbox and a few kinds of blocks you can mess around and build with. You can explore the randomly generated world for caves, pockets of air, etc.; you can grief with water sources... It's the core of Minecraft. The paid version ...
There is only about a dozen blocks in Classic, and they don't really do much. The full version of Minecraft not only includes nearly 150 blocks, but also has Redstone (an extremely flexible system you can use to make machines in Minecraft), custom avatars, infinite worlds, enhanced multiplayer, and the awesome survival...
102,339
I want to buy the full version of Minecraft, but I'm one of those creative types. What are some of the differences in Creative mode in the full version of Minecraft?
2013/01/22
[ "https://gaming.stackexchange.com/questions/102339", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/41294/" ]
From [the wiki](http://www.minecraftwiki.net/wiki/Classic#Advantages_of_purchasing) about the classic version: > > Advantages of purchasing > > > Although this mode is free to the public, there are several advantages > made available to those who have purchased the game. Some of them are > the ability to: > > ...
There is only about a dozen blocks in Classic, and they don't really do much. The full version of Minecraft not only includes nearly 150 blocks, but also has Redstone (an extremely flexible system you can use to make machines in Minecraft), custom avatars, infinite worlds, enhanced multiplayer, and the awesome survival...
9,119,233
How can I initialize a val that is to be used in another scope? In the example below, I am forced to make `myOptimizedList` as a var, since it is initialized in the `if (iteration == 5){}` scope and used in the `if (iteration > 5){}` scope. ``` val myList:A = List(...) var myOptimizedList:A = null for (iteration <- ...
2012/02/02
[ "https://Stackoverflow.com/questions/9119233", "https://Stackoverflow.com", "https://Stackoverflow.com/users/750995/" ]
Seems that you have taken this code example out of the context, so this solution can be not very suitable for your real context, but you can use `foldLeft` in order to simplify it: ``` val myOptimizedList = (1 to 100).foldLeft (myList) { case (list, 5) => optimize(list) case (list, _) => process(list); list } ...
It's often the case that you can rework your code to avoid the problem. Consider the simple, and common, example here: ``` var x = 0 if(something) x = 5 else x = 6 println(x) ``` This would be a pretty common pattern in most languages, but Scala has a better way of doing it. Specifically, if-statements can retur...
9,119,233
How can I initialize a val that is to be used in another scope? In the example below, I am forced to make `myOptimizedList` as a var, since it is initialized in the `if (iteration == 5){}` scope and used in the `if (iteration > 5){}` scope. ``` val myList:A = List(...) var myOptimizedList:A = null for (iteration <- ...
2012/02/02
[ "https://Stackoverflow.com/questions/9119233", "https://Stackoverflow.com", "https://Stackoverflow.com/users/750995/" ]
Seems that you have taken this code example out of the context, so this solution can be not very suitable for your real context, but you can use `foldLeft` in order to simplify it: ``` val myOptimizedList = (1 to 100).foldLeft (myList) { case (list, 5) => optimize(list) case (list, _) => process(list); list } ...
You can almost always rewrite some sort of looping construct as a (tail) recursive function: ``` @annotation.tailrec def processLists(xs: List[A], start: Int, stop: Int) { val next = start + 1 if (start < 5) { process(xs); processLists(xs, next, stop) else if (start == 5) { processLists( optimize(xs), next, stop...
9,119,233
How can I initialize a val that is to be used in another scope? In the example below, I am forced to make `myOptimizedList` as a var, since it is initialized in the `if (iteration == 5){}` scope and used in the `if (iteration > 5){}` scope. ``` val myList:A = List(...) var myOptimizedList:A = null for (iteration <- ...
2012/02/02
[ "https://Stackoverflow.com/questions/9119233", "https://Stackoverflow.com", "https://Stackoverflow.com/users/750995/" ]
Seems that you have taken this code example out of the context, so this solution can be not very suitable for your real context, but you can use `foldLeft` in order to simplify it: ``` val myOptimizedList = (1 to 100).foldLeft (myList) { case (list, 5) => optimize(list) case (list, _) => process(list); list } ...
There's another technique (perhaps trick in this case) to delay initialization of `myOptimizedList` which is to use a lazy val. Your example is very specific but the principal is still obvious, delay assignment of a val until it is first referenced. ``` val myList = List(A(), A(), A()) lazy val myOptimi...
1,320,991
My textbook says: Suppose that $E$ is a convex region in the plane bounded by a curve $C$. [Where a convex region is defined as for all $x, y \in E, sx + ty \in E$ where $0 \le s, t \le 1$ and $s + t = 1$.] Show that $C$ has a tangent line except at a countable number of points. So my thinking is roughly that points w...
2015/06/11
[ "https://math.stackexchange.com/questions/1320991", "https://math.stackexchange.com", "https://math.stackexchange.com/users/204420/" ]
Line segments from $(n,n^2)$ to $((n+1),(n+1)^2)$ for each integer $n$ you should draw. A nice and simple convex region you will get.
Here's a compact example. Start with a circle of radius $1$. Cut off a minor segment with a chord of length $1$, and close the resulting major segment. From this major segment, cut off a minor segment with an adjacent chord of length $\frac12$, and close the rest. Continue this process, cutting off minor segments with ...
70,811,590
Let's say we have the following table: ``` city gender abc m abc f def m ``` Required output: --- ``` city f_count m_count abc 1 1 def 0 1 ``` Please help me in writing a query either in Hive or MySQL or SQL Server syntax. Hive syntax is needed for me. Thank You:)
2022/01/22
[ "https://Stackoverflow.com/questions/70811590", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13345717/" ]
Try: ``` select city,sum(gender='f') as f_count,sum(gender='m') as m_count from my_table group by city; ``` > > Result: > > > > ``` > city f_count m_count > abc 1 1 > def 0 1 > > ``` > > [Demo](https://dbfiddle.uk/?rdbms=mysql_8.0&fiddle=e9e64e17c116766877f1ba802492fac3)
``` select city, sum(male),sum(female) from (select city ,count(gender) as male,0 as female from temp where gender='M' group by city union select city , 0,count(gender) as female from temp where gender='F'group by city) group by city; ```
70,811,590
Let's say we have the following table: ``` city gender abc m abc f def m ``` Required output: --- ``` city f_count m_count abc 1 1 def 0 1 ``` Please help me in writing a query either in Hive or MySQL or SQL Server syntax. Hive syntax is needed for me. Thank You:)
2022/01/22
[ "https://Stackoverflow.com/questions/70811590", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13345717/" ]
SQL Server: ``` select city ,count(case when gender = 'm' then 1 else null end) as m_count ,count(case when gender <> 'm' then 1 else null end) as f_count from table_name group by city ``` > > Result: > > > > ``` > city | f_count | m_count > abc | 1 | 1 > def | 0 | 1 > > ``` > >
``` select city, sum(male),sum(female) from (select city ,count(gender) as male,0 as female from temp where gender='M' group by city union select city , 0,count(gender) as female from temp where gender='F'group by city) group by city; ```
57,887,300
My Github repo won't update after `git push -u origin master` command! It says: ``` Branch 'master' set up to track remote branch 'master' from 'origin'. Everything up-to-date ``` The result for `git remote show origin` is: ``` * remote origin Fetch URL: git@github.com:MyGithubID/RepoName.git Push URL: git@git...
2019/09/11
[ "https://Stackoverflow.com/questions/57887300", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7522214/" ]
You have only staged the file for commit, but not actually committed the change. You have to commit the change to get a commit-id which is then used during the push/pull phase. ``` git commit ``` With `git`, committing a change is a two step process. The first step is to add your change(s) to a so called staging ar...
``` Changes to be committed: (use "git reset HEAD <file>..." to unstage) new file: myFile.m ``` That implies that you have to commit your changes. So, you've done well, you're almost there you just have to do a: ``` git commit -m "Here a short descriptive message" -m "Here a longer more detailed message" ```...
57,887,300
My Github repo won't update after `git push -u origin master` command! It says: ``` Branch 'master' set up to track remote branch 'master' from 'origin'. Everything up-to-date ``` The result for `git remote show origin` is: ``` * remote origin Fetch URL: git@github.com:MyGithubID/RepoName.git Push URL: git@git...
2019/09/11
[ "https://Stackoverflow.com/questions/57887300", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7522214/" ]
``` Changes to be committed: (use "git reset HEAD <file>..." to unstage) new file: myFile.m ``` That implies that you have to commit your changes. So, you've done well, you're almost there you just have to do a: ``` git commit -m "Here a short descriptive message" -m "Here a longer more detailed message" ```...
if you are adding new project try below steps : ``` rm -rf .git/ git init git remote add origin https://repository.remote.url git add . git commit -m “Commit message here”. git push -f origin master ```
57,887,300
My Github repo won't update after `git push -u origin master` command! It says: ``` Branch 'master' set up to track remote branch 'master' from 'origin'. Everything up-to-date ``` The result for `git remote show origin` is: ``` * remote origin Fetch URL: git@github.com:MyGithubID/RepoName.git Push URL: git@git...
2019/09/11
[ "https://Stackoverflow.com/questions/57887300", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7522214/" ]
``` Changes to be committed: (use "git reset HEAD <file>..." to unstage) new file: myFile.m ``` That implies that you have to commit your changes. So, you've done well, you're almost there you just have to do a: ``` git commit -m "Here a short descriptive message" -m "Here a longer more detailed message" ```...
You can also get a situation where you've pushed remotely, and if you do `git log` it'll show *(HEAD -> master)* next to your latest commit, but *origin/master* is seemingly out of date (showing several commit messages down). To resolve this I verified the state of the repository I'd pushed to at the other end, then r...
57,887,300
My Github repo won't update after `git push -u origin master` command! It says: ``` Branch 'master' set up to track remote branch 'master' from 'origin'. Everything up-to-date ``` The result for `git remote show origin` is: ``` * remote origin Fetch URL: git@github.com:MyGithubID/RepoName.git Push URL: git@git...
2019/09/11
[ "https://Stackoverflow.com/questions/57887300", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7522214/" ]
You have only staged the file for commit, but not actually committed the change. You have to commit the change to get a commit-id which is then used during the push/pull phase. ``` git commit ``` With `git`, committing a change is a two step process. The first step is to add your change(s) to a so called staging ar...
Follow the official documentation:- <https://git-scm.com/docs/gittutorial> Before push you will have to first add all the resources where the changes you have done. ``` git add . or git add --all ``` Then commit it using ``` git commit -m "your message". ``` and push code using ``` git push origin master ...
57,887,300
My Github repo won't update after `git push -u origin master` command! It says: ``` Branch 'master' set up to track remote branch 'master' from 'origin'. Everything up-to-date ``` The result for `git remote show origin` is: ``` * remote origin Fetch URL: git@github.com:MyGithubID/RepoName.git Push URL: git@git...
2019/09/11
[ "https://Stackoverflow.com/questions/57887300", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7522214/" ]
Follow the official documentation:- <https://git-scm.com/docs/gittutorial> Before push you will have to first add all the resources where the changes you have done. ``` git add . or git add --all ``` Then commit it using ``` git commit -m "your message". ``` and push code using ``` git push origin master ...
if you are adding new project try below steps : ``` rm -rf .git/ git init git remote add origin https://repository.remote.url git add . git commit -m “Commit message here”. git push -f origin master ```
57,887,300
My Github repo won't update after `git push -u origin master` command! It says: ``` Branch 'master' set up to track remote branch 'master' from 'origin'. Everything up-to-date ``` The result for `git remote show origin` is: ``` * remote origin Fetch URL: git@github.com:MyGithubID/RepoName.git Push URL: git@git...
2019/09/11
[ "https://Stackoverflow.com/questions/57887300", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7522214/" ]
Follow the official documentation:- <https://git-scm.com/docs/gittutorial> Before push you will have to first add all the resources where the changes you have done. ``` git add . or git add --all ``` Then commit it using ``` git commit -m "your message". ``` and push code using ``` git push origin master ...
You can also get a situation where you've pushed remotely, and if you do `git log` it'll show *(HEAD -> master)* next to your latest commit, but *origin/master* is seemingly out of date (showing several commit messages down). To resolve this I verified the state of the repository I'd pushed to at the other end, then r...
57,887,300
My Github repo won't update after `git push -u origin master` command! It says: ``` Branch 'master' set up to track remote branch 'master' from 'origin'. Everything up-to-date ``` The result for `git remote show origin` is: ``` * remote origin Fetch URL: git@github.com:MyGithubID/RepoName.git Push URL: git@git...
2019/09/11
[ "https://Stackoverflow.com/questions/57887300", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7522214/" ]
You have only staged the file for commit, but not actually committed the change. You have to commit the change to get a commit-id which is then used during the push/pull phase. ``` git commit ``` With `git`, committing a change is a two step process. The first step is to add your change(s) to a so called staging ar...
if you are adding new project try below steps : ``` rm -rf .git/ git init git remote add origin https://repository.remote.url git add . git commit -m “Commit message here”. git push -f origin master ```
57,887,300
My Github repo won't update after `git push -u origin master` command! It says: ``` Branch 'master' set up to track remote branch 'master' from 'origin'. Everything up-to-date ``` The result for `git remote show origin` is: ``` * remote origin Fetch URL: git@github.com:MyGithubID/RepoName.git Push URL: git@git...
2019/09/11
[ "https://Stackoverflow.com/questions/57887300", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7522214/" ]
You have only staged the file for commit, but not actually committed the change. You have to commit the change to get a commit-id which is then used during the push/pull phase. ``` git commit ``` With `git`, committing a change is a two step process. The first step is to add your change(s) to a so called staging ar...
You can also get a situation where you've pushed remotely, and if you do `git log` it'll show *(HEAD -> master)* next to your latest commit, but *origin/master* is seemingly out of date (showing several commit messages down). To resolve this I verified the state of the repository I'd pushed to at the other end, then r...
37,711
Comme l'on lit dans cette **excellente réponse** [Quand peut-on mettre un adjectif avant ou après un nom ? — When do adjectives go before or after a noun?](https://french.stackexchange.com/questions/319/quand-peut-on-mettre-un-adjectif-avant-ou-apr%c3%a8s-un-nom-when-do-adjectives-go/323#323) > > La place de l'épithè...
2019/08/01
[ "https://french.stackexchange.com/questions/37711", "https://french.stackexchange.com", "https://french.stackexchange.com/users/16020/" ]
Si on trouve ***excellent*** plutôt avant le nom ça tient au sens même de cet adjectif. L'adjectif exprimant un jugement, un réaction subjective, affective se place avant le nom. (Grevisse §398 10e édition, qui renvoie à l'article de Marouzeau « Encore la place de l'adjectif » dans *Le Français Moderne*, oct. 1953, [p....
*Excellent* est ambivalent, on le trouve avant ou après le nom. Lorsqu'il est associé à un nom et que les deux constituent à eux seuls une phrase autonome, je l'emploierais plutôt avant le nom : * Excellente initiative! * Excellente question! * Excellente idée! *Monumental* par contre s'emploie le plus souvent voire ...
69,299,965
I don't know how to describe them, so here is a screenshot [![enter image description here](https://i.stack.imgur.com/BZKHP.png)](https://i.stack.imgur.com/BZKHP.png)
2021/09/23
[ "https://Stackoverflow.com/questions/69299965", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
This is one method using css pseudo elements `:before` and `:after`. I used the Horizontal bar Unicode character ― in the css `content:` declaration. ```css div:before { content: "― "; } div:after { content: " ―"; } ``` ```html <div>TEST</div> ```
Here it is the code ```css p { background-color: #ffffff; position: relative; z-index: 1; width: max-content; margin: auto; padding: 0px 5px; } hr { width: 100px; position: absolute; left: 50%; transform: translatex(-50%); top: 9px; } div { postition: relative; } ``` ```htm...
69,938,288
I have a Vuetify treeview setup in a NuxtJS app like so: ```html <v-treeview open-all color="white" class="info-pool" :load-children="loadChildren" :search="search" :filter="filter" :items="items"> <template slot="label" slot-scope="{ item }"> <a @click="CHANGE_INFO_TOPIC(item)" style="text-...
2021/11/12
[ "https://Stackoverflow.com/questions/69938288", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10029354/" ]
try this Navigator.popUntil(context, ModalRoute.withName('/c')); or you can simply pop 3 times like Navigator.of(context)..pop()..pop()..pop();
If you have a stack of pages A-B-C-D-E and want to push F onto the stack using get x it would look like this ``` Get.to(F()) ``` or ``` Get.toName('/F') ``` Outside of that using named routes makes things easier If you have a stack of pages A-B-C-D-E and want to push F onto the stack but pop D and E then it would...
69,938,288
I have a Vuetify treeview setup in a NuxtJS app like so: ```html <v-treeview open-all color="white" class="info-pool" :load-children="loadChildren" :search="search" :filter="filter" :items="items"> <template slot="label" slot-scope="{ item }"> <a @click="CHANGE_INFO_TOPIC(item)" style="text-...
2021/11/12
[ "https://Stackoverflow.com/questions/69938288", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10029354/" ]
Do this on your third route --------------------------- ``` Navigator.pushReplacement( context, MaterialPageRoute(settings: RouteSettings(name: "Foo")), ); ``` **and at last screen you can call this.** ``` Navigator.popUntil(context, ModalRoute.withName("Foo")); ```
If you have a stack of pages A-B-C-D-E and want to push F onto the stack using get x it would look like this ``` Get.to(F()) ``` or ``` Get.toName('/F') ``` Outside of that using named routes makes things easier If you have a stack of pages A-B-C-D-E and want to push F onto the stack but pop D and E then it would...
69,938,288
I have a Vuetify treeview setup in a NuxtJS app like so: ```html <v-treeview open-all color="white" class="info-pool" :load-children="loadChildren" :search="search" :filter="filter" :items="items"> <template slot="label" slot-scope="{ item }"> <a @click="CHANGE_INFO_TOPIC(item)" style="text-...
2021/11/12
[ "https://Stackoverflow.com/questions/69938288", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10029354/" ]
For skip two screen like - `A-B-C-D-F` screen in my stack and I want to go to `B` by removing all upper screen in stack then final stack is `A-B.` **In Screen B** ``` Navigator.pushReplacement( context, MaterialPageRoute( settings: RouteSettings(name: "Foo"), ...
If you have a stack of pages A-B-C-D-E and want to push F onto the stack using get x it would look like this ``` Get.to(F()) ``` or ``` Get.toName('/F') ``` Outside of that using named routes makes things easier If you have a stack of pages A-B-C-D-E and want to push F onto the stack but pop D and E then it would...
69,938,288
I have a Vuetify treeview setup in a NuxtJS app like so: ```html <v-treeview open-all color="white" class="info-pool" :load-children="loadChildren" :search="search" :filter="filter" :items="items"> <template slot="label" slot-scope="{ item }"> <a @click="CHANGE_INFO_TOPIC(item)" style="text-...
2021/11/12
[ "https://Stackoverflow.com/questions/69938288", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10029354/" ]
When we move form one to another screen then use: ``` Get.toNamed(RoutersConst.third); ``` And to remove screen from stack then use ``` Get.until((route) => route.settings.name == RoutersConst.second); ```
If you have a stack of pages A-B-C-D-E and want to push F onto the stack using get x it would look like this ``` Get.to(F()) ``` or ``` Get.toName('/F') ``` Outside of that using named routes makes things easier If you have a stack of pages A-B-C-D-E and want to push F onto the stack but pop D and E then it would...
27,871,573
Im developing a WCF web service with receives always and only XML. So i need to validate that input XML using their XSD. The question is, can i save them inside web service? Locally i can access XSD files via relative path into IIS Express root folder which i created manually. I tried add the XSD files in VS project b...
2015/01/10
[ "https://Stackoverflow.com/questions/27871573", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3542287/" ]
You can add the XSD as a resource, then load it from your assembly. Add the XSD to your project, and under the "Properties Explorer", set the "Build Action" to "Embedded Resource". You can then read the file with: ``` var schemaSet = new XmlSchemaSet(); schemaSet.Add("", XmlReader.Create(typeof(SomeClassInTheSameAssem...
One way you can do it is by using an application setting in your config file that will hold a base file location such as: ``` <appSettings> <add key="BaseDir" value="C:\your\folder\names" /> </appSettings> ``` Then in your program, when you need a file, you would do something like this: ``` string fileLocation ...
27,871,573
Im developing a WCF web service with receives always and only XML. So i need to validate that input XML using their XSD. The question is, can i save them inside web service? Locally i can access XSD files via relative path into IIS Express root folder which i created manually. I tried add the XSD files in VS project b...
2015/01/10
[ "https://Stackoverflow.com/questions/27871573", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3542287/" ]
Files that belong to your solution should be **physically** part of it. Once that is the case you can use for instance [`HostingEnvironment.MapPath`](http://msdn.microsoft.com/en-us/library/system.web.hosting.hostingenvironment.mappath%28v=vs.110%29.aspx); or look at the answers to [this question](https://stackoverflow...
One way you can do it is by using an application setting in your config file that will hold a base file location such as: ``` <appSettings> <add key="BaseDir" value="C:\your\folder\names" /> </appSettings> ``` Then in your program, when you need a file, you would do something like this: ``` string fileLocation ...
27,871,573
Im developing a WCF web service with receives always and only XML. So i need to validate that input XML using their XSD. The question is, can i save them inside web service? Locally i can access XSD files via relative path into IIS Express root folder which i created manually. I tried add the XSD files in VS project b...
2015/01/10
[ "https://Stackoverflow.com/questions/27871573", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3542287/" ]
Files that belong to your solution should be **physically** part of it. Once that is the case you can use for instance [`HostingEnvironment.MapPath`](http://msdn.microsoft.com/en-us/library/system.web.hosting.hostingenvironment.mappath%28v=vs.110%29.aspx); or look at the answers to [this question](https://stackoverflow...
You can add the XSD as a resource, then load it from your assembly. Add the XSD to your project, and under the "Properties Explorer", set the "Build Action" to "Embedded Resource". You can then read the file with: ``` var schemaSet = new XmlSchemaSet(); schemaSet.Add("", XmlReader.Create(typeof(SomeClassInTheSameAssem...
9,709,688
Heya I get this error message. I've been looking everywhere but I dont know how to fix it? Im a beginner so I'm really confued. Thanks in advance Notice: Undefined index: cart in /nas/students/j/j39-green/unix/public\_html/ISD5/inc/functions.inc.php on line 3 You have no items in your shopping cart ``` <?php functio...
2012/03/14
[ "https://Stackoverflow.com/questions/9709688", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1269822/" ]
Use "EMPTY": ``` <?php function writeShoppingCart() { $cart = !empty($_SESSION['cart']); if (!$cart) { return '<p>You have no items in your shopping cart</p>'; } else { // Parse the cart session variable $items = explode(',',$cart); $s = (count($items) > 1) ? 's':''; ...
try initializing your $\_SESSION with something like: ``` $_SESSION['cart'] = 0; // zero items in cart ```
9,709,688
Heya I get this error message. I've been looking everywhere but I dont know how to fix it? Im a beginner so I'm really confued. Thanks in advance Notice: Undefined index: cart in /nas/students/j/j39-green/unix/public\_html/ISD5/inc/functions.inc.php on line 3 You have no items in your shopping cart ``` <?php functio...
2012/03/14
[ "https://Stackoverflow.com/questions/9709688", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1269822/" ]
If `$_SESSION['cart']` isn't set, it throws that warning. Try: ``` $cart = isset($_SESSION['cart'])?$_SESSION['cart']:false; ```
Try this: ``` $cart = isset($_SESSION['cart']) ? $_SESSION['cart'] : NULL; ```
9,709,688
Heya I get this error message. I've been looking everywhere but I dont know how to fix it? Im a beginner so I'm really confued. Thanks in advance Notice: Undefined index: cart in /nas/students/j/j39-green/unix/public\_html/ISD5/inc/functions.inc.php on line 3 You have no items in your shopping cart ``` <?php functio...
2012/03/14
[ "https://Stackoverflow.com/questions/9709688", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1269822/" ]
Use "EMPTY": ``` <?php function writeShoppingCart() { $cart = !empty($_SESSION['cart']); if (!$cart) { return '<p>You have no items in your shopping cart</p>'; } else { // Parse the cart session variable $items = explode(',',$cart); $s = (count($items) > 1) ? 's':''; ...
That means that your session does not contain `$_SESSION['cart']` Try this instead: ``` $cart = isset($_SESSION['cart']) ? $_SESSION['cart'] : false; ```
9,709,688
Heya I get this error message. I've been looking everywhere but I dont know how to fix it? Im a beginner so I'm really confued. Thanks in advance Notice: Undefined index: cart in /nas/students/j/j39-green/unix/public\_html/ISD5/inc/functions.inc.php on line 3 You have no items in your shopping cart ``` <?php functio...
2012/03/14
[ "https://Stackoverflow.com/questions/9709688", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1269822/" ]
This means that the key 'cart' does not exist in the $\_SESSION superglobal array. If it's alright for this value to not exist, you should be doing this: ``` $cart = false; if (isset($_SESSION['cart'])) { $cart = $_SESSION['cart']; } ``` You could use something called the ternary operator, in PHP, but since you...
try initializing your $\_SESSION with something like: ``` $_SESSION['cart'] = 0; // zero items in cart ```
9,709,688
Heya I get this error message. I've been looking everywhere but I dont know how to fix it? Im a beginner so I'm really confued. Thanks in advance Notice: Undefined index: cart in /nas/students/j/j39-green/unix/public\_html/ISD5/inc/functions.inc.php on line 3 You have no items in your shopping cart ``` <?php functio...
2012/03/14
[ "https://Stackoverflow.com/questions/9709688", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1269822/" ]
If `$_SESSION['cart']` isn't set, it throws that warning. Try: ``` $cart = isset($_SESSION['cart'])?$_SESSION['cart']:false; ```
That means that your session does not contain `$_SESSION['cart']` Try this instead: ``` $cart = isset($_SESSION['cart']) ? $_SESSION['cart'] : false; ```
9,709,688
Heya I get this error message. I've been looking everywhere but I dont know how to fix it? Im a beginner so I'm really confued. Thanks in advance Notice: Undefined index: cart in /nas/students/j/j39-green/unix/public\_html/ISD5/inc/functions.inc.php on line 3 You have no items in your shopping cart ``` <?php functio...
2012/03/14
[ "https://Stackoverflow.com/questions/9709688", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1269822/" ]
If `$_SESSION['cart']` isn't set, it throws that warning. Try: ``` $cart = isset($_SESSION['cart'])?$_SESSION['cart']:false; ```
This means that the key 'cart' does not exist in the $\_SESSION superglobal array. If it's alright for this value to not exist, you should be doing this: ``` $cart = false; if (isset($_SESSION['cart'])) { $cart = $_SESSION['cart']; } ``` You could use something called the ternary operator, in PHP, but since you...
9,709,688
Heya I get this error message. I've been looking everywhere but I dont know how to fix it? Im a beginner so I'm really confued. Thanks in advance Notice: Undefined index: cart in /nas/students/j/j39-green/unix/public\_html/ISD5/inc/functions.inc.php on line 3 You have no items in your shopping cart ``` <?php functio...
2012/03/14
[ "https://Stackoverflow.com/questions/9709688", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1269822/" ]
If `$_SESSION['cart']` isn't set, it throws that warning. Try: ``` $cart = isset($_SESSION['cart'])?$_SESSION['cart']:false; ```
Use "EMPTY": ``` <?php function writeShoppingCart() { $cart = !empty($_SESSION['cart']); if (!$cart) { return '<p>You have no items in your shopping cart</p>'; } else { // Parse the cart session variable $items = explode(',',$cart); $s = (count($items) > 1) ? 's':''; ...
9,709,688
Heya I get this error message. I've been looking everywhere but I dont know how to fix it? Im a beginner so I'm really confued. Thanks in advance Notice: Undefined index: cart in /nas/students/j/j39-green/unix/public\_html/ISD5/inc/functions.inc.php on line 3 You have no items in your shopping cart ``` <?php functio...
2012/03/14
[ "https://Stackoverflow.com/questions/9709688", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1269822/" ]
Use "EMPTY": ``` <?php function writeShoppingCart() { $cart = !empty($_SESSION['cart']); if (!$cart) { return '<p>You have no items in your shopping cart</p>'; } else { // Parse the cart session variable $items = explode(',',$cart); $s = (count($items) > 1) ? 's':''; ...
Try this: ``` $cart = isset($_SESSION['cart']) ? $_SESSION['cart'] : NULL; ```
9,709,688
Heya I get this error message. I've been looking everywhere but I dont know how to fix it? Im a beginner so I'm really confued. Thanks in advance Notice: Undefined index: cart in /nas/students/j/j39-green/unix/public\_html/ISD5/inc/functions.inc.php on line 3 You have no items in your shopping cart ``` <?php functio...
2012/03/14
[ "https://Stackoverflow.com/questions/9709688", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1269822/" ]
This means that the key 'cart' does not exist in the $\_SESSION superglobal array. If it's alright for this value to not exist, you should be doing this: ``` $cart = false; if (isset($_SESSION['cart'])) { $cart = $_SESSION['cart']; } ``` You could use something called the ternary operator, in PHP, but since you...
That means that your session does not contain `$_SESSION['cart']` Try this instead: ``` $cart = isset($_SESSION['cart']) ? $_SESSION['cart'] : false; ```
9,709,688
Heya I get this error message. I've been looking everywhere but I dont know how to fix it? Im a beginner so I'm really confued. Thanks in advance Notice: Undefined index: cart in /nas/students/j/j39-green/unix/public\_html/ISD5/inc/functions.inc.php on line 3 You have no items in your shopping cart ``` <?php functio...
2012/03/14
[ "https://Stackoverflow.com/questions/9709688", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1269822/" ]
This means that the key 'cart' does not exist in the $\_SESSION superglobal array. If it's alright for this value to not exist, you should be doing this: ``` $cart = false; if (isset($_SESSION['cart'])) { $cart = $_SESSION['cart']; } ``` You could use something called the ternary operator, in PHP, but since you...
Try this: ``` $cart = isset($_SESSION['cart']) ? $_SESSION['cart'] : NULL; ```
200,627
I'm using `standalone` document class and trying to draw a TikZ picture. The picture have border which is the border of the page. I do it [like this](http://papeeria.com/p/c6949888bcd012d5fcc4ca5bd8ba79a9#/without-fontspec.tex): ``` \documentclass{standalone} \usepackage{tikz} \def\W{220} \def\H{250} \begin{document...
2014/09/11
[ "https://tex.stackexchange.com/questions/200627", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/27682/" ]
I see the effect with TexLive 2013, but not with 2014 and miktex. So you will probably have to update something (fontspec?). The effect disappears if I add `\unskip` after `\begin{document}`. So it looks like an spurious space somewhere.
[Ulrike has shown](https://tex.stackexchange.com/a/200655) that this is a `fontspec` issue. The actually faulty code is ``` \tl_put_right:Nn \document { \tl_set_eq:NN \cyrillicencoding \g_fontspec_encoding_tl \tl_set_eq:NN \latinencoding \g_fontspec_encoding_tl } ``` which is used to do something 'really l...
39,065,933
First and foremost, this is my 1st time writing PHP code, so please forgive my newbie'isms. I have a login form with 3 submit buttons (post method) named login, register and forgot. If I select login button, the login function in the PHP code gets called, however, the same is not true for the register and forgot butt...
2016/08/21
[ "https://Stackoverflow.com/questions/39065933", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3254596/" ]
HTML forms can not contain more than one input of type "submit" (which means others would not be functioning) **register** and **forgot** are links rather than buttons. Instead you could use: ``` <a href="/register.php">Register</a> ``` Another alternative is to use javascript to make these buttons act as links.
After copying and pasting my code into another file. It worked without any issues. The multiple submit buttons work without any issues.
7,873,972
I'm rewriting/converting some VB-Code: ``` Dim dt As New System.Data.DataTable() Dim dr As System.Data.DataRow = dt.NewRow() Dim item = dr.Item("myItem") ``` C#: ``` System.Data.DataTable dt = new System.Data.DataTable(); System.Data.DataRow dr = dt.NewRow(); var item = dr.Item["myItem"]; ``` I can't make it run ...
2011/10/24
[ "https://Stackoverflow.com/questions/7873972", "https://Stackoverflow.com", "https://Stackoverflow.com/users/598516/" ]
Try like this: ``` var item = dr["myItem"]; ``` In C# you can access the [indexer property](http://msdn.microsoft.com/en-us/library/2549tw02.aspx) directly. And the [DataRow.Item](http://msdn.microsoft.com/en-us/library/system.data.datarow.item.aspx) property is defined as indexer.
There is actually no "Item" property in C#. In VB the DataRow cell access is defined like this: ```vb Default Public Property Item ( column As DataColumn ) As Object ``` So there is a literal "Item" property. However, in C# it is defined like this: ``` public object this[ DataColumn column ] { get; set; } ...
29,014
There is an existing light fixture and switch for the light fixture. I want to add a bath fan with its own switch. What is the easiest way?
2013/06/24
[ "https://diy.stackexchange.com/questions/29014", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/13644/" ]
If you're not comfortable working with electricity then hire a professional. Improper wiring and the resulting fire isn't worth saving a few bucks. That said: Your existing fan/light combo is likely connected using a 2-conductor cable (like 14-2)... but for two separately switched circuits you'll need three conductor...
You need to check to see how many wires you have going into your current switch from the fan. It is most likely that you have a black and a white. If this is the case you will need to run either 12-3 or 14-3 wiring from fan to switch. Size dependent on amperage of circuit. 15A gets 14 and 20A gets 12-3. 12-3 will act...
10,373,163
There a search service (PHP) which sends search query via POST. I would like to use that search engine in my app. The PHP service does not have a public API. Is there a way to enter search query and to fetch a POST request to see the name of parameters? I would use then later to send a POST requests from my app and to...
2012/04/29
[ "https://Stackoverflow.com/questions/10373163", "https://Stackoverflow.com", "https://Stackoverflow.com/users/437039/" ]
Have you tried viewing the source on the search form to get the POST parameters? i.e. the name of the input box **Edit** take for example the php form on tizag site ``` <html><body> <h4>Tizag Art Supply Order Form</h4> <form action="process.php" method="post"> <select name="item"> <option>Paint</option> <option>Bru...
Whilst this is certainly something you could do with [curl in PHP](http://php.net/manual/en/book.curl.php), you should consider the possible consequences of scraping a government site to collect and reuse it's data. Of course, I don't know how you will use the data, the importance of the data, the frequency of the req...
377,443
I was adventuring, and reset my spawn by accident, by interacting with a bed in a random village. I never wrote down the coordinates or followed a compass so I’m completely lost. I worked really hard, and since I’m on a Nintendo switch it’s confusing with what everyone’s saying? How do I get back home? Is there any co...
2020/11/02
[ "https://gaming.stackexchange.com/questions/377443", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/260711/" ]
There are a few ways you may be able to get back home. The simplest is to craft a compass which will point you to the world spawn. It's unclear from your post whether you used commands to change the spawn point to a village, or used a bed, but assuming you just used a bed then the compass would point you towards 0,0 w...
If you did it in Survival, you could make a copy of the world, find where you had as the spawn/your base, and write down the coordinates (using creative to find the base)
377,443
I was adventuring, and reset my spawn by accident, by interacting with a bed in a random village. I never wrote down the coordinates or followed a compass so I’m completely lost. I worked really hard, and since I’m on a Nintendo switch it’s confusing with what everyone’s saying? How do I get back home? Is there any co...
2020/11/02
[ "https://gaming.stackexchange.com/questions/377443", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/260711/" ]
There are a few ways you may be able to get back home. The simplest is to craft a compass which will point you to the world spawn. It's unclear from your post whether you used commands to change the spawn point to a village, or used a bed, but assuming you just used a bed then the compass would point you towards 0,0 w...
there are couple of ways you can make your way to your base 1 - craft a compass crafting a compass which will point to the world spawn [![](https://i.stack.imgur.com/W00Kp.png)](https://i.stack.imgur.com/W00Kp.png) 2 - when you go to settings you should see your seed copy the seed and make a another world with the ...
377,443
I was adventuring, and reset my spawn by accident, by interacting with a bed in a random village. I never wrote down the coordinates or followed a compass so I’m completely lost. I worked really hard, and since I’m on a Nintendo switch it’s confusing with what everyone’s saying? How do I get back home? Is there any co...
2020/11/02
[ "https://gaming.stackexchange.com/questions/377443", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/260711/" ]
There are a few ways you may be able to get back home. The simplest is to craft a compass which will point you to the world spawn. It's unclear from your post whether you used commands to change the spawn point to a village, or used a bed, but assuming you just used a bed then the compass would point you towards 0,0 w...
`/tp @p 0 ~ 0` This command will tp you to the world spawn. This should help you then navigate to your base, assuming your base is near the world spawn. And unless your base is underground it should help to make a bunch of maps and explore the area around spawn and look for any unusual blobs of color shaped like your b...
377,443
I was adventuring, and reset my spawn by accident, by interacting with a bed in a random village. I never wrote down the coordinates or followed a compass so I’m completely lost. I worked really hard, and since I’m on a Nintendo switch it’s confusing with what everyone’s saying? How do I get back home? Is there any co...
2020/11/02
[ "https://gaming.stackexchange.com/questions/377443", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/260711/" ]
there are couple of ways you can make your way to your base 1 - craft a compass crafting a compass which will point to the world spawn [![](https://i.stack.imgur.com/W00Kp.png)](https://i.stack.imgur.com/W00Kp.png) 2 - when you go to settings you should see your seed copy the seed and make a another world with the ...
If you did it in Survival, you could make a copy of the world, find where you had as the spawn/your base, and write down the coordinates (using creative to find the base)
377,443
I was adventuring, and reset my spawn by accident, by interacting with a bed in a random village. I never wrote down the coordinates or followed a compass so I’m completely lost. I worked really hard, and since I’m on a Nintendo switch it’s confusing with what everyone’s saying? How do I get back home? Is there any co...
2020/11/02
[ "https://gaming.stackexchange.com/questions/377443", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/260711/" ]
If you did it in Survival, you could make a copy of the world, find where you had as the spawn/your base, and write down the coordinates (using creative to find the base)
`/tp @p 0 ~ 0` This command will tp you to the world spawn. This should help you then navigate to your base, assuming your base is near the world spawn. And unless your base is underground it should help to make a bunch of maps and explore the area around spawn and look for any unusual blobs of color shaped like your b...
377,443
I was adventuring, and reset my spawn by accident, by interacting with a bed in a random village. I never wrote down the coordinates or followed a compass so I’m completely lost. I worked really hard, and since I’m on a Nintendo switch it’s confusing with what everyone’s saying? How do I get back home? Is there any co...
2020/11/02
[ "https://gaming.stackexchange.com/questions/377443", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/260711/" ]
there are couple of ways you can make your way to your base 1 - craft a compass crafting a compass which will point to the world spawn [![](https://i.stack.imgur.com/W00Kp.png)](https://i.stack.imgur.com/W00Kp.png) 2 - when you go to settings you should see your seed copy the seed and make a another world with the ...
`/tp @p 0 ~ 0` This command will tp you to the world spawn. This should help you then navigate to your base, assuming your base is near the world spawn. And unless your base is underground it should help to make a bunch of maps and explore the area around spawn and look for any unusual blobs of color shaped like your b...
42,638,440
I am having a hard time getting javascript to work without reloading a page. I believe the problem has to do with turbo links. I am setting an onsubmit listener to a form like this ``` <%= form_for @cart, url: cart_path, html: {onsubmit: "addCart(event, #{@product.id})"} do |c| %> ``` I am then submitting the form...
2017/03/07
[ "https://Stackoverflow.com/questions/42638440", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1599104/" ]
This could be a turbolinks issue. In your javascript file, surround your javascript code with ``` $(document).on('turbolinks:load', function() { // your code }); ```
So this had to do with turbolinks. I couldn't figure out how to make it work with turbo links so I removed the `//= require turbolinks` line from `assets/javascripts/application.js` file.
30,191,851
I am trying to figure out if Python/Numpy is a viable alternative to develop my numerical software which is already available in C++. In order to get performance in Python/Numpy, one need to "vectorize" the code. But it turns out that as soon as I move away from very simple examples, I struggle to vectorize the code (I...
2015/05/12
[ "https://Stackoverflow.com/questions/30191851", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3763545/" ]
You can do step 1. with numpy efficiently: ``` 1.0 + np.arange(n + 1) / n ``` however I think you would need the np.vectorize() method to feed back x into your calculated values and it's not an efficient function (basically a wrapper for a python loop). If you can use scipy then there are built in methods that might...
I'm not looking to wave small snippets of code as a solution, but here's something to get you started. I have a strong suspicion that you're having troubles just declaring such an array in python without spending too much time on it, so I'll mostly help you out there. As far as the square roots come in, please add yo...
30,191,851
I am trying to figure out if Python/Numpy is a viable alternative to develop my numerical software which is already available in C++. In order to get performance in Python/Numpy, one need to "vectorize" the code. But it turns out that as soon as I move away from very simple examples, I struggle to vectorize the code (I...
2015/05/12
[ "https://Stackoverflow.com/questions/30191851", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3763545/" ]
Here's a toy example. Notice that often vectorization means writing your code as if you're manipulating numbers, and letting numpy do its magic: ``` >>> import numpy as np >>> a = np.array([1., 2., 3.]) >>> def f(x): ... return x**2 - a, 2.*x # function and derivative >>> >>> def newt(f, x0): ... x = np.asar...
I'm not looking to wave small snippets of code as a solution, but here's something to get you started. I have a strong suspicion that you're having troubles just declaring such an array in python without spending too much time on it, so I'll mostly help you out there. As far as the square roots come in, please add yo...
30,191,851
I am trying to figure out if Python/Numpy is a viable alternative to develop my numerical software which is already available in C++. In order to get performance in Python/Numpy, one need to "vectorize" the code. But it turns out that as soon as I move away from very simple examples, I struggle to vectorize the code (I...
2015/05/12
[ "https://Stackoverflow.com/questions/30191851", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3763545/" ]
You can do step 1. with numpy efficiently: ``` 1.0 + np.arange(n + 1) / n ``` however I think you would need the np.vectorize() method to feed back x into your calculated values and it's not an efficient function (basically a wrapper for a python loop). If you can use scipy then there are built in methods that might...
Here's a toy example. Notice that often vectorization means writing your code as if you're manipulating numbers, and letting numpy do its magic: ``` >>> import numpy as np >>> a = np.array([1., 2., 3.]) >>> def f(x): ... return x**2 - a, 2.*x # function and derivative >>> >>> def newt(f, x0): ... x = np.asar...
30,191,851
I am trying to figure out if Python/Numpy is a viable alternative to develop my numerical software which is already available in C++. In order to get performance in Python/Numpy, one need to "vectorize" the code. But it turns out that as soon as I move away from very simple examples, I struggle to vectorize the code (I...
2015/05/12
[ "https://Stackoverflow.com/questions/30191851", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3763545/" ]
You can do step 1. with numpy efficiently: ``` 1.0 + np.arange(n + 1) / n ``` however I think you would need the np.vectorize() method to feed back x into your calculated values and it's not an efficient function (basically a wrapper for a python loop). If you can use scipy then there are built in methods that might...
Obviously I'm 6 years late to this party, but this question is a common stumbling block for people in effectively using numpy for real scientific work. The basic idea is covered in @ev-br's answer. The OP points out that the solution offered there (even modified to stop iterating when a convergence criterion is met rat...
30,191,851
I am trying to figure out if Python/Numpy is a viable alternative to develop my numerical software which is already available in C++. In order to get performance in Python/Numpy, one need to "vectorize" the code. But it turns out that as soon as I move away from very simple examples, I struggle to vectorize the code (I...
2015/05/12
[ "https://Stackoverflow.com/questions/30191851", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3763545/" ]
Here's a toy example. Notice that often vectorization means writing your code as if you're manipulating numbers, and letting numpy do its magic: ``` >>> import numpy as np >>> a = np.array([1., 2., 3.]) >>> def f(x): ... return x**2 - a, 2.*x # function and derivative >>> >>> def newt(f, x0): ... x = np.asar...
Obviously I'm 6 years late to this party, but this question is a common stumbling block for people in effectively using numpy for real scientific work. The basic idea is covered in @ev-br's answer. The OP points out that the solution offered there (even modified to stop iterating when a convergence criterion is met rat...
40,381,697
Suppose that we perform DFS on this graph by obeying the following rules: • Start from vertex 1. • At every vertex, process its out-neighbors in ascending order of id. • Whenever we need to restart, do it from the white vertex with the smallest id Show the resulting DFS forest. Furthermore, for every vertex, indica...
2016/11/02
[ "https://Stackoverflow.com/questions/40381697", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6821180/" ]
You need an `except` clause to use `else`: > > The `try ... except` statement has an optional `else` clause, which, when > present, must **follow** all `except` clauses > [*Emphasis mine*] > > >
I just saw it from the python document page, so I'm just gonna quote what it says to you: > > The try ... except statement has an optional else clause, which, when present, must follow all except clauses. It is useful for code that must be executed if the try clause does not raise an exception. For example: > > > ...
57,546,337
I want to open a file (`file`) that is stored in a folder (`Source`) which is in the same directory as the current workbook. I get a runtime error 1004 indicating that it the file can't be located. What am I doing worng? ``` Set x = Workbooks.Open(ThisWorkbook.Path & "\Source\file*.xlsx") ```
2019/08/18
[ "https://Stackoverflow.com/questions/57546337", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3435347/" ]
Since you want the wildcard to stay, you need to loop through the files in the folder. Something like this may be of interest to you: ``` Sub FileOpen() Dim sPath As String Dim sFile As String Dim wb As Workbook sPath = ThisWorkbook.Path & "\Source\" sFile = Dir(sPath & "file*.xlsx") ' Loops while there...
Replace the wildcard with actual filename.
57,546,337
I want to open a file (`file`) that is stored in a folder (`Source`) which is in the same directory as the current workbook. I get a runtime error 1004 indicating that it the file can't be located. What am I doing worng? ``` Set x = Workbooks.Open(ThisWorkbook.Path & "\Source\file*.xlsx") ```
2019/08/18
[ "https://Stackoverflow.com/questions/57546337", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3435347/" ]
Since you want the wildcard to stay, you need to loop through the files in the folder. Something like this may be of interest to you: ``` Sub FileOpen() Dim sPath As String Dim sFile As String Dim wb As Workbook sPath = ThisWorkbook.Path & "\Source\" sFile = Dir(sPath & "file*.xlsx") ' Loops while there...
Set x = Workbooks.Open(ThisWorkbook.Path & "\Source\file.xlsx" I changed the file\*.xlsx to file. xlsx...hope your code works. thanks.
37,242,600
I'm struggling with this and I'm not so clear about it. Let's say I have a function in a class: ``` class my_class(osv.Model): _name = 'my_class' _description = 'my description' def func (self, cr, uid, ids, name, arg, context=None): res = dict((id, 0) for id in ids) sur_res_obj = self.po...
2016/05/15
[ "https://Stackoverflow.com/questions/37242600", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2089267/" ]
Since you're using odoo8 you should use the new API. from the docs > > In the new API the notion of Environment is introduced. Its main > objective is to provide an encapsulation around cursor, user\_id, > model, and context, Recordset and caches > > > ``` def my_func(self): other_object = self.env['another...
``` def example(self, cr, uid, ids, context=None): otherClass = self.pool.get('my_class') ... otherClass.func(cr, uid, otherClassIds, name, arg, context) ``` [More information.](http://abhishek-jaiswal.github.io/blog/odoov8/2014/11/15/odoo-v8-decorator.html)
37,916,763
I need to remove a string ("DTE\_Field\_") from the id of elements in the dom. ``` <select id="DTE_Field_CD_PAIS" dependent-group="PAIS" dependent-group-level="1" class="form-control"></select> var str=$(el).attr("id"); str.replace("DTE_Field_",""); ```
2016/06/20
[ "https://Stackoverflow.com/questions/37916763", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1883099/" ]
Use [**`attr()`** method with callback](http://api.jquery.com/attr/#attr-attributeName-function). That will iterate over element and you can get old attribute value as callback argument you can update attribute by returning string where `DTE_FIELD` using **[`String#replace`](https://developer.mozilla.org/en-US/docs/Web...
``` $('[id^="DTE_FIELD_"]').each(function () { $(this).attr('id', $(this).attr('id').replace('DTE_FIELD_','')); }); ```
37,916,763
I need to remove a string ("DTE\_Field\_") from the id of elements in the dom. ``` <select id="DTE_Field_CD_PAIS" dependent-group="PAIS" dependent-group-level="1" class="form-control"></select> var str=$(el).attr("id"); str.replace("DTE_Field_",""); ```
2016/06/20
[ "https://Stackoverflow.com/questions/37916763", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1883099/" ]
You can split the string(`id`) and use `pop()` method to get the last element of the array ``` var str=$('#DTE_Field_CD_PAIS').attr("id"); alert(str.split("DTE_Field_").pop()); ``` [**JSFIDDLE**](https://jsfiddle.net/vasi_32/g6Lu7ywr/1/)
``` $('[id^="DTE_FIELD_"]').each(function () { $(this).attr('id', $(this).attr('id').replace('DTE_FIELD_','')); }); ```
37,916,763
I need to remove a string ("DTE\_Field\_") from the id of elements in the dom. ``` <select id="DTE_Field_CD_PAIS" dependent-group="PAIS" dependent-group-level="1" class="form-control"></select> var str=$(el).attr("id"); str.replace("DTE_Field_",""); ```
2016/06/20
[ "https://Stackoverflow.com/questions/37916763", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1883099/" ]
Use like this: ``` var string=$('#DTE_Field_CD_PAIS').attr("id"); console.log(str.split("DTE_Field_").pop()); ```
``` $('[id^="DTE_FIELD_"]').each(function () { $(this).attr('id', $(this).attr('id').replace('DTE_FIELD_','')); }); ```
2,880,293
$$I=\large \int\_{0}^{\infty}\left(x^2-3x+1\right)e^{-x}\ln^3(x)\mathrm dx$$ $$e^{-x}=\sum\_{n=0}^{\infty}\frac{(-x)^n}{n!}$$ $$I=\large \sum\_{n=0}^{\infty}\frac{(-1)^n}{n!}\int\_{0}^{\infty}\left(x^2-3x+1\right)x^n\ln^3(x)\mathrm dx$$ $$J=\int \left(x^2-3x+1\right)x^n\ln^3(x)\mathrm dx$$ We can evaluate $J$ by in...
2018/08/12
[ "https://math.stackexchange.com/questions/2880293", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
Here's a way that only requires the identity $\Gamma'(1) = - \gamma$ , since all derivatives of higher order cancel: \begin{align} I &=\int \limits\_0^\infty (x^2 - 3x+1) \ln^3 (x) \mathrm{e}^{-x} \, \mathrm{d} x \\ &= \left[\frac{\mathrm{d}^2}{\mathrm{d} t^2} + 3 \frac{\mathrm{d}}{\mathrm{d}t}+1 \right] \int \limits\_...
Though it's not good practice, we will ignore any constants when evaluating indefinite integrals, as the end result is definite. **Step I:** Let's start with the integral $$G\_1=\int\ln x\,dx=x(\ln x-1).$$ Integration by parts gives $$G\_2=\int\ln^2x\,dx=[x\ln x(\ln x-1)]-\int(\ln x-1)\,dx=x(\ln^2x-2\ln x+2)$$ and si...
2,880,293
$$I=\large \int\_{0}^{\infty}\left(x^2-3x+1\right)e^{-x}\ln^3(x)\mathrm dx$$ $$e^{-x}=\sum\_{n=0}^{\infty}\frac{(-x)^n}{n!}$$ $$I=\large \sum\_{n=0}^{\infty}\frac{(-1)^n}{n!}\int\_{0}^{\infty}\left(x^2-3x+1\right)x^n\ln^3(x)\mathrm dx$$ $$J=\int \left(x^2-3x+1\right)x^n\ln^3(x)\mathrm dx$$ We can evaluate $J$ by in...
2018/08/12
[ "https://math.stackexchange.com/questions/2880293", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
Though it's not good practice, we will ignore any constants when evaluating indefinite integrals, as the end result is definite. **Step I:** Let's start with the integral $$G\_1=\int\ln x\,dx=x(\ln x-1).$$ Integration by parts gives $$G\_2=\int\ln^2x\,dx=[x\ln x(\ln x-1)]-\int(\ln x-1)\,dx=x(\ln^2x-2\ln x+2)$$ and si...
The form of the integral takes on the form of the product of a power function, $e^{-x}$, and an integer power of a logarithm. This allows us to consider the integral $$ \int\_{0}^{\infty}x^{s-1+\epsilon}\,e^{-x}\,\mathrm{d}x = \int\_{0}^{\infty}x^{s-1}e^{\epsilon\ln x}\,e^{-x}\,\mathrm{d}x = \sum\_{n=0}^{\infty}\frac{...
2,880,293
$$I=\large \int\_{0}^{\infty}\left(x^2-3x+1\right)e^{-x}\ln^3(x)\mathrm dx$$ $$e^{-x}=\sum\_{n=0}^{\infty}\frac{(-x)^n}{n!}$$ $$I=\large \sum\_{n=0}^{\infty}\frac{(-1)^n}{n!}\int\_{0}^{\infty}\left(x^2-3x+1\right)x^n\ln^3(x)\mathrm dx$$ $$J=\int \left(x^2-3x+1\right)x^n\ln^3(x)\mathrm dx$$ We can evaluate $J$ by in...
2018/08/12
[ "https://math.stackexchange.com/questions/2880293", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
Here's a way that only requires the identity $\Gamma'(1) = - \gamma$ , since all derivatives of higher order cancel: \begin{align} I &=\int \limits\_0^\infty (x^2 - 3x+1) \ln^3 (x) \mathrm{e}^{-x} \, \mathrm{d} x \\ &= \left[\frac{\mathrm{d}^2}{\mathrm{d} t^2} + 3 \frac{\mathrm{d}}{\mathrm{d}t}+1 \right] \int \limits\_...
It is pretty straightforward to differentiate three times $$ \int\_{0}^{+\infty}(x^2-3x+1)x^s e^{-x}\,dx = s^2\,\Gamma(s+1)$$ then consider the limit as $s\to 0^+$. The final outcome is $\color{red}{-6\,\gamma}=6\,\Gamma'(1)$ since $s^2\,\Gamma(s+1)$ clearly has a zero of order $2$ at the origin.
2,880,293
$$I=\large \int\_{0}^{\infty}\left(x^2-3x+1\right)e^{-x}\ln^3(x)\mathrm dx$$ $$e^{-x}=\sum\_{n=0}^{\infty}\frac{(-x)^n}{n!}$$ $$I=\large \sum\_{n=0}^{\infty}\frac{(-1)^n}{n!}\int\_{0}^{\infty}\left(x^2-3x+1\right)x^n\ln^3(x)\mathrm dx$$ $$J=\int \left(x^2-3x+1\right)x^n\ln^3(x)\mathrm dx$$ We can evaluate $J$ by in...
2018/08/12
[ "https://math.stackexchange.com/questions/2880293", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
Here's a way that only requires the identity $\Gamma'(1) = - \gamma$ , since all derivatives of higher order cancel: \begin{align} I &=\int \limits\_0^\infty (x^2 - 3x+1) \ln^3 (x) \mathrm{e}^{-x} \, \mathrm{d} x \\ &= \left[\frac{\mathrm{d}^2}{\mathrm{d} t^2} + 3 \frac{\mathrm{d}}{\mathrm{d}t}+1 \right] \int \limits\_...
The form of the integral takes on the form of the product of a power function, $e^{-x}$, and an integer power of a logarithm. This allows us to consider the integral $$ \int\_{0}^{\infty}x^{s-1+\epsilon}\,e^{-x}\,\mathrm{d}x = \int\_{0}^{\infty}x^{s-1}e^{\epsilon\ln x}\,e^{-x}\,\mathrm{d}x = \sum\_{n=0}^{\infty}\frac{...
2,880,293
$$I=\large \int\_{0}^{\infty}\left(x^2-3x+1\right)e^{-x}\ln^3(x)\mathrm dx$$ $$e^{-x}=\sum\_{n=0}^{\infty}\frac{(-x)^n}{n!}$$ $$I=\large \sum\_{n=0}^{\infty}\frac{(-1)^n}{n!}\int\_{0}^{\infty}\left(x^2-3x+1\right)x^n\ln^3(x)\mathrm dx$$ $$J=\int \left(x^2-3x+1\right)x^n\ln^3(x)\mathrm dx$$ We can evaluate $J$ by in...
2018/08/12
[ "https://math.stackexchange.com/questions/2880293", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
It is pretty straightforward to differentiate three times $$ \int\_{0}^{+\infty}(x^2-3x+1)x^s e^{-x}\,dx = s^2\,\Gamma(s+1)$$ then consider the limit as $s\to 0^+$. The final outcome is $\color{red}{-6\,\gamma}=6\,\Gamma'(1)$ since $s^2\,\Gamma(s+1)$ clearly has a zero of order $2$ at the origin.
The form of the integral takes on the form of the product of a power function, $e^{-x}$, and an integer power of a logarithm. This allows us to consider the integral $$ \int\_{0}^{\infty}x^{s-1+\epsilon}\,e^{-x}\,\mathrm{d}x = \int\_{0}^{\infty}x^{s-1}e^{\epsilon\ln x}\,e^{-x}\,\mathrm{d}x = \sum\_{n=0}^{\infty}\frac{...
16,124,667
Hi i am working in java and want to know how String objects are created in the String pool and how they are managed. So in the following example i am creating two Strings s and s1,so can anyone explain me how many Objects are created in LIne1?Also how many Objects are eligible for garbage collection in Line3? ``` ...
2013/04/20
[ "https://Stackoverflow.com/questions/16124667", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2303011/" ]
Only one object is created `"xy"` . compiler does it for optimization. No object is eligible for garbage collection.
It would create one object `xy` in the String constant pool area. As `"x"+"y"` would be evaluated during compilation. Additionally, garbage collector cannot access String constant pool area. Reference: <https://docs.oracle.com/javase/specs/jls/se7/html/jls-3.html#jls-3.10.5>
19,423,030
I am using c# MVC 4 and have embedded a Report Viewer aspx page to render reports from SSRS. I am using Sql Server 2008R2, Microsoft.ReportViewer.WebForms version 11.0. Firstly the issue I am facing, I am using session variables within the project to hold values relative to the site. These have nothing to do with SSR...
2013/10/17
[ "https://Stackoverflow.com/questions/19423030", "https://Stackoverflow.com", "https://Stackoverflow.com/users/128756/" ]
I ran into the same issue. It appears that when the objects that the ReportViewer puts in Session are accessed, they try to ping the report server. If the report has expired, a ReportServerException gets thrown, which is expected behavior when a user is still viewing an expired report, but not when they're no longer on...
On thing to consider with Patrick J. Brown`s answer: think twice before removing Session values in the try block, may belong to other browser window/tab.
29,830,501
I'm quite a newbie with SQL. I'm currently working on an **Oracle database** and I've created a report that pulls up data depending on the date range parameter. **The code is as follows:** ``` SELECT DISTINCT C.CUSTOMER_CODE , MS.SALESMAN_NAME , SUM(C.REVENUE_AMT) Rev_Amt FROM C_REVENUE_ANALYSIS C , M_CUS...
2015/04/23
[ "https://Stackoverflow.com/questions/29830501", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4403824/" ]
Change `id` to `name` - after that you can access value of input field ```js function myFunction(form, event) { event.preventDefault(); alert(form.num_cluster.value); } ``` ```html <form onsubmit="return myFunction(this, event)"> Num. Cluster: <input name="num_cluster" type="text"> <input type="submit"> ...
``` function myFunction(){ var value=document.getElementById("num_cluster").value; /// value has the actual thing that you need //... rest of your code } ``` you can use this statement even in onsubmit event by directly writing java script there.
37,014,685
So I am trying to make a valid login for my web dev class' final project. Whenever I try to log in with the correct credentials, I always get redirected to the "something.php" page, and I never receive any of the output that I put in my code. This even happens when I input valid login credentials.I know this isn't a se...
2016/05/03
[ "https://Stackoverflow.com/questions/37014685", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5948316/" ]
As other have suggested you should create the `Point` class: ``` public partial class Point { public int X { get; set; } public int Y { get; set; } public Point(int x, int y) { this.X = x; this.Y = y; } } ``` And, let's encapsulate the *functions* for computing distance and total...
You can change the for loop to Foreach to make it more readable and rather than using index to fetch values. ``` private static int CalculateMinimumTotalCost(List<Tuple<int, int>> tuples) { int minimumCost = 0; Tuple<int, int> currentTuple = tuples.First(); foreach (Tuple<i...
5,605,181
Is it possible to disable the execution of the logger during testing? I have this class ``` public class UnitTestMe { private final MockMe mockMe; private final SomethingElse something; private final Logger logger = LoggerFactory.getLogger(this.getClass().getClass()); public UnitTestMe(MockMe mockM...
2011/04/09
[ "https://Stackoverflow.com/questions/5605181", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
**Poor answer**: first decrease logging level to `WARN` or `ERROR` for this logger. Then, surround logging statement with `isInfoEnabled()`: ``` if(logger.isInfoEnabled()) logger.info("Executing toTest. MockMe a: {}, Foo: b: {}", mockMe.toString(), something.foo().bar()); ``` --- **Better one**: it looks a bit ...
You can use `try catch NullPointerException`. If your test method want to test NullPointerException it will be better us expect NullPointerException ``` @expect(NullPointerException.class) public void testMethod() { //your test method logic } ```
5,605,181
Is it possible to disable the execution of the logger during testing? I have this class ``` public class UnitTestMe { private final MockMe mockMe; private final SomethingElse something; private final Logger logger = LoggerFactory.getLogger(this.getClass().getClass()); public UnitTestMe(MockMe mockM...
2011/04/09
[ "https://Stackoverflow.com/questions/5605181", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
**Poor answer**: first decrease logging level to `WARN` or `ERROR` for this logger. Then, surround logging statement with `isInfoEnabled()`: ``` if(logger.isInfoEnabled()) logger.info("Executing toTest. MockMe a: {}, Foo: b: {}", mockMe.toString(), something.foo().bar()); ``` --- **Better one**: it looks a bit ...
Your logging statement introduce an additional requirement for the mocking of `something`. You must make it give a non-null value returned for foo(), or rewrite your logging statements to avoid introducing these extra things.
5,605,181
Is it possible to disable the execution of the logger during testing? I have this class ``` public class UnitTestMe { private final MockMe mockMe; private final SomethingElse something; private final Logger logger = LoggerFactory.getLogger(this.getClass().getClass()); public UnitTestMe(MockMe mockM...
2011/04/09
[ "https://Stackoverflow.com/questions/5605181", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
**Poor answer**: first decrease logging level to `WARN` or `ERROR` for this logger. Then, surround logging statement with `isInfoEnabled()`: ``` if(logger.isInfoEnabled()) logger.info("Executing toTest. MockMe a: {}, Foo: b: {}", mockMe.toString(), something.foo().bar()); ``` --- **Better one**: it looks a bit ...
You can suppress the execution of logger ### usecase for PowerMockito: ``` // this is to suppress for logger.error(Exception e) PowerMockito.doNothing().when(logger, "error", (Exception) any(Exception.class)); // this is to suppress for logger.debug(String message) PowerMockito.doNothing().when(logger, "debug",anySt...
5,605,181
Is it possible to disable the execution of the logger during testing? I have this class ``` public class UnitTestMe { private final MockMe mockMe; private final SomethingElse something; private final Logger logger = LoggerFactory.getLogger(this.getClass().getClass()); public UnitTestMe(MockMe mockM...
2011/04/09
[ "https://Stackoverflow.com/questions/5605181", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Your logging statement introduce an additional requirement for the mocking of `something`. You must make it give a non-null value returned for foo(), or rewrite your logging statements to avoid introducing these extra things.
You can use `try catch NullPointerException`. If your test method want to test NullPointerException it will be better us expect NullPointerException ``` @expect(NullPointerException.class) public void testMethod() { //your test method logic } ```
5,605,181
Is it possible to disable the execution of the logger during testing? I have this class ``` public class UnitTestMe { private final MockMe mockMe; private final SomethingElse something; private final Logger logger = LoggerFactory.getLogger(this.getClass().getClass()); public UnitTestMe(MockMe mockM...
2011/04/09
[ "https://Stackoverflow.com/questions/5605181", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
You can suppress the execution of logger ### usecase for PowerMockito: ``` // this is to suppress for logger.error(Exception e) PowerMockito.doNothing().when(logger, "error", (Exception) any(Exception.class)); // this is to suppress for logger.debug(String message) PowerMockito.doNothing().when(logger, "debug",anySt...
You can use `try catch NullPointerException`. If your test method want to test NullPointerException it will be better us expect NullPointerException ``` @expect(NullPointerException.class) public void testMethod() { //your test method logic } ```
5,605,181
Is it possible to disable the execution of the logger during testing? I have this class ``` public class UnitTestMe { private final MockMe mockMe; private final SomethingElse something; private final Logger logger = LoggerFactory.getLogger(this.getClass().getClass()); public UnitTestMe(MockMe mockM...
2011/04/09
[ "https://Stackoverflow.com/questions/5605181", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Your logging statement introduce an additional requirement for the mocking of `something`. You must make it give a non-null value returned for foo(), or rewrite your logging statements to avoid introducing these extra things.
You can suppress the execution of logger ### usecase for PowerMockito: ``` // this is to suppress for logger.error(Exception e) PowerMockito.doNothing().when(logger, "error", (Exception) any(Exception.class)); // this is to suppress for logger.debug(String message) PowerMockito.doNothing().when(logger, "debug",anySt...
36,344,180
I am working on filtering out a massive dataset that reads in as a list. I need to filter out special markings and am getting stuck on some of them. Here is what I currently have: ``` library(R.utils) library(stringr) gunzip("movies.list.gz") #open file movies <- readLines("movies.list") #read lines in movies <- gsub...
2016/03/31
[ "https://Stackoverflow.com/questions/36344180", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5970435/" ]
out.print("\""); This solution ended up being the one that worked. My editor kept telling me that it wasn't valid code, but it ran just fine.
print this instead: ``` out.print("&quot;"); ```
254,551
If using Python on a Linux machine, which of the following would be faster? Why? 1. Creating a file at the very beginning of the program, writing very large amounts of data (text), closing it, then splitting the large file up into many smaller files at the very end of the program. 2. Throughout the program's span, man...
2014/08/27
[ "https://softwareengineering.stackexchange.com/questions/254551", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/143527/" ]
To answer your question, you really should benchmark (i.e. measure the execution time of several variants of your program). I guess it might depend on how many small files you need (10 thousand files is not the same as 10 billion files), and what file system you are using. You could use `tmpfs` file systems. It also ob...
I think it doesn't so much depend on the programming language, but on how Linux (and other systems) handle files: For each file that's created, an inode is created that contains meta information about the file. Therefore it is faster creating one large file than a myriad of smaller ones. Regarding RAM, the OS should t...
24,893,236
[Material design](http://www.google.com/design/spec/material-design/introduction.html#introduction-principles) makes a huge emphasis on the metaphor of "sheets of paper". To make these, shadows are essential. Since Material design is a philosophy and **not an API** (despite it being built into L), this should be done a...
2014/07/22
[ "https://Stackoverflow.com/questions/24893236", "https://Stackoverflow.com", "https://Stackoverflow.com/users/453435/" ]
here is just a rough sample ... ``` <?xml version="1.0" encoding="utf-8"?> ``` ``` <!-- Drop Shadow Stack --> <item> <shape android:shape="oval"> <corners android:radius="64dp"/> <solid android:color="#009A3D"/> <size android:width="64dp" android:height="64dp"/> ...
The floating action button (with shadow) can be emulated on old platforms with a simple java class. I'm using Faiz Malkani's version here: <https://github.com/FaizMalkani/FloatingActionButton> [Note, that to get it compatible back to Gingerbread you'll need to put some SDK version checks around the animations and tra...
24,893,236
[Material design](http://www.google.com/design/spec/material-design/introduction.html#introduction-principles) makes a huge emphasis on the metaphor of "sheets of paper". To make these, shadows are essential. Since Material design is a philosophy and **not an API** (despite it being built into L), this should be done a...
2014/07/22
[ "https://Stackoverflow.com/questions/24893236", "https://Stackoverflow.com", "https://Stackoverflow.com/users/453435/" ]
Rendering shadows on pre-Lollipop is not easy, but possible. The trick is that a shadow is simply a black, blured shape of a view. You can do that by yourself. 1. Draw your shadow-casting view to a bitmap with LightingColorFilter(0,0) set 2. Blur it using ScriptIntrisincBlur 3. Draw the shape 4. Draw the view on top o...
The floating action button (with shadow) can be emulated on old platforms with a simple java class. I'm using Faiz Malkani's version here: <https://github.com/FaizMalkani/FloatingActionButton> [Note, that to get it compatible back to Gingerbread you'll need to put some SDK version checks around the animations and tra...
24,893,236
[Material design](http://www.google.com/design/spec/material-design/introduction.html#introduction-principles) makes a huge emphasis on the metaphor of "sheets of paper". To make these, shadows are essential. Since Material design is a philosophy and **not an API** (despite it being built into L), this should be done a...
2014/07/22
[ "https://Stackoverflow.com/questions/24893236", "https://Stackoverflow.com", "https://Stackoverflow.com/users/453435/" ]
If you're not worried about backwards compatibility past Lollipop, you can set the elevation Attribute directly in the XML ``` android:elevation="10dp" ``` Otherwise you have to set it in Java using the support.v4.ViewCompat library. ``` ViewCompat.setElevation(myView, 10); ``` and add this to your build....
The floating action button (with shadow) can be emulated on old platforms with a simple java class. I'm using Faiz Malkani's version here: <https://github.com/FaizMalkani/FloatingActionButton> [Note, that to get it compatible back to Gingerbread you'll need to put some SDK version checks around the animations and tra...
24,893,236
[Material design](http://www.google.com/design/spec/material-design/introduction.html#introduction-principles) makes a huge emphasis on the metaphor of "sheets of paper". To make these, shadows are essential. Since Material design is a philosophy and **not an API** (despite it being built into L), this should be done a...
2014/07/22
[ "https://Stackoverflow.com/questions/24893236", "https://Stackoverflow.com", "https://Stackoverflow.com/users/453435/" ]
here is just a rough sample ... ``` <?xml version="1.0" encoding="utf-8"?> ``` ``` <!-- Drop Shadow Stack --> <item> <shape android:shape="oval"> <corners android:radius="64dp"/> <solid android:color="#009A3D"/> <size android:width="64dp" android:height="64dp"/> ...
You can use android.support.v7.widget.CardView. Maybe is not the perfect solution but for me is working on what I want. So, for example this is the trick I use on my app ... on an rectangular shape and I am pleased of the result. ``` private View.OnTouchListener touch = new View.OnTouchListener() { @Override ...
24,893,236
[Material design](http://www.google.com/design/spec/material-design/introduction.html#introduction-principles) makes a huge emphasis on the metaphor of "sheets of paper". To make these, shadows are essential. Since Material design is a philosophy and **not an API** (despite it being built into L), this should be done a...
2014/07/22
[ "https://Stackoverflow.com/questions/24893236", "https://Stackoverflow.com", "https://Stackoverflow.com/users/453435/" ]
If you're not worried about backwards compatibility past Lollipop, you can set the elevation Attribute directly in the XML ``` android:elevation="10dp" ``` Otherwise you have to set it in Java using the support.v4.ViewCompat library. ``` ViewCompat.setElevation(myView, 10); ``` and add this to your build....
here is just a rough sample ... ``` <?xml version="1.0" encoding="utf-8"?> ``` ``` <!-- Drop Shadow Stack --> <item> <shape android:shape="oval"> <corners android:radius="64dp"/> <solid android:color="#009A3D"/> <size android:width="64dp" android:height="64dp"/> ...
24,893,236
[Material design](http://www.google.com/design/spec/material-design/introduction.html#introduction-principles) makes a huge emphasis on the metaphor of "sheets of paper". To make these, shadows are essential. Since Material design is a philosophy and **not an API** (despite it being built into L), this should be done a...
2014/07/22
[ "https://Stackoverflow.com/questions/24893236", "https://Stackoverflow.com", "https://Stackoverflow.com/users/453435/" ]
Rendering shadows on pre-Lollipop is not easy, but possible. The trick is that a shadow is simply a black, blured shape of a view. You can do that by yourself. 1. Draw your shadow-casting view to a bitmap with LightingColorFilter(0,0) set 2. Blur it using ScriptIntrisincBlur 3. Draw the shape 4. Draw the view on top o...
You can use android.support.v7.widget.CardView. Maybe is not the perfect solution but for me is working on what I want. So, for example this is the trick I use on my app ... on an rectangular shape and I am pleased of the result. ``` private View.OnTouchListener touch = new View.OnTouchListener() { @Override ...
24,893,236
[Material design](http://www.google.com/design/spec/material-design/introduction.html#introduction-principles) makes a huge emphasis on the metaphor of "sheets of paper". To make these, shadows are essential. Since Material design is a philosophy and **not an API** (despite it being built into L), this should be done a...
2014/07/22
[ "https://Stackoverflow.com/questions/24893236", "https://Stackoverflow.com", "https://Stackoverflow.com/users/453435/" ]
If you're not worried about backwards compatibility past Lollipop, you can set the elevation Attribute directly in the XML ``` android:elevation="10dp" ``` Otherwise you have to set it in Java using the support.v4.ViewCompat library. ``` ViewCompat.setElevation(myView, 10); ``` and add this to your build....
Rendering shadows on pre-Lollipop is not easy, but possible. The trick is that a shadow is simply a black, blured shape of a view. You can do that by yourself. 1. Draw your shadow-casting view to a bitmap with LightingColorFilter(0,0) set 2. Blur it using ScriptIntrisincBlur 3. Draw the shape 4. Draw the view on top o...
24,893,236
[Material design](http://www.google.com/design/spec/material-design/introduction.html#introduction-principles) makes a huge emphasis on the metaphor of "sheets of paper". To make these, shadows are essential. Since Material design is a philosophy and **not an API** (despite it being built into L), this should be done a...
2014/07/22
[ "https://Stackoverflow.com/questions/24893236", "https://Stackoverflow.com", "https://Stackoverflow.com/users/453435/" ]
If you're not worried about backwards compatibility past Lollipop, you can set the elevation Attribute directly in the XML ``` android:elevation="10dp" ``` Otherwise you have to set it in Java using the support.v4.ViewCompat library. ``` ViewCompat.setElevation(myView, 10); ``` and add this to your build....
You can use android.support.v7.widget.CardView. Maybe is not the perfect solution but for me is working on what I want. So, for example this is the trick I use on my app ... on an rectangular shape and I am pleased of the result. ``` private View.OnTouchListener touch = new View.OnTouchListener() { @Override ...
98,945
I have got a shortcode that displays a custom post type, via a `foreach`. The shortcode has been used in the standard post type. I have used `the_title();` in the shortcode. `the_title();` outputs the post\_title of the standard post type (which the shortcode is in), rather than `the_title();` of the custom post type. ...
2013/05/09
[ "https://wordpress.stackexchange.com/questions/98945", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/-1/" ]
You need to add `setup_postdata($post);` inside your loop: ``` foreach ( $attachments as $post ) { setup_postdata($post); the_title(); the_content(); } ```
My guess is that you'll need to use `setup_postdata($post);` inside of your foreach loop. <https://codex.wordpress.org/Function_Reference/setup_postdata>
98,945
I have got a shortcode that displays a custom post type, via a `foreach`. The shortcode has been used in the standard post type. I have used `the_title();` in the shortcode. `the_title();` outputs the post\_title of the standard post type (which the shortcode is in), rather than `the_title();` of the custom post type. ...
2013/05/09
[ "https://wordpress.stackexchange.com/questions/98945", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/-1/" ]
You need to add `setup_postdata($post);` inside your loop: ``` foreach ( $attachments as $post ) { setup_postdata($post); the_title(); the_content(); } ```
Both [`the_title`](http://codex.wordpress.org/Function_Reference/the_title) and [`the_content`](http://codex.wordpress.org/Function_Reference/the_content) are template tags and the operate inside the Loop based on the `global` variable `$post` which is setup by [`setup_postdata`](http://codex.wordpress.org/Function_Ref...
98,945
I have got a shortcode that displays a custom post type, via a `foreach`. The shortcode has been used in the standard post type. I have used `the_title();` in the shortcode. `the_title();` outputs the post\_title of the standard post type (which the shortcode is in), rather than `the_title();` of the custom post type. ...
2013/05/09
[ "https://wordpress.stackexchange.com/questions/98945", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/-1/" ]
You need to add `setup_postdata($post);` inside your loop: ``` foreach ( $attachments as $post ) { setup_postdata($post); the_title(); the_content(); } ```
**THE ANSWER** This is the working code ``` function faq_register_shortcode() { /* register the [display_faqs] shortcode */ add_shortcode( 'display_faqs', 'mp_faq_shortcode' ); } function mp_faq_shortcode() { global $post; $args = array( 'post_type' => 'faq_type_mp', 'numberposts' => 3, 'post...
263,238
I have a prediction model tested with four methods as you can see in the boxplot figure below. The attribute that the model predicts is in range of 0-8. You may notice that there is **one upper-bound outlier** and **three lower-bound outliers** indicated by all methods. I wonder if it is appropriate to remove these in...
2017/02/21
[ "https://stats.stackexchange.com/questions/263238", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/91142/" ]
It is **almost always** a cheating to remove observations **to improve** a regression model. You should drop observations only when you truly think that these are in fact outliers. For instance, you have time series from the heart rate monitor connected to your smart watch. If you take a look at the series, it's easy...
There are pros and cons to removing outliers and build model for "normal pattern" only. * Pros: the model performance is better. The intuition is that, it is very hard to use ONE model to capture both "normal pattern" and "outlier pattern". So we remove outliers and say, we only build a model for "normal pattern". * C...
263,238
I have a prediction model tested with four methods as you can see in the boxplot figure below. The attribute that the model predicts is in range of 0-8. You may notice that there is **one upper-bound outlier** and **three lower-bound outliers** indicated by all methods. I wonder if it is appropriate to remove these in...
2017/02/21
[ "https://stats.stackexchange.com/questions/263238", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/91142/" ]
It is **almost always** a cheating to remove observations **to improve** a regression model. You should drop observations only when you truly think that these are in fact outliers. For instance, you have time series from the heart rate monitor connected to your smart watch. If you take a look at the series, it's easy...
I originally wanted to post this as a comment to another answer, but it got too long to fit. When I look at your model, it doesn't necessarily contain one large group and some outliers. In my opinion, it contains 1 medium-sized group (1 to -1) and then 6 smaller groups, each found between 2 whole numbers. You can pret...