qid
int64
1
74.7M
question
stringlengths
0
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
2
48.3k
response_k
stringlengths
2
40.5k
61,717,941
I have configured the connection to IBM MQ using application properties. As below, ``` ibm.mq.conn-name=localhost(1415) ibm.mq.queue-manager=QMGR ibm.mq.channel=QMGR.SVR.CON.C ibm.mq.user=xxxxx ibm.mq.password=xxxxx ``` I have class annotated @service which has method as below that reads messages from queue, ``` @S...
2020/05/10
[ "https://Stackoverflow.com/questions/61717941", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9180615/" ]
As @JoshMc suggested, you should use a `JmsListener`. There is good [JMS Getting Started Guide](https://spring.io/guides/gs/messaging-jms/) from Spring. For you it will look like this (definition for `myFactory` you can see in the mentioned Spring guide): ``` package hello; import org.springframework.jms.annotation....
``` @SpringBootApplication @EnableJms @EnableScheduling public class MyApplication extends SpringBootServletInitializer implements SchedulingConfigurer { @Override protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) { return builder.sources(MyApplication.class); } @B...
30,223,119
I would like to know how to create a clickable button in HTML format that sits on in the center of a header image. I have tried to use the button tags along with the href attribute along with the img tags to try to wrap the code around the desired image but it doesn't work. An example of the result that I am trying to...
2015/05/13
[ "https://Stackoverflow.com/questions/30223119", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4897118/" ]
You need to call `WebView.enableSlowWholeDocumentDraw()` before creating *any* WebViews in your app. That is, if you have a WebView somewhere in your static layout, make sure you call `WebView.enableSlowWholeDocumentDraw()` before your first call to `setContentView()` that inflates a layout with WebView. Also make s...
``` if(Build.VERSION.SDK_INT>=21) { WebView.enableSlowWholeDocumentDraw(); } public void capture(WebView webView) { WebView lObjWebView = webView; lObjWebView.measure(MeasureSpec.makeMeasureSpec(MeasureSpec.UNSPECIFIED, MeasureSpec.UNSPECIFIED), MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED)); ...
30,223,119
I would like to know how to create a clickable button in HTML format that sits on in the center of a header image. I have tried to use the button tags along with the href attribute along with the img tags to try to wrap the code around the desired image but it doesn't work. An example of the result that I am trying to...
2015/05/13
[ "https://Stackoverflow.com/questions/30223119", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4897118/" ]
I am the author of [this question](https://stackoverflow.com/questions/30078157/webview-draw-not-properly-working-on-latest-android-system-webview-update). To fix this problem, I had to call `WebView.enableSlowWholeDocumentDraw()` *before* inflating the view in your fragment. In the comments of Mikhail Naganov's answe...
``` if(Build.VERSION.SDK_INT>=21) { WebView.enableSlowWholeDocumentDraw(); } public void capture(WebView webView) { WebView lObjWebView = webView; lObjWebView.measure(MeasureSpec.makeMeasureSpec(MeasureSpec.UNSPECIFIED, MeasureSpec.UNSPECIFIED), MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED)); ...
30,223,119
I would like to know how to create a clickable button in HTML format that sits on in the center of a header image. I have tried to use the button tags along with the href attribute along with the img tags to try to wrap the code around the desired image but it doesn't work. An example of the result that I am trying to...
2015/05/13
[ "https://Stackoverflow.com/questions/30223119", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4897118/" ]
Struggled with this/similar issue myself for ages. Finally found a solution, for some reason `webView.draw(page.getCanvas())` renders the whole content with KitKat but not with Lollipop (even with `enableSlowWholeDocumentDraw()`). However, using `(webView.capturePicture()).draw(page.getCanvas())` in combination wit...
``` if(Build.VERSION.SDK_INT>=21) { WebView.enableSlowWholeDocumentDraw(); } public void capture(WebView webView) { WebView lObjWebView = webView; lObjWebView.measure(MeasureSpec.makeMeasureSpec(MeasureSpec.UNSPECIFIED, MeasureSpec.UNSPECIFIED), MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED)); ...
3,130,701
How to kill a running thread in java
2010/06/28
[ "https://Stackoverflow.com/questions/3130701", "https://Stackoverflow.com", "https://Stackoverflow.com/users/297115/" ]
You can ask the thread to interrupt, by calling [`Thread.interrupt()`](http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Thread.html#interrupt%28%29) Note that a few other methods with similar semantics exist - `stop()` and `destroy()` - but they are *deprecated*, because they are [unsafe](http://java.sun.com/j2se/1.5...
Shortly you need [`Thread.interrupt()`](http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Thread.html#interrupt%28%29) For more details check the section `How do I stop a thread that waits for long periods (e.g., for input)` in this article [Why Are `Thread.stop`, `Thread.suspend`,`Thread.resume` and `Runtime.runFinal...
3,130,701
How to kill a running thread in java
2010/06/28
[ "https://Stackoverflow.com/questions/3130701", "https://Stackoverflow.com", "https://Stackoverflow.com/users/297115/" ]
You can ask the thread to interrupt, by calling [`Thread.interrupt()`](http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Thread.html#interrupt%28%29) Note that a few other methods with similar semantics exist - `stop()` and `destroy()` - but they are *deprecated*, because they are [unsafe](http://java.sun.com/j2se/1.5...
As Bozho said, Thread.interrupt() is the generic and right way to do it. But remember that it requires the thread to cooperate; It is very easy to implement a thread that ignores interruption requests. In order for a piece of code to be interruptible this way, it shouldn't ignore any InterruptedException, and it shou...
3,130,701
How to kill a running thread in java
2010/06/28
[ "https://Stackoverflow.com/questions/3130701", "https://Stackoverflow.com", "https://Stackoverflow.com/users/297115/" ]
As Bozho said, Thread.interrupt() is the generic and right way to do it. But remember that it requires the thread to cooperate; It is very easy to implement a thread that ignores interruption requests. In order for a piece of code to be interruptible this way, it shouldn't ignore any InterruptedException, and it shou...
Shortly you need [`Thread.interrupt()`](http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Thread.html#interrupt%28%29) For more details check the section `How do I stop a thread that waits for long periods (e.g., for input)` in this article [Why Are `Thread.stop`, `Thread.suspend`,`Thread.resume` and `Runtime.runFinal...
36,425,945
I want to display picture from access and show that on a form in vb.net I have this for display information: ``` info.TextBox5.Text = DataGridView1.SelectedRows(0).Cells(5).Value ``` Now I tried something like this for pictures: ``` info.PictureBox1.Image = DataGridView1.SelectedRows(0).Cells(6).Value ``` But I ...
2016/04/05
[ "https://Stackoverflow.com/questions/36425945", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5433094/" ]
Based on Google Maps [docs](https://developers.google.com/maps/faq#usage-limits): > > Excess usage over the complimentary quota for each Google Maps API > service is calculated at the end of each day. > > > Web service APIs offer 2,500 free requests per day. If you enable > billing to access higher quotas, once y...
There is an opensource map library, <https://www.openstreetmap.org> And they have services for geocoding: <http://wiki.openstreetmap.org/wiki/Nominatim> So you can also take a look at the different solutions like this one.
163
I was tasked with figuring out whether carbon or nitrogen has a more negative electron affinity value. I initially picked nitrogen, just because nitrogen has a higher $Z\_\mathrm{eff}$, creating a larger attraction between electrons and protons, decreasing the radius, causing a higher ionization energy, and therefore d...
2012/04/29
[ "https://chemistry.stackexchange.com/questions/163", "https://chemistry.stackexchange.com", "https://chemistry.stackexchange.com/users/85/" ]
This exception rule is actually orbital filling rule. For two electrons to be in same orbital they need to have different spins (Pauli exclusion principal). This electron pairing requires additional energy and thus it is easier to add electrons if there are free orbitals. When element has a half-filled p sublevel all 3...
I say the reason why the electron affinity of fluorine is not as negative as chlorine and that of O is not as negative as S is because of the electron repulsions in the small compact atoms keep the added electrons from being tightly bound as we might expect. . .
163
I was tasked with figuring out whether carbon or nitrogen has a more negative electron affinity value. I initially picked nitrogen, just because nitrogen has a higher $Z\_\mathrm{eff}$, creating a larger attraction between electrons and protons, decreasing the radius, causing a higher ionization energy, and therefore d...
2012/04/29
[ "https://chemistry.stackexchange.com/questions/163", "https://chemistry.stackexchange.com", "https://chemistry.stackexchange.com/users/85/" ]
This exception rule is actually orbital filling rule. For two electrons to be in same orbital they need to have different spins (Pauli exclusion principal). This electron pairing requires additional energy and thus it is easier to add electrons if there are free orbitals. When element has a half-filled p sublevel all 3...
Exceptions abound in electron affinity. Another case is in that of $\ce{F}$ versus that of $\ce{Cl}$. You would think that $\ce{F}$ being far more electronegative, would have the more negative electron affinity, but actually, that is not the case. The small size of $\ce{F}$ makes another electron energetically unfavora...
36,105,068
I am currently learning Meteor and I found out something that intrigued me. I can load HTML and CSS assets from a JS file using the import statement. ``` import '../imports/hello/myapp.html'; import '../imports/hello/myapp.css'; import * as myApp from '../imports/hello/myapp.js'; ``` This was a surprise to me so I ...
2016/03/19
[ "https://Stackoverflow.com/questions/36105068", "https://Stackoverflow.com", "https://Stackoverflow.com/users/400544/" ]
One of the features in Meteor 1.3 is lazy-loading where you place your files in the `/imports` folder and will not be evaluated eagerly. Quote from Meteor Guide: > > To fully use the module system and ensure that our code only runs when > we ask it to, we recommend that all of your application code should be > pla...
ES6 export and import functionally are available in Meteor 1.3. You should not be importing HTML and CSS files if you are using Blaze, the current default templating enginge. The import/export functionality is there, but you may be using the wrong approach for building your views.
36,105,068
I am currently learning Meteor and I found out something that intrigued me. I can load HTML and CSS assets from a JS file using the import statement. ``` import '../imports/hello/myapp.html'; import '../imports/hello/myapp.css'; import * as myApp from '../imports/hello/myapp.js'; ``` This was a surprise to me so I ...
2016/03/19
[ "https://Stackoverflow.com/questions/36105068", "https://Stackoverflow.com", "https://Stackoverflow.com/users/400544/" ]
After going through the implementation of the built files for my app I found out why this works. **HTML** Files are read from the file system and their contents added to the global Template object, e.g., ``` == myapp.html == <body> <h1>Welcome to Meteor!</h1> {{> hello}} </body> ``` results in the following J...
ES6 export and import functionally are available in Meteor 1.3. You should not be importing HTML and CSS files if you are using Blaze, the current default templating enginge. The import/export functionality is there, but you may be using the wrong approach for building your views.
36,105,068
I am currently learning Meteor and I found out something that intrigued me. I can load HTML and CSS assets from a JS file using the import statement. ``` import '../imports/hello/myapp.html'; import '../imports/hello/myapp.css'; import * as myApp from '../imports/hello/myapp.js'; ``` This was a surprise to me so I ...
2016/03/19
[ "https://Stackoverflow.com/questions/36105068", "https://Stackoverflow.com", "https://Stackoverflow.com/users/400544/" ]
After going through the implementation of the built files for my app I found out why this works. **HTML** Files are read from the file system and their contents added to the global Template object, e.g., ``` == myapp.html == <body> <h1>Welcome to Meteor!</h1> {{> hello}} </body> ``` results in the following J...
One of the features in Meteor 1.3 is lazy-loading where you place your files in the `/imports` folder and will not be evaluated eagerly. Quote from Meteor Guide: > > To fully use the module system and ensure that our code only runs when > we ask it to, we recommend that all of your application code should be > pla...
3,852,932
I am working application in which i calling `presentModalViewController` and once finished(calling `dismissModalViewControllerAnimated:YES`) it should immediately call `popToRootViewControllerAnimated`. But the issue is `dismissModalViewControllerAnimated:YES` is working properly but `popToRootViewControllerAnimated`i...
2010/10/04
[ "https://Stackoverflow.com/questions/3852932", "https://Stackoverflow.com", "https://Stackoverflow.com/users/384150/" ]
Try something like this: ``` [self.navigationController dismissModalViewControllerAnimated:YES] ; [self performSelector:@selector(patchSelector) withObject:nil afterDelay:0.3]; -(void)patchSelector{ [self.navigationController popToRootViewControllerAnimated:YES]; } ``` It is not so neat but it should work. **UP...
I guess, you are not calling the ``` [self.navigationController popToRootViewControllerAnimated:YES]; ``` in the target modal viewcontroller. check that.
3,852,932
I am working application in which i calling `presentModalViewController` and once finished(calling `dismissModalViewControllerAnimated:YES`) it should immediately call `popToRootViewControllerAnimated`. But the issue is `dismissModalViewControllerAnimated:YES` is working properly but `popToRootViewControllerAnimated`i...
2010/10/04
[ "https://Stackoverflow.com/questions/3852932", "https://Stackoverflow.com", "https://Stackoverflow.com/users/384150/" ]
Try something like this: ``` [self.navigationController dismissModalViewControllerAnimated:YES] ; [self performSelector:@selector(patchSelector) withObject:nil afterDelay:0.3]; -(void)patchSelector{ [self.navigationController popToRootViewControllerAnimated:YES]; } ``` It is not so neat but it should work. **UP...
If you have a navigation controller with a stack of UIViewControllers: ``` [self dismissModalViewControllerAnimated:YES]; [(UINavigationController*)self.parentViewController popToRootViewControllerAnimated:YES]; //UIViewController *vc = [[UIViewController new] autorelease]; //[(UINavigationController*)self.parentViewC...
3,852,932
I am working application in which i calling `presentModalViewController` and once finished(calling `dismissModalViewControllerAnimated:YES`) it should immediately call `popToRootViewControllerAnimated`. But the issue is `dismissModalViewControllerAnimated:YES` is working properly but `popToRootViewControllerAnimated`i...
2010/10/04
[ "https://Stackoverflow.com/questions/3852932", "https://Stackoverflow.com", "https://Stackoverflow.com/users/384150/" ]
Try something like this: ``` [self.navigationController dismissModalViewControllerAnimated:YES] ; [self performSelector:@selector(patchSelector) withObject:nil afterDelay:0.3]; -(void)patchSelector{ [self.navigationController popToRootViewControllerAnimated:YES]; } ``` It is not so neat but it should work. **UP...
I ran into something similar to this. You need to make a copy of your self.navigationcontroller first and also retain yourself, so when you call the second pop, there is still a reference to the NC and you still exist. ``` // locally store the navigation controller since // self.navigationController will be ni...
3,852,932
I am working application in which i calling `presentModalViewController` and once finished(calling `dismissModalViewControllerAnimated:YES`) it should immediately call `popToRootViewControllerAnimated`. But the issue is `dismissModalViewControllerAnimated:YES` is working properly but `popToRootViewControllerAnimated`i...
2010/10/04
[ "https://Stackoverflow.com/questions/3852932", "https://Stackoverflow.com", "https://Stackoverflow.com/users/384150/" ]
If you have a navigation controller with a stack of UIViewControllers: ``` [self dismissModalViewControllerAnimated:YES]; [(UINavigationController*)self.parentViewController popToRootViewControllerAnimated:YES]; //UIViewController *vc = [[UIViewController new] autorelease]; //[(UINavigationController*)self.parentViewC...
I guess, you are not calling the ``` [self.navigationController popToRootViewControllerAnimated:YES]; ``` in the target modal viewcontroller. check that.
3,852,932
I am working application in which i calling `presentModalViewController` and once finished(calling `dismissModalViewControllerAnimated:YES`) it should immediately call `popToRootViewControllerAnimated`. But the issue is `dismissModalViewControllerAnimated:YES` is working properly but `popToRootViewControllerAnimated`i...
2010/10/04
[ "https://Stackoverflow.com/questions/3852932", "https://Stackoverflow.com", "https://Stackoverflow.com/users/384150/" ]
I ran into something similar to this. You need to make a copy of your self.navigationcontroller first and also retain yourself, so when you call the second pop, there is still a reference to the NC and you still exist. ``` // locally store the navigation controller since // self.navigationController will be ni...
I guess, you are not calling the ``` [self.navigationController popToRootViewControllerAnimated:YES]; ``` in the target modal viewcontroller. check that.
3,852,932
I am working application in which i calling `presentModalViewController` and once finished(calling `dismissModalViewControllerAnimated:YES`) it should immediately call `popToRootViewControllerAnimated`. But the issue is `dismissModalViewControllerAnimated:YES` is working properly but `popToRootViewControllerAnimated`i...
2010/10/04
[ "https://Stackoverflow.com/questions/3852932", "https://Stackoverflow.com", "https://Stackoverflow.com/users/384150/" ]
If you have a navigation controller with a stack of UIViewControllers: ``` [self dismissModalViewControllerAnimated:YES]; [(UINavigationController*)self.parentViewController popToRootViewControllerAnimated:YES]; //UIViewController *vc = [[UIViewController new] autorelease]; //[(UINavigationController*)self.parentViewC...
I ran into something similar to this. You need to make a copy of your self.navigationcontroller first and also retain yourself, so when you call the second pop, there is still a reference to the NC and you still exist. ``` // locally store the navigation controller since // self.navigationController will be ni...
58,369,989
Need help passing state as a prop to another state component. I'm very new to React and I'm not sure what I'm doing wrong. When I console.log inside the Timer component it displays undefined but when I console.log in the Main component it displays the object perfectly. ``` class Main extends React.Component { const...
2019/10/14
[ "https://Stackoverflow.com/questions/58369989", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6383688/" ]
@tlrmacl might have answered it there. It's missing the `this` keyword. In theory, you might be assigning the initial value still to the state. It is due to how react lifecycle works On your `componentDidMount()`, you are calling setState after the jsx gets mounted to the DOM. `this.state.itemsP` is given an initial ...
From ur parent component u pass value as `nextLaunch` Dont forget to call props in ur parent component constructor ``` constructor(props) { super(props); this.state = { isLoaded: false, itemsP: 'myValue' } } <Timer nextLaunch={this.state.itemsP} /> ``` So in your Timer Component to print u...
58,369,989
Need help passing state as a prop to another state component. I'm very new to React and I'm not sure what I'm doing wrong. When I console.log inside the Timer component it displays undefined but when I console.log in the Main component it displays the object perfectly. ``` class Main extends React.Component { const...
2019/10/14
[ "https://Stackoverflow.com/questions/58369989", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6383688/" ]
@tlrmacl might have answered it there. It's missing the `this` keyword. In theory, you might be assigning the initial value still to the state. It is due to how react lifecycle works On your `componentDidMount()`, you are calling setState after the jsx gets mounted to the DOM. `this.state.itemsP` is given an initial ...
``` //Timer component class Timer extends React.Component{ constructor(props) { super(props) this.state = { nextDate: this.props.nextLaunch.launch_date_utc } } ``` You need this.props instead of props in your constructor
52,436,015
I'm trying to mimic the Web Audio API multitrack demo from the 'Mozilla Web Audio API for games' Web doc. <https://developer.mozilla.org/en-US/docs/Games/Techniques/Audio_for_Web_Games#Web_Audio_API_for_games> The only caveat I have is that I want the previous track to stop, once a new track is clicked (instead of pl...
2018/09/21
[ "https://Stackoverflow.com/questions/52436015", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10241361/" ]
Simply store the BufferSources somewhere in the outer scope and then call their `stop()` method. I took the liberty to rewrite a bit your loading logic, you shouldn't create a new request every time you start a new track, in that case you loose the main advantages of AudioBuffers against Audio element: they're truly f...
Figured it out with help from @Kaiido Example with both synchronization and starting a new track where a previous track stops: ``` <ul> <li><a class="track" href="http://jPlayer.org/audio/mp3/gbreggae-leadguitar.mp3">Lead Guitar</a></li> <li><a class="track" href="http://jPlayer.org/audio/mp3/gbreggae-drums.mp3">...
34,538,571
I am trying run cucumber tests using maven with following command ``` mvn test -Dcucumber.options="--tag @debug1" ``` This command works fine, however if i try something like following, i get error ``` mvn test -Dcucumber.options="--tag @debug1 @debug2" ``` Is there a way to pass in multiple tag names with cucumb...
2015/12/30
[ "https://Stackoverflow.com/questions/34538571", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3062121/" ]
I using this commandline to run multiple tags ``` mvn test -Dcucumber.options="--tags '@tag1 or @tag2' --plugin io.qameta.allure.cucumber4jvm.AllureCucumber4Jvm --plugin rerun:rerun/failed_scenarios.txt" ``` Cucumber version 4.2.6
In cucumber v5.X, only `mvn test -Dcucumber.options="--tags '@debug1 or @debug2'"` is supported and working. `mvn test -Dcucumber.options="--tags '@debug1 and @debug2'"` is not working and either scenarios won't get executed
34,538,571
I am trying run cucumber tests using maven with following command ``` mvn test -Dcucumber.options="--tag @debug1" ``` This command works fine, however if i try something like following, i get error ``` mvn test -Dcucumber.options="--tag @debug1 @debug2" ``` Is there a way to pass in multiple tag names with cucumb...
2015/12/30
[ "https://Stackoverflow.com/questions/34538571", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3062121/" ]
In Cucumber 6, property name has changed. Use: ``` mvn verify -Dcucumber.filter.tags="@debug1 or @debug2" ```
In cucumber v5.X, only `mvn test -Dcucumber.options="--tags '@debug1 or @debug2'"` is supported and working. `mvn test -Dcucumber.options="--tags '@debug1 and @debug2'"` is not working and either scenarios won't get executed
34,538,571
I am trying run cucumber tests using maven with following command ``` mvn test -Dcucumber.options="--tag @debug1" ``` This command works fine, however if i try something like following, i get error ``` mvn test -Dcucumber.options="--tag @debug1 @debug2" ``` Is there a way to pass in multiple tag names with cucumb...
2015/12/30
[ "https://Stackoverflow.com/questions/34538571", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3062121/" ]
In Cucumber 6, property name has changed. Use: ``` mvn verify -Dcucumber.filter.tags="@debug1 or @debug2" ```
`mvn clean verify -D tags="tagName"`
34,538,571
I am trying run cucumber tests using maven with following command ``` mvn test -Dcucumber.options="--tag @debug1" ``` This command works fine, however if i try something like following, i get error ``` mvn test -Dcucumber.options="--tag @debug1 @debug2" ``` Is there a way to pass in multiple tag names with cucumb...
2015/12/30
[ "https://Stackoverflow.com/questions/34538571", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3062121/" ]
For me what was working with **surefire plugin**: ``` mvn clean test -D"cucumber.filter.tags=@tag1 or @tag2" ``` When I tried with this version: ``` mvn clean test -Dcucumber.filter.tags="not @MyTag" ``` I got this exception: ``` io.cucumber.core.exception.CucumberException: Failed to parse 'cucumber.filter.tags...
In cucumber v5.X, only `mvn test -Dcucumber.options="--tags '@debug1 or @debug2'"` is supported and working. `mvn test -Dcucumber.options="--tags '@debug1 and @debug2'"` is not working and either scenarios won't get executed
34,538,571
I am trying run cucumber tests using maven with following command ``` mvn test -Dcucumber.options="--tag @debug1" ``` This command works fine, however if i try something like following, i get error ``` mvn test -Dcucumber.options="--tag @debug1 @debug2" ``` Is there a way to pass in multiple tag names with cucumb...
2015/12/30
[ "https://Stackoverflow.com/questions/34538571", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3062121/" ]
In Cucumber 6, property name has changed. Use: ``` mvn verify -Dcucumber.filter.tags="@debug1 or @debug2" ```
Little late to the party, but I am using something like: ``` mvn test -D tags="debug1 and debug2" ``` I am on Cucumber 2.4. The `@` symbol is optional. You can use a `tags` Maven property. And you can use boolean logic to hook up multiple tags - [official docs](https://cucumber.io/docs/cucumber/api/#tags). Reduces...
34,538,571
I am trying run cucumber tests using maven with following command ``` mvn test -Dcucumber.options="--tag @debug1" ``` This command works fine, however if i try something like following, i get error ``` mvn test -Dcucumber.options="--tag @debug1 @debug2" ``` Is there a way to pass in multiple tag names with cucumb...
2015/12/30
[ "https://Stackoverflow.com/questions/34538571", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3062121/" ]
For me what was working with **surefire plugin**: ``` mvn clean test -D"cucumber.filter.tags=@tag1 or @tag2" ``` When I tried with this version: ``` mvn clean test -Dcucumber.filter.tags="not @MyTag" ``` I got this exception: ``` io.cucumber.core.exception.CucumberException: Failed to parse 'cucumber.filter.tags...
`mvn clean verify -D tags="tagName"`
34,538,571
I am trying run cucumber tests using maven with following command ``` mvn test -Dcucumber.options="--tag @debug1" ``` This command works fine, however if i try something like following, i get error ``` mvn test -Dcucumber.options="--tag @debug1 @debug2" ``` Is there a way to pass in multiple tag names with cucumb...
2015/12/30
[ "https://Stackoverflow.com/questions/34538571", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3062121/" ]
In Cucumber 6, property name has changed. Use: ``` mvn verify -Dcucumber.filter.tags="@debug1 or @debug2" ```
For me what was working with **surefire plugin**: ``` mvn clean test -D"cucumber.filter.tags=@tag1 or @tag2" ``` When I tried with this version: ``` mvn clean test -Dcucumber.filter.tags="not @MyTag" ``` I got this exception: ``` io.cucumber.core.exception.CucumberException: Failed to parse 'cucumber.filter.tags...
34,538,571
I am trying run cucumber tests using maven with following command ``` mvn test -Dcucumber.options="--tag @debug1" ``` This command works fine, however if i try something like following, i get error ``` mvn test -Dcucumber.options="--tag @debug1 @debug2" ``` Is there a way to pass in multiple tag names with cucumb...
2015/12/30
[ "https://Stackoverflow.com/questions/34538571", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3062121/" ]
for version 6.10.2 Cucumber and Junit 4.12 ``` mvn test "-Dcucumber.filter.tags= (@Tag1 or @Tag2) and not @Tag3" ``` where "or" is equal to "and".... for no reason (thanks Cucumber...)
`mvn clean verify -D tags="tagName"`
34,538,571
I am trying run cucumber tests using maven with following command ``` mvn test -Dcucumber.options="--tag @debug1" ``` This command works fine, however if i try something like following, i get error ``` mvn test -Dcucumber.options="--tag @debug1 @debug2" ``` Is there a way to pass in multiple tag names with cucumb...
2015/12/30
[ "https://Stackoverflow.com/questions/34538571", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3062121/" ]
Little late to the party, but I am using something like: ``` mvn test -D tags="debug1 and debug2" ``` I am on Cucumber 2.4. The `@` symbol is optional. You can use a `tags` Maven property. And you can use boolean logic to hook up multiple tags - [official docs](https://cucumber.io/docs/cucumber/api/#tags). Reduces...
In cucumber v5.X, only `mvn test -Dcucumber.options="--tags '@debug1 or @debug2'"` is supported and working. `mvn test -Dcucumber.options="--tags '@debug1 and @debug2'"` is not working and either scenarios won't get executed
34,538,571
I am trying run cucumber tests using maven with following command ``` mvn test -Dcucumber.options="--tag @debug1" ``` This command works fine, however if i try something like following, i get error ``` mvn test -Dcucumber.options="--tag @debug1 @debug2" ``` Is there a way to pass in multiple tag names with cucumb...
2015/12/30
[ "https://Stackoverflow.com/questions/34538571", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3062121/" ]
* To run scenarios with `@debug1` and `@debug2`: **Old version of Cucumber-jvm:** ``` mvn test -Dcucumber.options="--tags @debug1 --tags @debug2" ``` **Actual version of Cucumber-jvm:** ``` mvn test -Dcucumber.options="--tags '@debug1 and @debug2'" ``` * To run scenarios with `@debug1` or `@debug2`: **Old versi...
For me what was working with **surefire plugin**: ``` mvn clean test -D"cucumber.filter.tags=@tag1 or @tag2" ``` When I tried with this version: ``` mvn clean test -Dcucumber.filter.tags="not @MyTag" ``` I got this exception: ``` io.cucumber.core.exception.CucumberException: Failed to parse 'cucumber.filter.tags...
9,803,396
I am looking for a lightweight, reliable and fast key/value database for storing binary data. Simple without server. Most of popular key/value databases like CDB and BerkeleyDB does not natively store `BLOB`. What can be the best choice that I missed? My current choice is SQLite, but it is too advanced for my simple u...
2012/03/21
[ "https://Stackoverflow.com/questions/9803396", "https://Stackoverflow.com", "https://Stackoverflow.com/users/943340/" ]
As it was previously pointed out, BerkeleyDB does support opaque values and keys, but I would suggest a better alternative: LevelDB. **LevelDB:** Google is your friend :), so much so that they even provide you with an embedded database: [A fast and lightweight key/value database library by Google.](https://github.com...
You may have a look at <http://www.codeproject.com/Articles/316816/RaptorDB-The-Key-Value-Store-V2> my friend of Databases.
9,803,396
I am looking for a lightweight, reliable and fast key/value database for storing binary data. Simple without server. Most of popular key/value databases like CDB and BerkeleyDB does not natively store `BLOB`. What can be the best choice that I missed? My current choice is SQLite, but it is too advanced for my simple u...
2012/03/21
[ "https://Stackoverflow.com/questions/9803396", "https://Stackoverflow.com", "https://Stackoverflow.com/users/943340/" ]
What makes you think BerkDB cannot store binary data? From their docs: > > Key and content arguments are objects described by the datum typedef. A datum specifies a string of dsize bytes pointed to by dptr. Arbitrary binary data, as well as normal text strings, are allowed. > > > Also see their [examples](http://...
You may have a look at <http://www.codeproject.com/Articles/316816/RaptorDB-The-Key-Value-Store-V2> my friend of Databases.
9,803,396
I am looking for a lightweight, reliable and fast key/value database for storing binary data. Simple without server. Most of popular key/value databases like CDB and BerkeleyDB does not natively store `BLOB`. What can be the best choice that I missed? My current choice is SQLite, but it is too advanced for my simple u...
2012/03/21
[ "https://Stackoverflow.com/questions/9803396", "https://Stackoverflow.com", "https://Stackoverflow.com/users/943340/" ]
As it was previously pointed out, BerkeleyDB does support opaque values and keys, but I would suggest a better alternative: LevelDB. **LevelDB:** Google is your friend :), so much so that they even provide you with an embedded database: [A fast and lightweight key/value database library by Google.](https://github.com...
Which OS are you running? For Windows you might want to check out [ESE](http://en.wikipedia.org/wiki/Extensible_Storage_Engine), which is a very robust storage engine which ships as part of the OS. It powers Active Directory, Exchange, DNS and a few other Microsoft server products, and is used by many 3rd party product...
9,803,396
I am looking for a lightweight, reliable and fast key/value database for storing binary data. Simple without server. Most of popular key/value databases like CDB and BerkeleyDB does not natively store `BLOB`. What can be the best choice that I missed? My current choice is SQLite, but it is too advanced for my simple u...
2012/03/21
[ "https://Stackoverflow.com/questions/9803396", "https://Stackoverflow.com", "https://Stackoverflow.com/users/943340/" ]
If you don't need "multiple writer processes" (only multiple readers works), want something small and want something that is available on nearly every linux, you might want to take a look at gdbm, which is like berkeley db, but much simpler. Also it's possibly not as fast. In nearly the same area are things like tokyo...
You may have a look at <http://www.codeproject.com/Articles/316816/RaptorDB-The-Key-Value-Store-V2> my friend of Databases.
9,803,396
I am looking for a lightweight, reliable and fast key/value database for storing binary data. Simple without server. Most of popular key/value databases like CDB and BerkeleyDB does not natively store `BLOB`. What can be the best choice that I missed? My current choice is SQLite, but it is too advanced for my simple u...
2012/03/21
[ "https://Stackoverflow.com/questions/9803396", "https://Stackoverflow.com", "https://Stackoverflow.com/users/943340/" ]
What makes you think BerkDB cannot store binary data? From their docs: > > Key and content arguments are objects described by the datum typedef. A datum specifies a string of dsize bytes pointed to by dptr. Arbitrary binary data, as well as normal text strings, are allowed. > > > Also see their [examples](http://...
Using sqlite is now straightforward with the new functions readfile(X) and writefile(X,Y) which are available since 2014-06. For example to save a blob in the database from a file and extract it again ``` CREATE TABLE images(name TEXT, type TEXT, img BLOB); INSERT INTO images(name,type,img) VALUES('icon','jp...
9,803,396
I am looking for a lightweight, reliable and fast key/value database for storing binary data. Simple without server. Most of popular key/value databases like CDB and BerkeleyDB does not natively store `BLOB`. What can be the best choice that I missed? My current choice is SQLite, but it is too advanced for my simple u...
2012/03/21
[ "https://Stackoverflow.com/questions/9803396", "https://Stackoverflow.com", "https://Stackoverflow.com/users/943340/" ]
What makes you think BerkDB cannot store binary data? From their docs: > > Key and content arguments are objects described by the datum typedef. A datum specifies a string of dsize bytes pointed to by dptr. Arbitrary binary data, as well as normal text strings, are allowed. > > > Also see their [examples](http://...
If you don't need "multiple writer processes" (only multiple readers works), want something small and want something that is available on nearly every linux, you might want to take a look at gdbm, which is like berkeley db, but much simpler. Also it's possibly not as fast. In nearly the same area are things like tokyo...
9,803,396
I am looking for a lightweight, reliable and fast key/value database for storing binary data. Simple without server. Most of popular key/value databases like CDB and BerkeleyDB does not natively store `BLOB`. What can be the best choice that I missed? My current choice is SQLite, but it is too advanced for my simple u...
2012/03/21
[ "https://Stackoverflow.com/questions/9803396", "https://Stackoverflow.com", "https://Stackoverflow.com/users/943340/" ]
As it was previously pointed out, BerkeleyDB does support opaque values and keys, but I would suggest a better alternative: LevelDB. **LevelDB:** Google is your friend :), so much so that they even provide you with an embedded database: [A fast and lightweight key/value database library by Google.](https://github.com...
If you don't need "multiple writer processes" (only multiple readers works), want something small and want something that is available on nearly every linux, you might want to take a look at gdbm, which is like berkeley db, but much simpler. Also it's possibly not as fast. In nearly the same area are things like tokyo...
9,803,396
I am looking for a lightweight, reliable and fast key/value database for storing binary data. Simple without server. Most of popular key/value databases like CDB and BerkeleyDB does not natively store `BLOB`. What can be the best choice that I missed? My current choice is SQLite, but it is too advanced for my simple u...
2012/03/21
[ "https://Stackoverflow.com/questions/9803396", "https://Stackoverflow.com", "https://Stackoverflow.com/users/943340/" ]
If you don't need "multiple writer processes" (only multiple readers works), want something small and want something that is available on nearly every linux, you might want to take a look at gdbm, which is like berkeley db, but much simpler. Also it's possibly not as fast. In nearly the same area are things like tokyo...
Which OS are you running? For Windows you might want to check out [ESE](http://en.wikipedia.org/wiki/Extensible_Storage_Engine), which is a very robust storage engine which ships as part of the OS. It powers Active Directory, Exchange, DNS and a few other Microsoft server products, and is used by many 3rd party product...
9,803,396
I am looking for a lightweight, reliable and fast key/value database for storing binary data. Simple without server. Most of popular key/value databases like CDB and BerkeleyDB does not natively store `BLOB`. What can be the best choice that I missed? My current choice is SQLite, but it is too advanced for my simple u...
2012/03/21
[ "https://Stackoverflow.com/questions/9803396", "https://Stackoverflow.com", "https://Stackoverflow.com/users/943340/" ]
As it was previously pointed out, BerkeleyDB does support opaque values and keys, but I would suggest a better alternative: LevelDB. **LevelDB:** Google is your friend :), so much so that they even provide you with an embedded database: [A fast and lightweight key/value database library by Google.](https://github.com...
Using sqlite is now straightforward with the new functions readfile(X) and writefile(X,Y) which are available since 2014-06. For example to save a blob in the database from a file and extract it again ``` CREATE TABLE images(name TEXT, type TEXT, img BLOB); INSERT INTO images(name,type,img) VALUES('icon','jp...
9,803,396
I am looking for a lightweight, reliable and fast key/value database for storing binary data. Simple without server. Most of popular key/value databases like CDB and BerkeleyDB does not natively store `BLOB`. What can be the best choice that I missed? My current choice is SQLite, but it is too advanced for my simple u...
2012/03/21
[ "https://Stackoverflow.com/questions/9803396", "https://Stackoverflow.com", "https://Stackoverflow.com/users/943340/" ]
If you don't need "multiple writer processes" (only multiple readers works), want something small and want something that is available on nearly every linux, you might want to take a look at gdbm, which is like berkeley db, but much simpler. Also it's possibly not as fast. In nearly the same area are things like tokyo...
Using sqlite is now straightforward with the new functions readfile(X) and writefile(X,Y) which are available since 2014-06. For example to save a blob in the database from a file and extract it again ``` CREATE TABLE images(name TEXT, type TEXT, img BLOB); INSERT INTO images(name,type,img) VALUES('icon','jp...
2,225,263
Suppose I have a simple table, like this: ``` Smith | Select Jones | Select Johnson | Select ``` And I need to write a Selenium test to select the link corresponding to Jones. I can make it click the "Select" in the 2nd row, but I would rather have it find where "Jones" is and click the corresponding "Sele...
2010/02/08
[ "https://Stackoverflow.com/questions/2225263", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16012/" ]
Use an xpath expression like "//tc[.//text() = 'Jones']/../tc[2]/a" which looks for a table cell whose text contents are 'Jones' and then naviagates up to that cells parent, selects the second table cell of that parent, and then a link inside the second table cell.
If you wanna use jQuery, here is some information: * First you can read the jquery from a jquery.js or jquery.min.js file. * Then using execute\_script(jquery) to enable jquery dynamically. * Now you can interact with jquery. here is some code: ``` browser = webdriver.Firefox() # Get local session of firefox with...
117,095
**Your task:** Find the most efficient mowing path around the dark green bushes that mows (passes over) all of the grass (light green). [![enter image description here](https://i.stack.imgur.com/hSmSr.png)](https://i.stack.imgur.com/hSmSr.png) --- For those who cannot view the image above, there are 9 rows of 16,...
2022/07/15
[ "https://puzzling.stackexchange.com/questions/117095", "https://puzzling.stackexchange.com", "https://puzzling.stackexchange.com/users/463/" ]
**Proof of optimality for the solutions given** > > [![enter image description here](https://i.stack.imgur.com/V4Pam.png)](https://i.stack.imgur.com/V4Pam.png) > > > > There are 7 regions that have an odd number of accesses. > > > > For each such region you either have an endpoint inside the region >...
Because of the [no-computers] tag, I waited to post this answer until somebody else already proved optimality. A graph-based approach to this problem is to first compute all-pairs shortest-path distances in an undirected graph with a node for each grassy square and an edge between nodes that are horizontal or vertical...
117,095
**Your task:** Find the most efficient mowing path around the dark green bushes that mows (passes over) all of the grass (light green). [![enter image description here](https://i.stack.imgur.com/hSmSr.png)](https://i.stack.imgur.com/hSmSr.png) --- For those who cannot view the image above, there are 9 rows of 16,...
2022/07/15
[ "https://puzzling.stackexchange.com/questions/117095", "https://puzzling.stackexchange.com", "https://puzzling.stackexchange.com/users/463/" ]
> > **Optimal : 111 moves** > > > > [![enter image description here](https://i.stack.imgur.com/cqYPf.png)](https://i.stack.imgur.com/cqYPf.png) > > > > [Visual of path](https://i.stack.imgur.com/WiFNJ.png) > > > Others of the same length exist, such as [this](https://i.stack.imgur.com/8daZH.png), [th...
Because of the [no-computers] tag, I waited to post this answer until somebody else already proved optimality. A graph-based approach to this problem is to first compute all-pairs shortest-path distances in an undirected graph with a node for each grassy square and an edge between nodes that are horizontal or vertical...
117,095
**Your task:** Find the most efficient mowing path around the dark green bushes that mows (passes over) all of the grass (light green). [![enter image description here](https://i.stack.imgur.com/hSmSr.png)](https://i.stack.imgur.com/hSmSr.png) --- For those who cannot view the image above, there are 9 rows of 16,...
2022/07/15
[ "https://puzzling.stackexchange.com/questions/117095", "https://puzzling.stackexchange.com", "https://puzzling.stackexchange.com/users/463/" ]
**Proof of optimality for the solutions given** > > [![enter image description here](https://i.stack.imgur.com/V4Pam.png)](https://i.stack.imgur.com/V4Pam.png) > > > > There are 7 regions that have an odd number of accesses. > > > > For each such region you either have an endpoint inside the region >...
Here is a pretty long path that does not visit any square twice, but misses a few spots: > > [![enter image description here](https://i.stack.imgur.com/s74My.png)](https://i.stack.imgur.com/s74My.png) > > The path visits 96 squares. > > > To turn this into a solution, we have to add a few extra moves to mow ...
117,095
**Your task:** Find the most efficient mowing path around the dark green bushes that mows (passes over) all of the grass (light green). [![enter image description here](https://i.stack.imgur.com/hSmSr.png)](https://i.stack.imgur.com/hSmSr.png) --- For those who cannot view the image above, there are 9 rows of 16,...
2022/07/15
[ "https://puzzling.stackexchange.com/questions/117095", "https://puzzling.stackexchange.com", "https://puzzling.stackexchange.com/users/463/" ]
Because of the [no-computers] tag, I waited to post this answer until somebody else already proved optimality. A graph-based approach to this problem is to first compute all-pairs shortest-path distances in an undirected graph with a node for each grassy square and an edge between nodes that are horizontal or vertical...
I was able to get 111 moves (assuming I counted correctly): > > [![squares wow](https://i.stack.imgur.com/owj9A.png)](https://i.stack.imgur.com/owj9A.png) > > >
117,095
**Your task:** Find the most efficient mowing path around the dark green bushes that mows (passes over) all of the grass (light green). [![enter image description here](https://i.stack.imgur.com/hSmSr.png)](https://i.stack.imgur.com/hSmSr.png) --- For those who cannot view the image above, there are 9 rows of 16,...
2022/07/15
[ "https://puzzling.stackexchange.com/questions/117095", "https://puzzling.stackexchange.com", "https://puzzling.stackexchange.com/users/463/" ]
Here's a path that uses just 111 mows: > > ![1](https://i.imgur.com/inbnobn.png) > > > Proof of optimal starting and ending points and lower bound: > > First note that there are two obvious "dead ends": > ![2](https://i.imgur.com/kclGQ9h.png) > If you don't start (or end) your path in those squares, they wil...
I got 112 squares (assuming I counted correctly), visiting every one: > > [![you can see the overlapping squares better here.](https://i.stack.imgur.com/NAIHi.png)](https://i.stack.imgur.com/NAIHi.png) > > > However, this is not optimal.
117,095
**Your task:** Find the most efficient mowing path around the dark green bushes that mows (passes over) all of the grass (light green). [![enter image description here](https://i.stack.imgur.com/hSmSr.png)](https://i.stack.imgur.com/hSmSr.png) --- For those who cannot view the image above, there are 9 rows of 16,...
2022/07/15
[ "https://puzzling.stackexchange.com/questions/117095", "https://puzzling.stackexchange.com", "https://puzzling.stackexchange.com/users/463/" ]
Here's a path that uses just 111 mows: > > ![1](https://i.imgur.com/inbnobn.png) > > > Proof of optimal starting and ending points and lower bound: > > First note that there are two obvious "dead ends": > ![2](https://i.imgur.com/kclGQ9h.png) > If you don't start (or end) your path in those squares, they wil...
Here is a pretty long path that does not visit any square twice, but misses a few spots: > > [![enter image description here](https://i.stack.imgur.com/s74My.png)](https://i.stack.imgur.com/s74My.png) > > The path visits 96 squares. > > > To turn this into a solution, we have to add a few extra moves to mow ...
117,095
**Your task:** Find the most efficient mowing path around the dark green bushes that mows (passes over) all of the grass (light green). [![enter image description here](https://i.stack.imgur.com/hSmSr.png)](https://i.stack.imgur.com/hSmSr.png) --- For those who cannot view the image above, there are 9 rows of 16,...
2022/07/15
[ "https://puzzling.stackexchange.com/questions/117095", "https://puzzling.stackexchange.com", "https://puzzling.stackexchange.com/users/463/" ]
> > **Optimal : 111 moves** > > > > [![enter image description here](https://i.stack.imgur.com/cqYPf.png)](https://i.stack.imgur.com/cqYPf.png) > > > > [Visual of path](https://i.stack.imgur.com/WiFNJ.png) > > > Others of the same length exist, such as [this](https://i.stack.imgur.com/8daZH.png), [th...
I got 112 squares (assuming I counted correctly), visiting every one: > > [![you can see the overlapping squares better here.](https://i.stack.imgur.com/NAIHi.png)](https://i.stack.imgur.com/NAIHi.png) > > > However, this is not optimal.
117,095
**Your task:** Find the most efficient mowing path around the dark green bushes that mows (passes over) all of the grass (light green). [![enter image description here](https://i.stack.imgur.com/hSmSr.png)](https://i.stack.imgur.com/hSmSr.png) --- For those who cannot view the image above, there are 9 rows of 16,...
2022/07/15
[ "https://puzzling.stackexchange.com/questions/117095", "https://puzzling.stackexchange.com", "https://puzzling.stackexchange.com/users/463/" ]
Here is a pretty long path that does not visit any square twice, but misses a few spots: > > [![enter image description here](https://i.stack.imgur.com/s74My.png)](https://i.stack.imgur.com/s74My.png) > > The path visits 96 squares. > > > To turn this into a solution, we have to add a few extra moves to mow ...
I was able to get 111 moves (assuming I counted correctly): > > [![squares wow](https://i.stack.imgur.com/owj9A.png)](https://i.stack.imgur.com/owj9A.png) > > >
117,095
**Your task:** Find the most efficient mowing path around the dark green bushes that mows (passes over) all of the grass (light green). [![enter image description here](https://i.stack.imgur.com/hSmSr.png)](https://i.stack.imgur.com/hSmSr.png) --- For those who cannot view the image above, there are 9 rows of 16,...
2022/07/15
[ "https://puzzling.stackexchange.com/questions/117095", "https://puzzling.stackexchange.com", "https://puzzling.stackexchange.com/users/463/" ]
Here's a path that uses just 111 mows: > > ![1](https://i.imgur.com/inbnobn.png) > > > Proof of optimal starting and ending points and lower bound: > > First note that there are two obvious "dead ends": > ![2](https://i.imgur.com/kclGQ9h.png) > If you don't start (or end) your path in those squares, they wil...
I was able to get 111 moves (assuming I counted correctly): > > [![squares wow](https://i.stack.imgur.com/owj9A.png)](https://i.stack.imgur.com/owj9A.png) > > >
117,095
**Your task:** Find the most efficient mowing path around the dark green bushes that mows (passes over) all of the grass (light green). [![enter image description here](https://i.stack.imgur.com/hSmSr.png)](https://i.stack.imgur.com/hSmSr.png) --- For those who cannot view the image above, there are 9 rows of 16,...
2022/07/15
[ "https://puzzling.stackexchange.com/questions/117095", "https://puzzling.stackexchange.com", "https://puzzling.stackexchange.com/users/463/" ]
I got 112 squares (assuming I counted correctly), visiting every one: > > [![you can see the overlapping squares better here.](https://i.stack.imgur.com/NAIHi.png)](https://i.stack.imgur.com/NAIHi.png) > > > However, this is not optimal.
I was able to get 111 moves (assuming I counted correctly): > > [![squares wow](https://i.stack.imgur.com/owj9A.png)](https://i.stack.imgur.com/owj9A.png) > > >
135,851
Related to [Poker Hand Evaluator](https://codereview.stackexchange.com/questions/135649/poker-hand-evaluator). This it **not** the same. This is take best from all combinations of 7. The other is all combinations of 5. Poker is 52 cards - 4 suits and 13 ranks: * Texas holdem * Hand is exactly 5 cards * Order of hands...
2016/07/25
[ "https://codereview.stackexchange.com/questions/135851", "https://codereview.stackexchange.com", "https://codereview.stackexchange.com/users/105946/" ]
When checking for a flush, instead of looping through the cards 4 times, you could have an array of length 4 where each position represents a suit. Then loop over the 7 cards one time and use a switch statement to increment the element that corresponds to the suit. Then loop over the array and check if any of the eleme...
I believe you can use formulas to calculate your answer, which will be much faster than brute force. However, it is a good idea to code a brute force solution first, as you have, so that you can test against it. The biggest improvement you can make readability-wise is on how you generate all of the card combinations. R...
55,678,914
Let's say I have a number from user, for exemple: 456789. I know how to print in reverse the number, but I am not sure how I can stop the execution to print only 3 first reversed digits. What I mean is that I want to print only 987 from the given number I have to stop somehow with break; but I am not sure how. ``` p...
2019/04/14
[ "https://Stackoverflow.com/questions/55678914", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11301177/" ]
You could follow this algo: 1. modulo the number by 1000 2. reverse it 3. print
You can just convert to into a StringBuilder and use `reverse()` and `substring()`: ``` String result = new StringBuilder() .append(numar) .reverse() .substring(0, 3); System.out.print(result); ```
55,678,914
Let's say I have a number from user, for exemple: 456789. I know how to print in reverse the number, but I am not sure how I can stop the execution to print only 3 first reversed digits. What I mean is that I want to print only 987 from the given number I have to stop somehow with break; but I am not sure how. ``` p...
2019/04/14
[ "https://Stackoverflow.com/questions/55678914", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11301177/" ]
You could follow this algo: 1. modulo the number by 1000 2. reverse it 3. print
``` System.out.println("Input a number"); Scanner sc = new Scanner(System.in); int num = sc.nextInt(); int reversed = 0, counter = 0; while (counter++ < 3) { int digit = num % 10; reversed = reversed * 10 + digit; num /= 10; } System.out.println("Reversed Number: ...
55,678,914
Let's say I have a number from user, for exemple: 456789. I know how to print in reverse the number, but I am not sure how I can stop the execution to print only 3 first reversed digits. What I mean is that I want to print only 987 from the given number I have to stop somehow with break; but I am not sure how. ``` p...
2019/04/14
[ "https://Stackoverflow.com/questions/55678914", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11301177/" ]
You could follow this algo: 1. modulo the number by 1000 2. reverse it 3. print
For the example of num = 456789 We have: a) A quotient of 45678 when we do an Integer division, i.e. 456789 / 10 b) A remainder of 9 when we use the Modulus operator, i.e. 456789 % 10 If we update the 'new' number to be the quotient and by iterating, the following table shows what it looks like: ``` digit ...
779,898
How can I pass a arbitrary number of arguments to the class constructor using the Object() function defined below? ``` <?php /* ./index.php */ function Object($object) { static $instance = array(); if (is_file('./' . $object . '.php') === true) { $class = basename($object); if (array_ke...
2009/04/23
[ "https://Stackoverflow.com/questions/779898", "https://Stackoverflow.com", "https://Stackoverflow.com/users/89771/" ]
Instead of your class taking separated parameters I'd have it take an array. ``` class DB { public function __construct(array $params) { // do stuff here } } ``` That way you can pass the direct result of the func\_get\_args into your constructor. The only problem now is being able to figure out ...
I haven't tried this, but `call_user_func_array` sounds like you want. ``` $thing = call_user_func_array(array($classname, '__construct'), $args); ``` Have a look in the [PHP Documentation](http://www.php.net/manual/en/function.call-user-func-array.php).
779,898
How can I pass a arbitrary number of arguments to the class constructor using the Object() function defined below? ``` <?php /* ./index.php */ function Object($object) { static $instance = array(); if (is_file('./' . $object . '.php') === true) { $class = basename($object); if (array_ke...
2009/04/23
[ "https://Stackoverflow.com/questions/779898", "https://Stackoverflow.com", "https://Stackoverflow.com/users/89771/" ]
``` $klass = new ReflectionClass($classname); $thing = $klass->newInstanceArgs($args); ``` Although the need to use reflection suggests that you are overcomplicating something in your design. Why do you want to write this function in the first place?
Instead of your class taking separated parameters I'd have it take an array. ``` class DB { public function __construct(array $params) { // do stuff here } } ``` That way you can pass the direct result of the func\_get\_args into your constructor. The only problem now is being able to figure out ...
779,898
How can I pass a arbitrary number of arguments to the class constructor using the Object() function defined below? ``` <?php /* ./index.php */ function Object($object) { static $instance = array(); if (is_file('./' . $object . '.php') === true) { $class = basename($object); if (array_ke...
2009/04/23
[ "https://Stackoverflow.com/questions/779898", "https://Stackoverflow.com", "https://Stackoverflow.com/users/89771/" ]
Instead of your class taking separated parameters I'd have it take an array. ``` class DB { public function __construct(array $params) { // do stuff here } } ``` That way you can pass the direct result of the func\_get\_args into your constructor. The only problem now is being able to figure out ...
An alternative for the reflection method, would be evaluate your code. ``` eval('$instance = new className('.implode(', ', $args).');'); ```
779,898
How can I pass a arbitrary number of arguments to the class constructor using the Object() function defined below? ``` <?php /* ./index.php */ function Object($object) { static $instance = array(); if (is_file('./' . $object . '.php') === true) { $class = basename($object); if (array_ke...
2009/04/23
[ "https://Stackoverflow.com/questions/779898", "https://Stackoverflow.com", "https://Stackoverflow.com/users/89771/" ]
``` $klass = new ReflectionClass($classname); $thing = $klass->newInstanceArgs($args); ``` Although the need to use reflection suggests that you are overcomplicating something in your design. Why do you want to write this function in the first place?
I haven't tried this, but `call_user_func_array` sounds like you want. ``` $thing = call_user_func_array(array($classname, '__construct'), $args); ``` Have a look in the [PHP Documentation](http://www.php.net/manual/en/function.call-user-func-array.php).
779,898
How can I pass a arbitrary number of arguments to the class constructor using the Object() function defined below? ``` <?php /* ./index.php */ function Object($object) { static $instance = array(); if (is_file('./' . $object . '.php') === true) { $class = basename($object); if (array_ke...
2009/04/23
[ "https://Stackoverflow.com/questions/779898", "https://Stackoverflow.com", "https://Stackoverflow.com/users/89771/" ]
``` $klass = new ReflectionClass($classname); $thing = $klass->newInstanceArgs($args); ``` Although the need to use reflection suggests that you are overcomplicating something in your design. Why do you want to write this function in the first place?
An alternative for the reflection method, would be evaluate your code. ``` eval('$instance = new className('.implode(', ', $args).');'); ```
14,063,072
So I would like to do a select from an SQL database, using Java, subject to a conditional statement (less than or equal to something) subject to some loop in Java. In other words, something like the following: ``` for (int i=0; i< 195; i++) { // Get the results of the SQL query resultSet = stat...
2012/12/28
[ "https://Stackoverflow.com/questions/14063072", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1849003/" ]
The SQL statement is parsed and run in a different environment than your Java code - different language, different scope, and unless you use SQLite they run in different processes or even different machines. Because of that, you can't just refer to the Java variable `i` from your SQL code - you have to either inject it...
The problem os that the database is not told about the value of i. Instead make Java put the value into the string and then submit it to the database. string sql = "select \* from foo where bar=" + i; You need to remember at all times that the database only knows what you explicitly tell it, and that you are essentia...
14,063,072
So I would like to do a select from an SQL database, using Java, subject to a conditional statement (less than or equal to something) subject to some loop in Java. In other words, something like the following: ``` for (int i=0; i< 195; i++) { // Get the results of the SQL query resultSet = stat...
2012/12/28
[ "https://Stackoverflow.com/questions/14063072", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1849003/" ]
The problem os that the database is not told about the value of i. Instead make Java put the value into the string and then submit it to the database. string sql = "select \* from foo where bar=" + i; You need to remember at all times that the database only knows what you explicitly tell it, and that you are essentia...
You can generate an sql string and call it via jdbc, using bind variable is more correct from performance, security. It also saves you from escaping any special characters. Since you are learning about using sql with jdbc, please read about bind variables. An example is [here](http://steveracanovic.blogspot.in/2008/03...
14,063,072
So I would like to do a select from an SQL database, using Java, subject to a conditional statement (less than or equal to something) subject to some loop in Java. In other words, something like the following: ``` for (int i=0; i< 195; i++) { // Get the results of the SQL query resultSet = stat...
2012/12/28
[ "https://Stackoverflow.com/questions/14063072", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1849003/" ]
The SQL statement is parsed and run in a different environment than your Java code - different language, different scope, and unless you use SQLite they run in different processes or even different machines. Because of that, you can't just refer to the Java variable `i` from your SQL code - you have to either inject it...
You can generate an sql string and call it via jdbc, using bind variable is more correct from performance, security. It also saves you from escaping any special characters. Since you are learning about using sql with jdbc, please read about bind variables. An example is [here](http://steveracanovic.blogspot.in/2008/03...
9,287,960
I currently have this code that parses imdbAPI http returns: ``` text = 'unicode: {"Title":"The Fountain","Year":"2006","Rated":"R","Released":"22 Nov 2006","Genre":"Drama, Romance, Sci-Fi","Director":"Darren Aronofsky","Writer":"Darren Aronofsky, Darren Aronofsky","Actors":"Hugh Jackman, Rachel Weisz, Sean Patrick Th...
2012/02/15
[ "https://Stackoverflow.com/questions/9287960", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1176502/" ]
``` >>> ast.literal_eval(text.split(' ', 1)[1]) {'Plot': 'Spanning over one thousand years, and three parallel stories, The Fountain is a story of love, death, spirituality, and the fragility of our existence in this world.', 'Votes': '100139', 'Rated': 'R', 'Response': 'True', 'Title': 'The Fountain', 'Poster': 'http:...
You can try casting all the data into a dict after removing all the unnecessary head and tail chars. ``` import re line = 'unicode: {"Title":"The Fountain","Year":"2006","Rated":"R","Released":"22 Nov 2006","Genre":"Drama, Romance, Sci-Fi","Director":"Darren Aronofsky","Writer":"Darren Aronofsky, Darren Aronofsky","A...
9,287,960
I currently have this code that parses imdbAPI http returns: ``` text = 'unicode: {"Title":"The Fountain","Year":"2006","Rated":"R","Released":"22 Nov 2006","Genre":"Drama, Romance, Sci-Fi","Director":"Darren Aronofsky","Writer":"Darren Aronofsky, Darren Aronofsky","Actors":"Hugh Jackman, Rachel Weisz, Sean Patrick Th...
2012/02/15
[ "https://Stackoverflow.com/questions/9287960", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1176502/" ]
``` >>> ast.literal_eval(text.split(' ', 1)[1]) {'Plot': 'Spanning over one thousand years, and three parallel stories, The Fountain is a story of love, death, spirituality, and the fragility of our existence in this world.', 'Votes': '100139', 'Rated': 'R', 'Response': 'True', 'Title': 'The Fountain', 'Poster': 'http:...
Seems to me that everyone is working way too hard... if you really have ``` line = 'unicode: {"key1":"Value1", "key2","value2", etc...}' ``` Which looks like a *string*... then you strip "unicode:" off the front of the string ``` newline = line[9:] ``` then eval the result directly into a dict ``` data_dict=e...
52,466,555
I want to find (or make) a python script that reads a different python script line by line and prints the commands executed and the output right there after. Suppose you have a python script, `testfile.py` as such: ``` print("Hello world") for i in range(3): print(f"i is: {i}") ``` Now, I want a different pyth...
2018/09/23
[ "https://Stackoverflow.com/questions/52466555", "https://Stackoverflow.com", "https://Stackoverflow.com/users/997253/" ]
[`code.InteractiveConsole.interact`](https://docs.python.org/3/library/code.html#code.InteractiveConsole.interact) does exactly what is asked.
This is not *exactly* what you wanted, but it's close. `trace` module does something very similar. `so.py:` ```py print("Hello world") for i in range(3): print(f"i is: {i}") ``` ``` python -m trace --trace so.py --- modulename: so, funcname: <module> so.py(1): print("Hello world") Hello world so.py(3): for i ...
30,205,906
I have been using oauth 2.0 with Linkedin as the provider. Now as of today suddenly the authentication is no longer working. Looked on Linkedin its API profile page and figured that they have been updating their program. The error that I am getting is the following: > > No 'Access-Control-Allow-Origin' header is pr...
2015/05/13
[ "https://Stackoverflow.com/questions/30205906", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2164689/" ]
LinkedIn February 12th 2015 update effects LinkedIn applications between May 12th - May 19th, 2015. Maybe, your application affected today. I'm getting error after updating. Your application has not been authorized for the scope "r\_fullprofile". The update affected somethings. <https://developer.linkedin.com/support...
Figured it out! Not only on linkedin side, but also in your initializers you have to be careful with what you are asking for. So r\_fullprofile is not longer part of Linkedin API (you have to ask linkedin to be able to make it work). There are also other API things that no longer work (e.g. r\_connections), so be reall...
50,886,900
I'm trying to make a test for some of my students where they need to type in missing words from a paragraph (see picture). The key problem I'm hitting is trying to embed input boxes into a text paragraph, so that when there is a gap, tkinter can make an entry box for the student to type in. Sketch of desired Output: ...
2018/06/16
[ "https://Stackoverflow.com/questions/50886900", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9181800/" ]
You can add widgets to a text widget with the `window_create` method. Here's a quick example to show how you can use it to embed widgets into a block of text. The code inserts a string that contains `{}` wherever you want an entry widget. The code then searches for that pattern in the widget, deletes it, and inserts ...
You can insert entries in a text widget, example below. ``` import tkinter as tk root = tk.Tk() text = tk.Text(root) text.pack() text.insert('end', 'The largest ') question = tk.Entry(text, width=10) text.window_create('end', window=question) text.insert('end', ' in the human body is...') root.mainloop() ```
14,527,237
We have a website running and my boss wanted to use a WordPress website as a cover. I am trying to create a log in in WordPress using our existing user database. So that when the user log in in WordPress, they will be redirect to our current website. Any suggestions on how should I approach this? I tried using jQuer...
2013/01/25
[ "https://Stackoverflow.com/questions/14527237", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2011844/" ]
Thanks, I've found the problem. My resource identifier `R.id.listItem_date` is declared as `@+id/listItem.date` in my resource xml file. Android seems to convert the "." in the name to an "\_" in the generated R file. This works fine when compiling and running the code but apparently robolectric has problems with thi...
Please see the following changes ``` LayoutInflater inflater = (LayoutInflater)**"ContextOnject"**.getSystemService(Context.LAYOUT_INFLATER_SERVICE); View layout = inflater.inflate(R.layout.timeline_list_item, null); ```
29,252,113
I am using [PredicateBuilder](http://www.albahari.com/nutshell/predicatebuilder.aspx) to build reusable expressions as return values of objects. For example: ``` public interface ISurveyEligibilityCriteria { Expression<Func<Client, bool>> GetEligibilityExpression(); } ``` I want to have automated tests that dete...
2015/03/25
[ "https://Stackoverflow.com/questions/29252113", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1860652/" ]
You can create a LINQ statement containing the expression and then check whether it can be translated without actually executing it: ``` var connString = @"server=x;database=x"; using(var db = new MyContext(connString)) { // ToString() shows the generated SQL string. var sql = db.Entities.Where(generatedExpres...
A very simple solution is executing it: ``` using (var context = ...) { // The query will return null, but will be executed. context.Clients.Where(GetEligibilityExpression()) .Where(() => false) .SingleOrDefault(); } ``` In older versions of EF (or using `ObjectContext`...
35,828,328
I am using Swashbuckle (swagger for C#) with my Web API. I have several GET End-Points that return lists and I allow the user to add a perpage and page params into the QueryString Example: <http://myapi.com/endpoint/?page=5&perpage=10> I see that swagger does support parameter in 'query' but how do I get Swashbuckle ...
2016/03/06
[ "https://Stackoverflow.com/questions/35828328", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4202984/" ]
You can achieve that quite easily. Suppose you have an `ItemsController` with an action like this: ``` [Route("/api/items/{id}")] public IHttpActionResult Get(int id, int? page = null, int? perpage = null) { // some relevant code return Ok(); } ``` Swashbuckle will generate this specification (only showing rel...
There's some comments here regarding missing information on the SwaggerParametersAttributeHandler. It is an operation filter to help you determine what to do to your attributes. Here's an example handler I used that allows me to override nullable parameters' required fields using the SwaggerParameterAttribute. ``` pu...
35,828,328
I am using Swashbuckle (swagger for C#) with my Web API. I have several GET End-Points that return lists and I allow the user to add a perpage and page params into the QueryString Example: <http://myapi.com/endpoint/?page=5&perpage=10> I see that swagger does support parameter in 'query' but how do I get Swashbuckle ...
2016/03/06
[ "https://Stackoverflow.com/questions/35828328", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4202984/" ]
You can achieve that quite easily. Suppose you have an `ItemsController` with an action like this: ``` [Route("/api/items/{id}")] public IHttpActionResult Get(int id, int? page = null, int? perpage = null) { // some relevant code return Ok(); } ``` Swashbuckle will generate this specification (only showing rel...
Here is a summary of the steps required (ASP.Net Core 2.1, Swashbuckle.AspNetCore v4.0.1) for the Attribute method. I needed a parameter starting with "$" so optional parameters were not an option! SwaggerParameterAttribute.cs ``` [AttributeUsage(AttributeTargets.Method, Inherited = false, AllowMultiple = true)]...
35,828,328
I am using Swashbuckle (swagger for C#) with my Web API. I have several GET End-Points that return lists and I allow the user to add a perpage and page params into the QueryString Example: <http://myapi.com/endpoint/?page=5&perpage=10> I see that swagger does support parameter in 'query' but how do I get Swashbuckle ...
2016/03/06
[ "https://Stackoverflow.com/questions/35828328", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4202984/" ]
You can achieve that quite easily. Suppose you have an `ItemsController` with an action like this: ``` [Route("/api/items/{id}")] public IHttpActionResult Get(int id, int? page = null, int? perpage = null) { // some relevant code return Ok(); } ``` Swashbuckle will generate this specification (only showing rel...
I know this is old and all but I spent some time looking for the easier method and found it. So for anyone who also stumbles onto this old thread, here it is: ``` public async Task<IActionResult> Foo([FromQuery]YourDtoType dto) ```
35,828,328
I am using Swashbuckle (swagger for C#) with my Web API. I have several GET End-Points that return lists and I allow the user to add a perpage and page params into the QueryString Example: <http://myapi.com/endpoint/?page=5&perpage=10> I see that swagger does support parameter in 'query' but how do I get Swashbuckle ...
2016/03/06
[ "https://Stackoverflow.com/questions/35828328", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4202984/" ]
Here is a summary of the steps required (ASP.Net Core 2.1, Swashbuckle.AspNetCore v4.0.1) for the Attribute method. I needed a parameter starting with "$" so optional parameters were not an option! SwaggerParameterAttribute.cs ``` [AttributeUsage(AttributeTargets.Method, Inherited = false, AllowMultiple = true)]...
There's some comments here regarding missing information on the SwaggerParametersAttributeHandler. It is an operation filter to help you determine what to do to your attributes. Here's an example handler I used that allows me to override nullable parameters' required fields using the SwaggerParameterAttribute. ``` pu...
35,828,328
I am using Swashbuckle (swagger for C#) with my Web API. I have several GET End-Points that return lists and I allow the user to add a perpage and page params into the QueryString Example: <http://myapi.com/endpoint/?page=5&perpage=10> I see that swagger does support parameter in 'query' but how do I get Swashbuckle ...
2016/03/06
[ "https://Stackoverflow.com/questions/35828328", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4202984/" ]
Here is a summary of the steps required (ASP.Net Core 2.1, Swashbuckle.AspNetCore v4.0.1) for the Attribute method. I needed a parameter starting with "$" so optional parameters were not an option! SwaggerParameterAttribute.cs ``` [AttributeUsage(AttributeTargets.Method, Inherited = false, AllowMultiple = true)]...
I know this is old and all but I spent some time looking for the easier method and found it. So for anyone who also stumbles onto this old thread, here it is: ``` public async Task<IActionResult> Foo([FromQuery]YourDtoType dto) ```
34,870
My pro tools version is HD 10.3.7. When I arm and start recording, everything is working, the meters going up, wave form is bulit. And when I stop it, the wave form (aka. region) immediately disappears. This happens only to short recordings. (As far as my test goes, it happens to recordings under 4 seconds). However,...
2015/04/05
[ "https://sound.stackexchange.com/questions/34870", "https://sound.stackexchange.com", "https://sound.stackexchange.com/users/11447/" ]
Try this: click off pre-roll on transport window (CMND + 1)
PT has a pre-record period whereby it will display the waveform but not record until this period is over. Logic Pro also has this function and you can disable it in preferences.
14,809,861
I'm having trouble with reverse navigation on one of my entities. I have the following two objects: ``` public class Candidate { [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)] public long CandidateId { get; set; } .... // Reverse navigation public virtual CandidateData Data { get; s...
2013/02/11
[ "https://Stackoverflow.com/questions/14809861", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2056149/" ]
The One to One problem.... The issue is EF and CODE First, when 1:1 , for the dependent to have a Primary key that refers to the principal. ALthough you can define a DB otherwise and indeed with a DB you can even have OPTIONAL FK on the Primary. EF makes this restriction in Code first. Fair Enough I think... TRy this ...
I think that the foreign key should be created as: .Map(t => t.MapKey("CandidateDataId")) because thsi foreign key will be placed in Candidate table... Waht do you think?
19,615,784
I'm trying to run a simple batch file. ``` for /f %%a IN ('dir /b /s "%~dp0\EnsembleIndependant\*.mis"') DO (ECHO %%a >> ResultatVorace.txt & CALL vorace.exe -f %%a >> ResultatVorace.txt) ``` this only works if there is no space in the path of the batch file. the batch is in: C:\Users\Rafael\Documents\Visual Studi...
2013/10/27
[ "https://Stackoverflow.com/questions/19615784", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2453139/" ]
``` for /f "delims=" %%a IN ('dir /b /s "%~dp0EnsembleIndependant\*.mis"') DO (ECHO %%a >> ResultatVorace.txt & CALL vorace.exe -f %%a >> ResultatVorace.txt) ``` `%~dp0` has already a backspace at the end.
``` for /f "delims=" %%a IN ('dir /b /s "%~dp0\EnsembleIndependant\*.mis"') DO (ECHO %%a >> ResultatVorace.txt & CALL vorace.exe -f %%a >> ResultatVorace.txt) ``` space is a standard delimiter in batch for loops as well as `<tab>` and with `"delims="` you deactivate it.
19,615,784
I'm trying to run a simple batch file. ``` for /f %%a IN ('dir /b /s "%~dp0\EnsembleIndependant\*.mis"') DO (ECHO %%a >> ResultatVorace.txt & CALL vorace.exe -f %%a >> ResultatVorace.txt) ``` this only works if there is no space in the path of the batch file. the batch is in: C:\Users\Rafael\Documents\Visual Studi...
2013/10/27
[ "https://Stackoverflow.com/questions/19615784", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2453139/" ]
``` for /f "delims=" %%a IN ('dir /b /s "%~dp0EnsembleIndependant\*.mis"') DO (ECHO %%a >> ResultatVorace.txt & CALL vorace.exe -f %%a >> ResultatVorace.txt) ``` `%~dp0` has already a backspace at the end.
FOR /F uses as standard delimiters `space` and `tab`, to avoid this you need to add the options. ``` for /f "delims=" %%a IN ('dir /b /s "%~dp0\EnsembleIndependant\*.mis"') DO (ECHO %%a >> ResultatVorace.txt & CALL vorace.exe -f %%a >> ResultatVorace.txt) ```
4,764,553
I want to create computer for the word-game [Ghost](http://en.wikipedia.org/wiki/Ghost_%28game%29). However, I'm having problems thinking of a good way to deal with accessing the huge word list. Here's my current implementation (which doesn't work): ``` import os, random, sys, math, string def main(): #Contains ...
2011/01/21
[ "https://Stackoverflow.com/questions/4764553", "https://Stackoverflow.com", "https://Stackoverflow.com/users/372526/" ]
I would suggest not deleting words from your list. It will be extremely slow because deleting in the middle of a list is O(N). It is better to just make a new list. One possible way to do this is to replace the lines ``` for line in wordlist: if not line.startswith(word): wordlist.remove(line) ``` with ...
Peter Norvig has a great discussion on autocorrect here: <http://norvig.com/spell-correct.html> The large-list comprehension and context matching seem relevant - and at 21 lines it's a quick read (with good explanation following). Also check out the "Charming python" 3-part on functional programming with python (IBM)...
4,764,553
I want to create computer for the word-game [Ghost](http://en.wikipedia.org/wiki/Ghost_%28game%29). However, I'm having problems thinking of a good way to deal with accessing the huge word list. Here's my current implementation (which doesn't work): ``` import os, random, sys, math, string def main(): #Contains ...
2011/01/21
[ "https://Stackoverflow.com/questions/4764553", "https://Stackoverflow.com", "https://Stackoverflow.com/users/372526/" ]
Peter Norvig has a great discussion on autocorrect here: <http://norvig.com/spell-correct.html> The large-list comprehension and context matching seem relevant - and at 21 lines it's a quick read (with good explanation following). Also check out the "Charming python" 3-part on functional programming with python (IBM)...
If you want to work for ITA you'd be better off writing this in clisp... or clojure.
4,764,553
I want to create computer for the word-game [Ghost](http://en.wikipedia.org/wiki/Ghost_%28game%29). However, I'm having problems thinking of a good way to deal with accessing the huge word list. Here's my current implementation (which doesn't work): ``` import os, random, sys, math, string def main(): #Contains ...
2011/01/21
[ "https://Stackoverflow.com/questions/4764553", "https://Stackoverflow.com", "https://Stackoverflow.com/users/372526/" ]
I would suggest not deleting words from your list. It will be extremely slow because deleting in the middle of a list is O(N). It is better to just make a new list. One possible way to do this is to replace the lines ``` for line in wordlist: if not line.startswith(word): wordlist.remove(line) ``` with ...
If you want to work for ITA you'd be better off writing this in clisp... or clojure.
62,465,566
I am trying to first upload images to firebase then retrieving in in an activity(gallery) but getting a code error. ``` @Override public void onBindViewHolder(ImageViewHolder holder, int position) { ImageUploaderAdapter uploadCurrent = mUploads.get(position); holder.textViewName.setText(uploadCur...
2020/06/19
[ "https://Stackoverflow.com/questions/62465566", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13607439/" ]
matchTemplate wont work well in this case, as they need exact size and viewpoint match. Opencv Feature based method might work. You can try SIFT based method first. But the general assumption is that the rotation, translation, perspective changes are bounded. It means that for adjacent iamge pair, it can not be 1 tak...
For pixel-wise similarity, you may use `res = cv2.matchTemplate(img1, img2, cv2.TM_CCOEFF_NORMED) \\ similarity = res[0][0]`, which adopts standard corralation coefficient to evaluate simlarity (first assure two inputted image is in the same size). For chromatic similarity, you may calculate histogram of each image by...
15,795,748
I am hosting an ASP.NET MVC 4 site on AppHarbor (which uses Amazon EC2), and I'm using CloudFlare for Flexible SSL. I'm having a problem with redirect loops (310) when trying to use RequireHttps. The problem is that, like EC2, CloudFlare terminates the SSL before forwarding the request onto the server. However, whereas...
2013/04/03
[ "https://Stackoverflow.com/questions/15795748", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1141679/" ]
The `X-Forwarded-Proto` header is intentionally overridden by AppHarbor's load balancers to the actual scheme of the request. Note that while CloudFlare's flexible SSL option may add slightly more security, there is still unencrypted traffic travelling over the public internet from CloudFlare to AppHarbor. This arguab...
This is interesting. Just I recently had a discussion with one of our clients, who asked me about "flexible" SSL and suggested that we (Incapsula) also offer such option. After some discussion we both came to the conclusion that such a feature would be misleading, since it will provide the end-user with a false sens...
15,795,748
I am hosting an ASP.NET MVC 4 site on AppHarbor (which uses Amazon EC2), and I'm using CloudFlare for Flexible SSL. I'm having a problem with redirect loops (310) when trying to use RequireHttps. The problem is that, like EC2, CloudFlare terminates the SSL before forwarding the request onto the server. However, whereas...
2013/04/03
[ "https://Stackoverflow.com/questions/15795748", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1141679/" ]
The `X-Forwarded-Proto` header is intentionally overridden by AppHarbor's load balancers to the actual scheme of the request. Note that while CloudFlare's flexible SSL option may add slightly more security, there is still unencrypted traffic travelling over the public internet from CloudFlare to AppHarbor. This arguab...
Or you could just get a free one year SSL cert signed by StartCom and upload that to AppHarbor. Then you can call it a day and pat yourself on the back! That is until future you one year from now has to purchase a cert =).
27,343,087
I am developing an application which requires the youtube api. I am stuck at a point where i need the keywords of a youtube channel. I am getting all keywords in a string. ``` $string = 'php java "john smith" plugins'; ``` I am trying to get the above keywords in an array. I can use `explode(' ',$string)` but the p...
2014/12/07
[ "https://Stackoverflow.com/questions/27343087", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1015448/" ]
``` char *get_set(int size, char *set){// size : size of set as buffer size char ch; int i; for(i = 0; i < size-1 && (ch=getchar()) != '\n'; ){ if(!isspace(ch)) set[i++] = ch; } set[i] = '\0'; return set; } ```
You can use [getchar](http://linux.die.net/man/3/getchar): ``` while (((ch = getchar()) != '\n')) { if(!isspace(ch)) inset[i++] = ch; } ``` getchar reads the next character from stdin and returns it as an unsigned char cast to an int, or EOF on end of file or error.
27,343,087
I am developing an application which requires the youtube api. I am stuck at a point where i need the keywords of a youtube channel. I am getting all keywords in a string. ``` $string = 'php java "john smith" plugins'; ``` I am trying to get the above keywords in an array. I can use `explode(' ',$string)` but the p...
2014/12/07
[ "https://Stackoverflow.com/questions/27343087", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1015448/" ]
``` char *get_set(int size, char *set){// size : size of set as buffer size char ch; int i; for(i = 0; i < size-1 && (ch=getchar()) != '\n'; ){ if(!isspace(ch)) set[i++] = ch; } set[i] = '\0'; return set; } ```
once try these, char \* ``` get_set(char *set) { char inset[SETSIZ]; char ch = ' '; int i = 0; while(ch != '\n'){ if(ch!=32)// ASCII 32 for whitespaces inset[i] = scanf(" %c", &ch); i++; } set[strlen(inset)] = '\0'; return (set); } ```
25,382,103
I have created a Login page using MVC Razor. The page contains a User name & Password to be entered and two button Login and SignUp button. I have applied required field validation for both textboxes. It works fine when i click Login button. For Signup button i want the page to be redirected to signup page. But when i...
2014/08/19
[ "https://Stackoverflow.com/questions/25382103", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3211705/" ]
Take `Signup` button as **input type button** not **input type submit** as shown :- ``` <input type="button" value="SignUp" name="Command" class="loginBtn" id="SignUpBtn" /> ``` and use some **Jquery/Javascript** to go to `SignUp Page` as :- ``` $("#SignUpBtn").click(function(){ window.location.href="/SignUp/Sig...
There are several ways. 1. Can't you put "SignUp" as link and use css to appear like button. 2. wrap "SingUp" button around a separate form ``` <form action="/signup" method="get"> <input type="submit" /> </form> ``` 1. Or As suggested use button with value property. u can use js to redirect or in controller u...
25,382,103
I have created a Login page using MVC Razor. The page contains a User name & Password to be entered and two button Login and SignUp button. I have applied required field validation for both textboxes. It works fine when i click Login button. For Signup button i want the page to be redirected to signup page. But when i...
2014/08/19
[ "https://Stackoverflow.com/questions/25382103", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3211705/" ]
You can simply add a cancel class to the button that does not need the validation as follows: ``` <input type="submit" value="SignUp" name="Command" class="loginBtn cancel" /> ``` This will circumvent validation, provided you are using the built in jQuery unobtrusive validation.
There are several ways. 1. Can't you put "SignUp" as link and use css to appear like button. 2. wrap "SingUp" button around a separate form ``` <form action="/signup" method="get"> <input type="submit" /> </form> ``` 1. Or As suggested use button with value property. u can use js to redirect or in controller u...
11,838
My website can only be accessed by authenticated users. How can I automatically make the author's name the user's name without giving users the option to input anything else in the name field?
2011/09/22
[ "https://drupal.stackexchange.com/questions/11838", "https://drupal.stackexchange.com", "https://drupal.stackexchange.com/users/1273/" ]
Custom datepicker options are now supported (as of Date module version 7.x-2.6) by setting the necessary values with `#datepicker_options`. Alex's use case of a custom form element to display only future dates would look like this: ``` $form['date'] = array( '#prefix'=>t('When do you want to start the featured campa...
As far as I know by default you do not have such option. The easiest way would be just to check it in validate function, and return an error if selected date is not from future. On the other hand, a quick Google search returned for example this question - [how to restrict the user to enter only today to future dates. ...
11,838
My website can only be accessed by authenticated users. How can I automatically make the author's name the user's name without giving users the option to input anything else in the name field?
2011/09/22
[ "https://drupal.stackexchange.com/questions/11838", "https://drupal.stackexchange.com", "https://drupal.stackexchange.com/users/1273/" ]
Date use Jquery DatePicker: <https://jqueryui.com/datepicker/#min-max> Then, We must do that from javascript: ``` $(function () { $("#myIdinputDatePicker").datepicker({ minDate: -0, maxDate: "+1M +10D" }); }); ``` That's it, leaving the Drupal World.
As far as I know by default you do not have such option. The easiest way would be just to check it in validate function, and return an error if selected date is not from future. On the other hand, a quick Google search returned for example this question - [how to restrict the user to enter only today to future dates. ...
11,838
My website can only be accessed by authenticated users. How can I automatically make the author's name the user's name without giving users the option to input anything else in the name field?
2011/09/22
[ "https://drupal.stackexchange.com/questions/11838", "https://drupal.stackexchange.com", "https://drupal.stackexchange.com/users/1273/" ]
Custom datepicker options are now supported (as of Date module version 7.x-2.6) by setting the necessary values with `#datepicker_options`. Alex's use case of a custom form element to display only future dates would look like this: ``` $form['date'] = array( '#prefix'=>t('When do you want to start the featured campa...
Date use Jquery DatePicker: <https://jqueryui.com/datepicker/#min-max> Then, We must do that from javascript: ``` $(function () { $("#myIdinputDatePicker").datepicker({ minDate: -0, maxDate: "+1M +10D" }); }); ``` That's it, leaving the Drupal World.
2,646,463
I have a XMLDocument like: ``` <Folder name="test"> <Folder name="test2"> <File>TestFile</File> </Folder> </Folder> ``` I want only the folder´s, not the files. So, how to delete / manipulate the XML Document in c# to delete / remove ALL elements in the document? Thanks!
2010/04/15
[ "https://Stackoverflow.com/questions/2646463", "https://Stackoverflow.com", "https://Stackoverflow.com/users/298926/" ]
If you can use `XDocument` and LINQ, you can do ``` XDocument doc = XDocument.Load(filename) // or XDocument.Parse(string) doc.Root.Descendants().Where(e => e.Name == "File").Remove(); ``` -- edited out an error
To remove a node from an `XMLDocument` (see Jens' answer for remove node form `XDocument`) ``` XmlDocument doc = XmlDocument.Load(filename); // or XmlDocument.LoadXml(string) XmlNodeList nodes = doc.SelectNodes("//file"); foreach(XmlNode node in nodes) { node.ParentNode.RemoveChild(node); } ``` Watch for the poss...
45,041,702
My Application wants to Request for Wifi Permission on the start.So far I have managed to give permission through **Setting**.But I don't want to Do that anymore.So far I have seen this previous [Question](https://stackoverflow.com/questions/40301628/how-to-request-permissions-during-run-time-when-using-gluon-mobile-en...
2017/07/11
[ "https://Stackoverflow.com/questions/45041702", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7315145/" ]
The Android Developers Website has a great walkthrough example on how runtime permissions work here: <https://developer.android.com/training/permissions/requesting.html> Also don't forget to add the permissions into your manifest as well.
Heavily based on this [answer](https://stackoverflow.com/questions/40301628/how-to-request-permissions-during-run-time-when-using-gluon-mobile-environment/40370076?noredirect=1#comment77053866_40370076), I created the following class to request permissions on the app start when android version >= Marshmallow: ``` publ...
45,041,702
My Application wants to Request for Wifi Permission on the start.So far I have managed to give permission through **Setting**.But I don't want to Do that anymore.So far I have seen this previous [Question](https://stackoverflow.com/questions/40301628/how-to-request-permissions-during-run-time-when-using-gluon-mobile-en...
2017/07/11
[ "https://Stackoverflow.com/questions/45041702", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7315145/" ]
You have ask for the permission at run time: ``` if (ContextCompat.checkSelfPermission(thisActivity,Manifest.permission.READ_EXTERNAL_STORAGE)!= PackageManager.PERMISSION_GRANTED) { if (ActivityCompat.shouldShowRequestPermissionRationale(thisActivity, Manifest.permission.READ_EXTERNAL_STORAGE)) { // Show...
Heavily based on this [answer](https://stackoverflow.com/questions/40301628/how-to-request-permissions-during-run-time-when-using-gluon-mobile-environment/40370076?noredirect=1#comment77053866_40370076), I created the following class to request permissions on the app start when android version >= Marshmallow: ``` publ...
45,062,106
So i have two different queries as follows: ``` Query1 CPT Resource 1 2 3 4 5 2017-06-12 RM1 5.00 5.00 4.00 4.00 2.00 2017-06-12 RM2 3.00 6.00 4.00 7.00 4.00 2017-06-12 RM3 3.00 4.00 6.00 8.00 6.00 2017-06-13 RM1 3.00 7.00 ...
2017/07/12
[ "https://Stackoverflow.com/questions/45062106", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8249331/" ]
Just join for the key field and use `ABS()` to return a positive result. ``` SELECT Q1.CPT, Q1.Resource, ABS(Q1.[1] * Q2.[1]) as [1], ABS(Q1.[2] * Q2.[2]) as [2], ABS(Q1.[3] * Q2.[3]) as [3], ABS(Q1.[4] * Q2.[4]) as [4], ABS(Q1.[5] * Q2.[5]) as [5] FROM Query1 Q1 JOIN Query2 ...
You need to join on CPT and Resource, returning table1.1 \* table2.1 as 1, like so: ``` SELECT t1.1 * t2.1 as 1 from t1 join t2 on t1.CPT = t2.CPT and t1.Resource = t2.Resource ```
45,062,106
So i have two different queries as follows: ``` Query1 CPT Resource 1 2 3 4 5 2017-06-12 RM1 5.00 5.00 4.00 4.00 2.00 2017-06-12 RM2 3.00 6.00 4.00 7.00 4.00 2017-06-12 RM3 3.00 4.00 6.00 8.00 6.00 2017-06-13 RM1 3.00 7.00 ...
2017/07/12
[ "https://Stackoverflow.com/questions/45062106", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8249331/" ]
Just join for the key field and use `ABS()` to return a positive result. ``` SELECT Q1.CPT, Q1.Resource, ABS(Q1.[1] * Q2.[1]) as [1], ABS(Q1.[2] * Q2.[2]) as [2], ABS(Q1.[3] * Q2.[3]) as [3], ABS(Q1.[4] * Q2.[4]) as [4], ABS(Q1.[5] * Q2.[5]) as [5] FROM Query1 Q1 JOIN Query2 ...
you can use simple join as below ``` Select q1.CPT, q1.[Resource] , [1] = abs(q1.[1]*q2.[1]) , [2] = abs(q1.[2]*q2.[2]) , [3] = abs(q1.[3]*q2.[3]) , [4] = abs(q1.[4]*q2.[4]) , [5] = abs(q1.[5]*q2.[5]) from Query1 q1 join Query2 q2 on q1.CPT = q2.CPT and q1.[Resource] = q2.[Re...
45,062,106
So i have two different queries as follows: ``` Query1 CPT Resource 1 2 3 4 5 2017-06-12 RM1 5.00 5.00 4.00 4.00 2.00 2017-06-12 RM2 3.00 6.00 4.00 7.00 4.00 2017-06-12 RM3 3.00 4.00 6.00 8.00 6.00 2017-06-13 RM1 3.00 7.00 ...
2017/07/12
[ "https://Stackoverflow.com/questions/45062106", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8249331/" ]
Just join for the key field and use `ABS()` to return a positive result. ``` SELECT Q1.CPT, Q1.Resource, ABS(Q1.[1] * Q2.[1]) as [1], ABS(Q1.[2] * Q2.[2]) as [2], ABS(Q1.[3] * Q2.[3]) as [3], ABS(Q1.[4] * Q2.[4]) as [4], ABS(Q1.[5] * Q2.[5]) as [5] FROM Query1 Q1 JOIN Query2 ...
Assuming that you have two tables in question as t1 and t2 then your query should be ``` select t1.CPT, t1.resource, ABS(t1.[1]*t2.[1]) as [1], ABS(t1.[2]*t2.[2]) as [2], ABS(t1.[3]*t2.[3]) as [3], ABS(t1.[4]*t2.[4]) as [4], ABS(t1.[5]*t2.[5]) as [5] from t1 join t2 on t1.CPT=...