qid int64 1 74.6M | question stringlengths 45 24.2k | date stringlengths 10 10 | metadata stringlengths 101 178 | response_j stringlengths 32 23.2k | response_k stringlengths 21 13.2k |
|---|---|---|---|---|---|
293,885 | Please note that I asked the same question on [stackoverflow](https://stackoverflow.com/questions/32049022/application-logic-vs-business-logic) but they directed me to ask here.
While I am trying to discerne the difference between the application logic and business logic I have found set of articles but unfortunately ... | 2015/08/17 | ['https://softwareengineering.stackexchange.com/questions/293885', 'https://softwareengineering.stackexchange.com', 'https://softwareengineering.stackexchange.com/users/192185/'] | As others have pointed out, these terms do not have one universally accepted meaning. I will describe the definitions I have encountered more often, i.e. in several projects with different companies.
The **business logic** defines a normalized, general-purpose model of the business domain for which an application is w... | Na, they're just different terms for the same thing - the "middle tier" of program code that does the things you want your program to perform. Like many things in software, there are no hard-and-fast terminology for pieces of a system, as there are no single formal definitions for building systems.
So sometimes people... |
293,885 | Please note that I asked the same question on [stackoverflow](https://stackoverflow.com/questions/32049022/application-logic-vs-business-logic) but they directed me to ask here.
While I am trying to discerne the difference between the application logic and business logic I have found set of articles but unfortunately ... | 2015/08/17 | ['https://softwareengineering.stackexchange.com/questions/293885', 'https://softwareengineering.stackexchange.com', 'https://softwareengineering.stackexchange.com/users/192185/'] | Every system or application is going to have its own definitions of what is business logic and what is application logic. It will either be explicit or implicit.
In my experience data driven applications (e.g. DBs etc.) tend to have a more formal definition of what the business logic is.
The application logic tends t... | As others have pointed out, these terms do not have one universally accepted meaning. I will describe the definitions I have encountered more often, i.e. in several projects with different companies.
The **business logic** defines a normalized, general-purpose model of the business domain for which an application is w... |
17,761,717 | I tried to replace "-" character in a Java String but is doesn't work :
```
str.replace("\u2014", "");
```
Could you help me ? | 2013/07/20 | ['https://Stackoverflow.com/questions/17761717', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1076026/'] | String is Immutable in Java. You have to reassign it to get the result back:
```
String str ="your string with dashesh";
str= str.replace("\u2014", "");
```
See the [API](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html#replace%28java.lang.CharSequence,%20java.lang.CharSequence%29) for details. | this simply works..
```
String str = "String-with-dash-";
str=str.replace("-", "");
System.out.println(str);
```
output - Stringwithdash |
17,761,717 | I tried to replace "-" character in a Java String but is doesn't work :
```
str.replace("\u2014", "");
```
Could you help me ? | 2013/07/20 | ['https://Stackoverflow.com/questions/17761717', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1076026/'] | String is Immutable in Java. You have to reassign it to get the result back:
```
String str ="your string with dashesh";
str= str.replace("\u2014", "");
```
See the [API](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html#replace%28java.lang.CharSequence,%20java.lang.CharSequence%29) for details. | It's quite easy. You can use an Apache library, that will be useful while you develop an application. This is apache-commons-lang. You can do the following:
```
public class Main {
public static void main(String[] args) {
String test = "Dash - string";
String withoutDash = StringUtils.replace(te... |
17,761,717 | I tried to replace "-" character in a Java String but is doesn't work :
```
str.replace("\u2014", "");
```
Could you help me ? | 2013/07/20 | ['https://Stackoverflow.com/questions/17761717', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1076026/'] | this simply works..
```
String str = "String-with-dash-";
str=str.replace("-", "");
System.out.println(str);
```
output - Stringwithdash | It's quite easy. You can use an Apache library, that will be useful while you develop an application. This is apache-commons-lang. You can do the following:
```
public class Main {
public static void main(String[] args) {
String test = "Dash - string";
String withoutDash = StringUtils.replace(te... |
12,206 | How can start the VNC server to make my desktop accessible? | 2010/11/08 | ['https://askubuntu.com/questions/12206', 'https://askubuntu.com', 'https://askubuntu.com/users/3999/'] | Install vino:
```
sudo apt-get install vino
```
Configure vino:
```
vino-preferences
```
It open this windows :

You start the server with :
```
/usr/lib/vino/vino-server
```
Enter this command in your Autostarted Apps if you wish vino to start automatically. | For a bit more security, I don't leave VNC running the whole time. I SSH into the machine and then start the VNC server using the following command:
x11vnc -safer -localhost -nopw -once -display :0
For ease I have the command in a shell script, so it is just a case of SSH to the server, followed by the command startv... |
12,206 | How can start the VNC server to make my desktop accessible? | 2010/11/08 | ['https://askubuntu.com/questions/12206', 'https://askubuntu.com', 'https://askubuntu.com/users/3999/'] | Install vino:
```
sudo apt-get install vino
```
Configure vino:
```
vino-preferences
```
It open this windows :

You start the server with :
```
/usr/lib/vino/vino-server
```
Enter this command in your Autostarted Apps if you wish vino to start automatically. | Here is the whole process I do to utilize VNC, simplified
---
ONE. SETUP server
install VNC: `sudo apt-get install vnc`
install openssh-server: `sudo apt-get install openssh-server`
---
TWO. SETUP remote access PC
install PuTTY
install VNC or VNC viewer
---
THREE. Connect and Launch:
From remote access PC:
... |
12,206 | How can start the VNC server to make my desktop accessible? | 2010/11/08 | ['https://askubuntu.com/questions/12206', 'https://askubuntu.com', 'https://askubuntu.com/users/3999/'] | Install vino:
```
sudo apt-get install vino
```
Configure vino:
```
vino-preferences
```
It open this windows :

You start the server with :
```
/usr/lib/vino/vino-server
```
Enter this command in your Autostarted Apps if you wish vino to start automatically. | As root, run:
```
sudo apt-get install vino
```
As your user, run:
```
gsettings set org.gnome.Vino require-encryption false
vino-preferences
# replace eth0 in the following with your network interface
gsettings set org.gnome.Vino network-interface eth0
/usr/lib/vino/vino-server
```
A script can be written to aut... |
12,206 | How can start the VNC server to make my desktop accessible? | 2010/11/08 | ['https://askubuntu.com/questions/12206', 'https://askubuntu.com', 'https://askubuntu.com/users/3999/'] | Here is the whole process I do to utilize VNC, simplified
---
ONE. SETUP server
install VNC: `sudo apt-get install vnc`
install openssh-server: `sudo apt-get install openssh-server`
---
TWO. SETUP remote access PC
install PuTTY
install VNC or VNC viewer
---
THREE. Connect and Launch:
From remote access PC:
... | For a bit more security, I don't leave VNC running the whole time. I SSH into the machine and then start the VNC server using the following command:
x11vnc -safer -localhost -nopw -once -display :0
For ease I have the command in a shell script, so it is just a case of SSH to the server, followed by the command startv... |
12,206 | How can start the VNC server to make my desktop accessible? | 2010/11/08 | ['https://askubuntu.com/questions/12206', 'https://askubuntu.com', 'https://askubuntu.com/users/3999/'] | Here is the whole process I do to utilize VNC, simplified
---
ONE. SETUP server
install VNC: `sudo apt-get install vnc`
install openssh-server: `sudo apt-get install openssh-server`
---
TWO. SETUP remote access PC
install PuTTY
install VNC or VNC viewer
---
THREE. Connect and Launch:
From remote access PC:
... | As root, run:
```
sudo apt-get install vino
```
As your user, run:
```
gsettings set org.gnome.Vino require-encryption false
vino-preferences
# replace eth0 in the following with your network interface
gsettings set org.gnome.Vino network-interface eth0
/usr/lib/vino/vino-server
```
A script can be written to aut... |
17,041,685 | I would like to change the value of a recursive array.
One array provides the `path` to the variable to change:
`$scopePath` represents the path to change.
For example `if $scopePath==Array("owners","products","categories")`
and $tag="price";
I would like to change `$value["owners"]["products"]["categories"]["tag"... | 2013/06/11 | ['https://Stackoverflow.com/questions/17041685', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1993501/'] | You can directly make your Background Blur using "Visual Effect View with Blur" and "Visual Effect View with Blur and Vibrancy".
All you have to do for making Blur Background in iOS Application is...
1. Go and search for "Visual Effect View with Blur" in Object Library
[Step 1 Image](https://i.stack.imgur.com/Qy0Vf.... | Simple answer is Add a subview and change it's alpha.
```
UIView *mainView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 200, 200)];
UIView *subView = [[UIView alloc] initWithFrame:popupView.frame];
UIColor * backImgColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"blue_Img.png"]];
subView.backgroundColo... |
17,041,685 | I would like to change the value of a recursive array.
One array provides the `path` to the variable to change:
`$scopePath` represents the path to change.
For example `if $scopePath==Array("owners","products","categories")`
and $tag="price";
I would like to change `$value["owners"]["products"]["categories"]["tag"... | 2013/06/11 | ['https://Stackoverflow.com/questions/17041685', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1993501/'] | I don't think I'm allowed to post the code, but the above post mentioning the WWDC sample code is correct. Here is the link: <https://developer.apple.com/downloads/index.action?name=WWDC%202013>
The file you're looking for is the category on UIImage, and the method is applyLightEffect.
As I noted above in a comment, ... | You can directly make your Background Blur using "Visual Effect View with Blur" and "Visual Effect View with Blur and Vibrancy".
All you have to do for making Blur Background in iOS Application is...
1. Go and search for "Visual Effect View with Blur" in Object Library
[Step 1 Image](https://i.stack.imgur.com/Qy0Vf.... |
17,041,685 | I would like to change the value of a recursive array.
One array provides the `path` to the variable to change:
`$scopePath` represents the path to change.
For example `if $scopePath==Array("owners","products","categories")`
and $tag="price";
I would like to change `$value["owners"]["products"]["categories"]["tag"... | 2013/06/11 | ['https://Stackoverflow.com/questions/17041685', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1993501/'] | You can use `UIVisualEffectView` to achieve this effect. This is a native API that has been fine-tuned for performance and great battery life, plus it's easy to implement.
**Swift:**
```
//only apply the blur if the user hasn't disabled transparency effects
if !UIAccessibility.isReduceTransparencyEnabled {
view.b... | Apple has provided an extension for the UIImage class called UIImage+ImageEffects.h. In this class you have the desired methods for blurring your view |
17,041,685 | I would like to change the value of a recursive array.
One array provides the `path` to the variable to change:
`$scopePath` represents the path to change.
For example `if $scopePath==Array("owners","products","categories")`
and $tag="price";
I would like to change `$value["owners"]["products"]["categories"]["tag"... | 2013/06/11 | ['https://Stackoverflow.com/questions/17041685', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1993501/'] | I decided to post a written Objective-C version from the accepted answer just to provide more options in this question..
```
- (UIView *)applyBlurToView:(UIView *)view withEffectStyle:(UIBlurEffectStyle)style andConstraints:(BOOL)addConstraints
{
//only apply the blur if the user hasn't disabled transparency effect... | Apple has provided an extension for the UIImage class called UIImage+ImageEffects.h. In this class you have the desired methods for blurring your view |
17,041,685 | I would like to change the value of a recursive array.
One array provides the `path` to the variable to change:
`$scopePath` represents the path to change.
For example `if $scopePath==Array("owners","products","categories")`
and $tag="price";
I would like to change `$value["owners"]["products"]["categories"]["tag"... | 2013/06/11 | ['https://Stackoverflow.com/questions/17041685', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1993501/'] | Found this by accident, gives me really great (near duplicate with Apple's) results and uses the Acceleration framework. -- <http://pastebin.com/6cs6hsyQ>
\*Not written by me | Here is the Swift 2.0 code for the solution that has been provided in **accepted answer**:
```
//only apply the blur if the user hasn't disabled transparency effects
if !UIAccessibilityIsReduceTransparencyEnabled() {
self.view.backgroundColor = UIColor.clearColor()
let blurEffect = UIBlurEffec... |
17,041,685 | I would like to change the value of a recursive array.
One array provides the `path` to the variable to change:
`$scopePath` represents the path to change.
For example `if $scopePath==Array("owners","products","categories")`
and $tag="price";
I would like to change `$value["owners"]["products"]["categories"]["tag"... | 2013/06/11 | ['https://Stackoverflow.com/questions/17041685', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1993501/'] | This answer is based on [Mitja Semolic's excellent earlier answer](https://stackoverflow.com/questions/29498884/less-blur-with-visual-effect-view-with-blur). I've converted it to swift 3, added an explanation to what's happening in coments, made it an extension of a UIViewController so any VC can call it at will, added... | Apple has provided an extension for the UIImage class called UIImage+ImageEffects.h. In this class you have the desired methods for blurring your view |
17,041,685 | I would like to change the value of a recursive array.
One array provides the `path` to the variable to change:
`$scopePath` represents the path to change.
For example `if $scopePath==Array("owners","products","categories")`
and $tag="price";
I would like to change `$value["owners"]["products"]["categories"]["tag"... | 2013/06/11 | ['https://Stackoverflow.com/questions/17041685', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1993501/'] | In case this helps anyone, here is a swift extension I created based on the answer by Jordan H. It is written in Swift 5 and can be used from Objective C.
```
extension UIView {
@objc func blurBackground(style: UIBlurEffect.Style, fallbackColor: UIColor) {
if !UIAccessibility.isReduceTransparencyEnabled {... | **An important supplement to @Joey's answer**
This applies to a situation where you want to present a blurred-background `UIViewController` with `UINavigationController`.
```
// suppose you've done blur effect with your presented view controller
UINavigationController *nav = [[UINavigationController alloc] initWithRo... |
17,041,685 | I would like to change the value of a recursive array.
One array provides the `path` to the variable to change:
`$scopePath` represents the path to change.
For example `if $scopePath==Array("owners","products","categories")`
and $tag="price";
I would like to change `$value["owners"]["products"]["categories"]["tag"... | 2013/06/11 | ['https://Stackoverflow.com/questions/17041685', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1993501/'] | Swift 3 Version of Kev's answer to return blurred image -
```
func blurBgImage(image: UIImage) -> UIImage? {
let radius: CGFloat = 20;
let context = CIContext(options: nil);
let inputImage = CIImage(cgImage: image.cgImage!);
let filter = CIFilter(name: "CIGaussianBlur");
filter?... | Apple has provided an extension for the UIImage class called UIImage+ImageEffects.h. In this class you have the desired methods for blurring your view |
17,041,685 | I would like to change the value of a recursive array.
One array provides the `path` to the variable to change:
`$scopePath` represents the path to change.
For example `if $scopePath==Array("owners","products","categories")`
and $tag="price";
I would like to change `$value["owners"]["products"]["categories"]["tag"... | 2013/06/11 | ['https://Stackoverflow.com/questions/17041685', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1993501/'] | Swift 3 Version of Kev's answer to return blurred image -
```
func blurBgImage(image: UIImage) -> UIImage? {
let radius: CGFloat = 20;
let context = CIContext(options: nil);
let inputImage = CIImage(cgImage: image.cgImage!);
let filter = CIFilter(name: "CIGaussianBlur");
filter?... | If adds a dark blur view for tableView, this will beautifully make it:
```
tableView.backgroundColor = .clear
let blurEffect = UIBlurEffect(style: .dark)
let blurEffectView = UIVisualEffectView(effect: blurEffect)
blurEffectView.frame = tableView.bounds
blurEffectView.autoresizingMask = [.flexibleHeight, .flexibleWidt... |
17,041,685 | I would like to change the value of a recursive array.
One array provides the `path` to the variable to change:
`$scopePath` represents the path to change.
For example `if $scopePath==Array("owners","products","categories")`
and $tag="price";
I would like to change `$value["owners"]["products"]["categories"]["tag"... | 2013/06/11 | ['https://Stackoverflow.com/questions/17041685', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1993501/'] | Core Image
----------
Since that image in the screenshot is static, you could use `CIGaussianBlur` from Core Image (requires iOS 6). Here is sample: <https://github.com/evanwdavis/Fun-with-Masks/blob/master/Fun%20with%20Masks/EWDBlurExampleVC.m>
Mind you, this is slower than the other options on this page.
```
#imp... | I think the easiest solution to this is to override UIToolbar, which blurs everything behind it in iOS 7. It's quite sneaky, but it's very simple for you to implement, and fast!
You can do it with any view, just make it a subclass of `UIToolbar` instead of `UIView`. You can even do it with a `UIViewController`'s `view... |
66,593,970 | I am trying to implement consul-agent and proxy as sidecar container inside my ECS fargate service. So, inside the task, there will be 3 containers running:
* core-business-service-container
* consul-agent-container
* core-business-consul-proxy-container
All containers are up and running on ECS task. The node has reg... | 2021/03/12 | ['https://Stackoverflow.com/questions/66593970', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/9923849/'] | HashiCorp recently announced support for running Consul service mesh on ECS using Terraform to deploy the agent and sidecar components. You might want to consider this as an alternative solution to your existing workflow.
This solution is currently in tech preview. You can find more information in the blog post <https... | I did not manage to get my proxy to work using the same method as you were using. But I remember reading somewhere that you should declare your Connect proxy inside the service registration config
```
{
"service": {
"name": "web",
"port": 8080,
"connect": { "sidecar_service": {} }
}
}
```
After you... |
3,550,591 | We say a positive symmetric $n\times n$ matrix $M$ over $\mathbb{R}^n$ is semi-definite if $v^{\intercal}Mv\geq 0$ for all nonzero $v\in\mathbb{R}^n$.
We say a function $f:\mathbb{T}^2\longrightarrow\mathbb{R}$ to be positive semi-definite if $\Big(f(t\_k, t\_j)\Big)\_{k,j=1}^n$ is a positive semi-definite matrix for ... | 2020/02/17 | ['https://math.stackexchange.com/questions/3550591', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/502975/'] | As **MaoWao** suggested, I am gonna post my own proof here.
---
*Proof of (1):*
Firstly let me claim that if $H$ is a Hilbert space, then its corresponding inner product $\langle \cdot, \cdot\rangle\_{H}:H\times H\longrightarrow\mathbb{R}$ is positive semi-definite.
Indeed, we have for any $n\in\mathbb{N}$, $x\_{1... | This will be a partial answer.
The standard Wiener process $\{B(t)\}\_{t\,\ge\,0},$ also called the standard Brownian motion, assigns to each $t\ge0$ a random variable $B(t)$ in such a way that every increment $B(t)-B(s)$ for $0\le s\le t$ is distributed as $\operatorname N(0,t-s)$ (the standard normal distribution wi... |
28,478,191 | Hi all I've a problem with include function in php:
I have 4 file:
```
dir1/file1.php
dir4/dir2/file2.php
dir3/file3.php
dir3/file4.php
```
In file1.php I have:
```
include_once('../dir3/file3.php');
```
In file3.php I have:
```
required('../dir3/file4.php');
```
In file2.php I want write:
```
include_once('... | 2015/02/12 | ['https://Stackoverflow.com/questions/28478191', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3297525/'] | You can use only dot (.) before your filename which will find that file from root of dir..for eg `./dir3/file4.php` but it increase the overhead..Another way is to use
```
$base = __DIR__ . '/../';
require_once $base.'_include/file1.php';
``` | If you are calling file3 from file2 you will have to go back 2 directories. The best way is using the full path like :
```
home/mysite/public_html/dir3/file3.php
```
It maybe (is) troublesome but good uptill some level.
Edit: **DIR** and rest is also handy, depending on your need |
28,478,191 | Hi all I've a problem with include function in php:
I have 4 file:
```
dir1/file1.php
dir4/dir2/file2.php
dir3/file3.php
dir3/file4.php
```
In file1.php I have:
```
include_once('../dir3/file3.php');
```
In file3.php I have:
```
required('../dir3/file4.php');
```
In file2.php I want write:
```
include_once('... | 2015/02/12 | ['https://Stackoverflow.com/questions/28478191', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3297525/'] | You can use only dot (.) before your filename which will find that file from root of dir..for eg `./dir3/file4.php` but it increase the overhead..Another way is to use
```
$base = __DIR__ . '/../';
require_once $base.'_include/file1.php';
``` | **I FIX it with:**
In file1.php I have:
```
$path = '..';
include_once($path.'/dir3/file3.php');
```
In file3.php I have:
```
required($path.'/dir3/file4.php');
```
In file2.php I want write:
```
$path = '../..'
include_once($path.'/dir3/file3.php');
```
**This work for me.** |
31,021,553 | I am trying to follow the redirect of a url using urllib2.
```
>>> import urllib2
>>> page=urllib2.urlopen('http://acer.com')
>>> print page.geturl()
http://www.acer.com/worldwide/selection.html
>>>page=urllib2.urlopen('http://www.acer.com/worldwide/selection.html')
>>> print page.geturl()
http://www.acer.com/worldwid... | 2015/06/24 | ['https://Stackoverflow.com/questions/31021553', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2350219/'] | `get_url()` doesn't work for all re-directs (for example JavaScript redirects)
What are you trying to achieve?
Something like [Selenium](https://pypi.python.org/pypi/selenium) with [PhantomJS](http://phantomjs.org/) as the backend might be more suited to this.
For screenshots you can then use [`save_screenshot()`](h... | Use `selenium` to get start. I'm using [chromedriver](https://sites.google.com/a/chromium.org/chromedriver/) as browser:
`from selenium.webdriver import Chrome
cr = Chrome()
cr.get(url)
cr.save_screenshot('IMAGE_NAME.png')` |
2,570,174 | If you have a function in the form of $f(kx)$, the graph is horizontally scaled by a factor of $k$ and
the bigger the magnitude of $k$, the more compressed the graph gets, and the inverse is true.
So by definition, $k$ should be called the horizontal compression factor of the function, meaning if $k = \frac{1}{2}$, th... | 2017/12/17 | ['https://math.stackexchange.com/questions/2570174', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/444199/'] | The inverse function:
$$ g(y)\ :=\ \frac{\log\_2(y)+1}{\log\_2(y)-1} $$
**REMARK** Domains:
$$ f : \mathbb R\setminus\{1\}\ \rightarrow\ (0;\infty)\setminus\{2\} $$
and
$$ g : (0;\infty)\setminus{2}\ \rightarrow\ \mathbb R\setminus\{1\} $$
>
>
>
>
>
**Explanation:**
Function $\ f\ $ is a composition of tw... | Answer is :
$$
x = {{\log(y) + \log(2)} \over {\log(y)-\log(2)}}
$$
Demo :
$$
y = f(x) \\
{{x+1} \over {x-1}} = {{\log y} \over {\log 2}} = P \\
x+1=P(x-1) \\
x+1=Px-P \\
x={{P+1} \over {P-1}} = {{{{\log y} \over {\log 2}}+1} \over {{\log y} \over {\log 2}}-1}
$$ |
718,982 | I found this observation in a book. "It is not possible to have an invariant definition of symmetry in one contravariant and one covariant index". That's all right, my problem is that to show how restrictive is to require symmetry on a mixed tensor $A^i\_j$ the authors ask to resolve the following problem:
If a tensor ... | 2022/07/18 | ['https://physics.stackexchange.com/questions/718982', 'https://physics.stackexchange.com', 'https://physics.stackexchange.com/users/80627/'] | *Sketched proof:* The mixed tensor components $A^i{}\_j$ transform (in matrix notation) as $A^{\prime}=SAS^{-1}$, where $S\in GL(n,\mathbb{R})$ is an arbitrary invertible matrix. Let $S$ be symmetric from now on. Then transposition yields $A^{\prime}=S^{-1}AS$ because all matrices are symmetric. Elimination of $A^{\pri... | Thank you, guys. I think you both tackled special cases. However, your matrix approaches led me to a general solution I believe is also correct.
From the general transformation $A'=S^{-1}AS$ we have $SA'=AS$. Assuming we already proved that $A$ is diagonal, let $A=diag\{\lambda\_1\ldots\lambda\_n\}$ and $A'=diag\{\lamb... |
718,982 | I found this observation in a book. "It is not possible to have an invariant definition of symmetry in one contravariant and one covariant index". That's all right, my problem is that to show how restrictive is to require symmetry on a mixed tensor $A^i\_j$ the authors ask to resolve the following problem:
If a tensor ... | 2022/07/18 | ['https://physics.stackexchange.com/questions/718982', 'https://physics.stackexchange.com', 'https://physics.stackexchange.com/users/80627/'] | Consider the change of basis with the matrix $\begin{pmatrix}
1 & 1\\
0 & 1
\end{pmatrix}$.
$$
\begin{pmatrix}
1 & 1\\
0 & 1
\end{pmatrix}
\begin{pmatrix}
1 & 0\\
0 & a
\end{pmatrix}
\begin{pmatrix}
1 & -1\\
0 & 1
\end{pmatrix}
=
\begin{pmatrix}
1 & a-1\\
0 & a
\end{pmatrix}
$$
is symmetric if and only if $a=1$. In mor... | Thank you, guys. I think you both tackled special cases. However, your matrix approaches led me to a general solution I believe is also correct.
From the general transformation $A'=S^{-1}AS$ we have $SA'=AS$. Assuming we already proved that $A$ is diagonal, let $A=diag\{\lambda\_1\ldots\lambda\_n\}$ and $A'=diag\{\lamb... |
13,690,372 | Hey I have the following strings as input:
```
"abcol"
"ab_col"
"cold"
"col_ab"
"col.ab"
```
I have the string col to search from. I'm using regex to match
```
Match matchResults = Regex.Match(input , "col", RegexOptions.IgnoreCase);
```
I want to match only the string that has this pattern
`[Any spe... | 2012/12/03 | ['https://Stackoverflow.com/questions/13690372', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1178492/'] | You can use this regex: -
```
(?:^.*[^a-zA-Z0-9]|^)col(?:[^a-zA-Z0-9].*$|$)
```
**Explanation : -**
```
(?: // non-capturing
^ // match at start of the string
.*[^a-zA-Z0-9] // match anything followed by a non-alphanumeric before `col`
| // or
^ // match the start itself (means nothing befo... | `@"(^|.*[\W_])col([\W_].*|$)"` this is your pattern. `\w` is alphanumeric character and `\W` is non alphanumeric character. `^` means line start and `$` means line end. `|` is the or. so `(^|.*\W)` means line start or some characters and non alphanumeric after them.
**EDIT:**
yes, underline is alphanumeric too... so... |
36,834,939 | I have a Stored Procedure to get the details of Invoices
Some occasions I get the list of invoices by sending only the InvoiceID
But in some other occasions I need to get the list of invoices as per the search fields supplied by the user. To do this I send all the fields to the Stored Procedure and use those paramete... | 2016/04/25 | ['https://Stackoverflow.com/questions/36834939', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4073943/'] | Yes, it is possible with Dynamic SQL, but I highly discourage to do that.
[SELECT \* FROM tbl WHERE @condition](http://www.sommarskog.se/dynamic_sql.html#Condition):
>
> If you are considering to write the procedure
>
>
>
> ```
> CREATE PROCEDURE search_sp @condition varchar(8000) AS
> SELECT * FROM tbl WHERE ... | You can use custom type to pass table as parameter <https://msdn.microsoft.com/pl-pl/library/bb510489(v=sql.110).aspx> or you can use default parameters |
36,834,939 | I have a Stored Procedure to get the details of Invoices
Some occasions I get the list of invoices by sending only the InvoiceID
But in some other occasions I need to get the list of invoices as per the search fields supplied by the user. To do this I send all the fields to the Stored Procedure and use those paramete... | 2016/04/25 | ['https://Stackoverflow.com/questions/36834939', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4073943/'] | Yes, it is possible with Dynamic SQL, but I highly discourage to do that.
[SELECT \* FROM tbl WHERE @condition](http://www.sommarskog.se/dynamic_sql.html#Condition):
>
> If you are considering to write the procedure
>
>
>
> ```
> CREATE PROCEDURE search_sp @condition varchar(8000) AS
> SELECT * FROM tbl WHERE ... | If you're using SQL Server 2016 or similar (check by calling `select compatibility_level, name from sys.databases` and seeing that your DB is 130 or higher) then you can use the [string\_split](https://learn.microsoft.com/en-us/sql/t-sql/functions/string-split-transact-sql) builtin function.
I found it works best like... |
36,834,939 | I have a Stored Procedure to get the details of Invoices
Some occasions I get the list of invoices by sending only the InvoiceID
But in some other occasions I need to get the list of invoices as per the search fields supplied by the user. To do this I send all the fields to the Stored Procedure and use those paramete... | 2016/04/25 | ['https://Stackoverflow.com/questions/36834939', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4073943/'] | You can use custom type to pass table as parameter <https://msdn.microsoft.com/pl-pl/library/bb510489(v=sql.110).aspx> or you can use default parameters | If you're using SQL Server 2016 or similar (check by calling `select compatibility_level, name from sys.databases` and seeing that your DB is 130 or higher) then you can use the [string\_split](https://learn.microsoft.com/en-us/sql/t-sql/functions/string-split-transact-sql) builtin function.
I found it works best like... |
6,039,356 | I'm sort of stumbling around with an issue with Xcode 4, and Git. I'm a one man shop with multiple macs, and had my project working with Git and Xcode4, (stored on a dropbox folder), so I could share that folder across my MBP and iMac with minimal interaction. So, it was late one night and I accidentally committed my x... | 2011/05/18 | ['https://Stackoverflow.com/questions/6039356', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/415640/'] | To add Git to the project
1. Go to the directory and in a terminal window
```
cat > .gitignore
build/*
*.pbxuser
*.perspectivev3
*.mode1v3
javascripts/phonegap.*.js
```
Type Ctrl+D to close the file.
2. Initialize the Git repository
```
git init
git add .
git commit -m
```
3. Add the repository in organizer. Use ... | There are [three ways of setting up exclude files](http://365git.tumblr.com/post/519016351/three-ways-of-excluding-files) in git. Which is easiest depends on you. But, I find that when using git to share for myself amongst multiple machines, a global ignore file works best, and I can always add more specific excludes i... |
6,039,356 | I'm sort of stumbling around with an issue with Xcode 4, and Git. I'm a one man shop with multiple macs, and had my project working with Git and Xcode4, (stored on a dropbox folder), so I could share that folder across my MBP and iMac with minimal interaction. So, it was late one night and I accidentally committed my x... | 2011/05/18 | ['https://Stackoverflow.com/questions/6039356', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/415640/'] | Maybe this isn't the answer you want but I gave up on getting Xcode4 to play well with git and just started using the excellent (and free) [SourceTree](http://www.sourcetreeapp.com/). It really made my life easier. | To add Git to the project
1. Go to the directory and in a terminal window
```
cat > .gitignore
build/*
*.pbxuser
*.perspectivev3
*.mode1v3
javascripts/phonegap.*.js
```
Type Ctrl+D to close the file.
2. Initialize the Git repository
```
git init
git add .
git commit -m
```
3. Add the repository in organizer. Use ... |
6,039,356 | I'm sort of stumbling around with an issue with Xcode 4, and Git. I'm a one man shop with multiple macs, and had my project working with Git and Xcode4, (stored on a dropbox folder), so I could share that folder across my MBP and iMac with minimal interaction. So, it was late one night and I accidentally committed my x... | 2011/05/18 | ['https://Stackoverflow.com/questions/6039356', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/415640/'] | Maybe this isn't the answer you want but I gave up on getting Xcode4 to play well with git and just started using the excellent (and free) [SourceTree](http://www.sourcetreeapp.com/). It really made my life easier. | There are [three ways of setting up exclude files](http://365git.tumblr.com/post/519016351/three-ways-of-excluding-files) in git. Which is easiest depends on you. But, I find that when using git to share for myself amongst multiple machines, a global ignore file works best, and I can always add more specific excludes i... |
96,880 | My company is a software vendor. We develop software that is later deployed on the customer's environment, on their own machines. Our software uses various DBMS, depending on what the customer has. We do it for PostgreSQL, MySQL and so on.
Currently we have two new customers, which are using Oracle DB in their own pro... | 2015/04/02 | ['https://dba.stackexchange.com/questions/96880', 'https://dba.stackexchange.com', 'https://dba.stackexchange.com/users/1172/'] | If you want to shrink ibdata1, so that it should only contain the metadata, You may try these steps
To shrink ibdata1 once and for all you must do the following:
1. MySQLDump all databases into a SQL text file (as bkp\_all\_db.sql)
2. Drop all databases (except mysql schema)
3. Stop MySQL
`/etc/init.d/mysql stop`
4. ... | The config items you added in should have little to no impact on the situation. n.b. you will probably also want `log-slave-updates`, ([details](https://dev.mysql.com/doc/refman/5.6/en/replication-options-slave.html#option_mysqld_log-slave-updates)) but leave that out until after you've imported the data, of you'll hav... |
41,462,493 | I have a PHP script that serves portions of a PDF file by byte ranges.
If an HTTP HEAD request is received, it should send back headers (including the PDF file size) but not the actual file contents. I have tried this:
```
header('HTTP/1.1 200 OK');
header('Content-Type: application/pdf');
header('Accept-Ranges: byte... | 2017/01/04 | ['https://Stackoverflow.com/questions/41462493', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/7373028/'] | From w3c Hypertext Transfer Protocol -- HTTP/1.1:
>
> When a Content-Length is given in a message where a message-body is
> allowed, its field value MUST exactly match the number of OCTETs in
> the message-body. HTTP/1.1 user agents MUST notify the user when an
> invalid length is received and detected.
>
>
>
... | As Lurii mentioned, the content length is affected by your request type.
With GET requests, a non-matching content length may result in a hanging client, so LiteSpeed will verify the content length before sending the header to the client.
Using a HEAD request should return the content length as expected. |
41,462,493 | I have a PHP script that serves portions of a PDF file by byte ranges.
If an HTTP HEAD request is received, it should send back headers (including the PDF file size) but not the actual file contents. I have tried this:
```
header('HTTP/1.1 200 OK');
header('Content-Type: application/pdf');
header('Accept-Ranges: byte... | 2017/01/04 | ['https://Stackoverflow.com/questions/41462493', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/7373028/'] | From w3c Hypertext Transfer Protocol -- HTTP/1.1:
>
> When a Content-Length is given in a message where a message-body is
> allowed, its field value MUST exactly match the number of OCTETs in
> the message-body. HTTP/1.1 user agents MUST notify the user when an
> invalid length is received and detected.
>
>
>
... | It's the webserver job, not yours.
In my case I left everything to the Apache webserver and nothing changed in my php code except of how the requests is being parsed
For example things like
```
if($_SERVER['REQUEST_METHOD'] === "GET"){
//ok
}else{
//send 400 Bad Request
}
```
are changed to
```
if($_... |
114,445 | Let's create some sample data
```
n = 100;
d00 = Table[{RandomReal[{-1, 1}], RandomReal[{-4, 4}], RandomReal[{-1, 1}]}, {i, 1, n}];
```
Now I want the following: create a list plot with the first element of the list as $x$ coordinate and the third element as the $y$ coordinate.
```
d0 = Table[{d00[[i, 1]], d00[[i,... | 2016/05/05 | ['https://mathematica.stackexchange.com/questions/114445', 'https://mathematica.stackexchange.com', 'https://mathematica.stackexchange.com/users/5052/'] | Basically a duplicate of [this question](https://mathematica.stackexchange.com/questions/105574/plotmarkers-shadows-the-settings-by-style).
You can just style each point before you pass them to `ListPlot` for things like this.
Define a color function:
```
cfun = Piecewise[{{White, # <= -2}, {Green, -2 < # < 2}, {Red... | Just some variants:
```
l = RandomReal[{-4, 4}, {200, 3}];
With[{g = #[[All, {1, 3}]] & /@ GatherBy[l, #[[2]] < 2 &]},
ListPlot[g, PlotStyle -> {Red, Green}, PlotMarkers -> {Automatic, 8}]]
ListPlot[Last@Reap[Sow[{#1, #3}, #2 < 2] & @@@ l, _, #2 &],
PlotStyle -> {Red, Green}, PlotMarkers -> {Automatic, 8}]
ListPlot... |
114,445 | Let's create some sample data
```
n = 100;
d00 = Table[{RandomReal[{-1, 1}], RandomReal[{-4, 4}], RandomReal[{-1, 1}]}, {i, 1, n}];
```
Now I want the following: create a list plot with the first element of the list as $x$ coordinate and the third element as the $y$ coordinate.
```
d0 = Table[{d00[[i, 1]], d00[[i,... | 2016/05/05 | ['https://mathematica.stackexchange.com/questions/114445', 'https://mathematica.stackexchange.com', 'https://mathematica.stackexchange.com/users/5052/'] | Basically a duplicate of [this question](https://mathematica.stackexchange.com/questions/105574/plotmarkers-shadows-the-settings-by-style).
You can just style each point before you pass them to `ListPlot` for things like this.
Define a color function:
```
cfun = Piecewise[{{White, # <= -2}, {Green, -2 < # < 2}, {Red... | Another way is to use `Graphics` which gives you more control over your plot.
```
n = 100;
d00 = Table[{RandomReal[{-1, 1}], RandomReal[{-4, 4}],
RandomReal[{-1, 1}]}, {i, 1, n}];
{x1, x2} = {Min[#], Max[#]} &@d00[[All, 2]];
col[x_] := If[Abs[x] < 2, Green, Red] (*for color*)
scale[x_] := (x - x1)/(x2 - x1)/20 ... |
114,445 | Let's create some sample data
```
n = 100;
d00 = Table[{RandomReal[{-1, 1}], RandomReal[{-4, 4}], RandomReal[{-1, 1}]}, {i, 1, n}];
```
Now I want the following: create a list plot with the first element of the list as $x$ coordinate and the third element as the $y$ coordinate.
```
d0 = Table[{d00[[i, 1]], d00[[i,... | 2016/05/05 | ['https://mathematica.stackexchange.com/questions/114445', 'https://mathematica.stackexchange.com', 'https://mathematica.stackexchange.com/users/5052/'] | Basically a duplicate of [this question](https://mathematica.stackexchange.com/questions/105574/plotmarkers-shadows-the-settings-by-style).
You can just style each point before you pass them to `ListPlot` for things like this.
Define a color function:
```
cfun = Piecewise[{{White, # <= -2}, {Green, -2 < # < 2}, {Red... | **ListPlot with styled data**
```
styleddata1 = With[{ps = Rescale[#2, Through[{Min, Max}@d00[[All, 2]]], {5, 20}]},
Style[Tooltip[{#, #3}, #2], If[-2 <= #2 <= 2, Directive[Green, AbsolutePointSize[ps]],
Directive[Red, AbsolutePointSize[ps]]]]] & @@@ d00;
ListPlot[styleddata1, AspectRatio -> 1]
```
![Ma... |
114,445 | Let's create some sample data
```
n = 100;
d00 = Table[{RandomReal[{-1, 1}], RandomReal[{-4, 4}], RandomReal[{-1, 1}]}, {i, 1, n}];
```
Now I want the following: create a list plot with the first element of the list as $x$ coordinate and the third element as the $y$ coordinate.
```
d0 = Table[{d00[[i, 1]], d00[[i,... | 2016/05/05 | ['https://mathematica.stackexchange.com/questions/114445', 'https://mathematica.stackexchange.com', 'https://mathematica.stackexchange.com/users/5052/'] | Here's another option:
```
l = RandomReal[{-4, 4}, {200, 3}];
ListPlot[
List /@ (l[[All, {1, 3}]])
, PlotStyle -> (If[Abs[#[[2]]] < 2, Green, Red] & /@ l)
]
```
Where you can use any function that returns a color in your styling. You might want have to rescale your data if it's not in the range {0,1}.
[![enter... | Just some variants:
```
l = RandomReal[{-4, 4}, {200, 3}];
With[{g = #[[All, {1, 3}]] & /@ GatherBy[l, #[[2]] < 2 &]},
ListPlot[g, PlotStyle -> {Red, Green}, PlotMarkers -> {Automatic, 8}]]
ListPlot[Last@Reap[Sow[{#1, #3}, #2 < 2] & @@@ l, _, #2 &],
PlotStyle -> {Red, Green}, PlotMarkers -> {Automatic, 8}]
ListPlot... |
114,445 | Let's create some sample data
```
n = 100;
d00 = Table[{RandomReal[{-1, 1}], RandomReal[{-4, 4}], RandomReal[{-1, 1}]}, {i, 1, n}];
```
Now I want the following: create a list plot with the first element of the list as $x$ coordinate and the third element as the $y$ coordinate.
```
d0 = Table[{d00[[i, 1]], d00[[i,... | 2016/05/05 | ['https://mathematica.stackexchange.com/questions/114445', 'https://mathematica.stackexchange.com', 'https://mathematica.stackexchange.com/users/5052/'] | Here's another option:
```
l = RandomReal[{-4, 4}, {200, 3}];
ListPlot[
List /@ (l[[All, {1, 3}]])
, PlotStyle -> (If[Abs[#[[2]]] < 2, Green, Red] & /@ l)
]
```
Where you can use any function that returns a color in your styling. You might want have to rescale your data if it's not in the range {0,1}.
[![enter... | Another way is to use `Graphics` which gives you more control over your plot.
```
n = 100;
d00 = Table[{RandomReal[{-1, 1}], RandomReal[{-4, 4}],
RandomReal[{-1, 1}]}, {i, 1, n}];
{x1, x2} = {Min[#], Max[#]} &@d00[[All, 2]];
col[x_] := If[Abs[x] < 2, Green, Red] (*for color*)
scale[x_] := (x - x1)/(x2 - x1)/20 ... |
114,445 | Let's create some sample data
```
n = 100;
d00 = Table[{RandomReal[{-1, 1}], RandomReal[{-4, 4}], RandomReal[{-1, 1}]}, {i, 1, n}];
```
Now I want the following: create a list plot with the first element of the list as $x$ coordinate and the third element as the $y$ coordinate.
```
d0 = Table[{d00[[i, 1]], d00[[i,... | 2016/05/05 | ['https://mathematica.stackexchange.com/questions/114445', 'https://mathematica.stackexchange.com', 'https://mathematica.stackexchange.com/users/5052/'] | Here's another option:
```
l = RandomReal[{-4, 4}, {200, 3}];
ListPlot[
List /@ (l[[All, {1, 3}]])
, PlotStyle -> (If[Abs[#[[2]]] < 2, Green, Red] & /@ l)
]
```
Where you can use any function that returns a color in your styling. You might want have to rescale your data if it's not in the range {0,1}.
[![enter... | **ListPlot with styled data**
```
styleddata1 = With[{ps = Rescale[#2, Through[{Min, Max}@d00[[All, 2]]], {5, 20}]},
Style[Tooltip[{#, #3}, #2], If[-2 <= #2 <= 2, Directive[Green, AbsolutePointSize[ps]],
Directive[Red, AbsolutePointSize[ps]]]]] & @@@ d00;
ListPlot[styleddata1, AspectRatio -> 1]
```
![Ma... |
114,445 | Let's create some sample data
```
n = 100;
d00 = Table[{RandomReal[{-1, 1}], RandomReal[{-4, 4}], RandomReal[{-1, 1}]}, {i, 1, n}];
```
Now I want the following: create a list plot with the first element of the list as $x$ coordinate and the third element as the $y$ coordinate.
```
d0 = Table[{d00[[i, 1]], d00[[i,... | 2016/05/05 | ['https://mathematica.stackexchange.com/questions/114445', 'https://mathematica.stackexchange.com', 'https://mathematica.stackexchange.com/users/5052/'] | Just some variants:
```
l = RandomReal[{-4, 4}, {200, 3}];
With[{g = #[[All, {1, 3}]] & /@ GatherBy[l, #[[2]] < 2 &]},
ListPlot[g, PlotStyle -> {Red, Green}, PlotMarkers -> {Automatic, 8}]]
ListPlot[Last@Reap[Sow[{#1, #3}, #2 < 2] & @@@ l, _, #2 &],
PlotStyle -> {Red, Green}, PlotMarkers -> {Automatic, 8}]
ListPlot... | **ListPlot with styled data**
```
styleddata1 = With[{ps = Rescale[#2, Through[{Min, Max}@d00[[All, 2]]], {5, 20}]},
Style[Tooltip[{#, #3}, #2], If[-2 <= #2 <= 2, Directive[Green, AbsolutePointSize[ps]],
Directive[Red, AbsolutePointSize[ps]]]]] & @@@ d00;
ListPlot[styleddata1, AspectRatio -> 1]
```
![Ma... |
114,445 | Let's create some sample data
```
n = 100;
d00 = Table[{RandomReal[{-1, 1}], RandomReal[{-4, 4}], RandomReal[{-1, 1}]}, {i, 1, n}];
```
Now I want the following: create a list plot with the first element of the list as $x$ coordinate and the third element as the $y$ coordinate.
```
d0 = Table[{d00[[i, 1]], d00[[i,... | 2016/05/05 | ['https://mathematica.stackexchange.com/questions/114445', 'https://mathematica.stackexchange.com', 'https://mathematica.stackexchange.com/users/5052/'] | Another way is to use `Graphics` which gives you more control over your plot.
```
n = 100;
d00 = Table[{RandomReal[{-1, 1}], RandomReal[{-4, 4}],
RandomReal[{-1, 1}]}, {i, 1, n}];
{x1, x2} = {Min[#], Max[#]} &@d00[[All, 2]];
col[x_] := If[Abs[x] < 2, Green, Red] (*for color*)
scale[x_] := (x - x1)/(x2 - x1)/20 ... | **ListPlot with styled data**
```
styleddata1 = With[{ps = Rescale[#2, Through[{Min, Max}@d00[[All, 2]]], {5, 20}]},
Style[Tooltip[{#, #3}, #2], If[-2 <= #2 <= 2, Directive[Green, AbsolutePointSize[ps]],
Directive[Red, AbsolutePointSize[ps]]]]] & @@@ d00;
ListPlot[styleddata1, AspectRatio -> 1]
```
![Ma... |
56,801,384 | I have table pulled from sqlite3 using sqlalchemy. This table holds the date and time of each showing of the car:
```
Id Car Code ShowTime
1 Honda A 10/18/2017 14:45
1 Honda A 10/18/2017 17:10
3 Honda C 10/18/2017 19:35
4 Toyota B 10/18/2017 12:20
4 Toyota B 10/1... | 2019/06/28 | ['https://Stackoverflow.com/questions/56801384', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2341389/'] | You can use pandas to split the `ShowTime` column:
```
In [22]: import pandas as pd
In [68]: df = pd.read_csv('test.csv')
In [69]: df.rename(columns={'Id':'id','Car':'car', 'Code':'code'}, inplace=True)
In [70]: df[['show_date', 'time_available']] = df.ShowTime.str.split(' ', expand=True)
In [71]: df.drop('ShowTim... | You could also try the json library. Its a bit hacky because you have to do some replaces. Changed it due to a mistake in the first version.
```
import json
data = """your string"""
data = data.replace("\n", "").replace("\t", "")
data = data.replace(r"'",r'\"').replace(" ", "").replace(",]", "]").replace('"data":', ""... |
56,801,384 | I have table pulled from sqlite3 using sqlalchemy. This table holds the date and time of each showing of the car:
```
Id Car Code ShowTime
1 Honda A 10/18/2017 14:45
1 Honda A 10/18/2017 17:10
3 Honda C 10/18/2017 19:35
4 Toyota B 10/18/2017 12:20
4 Toyota B 10/1... | 2019/06/28 | ['https://Stackoverflow.com/questions/56801384', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2341389/'] | You can use pandas to split the `ShowTime` column:
```
In [22]: import pandas as pd
In [68]: df = pd.read_csv('test.csv')
In [69]: df.rename(columns={'Id':'id','Car':'car', 'Code':'code'}, inplace=True)
In [70]: df[['show_date', 'time_available']] = df.ShowTime.str.split(' ', expand=True)
In [71]: df.drop('ShowTim... | Here you go:
```
import pandas as pd
from collections import defaultdict
data = {'Id': [1,1,3,4,4], 'Car': ['Honda','Honda','Honda','Toyota','Toyota'], 'Code': ['A','A','C','B','B'],
'ShowTime': ['10/18/2017 14:45', '10/18/2017 17:10', '10/18/2017 19:35', '10/18/2017 12:20', '10/18/2017 14:45']}
df = pd.Data... |
56,801,384 | I have table pulled from sqlite3 using sqlalchemy. This table holds the date and time of each showing of the car:
```
Id Car Code ShowTime
1 Honda A 10/18/2017 14:45
1 Honda A 10/18/2017 17:10
3 Honda C 10/18/2017 19:35
4 Toyota B 10/18/2017 12:20
4 Toyota B 10/1... | 2019/06/28 | ['https://Stackoverflow.com/questions/56801384', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2341389/'] | You can use pandas to split the `ShowTime` column:
```
In [22]: import pandas as pd
In [68]: df = pd.read_csv('test.csv')
In [69]: df.rename(columns={'Id':'id','Car':'car', 'Code':'code'}, inplace=True)
In [70]: df[['show_date', 'time_available']] = df.ShowTime.str.split(' ', expand=True)
In [71]: df.drop('ShowTim... | You can use the simple setdefault() dictionary method, too:
```
tbl=['1 Honda A 10/18/2017 14:45',
'1 Honda A 10/18/2017 17:10',
'3 Honda C 10/18/2017 19:35',
'4 Toyota B 10/18/2017 12:20',
'4 Toyota B 10/18/2017 14:45']
data={} ... |
59,125,318 | I have problem with this code:
```
function get_request($url,$header_array){
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 3... | 2019/12/01 | ['https://Stackoverflow.com/questions/59125318', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/-1/'] | There's a few things this could be; and generally its either a malformed URL or a networking issue outside the scope of cURL.
First, save yourself some time and just double and triple check you've typed the URL correctly. I do this time and time again =D
Next up, on the same machine and under the same user as your PH... | reading the symptoms, it is possible the DNS resolver that you use is probably too busy (timeout) -or- limit the number of inquiry per IP address in a certain timespan. So, the same exact process will probably give a different error if run on a different day. |
3,835,971 | Assuming the Hudson job checks out 2 SVN directories:
```
https://foo.com/packages (root is https://foo.com/packages) -> "packages" in workspace
https://bar.com/temp/Hudson (root is https://bar.com/temp) -> "Hudson" in workspace
```
I tried different things, browsed online for answers, but I still can't get these 2 ... | 2010/10/01 | ['https://Stackoverflow.com/questions/3835971', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/463432/'] | Take a look at the [ADO.NET Performance Counters](http://msdn.microsoft.com/en-us/library/ms254503.aspx) related to pooling.
Your described symptom is often an indication that you are leaking connections. Make sure all connections are disposed when you are finished with them, preferably by wrapping in an `using` state... | here's some code to try the pool and then failover to unpooled:
use this sub if a problem happens with the pool:
```
Public Sub OpenConn()
Dim sTempCNString As String = cn.ConnectionString
Try
' add a timeout to the cn string, following http://www.15seconds.com/issue/040830.htm
Dim iTimeOut As... |
54,559,793 | I started a new laravel project yesterday. Followed the guide from a guy in YouTube. Everything works until I installed laravel auth and realised none of the bootstrap dropdown works, even when i create new one from their website.
Firstly, I thought I messed something up in composer, because I wanted to get rid of the... | 2019/02/06 | ['https://Stackoverflow.com/questions/54559793', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/9034591/'] | I had the same problem, it is happening because bootstrap has not been loaded properly and I simply solved it by pasting this link in `<head>` tag
```
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGR... | It seems that your bootstrap has not been loaded at all. Make sure that you include the bootstrap library in your view. If you are using WebPack, check if you are mixing the external libraries into one, and include that one in your main blade file. |
54,559,793 | I started a new laravel project yesterday. Followed the guide from a guy in YouTube. Everything works until I installed laravel auth and realised none of the bootstrap dropdown works, even when i create new one from their website.
Firstly, I thought I messed something up in composer, because I wanted to get rid of the... | 2019/02/06 | ['https://Stackoverflow.com/questions/54559793', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/9034591/'] | By default, bootstrap.bundle.js is not included inside your Laravel app. To add this:
Open `'resources/js/bootstrap.js'` file and add the following code at the last line of this file.
```
require('bootstrap/dist/js/bootstrap.bundle');
```
Hit save and run `npm run dev` and it will work finally! | It seems that your bootstrap has not been loaded at all. Make sure that you include the bootstrap library in your view. If you are using WebPack, check if you are mixing the external libraries into one, and include that one in your main blade file. |
54,559,793 | I started a new laravel project yesterday. Followed the guide from a guy in YouTube. Everything works until I installed laravel auth and realised none of the bootstrap dropdown works, even when i create new one from their website.
Firstly, I thought I messed something up in composer, because I wanted to get rid of the... | 2019/02/06 | ['https://Stackoverflow.com/questions/54559793', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/9034591/'] | It seems that your bootstrap has not been loaded at all. Make sure that you include the bootstrap library in your view. If you are using WebPack, check if you are mixing the external libraries into one, and include that one in your main blade file. | Sometimes you should change order of script links for that to work |
54,559,793 | I started a new laravel project yesterday. Followed the guide from a guy in YouTube. Everything works until I installed laravel auth and realised none of the bootstrap dropdown works, even when i create new one from their website.
Firstly, I thought I messed something up in composer, because I wanted to get rid of the... | 2019/02/06 | ['https://Stackoverflow.com/questions/54559793', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/9034591/'] | I had the same problem, it is happening because bootstrap has not been loaded properly and I simply solved it by pasting this link in `<head>` tag
```
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGR... | Sometimes you should change order of script links for that to work |
54,559,793 | I started a new laravel project yesterday. Followed the guide from a guy in YouTube. Everything works until I installed laravel auth and realised none of the bootstrap dropdown works, even when i create new one from their website.
Firstly, I thought I messed something up in composer, because I wanted to get rid of the... | 2019/02/06 | ['https://Stackoverflow.com/questions/54559793', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/9034591/'] | By default, bootstrap.bundle.js is not included inside your Laravel app. To add this:
Open `'resources/js/bootstrap.js'` file and add the following code at the last line of this file.
```
require('bootstrap/dist/js/bootstrap.bundle');
```
Hit save and run `npm run dev` and it will work finally! | Sometimes you should change order of script links for that to work |
52,653,776 | I've been successfully running the local development server daily and have made no changes except that I called "gcloud components update" just before it stopped working. Now I get:
```
..snip... <<PATH TO MY SDK>>/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/application_configur... | 2018/10/04 | ['https://Stackoverflow.com/questions/52653776', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/10458445/'] | It looks like there's [an active issue on Google's issue tracker](https://issuetracker.google.com/117145272) (opened on Oct 2, 2018) pertaining to this:
>
> After updating to the Python (2.7) extensions for GAE to version
> 1.9.76, I am no longer able to run my code with dev\_appserver.py
>
>
>
As of Oct 3, a fix... | `cd` to the directory with `app.yaml` in it and try again |
52,653,776 | I've been successfully running the local development server daily and have made no changes except that I called "gcloud components update" just before it stopped working. Now I get:
```
..snip... <<PATH TO MY SDK>>/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/application_configur... | 2018/10/04 | ['https://Stackoverflow.com/questions/52653776', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/10458445/'] | You may create `make` file and have something like this:
```
export SDK=dev_appserver.py
export APP_PATH=${CURDIR}
run:
$(SDK) $(APP_PATH)/path-to/app.yaml
```
And just use it with: `make run` so you don't have to worry about paths. | `cd` to the directory with `app.yaml` in it and try again |
52,653,776 | I've been successfully running the local development server daily and have made no changes except that I called "gcloud components update" just before it stopped working. Now I get:
```
..snip... <<PATH TO MY SDK>>/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/application_configur... | 2018/10/04 | ['https://Stackoverflow.com/questions/52653776', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/10458445/'] | It looks like there's [an active issue on Google's issue tracker](https://issuetracker.google.com/117145272) (opened on Oct 2, 2018) pertaining to this:
>
> After updating to the Python (2.7) extensions for GAE to version
> 1.9.76, I am no longer able to run my code with dev\_appserver.py
>
>
>
As of Oct 3, a fix... | You may create `make` file and have something like this:
```
export SDK=dev_appserver.py
export APP_PATH=${CURDIR}
run:
$(SDK) $(APP_PATH)/path-to/app.yaml
```
And just use it with: `make run` so you don't have to worry about paths. |
52,653,776 | I've been successfully running the local development server daily and have made no changes except that I called "gcloud components update" just before it stopped working. Now I get:
```
..snip... <<PATH TO MY SDK>>/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/application_configur... | 2018/10/04 | ['https://Stackoverflow.com/questions/52653776', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/10458445/'] | It looks like there's [an active issue on Google's issue tracker](https://issuetracker.google.com/117145272) (opened on Oct 2, 2018) pertaining to this:
>
> After updating to the Python (2.7) extensions for GAE to version
> 1.9.76, I am no longer able to run my code with dev\_appserver.py
>
>
>
As of Oct 3, a fix... | On Windows, `dev_appserver.py %CD%` is enough if your .yaml file has the default `app.yaml` name. Otherwise `dev_appserver.py %CD%/your-file-name.yaml` |
52,653,776 | I've been successfully running the local development server daily and have made no changes except that I called "gcloud components update" just before it stopped working. Now I get:
```
..snip... <<PATH TO MY SDK>>/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/application_configur... | 2018/10/04 | ['https://Stackoverflow.com/questions/52653776', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/10458445/'] | It looks like there's [an active issue on Google's issue tracker](https://issuetracker.google.com/117145272) (opened on Oct 2, 2018) pertaining to this:
>
> After updating to the Python (2.7) extensions for GAE to version
> 1.9.76, I am no longer able to run my code with dev\_appserver.py
>
>
>
As of Oct 3, a fix... | This worked for me: in `app.yaml`, change
`runtime: go`
to
`runtime: go111` |
52,653,776 | I've been successfully running the local development server daily and have made no changes except that I called "gcloud components update" just before it stopped working. Now I get:
```
..snip... <<PATH TO MY SDK>>/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/application_configur... | 2018/10/04 | ['https://Stackoverflow.com/questions/52653776', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/10458445/'] | You may create `make` file and have something like this:
```
export SDK=dev_appserver.py
export APP_PATH=${CURDIR}
run:
$(SDK) $(APP_PATH)/path-to/app.yaml
```
And just use it with: `make run` so you don't have to worry about paths. | On Windows, `dev_appserver.py %CD%` is enough if your .yaml file has the default `app.yaml` name. Otherwise `dev_appserver.py %CD%/your-file-name.yaml` |
52,653,776 | I've been successfully running the local development server daily and have made no changes except that I called "gcloud components update" just before it stopped working. Now I get:
```
..snip... <<PATH TO MY SDK>>/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/application_configur... | 2018/10/04 | ['https://Stackoverflow.com/questions/52653776', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/10458445/'] | You may create `make` file and have something like this:
```
export SDK=dev_appserver.py
export APP_PATH=${CURDIR}
run:
$(SDK) $(APP_PATH)/path-to/app.yaml
```
And just use it with: `make run` so you don't have to worry about paths. | This worked for me: in `app.yaml`, change
`runtime: go`
to
`runtime: go111` |
6,756,099 | **Ooops, fiddle updated now correct**
In this fiddle, <http://jsfiddle.net/SySRb/118/> once you click `.start` an element from an array is randomly chosen and assigned to variable `ran` This random selection jquery has been checked <http://jsfiddle.net/urfXq/96/> and is working so I don't think that's the problem, alth... | 2011/07/20 | ['https://Stackoverflow.com/questions/6756099', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/577455/'] | You are doing the string concatenation wrong..
use
```
ran = '#' + ran;
$(ran).show();
```
and you need to call your `test` method on `document.ready` so use
```
$(test);
```
Demo at <http://jsfiddle.net/gaby/SySRb/129/> | A few things:
1. You're forgetting to use `$` to query the DOM with jQuery. You should replace:
```
ran = ('# + ran');
```
with
```
ran = $("#" + ran");
```
That is, build a jQuery selector by appending `#` to `ran`, then call jQuery with that selector.
2. Since the variable you're saving the results of the jQue... |
30,220,156 | At the moment I'm trying to create my own WordPress blog with an own theme. It works really good so far but I have one problem: I use the skel.js and this tryes to load a css file. which can't be found because it looks under:
>
> /wp-admin/css/style.css
>
>
>
I'm really new to WordPress soI have no idea how I can... | 2015/05/13 | ['https://Stackoverflow.com/questions/30220156', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2047987/'] | The following code should go in your functions file. Then your css should go into your css folder in your theme
```
function enqueue_additional_stylesheets() {
// Register the style like this for a theme:
wp_register_style( 'css_file', get_template_directory_uri() . '/css/yourfile.css', array(), '20150505', 'a... | You can either modify the JS file (which may pose a problem when you do version updates), or you can put the CSS file where it's expected. The latter seems like a simple approach.
You could also use an `@import` statement in style.css (at the expected location) to include the other file (at its current location).
`... |
1,021,071 | I hope you can help me.
I have 5 Public IP's in an subnet `186.121.200.X/29`
I have `example.com` addressed to one of those public IPs, and some subdomains that point to the rest of them.
Now, I have other 5 Public IP's in another subnet `190.181.15.Y/29`
**My question is:**
*Can I configure `example.com` to also ... | 2020/06/11 | ['https://serverfault.com/questions/1021071', 'https://serverfault.com', 'https://serverfault.com/users/578810/'] | You can have multiple entries for any A record. You'd just add another entry with whatever additional IP(s) you want to the zone file. | If I'm not mistaking, you are trying to do:
```
subdomain1 IN A 186.121.206.X3
```
Then point the reverse IP of:
```
190.181.15.Y IN PTR subdomain1.example.com.
```
Based on my experience, the organization who had received the direct IP allocation from ARIN, APNIC, AFRINIC, RIPE ... |
1,021,071 | I hope you can help me.
I have 5 Public IP's in an subnet `186.121.200.X/29`
I have `example.com` addressed to one of those public IPs, and some subdomains that point to the rest of them.
Now, I have other 5 Public IP's in another subnet `190.181.15.Y/29`
**My question is:**
*Can I configure `example.com` to also ... | 2020/06/11 | ['https://serverfault.com/questions/1021071', 'https://serverfault.com', 'https://serverfault.com/users/578810/'] | You can add multiple ip addresses for a single record in a zone, but you can't control (without additional resources) which ip will be resolved for each request, there'll be random resolutions (e: for two ip addresses, 50% of possibilities for each one) | If I'm not mistaking, you are trying to do:
```
subdomain1 IN A 186.121.206.X3
```
Then point the reverse IP of:
```
190.181.15.Y IN PTR subdomain1.example.com.
```
Based on my experience, the organization who had received the direct IP allocation from ARIN, APNIC, AFRINIC, RIPE ... |
9,693,323 | I have a lot of static IF statements that I need to use to build a page. How would I add this to the view itself (not the controller.)
**Example:** view: test.chtml
```
@{ if (!Request.Browser.IsMobileDevice)
{
<p>Write this to html</p>
}
}
```
I am not sure which html helper I should use to make this wr... | 2012/03/13 | ['https://Stackoverflow.com/questions/9693323', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/719825/'] | There is no such `HTML-Helper`, So your doing it the right way allready!(Ask for a salary raise...)
Just remove the `{}` as this code isn't a *"code block"*:
```
@if (!Request.Browser.IsMobileDevice)
{
<p>Write this to html</p>
}
```
[C# Razor Syntax Quick Reference](http://haacked.com/archive/2011/01/06/razor-... | Razor has a native if statement: `@if` does what you want. You might be interested in the following two links:
[ASP.Net's basic guide to writing views with Razor](http://www.asp.net/web-pages/tutorials/basics/2-introduction-to-asp-net-web-programming-using-the-razor-syntax)
[Phil Haack's concise syntax guide for Razo... |
9,693,323 | I have a lot of static IF statements that I need to use to build a page. How would I add this to the view itself (not the controller.)
**Example:** view: test.chtml
```
@{ if (!Request.Browser.IsMobileDevice)
{
<p>Write this to html</p>
}
}
```
I am not sure which html helper I should use to make this wr... | 2012/03/13 | ['https://Stackoverflow.com/questions/9693323', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/719825/'] | if you go
```
@:<p>Write this to html</p>
```
this may work
Although instead of putting it in a code block i perfer
```
@if (!Request.Browser.IsMobileDevice)
{
<p>Write this to html</p>
}
``` | There is no such `HTML-Helper`, So your doing it the right way allready!(Ask for a salary raise...)
Just remove the `{}` as this code isn't a *"code block"*:
```
@if (!Request.Browser.IsMobileDevice)
{
<p>Write this to html</p>
}
```
[C# Razor Syntax Quick Reference](http://haacked.com/archive/2011/01/06/razor-... |
9,693,323 | I have a lot of static IF statements that I need to use to build a page. How would I add this to the view itself (not the controller.)
**Example:** view: test.chtml
```
@{ if (!Request.Browser.IsMobileDevice)
{
<p>Write this to html</p>
}
}
```
I am not sure which html helper I should use to make this wr... | 2012/03/13 | ['https://Stackoverflow.com/questions/9693323', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/719825/'] | if you go
```
@:<p>Write this to html</p>
```
this may work
Although instead of putting it in a code block i perfer
```
@if (!Request.Browser.IsMobileDevice)
{
<p>Write this to html</p>
}
``` | Razor has a native if statement: `@if` does what you want. You might be interested in the following two links:
[ASP.Net's basic guide to writing views with Razor](http://www.asp.net/web-pages/tutorials/basics/2-introduction-to-asp-net-web-programming-using-the-razor-syntax)
[Phil Haack's concise syntax guide for Razo... |
584,870 | why this program is not executing when it goes in to the do while loop second time and why it is giving the exception "Exception java.sql.SQLException: [MySQL][ODBC 5.1 Driver][mysqld-5.0.51a-community-nt]No database selected"
```
//import java.io.InputStream;
import java.sql.Connection;
import java.sql.DriverManager;... | 2009/02/25 | ['https://Stackoverflow.com/questions/584870', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/-1/'] | Unless you have to use the jdbc/odbc driver I would use the straight mysql jdbc driver. You can download it free from mysql.
then
```
public void LoadDriver() {
// Load the JDBC-ODBC bridge driver
try {
Class.forName("com.mysql.jdbc.Driver");
} catch (ClassNotFoundException e... | Just from looking at the exception.. I would guess that you are not specifying the database.
How can you do a select on a table without telling it which schema to select from ?
This is typically set in the connection string.. |
584,870 | why this program is not executing when it goes in to the do while loop second time and why it is giving the exception "Exception java.sql.SQLException: [MySQL][ODBC 5.1 Driver][mysqld-5.0.51a-community-nt]No database selected"
```
//import java.io.InputStream;
import java.sql.Connection;
import java.sql.DriverManager;... | 2009/02/25 | ['https://Stackoverflow.com/questions/584870', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/-1/'] | Just from looking at the exception.. I would guess that you are not specifying the database.
How can you do a select on a table without telling it which schema to select from ?
This is typically set in the connection string.. | Found a [bug listing at MySQL](http://bugs.mysql.com/bug.php?id=3920) that gives this error but with different technologies. However, in the description it indicates that it is related to reauthorization not sending the database information, so perhaps that is what you are encountering here as well.
Some things that s... |
584,870 | why this program is not executing when it goes in to the do while loop second time and why it is giving the exception "Exception java.sql.SQLException: [MySQL][ODBC 5.1 Driver][mysqld-5.0.51a-community-nt]No database selected"
```
//import java.io.InputStream;
import java.sql.Connection;
import java.sql.DriverManager;... | 2009/02/25 | ['https://Stackoverflow.com/questions/584870', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/-1/'] | Just from looking at the exception.. I would guess that you are not specifying the database.
How can you do a select on a table without telling it which schema to select from ?
This is typically set in the connection string.. | Is the ODBC source actually set up to select a database? eg. can you access the database through another ODBC client tool?
If you need to select a database explicitly in the JDBC string you can do that using the ‘database’ parameter.
But having the database chosen in the ODBC setup would be more usual. And indeed, as... |
584,870 | why this program is not executing when it goes in to the do while loop second time and why it is giving the exception "Exception java.sql.SQLException: [MySQL][ODBC 5.1 Driver][mysqld-5.0.51a-community-nt]No database selected"
```
//import java.io.InputStream;
import java.sql.Connection;
import java.sql.DriverManager;... | 2009/02/25 | ['https://Stackoverflow.com/questions/584870', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/-1/'] | Unless you have to use the jdbc/odbc driver I would use the straight mysql jdbc driver. You can download it free from mysql.
then
```
public void LoadDriver() {
// Load the JDBC-ODBC bridge driver
try {
Class.forName("com.mysql.jdbc.Driver");
} catch (ClassNotFoundException e... | Found a [bug listing at MySQL](http://bugs.mysql.com/bug.php?id=3920) that gives this error but with different technologies. However, in the description it indicates that it is related to reauthorization not sending the database information, so perhaps that is what you are encountering here as well.
Some things that s... |
584,870 | why this program is not executing when it goes in to the do while loop second time and why it is giving the exception "Exception java.sql.SQLException: [MySQL][ODBC 5.1 Driver][mysqld-5.0.51a-community-nt]No database selected"
```
//import java.io.InputStream;
import java.sql.Connection;
import java.sql.DriverManager;... | 2009/02/25 | ['https://Stackoverflow.com/questions/584870', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/-1/'] | Unless you have to use the jdbc/odbc driver I would use the straight mysql jdbc driver. You can download it free from mysql.
then
```
public void LoadDriver() {
// Load the JDBC-ODBC bridge driver
try {
Class.forName("com.mysql.jdbc.Driver");
} catch (ClassNotFoundException e... | Is the ODBC source actually set up to select a database? eg. can you access the database through another ODBC client tool?
If you need to select a database explicitly in the JDBC string you can do that using the ‘database’ parameter.
But having the database chosen in the ODBC setup would be more usual. And indeed, as... |
584,870 | why this program is not executing when it goes in to the do while loop second time and why it is giving the exception "Exception java.sql.SQLException: [MySQL][ODBC 5.1 Driver][mysqld-5.0.51a-community-nt]No database selected"
```
//import java.io.InputStream;
import java.sql.Connection;
import java.sql.DriverManager;... | 2009/02/25 | ['https://Stackoverflow.com/questions/584870', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/-1/'] | Is the ODBC source actually set up to select a database? eg. can you access the database through another ODBC client tool?
If you need to select a database explicitly in the JDBC string you can do that using the ‘database’ parameter.
But having the database chosen in the ODBC setup would be more usual. And indeed, as... | Found a [bug listing at MySQL](http://bugs.mysql.com/bug.php?id=3920) that gives this error but with different technologies. However, in the description it indicates that it is related to reauthorization not sending the database information, so perhaps that is what you are encountering here as well.
Some things that s... |
10,143,140 | The HTML5 spec allows [form-associated elements](http://dev.w3.org/html5/spec/forms.html#form-associated-element) to refer to their [associated `<form>` element](http://dev.w3.org/html5/spec/association-of-controls-and-forms.html#attr-fae-form) via the `[form]` attribute. Do any browsers support this natively? | 2012/04/13 | ['https://Stackoverflow.com/questions/10143140', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/497418/'] | See:
* <http://www.impressivewebs.com/html5-form-attribute/>
* <http://swatelier.info/at/forms/HTML5attrib.asp>
The `form` attribute is supported since Firefox 4, Opera 9.5, Safari 5.1 and Chrome 10, but not on IE yet.
Here's a test page:
<http://www.impressivewebs.com/demo-files/html5-form-attribute/> | >
> Opera 9.5+, Safari 5.1+, Firefox 4+, Chrome 10+
>
>
> |
10,143,140 | The HTML5 spec allows [form-associated elements](http://dev.w3.org/html5/spec/forms.html#form-associated-element) to refer to their [associated `<form>` element](http://dev.w3.org/html5/spec/association-of-controls-and-forms.html#attr-fae-form) via the `[form]` attribute. Do any browsers support this natively? | 2012/04/13 | ['https://Stackoverflow.com/questions/10143140', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/497418/'] | See:
* <http://www.impressivewebs.com/html5-form-attribute/>
* <http://swatelier.info/at/forms/HTML5attrib.asp>
The `form` attribute is supported since Firefox 4, Opera 9.5, Safari 5.1 and Chrome 10, but not on IE yet.
Here's a test page:
<http://www.impressivewebs.com/demo-files/html5-form-attribute/> | Chrome v25 does not seem to recognize the use of the form attribute. A form that contains an element that has "form='xxx'" in it will not show up in that form's submitted content if the form name/id does not match the value of the form attrib. Also if the form attrib contains two form names, it will not show up at all,... |
10,143,140 | The HTML5 spec allows [form-associated elements](http://dev.w3.org/html5/spec/forms.html#form-associated-element) to refer to their [associated `<form>` element](http://dev.w3.org/html5/spec/association-of-controls-and-forms.html#attr-fae-form) via the `[form]` attribute. Do any browsers support this natively? | 2012/04/13 | ['https://Stackoverflow.com/questions/10143140', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/497418/'] | >
> Opera 9.5+, Safari 5.1+, Firefox 4+, Chrome 10+
>
>
> | Chrome v25 does not seem to recognize the use of the form attribute. A form that contains an element that has "form='xxx'" in it will not show up in that form's submitted content if the form name/id does not match the value of the form attrib. Also if the form attrib contains two form names, it will not show up at all,... |
1,890,332 | Hi I have been working on this problem and I don't understand my textbook's solution to this problem.
Here is my textbook's solution to the problem:
We have 1001 = 7\*11\*13 and the condition of the problem says 7\*11\*13\*k = 10^j - 10^i = (10^i)(10^(j-I) - 1). This implies 10^j-i = 1 (mod 1001) (and also (mod 7)).... | 2016/08/12 | ['https://math.stackexchange.com/questions/1890332', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/360993/'] | You have $7 \cdot 11 \cdot 13 \cdot k$ is a multiple of $1001$. You know $10^I$ is not a multiple of $1001$, so the other factor $10^{j-I}-1$ must be a multiple of $1001$ and hence of all its factors. The rest of the proof is incorrect but results in the correct answer. Euler's totient theorem says that $a^{\phi(n)} \e... | "I don't get how $(10^i)(10^{(j-I)} - 1)$ implies $10^{(j-I)} = 1 (\mod 1001)$
$1001k = 10^j - 10^i \iff 10^j - 10^i \equiv 0 \mod 1001$
So $10^{i}(10^{j-i}-1) \equiv 0 \mod 1001$.
$\gcd(10^i, 1001) = \gcd(2^i\*5^i, 7\*11\*13) = 1$.
So $10^{i}(10^{j-i}-1) \equiv 0 \mod 1001 \iff 10^{j-i} - 1 \equiv 1001 \iff 10^{j-... |
1,890,332 | Hi I have been working on this problem and I don't understand my textbook's solution to this problem.
Here is my textbook's solution to the problem:
We have 1001 = 7\*11\*13 and the condition of the problem says 7\*11\*13\*k = 10^j - 10^i = (10^i)(10^(j-I) - 1). This implies 10^j-i = 1 (mod 1001) (and also (mod 7)).... | 2016/08/12 | ['https://math.stackexchange.com/questions/1890332', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/360993/'] | You have $7 \cdot 11 \cdot 13 \cdot k$ is a multiple of $1001$. You know $10^I$ is not a multiple of $1001$, so the other factor $10^{j-I}-1$ must be a multiple of $1001$ and hence of all its factors. The rest of the proof is incorrect but results in the correct answer. Euler's totient theorem says that $a^{\phi(n)} \e... | Forgive the second answer but you book just gives the wrong reason.
Instead here's the "pretty picture" way:
$10^j - 10^i = 100000..... - 1000.... = 99999999.....90000.....$
where there are $j-i$ 9's and $i$ zeros. This is divisble by $1001$ only if $999...9 = 10^{j-i} -1$ is.
So take some pencil and paper and do t... |
363,876 | How can I use file command to know which language my file is written? File command use language tests to get the language file is written, but it seems it do not execute when first two tests - file type and magic number execute properly. How to check only the language a file is written in? | 2017/05/09 | ['https://unix.stackexchange.com/questions/363876', 'https://unix.stackexchange.com', 'https://unix.stackexchange.com/users/230526/'] | Maybe not very smart solution:
* sort files by name
* loop through names
* compare characters of last loop:
```
last=""
ls -1 $1 | sort | while read file; do
sub=${file:0:3}
[ "$last" != "$sub" ] && { echo "NEW GROUP"; last="$sub"; }
echo "[$sub] $file"
done
```
Instead of echo-ing collect filenames ins... | With `zsh`:
```
files=(???-??-*.avi)
for prefix (${(Mu)files#???-??-}) encode $prefix*.avi
```
(or `encode ${(M)files:#$prefix*}`)
The equivalent with the GNU shell (`bash`) and tools would be:
```
while IFS= read -u3 -rd '' prefix; do
encode "$prefix-"*.avi 3<&-
done 3< <(printf '%s\0' ???-??-*.avi | grep -oz '... |
13,216,224 | I am using Xilinx and trying to compile this code.
I am getting this error:
**ERROR:HDLParsers:808 - "C:/Users/Dell/digi/sm.vhd" Line xx. and can not have such operands in this context.**
[code is here](http://pastebin.com/JSmaE5dj) | 2012/11/04 | ['https://Stackoverflow.com/questions/13216224', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1416136/'] | The problem is you are mixing bit and std\_logic types. You should generally pick one or the other (no using both in the same file unless you *REALLY* know why you need to), most new work is usually done using std\_logic. To fix the problem you need to make everything consistent...either change your inputs to bit types... | Changing the declaration of ports from
```
port(X1,X2,CLK: in STD_LOGIC;
```
to
```
port(X1,X2,CLK: in bit;
```
made it work.
[Difference between the two](http://vhdlguru.blogspot.in/2010/03/what-is-difference-between-stdlogic-and.html) |
268,491 | When this exchange happens during the final batter in *Return of the Jedi* (1983), how was “north” determined within the structure of the Death Star?
>
> **LANDO:** There it is. All right, Wedge, go for the power regulator on the **north tower**.
>
>
> **WEDGE:** Copy, Gold Leader. I'm already on my way out.
>
>
... | 2022/10/11 | ['https://scifi.stackexchange.com/questions/268491', 'https://scifi.stackexchange.com', 'https://scifi.stackexchange.com/users/140601/'] | From *Star Wars: Complete Locations* (2016):
[](https://i.stack.imgur.com/cZoP0.jpg)
>
> **1** The primary stage focused on assembling components necessary for construction of the main reactor cor... | Artificial gravity in *Star Wars* works weirdly, compared to real world artificial gravity which requires the spaceship to rotate. *Star Wars* artificial gravity just picks a direction as 'down' and makes it work.
This might be hard to observe in a small fighter like an X-wing, where the pilot is strapped to a chair. ... |
268,491 | When this exchange happens during the final batter in *Return of the Jedi* (1983), how was “north” determined within the structure of the Death Star?
>
> **LANDO:** There it is. All right, Wedge, go for the power regulator on the **north tower**.
>
>
> **WEDGE:** Copy, Gold Leader. I'm already on my way out.
>
>
... | 2022/10/11 | ['https://scifi.stackexchange.com/questions/268491', 'https://scifi.stackexchange.com', 'https://scifi.stackexchange.com/users/140601/'] | From *Star Wars: Complete Locations* (2016):
[](https://i.stack.imgur.com/cZoP0.jpg)
>
> **1** The primary stage focused on assembling components necessary for construction of the main reactor cor... | The same way as on Earth: it's defined by convention.
Specifically, the direction of spin of a body relative to the celestial background is a vector found with the right hand rule (or cross-products). That vector is "celestial north". This actually matters a great deal if you want to do orbital mechanics calculations,... |
22,902,486 | I am having trouble with getting the JavaScript to do what I need it to. I have a form with a country drop down list that has United States or Other; then I have a State field with a list of all 50 states in the US; then I have a text field for people to put what country they live in if they don't live in the United St... | 2014/04/07 | ['https://Stackoverflow.com/questions/22902486', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2810473/'] | You need to understand what `include` does. Literally everything in the "included" file will be put where you call that function. So in this case, you're putting practically an entire HTML document inside the `<head>` of another.
headertop.php should likely only be:
```
<meta http-equiv="content-type" content="text/h... | It looks like you should delete everything outside of `<header>...</header>` from your headertop.php file. You already define the html and head tags in index.php so you don't need to do it again in headertop.php. However I'm not sure you really want your header block to be inside the page's head section. Shouldn't it b... |
22,902,486 | I am having trouble with getting the JavaScript to do what I need it to. I have a form with a country drop down list that has United States or Other; then I have a State field with a list of all 50 states in the US; then I have a text field for people to put what country they live in if they don't live in the United St... | 2014/04/07 | ['https://Stackoverflow.com/questions/22902486', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2810473/'] | It looks like you should delete everything outside of `<header>...</header>` from your headertop.php file. You already define the html and head tags in index.php so you don't need to do it again in headertop.php. However I'm not sure you really want your header block to be inside the page's head section. Shouldn't it b... | You can do it like this.
index.php
```
<!DOCTYPE html>
<html>
<head>
<title>HOME</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<meta name="description" content="Slide Down Box Menu with jQuery and CSS3" />
<meta name="keywords" content="jquery, css3, sliding, box, menu, ... |
22,902,486 | I am having trouble with getting the JavaScript to do what I need it to. I have a form with a country drop down list that has United States or Other; then I have a State field with a list of all 50 states in the US; then I have a text field for people to put what country they live in if they don't live in the United St... | 2014/04/07 | ['https://Stackoverflow.com/questions/22902486', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2810473/'] | You need to understand what `include` does. Literally everything in the "included" file will be put where you call that function. So in this case, you're putting practically an entire HTML document inside the `<head>` of another.
headertop.php should likely only be:
```
<meta http-equiv="content-type" content="text/h... | You can do it like this.
index.php
```
<!DOCTYPE html>
<html>
<head>
<title>HOME</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<meta name="description" content="Slide Down Box Menu with jQuery and CSS3" />
<meta name="keywords" content="jquery, css3, sliding, box, menu, ... |
43,404,865 | I'm making a login script which fetches data from two tables. I understand that this error occurs when the statement returns FALSE AKA a boolean, but why is it returning false???
I made a function which works up to a point
```
function loginall($username, $password)
{
$db_host="localhost";
$db_username="ro... | 2017/04/14 | ['https://Stackoverflow.com/questions/43404865', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5990955/'] | Your function will end/return as soon as it hits the first return statement in the loop (first iteration).
You will need to build the complete array and then return it once.
This ought to do it:
```
if(!($stmt=$mysqli->prepare($qry))){
return ["Prepare failed: ".mysqli_error($mysqli)]; // what does this say?
}el... | Try this maybe `bind_result()` not `get_result()`:
You might be wondering, why even use `bind_result()`?
This is strictly due to preference, as the syntax is considered to be more readable.
However, it should be noted that bind\_result() may not be used with the \* wildcard selector. It must contain explicit values... |
37,447,721 | I have a main method in a package in one of my projects. Say, the package is `com.ant.car`. I am trying to run and/or debug this main method, and I keep getting the error `Could not find or load main class com.ant.car`.
I've searched this problem, and it seems like I can't figure out what is wrong.
1) I've checked ru... | 2016/05/25 | ['https://Stackoverflow.com/questions/37447721', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2664815/'] | This issue occurs when the main .class file moved or not found because you changed the directory for committed/shared the project into the git or another repository.
To Resolve this issue -->
Remove existing run configuration and new one.
Find the parent pom.xml or project pom.xml and open cmd/command prompt and run t... | I think .class files are deleted/missing from JavaProject/bin folder.
To resolve this issue ->
1) Just cut paste and save the code contents of all the files that you are using then .class files will be regenerated.
2) Then run the code and you can see it works fine if there is no syntactical errors. |
37,447,721 | I have a main method in a package in one of my projects. Say, the package is `com.ant.car`. I am trying to run and/or debug this main method, and I keep getting the error `Could not find or load main class com.ant.car`.
I've searched this problem, and it seems like I can't figure out what is wrong.
1) I've checked ru... | 2016/05/25 | ['https://Stackoverflow.com/questions/37447721', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2664815/'] | The solution to this was the following:
* Close Eclipse/STS
* Use a file explorer on your operating system to navigate to your workspace (In my case, I'm on Windows so I used Windows Explorer)
* Delete the `.metadata` directory (or to be safe, copy the directory somewhere else to be safe, then delete it)
* Restart Ecl... | A quick and easy fix is to directly run your SpringBootApplication class (i.e. Right click, Run As -> Spring Boot App). This runs the app and creates a run configuration automatically. |
37,447,721 | I have a main method in a package in one of my projects. Say, the package is `com.ant.car`. I am trying to run and/or debug this main method, and I keep getting the error `Could not find or load main class com.ant.car`.
I've searched this problem, and it seems like I can't figure out what is wrong.
1) I've checked ru... | 2016/05/25 | ['https://Stackoverflow.com/questions/37447721', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2664815/'] | Today I ran into the same problem and I tried a lot of answers. Nothing helped. Cleaning the project, build automatically is already checked, deleting `.metadata`, etc.
Eventually I tried this and it worked perfectly:
menu Project -> Properties
Java Build Path, tab Libraries
Remove the JRE System Library from the... | I faced the same issue..
just do follow these steps:
>
> STS/Eclipse --> Project --> Enable "Build Automatically"
>
>
>
then refresh your project, it will resolve your issue.
Still not refreshed your projects automatically, just restart your STS and check.
Hope it will help you. |
37,447,721 | I have a main method in a package in one of my projects. Say, the package is `com.ant.car`. I am trying to run and/or debug this main method, and I keep getting the error `Could not find or load main class com.ant.car`.
I've searched this problem, and it seems like I can't figure out what is wrong.
1) I've checked ru... | 2016/05/25 | ['https://Stackoverflow.com/questions/37447721', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2664815/'] | What worked for me:
**Menu Project -> Properties**
In **Java Build Path**, tab **Libraries**
Delete all libraries with a red [x] next to them.
In my case, problem happened when I switched from Kepler to STS IDE. | Project -> Clean... -> check project not working -> Clean
I already had build automatically set, but forcing STS to rebuild it fixed it. |
37,447,721 | I have a main method in a package in one of my projects. Say, the package is `com.ant.car`. I am trying to run and/or debug this main method, and I keep getting the error `Could not find or load main class com.ant.car`.
I've searched this problem, and it seems like I can't figure out what is wrong.
1) I've checked ru... | 2016/05/25 | ['https://Stackoverflow.com/questions/37447721', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2664815/'] | This issue occurs when the main .class file moved or not found because you changed the directory for committed/shared the project into the git or another repository.
To Resolve this issue -->
Remove existing run configuration and new one.
Find the parent pom.xml or project pom.xml and open cmd/command prompt and run t... | I tried all the answers but finally what worked for me was deleting the project from eclipse workspace and importing it again. |
37,447,721 | I have a main method in a package in one of my projects. Say, the package is `com.ant.car`. I am trying to run and/or debug this main method, and I keep getting the error `Could not find or load main class com.ant.car`.
I've searched this problem, and it seems like I can't figure out what is wrong.
1) I've checked ru... | 2016/05/25 | ['https://Stackoverflow.com/questions/37447721', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2664815/'] | Today I ran into the same problem and I tried a lot of answers. Nothing helped. Cleaning the project, build automatically is already checked, deleting `.metadata`, etc.
Eventually I tried this and it worked perfectly:
menu Project -> Properties
Java Build Path, tab Libraries
Remove the JRE System Library from the... | 1. Remove project from STS/Eclipse
2. Close or Refresh the Eclipse/ STS Eclipse.
3. Run maven install on pom.
4. Run the project with your Run configuration.
Tried above mentioned steps to resolved issue. |
37,447,721 | I have a main method in a package in one of my projects. Say, the package is `com.ant.car`. I am trying to run and/or debug this main method, and I keep getting the error `Could not find or load main class com.ant.car`.
I've searched this problem, and it seems like I can't figure out what is wrong.
1) I've checked ru... | 2016/05/25 | ['https://Stackoverflow.com/questions/37447721', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2664815/'] | Today I ran into the same problem and I tried a lot of answers. Nothing helped. Cleaning the project, build automatically is already checked, deleting `.metadata`, etc.
Eventually I tried this and it worked perfectly:
menu Project -> Properties
Java Build Path, tab Libraries
Remove the JRE System Library from the... | This worked for me to solve the error. (I got this error after removing AWS ToolKit)
1. **Close** the Eclipse/ STS Eclipse.
2. Go to the **WorkSpace** folder.
3. **Delete** the ***.metadata*** folder.
4. **Open** the eclipse.
5. Run ***maven install*** on pom.
6. **Run** the project with your Run configuration. |
37,447,721 | I have a main method in a package in one of my projects. Say, the package is `com.ant.car`. I am trying to run and/or debug this main method, and I keep getting the error `Could not find or load main class com.ant.car`.
I've searched this problem, and it seems like I can't figure out what is wrong.
1) I've checked ru... | 2016/05/25 | ['https://Stackoverflow.com/questions/37447721', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2664815/'] | Project -> Clean
**this is working** | I faced the same issue..
just do follow these steps:
>
> STS/Eclipse --> Project --> Enable "Build Automatically"
>
>
>
then refresh your project, it will resolve your issue.
Still not refreshed your projects automatically, just restart your STS and check.
Hope it will help you. |
37,447,721 | I have a main method in a package in one of my projects. Say, the package is `com.ant.car`. I am trying to run and/or debug this main method, and I keep getting the error `Could not find or load main class com.ant.car`.
I've searched this problem, and it seems like I can't figure out what is wrong.
1) I've checked ru... | 2016/05/25 | ['https://Stackoverflow.com/questions/37447721', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2664815/'] | Today I ran into the same problem and I tried a lot of answers. Nothing helped. Cleaning the project, build automatically is already checked, deleting `.metadata`, etc.
Eventually I tried this and it worked perfectly:
menu Project -> Properties
Java Build Path, tab Libraries
Remove the JRE System Library from the... | 1 ) Clean the Project
2 ) Enable build automatically Option
3 ) Update the maven project by use the short cut `Alt` + `F5` |
37,447,721 | I have a main method in a package in one of my projects. Say, the package is `com.ant.car`. I am trying to run and/or debug this main method, and I keep getting the error `Could not find or load main class com.ant.car`.
I've searched this problem, and it seems like I can't figure out what is wrong.
1) I've checked ru... | 2016/05/25 | ['https://Stackoverflow.com/questions/37447721', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2664815/'] | It worked for me:
1. Delete metadata from work-space directory.
2. Import the project again, but selected copy to work-space option.
I think the cause for the error was Non-English characters in the original saved directory. | I spent several hours on this issue, finally it is fixed by doing this:
Properties -> Java Compiler: uncheck the checkbox "use '--release' option" |
8,389,278 | I have a .NET 4 class library that contains an Entity Framework data model and a collection of classes that provide common functionality using those entities. These classes are used across different types of applications.
So, my question is would it be considered good practice to expose entities contained within the ... | 2011/12/05 | ['https://Stackoverflow.com/questions/8389278', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/667108/'] | If your entities are advanced enough to meet your persistence needs *and* your domain needs (or external application needs) and there is not much or a low-likelihood of "cross-layer pollution", then I say yes it's a good practice. It can also be a good practice in the agile development sense: good-enough-for-now.
Give... | Because entity framework changes whenever the database changes, I don't believe this would provide an adequate API. Instead, I would recommend creating a Data Transfer Object to act as an intermediary between external code and each entity that needs to be accessed. Furthermore, consider creating a Facade class (Service... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.