qid int64 1 74.7M | question stringlengths 15 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 4 30.2k | response_k stringlengths 11 36.5k |
|---|---|---|---|---|---|
22,235,460 | I would like the program to re-do the while loop when it catches the exception - the exception being receiving a number zero. Instead it continues a while loop with the code below, I would like it to ask for the user input again until the user inputs a number that is different by zero.
```
import java.util.InputMismat... | 2014/03/06 | [
"https://Stackoverflow.com/questions/22235460",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3364271/"
] | Use something of the following form (not exact Java for your homework problem)
```
boolean validInput = false;
while (!validInput) {
.. get input
.. set validInput = true if no error
.. catch error
.. print try again message
}
``` | You can set a boolean value, that determines, if the `while` loop ends succesfully. Then in every loop you start by assuming the value is `true` and when an exception is raised, you set it to `false`.
```
boolean success = false;
while(success == false){
success = true;
try {
System.out.println("Enter... |
22,235,460 | I would like the program to re-do the while loop when it catches the exception - the exception being receiving a number zero. Instead it continues a while loop with the code below, I would like it to ask for the user input again until the user inputs a number that is different by zero.
```
import java.util.InputMismat... | 2014/03/06 | [
"https://Stackoverflow.com/questions/22235460",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3364271/"
] | Use something of the following form (not exact Java for your homework problem)
```
boolean validInput = false;
while (!validInput) {
.. get input
.. set validInput = true if no error
.. catch error
.. print try again message
}
``` | Define a boolean outside of your while loop, and use it for the while's condition.
Assuming I understood your question correctly, you want to stay in the loop if the user's input threw an exception, ie it was invalid input, and you want to break out of the loop when you get valid input from the user.
```
boolean gotV... |
22,235,460 | I would like the program to re-do the while loop when it catches the exception - the exception being receiving a number zero. Instead it continues a while loop with the code below, I would like it to ask for the user input again until the user inputs a number that is different by zero.
```
import java.util.InputMismat... | 2014/03/06 | [
"https://Stackoverflow.com/questions/22235460",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3364271/"
] | Use something of the following form (not exact Java for your homework problem)
```
boolean validInput = false;
while (!validInput) {
.. get input
.. set validInput = true if no error
.. catch error
.. print try again message
}
``` | You can put extra outter loop, like
```
while (true) {
System.out.println("Enter a value: ");
a = s.nextInt();
while(true) {
/// terminate the loop in case of problem with a, and allow a user to re done
}
}
``` |
22,235,460 | I would like the program to re-do the while loop when it catches the exception - the exception being receiving a number zero. Instead it continues a while loop with the code below, I would like it to ask for the user input again until the user inputs a number that is different by zero.
```
import java.util.InputMismat... | 2014/03/06 | [
"https://Stackoverflow.com/questions/22235460",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3364271/"
] | Use something of the following form (not exact Java for your homework problem)
```
boolean validInput = false;
while (!validInput) {
.. get input
.. set validInput = true if no error
.. catch error
.. print try again message
}
``` | Cleaned up the warnings and moved `s` to ouside the `main` method and defined it as `static`. It appears the s is a resource leak if within the main and is never closed.
```
import java.util.InputMismatchException;
import java.util.Scanner;
public class whilePerjashtim {
private static Scanner s;
public sta... |
22,235,460 | I would like the program to re-do the while loop when it catches the exception - the exception being receiving a number zero. Instead it continues a while loop with the code below, I would like it to ask for the user input again until the user inputs a number that is different by zero.
```
import java.util.InputMismat... | 2014/03/06 | [
"https://Stackoverflow.com/questions/22235460",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3364271/"
] | Use something of the following form (not exact Java for your homework problem)
```
boolean validInput = false;
while (!validInput) {
.. get input
.. set validInput = true if no error
.. catch error
.. print try again message
}
``` | You need to handle the erroneous input as well if you want the while loop to continue properly: You need to get rid of the erroneous input at the end of each catch block. Adding continue will simply make the loop run again until the user gives the correct input.
```
catch (InputMismatchException e)
{
System.err.p... |
25,204,979 | I am having trouble getting my regex to match the pattern `"(cmd: .*)"`.
For example, I want to match `"(cmd: cd $HOME)"`.
Here is my regex : `\(cmd:\s+.*\)`
The problem is, this will also match `"(cmd: char) ()"`. Since there is a `".*"` inside the regex, it will match all `")"` until the last one it sees. How, ... | 2014/08/08 | [
"https://Stackoverflow.com/questions/25204979",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2759719/"
] | I would add another group to capture only thing you need.
```
^\(cmd\:(.*)\)$
``` | It is not possible to accomplish this with a regex. Brace or parenthesis matching requires a recursive/counting feature that is not available in a regex. You'll need a parser for this.
More details available here: <http://blogs.msdn.com/jaredpar/archive/2008/10/15/regular-expression-limitations.aspx> |
25,204,979 | I am having trouble getting my regex to match the pattern `"(cmd: .*)"`.
For example, I want to match `"(cmd: cd $HOME)"`.
Here is my regex : `\(cmd:\s+.*\)`
The problem is, this will also match `"(cmd: char) ()"`. Since there is a `".*"` inside the regex, it will match all `")"` until the last one it sees. How, ... | 2014/08/08 | [
"https://Stackoverflow.com/questions/25204979",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2759719/"
] | I would add another group to capture only thing you need.
```
^\(cmd\:(.*)\)$
``` | You want a regex that allows brackets in the match, but only if they are paired. Like this regex:
```
\(cmd:\s+([^()]*\([^()]\))*[^()]*\)
```
See [live demo](http://rubular.com/r/J5stvp8duY) |
25,204,979 | I am having trouble getting my regex to match the pattern `"(cmd: .*)"`.
For example, I want to match `"(cmd: cd $HOME)"`.
Here is my regex : `\(cmd:\s+.*\)`
The problem is, this will also match `"(cmd: char) ()"`. Since there is a `".*"` inside the regex, it will match all `")"` until the last one it sees. How, ... | 2014/08/08 | [
"https://Stackoverflow.com/questions/25204979",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2759719/"
] | Give you one Java implementation sample as below:
```
String str3 = "(cmd: (((char))) (ddt)) ()";
String regexp = "\\(cmd: "+ nestingPair(5, '(', ')')+ "\\)";
Pattern pMod = Pattern.compile(regexp);
Matcher mMod = pMod.matcher(str3);
while (mMod.find()) {
System.out.println(mMod.group(0));... | I would add another group to capture only thing you need.
```
^\(cmd\:(.*)\)$
``` |
25,204,979 | I am having trouble getting my regex to match the pattern `"(cmd: .*)"`.
For example, I want to match `"(cmd: cd $HOME)"`.
Here is my regex : `\(cmd:\s+.*\)`
The problem is, this will also match `"(cmd: char) ()"`. Since there is a `".*"` inside the regex, it will match all `")"` until the last one it sees. How, ... | 2014/08/08 | [
"https://Stackoverflow.com/questions/25204979",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2759719/"
] | Give you one Java implementation sample as below:
```
String str3 = "(cmd: (((char))) (ddt)) ()";
String regexp = "\\(cmd: "+ nestingPair(5, '(', ')')+ "\\)";
Pattern pMod = Pattern.compile(regexp);
Matcher mMod = pMod.matcher(str3);
while (mMod.find()) {
System.out.println(mMod.group(0));... | It is not possible to accomplish this with a regex. Brace or parenthesis matching requires a recursive/counting feature that is not available in a regex. You'll need a parser for this.
More details available here: <http://blogs.msdn.com/jaredpar/archive/2008/10/15/regular-expression-limitations.aspx> |
25,204,979 | I am having trouble getting my regex to match the pattern `"(cmd: .*)"`.
For example, I want to match `"(cmd: cd $HOME)"`.
Here is my regex : `\(cmd:\s+.*\)`
The problem is, this will also match `"(cmd: char) ()"`. Since there is a `".*"` inside the regex, it will match all `")"` until the last one it sees. How, ... | 2014/08/08 | [
"https://Stackoverflow.com/questions/25204979",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2759719/"
] | Give you one Java implementation sample as below:
```
String str3 = "(cmd: (((char))) (ddt)) ()";
String regexp = "\\(cmd: "+ nestingPair(5, '(', ')')+ "\\)";
Pattern pMod = Pattern.compile(regexp);
Matcher mMod = pMod.matcher(str3);
while (mMod.find()) {
System.out.println(mMod.group(0));... | You want a regex that allows brackets in the match, but only if they are paired. Like this regex:
```
\(cmd:\s+([^()]*\([^()]\))*[^()]*\)
```
See [live demo](http://rubular.com/r/J5stvp8duY) |
5,573,396 | How do I set up a fall-back file for an IceCast server? | 2011/04/06 | [
"https://Stackoverflow.com/questions/5573396",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/565403/"
] | If you happen to be using a very useful toolset named **liquidsoap** with icecast2 then you ought to be thrilled with the follow example, which will **play a directory of sound files, or if there is a live stream broadcast then it will fadeout the playlist, play a "jingle" sound file, then fadeup the live stream**. Asi... | From the doc:
```
fallback-mount>/example2.ogg</fallback-mount>
<fallback-override>1</fallback-override>
<fallback-when-full>1</fallback-when-full>`
```
Please see [icecast2\_config\_file](http://www.icecast.org/docs/icecast-2.3.1/icecast2_config_file.html) for more explanation scroll to the fallback-mount descripti... |
1,771,470 | I recently found an example on implementing a We3bService with groovy and jax-ws:
the problem is that the @webmethod annotation seems to be ignored.
This is the source code of the groovy script:
```
import javax.jws.soap.*
import javax.jws.*
import javax.xml.ws.*
import javax.xml.bind.annotation.*
@XmlAccessorType(X... | 2009/11/20 | [
"https://Stackoverflow.com/questions/1771470",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/278124/"
] | Two ways of doing it come to mind right away, there are probably others. Both require storing an IP in the database.
1. Block the vote from being created with a uniqueness validation.
```
class Vote < ActiveRecord::Base
validates_uniqueness_of :ip_address
...
end
```
2. Block the vote from being created in the c... | You could add an `ip_address` attribute to your `votes` table and `validates_uniqueness_of :ip_address` to ensure that only one vote can come from an IP. |
1,771,470 | I recently found an example on implementing a We3bService with groovy and jax-ws:
the problem is that the @webmethod annotation seems to be ignored.
This is the source code of the groovy script:
```
import javax.jws.soap.*
import javax.jws.*
import javax.xml.ws.*
import javax.xml.bind.annotation.*
@XmlAccessorType(X... | 2009/11/20 | [
"https://Stackoverflow.com/questions/1771470",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/278124/"
] | I would do both EmFi and bensie said and store the IP address with the vote but you might also want to look into creating a blacklist of IPs which you want to block because the represent popular proxy servers (for example, the many proxies in the <http://proxy.org/> list).
As you add to the list it will make it at lea... | You could add an `ip_address` attribute to your `votes` table and `validates_uniqueness_of :ip_address` to ensure that only one vote can come from an IP. |
1,771,470 | I recently found an example on implementing a We3bService with groovy and jax-ws:
the problem is that the @webmethod annotation seems to be ignored.
This is the source code of the groovy script:
```
import javax.jws.soap.*
import javax.jws.*
import javax.xml.ws.*
import javax.xml.bind.annotation.*
@XmlAccessorType(X... | 2009/11/20 | [
"https://Stackoverflow.com/questions/1771470",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/278124/"
] | Two ways of doing it come to mind right away, there are probably others. Both require storing an IP in the database.
1. Block the vote from being created with a uniqueness validation.
```
class Vote < ActiveRecord::Base
validates_uniqueness_of :ip_address
...
end
```
2. Block the vote from being created in the c... | I would do both EmFi and bensie said and store the IP address with the vote but you might also want to look into creating a blacklist of IPs which you want to block because the represent popular proxy servers (for example, the many proxies in the <http://proxy.org/> list).
As you add to the list it will make it at lea... |
18,511,286 | i been wanting to pass a data in the textfield of my selected cell, but im getting a full array of that parsed data where i NSLog the data it let me sees what data im passing and also the thing is when i click on any cell it gives me an exception, which is below
```
[UITableViewController setParentKey:]: unrecognized ... | 2013/08/29 | [
"https://Stackoverflow.com/questions/18511286",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2641205/"
] | It looks like you are expecting a `ChildTableViewController` but receiving a `UITableViewController`. Make sure your segue is navigating to what you think. You can also add this:
```
if ([myNextPage isKindOfClass:[ChildTableViewController class]])
```
That will likely prevent the crash, but if the segue is misconfig... | Error showing that you are trying to set the `parentKey` property of `UITableViewController` in fact `UITableViewController` doesn't have a property called `parentKey`. So make sure that you properly set the class of your view controller in storyboard to `ChildTableViewController` instead of `UITableViewController` |
18,773,531 | I have some very simple code that works in on the desktop with Chrome, Firefox, IE, and Safari on the Desktop, but when I try it on my Iphone it fails.
It's basically
```
var img1 = document.createElement('img');
img1.onerror = function() {
console.log('img1 fail');
};
img1.onload = function() {
console.log... | 2013/09/12 | [
"https://Stackoverflow.com/questions/18773531",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1308788/"
] | Ok I think the answer is this.
I am trying to use a PNG file that is 4096 x 4096
However this apple link
<https://developer.apple.com/library/safari/documentation/AppleApplications/Reference/SafariWebContent/CreatingContentforSafarioniPhone/CreatingContentforSafarioniPhone.html>
says for PNGs my image must be
`w... | So I was doing some network profiling in Safari on my iOS Simulator, and it seems like the first image is being requested fine (Response Status 200, OK, and the image seems to be loaded). Still unsure why it's firing the onerror event rather than the onload event though. I'm guessing it has something to do with the hea... |
18,773,531 | I have some very simple code that works in on the desktop with Chrome, Firefox, IE, and Safari on the Desktop, but when I try it on my Iphone it fails.
It's basically
```
var img1 = document.createElement('img');
img1.onerror = function() {
console.log('img1 fail');
};
img1.onload = function() {
console.log... | 2013/09/12 | [
"https://Stackoverflow.com/questions/18773531",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1308788/"
] | Ok I think the answer is this.
I am trying to use a PNG file that is 4096 x 4096
However this apple link
<https://developer.apple.com/library/safari/documentation/AppleApplications/Reference/SafariWebContent/CreatingContentforSafarioniPhone/CreatingContentforSafarioniPhone.html>
says for PNGs my image must be
`w... | I came across this issue on iOS 9 because I had set `img.crossOrigin = "anonymous"`.
Removing that allowed large photos direct from the camera to load on an iPad. |
2,497,668 | I'm looking to dynamically add watermarks to a video on a website. What, in your opinion, is the best language and library to do so? | 2010/03/23 | [
"https://Stackoverflow.com/questions/2497668",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/210072/"
] | You can do this using ffmpeg (from command line or using one of its API such as [ffmpeg-php](http://ffmpeg-php.sourceforge.net/)) with the [watermark](http://www.linuxjournal.com/video/add-watermark-video-ffmpeg) or [drawtext](http://goinggnu.wordpress.com/2007/05/07/watermark-videos-with-ffmpeg/) vhook component, depe... | I believe you have a couple choices.
Both Flash and Silverlight should allow you to create a separate layer and have your watermark displayed.
I'm not sure if there is a way to do this with mpeg/qt videos. |
2,497,668 | I'm looking to dynamically add watermarks to a video on a website. What, in your opinion, is the best language and library to do so? | 2010/03/23 | [
"https://Stackoverflow.com/questions/2497668",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/210072/"
] | I believe you have a couple choices.
Both Flash and Silverlight should allow you to create a separate layer and have your watermark displayed.
I'm not sure if there is a way to do this with mpeg/qt videos. | Of course, <http://ffmpeg-php.sourceforge.net/> is better to dynamically add watermarks to a video on your website. |
2,497,668 | I'm looking to dynamically add watermarks to a video on a website. What, in your opinion, is the best language and library to do so? | 2010/03/23 | [
"https://Stackoverflow.com/questions/2497668",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/210072/"
] | You can do this using ffmpeg (from command line or using one of its API such as [ffmpeg-php](http://ffmpeg-php.sourceforge.net/)) with the [watermark](http://www.linuxjournal.com/video/add-watermark-video-ffmpeg) or [drawtext](http://goinggnu.wordpress.com/2007/05/07/watermark-videos-with-ffmpeg/) vhook component, depe... | Of course, <http://ffmpeg-php.sourceforge.net/> is better to dynamically add watermarks to a video on your website. |
72,838,101 | Using Angular, I have created an icon component, which allows for attributes `size` and `color` to be set. The following HTML tag creates an icon:
```
<my-icon size='medium' color='primary-dark'>person</my-icon>
```
This component is essentially just a wrapper of the material-icons tag. The attributes `size` and `co... | 2022/07/02 | [
"https://Stackoverflow.com/questions/72838101",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11225028/"
] | Your CSS syntax is not valid: <https://codebeautify.org/cssvalidate/y22780750>
Correct syntax:
styles.css
```css
my-icon > mat-icon:hover {
color: blue;
}
.green {
color: green;
}
.medium {
font-size: 50px !important;
}
.large {
font-size: 100px !important;
}
```
Do note, that for size `font-size` I nee... | You can apply hover style from css to that class
For more reference:
<https://www.w3schools.com/csSref/sel_hover.asp> |
98,496 | The code of my script:
```
import drawtext
drawtext.chain = 'Hello World!'
drawtext.positionx = 0
drawtext.positiony = 0
```
The code of the file drawtext.py:
```
# import game engine modules
from bge import render, logic
# import stand alone modules
import bgl, blf
# create a new font object, use external ttf fil... | 2018/01/14 | [
"https://blender.stackexchange.com/questions/98496",
"https://blender.stackexchange.com",
"https://blender.stackexchange.com/users/50527/"
] | Managing multiple text fragments
================================
I suggest to place the text attributes into a container such such as a class:
```
class Text():
def __init__(self, text, x, y, color, font_id):
self.text = text
self.x = x
self.y = y
self.color = color
self.f... | The code of the script:
```
import module_drawseveralwordsII
```
The code of the module\_drawseveralwordsII.py:
```
# import game engine modules
from bge import render, logic
# import stand alone modules
import bgl, blf
# create a new font object, use external ttf file
font_path = logic.expandPath('C://Documents ... |
14,581,747 | Hey all i have looked thoroughly through all the questions containing `XDocument` and while they are all giving an answer to what I'm looking for (mostly namespaces issues) it seems it just won't work for me.
The problem I'm having is that I'm unable to select any value, be it an attribute or element.
Using this [XML... | 2013/01/29 | [
"https://Stackoverflow.com/questions/14581747",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/514133/"
] | You can omit the namespace declaration in your linq statement.
```
public void GetEvent()
{
var xdocument = XDocument.Load(@"Shared\techdays2013.xml");
//XNamespace xmlns = "http://www.w3.org/2001/XMLSchema-instance";
var data = from c in xdocument.Descendants("speaker")
select c.Element("f... | 1) You have to drop the namespace
2) You'll have to query more precisely. All your `<speaker>` elements inside `<speakers>` have a fullname but in the next section I spotted `<speaker id="94" />`
A simple fix (maybe not the best) :
```
//untested
var data = from c in xdocument.Root.Descendants("speakers").Descendan... |
14,581,747 | Hey all i have looked thoroughly through all the questions containing `XDocument` and while they are all giving an answer to what I'm looking for (mostly namespaces issues) it seems it just won't work for me.
The problem I'm having is that I'm unable to select any value, be it an attribute or element.
Using this [XML... | 2013/01/29 | [
"https://Stackoverflow.com/questions/14581747",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/514133/"
] | You can omit the namespace declaration in your linq statement.
```
public void GetEvent()
{
var xdocument = XDocument.Load(@"Shared\techdays2013.xml");
//XNamespace xmlns = "http://www.w3.org/2001/XMLSchema-instance";
var data = from c in xdocument.Descendants("speaker")
select c.Element("f... | You can omit `WebClient` because you have direct local access to a file. I'm just showing a way to process your file on my machine.
```
void Main()
{
string p = @"http://events.feed.comportal.be/agenda.aspx?event=TechDays&year=2013&speakerlist=c%7CExperts";
using (var client = new WebClient())
{
s... |
5,021,338 | I have a UIScrollView with varying numbers of items/subviews. When there is more than one item, scrolling bounce works. However, there are times when the scrollview should only have one item, and I would like to provide the feedback to the user that their scrolls are being recognized--thus the bounce effect. However, U... | 2011/02/16 | [
"https://Stackoverflow.com/questions/5021338",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/404146/"
] | Answer: set alwaysBounceHorizontal or alwaysBounceVertical to true. I answered my own question while writing this up and figured I might as well post it to help others. | Additionally, a UIScrollView will not scroll in (width / height) if the contentSize property is not greater than the frame property (in width / height) |
58,918,171 | I had a react project that managed files from azure blob storage also using azure search. Before I got the `metadata_storage_path` property encoded as base64 and I could read it by decoding it with `atob(metadata_storage_path.slice(0, -1))`. Now I deleted the Azure search to add some new stuff to it. But now I get the ... | 2019/11/18 | [
"https://Stackoverflow.com/questions/58918171",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6848161/"
] | No, this probably not your fault but rather a defect on our side resulting from the UI. You can use 547271 as tracking item number if talking to someone in the Azure Search team.
To fix this, you'll need to:
* Use a tool such as POSTMAN to edit your Indexer (remove the legacy encoding property)
* Delete and recreate y... | It sounds like you have both [base64Encode field mapping function](https://learn.microsoft.com/en-us/azure/search/search-indexer-field-mappings#base64EncodeFunction) and the legacy indexer parameter `base64EncodeKeys`. Updating your indexer with the indexer parameter `base64EncodeKeys` set to `false` should get rid of ... |
7,228,118 | I've been using eclipse for about 10 years now, and today I will be (forced to) use JDeveloper for the first time.
Being a big fan of the eclipse shortcuts, I would like to know some JDeveloper alternatives for my favorite shortcuts:
* `Ctrl`-`3` (Quick access)
* `Ctrl`-`Shift`-`1` (or `Ctrl`-`1`, depending on your k... | 2011/08/29 | [
"https://Stackoverflow.com/questions/7228118",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/109880/"
] | I once battled JDeveloper for two years and somehow lived to tell about it. If you're using 11g, here is a [trick you can use to load the Eclipse shortcut scheme](http://web-center-suite.blogspot.com/2011/08/jdeveloper-shortcuts.html). I highly recommend doing this as there's really no value in learning the native key ... | Here is the official link for JDeveloper shortcuts:
<http://download.oracle.com/docs/cd/E16162_01/user.1112/e17455/working_jdev.htm#OJDUG159>
Hope that helps ;) |
554,227 | I cannot close one of my forms programmatically. Can someone help me?
Here's the code:
```
private void WriteCheck_Load(object sender, EventArgs e) {
SelectBankAccountDialog sbad = new SelectBankAccountDialog();
DialogResult result = sbad.ShowDialog();
if (result == DialogResult.Cancel) {
... | 2009/02/16 | [
"https://Stackoverflow.com/questions/554227",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12243/"
] | By calling `Form.Close()`, the form should close, but not until all waiting events have been processed. You also still have a chance to cancel the form closing in the `FormClosing` event.
First, you'll probably want to `return` after your call to `this.Close()`. If it still doesn't close, step through your code and se... | The actual problem is that windows won't let a form close on it's load method. I have to show the dialog on construction, and then if the dialog result is cancel I have to throw an exception and catch the exception on form creation.
[This place](http://www.devnewsgroups.net/group/microsoft.public.dotnet.framework.wind... |
554,227 | I cannot close one of my forms programmatically. Can someone help me?
Here's the code:
```
private void WriteCheck_Load(object sender, EventArgs e) {
SelectBankAccountDialog sbad = new SelectBankAccountDialog();
DialogResult result = sbad.ShowDialog();
if (result == DialogResult.Cancel) {
... | 2009/02/16 | [
"https://Stackoverflow.com/questions/554227",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12243/"
] | As configurator mentioned (in comments), the form must be shown before it can be closed, so, instead of the *Load* event, you should be doing this in the *Shown* event instead.
If you don't want the form visible for the Dialog box, I guess you can wrap the event code in a Visible = false;
In summary, the basic code ... | By calling `Form.Close()`, the form should close, but not until all waiting events have been processed. You also still have a chance to cancel the form closing in the `FormClosing` event.
First, you'll probably want to `return` after your call to `this.Close()`. If it still doesn't close, step through your code and se... |
554,227 | I cannot close one of my forms programmatically. Can someone help me?
Here's the code:
```
private void WriteCheck_Load(object sender, EventArgs e) {
SelectBankAccountDialog sbad = new SelectBankAccountDialog();
DialogResult result = sbad.ShowDialog();
if (result == DialogResult.Cancel) {
... | 2009/02/16 | [
"https://Stackoverflow.com/questions/554227",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12243/"
] | As configurator mentioned (in comments), the form must be shown before it can be closed, so, instead of the *Load* event, you should be doing this in the *Shown* event instead.
If you don't want the form visible for the Dialog box, I guess you can wrap the event code in a Visible = false;
In summary, the basic code ... | The actual problem is that windows won't let a form close on it's load method. I have to show the dialog on construction, and then if the dialog result is cancel I have to throw an exception and catch the exception on form creation.
[This place](http://www.devnewsgroups.net/group/microsoft.public.dotnet.framework.wind... |
67,219,847 | Is there a way to tell what type of file a google downloadlink will produce? This type of link doesn't tell me anything about the file type (.mov? .png? .jpg?)
(link below is an example)
`https://drive.google.com/u/0/uc?id=2D-99h4-CLMNPO!1234567&export=download` | 2021/04/22 | [
"https://Stackoverflow.com/questions/67219847",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6054959/"
] | Unless the file is a Google Docs, Sheets, Slides, etc... that has a special link, e.g. `https://docs.google.com/document/d/FILE-ID`, the rest of the file types are just bundled as a generic link like `https://drive.google.com/file/d/FILE-ID`.
You can view the file type before downloading by using View Mode:
```
https... | Look at the `mimeType` property of the file.
See <https://developers.google.com/drive/api/v3/reference/files> |
26,986,737 | (I'm new to JavaScript) If all objects inherit their properties from a prototype, and if the default object is Object, why does the following script return undefined in both cases (I was expecting 'Object')?
```
obj1 = {}; //empty object
obj2 = new Object();
console.log(obj1.prototype);
console.log(obj2.prototype);
`... | 2014/11/18 | [
"https://Stackoverflow.com/questions/26986737",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1170686/"
] | `.prototype` is not a property of a live object and thus it doesn't exist so it reports `undefined`. The `.prototype` property is on the constructor which in this case is `Object.prototype`. For a given object in a modern browser, you can get the active prototype with this:
```
var obj1 = {};
var p = Object.getProtot... | In JavaScript's prototypal inheritance, you have *constructors* and *instances*.
The constructors, such as `Object`, is where you find the `.prototype` chain.
But on the instances, the prototype chain is not really accessible. |
51,039,257 | I'm using here `imageView` , when i click on it should show me a video in (linear10) this video is about 4 sec , i need a code that when i click again on the `imageView` the video should start playing again , every time i clicked on the `imageView` i need it to start the video from the beginning
this is the code im us... | 2018/06/26 | [
"https://Stackoverflow.com/questions/51039257",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9984006/"
] | Use the seekTo Function of video view to restart the video
```
imageview1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
n++;
linear1.setVisibility(View.VISIBLE);
if (n == 1) {
final VideoView vd = new Video... | Keep boolean values you will handle the video view using seekTo() when the clicks fires.
// playing true - getCurrent seekposition video is playing check the seekTo();
if (playing)
//change the flag and set as false & seekTo(0);
else
// change the flag and set as true seekTo(sum values); |
51,039,257 | I'm using here `imageView` , when i click on it should show me a video in (linear10) this video is about 4 sec , i need a code that when i click again on the `imageView` the video should start playing again , every time i clicked on the `imageView` i need it to start the video from the beginning
this is the code im us... | 2018/06/26 | [
"https://Stackoverflow.com/questions/51039257",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9984006/"
] | Use the seekTo Function of video view to restart the video
```
imageview1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
n++;
linear1.setVisibility(View.VISIBLE);
if (n == 1) {
final VideoView vd = new Video... | i found the solution guys , ty for help
someone called **jeff** has solve it for me (thanks **Jeff**)
the soulution :
put this code under onCreate:
```
vd = new VideoView(MainActivity.this); vd.setLayoutParams(new LinearLayout.LayoutParams(android.widget.LinearLayout.LayoutParams.MATCH_PARENT, android.widget.Line... |
10,004,502 | I have the following code where after a bool is true I want to add a drawing to my rect. here is the code I have but for some reason it is either not setting the bool or calling the setNeedsDisplay. Am I referencing to the other class properly? thanks
//in AppController.m
```
-(IBAction)colorToggle:(id)sender
{
i... | 2012/04/04 | [
"https://Stackoverflow.com/questions/10004502",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1034741/"
] | OK, you know how not every UILabel is the same? Like, you can remove one UILabel from a view without all the others disappearing too? Well, your CutoutView is the same way. When you write `CutoutView *theView = [[CutoutView alloc] init];` there, that creates a **new** CutoutView that isn't displayed anywhere. You need ... | You are forgetting to call the `drawRect:` method, it should looks like this:
```
CutoutView *theView = [[CutoutView alloc] init];
[theView setFilterEnabled:YES];
[theView setNeedsDisplay];
```
From the [docs](https://developer.apple.com/library/ios/#documentation/UIKit/Reference/UIView_Class/UIView/UIView.html):
>... |
65,817,454 | I am trying to make a jQuery function dynamically decide which array gets run through it based on a button click. Ideally, this is how it would work:
* User clicks one of the "View More ..." buttons.
* The program loads the next 3 images of that specific category (Sports, Concerts, etc.).
Below is a version of that f... | 2021/01/20 | [
"https://Stackoverflow.com/questions/65817454",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15047643/"
] | You can use `data` html attributes to achieve what you are looking for.
And in your js file you can just get those data attributes and validate them as i did in the code below.
```js
var altConcert = [
"Concert 1",
"Concert 2",
"Concert 3",
"Concert 4",
"Concert 5",
"Concert 6"
];
var imgConcert = [
"h... | This is just a quick stab at an answer. I'd probably combine the `alt` and `img` arrays into a single array with `{ alt: '', img: '' }`, but I don't have time...
Basically, the idea is, structure the data to fit your needs!
```js
var arrays = {
concert: {
alt: [
"Concert 1",
"Concert 2",
"Conc... |
65,817,454 | I am trying to make a jQuery function dynamically decide which array gets run through it based on a button click. Ideally, this is how it would work:
* User clicks one of the "View More ..." buttons.
* The program loads the next 3 images of that specific category (Sports, Concerts, etc.).
Below is a version of that f... | 2021/01/20 | [
"https://Stackoverflow.com/questions/65817454",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15047643/"
] | The selected button should be accessible as $(this) within it's bound click function. You can check for the class of the clicked button. So sticking with your original code and data structure this should work:
```
$(".view-more-concerts, .view-more-sports").click(function() {
if($(this).is('.view-more-concerts')) {... | This is just a quick stab at an answer. I'd probably combine the `alt` and `img` arrays into a single array with `{ alt: '', img: '' }`, but I don't have time...
Basically, the idea is, structure the data to fit your needs!
```js
var arrays = {
concert: {
alt: [
"Concert 1",
"Concert 2",
"Conc... |
65,817,454 | I am trying to make a jQuery function dynamically decide which array gets run through it based on a button click. Ideally, this is how it would work:
* User clicks one of the "View More ..." buttons.
* The program loads the next 3 images of that specific category (Sports, Concerts, etc.).
Below is a version of that f... | 2021/01/20 | [
"https://Stackoverflow.com/questions/65817454",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15047643/"
] | You can use `data` html attributes to achieve what you are looking for.
And in your js file you can just get those data attributes and validate them as i did in the code below.
```js
var altConcert = [
"Concert 1",
"Concert 2",
"Concert 3",
"Concert 4",
"Concert 5",
"Concert 6"
];
var imgConcert = [
"h... | The selected button should be accessible as $(this) within it's bound click function. You can check for the class of the clicked button. So sticking with your original code and data structure this should work:
```
$(".view-more-concerts, .view-more-sports").click(function() {
if($(this).is('.view-more-concerts')) {... |
29,986,297 | The thing is, I have detached threads created on my server which works in a thread-per-client way, so the function which accepts a client, creates another listener function (as a thread, and detaches it) waiting for another client to join.
Like the following in pseudo code:
```
Listen to client...
Accept Client Conne... | 2015/05/01 | [
"https://Stackoverflow.com/questions/29986297",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3195614/"
] | The way to end a thread is to return from its thread procedure.
If you want the ending decision to be made from deep inside processing code, then throw an exception that is caught by the thread procedure. This has several huge benefits over `pthread_exit`:
* Stack unwinding occurs, so dynamic allocations used by your... | I think you need to put test a variable in your client comms loop that signals a thread when to return:
```
class ClientComms
{
// set to true when you want the thread to stop
std::atomic_bool done;
public:
ClientComms(): done(false) {}
void operator()()
{
while(!done)
{
... |
1,038,782 | **Reference**
This problem grew out from: [Stone's Theorem Integral: Basic Integral](https://math.stackexchange.com/q/1004930/79762)
**Problem**
Given the real line as measure space $\mathbb{R}$ and a Hilbert space $\mathcal{H}$.
Consider a strongly continuous unitary group $U:\mathbb{R}\to\mathcal{B}(\mathcal{H})$... | 2014/11/25 | [
"https://math.stackexchange.com/questions/1038782",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/79762/"
] | If you've shown that the $\operatorname{null}(A) \cap \operatorname{column}(A) = \{ 0 \}$, then
$$A^2v = A(Av) = 0 \ \Longleftrightarrow \ Av = 0$$
That is $\operatorname{null}(A) = \operatorname{null}(A^2)$ and hence $\operatorname{nullity}(A) = \operatorname{nullity}(A^2)$.
Now as $\dim(\mathbb{R}^3) = \operatorn... | We can prove generally that if $\operatorname{null}(A)\cap \operatorname{col}(A)=\{0\}$, then $\operatorname{rank}(A^2) = \operatorname{rank}(A)$. We can do so as follows:
Let $v\_1,\dots,v\_k$ be a basis for the kernel of $A$. Extend this to a basis $v\_1,\dots,v\_n$ of $\Bbb R^n$.
**Claim:** the vectors $A^2(v\_{k+... |
1,038,782 | **Reference**
This problem grew out from: [Stone's Theorem Integral: Basic Integral](https://math.stackexchange.com/q/1004930/79762)
**Problem**
Given the real line as measure space $\mathbb{R}$ and a Hilbert space $\mathcal{H}$.
Consider a strongly continuous unitary group $U:\mathbb{R}\to\mathcal{B}(\mathcal{H})$... | 2014/11/25 | [
"https://math.stackexchange.com/questions/1038782",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/79762/"
] | We can prove generally that if $\operatorname{null}(A)\cap \operatorname{col}(A)=\{0\}$, then $\operatorname{rank}(A^2) = \operatorname{rank}(A)$. We can do so as follows:
Let $v\_1,\dots,v\_k$ be a basis for the kernel of $A$. Extend this to a basis $v\_1,\dots,v\_n$ of $\Bbb R^n$.
**Claim:** the vectors $A^2(v\_{k+... | in your comment you say that you have proved $image(A) \cup null(A) = {0}.$ that shows $null(A) = null(A^2)$ which in turn by the nullity theorem implies $image(A) = image(A^2).$ so the rank of $A$ and rank of $A^2$ are equal to $2.$
what am i missing? |
1,038,782 | **Reference**
This problem grew out from: [Stone's Theorem Integral: Basic Integral](https://math.stackexchange.com/q/1004930/79762)
**Problem**
Given the real line as measure space $\mathbb{R}$ and a Hilbert space $\mathcal{H}$.
Consider a strongly continuous unitary group $U:\mathbb{R}\to\mathcal{B}(\mathcal{H})$... | 2014/11/25 | [
"https://math.stackexchange.com/questions/1038782",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/79762/"
] | If you've shown that the $\operatorname{null}(A) \cap \operatorname{column}(A) = \{ 0 \}$, then
$$A^2v = A(Av) = 0 \ \Longleftrightarrow \ Av = 0$$
That is $\operatorname{null}(A) = \operatorname{null}(A^2)$ and hence $\operatorname{nullity}(A) = \operatorname{nullity}(A^2)$.
Now as $\dim(\mathbb{R}^3) = \operatorn... | First, the kernel of
$$A=\begin{bmatrix}
2 & 0 & 4\\
1 & -1 & 3\\
2 & 1 & 3
\end{bmatrix}
$$
is generated by $(2,-1,-1)^t$.
Now you want to know the number of solutions of
$$\begin{bmatrix}
2 & 0 & 4\\
1 & -1 & 3\\
2 & 1 & 3
\end{bmatrix}\begin{bmatrix}
x\\
y\\
z
\end{bmatrix}=\begin{bmatrix}
2\\
-1\\
-1
\end... |
1,038,782 | **Reference**
This problem grew out from: [Stone's Theorem Integral: Basic Integral](https://math.stackexchange.com/q/1004930/79762)
**Problem**
Given the real line as measure space $\mathbb{R}$ and a Hilbert space $\mathcal{H}$.
Consider a strongly continuous unitary group $U:\mathbb{R}\to\mathcal{B}(\mathcal{H})$... | 2014/11/25 | [
"https://math.stackexchange.com/questions/1038782",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/79762/"
] | If you've shown that the $\operatorname{null}(A) \cap \operatorname{column}(A) = \{ 0 \}$, then
$$A^2v = A(Av) = 0 \ \Longleftrightarrow \ Av = 0$$
That is $\operatorname{null}(A) = \operatorname{null}(A^2)$ and hence $\operatorname{nullity}(A) = \operatorname{nullity}(A^2)$.
Now as $\dim(\mathbb{R}^3) = \operatorn... | in your comment you say that you have proved $image(A) \cup null(A) = {0}.$ that shows $null(A) = null(A^2)$ which in turn by the nullity theorem implies $image(A) = image(A^2).$ so the rank of $A$ and rank of $A^2$ are equal to $2.$
what am i missing? |
1,038,782 | **Reference**
This problem grew out from: [Stone's Theorem Integral: Basic Integral](https://math.stackexchange.com/q/1004930/79762)
**Problem**
Given the real line as measure space $\mathbb{R}$ and a Hilbert space $\mathcal{H}$.
Consider a strongly continuous unitary group $U:\mathbb{R}\to\mathcal{B}(\mathcal{H})$... | 2014/11/25 | [
"https://math.stackexchange.com/questions/1038782",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/79762/"
] | First, the kernel of
$$A=\begin{bmatrix}
2 & 0 & 4\\
1 & -1 & 3\\
2 & 1 & 3
\end{bmatrix}
$$
is generated by $(2,-1,-1)^t$.
Now you want to know the number of solutions of
$$\begin{bmatrix}
2 & 0 & 4\\
1 & -1 & 3\\
2 & 1 & 3
\end{bmatrix}\begin{bmatrix}
x\\
y\\
z
\end{bmatrix}=\begin{bmatrix}
2\\
-1\\
-1
\end... | in your comment you say that you have proved $image(A) \cup null(A) = {0}.$ that shows $null(A) = null(A^2)$ which in turn by the nullity theorem implies $image(A) = image(A^2).$ so the rank of $A$ and rank of $A^2$ are equal to $2.$
what am i missing? |
34,744,219 | I was wondering how can I build a condition based query in Laravel using eloquent?
I've found how to do it with a [raw query](https://stackoverflow.com/a/14179817/1783311) but that that's not what I want also the [answer to this question](https://stackoverflow.com/a/27522556/1783311) isn't that dynamic at least not as... | 2016/01/12 | [
"https://Stackoverflow.com/questions/34744219",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1783311/"
] | Build up the query and include the `->where()` clause depending on whether or not you have the location in your input:
```
$query = User::where('role', 'user');
$query = \Input::has('location') ? $query->where('location', \Input::get('location')) : $query;
$availableUsers = $query->take($count)->orderByRaw('RAND()')... | Just build the array with an if condition:
```
$matchThese = [
'role' => 'user',
];
if(\Input::has('location')){
$matchThese['place'] = \Input::get('location');
}
$availableUsers = User::where($matchThese)->take($count)->orderByRaw("RAND()")->get();
``` |
34,744,219 | I was wondering how can I build a condition based query in Laravel using eloquent?
I've found how to do it with a [raw query](https://stackoverflow.com/a/14179817/1783311) but that that's not what I want also the [answer to this question](https://stackoverflow.com/a/27522556/1783311) isn't that dynamic at least not as... | 2016/01/12 | [
"https://Stackoverflow.com/questions/34744219",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1783311/"
] | Just build the array with an if condition:
```
$matchThese = [
'role' => 'user',
];
if(\Input::has('location')){
$matchThese['place'] = \Input::get('location');
}
$availableUsers = User::where($matchThese)->take($count)->orderByRaw("RAND()")->get();
``` | ```
$query = DB::table('table_name');
if($something == "something"){
$query->where('something', 'something');
}
$some_variable= $query->where('published', 1)->get();
```
You can use something like this. |
34,744,219 | I was wondering how can I build a condition based query in Laravel using eloquent?
I've found how to do it with a [raw query](https://stackoverflow.com/a/14179817/1783311) but that that's not what I want also the [answer to this question](https://stackoverflow.com/a/27522556/1783311) isn't that dynamic at least not as... | 2016/01/12 | [
"https://Stackoverflow.com/questions/34744219",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1783311/"
] | Build up the query and include the `->where()` clause depending on whether or not you have the location in your input:
```
$query = User::where('role', 'user');
$query = \Input::has('location') ? $query->where('location', \Input::get('location')) : $query;
$availableUsers = $query->take($count)->orderByRaw('RAND()')... | ```
$query = DB::table('table_name');
if($something == "something"){
$query->where('something', 'something');
}
$some_variable= $query->where('published', 1)->get();
```
You can use something like this. |
20,811,509 | While gone through some of the CSS files included with some websites and some other widely used plugins and frameworks, found that they are widely using hyphen separated words as class names. Actually what is the advantage of using such class names.
**For example:
In jquery UI CSS,**
```
.ui-helper-reset {
// C... | 2013/12/28 | [
"https://Stackoverflow.com/questions/20811509",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1101893/"
] | It is just a practice for **readability**. Generally, you cannot have such variables in JavaScript, for separator, as `-` is an operator. When you need separator in JavaScript, you either use something of these:
```
.ui_helper_reset //snake_case
.uiHelperReset //camelCase
```
This way you can differentiate that one ... | It is just a for **readability**. you may use any names as per convention. |
20,811,509 | While gone through some of the CSS files included with some websites and some other widely used plugins and frameworks, found that they are widely using hyphen separated words as class names. Actually what is the advantage of using such class names.
**For example:
In jquery UI CSS,**
```
.ui-helper-reset {
// C... | 2013/12/28 | [
"https://Stackoverflow.com/questions/20811509",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1101893/"
] | Readability:
------------
`ui-helper-reset` readable,
`uiHelperReset` unreadable.
Safe delimiter:
---------------
When using *[attribute selectors](https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors)* like `[class^="icon-"], [class*=" icon-"]` to specifically and safely target the specific class... | It is just a practice for **readability**. Generally, you cannot have such variables in JavaScript, for separator, as `-` is an operator. When you need separator in JavaScript, you either use something of these:
```
.ui_helper_reset //snake_case
.uiHelperReset //camelCase
```
This way you can differentiate that one ... |
20,811,509 | While gone through some of the CSS files included with some websites and some other widely used plugins and frameworks, found that they are widely using hyphen separated words as class names. Actually what is the advantage of using such class names.
**For example:
In jquery UI CSS,**
```
.ui-helper-reset {
// C... | 2013/12/28 | [
"https://Stackoverflow.com/questions/20811509",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1101893/"
] | In addition to being more readable, they can also suggest which classes are related to other. Twitter Bootstrap buttons, for example, have classes like
```
btn
btn-danger
btn-sm
```
etc.
The second two are related in usage to the first | It is just a for **readability**. you may use any names as per convention. |
20,811,509 | While gone through some of the CSS files included with some websites and some other widely used plugins and frameworks, found that they are widely using hyphen separated words as class names. Actually what is the advantage of using such class names.
**For example:
In jquery UI CSS,**
```
.ui-helper-reset {
// C... | 2013/12/28 | [
"https://Stackoverflow.com/questions/20811509",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1101893/"
] | Readability:
------------
`ui-helper-reset` readable,
`uiHelperReset` unreadable.
Safe delimiter:
---------------
When using *[attribute selectors](https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors)* like `[class^="icon-"], [class*=" icon-"]` to specifically and safely target the specific class... | In addition to being more readable, they can also suggest which classes are related to other. Twitter Bootstrap buttons, for example, have classes like
```
btn
btn-danger
btn-sm
```
etc.
The second two are related in usage to the first |
20,811,509 | While gone through some of the CSS files included with some websites and some other widely used plugins and frameworks, found that they are widely using hyphen separated words as class names. Actually what is the advantage of using such class names.
**For example:
In jquery UI CSS,**
```
.ui-helper-reset {
// C... | 2013/12/28 | [
"https://Stackoverflow.com/questions/20811509",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1101893/"
] | Readability:
------------
`ui-helper-reset` readable,
`uiHelperReset` unreadable.
Safe delimiter:
---------------
When using *[attribute selectors](https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors)* like `[class^="icon-"], [class*=" icon-"]` to specifically and safely target the specific class... | It is just a for **readability**. you may use any names as per convention. |
977,538 | `crontab -e` defaults to using `vi` for editing.
This is not usually a problem. `vi` is an excellent editor, and easy to learn.
---
Recently I've begun to use `vim` which is installed by
```
sudo apt-get update
sudo apt-get install vim
```
and in order to make it show line numbers and default to proper numbers of... | 2017/11/17 | [
"https://askubuntu.com/questions/977538",
"https://askubuntu.com",
"https://askubuntu.com/users/640711/"
] | When the environment is checked with the `env` command
```
env
```
there is no default EDITOR specified.
Not wanting to waste time trying to figure out what version of `vi` it is trying to use, it seems better to simply solve the problem.
Thus, the solution is simple.
```
export EDITOR=gedit
```
---
Alternat... | >
> `crontab -e` defaults to using `vi` for editing.
>
>
>
Not really. Per `man crontab`:
>
> The `-e` option is used to edit the current crontab using the editor specified by the `VISUAL` or `EDITOR` environment variables. After you exit from the editor, the modified crontab will be installed automatically. If ... |
977,538 | `crontab -e` defaults to using `vi` for editing.
This is not usually a problem. `vi` is an excellent editor, and easy to learn.
---
Recently I've begun to use `vim` which is installed by
```
sudo apt-get update
sudo apt-get install vim
```
and in order to make it show line numbers and default to proper numbers of... | 2017/11/17 | [
"https://askubuntu.com/questions/977538",
"https://askubuntu.com",
"https://askubuntu.com/users/640711/"
] | When the environment is checked with the `env` command
```
env
```
there is no default EDITOR specified.
Not wanting to waste time trying to figure out what version of `vi` it is trying to use, it seems better to simply solve the problem.
Thus, the solution is simple.
```
export EDITOR=gedit
```
---
Alternat... | in ubuntu 18.04
Right click on file select `properties` select third tab `open with` add new and set it as default. |
977,538 | `crontab -e` defaults to using `vi` for editing.
This is not usually a problem. `vi` is an excellent editor, and easy to learn.
---
Recently I've begun to use `vim` which is installed by
```
sudo apt-get update
sudo apt-get install vim
```
and in order to make it show line numbers and default to proper numbers of... | 2017/11/17 | [
"https://askubuntu.com/questions/977538",
"https://askubuntu.com",
"https://askubuntu.com/users/640711/"
] | >
> `crontab -e` defaults to using `vi` for editing.
>
>
>
Not really. Per `man crontab`:
>
> The `-e` option is used to edit the current crontab using the editor specified by the `VISUAL` or `EDITOR` environment variables. After you exit from the editor, the modified crontab will be installed automatically. If ... | in ubuntu 18.04
Right click on file select `properties` select third tab `open with` add new and set it as default. |
11,981,371 | If I use the following code to create a sender and receiver
```
qsender = qsession.createSender((Queue)msg.getJMSDestination());
qreceiver=qsession.createReceiver((Queue)msg.getJMSDestination());
```
and then do this
```
qsender.send(msg);
```
Does it just send the message to the queue and will it remain in the ... | 2012/08/16 | [
"https://Stackoverflow.com/questions/11981371",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1131384/"
] | If its HashMap, i don't think there is a better option than iterating, but if you can use TreeMap use this...
`map.headMap(key).clear();`
**Eg:**
```
public class Test
{
public static void main( String[] args )
{
SortedMap<Integer,String> map = new TreeMap<Integer... | Iterating is the only way.
```
// this is the number of items you want to remove
final int NUMBER_TO_REMOVE = 2;
// this is your map
Map<String, String> map = new HashMap<String, String>();
map.put("a", "1");
map.put("b", "2");
map.put("c", "3");
map.put("d", "4");
map.put("e", "5");
map.put("f", "6");
map.put("g", "... |
11,981,371 | If I use the following code to create a sender and receiver
```
qsender = qsession.createSender((Queue)msg.getJMSDestination());
qreceiver=qsession.createReceiver((Queue)msg.getJMSDestination());
```
and then do this
```
qsender.send(msg);
```
Does it just send the message to the queue and will it remain in the ... | 2012/08/16 | [
"https://Stackoverflow.com/questions/11981371",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1131384/"
] | If its HashMap, i don't think there is a better option than iterating, but if you can use TreeMap use this...
`map.headMap(key).clear();`
**Eg:**
```
public class Test
{
public static void main( String[] args )
{
SortedMap<Integer,String> map = new TreeMap<Integer... | A generic hashmap has only a limited number of interface functions. If K is small, I don't see any obvious better way than iterating, and breaking out of the iteration once K keys are removed. Of course, if K is large it might be better to do something else, such as preserve size-k elements and clear. If you need parti... |
11,981,371 | If I use the following code to create a sender and receiver
```
qsender = qsession.createSender((Queue)msg.getJMSDestination());
qreceiver=qsession.createReceiver((Queue)msg.getJMSDestination());
```
and then do this
```
qsender.send(msg);
```
Does it just send the message to the queue and will it remain in the ... | 2012/08/16 | [
"https://Stackoverflow.com/questions/11981371",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1131384/"
] | Why not iterate? You can remove *from the iterator* which is likely to be very efficient - no extra lookup required:
```
Iterator<Map.Enty<Foo, Bar>> it = map.entrySet().iterator();
for (int i = 0; i < k && it.hasNext; i++)
{
it.next();
it.remove();
}
``` | Iterating is the only way.
```
// this is the number of items you want to remove
final int NUMBER_TO_REMOVE = 2;
// this is your map
Map<String, String> map = new HashMap<String, String>();
map.put("a", "1");
map.put("b", "2");
map.put("c", "3");
map.put("d", "4");
map.put("e", "5");
map.put("f", "6");
map.put("g", "... |
11,981,371 | If I use the following code to create a sender and receiver
```
qsender = qsession.createSender((Queue)msg.getJMSDestination());
qreceiver=qsession.createReceiver((Queue)msg.getJMSDestination());
```
and then do this
```
qsender.send(msg);
```
Does it just send the message to the queue and will it remain in the ... | 2012/08/16 | [
"https://Stackoverflow.com/questions/11981371",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1131384/"
] | A generic hashmap has only a limited number of interface functions. If K is small, I don't see any obvious better way than iterating, and breaking out of the iteration once K keys are removed. Of course, if K is large it might be better to do something else, such as preserve size-k elements and clear. If you need parti... | Iterating is the only way.
```
// this is the number of items you want to remove
final int NUMBER_TO_REMOVE = 2;
// this is your map
Map<String, String> map = new HashMap<String, String>();
map.put("a", "1");
map.put("b", "2");
map.put("c", "3");
map.put("d", "4");
map.put("e", "5");
map.put("f", "6");
map.put("g", "... |
11,981,371 | If I use the following code to create a sender and receiver
```
qsender = qsession.createSender((Queue)msg.getJMSDestination());
qreceiver=qsession.createReceiver((Queue)msg.getJMSDestination());
```
and then do this
```
qsender.send(msg);
```
Does it just send the message to the queue and will it remain in the ... | 2012/08/16 | [
"https://Stackoverflow.com/questions/11981371",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1131384/"
] | Why not iterate? You can remove *from the iterator* which is likely to be very efficient - no extra lookup required:
```
Iterator<Map.Enty<Foo, Bar>> it = map.entrySet().iterator();
for (int i = 0; i < k && it.hasNext; i++)
{
it.next();
it.remove();
}
``` | A generic hashmap has only a limited number of interface functions. If K is small, I don't see any obvious better way than iterating, and breaking out of the iteration once K keys are removed. Of course, if K is large it might be better to do something else, such as preserve size-k elements and clear. If you need parti... |
15,815 | I've asked [this question at SO](https://stackoverflow.com/questions/4526143/construct-polygons-out-of-union-of-many-polygons), but only answer I got is a non-answer as far as I can tell, so I would like to try my luck here.
Basically, I'm looking for a better-than-naive algorithm for the constructions of polygons ou... | 2010/12/29 | [
"https://math.stackexchange.com/questions/15815",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/550/"
] | Likely the best method is to perform a simultaneous [plane sweep](http://en.wikipedia.org/wiki/Plane_sweep) of all the polygons.
This is discussed in *The Algorithms Design Manual* under "[Intersection Detection](http://books.google.com/books?id=7XUSn0IKQEgC&pg=PA618&lpg=PA618&dq=plane+sweep+to+union+polygons&source=bl... | If the polygons either share exactly one edge or are disjoint then create a list of edges and the polygons they belong to and then remove each edge that has two polygons, joining those two polygons. |
15,815 | I've asked [this question at SO](https://stackoverflow.com/questions/4526143/construct-polygons-out-of-union-of-many-polygons), but only answer I got is a non-answer as far as I can tell, so I would like to try my luck here.
Basically, I'm looking for a better-than-naive algorithm for the constructions of polygons ou... | 2010/12/29 | [
"https://math.stackexchange.com/questions/15815",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/550/"
] | Martin Davis describes an approach on his [blog](http://lin-ear-th-inking.blogspot.dk/2007/11/fast-polygon-merging-in-jts-using.html) which he calls "Cascading Union".
The approach is to traverse a spatial index like an R-tree, to union polygons that are likely to overlap or touch, which gets rid of a lot of internal... | If the polygons either share exactly one edge or are disjoint then create a list of edges and the polygons they belong to and then remove each edge that has two polygons, joining those two polygons. |
15,815 | I've asked [this question at SO](https://stackoverflow.com/questions/4526143/construct-polygons-out-of-union-of-many-polygons), but only answer I got is a non-answer as far as I can tell, so I would like to try my luck here.
Basically, I'm looking for a better-than-naive algorithm for the constructions of polygons ou... | 2010/12/29 | [
"https://math.stackexchange.com/questions/15815",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/550/"
] | Likely the best method is to perform a simultaneous [plane sweep](http://en.wikipedia.org/wiki/Plane_sweep) of all the polygons.
This is discussed in *The Algorithms Design Manual* under "[Intersection Detection](http://books.google.com/books?id=7XUSn0IKQEgC&pg=PA618&lpg=PA618&dq=plane+sweep+to+union+polygons&source=bl... | Martin Davis describes an approach on his [blog](http://lin-ear-th-inking.blogspot.dk/2007/11/fast-polygon-merging-in-jts-using.html) which he calls "Cascading Union".
The approach is to traverse a spatial index like an R-tree, to union polygons that are likely to overlap or touch, which gets rid of a lot of internal... |
52,863,844 | I need save attribute "created\_at" in MySQL formatt "yyyy-mm-dd hh:mm:ss", but display in php format "d-m-Y".
It´s works fine in create scenario but when i update any attribute and save, its overwrite "created\_at" and set like "0000-00-00 00:00:00" automatically in DB.
I use two functions in the model **beforeValida... | 2018/10/17 | [
"https://Stackoverflow.com/questions/52863844",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9439508/"
] | Why don't you use `TimestampBehavior` in your data model? You could handle this issue easily with this behavior (<https://www.yiiframework.com/doc/guide/2.0/en/concept-behaviors#using-timestamp-behavior>) without doing manually.
As it is stated in the documentation:
>
> This behavior supports automatically updating... | you could try this:
```
public function rules()
{
return array(
...
array('created_at','default',
'value'=>date('Y-m-d H:i:s'),
'setOnEmpty'=>false,'on'=>'insert')
);
}
```
and eliminate the function "beforeValidate"
I hope it helps you. |
52,863,844 | I need save attribute "created\_at" in MySQL formatt "yyyy-mm-dd hh:mm:ss", but display in php format "d-m-Y".
It´s works fine in create scenario but when i update any attribute and save, its overwrite "created\_at" and set like "0000-00-00 00:00:00" automatically in DB.
I use two functions in the model **beforeValida... | 2018/10/17 | [
"https://Stackoverflow.com/questions/52863844",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9439508/"
] | Why don't you use `TimestampBehavior` in your data model? You could handle this issue easily with this behavior (<https://www.yiiframework.com/doc/guide/2.0/en/concept-behaviors#using-timestamp-behavior>) without doing manually.
As it is stated in the documentation:
>
> This behavior supports automatically updating... | You always can use behaviors. This is more clean and advanced way. You can control all events that model has. Here is example:
```
public function behaviors()
{
return [
[
'class' => TimestampBehavior::class,
'createdAtAttribute' => 'created_at',
... |
52,863,844 | I need save attribute "created\_at" in MySQL formatt "yyyy-mm-dd hh:mm:ss", but display in php format "d-m-Y".
It´s works fine in create scenario but when i update any attribute and save, its overwrite "created\_at" and set like "0000-00-00 00:00:00" automatically in DB.
I use two functions in the model **beforeValida... | 2018/10/17 | [
"https://Stackoverflow.com/questions/52863844",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9439508/"
] | Why don't you use `TimestampBehavior` in your data model? You could handle this issue easily with this behavior (<https://www.yiiframework.com/doc/guide/2.0/en/concept-behaviors#using-timestamp-behavior>) without doing manually.
As it is stated in the documentation:
>
> This behavior supports automatically updating... | If created\_at is saved as Unix like use `Yii::$app->formatter->asDate($model->created_at,'d-m-Y')` |
24,427,379 | I have a Group model which `has_many` Topics. The Topics model `has_many` Posts.
I want to create an array of all Topics for a Group sorted by the Post attribute `:published_on`.
On my Group show page I have `@group.topics.collect {|x| x.posts }` which returns an `ActiveRecord::Associations::CollectionProxy` array wit... | 2014/06/26 | [
"https://Stackoverflow.com/questions/24427379",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/256917/"
] | I think that
```
group.topics.includes(:posts).order("posts.published_on").map(&:posts).flatten
```
would be enough. | You can also resolve this with the correct relations.
On your `Group` model you could do something like:
```
# you already have this relation
has_many :topics
# you add this
has_many :posts, through: :topics
```
That [through](https://guides.rubyonrails.org/association_basics.html#the-has-many-through-association) ... |
454,724 | I don't understand how to go on with this question:
"As the point $R$ moves on the line $x+y=1$ from $(1,0)$ to $(0,1)$, the point $P$ moves such that it has the same $x$-coordinate as $R$, and its $y$-coordinate is equal to the square root of that of $R$. Describe the locus of $P$ and draw the loci of both $R$ and $P... | 2013/07/29 | [
"https://math.stackexchange.com/questions/454724",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/70377/"
] | First, just graph the line first on the Cartesian plane. And then,
determine the relationship between $R$ and $P$. Any point $R$ would
be of the form $\left(t,1-t\right)$, where $0\leq t\leq1$.
This means that $P$ will have coordinates $\left(t,\sqrt{1-t}\right)$.
So actually what you have is
\begin{eqnarray\*}
f:R & ... | First draw the line hence it will be between $y = 1$ and $x = 1$ and then use the $1/x$ method and it will increase hence the curve will go above the line and create a parabola shape. |
454,724 | I don't understand how to go on with this question:
"As the point $R$ moves on the line $x+y=1$ from $(1,0)$ to $(0,1)$, the point $P$ moves such that it has the same $x$-coordinate as $R$, and its $y$-coordinate is equal to the square root of that of $R$. Describe the locus of $P$ and draw the loci of both $R$ and $P... | 2013/07/29 | [
"https://math.stackexchange.com/questions/454724",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/70377/"
] | **Hint:** The question can be interpreted as such:
Plot the line $(x,\sqrt{1-x})$ from $x=1$ to $0$. | First draw the line hence it will be between $y = 1$ and $x = 1$ and then use the $1/x$ method and it will increase hence the curve will go above the line and create a parabola shape. |
9,694,759 | I've a got ListBox called lbxUpcommingEvents. When the index is changed the event handler is fired to check for duplicate records. If duplicates are not found, a panel called pnlAction inside a formview is turned on by the way of display style. If dups are found another panel pnlActionCancel is turned on and the oter i... | 2012/03/14 | [
"https://Stackoverflow.com/questions/9694759",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/234188/"
] | By default the name of your class is the name of your AOT-compiled namespace (that's what gen-class is for), so you can simply use the namespace's class.
```
(ns foo.core
(:gen-class))
(defn this-jar
"utility function to get the name of jar in which this function is invoked"
[& [ns]]
;; The .toURI step is vit... | ```
(defn this-jar
"utility function to get the name of jar in which this function is invoked"
[& [ns]]
(-> (or ns (class *ns*))
.getProtectionDomain .getCodeSource .getLocation .toURI .getPath))
```
Note that it's crucial to call `.toURI` to avoid problems with paths that have spaces as described in the ... |
9,694,759 | I've a got ListBox called lbxUpcommingEvents. When the index is changed the event handler is fired to check for duplicate records. If duplicates are not found, a panel called pnlAction inside a formview is turned on by the way of display style. If dups are found another panel pnlActionCancel is turned on and the oter i... | 2012/03/14 | [
"https://Stackoverflow.com/questions/9694759",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/234188/"
] | The idea of classpath is to hide where classes come from. You may have classes with the same name loaded from different classloaders, you may have the same class in multiple jars and rely on classpath ordering to choose the correct one.
Why do you want to know? If it's for any other reason than debug/logging purposes ... | You could try getting the path from a class defined by Clojure itself, e.g.:
```
(-> clojure.lang.Atom (.getProtectionDomain) (.getCodeSource) (.getLocation))
=> file:/some/path/to/clojure-1.3.0.jar
```
I believe this is technically the running jar file if you are running Clojure scripts or coding at the REPL. |
9,694,759 | I've a got ListBox called lbxUpcommingEvents. When the index is changed the event handler is fired to check for duplicate records. If duplicates are not found, a panel called pnlAction inside a formview is turned on by the way of display style. If dups are found another panel pnlActionCancel is turned on and the oter i... | 2012/03/14 | [
"https://Stackoverflow.com/questions/9694759",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/234188/"
] | By default the name of your class is the name of your AOT-compiled namespace (that's what gen-class is for), so you can simply use the namespace's class.
```
(ns foo.core
(:gen-class))
(defn this-jar
"utility function to get the name of jar in which this function is invoked"
[& [ns]]
;; The .toURI step is vit... | find source files in a jar: [tools.namespace/clojure-sources-in-jar](http://clojure.github.com/tools.namespace/#clojure.tools.namespace/clojure-sources-in-jar) |
9,694,759 | I've a got ListBox called lbxUpcommingEvents. When the index is changed the event handler is fired to check for duplicate records. If duplicates are not found, a panel called pnlAction inside a formview is turned on by the way of display style. If dups are found another panel pnlActionCancel is turned on and the oter i... | 2012/03/14 | [
"https://Stackoverflow.com/questions/9694759",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/234188/"
] | ```
(defn this-jar
"utility function to get the name of jar in which this function is invoked"
[& [ns]]
(-> (or ns (class *ns*))
.getProtectionDomain .getCodeSource .getLocation .toURI .getPath))
```
Note that it's crucial to call `.toURI` to avoid problems with paths that have spaces as described in the ... | find source files in a jar: [tools.namespace/clojure-sources-in-jar](http://clojure.github.com/tools.namespace/#clojure.tools.namespace/clojure-sources-in-jar) |
9,694,759 | I've a got ListBox called lbxUpcommingEvents. When the index is changed the event handler is fired to check for duplicate records. If duplicates are not found, a panel called pnlAction inside a formview is turned on by the way of display style. If dups are found another panel pnlActionCancel is turned on and the oter i... | 2012/03/14 | [
"https://Stackoverflow.com/questions/9694759",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/234188/"
] | By default the name of your class is the name of your AOT-compiled namespace (that's what gen-class is for), so you can simply use the namespace's class.
```
(ns foo.core
(:gen-class))
(defn this-jar
"utility function to get the name of jar in which this function is invoked"
[& [ns]]
;; The .toURI step is vit... | I haven't tried this, but it seems like all you need is a class instance. So for example can you not do this:
```
(-> (new Object) (.getClass) (.getProtectionDomain) (.getCodeSource) (.getLocation) (.getPath))
``` |
9,694,759 | I've a got ListBox called lbxUpcommingEvents. When the index is changed the event handler is fired to check for duplicate records. If duplicates are not found, a panel called pnlAction inside a formview is turned on by the way of display style. If dups are found another panel pnlActionCancel is turned on and the oter i... | 2012/03/14 | [
"https://Stackoverflow.com/questions/9694759",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/234188/"
] | You could try getting the path from a class defined by Clojure itself, e.g.:
```
(-> clojure.lang.Atom (.getProtectionDomain) (.getCodeSource) (.getLocation))
=> file:/some/path/to/clojure-1.3.0.jar
```
I believe this is technically the running jar file if you are running Clojure scripts or coding at the REPL. | find source files in a jar: [tools.namespace/clojure-sources-in-jar](http://clojure.github.com/tools.namespace/#clojure.tools.namespace/clojure-sources-in-jar) |
9,694,759 | I've a got ListBox called lbxUpcommingEvents. When the index is changed the event handler is fired to check for duplicate records. If duplicates are not found, a panel called pnlAction inside a formview is turned on by the way of display style. If dups are found another panel pnlActionCancel is turned on and the oter i... | 2012/03/14 | [
"https://Stackoverflow.com/questions/9694759",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/234188/"
] | The idea of classpath is to hide where classes come from. You may have classes with the same name loaded from different classloaders, you may have the same class in multiple jars and rely on classpath ordering to choose the correct one.
Why do you want to know? If it's for any other reason than debug/logging purposes ... | find source files in a jar: [tools.namespace/clojure-sources-in-jar](http://clojure.github.com/tools.namespace/#clojure.tools.namespace/clojure-sources-in-jar) |
9,694,759 | I've a got ListBox called lbxUpcommingEvents. When the index is changed the event handler is fired to check for duplicate records. If duplicates are not found, a panel called pnlAction inside a formview is turned on by the way of display style. If dups are found another panel pnlActionCancel is turned on and the oter i... | 2012/03/14 | [
"https://Stackoverflow.com/questions/9694759",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/234188/"
] | By default the name of your class is the name of your AOT-compiled namespace (that's what gen-class is for), so you can simply use the namespace's class.
```
(ns foo.core
(:gen-class))
(defn this-jar
"utility function to get the name of jar in which this function is invoked"
[& [ns]]
;; The .toURI step is vit... | You could try getting the path from a class defined by Clojure itself, e.g.:
```
(-> clojure.lang.Atom (.getProtectionDomain) (.getCodeSource) (.getLocation))
=> file:/some/path/to/clojure-1.3.0.jar
```
I believe this is technically the running jar file if you are running Clojure scripts or coding at the REPL. |
9,694,759 | I've a got ListBox called lbxUpcommingEvents. When the index is changed the event handler is fired to check for duplicate records. If duplicates are not found, a panel called pnlAction inside a formview is turned on by the way of display style. If dups are found another panel pnlActionCancel is turned on and the oter i... | 2012/03/14 | [
"https://Stackoverflow.com/questions/9694759",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/234188/"
] | I haven't tried this, but it seems like all you need is a class instance. So for example can you not do this:
```
(-> (new Object) (.getClass) (.getProtectionDomain) (.getCodeSource) (.getLocation) (.getPath))
``` | find source files in a jar: [tools.namespace/clojure-sources-in-jar](http://clojure.github.com/tools.namespace/#clojure.tools.namespace/clojure-sources-in-jar) |
9,694,759 | I've a got ListBox called lbxUpcommingEvents. When the index is changed the event handler is fired to check for duplicate records. If duplicates are not found, a panel called pnlAction inside a formview is turned on by the way of display style. If dups are found another panel pnlActionCancel is turned on and the oter i... | 2012/03/14 | [
"https://Stackoverflow.com/questions/9694759",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/234188/"
] | The idea of classpath is to hide where classes come from. You may have classes with the same name loaded from different classloaders, you may have the same class in multiple jars and rely on classpath ordering to choose the correct one.
Why do you want to know? If it's for any other reason than debug/logging purposes ... | ```
(defn this-jar
"utility function to get the name of jar in which this function is invoked"
[& [ns]]
(-> (or ns (class *ns*))
.getProtectionDomain .getCodeSource .getLocation .toURI .getPath))
```
Note that it's crucial to call `.toURI` to avoid problems with paths that have spaces as described in the ... |
74,268 | I have a puncture on my MTB tire. It says tubeless ready, but how do I know if it has a tube in it? Rims are sealed, it is a new bike around 6 months old. | 2021/01/02 | [
"https://bicycles.stackexchange.com/questions/74268",
"https://bicycles.stackexchange.com",
"https://bicycles.stackexchange.com/users/54475/"
] | First you may check whether sealant fluid came out of the punctured tyre. It could indicate a tubeless tyre, though it is not always the case. The sure way to tell is by checking the valve.
If your valve is held by a thin screw-on collar that you can screw off with two finger or no collar at all and that you can easil... | The best way is to simply pop the tyre off the rim at some place (you do not have to take off the entire tyre) and see if there is a tube underneath. To do this just take the wheel/tyre in your hands (as if holding your hands on a car steering wheel - you do not have to take the wheel off the bike) and squeeze the tyre... |
74,268 | I have a puncture on my MTB tire. It says tubeless ready, but how do I know if it has a tube in it? Rims are sealed, it is a new bike around 6 months old. | 2021/01/02 | [
"https://bicycles.stackexchange.com/questions/74268",
"https://bicycles.stackexchange.com",
"https://bicycles.stackexchange.com/users/54475/"
] | In general bikes come from the factory with tubes fitted even if tubeless ready. Easiest way to find out is pop the wheel off, shake it about and listen for sloshy sounds which will be the sealant.
“Tubeless ready” tends to mean that the rim has tubeless compatible rim tape and a suitable rim profile combined with tub... | The best way is to simply pop the tyre off the rim at some place (you do not have to take off the entire tyre) and see if there is a tube underneath. To do this just take the wheel/tyre in your hands (as if holding your hands on a car steering wheel - you do not have to take the wheel off the bike) and squeeze the tyre... |
70,129 | (There's a bunch here, sorry. I've used bold text to outline the flow of the main content of the question.)
Basically, I'm transcribing the rhythms of a song, mostly in a 6/4 & 4/4 feel, though every now & then the music deviates into a small series of "glitchy syncopations," to put it one way. in the midst of all thi... | 2018/04/19 | [
"https://music.stackexchange.com/questions/70129",
"https://music.stackexchange.com",
"https://music.stackexchange.com/users/49602/"
] | Wow, very interesting question, and your opening example really shows the problem very well!
If I understand your entire question correctly, *then I recommend not viewing the Scriabin as 3:5*.
The left hand triplets are really 3:2, in the sense that you are playing 3 quarter notes in the span or 2 notated quarter not... | I'm not sure I entirely agree with Richard's answer. Certainly standard notation is to indicate a triplet using notes which would "normally" take longer than the triplet, e.g. three eighth notes for a triplet covering a quarter note.
Your stated problem occurs because 5/8 time can only be "contracted" in this way by... |
70,129 | (There's a bunch here, sorry. I've used bold text to outline the flow of the main content of the question.)
Basically, I'm transcribing the rhythms of a song, mostly in a 6/4 & 4/4 feel, though every now & then the music deviates into a small series of "glitchy syncopations," to put it one way. in the midst of all thi... | 2018/04/19 | [
"https://music.stackexchange.com/questions/70129",
"https://music.stackexchange.com",
"https://music.stackexchange.com/users/49602/"
] | Wow, very interesting question, and your opening example really shows the problem very well!
If I understand your entire question correctly, *then I recommend not viewing the Scriabin as 3:5*.
The left hand triplets are really 3:2, in the sense that you are playing 3 quarter notes in the span or 2 notated quarter not... | To answer if this one of the kinks in our system, I would just say that our system has not caught up to all of these rhythmic possibilities. I have not done enough looking at scores from musics around the world to see how polyrhythms are notated in different places. But this kind of polyrhythm has just not been common ... |
70,129 | (There's a bunch here, sorry. I've used bold text to outline the flow of the main content of the question.)
Basically, I'm transcribing the rhythms of a song, mostly in a 6/4 & 4/4 feel, though every now & then the music deviates into a small series of "glitchy syncopations," to put it one way. in the midst of all thi... | 2018/04/19 | [
"https://music.stackexchange.com/questions/70129",
"https://music.stackexchange.com",
"https://music.stackexchange.com/users/49602/"
] | I'm not sure I entirely agree with Richard's answer. Certainly standard notation is to indicate a triplet using notes which would "normally" take longer than the triplet, e.g. three eighth notes for a triplet covering a quarter note.
Your stated problem occurs because 5/8 time can only be "contracted" in this way by... | To answer if this one of the kinks in our system, I would just say that our system has not caught up to all of these rhythmic possibilities. I have not done enough looking at scores from musics around the world to see how polyrhythms are notated in different places. But this kind of polyrhythm has just not been common ... |
38,239,057 | I'm a bit confused on how Bot Builder is intended to be used if you want to connect to Slack as well as Kik.
Am I supposed to be using "builder.BotConnectorBot" or will I end up with a "builder.BotConnectorBot" and a separate "builder.SlackBot"? If so, does that mean I'm hosing two separate bots, one for Kik and one f... | 2016/07/07 | [
"https://Stackoverflow.com/questions/38239057",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1203703/"
] | You only need to create a single bot. Just enable it for multiple channels in the portal.
Direct link:
<https://dev.botframework.com/bots?id=>{YourBotId} | You develop one bot and you can use it across multiple channels (skype, slack, FB Messenger, Email, SMS, etc.). This is the main objective of BotFramework to abstract you to the channel implementations.
To add a new channel, you may enter in your bot and BotFramework dev portal and click in the channel you want to add... |
358,683 | Is it possible to set the root mail address to my gmail address?
And if so how?
Would it work by just setting my email address in the following file?
/etc/aliases :
```
root: mygmail@gmail.com
```
Or does it need to be a domain that is hosted on my webserver?
As a side note: not really sure this has to do with po... | 2012/02/10 | [
"https://serverfault.com/questions/358683",
"https://serverfault.com",
"https://serverfault.com/users/102762/"
] | Yes you can send email to an account outside your mailserver. But, it might not work out of the box.
Test it first from the commandline:
```
[root@host ~]# /usr/bin/mail -s "Test from $HOSTNAME" mygmail@gmail.com
```
If the mail does not arrive at your gmail account, then you should see a reason why in `/var/log/ma... | This will work fine. I forward root mail to off site mail addresses all the time. |
358,683 | Is it possible to set the root mail address to my gmail address?
And if so how?
Would it work by just setting my email address in the following file?
/etc/aliases :
```
root: mygmail@gmail.com
```
Or does it need to be a domain that is hosted on my webserver?
As a side note: not really sure this has to do with po... | 2012/02/10 | [
"https://serverfault.com/questions/358683",
"https://serverfault.com",
"https://serverfault.com/users/102762/"
] | This will work fine. I forward root mail to off site mail addresses all the time. | This will work, but you may have to set parameter **append\_at\_myorigin=no** in **main.cf** in case **myorigin** is set. Otherwise if you are sending locally to "root" postfix by default will append myorigin value to the domain part of the recipient. |
358,683 | Is it possible to set the root mail address to my gmail address?
And if so how?
Would it work by just setting my email address in the following file?
/etc/aliases :
```
root: mygmail@gmail.com
```
Or does it need to be a domain that is hosted on my webserver?
As a side note: not really sure this has to do with po... | 2012/02/10 | [
"https://serverfault.com/questions/358683",
"https://serverfault.com",
"https://serverfault.com/users/102762/"
] | Yes you can send email to an account outside your mailserver. But, it might not work out of the box.
Test it first from the commandline:
```
[root@host ~]# /usr/bin/mail -s "Test from $HOSTNAME" mygmail@gmail.com
```
If the mail does not arrive at your gmail account, then you should see a reason why in `/var/log/ma... | This will work, but you may have to set parameter **append\_at\_myorigin=no** in **main.cf** in case **myorigin** is set. Otherwise if you are sending locally to "root" postfix by default will append myorigin value to the domain part of the recipient. |
4,359,149 | Prove that the unitary closed ball of $l\_1 (\mathbb N)$ is closed in $l\_2 (\mathbb N)$.
My attempt: $$\text{Let $(x\_n)\_{n\in\mathbb N} $ be a sequence such that }\sum\_i^\infty |x\_{n\_i}| \le 1 \ \text{and} \lim\_{n\to \infty } x\_n = x \text { in $ l\_2(\mathbb N)$}$$
If we had that the unitary ball was not clos... | 2022/01/17 | [
"https://math.stackexchange.com/questions/4359149",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/730135/"
] | Observe that $\ell\_1(\mathbb{N})\subset\ell\_2(\mathbb{N})$, this the unit $\|\;\|\_1$-ball is contained in $\ell\_2$.
Suppose $(x\_k, x: k\in\mathbb{N})\subset \ell\_2(\mathbb{N})$ such that
1. $\sum\_n|x\_k(n)|\leq 1$,
2. $\|x\_k-x\|^2\_2=\sum\_n|x\_k(n)-x(n)|^2\xrightarrow{k\rightarrow\infty}0$.
Condition (2) im... | Step I. The closed unit ball in $\ell\_1(\mathbb N)$ is a subset of the closed unit ball of $\ell\_2(\mathbb N)$.
Step II. If $x^n=(x\_k^n)\in\ell\_1(\mathbb N)$, $\|x^n\|\_1\le 1,$ and $(x^n)$ is $\ell\_1-$convergent to $x=(x\_k)$, then clearly $x\_k^n\to x\_k$, for all $k$.
Also, $(x^n)$ is $\ell\_1-$Cauchy. But,
$$... |
331,445 | I have an ISP (Beam telecom, if it's relevant) that provides only a LAN cable connection. Using this, whichever site you initially open, you are redirected to its portal page where you are required to log in. After this you can access internet as normal.
The problem that I am facing is when I am trying to setup my ADS... | 2011/09/03 | [
"https://superuser.com/questions/331445",
"https://superuser.com",
"https://superuser.com/users/6722/"
] | The mechanism being used to stifle you is called "captive portal". While I don't know all that much about it you could do some searching to see if there is a way to persist a connection through it. Persistence with this is usually accomplished with a combination MAC address and a cookie combo.
This may help you: <htt... | Answering this three year old post for the lack of a better answer. A virtual router is one way but not the idle one.
For such ISPs, (BEAM telecom / ACT etc), you could use PPPoE. You just need to put in your usual credential into the router PPPoE page and then any device connecting to your wifi router will not need ... |
331,445 | I have an ISP (Beam telecom, if it's relevant) that provides only a LAN cable connection. Using this, whichever site you initially open, you are redirected to its portal page where you are required to log in. After this you can access internet as normal.
The problem that I am facing is when I am trying to setup my ADS... | 2011/09/03 | [
"https://superuser.com/questions/331445",
"https://superuser.com",
"https://superuser.com/users/6722/"
] | I have got a working solution to my own question. I was able to wirelessly connect one of my PCs running Windows. I installed Virtual Router on my Windows PC that establishes its own wireless network to which other PCs can connect.
So now all my devices can connect to the internet, but the Windows PC has to be running... | Answering this three year old post for the lack of a better answer. A virtual router is one way but not the idle one.
For such ISPs, (BEAM telecom / ACT etc), you could use PPPoE. You just need to put in your usual credential into the router PPPoE page and then any device connecting to your wifi router will not need ... |
63,157,682 | I am trying to summarize data from a health app by date. Each date has multiple entries so I've created a single dictionary that has each unique date as a key (column index `1`), and I want to add the total amount of fat (column index `7`) for each date as a value.
I am new to Python and trying to do this in pure Pyth... | 2020/07/29 | [
"https://Stackoverflow.com/questions/63157682",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1642410/"
] | That's because you call the method using `prototype`. In that case `Top.prototype` is binded to `this`. In general `this` is an object "before a dot". That's why in the first call `t.longRun1()`, `this` is `t`.
Correct call would be:
```
this.longRun2().then((out) => {
resolve(out);
}).catch((err) => {
console.lo... | One more thing for those who may stumble upon this:
szatkus's answer worked for me.....just not at first, and it was a weird one (well, to me it was.....)
I changed my test code above, and it worked correctly, so I went to the code that I'm working on, and it still crapped out, even with the fix?!? After looking long... |
31,164,747 | How to change the number of decimal digits?
Changing the `format` Matlab can show only 4 (if `short`) or 15 (if `long`). But I want exactly 3 digits to show. | 2015/07/01 | [
"https://Stackoverflow.com/questions/31164747",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5058209/"
] | Just use `duplicated()` on the subset of columns that you want to make sure are unique and use that to subset the main data.frame. For example
```
dd[ !duplicated(dd[,c("P1","P2")]) , ]
``` | If dt is your data frame -
```
library(data.table)
setDT(dt)
dtFiltered = dt[,
Flag := .I - min(.I),
list(P1,P2)
][
Flag == 0
]
dtFiltered = dtFiltered[,
Flag := NULL
]
```
Thanks for Frank for pointing out I missed the P2. |
31,164,747 | How to change the number of decimal digits?
Changing the `format` Matlab can show only 4 (if `short`) or 15 (if `long`). But I want exactly 3 digits to show. | 2015/07/01 | [
"https://Stackoverflow.com/questions/31164747",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5058209/"
] | If dt is your data frame -
```
library(data.table)
setDT(dt)
dtFiltered = dt[,
Flag := .I - min(.I),
list(P1,P2)
][
Flag == 0
]
dtFiltered = dtFiltered[,
Flag := NULL
]
```
Thanks for Frank for pointing out I missed the P2. | Try this :
```
dat <- dat[!duplicated(dat[1:2]), ]
``` |
31,164,747 | How to change the number of decimal digits?
Changing the `format` Matlab can show only 4 (if `short`) or 15 (if `long`). But I want exactly 3 digits to show. | 2015/07/01 | [
"https://Stackoverflow.com/questions/31164747",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5058209/"
] | Just use `duplicated()` on the subset of columns that you want to make sure are unique and use that to subset the main data.frame. For example
```
dd[ !duplicated(dd[,c("P1","P2")]) , ]
``` | Try this :
```
dat <- dat[!duplicated(dat[1:2]), ]
``` |
11,046,260 | I'm not good in English. What wrong with my text ^^ sorry :)
I have data in my table football.
[jsfiddle](http://jsfiddle.net/ctheidea/7x7MZ/)
I am having trouble building a function to calculate all rows in the table. When the page finishes loading or click row for edit value in textfiled. jQuery will be calculate a... | 2012/06/15 | [
"https://Stackoverflow.com/questions/11046260",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1559077/"
] | Though i could not get your problem statement exactly, But you can get the sum of columns like this way.
```
$(document).ready(function(){
var sum = 0;
jQuery('.text').each(function(){
sum += parseInt(jQuery(this).text());
});
console.log(sum);
});
```
... | just another solution:
```
var tot = 0;
$('tbody tr').each(function() {
$(this).find('.text').each(function(){
tot += parseInt($(this).text());
});
alert(tot);
tot = 0;
});
```
sum salt element:
```
var sum, i, k;
$('tbody tr').each(function() {
k = ($(this).find('.t... |
35,215,854 | I am developing a Quickfix/n initiator to be used with several counterparties, in the same instance, all using the same version of FIX (4.2 in this instance) but utilizing a unique messaging specification and I would like to use Intellisense/ReSharper to develop said initiator.
Previously I have used the generate.rb s... | 2016/02/05 | [
"https://Stackoverflow.com/questions/35215854",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3246873/"
] | For anyone that ever is trying to do this, the answer is pretty simple - probably not the most efficient but it works as far as I know.
the trick is to edit two ruby generation scripts (messages\_gen.rb and generate.rb) and place the additional FIX specification XML file(s) in the spec/fix directory.
Assuming that yo... | So the problem is you want 1 QF initiator process to connect to several different counterparties where each session uses a separate data dictionary?
Don't you do this using `DataDictionary=somewhere/FIX42.xml` in the configuration file?
See also <http://quickfixn.org/tutorial/configuration.html> `AppDataDictionary: T... |
1,939 | There is a feature called 'Upcoming Events' that is used at [Space](https://space.stackexchange.com/), and possibly other sister sites. Their [application of it is not completely without issue](https://space.meta.stackexchange.com/questions/550/how-do-the-upcoming-events-links-work) but it did get me wondering if we mi... | 2014/11/05 | [
"https://pets.meta.stackexchange.com/questions/1939",
"https://pets.meta.stackexchange.com",
"https://pets.meta.stackexchange.com/users/13/"
] | On the litter box question:
We have had a consistent problem with people posting vague problems and not following up when asked for more details that will help us answer the question properly. We've been closing those questions as a temporary measure with a comment about some of the information that we need to answer ... | @MattS. posted <http://data.stackexchange.com/pets/revision/241383/315568/question-votes-compared-to-its-views> in chat, in response to my request to look at votes in relation to visits.
If the best questions are the ones with the most up votes per visit. Said differently the questions that were up-voted by the large... |
1,939 | There is a feature called 'Upcoming Events' that is used at [Space](https://space.stackexchange.com/), and possibly other sister sites. Their [application of it is not completely without issue](https://space.meta.stackexchange.com/questions/550/how-do-the-upcoming-events-links-work) but it did get me wondering if we mi... | 2014/11/05 | [
"https://pets.meta.stackexchange.com/questions/1939",
"https://pets.meta.stackexchange.com",
"https://pets.meta.stackexchange.com/users/13/"
] | **Quick and dirty summary:**
* We've tried these types of questions before and they didn't work out.
* This isn't a forum, we try to avoid discussions outside of the chatroom (and sometimes meta).
* There is a difference between questions/answers that are useful to anyone, and questions/answers that are useful to onl... | @MattS. posted <http://data.stackexchange.com/pets/revision/241383/315568/question-votes-compared-to-its-views> in chat, in response to my request to look at votes in relation to visits.
If the best questions are the ones with the most up votes per visit. Said differently the questions that were up-voted by the large... |
16,339,947 | I have developed an application with Netbeans (Using Java, JSP and JQuery) in Windows environment. Now I am ready to transfer the application to a web host so that the application can be available on the Web and I am told that the application would have to be moved to a linux environment (hosting service already bought... | 2013/05/02 | [
"https://Stackoverflow.com/questions/16339947",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1519100/"
] | >
> How to convert my code to Linux? Is there an automatic tool for this?
>
>
>
One of the Java key features is [portability](http://en.wikipedia.org/wiki/Software_portability), so as far as you haven't used any OS-specific code like running a program using CMD or similar or a library that is OS-dependant (which i... | OK, first a few thoughts:
1. Convert code to Linux. Once you have your ear of war file, you can just deploy them. It's best if you use UTF8 enconding in your files, specially if you use special characters, but that would be an issue you could test out when you deploy, could also be dependant on the Linux configuration... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.