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
33,194,640
To build an exact and reliable Alarm in Android OS 6, aka Marshmallow, I am forced to use [setAlarmClock](http://developer.android.com/reference/android/app/AlarmManager.html#setAlarmClock(android.app.AlarmManager.AlarmClockInfo,%20android.app.PendingIntent)) method of AlarmManager. The problem is this method displays ...
2015/10/18
[ "https://Stackoverflow.com/questions/33194640", "https://Stackoverflow.com", "https://Stackoverflow.com/users/305135/" ]
You need to use `setExactAndAllowWhileIdle()`. If your app is not ignoring optimizations, you have 10 seconds to achieve your goal. If you need more time, a partial wakelock and/or internet access, you need to add the permission to request to the users to ignore optimizations.
If I understood you correctly you want to use the `AlarmManager` to schedule a task at midnight without displaying the UI clock. You can use [`AlarmManager#set`](https://developer.android.com/reference/android/app/AlarmManager.html#set(int,%20long,%20android.app.PendingIntent)) this will not display the clock. e.g. ``...
33,194,640
To build an exact and reliable Alarm in Android OS 6, aka Marshmallow, I am forced to use [setAlarmClock](http://developer.android.com/reference/android/app/AlarmManager.html#setAlarmClock(android.app.AlarmManager.AlarmClockInfo,%20android.app.PendingIntent)) method of AlarmManager. The problem is this method displays ...
2015/10/18
[ "https://Stackoverflow.com/questions/33194640", "https://Stackoverflow.com", "https://Stackoverflow.com/users/305135/" ]
Unfortunately, this is completely intentional design by the Android developers in order to save battery. This motive becomes clear when you look through the documentation for AlarmManager methods. For example, this quote is taken from the documentation on [`AlarmManager#setExactAndAllowWhileIdle`](https://developer.and...
If I understood you correctly you want to use the `AlarmManager` to schedule a task at midnight without displaying the UI clock. You can use [`AlarmManager#set`](https://developer.android.com/reference/android/app/AlarmManager.html#set(int,%20long,%20android.app.PendingIntent)) this will not display the clock. e.g. ``...
61,647,282
I have a react-table component that displays some game data. The component uses hooks to set state like this: ``` const [data, setData] = React.useState([]); React.useEffect(() => { gameData(false).then(res => { setData(res.data); }); }, []); ``` Inside my table, I have a button that adds or removes...
2020/05/06
[ "https://Stackoverflow.com/questions/61647282", "https://Stackoverflow.com", "https://Stackoverflow.com/users/880874/" ]
You have to let the effect know when you want it to run. The empty bracket is basically like using onMount so by adding the data to it will refresh when data is changed. ``` const [data, setData] = React.useState([]); React.useEffect(() => { gameData(false).then(res => { setData(res.data); }); }, [data...
``` setData(data); ``` This just sets the data you already have because the `data` variable hasn't changed. Did you mean to set the new data returned by your PUT request? If so you need to `await` the request, and then set the new state. You probably want something like: ``` const newData = await axios({ metho...
52,554,628
I got following error on liver server but on local server its work fine ``` 'Datatables' => Yajra\Datatables\Facades\Datatables::class, ```
2018/09/28
[ "https://Stackoverflow.com/questions/52554628", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10416853/" ]
Case problem try: ``` 'DataTables' => Yajra\DataTables\Facades\DataTables::class, ```
The problem is case of letters: ``` 'DataTables' => Yajra\DataTables\Facades\DataTables::class ``` Linux filesystem is case-sensitive, and you have 3 times`Datatables` instead of `DataTables`
1,175,380
I'm using a dynamic jQuery tab widget to add/remove tabs generated programmatically. How do I check through jQuery and count how many existing tabs are present in the widget? I'm using this code, but it doesn't work: ``` $('#container-1 > ul').tabs('add', tabName, name); var newTab; if ($('#container-1 > li').size...
2009/07/24
[ "https://Stackoverflow.com/questions/1175380", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Just use the below code ``` $('#selector >ul >li').size(); ``` where "#selector" is the selector you have used to create the tabs. **UPDATE** `size()` function doesn't exist any more, now the solution is: ``` $('#selector >ul >li').length; ```
``` var tabCount = $(tabContainer).tabs("length"); ```
67,439,993
I have a Gradle project being run from the latest version of IntelliJ IDEA (2021.1.1 Ultimate Edition). The project has a Java class with a main method that outputs its results to the console. When I run this main method from IntelliJ IDEA, outputs the results of the program in the "Run" tab. However, it also outputs ...
2021/05/07
[ "https://Stackoverflow.com/questions/67439993", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1108305/" ]
There is no way to hide Gradle build output when running in this mode. The only way is to disable Gradle run delegation so that app is started directly by IntelliJ IDEA. [![no delegation](https://i.stack.imgur.com/KNX8W.png)](https://i.stack.imgur.com/KNX8W.png) Hiding the command line and the exit code is also [not...
Old question, but for anybody still interested to just get the output of the script, you can use the --quiet flag (<https://docs.gradle.org/current/userguide/logging.html>) So having this in the `build.gradle` : ``` task(run, dependsOn: 'classes', type: JavaExec) { main = 'com.multimodule.module.MainClass' cl...
16,805,306
I have some problem using ajax. How can I assign all result from ajax into outside variable ? I google it up and found this code.. ``` var return_first = (function () { var tmp = null; $.ajax({ 'async': false, 'type': "POST", 'global': false, 'dataType': 'html', 'url':...
2013/05/29
[ "https://Stackoverflow.com/questions/16805306", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1768052/" ]
So this is long after the initial question, and technically it isn't a direct answer to how to use Ajax call to populate exterior variable as the question asks. However in research and responses it's been found to be extremely difficult to do this without disabling asynchronous functions within the call, or by descendi...
I solved it by doing like that: ``` var return_first = (function () { var tmp = $.ajax({ 'type': "POST", 'dataType': 'html', 'url': "ajax.php?first", 'data': { 'request': "", 'target': arrange_url, 'method': method_target }, 'suc...
16,805,306
I have some problem using ajax. How can I assign all result from ajax into outside variable ? I google it up and found this code.. ``` var return_first = (function () { var tmp = null; $.ajax({ 'async': false, 'type': "POST", 'global': false, 'dataType': 'html', 'url':...
2013/05/29
[ "https://Stackoverflow.com/questions/16805306", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1768052/" ]
You are missing a comma after ``` 'data': { 'request': "", 'target': 'arrange_url', 'method': 'method_target' } ``` Also, if you want `return_first` to hold the result of your anonymous function, you need to make a function call: ``` var return_first = function () { var tmp = null; $.ajax({ 'async':...
This is all you need to do: ``` var myVariable; $.ajax({ 'async': false, 'type': "POST", 'global': false, 'dataType': 'html', 'url': "ajax.php?first", 'data': { 'request': "", 'target': 'arrange_url', 'method': 'method_target' }, 'success': function (data) { myVariable = data; ...
16,805,306
I have some problem using ajax. How can I assign all result from ajax into outside variable ? I google it up and found this code.. ``` var return_first = (function () { var tmp = null; $.ajax({ 'async': false, 'type': "POST", 'global': false, 'dataType': 'html', 'url':...
2013/05/29
[ "https://Stackoverflow.com/questions/16805306", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1768052/" ]
You are missing a comma after ``` 'data': { 'request': "", 'target': 'arrange_url', 'method': 'method_target' } ``` Also, if you want `return_first` to hold the result of your anonymous function, you need to make a function call: ``` var return_first = function () { var tmp = null; $.ajax({ 'async':...
So this is long after the initial question, and technically it isn't a direct answer to how to use Ajax call to populate exterior variable as the question asks. However in research and responses it's been found to be extremely difficult to do this without disabling asynchronous functions within the call, or by descendi...
16,805,306
I have some problem using ajax. How can I assign all result from ajax into outside variable ? I google it up and found this code.. ``` var return_first = (function () { var tmp = null; $.ajax({ 'async': false, 'type': "POST", 'global': false, 'dataType': 'html', 'url':...
2013/05/29
[ "https://Stackoverflow.com/questions/16805306", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1768052/" ]
I have changed previous response a little and this solution have been working for me. ``` function searchlipcutforbrace(cs,id_pff,wt,ofl){ var params = { "cs" : cs, "id" : id_pff, "wt" : wt, "ofl" : ofl } var response = $.ajax({ data: params, ...
I solved it by doing like that: ``` var return_first = (function () { var tmp = $.ajax({ 'type': "POST", 'dataType': 'html', 'url': "ajax.php?first", 'data': { 'request': "", 'target': arrange_url, 'method': method_target }, 'suc...
16,805,306
I have some problem using ajax. How can I assign all result from ajax into outside variable ? I google it up and found this code.. ``` var return_first = (function () { var tmp = null; $.ajax({ 'async': false, 'type': "POST", 'global': false, 'dataType': 'html', 'url':...
2013/05/29
[ "https://Stackoverflow.com/questions/16805306", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1768052/" ]
This is all you need to do: ``` var myVariable; $.ajax({ 'async': false, 'type': "POST", 'global': false, 'dataType': 'html', 'url': "ajax.php?first", 'data': { 'request': "", 'target': 'arrange_url', 'method': 'method_target' }, 'success': function (data) { myVariable = data; ...
`'async': false` says it's depreciated. I did notice if I run `console.log('test1');` on ajax success, then `console.log('test2');` in normal js after the ajax function, `test2` prints before `test1` so the issue is an ajax call has a small delay, but doesn't stop the rest of the function to get results. The variable s...
16,805,306
I have some problem using ajax. How can I assign all result from ajax into outside variable ? I google it up and found this code.. ``` var return_first = (function () { var tmp = null; $.ajax({ 'async': false, 'type': "POST", 'global': false, 'dataType': 'html', 'url':...
2013/05/29
[ "https://Stackoverflow.com/questions/16805306", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1768052/" ]
You are missing a comma after ``` 'data': { 'request': "", 'target': 'arrange_url', 'method': 'method_target' } ``` Also, if you want `return_first` to hold the result of your anonymous function, you need to make a function call: ``` var return_first = function () { var tmp = null; $.ajax({ 'async':...
Using **'async': false** to prevent asynchronous code is a bad practice, > > Synchronous XMLHttpRequest on the main thread is deprecated because of > its detrimental effects to the end user's experience. <https://xhr.spec.whatwg.org/> > > > On the surface setting async to false fixes a lot of issues because, as ...
16,805,306
I have some problem using ajax. How can I assign all result from ajax into outside variable ? I google it up and found this code.. ``` var return_first = (function () { var tmp = null; $.ajax({ 'async': false, 'type': "POST", 'global': false, 'dataType': 'html', 'url':...
2013/05/29
[ "https://Stackoverflow.com/questions/16805306", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1768052/" ]
Using **'async': false** to prevent asynchronous code is a bad practice, > > Synchronous XMLHttpRequest on the main thread is deprecated because of > its detrimental effects to the end user's experience. <https://xhr.spec.whatwg.org/> > > > On the surface setting async to false fixes a lot of issues because, as ...
`'async': false` says it's depreciated. I did notice if I run `console.log('test1');` on ajax success, then `console.log('test2');` in normal js after the ajax function, `test2` prints before `test1` so the issue is an ajax call has a small delay, but doesn't stop the rest of the function to get results. The variable s...
16,805,306
I have some problem using ajax. How can I assign all result from ajax into outside variable ? I google it up and found this code.. ``` var return_first = (function () { var tmp = null; $.ajax({ 'async': false, 'type': "POST", 'global': false, 'dataType': 'html', 'url':...
2013/05/29
[ "https://Stackoverflow.com/questions/16805306", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1768052/" ]
I have changed previous response a little and this solution have been working for me. ``` function searchlipcutforbrace(cs,id_pff,wt,ofl){ var params = { "cs" : cs, "id" : id_pff, "wt" : wt, "ofl" : ofl } var response = $.ajax({ data: params, ...
`'async': false` says it's depreciated. I did notice if I run `console.log('test1');` on ajax success, then `console.log('test2');` in normal js after the ajax function, `test2` prints before `test1` so the issue is an ajax call has a small delay, but doesn't stop the rest of the function to get results. The variable s...
16,805,306
I have some problem using ajax. How can I assign all result from ajax into outside variable ? I google it up and found this code.. ``` var return_first = (function () { var tmp = null; $.ajax({ 'async': false, 'type': "POST", 'global': false, 'dataType': 'html', 'url':...
2013/05/29
[ "https://Stackoverflow.com/questions/16805306", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1768052/" ]
You are missing a comma after ``` 'data': { 'request': "", 'target': 'arrange_url', 'method': 'method_target' } ``` Also, if you want `return_first` to hold the result of your anonymous function, you need to make a function call: ``` var return_first = function () { var tmp = null; $.ajax({ 'async':...
I have changed previous response a little and this solution have been working for me. ``` function searchlipcutforbrace(cs,id_pff,wt,ofl){ var params = { "cs" : cs, "id" : id_pff, "wt" : wt, "ofl" : ofl } var response = $.ajax({ data: params, ...
16,805,306
I have some problem using ajax. How can I assign all result from ajax into outside variable ? I google it up and found this code.. ``` var return_first = (function () { var tmp = null; $.ajax({ 'async': false, 'type': "POST", 'global': false, 'dataType': 'html', 'url':...
2013/05/29
[ "https://Stackoverflow.com/questions/16805306", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1768052/" ]
Using **'async': false** to prevent asynchronous code is a bad practice, > > Synchronous XMLHttpRequest on the main thread is deprecated because of > its detrimental effects to the end user's experience. <https://xhr.spec.whatwg.org/> > > > On the surface setting async to false fixes a lot of issues because, as ...
I solved it by doing like that: ``` var return_first = (function () { var tmp = $.ajax({ 'type': "POST", 'dataType': 'html', 'url': "ajax.php?first", 'data': { 'request': "", 'target': arrange_url, 'method': method_target }, 'suc...
20,863,061
I am trying to set up some css selectors, and I need to set up several that I want to be ignored in IE8 (actually any IE < IE9, but that's ok). Which selector can I safely use knowing that all browsers (including IE9) support the selector but IE8 fails? In other words, I am looking to do something like ``` .somesele...
2013/12/31
[ "https://Stackoverflow.com/questions/20863061", "https://Stackoverflow.com", "https://Stackoverflow.com/users/187835/" ]
There's so many things that ie doesn't handle, I generally do this: .no-boxshadow .classname {border:1px solid #ddd} Go to <http://caniuse.com/> to see what IE 8 doesn't handle. The problem with VenomVendor's answer is that .noie .mystyle is relying on javascript to be enabled to use it for the majority of browsers,...
add `noie` class for browsers higher than IE8 & other broswers. ``` <!DOCTYPE html> <!--[if lt IE 8]><html lang="en" class="no-js dumbie"><![endif]--> <!--[if (gt IE 8)|!(IE)]><!--> <html class="no-js noie" lang="en"> <!--<![endif]--> <head> .noie .mystyle { stuff for new browsers } ```
20,863,061
I am trying to set up some css selectors, and I need to set up several that I want to be ignored in IE8 (actually any IE < IE9, but that's ok). Which selector can I safely use knowing that all browsers (including IE9) support the selector but IE8 fails? In other words, I am looking to do something like ``` .somesele...
2013/12/31
[ "https://Stackoverflow.com/questions/20863061", "https://Stackoverflow.com", "https://Stackoverflow.com/users/187835/" ]
add `noie` class for browsers higher than IE8 & other broswers. ``` <!DOCTYPE html> <!--[if lt IE 8]><html lang="en" class="no-js dumbie"><![endif]--> <!--[if (gt IE 8)|!(IE)]><!--> <html class="no-js noie" lang="en"> <!--<![endif]--> <head> .noie .mystyle { stuff for new browsers } ```
To answer the original question, IE8 does not support the `canvas` element. Modernizr will add the `canvas` class to the `<html>` tag for modern browsers, and alternatively, it will add the `no-canvas` class for IE8 and below. Therefore, you could do this to target modern browsers: ``` .canvas .my-checkbox-style { /* ...
20,863,061
I am trying to set up some css selectors, and I need to set up several that I want to be ignored in IE8 (actually any IE < IE9, but that's ok). Which selector can I safely use knowing that all browsers (including IE9) support the selector but IE8 fails? In other words, I am looking to do something like ``` .somesele...
2013/12/31
[ "https://Stackoverflow.com/questions/20863061", "https://Stackoverflow.com", "https://Stackoverflow.com/users/187835/" ]
add `noie` class for browsers higher than IE8 & other broswers. ``` <!DOCTYPE html> <!--[if lt IE 8]><html lang="en" class="no-js dumbie"><![endif]--> <!--[if (gt IE 8)|!(IE)]><!--> <html class="no-js noie" lang="en"> <!--<![endif]--> <head> .noie .mystyle { stuff for new browsers } ```
I've found that **ES5 array methods** work for detecting IE8 and lower. I happened to use the forEach in my code. <http://caniuse.com/#search=ECMAScript%205> Using **Modernizr** you can check `.no-es5array` or `.es5array` in CSS and `Modernizr.es5array` in JS. <https://modernizr.com/download?es5array-dontmin-setclasse...
20,863,061
I am trying to set up some css selectors, and I need to set up several that I want to be ignored in IE8 (actually any IE < IE9, but that's ok). Which selector can I safely use knowing that all browsers (including IE9) support the selector but IE8 fails? In other words, I am looking to do something like ``` .somesele...
2013/12/31
[ "https://Stackoverflow.com/questions/20863061", "https://Stackoverflow.com", "https://Stackoverflow.com/users/187835/" ]
There's so many things that ie doesn't handle, I generally do this: .no-boxshadow .classname {border:1px solid #ddd} Go to <http://caniuse.com/> to see what IE 8 doesn't handle. The problem with VenomVendor's answer is that .noie .mystyle is relying on javascript to be enabled to use it for the majority of browsers,...
To answer the original question, IE8 does not support the `canvas` element. Modernizr will add the `canvas` class to the `<html>` tag for modern browsers, and alternatively, it will add the `no-canvas` class for IE8 and below. Therefore, you could do this to target modern browsers: ``` .canvas .my-checkbox-style { /* ...
20,863,061
I am trying to set up some css selectors, and I need to set up several that I want to be ignored in IE8 (actually any IE < IE9, but that's ok). Which selector can I safely use knowing that all browsers (including IE9) support the selector but IE8 fails? In other words, I am looking to do something like ``` .somesele...
2013/12/31
[ "https://Stackoverflow.com/questions/20863061", "https://Stackoverflow.com", "https://Stackoverflow.com/users/187835/" ]
There's so many things that ie doesn't handle, I generally do this: .no-boxshadow .classname {border:1px solid #ddd} Go to <http://caniuse.com/> to see what IE 8 doesn't handle. The problem with VenomVendor's answer is that .noie .mystyle is relying on javascript to be enabled to use it for the majority of browsers,...
I've found that **ES5 array methods** work for detecting IE8 and lower. I happened to use the forEach in my code. <http://caniuse.com/#search=ECMAScript%205> Using **Modernizr** you can check `.no-es5array` or `.es5array` in CSS and `Modernizr.es5array` in JS. <https://modernizr.com/download?es5array-dontmin-setclasse...
48,202,067
I have created a Sample App for Windows (UWP) and registered an URL scheme **myscheme** It has a WebView with source as my custom URL like ``` http//:192.168.1.25:8080/dummywebsite.html ``` To open App I am using win+r and type **myscheme://hello** and app gets open I am handling close app with this URL **mys...
2018/01/11
[ "https://Stackoverflow.com/questions/48202067", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3625215/" ]
The problem is that the `WebView` control runs an embedded version of `Edge`, which is "technically" not the same application and that causes the popup. A better solution would be to invoke C# code directly from JS. You can do that using Web allowed object. This is an instance of a special Windows Runtime class, that ...
I have added WebView1\_ScriptNotify method which is invoked whenever window.external.notify(param); is called from UI ``` // Add in MainPage.xaml.cs void WebView1_ScriptNotify(object sender, NotifyEventArgs e) { if (e.Value != null && e.Value.Contains("close")) { global::Windows.UI.Xaml.Application.Cur...
66,928,753
Following is a code I implemented to create a bar chart using chart js in React app. Here it creates a bar chart with all the data in an array. But, I want to change this code only to give the output in the x-axis - destination, y-axis - no. of occurrence of this destination since it has many repeated destinations. I s...
2021/04/03
[ "https://Stackoverflow.com/questions/66928753", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I ended up using [kbumsik/opus-media-recorder](https://github.com/kbumsik/opus-media-recorder), solved the issue for me. A drop-in replacement for MediaRecorder.
You need to set the `mimeType` of the `MediaRecorder`. Otherwise the browser will pick whatever format it likes best to encode the media. ``` let mediaRecorder = new MediaRecorder(stream, { mimeType: 'my/mimetype' }); ``` To be sure that the browser can actually encode the format you want you could use `isTypeSuppor...
66,928,753
Following is a code I implemented to create a bar chart using chart js in React app. Here it creates a bar chart with all the data in an array. But, I want to change this code only to give the output in the x-axis - destination, y-axis - no. of occurrence of this destination since it has many repeated destinations. I s...
2021/04/03
[ "https://Stackoverflow.com/questions/66928753", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
You need to remove the VideoTrack from your MediaStream: ```js const input = document.querySelector("video"); const stop_btn = document.querySelector("button"); input.onplaying = (evt) => { input.onplaying = null; console.clear(); const stream = input.captureStream ? input.captureStream() : input.mozCaptureStrea...
You need to set the `mimeType` of the `MediaRecorder`. Otherwise the browser will pick whatever format it likes best to encode the media. ``` let mediaRecorder = new MediaRecorder(stream, { mimeType: 'my/mimetype' }); ``` To be sure that the browser can actually encode the format you want you could use `isTypeSuppor...
66,928,753
Following is a code I implemented to create a bar chart using chart js in React app. Here it creates a bar chart with all the data in an array. But, I want to change this code only to give the output in the x-axis - destination, y-axis - no. of occurrence of this destination since it has many repeated destinations. I s...
2021/04/03
[ "https://Stackoverflow.com/questions/66928753", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I ended up using [kbumsik/opus-media-recorder](https://github.com/kbumsik/opus-media-recorder), solved the issue for me. A drop-in replacement for MediaRecorder.
You need to remove the VideoTrack from your MediaStream: ```js const input = document.querySelector("video"); const stop_btn = document.querySelector("button"); input.onplaying = (evt) => { input.onplaying = null; console.clear(); const stream = input.captureStream ? input.captureStream() : input.mozCaptureStrea...
3,694,449
> > Let $x$ be a non zero vector in the complex vector space $\mathbb C^n$ and $A=xx^H$.Find all the Eigenvalues and their Eigen spaces.[where $x^H=$ conjugate transpose of $x$] > > > Here rank of $A$ is $1$ and $A$ is a Hermitian matrix so all the Eigenvalues are real.since rank $<n $ it implies that at least one...
2020/05/27
[ "https://math.stackexchange.com/questions/3694449", "https://math.stackexchange.com", "https://math.stackexchange.com/users/707239/" ]
Note that $\lambda = x^{H}x$ is an eigenvalue associated to the eigenvector $x$. Next note that $A$ satisfies $f(t) = t^{2} - \lambda t$.
**Hint**: Can you show that $Ax$ is a non-zero constant multiple of $x$? If so, then $x$ is an eigenvector, and that non-zero constant is the corresponding eigenvalue.
9,145,684
How do I display this string with a bullet point? Below is the string: ``` if (!this.value || this.value.length < 5) { alertValidation += "\nYou have not entered a valid Question\n"; } ```
2012/02/04
[ "https://Stackoverflow.com/questions/9145684", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1182476/" ]
If you want to `alert()` it, do: ``` alertValidation += "\n\u2022 You have not entered a valid Question\n"; ```
``` alert ('\u2022 A, \n\u2022 B, \n\u2022 C, \n\u2022 D'); ```
9,145,684
How do I display this string with a bullet point? Below is the string: ``` if (!this.value || this.value.length < 5) { alertValidation += "\nYou have not entered a valid Question\n"; } ```
2012/02/04
[ "https://Stackoverflow.com/questions/9145684", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1182476/" ]
If you want to `alert()` it, do: ``` alertValidation += "\n\u2022 You have not entered a valid Question\n"; ```
You should enclose your strings in a resource file, strings.xml, for translation purposes. Here is how to use the bullet character in a resource file: ``` <string name="alert_validation">\n\u2022 You have not entered a valid Question\n</string> alertValidation = getString(R.string.alert_validation); ```
9,145,684
How do I display this string with a bullet point? Below is the string: ``` if (!this.value || this.value.length < 5) { alertValidation += "\nYou have not entered a valid Question\n"; } ```
2012/02/04
[ "https://Stackoverflow.com/questions/9145684", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1182476/" ]
``` alert ('\u2022 A, \n\u2022 B, \n\u2022 C, \n\u2022 D'); ```
You should enclose your strings in a resource file, strings.xml, for translation purposes. Here is how to use the bullet character in a resource file: ``` <string name="alert_validation">\n\u2022 You have not entered a valid Question\n</string> alertValidation = getString(R.string.alert_validation); ```
433,158
Kafka broker is 10.2.1. This works: ``` $ ssh me@jumpbox me@jumpbox:~$ kafka-console-consumer.sh --bootstrap-server \ "10.200.1.1:9092,10.200.1.2:9092" \ --topic "mytopic" ``` This doesn't: ``` $ ssh me@jumpbox -L 9998:10.200.1.1:909...
2018/03/23
[ "https://unix.stackexchange.com/questions/433158", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/220862/" ]
Because kafka broker will redirect the consumer to use the original hosts. See this, <https://stackoverflow.com/questions/45854168/consume-from-a-kafka-cluster-through-ssh-tunnel>
It took me a couple of hours to sort this out. The good thing is the solution turned out is easy My senario is 1. I have a Kafaka server on centos in AWS running at 10.155.10.2:9092 2. 10.155.10.2:22 is open for SSH with a centos RSA key access My target is Using kafka-node to produce messages to 10.155.10.2:9092 th...
47,662,412
Trying to use props from `<button>` of component in the dispatch of a redux-thunk function that has been set up for Async process but I can't quite get how to use both props and the function (that's being connected to the component through react-redux `connect` in the `mapDispatchToProps`) but I just can't figure out h...
2017/12/05
[ "https://Stackoverflow.com/questions/47662412", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3708280/" ]
``` function loadData(dispatch, medium) { console.log(dispatch) return dispatch({type: 'LOADING_COMPONENT'}) return axios.get(`/professionals/${medium}`) .then(res => res.json()) .then( data => dispatch({ type: 'LOAD_SOME_DATA_SUCCESS', data }), err => dispatch({ type: 'LOAD_SOME_DATA_FAI...
Try returning a function, which **redux-thunk** will then call with **dispatch** as an argument. You can then call dispatch from that returned function: ``` function loadData(medium) { return (dispatch) => { dispatch({ type: 'LOADING_COMPONENT' }) axios.get(`/professionals/${medium}`) .then(res => re...
33,681,165
when I launch a photos fetch like: ``` let assetCollections: PHFetchResult = PHAssetCollection.fetchAssetCollectionsWithType(.SmartAlbum, subtype: .Any, options: nil) ``` I get a result of several albums, so I can iterate through the array and put their titles in a tableView. BUT: when I use a predicate to filter ...
2015/11/12
[ "https://Stackoverflow.com/questions/33681165", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3403442/" ]
the solution seems to be to use: ``` PHAssetCollection.fetchAssetCollectionsWithLocalizedIdentifiesr(identifiers: [String], options: PHFetchOptions) ``` So, passing into the parameter 'identifier' an array of strings with the titles of the albums we wish to fetch achieves the same result than attempting the predicat...
Try the format: `fetchOptions.predicate = NSPredicate(format: "%K == %@", "title", "Camera Roll")` or `fetchOptions.predicate = NSPredicate(format: "%K LIKE[cd] %@", "title", "Camera Roll")`
33,681,165
when I launch a photos fetch like: ``` let assetCollections: PHFetchResult = PHAssetCollection.fetchAssetCollectionsWithType(.SmartAlbum, subtype: .Any, options: nil) ``` I get a result of several albums, so I can iterate through the array and put their titles in a tableView. BUT: when I use a predicate to filter ...
2015/11/12
[ "https://Stackoverflow.com/questions/33681165", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3403442/" ]
If you want the Camera Roll album, you're probably better off asking for it symbolically: ``` let collections = PHAssetCollection.fetchAssetCollectionsWithType(.SmartAlbum, subtype: .SmartAlbumUserLibrary, options: nil) ``` The `SmartAlbumUserLibrary` subtype is how you get the Camera Roll (which isn't always called...
the solution seems to be to use: ``` PHAssetCollection.fetchAssetCollectionsWithLocalizedIdentifiesr(identifiers: [String], options: PHFetchOptions) ``` So, passing into the parameter 'identifier' an array of strings with the titles of the albums we wish to fetch achieves the same result than attempting the predicat...
33,681,165
when I launch a photos fetch like: ``` let assetCollections: PHFetchResult = PHAssetCollection.fetchAssetCollectionsWithType(.SmartAlbum, subtype: .Any, options: nil) ``` I get a result of several albums, so I can iterate through the array and put their titles in a tableView. BUT: when I use a predicate to filter ...
2015/11/12
[ "https://Stackoverflow.com/questions/33681165", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3403442/" ]
the solution seems to be to use: ``` PHAssetCollection.fetchAssetCollectionsWithLocalizedIdentifiesr(identifiers: [String], options: PHFetchOptions) ``` So, passing into the parameter 'identifier' an array of strings with the titles of the albums we wish to fetch achieves the same result than attempting the predicat...
If you want Camera Roll album only, you can try something like this : ``` func getCameraRoll() -> AlbumModel { var cameraRollAlbum : AlbumModel! let cameraRoll = PHAssetCollection.fetchAssetCollections(with: .smartAlbum, subtype: .smartAlbumUserLibrary, options: nil) cameraRoll.enumerateObjects({ ...
33,681,165
when I launch a photos fetch like: ``` let assetCollections: PHFetchResult = PHAssetCollection.fetchAssetCollectionsWithType(.SmartAlbum, subtype: .Any, options: nil) ``` I get a result of several albums, so I can iterate through the array and put their titles in a tableView. BUT: when I use a predicate to filter ...
2015/11/12
[ "https://Stackoverflow.com/questions/33681165", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3403442/" ]
the solution seems to be to use: ``` PHAssetCollection.fetchAssetCollectionsWithLocalizedIdentifiesr(identifiers: [String], options: PHFetchOptions) ``` So, passing into the parameter 'identifier' an array of strings with the titles of the albums we wish to fetch achieves the same result than attempting the predicat...
``` let fetchOptions = PHFetchOptions() fetchOptions.predicate = NSPredicate(format: "localizedTitle = %@", "Camera Roll") let assetCollections = PHAssetCollection.fetchAssetCollections(with: .album, subtype: .any, options: fetchOptions) let album = assetCollections.firstObject ```
33,681,165
when I launch a photos fetch like: ``` let assetCollections: PHFetchResult = PHAssetCollection.fetchAssetCollectionsWithType(.SmartAlbum, subtype: .Any, options: nil) ``` I get a result of several albums, so I can iterate through the array and put their titles in a tableView. BUT: when I use a predicate to filter ...
2015/11/12
[ "https://Stackoverflow.com/questions/33681165", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3403442/" ]
If you want the Camera Roll album, you're probably better off asking for it symbolically: ``` let collections = PHAssetCollection.fetchAssetCollectionsWithType(.SmartAlbum, subtype: .SmartAlbumUserLibrary, options: nil) ``` The `SmartAlbumUserLibrary` subtype is how you get the Camera Roll (which isn't always called...
Try the format: `fetchOptions.predicate = NSPredicate(format: "%K == %@", "title", "Camera Roll")` or `fetchOptions.predicate = NSPredicate(format: "%K LIKE[cd] %@", "title", "Camera Roll")`
33,681,165
when I launch a photos fetch like: ``` let assetCollections: PHFetchResult = PHAssetCollection.fetchAssetCollectionsWithType(.SmartAlbum, subtype: .Any, options: nil) ``` I get a result of several albums, so I can iterate through the array and put their titles in a tableView. BUT: when I use a predicate to filter ...
2015/11/12
[ "https://Stackoverflow.com/questions/33681165", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3403442/" ]
If you want Camera Roll album only, you can try something like this : ``` func getCameraRoll() -> AlbumModel { var cameraRollAlbum : AlbumModel! let cameraRoll = PHAssetCollection.fetchAssetCollections(with: .smartAlbum, subtype: .smartAlbumUserLibrary, options: nil) cameraRoll.enumerateObjects({ ...
Try the format: `fetchOptions.predicate = NSPredicate(format: "%K == %@", "title", "Camera Roll")` or `fetchOptions.predicate = NSPredicate(format: "%K LIKE[cd] %@", "title", "Camera Roll")`
33,681,165
when I launch a photos fetch like: ``` let assetCollections: PHFetchResult = PHAssetCollection.fetchAssetCollectionsWithType(.SmartAlbum, subtype: .Any, options: nil) ``` I get a result of several albums, so I can iterate through the array and put their titles in a tableView. BUT: when I use a predicate to filter ...
2015/11/12
[ "https://Stackoverflow.com/questions/33681165", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3403442/" ]
``` let fetchOptions = PHFetchOptions() fetchOptions.predicate = NSPredicate(format: "localizedTitle = %@", "Camera Roll") let assetCollections = PHAssetCollection.fetchAssetCollections(with: .album, subtype: .any, options: fetchOptions) let album = assetCollections.firstObject ```
Try the format: `fetchOptions.predicate = NSPredicate(format: "%K == %@", "title", "Camera Roll")` or `fetchOptions.predicate = NSPredicate(format: "%K LIKE[cd] %@", "title", "Camera Roll")`
33,681,165
when I launch a photos fetch like: ``` let assetCollections: PHFetchResult = PHAssetCollection.fetchAssetCollectionsWithType(.SmartAlbum, subtype: .Any, options: nil) ``` I get a result of several albums, so I can iterate through the array and put their titles in a tableView. BUT: when I use a predicate to filter ...
2015/11/12
[ "https://Stackoverflow.com/questions/33681165", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3403442/" ]
If you want the Camera Roll album, you're probably better off asking for it symbolically: ``` let collections = PHAssetCollection.fetchAssetCollectionsWithType(.SmartAlbum, subtype: .SmartAlbumUserLibrary, options: nil) ``` The `SmartAlbumUserLibrary` subtype is how you get the Camera Roll (which isn't always called...
If you want Camera Roll album only, you can try something like this : ``` func getCameraRoll() -> AlbumModel { var cameraRollAlbum : AlbumModel! let cameraRoll = PHAssetCollection.fetchAssetCollections(with: .smartAlbum, subtype: .smartAlbumUserLibrary, options: nil) cameraRoll.enumerateObjects({ ...
33,681,165
when I launch a photos fetch like: ``` let assetCollections: PHFetchResult = PHAssetCollection.fetchAssetCollectionsWithType(.SmartAlbum, subtype: .Any, options: nil) ``` I get a result of several albums, so I can iterate through the array and put their titles in a tableView. BUT: when I use a predicate to filter ...
2015/11/12
[ "https://Stackoverflow.com/questions/33681165", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3403442/" ]
If you want the Camera Roll album, you're probably better off asking for it symbolically: ``` let collections = PHAssetCollection.fetchAssetCollectionsWithType(.SmartAlbum, subtype: .SmartAlbumUserLibrary, options: nil) ``` The `SmartAlbumUserLibrary` subtype is how you get the Camera Roll (which isn't always called...
``` let fetchOptions = PHFetchOptions() fetchOptions.predicate = NSPredicate(format: "localizedTitle = %@", "Camera Roll") let assetCollections = PHAssetCollection.fetchAssetCollections(with: .album, subtype: .any, options: fetchOptions) let album = assetCollections.firstObject ```
16,707,715
I have a `contentEditable` DIV, and i need to prevent the insertion of Line Break on Enter keypress, and allow it only by pressing Shift + Enter I've tried: ``` $(".element").on('keydown', function(e) { if (e.keyCode == 13 && !e.shiftKey){ e.preventDefault(); } }); ``` But doesn't work. It works onl...
2013/05/23
[ "https://Stackoverflow.com/questions/16707715", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1405918/" ]
I`ve been trying this code, and its works: ``` $(document).ready(function(e){ $(".wysibb-body").keydown(function(e) { if (e.keyCode == 13 && e.shiftKey){ alert('Enter + shift pressed'); } else if(e.keyCode == 13){ e.preventDefault(); } }); }); ``` Test...
**Found out why wasn't working.** The DIV was generated by a jQuery plugin. Looking into it, i found out that there was already an event to insert a `<br>` on enter keyPress.
5,892,509
1) What good software out there already exists that allows one (preferably visually) see what folders and files are taking the most space on one's computer (Windows Vista compatible) 2) Say I wanted to write a this program myself, what opensource tools out there can I use to get started? Thanks!
2011/05/05
[ "https://Stackoverflow.com/questions/5892509", "https://Stackoverflow.com", "https://Stackoverflow.com/users/648927/" ]
1) You can try WinDirStat: <http://windirstat.info/> 2) I don't think you need open source tools, you could write it in Java or .NET just by using what is already provided with the languages.
Yes there are plenty of them. [For example check out these..](http://www.technize.com/5-free-tools-to-list-hard-drive-contents-graphically/)
5,892,509
1) What good software out there already exists that allows one (preferably visually) see what folders and files are taking the most space on one's computer (Windows Vista compatible) 2) Say I wanted to write a this program myself, what opensource tools out there can I use to get started? Thanks!
2011/05/05
[ "https://Stackoverflow.com/questions/5892509", "https://Stackoverflow.com", "https://Stackoverflow.com/users/648927/" ]
1) You can try WinDirStat: <http://windirstat.info/> 2) I don't think you need open source tools, you could write it in Java or .NET just by using what is already provided with the languages.
I use Sequoia View <http://www.snapfiles.com/get/sequoia.html>. As to the second part of your question I don't know sorry.
5,892,509
1) What good software out there already exists that allows one (preferably visually) see what folders and files are taking the most space on one's computer (Windows Vista compatible) 2) Say I wanted to write a this program myself, what opensource tools out there can I use to get started? Thanks!
2011/05/05
[ "https://Stackoverflow.com/questions/5892509", "https://Stackoverflow.com", "https://Stackoverflow.com/users/648927/" ]
Yes there are plenty of them. [For example check out these..](http://www.technize.com/5-free-tools-to-list-hard-drive-contents-graphically/)
I use Sequoia View <http://www.snapfiles.com/get/sequoia.html>. As to the second part of your question I don't know sorry.
21,186,442
I have a problem with non-portable code that works as intended on ARM RealView compiler, but VC++, GCC refuse to compile it and QAC++(a static analysis tool) issues a warning. The problem ----------- I have a system that needs to parse mnemonic identifiers in messages. The mnemonics are all three character 8-bit ASCI...
2014/01/17
[ "https://Stackoverflow.com/questions/21186442", "https://Stackoverflow.com", "https://Stackoverflow.com/users/168986/" ]
With C++11 you could use a [`constexpr`](http://en.cppreference.com/w/cpp/language/constexpr) function: ``` constexpr int CONST_MNEMONIC(const char* s) { return (static_cast<int>(s[2]) << 16) + (static_cast<int>(s[1]) << 8) + static_cast<int>(s[0]); } ```
It compiles fine here with gcc 4.8 and clang 3.4... In C++11, you may use: ``` constexpr uint32_t CONST_MNEMONIC(const char (&s)[4]) { return (uint32_t(s[2]) << 16) | (uint32_t(s[1]) << 8) | uint32_t(s[0]); } ```
184,772
I want to develop a WordPress theme similar to another theme present on the internet. Shall I use the default WordPress theme to start from or start from scratch? Please guide me.
2015/04/20
[ "https://wordpress.stackexchange.com/questions/184772", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/-1/" ]
Go with WordPress TwentyFifteen or any other default theme. You don't have re-invent the wheel, you will save a lot of time.
For learning & understanding I think you should start from [wordpress blank theme](https://wordpress.org/themes/blankslate/)
184,772
I want to develop a WordPress theme similar to another theme present on the internet. Shall I use the default WordPress theme to start from or start from scratch? Please guide me.
2015/04/20
[ "https://wordpress.stackexchange.com/questions/184772", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/-1/" ]
Use [this](http://underscores.me/) basic theme with default features that should begginer person to know. * A just right amount of lean, well-commented, modern, HTML5 templates. * A helpful 404 template. * An optional sample custom header implementation in inc/custom-header.php * Custom template tags in inc/template-t...
For learning & understanding I think you should start from [wordpress blank theme](https://wordpress.org/themes/blankslate/)
29,968,301
I write a file in internal memory: ``` byte[] data = ... // (A buffer containing wav data) String filename = context.getFilesDir().getAbsolutePath() + "/newout.wav"; File file = new File(filename); FileOutputStream fos = new FileOutputStream(file); fos.write(data); fos.close(); ``` Then I try to play it: ``` MediaP...
2015/04/30
[ "https://Stackoverflow.com/questions/29968301", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1385489/" ]
To change programaticaly the file permissions to -rw-r--r-- you need to do smoething like this: ``` Process process = null; DataOutputStream dataOutputStream = null; try { process = Runtime.getRuntime().exec("su"); dataOutputStream = new DataOutputStream(process.getOutputStream()); dataOutputStream.writeB...
If you open a file, the default mode is [`Context.MODE_PRIVATE`](http://developer.android.com/reference/android/content/Context.html#MODE_PRIVATE), e.g. as in ``` File file = new File(context.getFilesDir(), filename); String filename = "myfile"; String string = "Hello world!"; FileOutputStream outputStream; try { ...
15,131,837
I want to set image.imageurl dinamically... But the code bellow just works when the page is not on a masterpage. Here is the code: ``` protected void AsyncFileUpload1_UploadedComplete(object sender, AjaxControlToolkit.AsyncFileUploadEventArgs e) { Byte[] bytes = AsyncFileUpload1.FileBytes; string base64String...
2013/02/28
[ "https://Stackoverflow.com/questions/15131837", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2118928/" ]
In the `MasterPage` the `Id` is derived from the `ContentPlaceHolder`, e.g.: ``` ctl00$ContentPlaceHolder1$Image1 ``` But why don't you simply use `Image1.ClientId` instead? ``` ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "img", "top.document.getElementById('" + Image1.ClientId + "').src='data...
Tim Schmelter is correct, you could also set the ClientIDMode on the control to Static. E.g. ``` <asp:Image runat="server" ID="Image1" ClientIDMode="Static" /> ``` MSDN Docs: <http://msdn.microsoft.com/en-us/library/system.web.ui.control.clientidmode.aspx>
47,129,380
I am trying to ask for an input of an alphanumeric phone number and convert it to a list so that I can convert the alphabet letters to numbers. I have this for the input: ``` number=str(input("Enter Alphanumeric phone number:")) number.split("") ``` and to try and convert it I tried `number.split("")` which gave ...
2017/11/06
[ "https://Stackoverflow.com/questions/47129380", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8891920/" ]
You can also use list comprehension for one line input. In this method you will not need to write more number of lines. ``` list = [int(i) for i in input()] ``` for input`123456789` you will get `[1,2,3,4,5,6,7,8,9]`
One of the issues you have with both approaches is you still have to convert the string to a number in this case `int`. ``` numbers = str(input('Enter Alphanumeric phone number')) numbers = list(numbers) numbers = [int(number) for number in numbers] ``` for input of `1234567899` you'll get `[1,2,3,4,5,6,7,8,9,9]`
47,129,380
I am trying to ask for an input of an alphanumeric phone number and convert it to a list so that I can convert the alphabet letters to numbers. I have this for the input: ``` number=str(input("Enter Alphanumeric phone number:")) number.split("") ``` and to try and convert it I tried `number.split("")` which gave ...
2017/11/06
[ "https://Stackoverflow.com/questions/47129380", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8891920/" ]
You can also use list comprehension for one line input. In this method you will not need to write more number of lines. ``` list = [int(i) for i in input()] ``` for input`123456789` you will get `[1,2,3,4,5,6,7,8,9]`
`list(number)` will convert the string to a list of characters. It sounds like you need to assign the result back to `number` though, like this: ``` number = list(number) ```
69,417,970
Problem summary =============== I am trying to install an open-source parallel finite-element code called TACS and available at [this github repository](https://github.com/smdogroup/tacs). To comply with the indicated prerequisites, I followed the instructions at [this github repository](https://github.com/jlblancoc/s...
2021/10/02
[ "https://Stackoverflow.com/questions/69417970", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6583606/" ]
I can't answer but maybe I can orient you. First `nmake` is not make. It will not work with any makefile not written specifically as an nmake makefile. And it's only available on Windows. So, best to just forget it exists. Second, it's important to understand how make works: rules in makefiles are a combination of ta...
You need a real answer: you can't compile using the Windows Command Prompt. Get yourself MSYS2 -- which will also install MinGW-w64 -- and follow the setup instructions. Then launch the MSYS shell to get a unix-y terminal prompt (zsh, IIRC), and change directory to the head of the project folder. To access the Window...
37,655,301
How can I show the image in asp:Image control after the image is selected in asp:FileUpload Control without any Button Click ? Here is my Code : ``` <asp:Image runat="server" ID="img_edu" Width="100" Height="100" /> <asp:FileUpload runat="server" ID="fileupload_edu" /> ``` I've gone through many links but got...
2016/06/06
[ "https://Stackoverflow.com/questions/37655301", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5554359/" ]
No you cannot do this on iOS using firebase, what you should do is call a service on your firebase which will send a notification to the other device. APNS and GCM are a little different in terms of the server setup. For GCM you just need the API key to be added in the POST call you make to <https://android.googleapis...
I don't think Firebase is currently equipped to handle this scenario. You need some sever side code to handle it. Either you could get hosting and make like a php endpoint what can used to incorporate the ``` [[FIRMessaging message]sendMessage:(nonnull NSDictionary *)message to:(nonnul...
56,850,210
Im trying to upgrade a vaadin 7 app to use gwt 2.8.2. In order to do so, after changing the dependencies and setting up the gwt-maven-plugin to compile (instead of the vaadin-maven-plugin), I'm running into an issue as by default, the gwt-maven-plugin expects to find the AppWidgetset.gwt.xml in the src/main/java folder...
2019/07/02
[ "https://Stackoverflow.com/questions/56850210", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11708441/" ]
A decision to define a function within or outside of useEffect depends on where all the functions is called. If your function is called only from within the useEffect then it makes sense to define it within the useEffect. However is the same function is being called from within useEffect as well as other event handle...
Setting another state should not be an effect at all. ``` const [someState, setSomeState] = React.useState(0); function incrementState() { setSomeState(someState => someState + 1); } ```
39,439,656
I have this triangle in CSS: ```css .triangle { width: 0; height: 0; border-style: solid; border-width: 200px 200px 0 0; border-color: #007bff transparent transparent transparent; } ``` ```html <div class="triangle"></div> ``` How can I apply a 1px shadow on the hypotenuse line?
2016/09/11
[ "https://Stackoverflow.com/questions/39439656", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4467741/" ]
Since `box-shadow` won't work, you have to apply a drop shadow filter on the triangle: ```css .triangle { width: 0; height: 0; border-style: solid; border-width: 200px 200px 0 0; border-color: #007bff transparent transparent transparent; -webkit-filter: drop-shadow(1px 1px 1px rgba(0,0,0,.5)); fil...
You can make this *without using borders* by employing an angled gradient. ```css div { width: 200px; height: 200px; margin: 2em auto; background: linear-gradient(to bottom right, #007bff 50%, rgba(0,0,0,.5) 50%, transparent 52%); } ``` ```html <div></div> ```
39,439,656
I have this triangle in CSS: ```css .triangle { width: 0; height: 0; border-style: solid; border-width: 200px 200px 0 0; border-color: #007bff transparent transparent transparent; } ``` ```html <div class="triangle"></div> ``` How can I apply a 1px shadow on the hypotenuse line?
2016/09/11
[ "https://Stackoverflow.com/questions/39439656", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4467741/" ]
Since `box-shadow` won't work, you have to apply a drop shadow filter on the triangle: ```css .triangle { width: 0; height: 0; border-style: solid; border-width: 200px 200px 0 0; border-color: #007bff transparent transparent transparent; -webkit-filter: drop-shadow(1px 1px 1px rgba(0,0,0,.5)); fil...
Create a `polygon` in an `svg`, then apply a [`drop-shadow`](https://developer.mozilla.org/en-US/docs/Web/CSS/filter-function/drop-shadow) filter. ```css .triangle { width: 200px; color: #007bff; filter: drop-shadow(1px 1px 1px rgba(0, 0, 0, .5)); } ``` ```html <svg class="triangle" viewBox="0 0 100 100"> ...
39,439,656
I have this triangle in CSS: ```css .triangle { width: 0; height: 0; border-style: solid; border-width: 200px 200px 0 0; border-color: #007bff transparent transparent transparent; } ``` ```html <div class="triangle"></div> ``` How can I apply a 1px shadow on the hypotenuse line?
2016/09/11
[ "https://Stackoverflow.com/questions/39439656", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4467741/" ]
Since `box-shadow` won't work, you have to apply a drop shadow filter on the triangle: ```css .triangle { width: 0; height: 0; border-style: solid; border-width: 200px 200px 0 0; border-color: #007bff transparent transparent transparent; -webkit-filter: drop-shadow(1px 1px 1px rgba(0,0,0,.5)); fil...
Working for me with this code: ```css .triangle-use-dropshadow{ content: ' '; width: 0; height: 0; border: 14px solid; border-color: #fdfdfd transparent transparent transparent; filter: drop-shadow(-2px -4px 2px rgba(0,0,0,0.5)); } ``` ```html <div class="triangle-use-dropshadow"></div> ```
39,439,656
I have this triangle in CSS: ```css .triangle { width: 0; height: 0; border-style: solid; border-width: 200px 200px 0 0; border-color: #007bff transparent transparent transparent; } ``` ```html <div class="triangle"></div> ``` How can I apply a 1px shadow on the hypotenuse line?
2016/09/11
[ "https://Stackoverflow.com/questions/39439656", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4467741/" ]
You can make this *without using borders* by employing an angled gradient. ```css div { width: 200px; height: 200px; margin: 2em auto; background: linear-gradient(to bottom right, #007bff 50%, rgba(0,0,0,.5) 50%, transparent 52%); } ``` ```html <div></div> ```
Working for me with this code: ```css .triangle-use-dropshadow{ content: ' '; width: 0; height: 0; border: 14px solid; border-color: #fdfdfd transparent transparent transparent; filter: drop-shadow(-2px -4px 2px rgba(0,0,0,0.5)); } ``` ```html <div class="triangle-use-dropshadow"></div> ```
39,439,656
I have this triangle in CSS: ```css .triangle { width: 0; height: 0; border-style: solid; border-width: 200px 200px 0 0; border-color: #007bff transparent transparent transparent; } ``` ```html <div class="triangle"></div> ``` How can I apply a 1px shadow on the hypotenuse line?
2016/09/11
[ "https://Stackoverflow.com/questions/39439656", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4467741/" ]
Create a `polygon` in an `svg`, then apply a [`drop-shadow`](https://developer.mozilla.org/en-US/docs/Web/CSS/filter-function/drop-shadow) filter. ```css .triangle { width: 200px; color: #007bff; filter: drop-shadow(1px 1px 1px rgba(0, 0, 0, .5)); } ``` ```html <svg class="triangle" viewBox="0 0 100 100"> ...
Working for me with this code: ```css .triangle-use-dropshadow{ content: ' '; width: 0; height: 0; border: 14px solid; border-color: #fdfdfd transparent transparent transparent; filter: drop-shadow(-2px -4px 2px rgba(0,0,0,0.5)); } ``` ```html <div class="triangle-use-dropshadow"></div> ```
10,708,709
I want to use awk to read a csv file. The csv file contains 5 columns, c1, c2, c3, c4, c5. I want judge the c1, c2 and c3 together is unique, like database constraint. here is sample csv file: ``` c1,c2,c3,c4,c5 1886,5141,11-2011,62242.57,52.71 1886,5140,11-2011,63763.75,52.22 23157666,4747,11-2011,71.07,83.33 1886,5...
2012/05/22
[ "https://Stackoverflow.com/questions/10708709", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1086510/" ]
``` awk -F, 'line[$1,$2,$3] {printf "Error: lines %d and %d collide\n", line[$1,$2,$3], NR; next} {line[$1,$2,$3] = NR}' ```
This lists *all* the lines for each duplication. It only outputs the duplication message *once* for each set. ``` awk -F, '{count[$1,$2,$3]++; line[$1,$2,$3] = line[$1,$2,$3] ", " NR} END {for (i in count) {if (count[i] > 1) {v=i; gsub(SUBSEP, FS, v); print "Error: lines", substr(line[i], 3), "collide on value:", v}}}...
49,832
Here are the [rules](https://www.jaxgames.com/sequence-game-rules/) of Sequence. > > Loss of Card > > > Once you have taken your turn and placed your marker chip on the game board, you must take a card from the draw deck. If you fail to take a card before the next player makes a move AND takes his/her card, you los...
2020/01/03
[ "https://boardgames.stackexchange.com/questions/49832", "https://boardgames.stackexchange.com", "https://boardgames.stackexchange.com/users/30171/" ]
It does not count as a "pick". From the rulebook, page 3: > > IMPORTANT: Some abilities may let you draw a random Energy ( ). **This is > not a Pick Action.** In those cases, you don’t take from the Energy Row. Instead, you > draw blindly from the top of the Dispenser > > >
There are two ways to get energy marbles: pick, and draw. Pick is represented by a hand with two fingers making a pinching motion. Draw is represented by a horizontal bar with a question mark in a circle above it. To pick is to take a marble from the Energy Row. You get to take the color of your choice (among the ones ...
35,756
> > To calculate $\Delta H$, the change in enthalpy at $\mathrm{100^\circ C}$ for the reaction below, one needs what addition information? > > > $$\ce{N2(g) + 3H2(g) -> 2NH3(g)}$$ > > > $\Delta H^\circ = \pu{-92.0 kJ}$ at $\mathrm{25^\circ C}$ > > > (a) The equilibrium constant for the reaction at $\mathrm{100^\...
2015/09/01
[ "https://chemistry.stackexchange.com/questions/35756", "https://chemistry.stackexchange.com", "https://chemistry.stackexchange.com/users/19290/" ]
@Chet already gave the qualitative answer but the actual equation it is based on is: $$ \Delta H^\circ(T)=\Delta H{^\circ}\_{T\_1} + \int\_{T\_1}^{T} \Delta C\_p{^\circ}(T^\prime ) \,\mathrm{d}T^\prime$$ If you know the enthalpy at a reference temperature and the heat capacity as a function of temperature you can cal...
Since $\Delta H$ is a function of state, you can get $\Delta H$ at 100 C by taking the reactants at 100 C, cooling them down to 25 C, then carrying out the reaction at 25 C, and then heating the products up to 100 C. This procedure makes use of Hess' Law. Getting the amount of heat removed to take the reactants from 10...
16,663,782
I had made a java program in which it is supposed to take input from a user in a GUI frame and store in a .dat file in row and columns. The problem is with this particular code as it is not giving the desired results. the user should be able to enter only numbers between 20 to 30 using a keylistener. the input should n...
2013/05/21
[ "https://Stackoverflow.com/questions/16663782", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2404278/" ]
Your app.yaml file is for routing requests from incoming URLs to the initial script you want to use to process the request. You don't need to add routings for each and every \*.php file that you want to include from one script to another. For example, look at the [app.yaml](https://developers.google.com/appengine/art...
The problem you face is most likely independent to Google App Engine. On Google App Engine, the [standard rules of PHP file-inclusion](http://php.net/include) still applies. The only potential difference here is that the files are read-only (but that should not pose any problems in your case). So if `lib1.php` require...
16,663,782
I had made a java program in which it is supposed to take input from a user in a GUI frame and store in a .dat file in row and columns. The problem is with this particular code as it is not giving the desired results. the user should be able to enter only numbers between 20 to 30 using a keylistener. the input should n...
2013/05/21
[ "https://Stackoverflow.com/questions/16663782", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2404278/" ]
Your app.yaml file is for routing requests from incoming URLs to the initial script you want to use to process the request. You don't need to add routings for each and every \*.php file that you want to include from one script to another. For example, look at the [app.yaml](https://developers.google.com/appengine/art...
The error 500 was thrown basically because Google App Engine for php doesn't support CURL extension used in the Facebook php SDK. Nothing related to app.yaml includes. I forked the official fb sdk git and I'm patching a solution right now.
68,673,383
If I have two tables, Consumer, and Appointment, would there be a way join them, so that it only displays the most recent appointment? I was able to do it with sql server, but mysql seems to be a bit different. I would have thought the query to do it would be ``` SELECT Con.ConsumerID, Con.ConsumerName, ...
2021/08/05
[ "https://Stackoverflow.com/questions/68673383", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2250373/" ]
add Indexes for given WHERE statements. SOURCE\_SYSTEM, CAL\_DT
In addition to configuring indexes in the database, as mentioned by Kutay Zorlu in his answer, you could consider adding a pagination feature to your REST endpoint.
1,819,372
Or is everything a method? Since everything is an object, a ``` def whatever: ``` is just a method of that file.py, right?
2009/11/30
[ "https://Stackoverflow.com/questions/1819372", "https://Stackoverflow.com", "https://Stackoverflow.com/users/179736/" ]
Python has functions. As everything is an object [functions are objects too](http://www.diveintopython.org/getting_to_know_python/everything_is_an_object.html). So, to use your example: ``` >>> def whatever(): ... pass ... >>> whatever <function whatever at 0x00AF5F30> ``` When we use `def` we have created an o...
Hmm... You can work with "whatever" as an ordinary function in file namespace.
1,819,372
Or is everything a method? Since everything is an object, a ``` def whatever: ``` is just a method of that file.py, right?
2009/11/30
[ "https://Stackoverflow.com/questions/1819372", "https://Stackoverflow.com", "https://Stackoverflow.com/users/179736/" ]
Unlike in Java in Python a file named `file.py` does not necessarily contain a class called `file` as you might expect if this was a java file named `file.java`. In Python a file is a module which is really just a namespace (more comparable to a Java package than a Java class) and not a class. Consider the example `fi...
Hmm... You can work with "whatever" as an ordinary function in file namespace.
1,819,372
Or is everything a method? Since everything is an object, a ``` def whatever: ``` is just a method of that file.py, right?
2009/11/30
[ "https://Stackoverflow.com/questions/1819372", "https://Stackoverflow.com", "https://Stackoverflow.com/users/179736/" ]
Python has functions. As everything is an object [functions are objects too](http://www.diveintopython.org/getting_to_know_python/everything_is_an_object.html). So, to use your example: ``` >>> def whatever(): ... pass ... >>> whatever <function whatever at 0x00AF5F30> ``` When we use `def` we have created an o...
Unlike in Java in Python a file named `file.py` does not necessarily contain a class called `file` as you might expect if this was a java file named `file.java`. In Python a file is a module which is really just a namespace (more comparable to a Java package than a Java class) and not a class. Consider the example `fi...
24,956,036
I have some test under features directory. But when I try to run `behat` I get the following error: ``` $ ls behat.yml features $ behat PHP Warning: Module 'memcache' already loaded in Unknown on line 0 PHP Warning: require_once(PHPUnit/Autoload.php): failed to open stream: No such file or directory in $HOME/works...
2014/07/25
[ "https://Stackoverflow.com/questions/24956036", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1045346/" ]
I ran into the same error using phpunit along with Behat, I did manage to overcome it with the following code: ``` require_once __DIR__.'/../../vendor/autoload.php'; require_once __DIR__.'/../../vendor/phpunit/phpunit/src/Framework/Assert/Functions.php'; ``` Given that the 'bootstrap' folder is only one two folders ...
You want to use the autoloader that comes with composer. Try adding ``` require_once 'path/to/vendor/autoload.php' ``` before using PHPUnit
64,789,762
So I'm fairly new to pandas and I run into this problem that I'm not able to fix. I have the following dataframe: ``` import pandas as pd df = pd.DataFrame({ 'Day': ['2018-12-31', '2019-01-07'], 'Product_Finished': [1000, 2000], 'Product_Tested': [50, 10]}) df['Day'] = pd.to_datetime(df['Day'], format='%...
2020/11/11
[ "https://Stackoverflow.com/questions/64789762", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9360602/" ]
No, it's impossible. ARM Template is used to create Azure resources under Azure subscription. But App Registration is the resource of Azure AD module. They are two different areas. A similar discussion [here](https://github.com/MicrosoftDocs/azure-docs/issues/51914) for your reference. You can use Azure AD Powershel...
I'm facing a similar problem and seems that ARM deployment scripts may be the answer: <https://learn.microsoft.com/en-us/azure/azure-resource-manager/templates/deployment-script-template> this post gives an example on how to create app registrations with ARM deployment scripts: <https://moimhossain.com/2020/04/03/az...
421,210
I have lots of used Li-Ion 18650s. I want to test their capacity. There are however 2 important parameters that I cannot find anywhere which is **amperage** and **cut off voltage**. Some people use **500mA** some people use **1000mA**. Some discharge to **3.0V** some do that up to **2.8V**. Depending on which param...
2019/02/08
[ "https://electronics.stackexchange.com/questions/421210", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/212274/" ]
If there's a significant difference in measured capacity between 500mA and 1A discharge currents, you should stick to lower value, i.e. 500mA (or even less). Unless you're interested in *capacity under specific load*, you should aim to measure the *maximum* value, and cells typically have higher capacity at smaller dis...
> > Since capacity is defined for cells it's calculation must adhere to > some standards for these parameters. > > > It is totally untrue. Batteries are designed for different purposes/uses. There are high-capacity batteries with moderate discharge rates (as for laptops). They have all electrode films thinner, so...
2,309,208
I have used Signals and slots in Qt and I want to implement same stuff in GTK+. I have 2 threads in which I need to pass data. I have done it using signals and slots in Qt but now I have to implement this same stuff in GTK+ and C. How should I do it?
2010/02/22
[ "https://Stackoverflow.com/questions/2309208", "https://Stackoverflow.com", "https://Stackoverflow.com/users/314247/" ]
[Here](http://zetcode.com/tutorials/gtktutorial/gtkevents/)'s a general tutorial for the signal/event mechanism without threads. When using threads, you'll have to make sure to * init the Gtk main loop for threads by calling [g\_thread\_init()](http://library.gnome.org/devel/glib/unstable/glib-Threads.html#g-thread-i...
GTK/GLib has its own [signal mechanism](http://library.gnome.org/devel/gtk-tutorial/2.17/x159.html).
2,309,208
I have used Signals and slots in Qt and I want to implement same stuff in GTK+. I have 2 threads in which I need to pass data. I have done it using signals and slots in Qt but now I have to implement this same stuff in GTK+ and C. How should I do it?
2010/02/22
[ "https://Stackoverflow.com/questions/2309208", "https://Stackoverflow.com", "https://Stackoverflow.com/users/314247/" ]
[Here](http://zetcode.com/tutorials/gtktutorial/gtkevents/)'s a general tutorial for the signal/event mechanism without threads. When using threads, you'll have to make sure to * init the Gtk main loop for threads by calling [g\_thread\_init()](http://library.gnome.org/devel/glib/unstable/glib-Threads.html#g-thread-i...
Qt does some of its own stuff behind the scenes to make signal/slot connections threadsafe. The last I was working with GTKmm, that wasn't the case for GTK. That being the case, you'd probably have to do up your own, or (my recommendation) use boost if you can. If you do have to roll your own, you'll want to have an ev...
11,871,351
``` static void just_traverse(sll **head_ref) { sll *first = *head_ref; sll *second = (*head_ref)->next; if(second == NULL) { return; } just_traverse(&(second)); *head_ref = second; printf("%d \t",second->payload); } ``` In above code if I remove \*head\_ref = second; I get o...
2012/08/08
[ "https://Stackoverflow.com/questions/11871351", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1172559/" ]
Firstly, you should be using `RelativeLayout`; [`FrameLayout`](http://developer.android.com/reference/android/widget/FrameLayout.html) is used to hold a single child element optimally. Second, the layout is drawn in order from top to bottom -> back to front. Therefore you want your `Button` below it in the XML file. ...
Add `android:focusable="false"` to your button attribute and see if that helps. ``` <Button android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="bottom|right" android:focusable="false" android:focusableInTouchMode="false" ...
11,871,351
``` static void just_traverse(sll **head_ref) { sll *first = *head_ref; sll *second = (*head_ref)->next; if(second == NULL) { return; } just_traverse(&(second)); *head_ref = second; printf("%d \t",second->payload); } ``` In above code if I remove \*head\_ref = second; I get o...
2012/08/08
[ "https://Stackoverflow.com/questions/11871351", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1172559/" ]
Firstly, you should be using `RelativeLayout`; [`FrameLayout`](http://developer.android.com/reference/android/widget/FrameLayout.html) is used to hold a single child element optimally. Second, the layout is drawn in order from top to bottom -> back to front. Therefore you want your `Button` below it in the XML file. ...
Use a RelativeLayout and use either android:layout\_below="@+id/yourIdHere" or android:layout\_above="@+id/yourIdHere"
11,871,351
``` static void just_traverse(sll **head_ref) { sll *first = *head_ref; sll *second = (*head_ref)->next; if(second == NULL) { return; } just_traverse(&(second)); *head_ref = second; printf("%d \t",second->payload); } ``` In above code if I remove \*head\_ref = second; I get o...
2012/08/08
[ "https://Stackoverflow.com/questions/11871351", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1172559/" ]
Firstly, you should be using `RelativeLayout`; [`FrameLayout`](http://developer.android.com/reference/android/widget/FrameLayout.html) is used to hold a single child element optimally. Second, the layout is drawn in order from top to bottom -> back to front. Therefore you want your `Button` below it in the XML file. ...
Use Relative Layout, and then you can set your button position by `gravity` use this example add `layout_align` with different values, will do the trick for you. ..... ``` <RelativeLayout android:layout_width="match_parent" android:layout_height="match_parent" > <Button android:id="@+id/button1" andro...
11,871,351
``` static void just_traverse(sll **head_ref) { sll *first = *head_ref; sll *second = (*head_ref)->next; if(second == NULL) { return; } just_traverse(&(second)); *head_ref = second; printf("%d \t",second->payload); } ``` In above code if I remove \*head\_ref = second; I get o...
2012/08/08
[ "https://Stackoverflow.com/questions/11871351", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1172559/" ]
Firstly, you should be using `RelativeLayout`; [`FrameLayout`](http://developer.android.com/reference/android/widget/FrameLayout.html) is used to hold a single child element optimally. Second, the layout is drawn in order from top to bottom -> back to front. Therefore you want your `Button` below it in the XML file. ...
Here sample code for how to using relative layout with listview and it shows like your image. ``` <RelativeLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <TextView android:id="@+id/textView1" android:layout_width="wrap_c...
11,871,351
``` static void just_traverse(sll **head_ref) { sll *first = *head_ref; sll *second = (*head_ref)->next; if(second == NULL) { return; } just_traverse(&(second)); *head_ref = second; printf("%d \t",second->payload); } ``` In above code if I remove \*head\_ref = second; I get o...
2012/08/08
[ "https://Stackoverflow.com/questions/11871351", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1172559/" ]
Firstly, you should be using `RelativeLayout`; [`FrameLayout`](http://developer.android.com/reference/android/widget/FrameLayout.html) is used to hold a single child element optimally. Second, the layout is drawn in order from top to bottom -> back to front. Therefore you want your `Button` below it in the XML file. ...
Just copy paste this. Tested solution. ``` <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="3"> <LinearLayout ...
23,468,664
Hi I'm working on a little website and need some help with some CSS coding. I'm trying to display the image on top/first, insted of the a href headline and I can't use float to do this or change the HTML this has to be done only by CSS, anyone know an alternative way of doing this? TIA ``` <ul> <li> <a href="url">head...
2014/05/05
[ "https://Stackoverflow.com/questions/23468664", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3603497/" ]
1. On Eclipse Click File->Import , then Select General->Existing Projects into Wrokspace. 2. Select the folder which have your Project 3. Click on Finish 4. From Window->Preferences Menu, select Server->Runtime environments 5. ADd your Tomcat instance 6. From Window->Showview menu, select 'Servers' 7. On Servers Tab ri...
1. In you **Project Explorer** right click then Select **Import Project** ![enter image description here](https://i.stack.imgur.com/Lc6FT.png) 2. In the import dialog box, Select **Web** and then select **WAR file**. Click on Next. ![enter image description here](https://i.stack.imgur.com/AUfPI.png) 3. Finally in ...
127,896
I've been trying to learn how to do this and I tried getting the raw source and also as XMLObjects. However, I'm having a difficult time extract the data that I need from a section on the page. I feel that it would be easier if it was a table, but it's a number of lists (HTML "< ul>< li>...< /li >< /ul >") with a heade...
2016/10/04
[ "https://mathematica.stackexchange.com/questions/127896", "https://mathematica.stackexchange.com", "https://mathematica.stackexchange.com/users/43542/" ]
You may use the [String Manipulation](http://reference.wolfram.com/language/guide/StringManipulation.html) functions on the `"ArticleWikicode"` property of article using [`WikipediaData`](http://reference.wolfram.com/language/ref/WikipediaData.html). ``` awc = WikipediaData["List of plants used in herbalism", "Article...
In version 0.8 of [jSoupLink](https://github.com/cekdahl/jSoupLink), you could do it like this: ``` doc = Import[ "https://en.wikipedia.org/wiki/List_of_plants_used_in_herbalism", "HTMLDOM" ]; herbs = doc["Select", "#mw-content-text > ul li"]; extractInformation[herb_] := { herb["AllText"], Through[herb["S...
37,411,117
I simply want to match "{". But don't know why giving this error: > > > ``` > terminate called after throwing an instance of 'std::regex_error' > what(): regex_error > Aborted (core dumped) > > ``` > > Compilation on Ubuntu with g++ version 4.6.3 ``` g++ -std=c++0x a.c ``` Program ------- ``` #include...
2016/05/24
[ "https://Stackoverflow.com/questions/37411117", "https://Stackoverflow.com", "https://Stackoverflow.com/users/543087/" ]
You need at [least gcc 4.9](https://stackoverflow.com/questions/12530406/is-gcc-4-8-or-earlier-buggy-about-regular-expressions) to make regexps work with gcc, once you will have 4.9 version add `.*` to make it match the rest of the string: ``` if (regex_match("{1}" , std::regex ("[{].*"))) { ...
I have the same error with you! And my IDE is **Clion**, I choose the C++ version with Clion is C++17 and my test code is: ``` std::string pattern{ "http|hppts://\\w.*$" }; // url std::regex re(pattern); std::vector<std::string> str{ "http://blog.net/xxx", "https://github.com/jasonhubs", "abcd://124.456", "ab...
15,531,319
I need to update a table data in database using RAILS migrations. ``` Sample: Table: Table_A(Col_A(number), Col_B(varchar),...) Query: UPDATE Table_A SET Col_B = "XXX" where Col_B = "YYY" ``` What would be the best way to do this using RAILS Migrations. I am not even sure if RAILS migrations is the way to go for up...
2013/03/20
[ "https://Stackoverflow.com/questions/15531319", "https://Stackoverflow.com", "https://Stackoverflow.com/users/518445/" ]
You can do like this: ``` class YourMigration < ActiveRecord::Migration def up execute('UPDATE Table_A SET Col_B = "XXX" where Col_B = "YYY"') end def down end end ``` Or: ``` class YourMigration < ActiveRecord::Migration def up update('UPDATE Table_A SET Col_B = "XXX" where Col_...
``` ActiveRecord::Base.connection.execute("update Table_A set Col_B = 'XXX' where Col_B = 'YYY') ```
15,531,319
I need to update a table data in database using RAILS migrations. ``` Sample: Table: Table_A(Col_A(number), Col_B(varchar),...) Query: UPDATE Table_A SET Col_B = "XXX" where Col_B = "YYY" ``` What would be the best way to do this using RAILS Migrations. I am not even sure if RAILS migrations is the way to go for up...
2013/03/20
[ "https://Stackoverflow.com/questions/15531319", "https://Stackoverflow.com", "https://Stackoverflow.com/users/518445/" ]
This should be done in a rake task... ``` namespace :onetime do task :update_my_data => :environment do TableA.where(Col_B: "YYY").update_all(Col_B: "XXX") end end ``` Then after you deploy: `rake onetime:update_my_data` At my company we delete the contents of the onetime namespace rake task after it's bee...
``` ActiveRecord::Base.connection.execute("update Table_A set Col_B = 'XXX' where Col_B = 'YYY') ```
15,531,319
I need to update a table data in database using RAILS migrations. ``` Sample: Table: Table_A(Col_A(number), Col_B(varchar),...) Query: UPDATE Table_A SET Col_B = "XXX" where Col_B = "YYY" ``` What would be the best way to do this using RAILS Migrations. I am not even sure if RAILS migrations is the way to go for up...
2013/03/20
[ "https://Stackoverflow.com/questions/15531319", "https://Stackoverflow.com", "https://Stackoverflow.com/users/518445/" ]
It's usually better to do these sorts of big data updates in a rake task. I usually write them so they have two versions: rake change\_lots\_of\_data:report and rake change\_lots\_of\_data:update. The 'report' version just executes the where clause and spits out a list of what would be changed. The 'update' version use...
``` ActiveRecord::Base.connection.execute("update Table_A set Col_B = 'XXX' where Col_B = 'YYY') ```
15,531,319
I need to update a table data in database using RAILS migrations. ``` Sample: Table: Table_A(Col_A(number), Col_B(varchar),...) Query: UPDATE Table_A SET Col_B = "XXX" where Col_B = "YYY" ``` What would be the best way to do this using RAILS Migrations. I am not even sure if RAILS migrations is the way to go for up...
2013/03/20
[ "https://Stackoverflow.com/questions/15531319", "https://Stackoverflow.com", "https://Stackoverflow.com/users/518445/" ]
I prefer to do any database data changes in a rake task so that's it's 1. Obvious 2. Repeatable 3. Won't later be executed via `rake db:migrate` The code: ``` namespace :update do desc "Update table A to set Col_B to YYY" task :table_a => :environment do TableA.where(Col_B: "YYY").update_all(Col_B: "XXX"...
``` ActiveRecord::Base.connection.execute("update Table_A set Col_B = 'XXX' where Col_B = 'YYY') ```
15,531,319
I need to update a table data in database using RAILS migrations. ``` Sample: Table: Table_A(Col_A(number), Col_B(varchar),...) Query: UPDATE Table_A SET Col_B = "XXX" where Col_B = "YYY" ``` What would be the best way to do this using RAILS Migrations. I am not even sure if RAILS migrations is the way to go for up...
2013/03/20
[ "https://Stackoverflow.com/questions/15531319", "https://Stackoverflow.com", "https://Stackoverflow.com/users/518445/" ]
This should be done in a rake task... ``` namespace :onetime do task :update_my_data => :environment do TableA.where(Col_B: "YYY").update_all(Col_B: "XXX") end end ``` Then after you deploy: `rake onetime:update_my_data` At my company we delete the contents of the onetime namespace rake task after it's bee...
You can do like this: ``` class YourMigration < ActiveRecord::Migration def up execute('UPDATE Table_A SET Col_B = "XXX" where Col_B = "YYY"') end def down end end ``` Or: ``` class YourMigration < ActiveRecord::Migration def up update('UPDATE Table_A SET Col_B = "XXX" where Col_...
15,531,319
I need to update a table data in database using RAILS migrations. ``` Sample: Table: Table_A(Col_A(number), Col_B(varchar),...) Query: UPDATE Table_A SET Col_B = "XXX" where Col_B = "YYY" ``` What would be the best way to do this using RAILS Migrations. I am not even sure if RAILS migrations is the way to go for up...
2013/03/20
[ "https://Stackoverflow.com/questions/15531319", "https://Stackoverflow.com", "https://Stackoverflow.com/users/518445/" ]
It's usually better to do these sorts of big data updates in a rake task. I usually write them so they have two versions: rake change\_lots\_of\_data:report and rake change\_lots\_of\_data:update. The 'report' version just executes the where clause and spits out a list of what would be changed. The 'update' version use...
You can do like this: ``` class YourMigration < ActiveRecord::Migration def up execute('UPDATE Table_A SET Col_B = "XXX" where Col_B = "YYY"') end def down end end ``` Or: ``` class YourMigration < ActiveRecord::Migration def up update('UPDATE Table_A SET Col_B = "XXX" where Col_...
15,531,319
I need to update a table data in database using RAILS migrations. ``` Sample: Table: Table_A(Col_A(number), Col_B(varchar),...) Query: UPDATE Table_A SET Col_B = "XXX" where Col_B = "YYY" ``` What would be the best way to do this using RAILS Migrations. I am not even sure if RAILS migrations is the way to go for up...
2013/03/20
[ "https://Stackoverflow.com/questions/15531319", "https://Stackoverflow.com", "https://Stackoverflow.com/users/518445/" ]
I prefer to do any database data changes in a rake task so that's it's 1. Obvious 2. Repeatable 3. Won't later be executed via `rake db:migrate` The code: ``` namespace :update do desc "Update table A to set Col_B to YYY" task :table_a => :environment do TableA.where(Col_B: "YYY").update_all(Col_B: "XXX"...
You can do like this: ``` class YourMigration < ActiveRecord::Migration def up execute('UPDATE Table_A SET Col_B = "XXX" where Col_B = "YYY"') end def down end end ``` Or: ``` class YourMigration < ActiveRecord::Migration def up update('UPDATE Table_A SET Col_B = "XXX" where Col_...
15,531,319
I need to update a table data in database using RAILS migrations. ``` Sample: Table: Table_A(Col_A(number), Col_B(varchar),...) Query: UPDATE Table_A SET Col_B = "XXX" where Col_B = "YYY" ``` What would be the best way to do this using RAILS Migrations. I am not even sure if RAILS migrations is the way to go for up...
2013/03/20
[ "https://Stackoverflow.com/questions/15531319", "https://Stackoverflow.com", "https://Stackoverflow.com/users/518445/" ]
It's usually better to do these sorts of big data updates in a rake task. I usually write them so they have two versions: rake change\_lots\_of\_data:report and rake change\_lots\_of\_data:update. The 'report' version just executes the where clause and spits out a list of what would be changed. The 'update' version use...
This should be done in a rake task... ``` namespace :onetime do task :update_my_data => :environment do TableA.where(Col_B: "YYY").update_all(Col_B: "XXX") end end ``` Then after you deploy: `rake onetime:update_my_data` At my company we delete the contents of the onetime namespace rake task after it's bee...
15,531,319
I need to update a table data in database using RAILS migrations. ``` Sample: Table: Table_A(Col_A(number), Col_B(varchar),...) Query: UPDATE Table_A SET Col_B = "XXX" where Col_B = "YYY" ``` What would be the best way to do this using RAILS Migrations. I am not even sure if RAILS migrations is the way to go for up...
2013/03/20
[ "https://Stackoverflow.com/questions/15531319", "https://Stackoverflow.com", "https://Stackoverflow.com/users/518445/" ]
I prefer to do any database data changes in a rake task so that's it's 1. Obvious 2. Repeatable 3. Won't later be executed via `rake db:migrate` The code: ``` namespace :update do desc "Update table A to set Col_B to YYY" task :table_a => :environment do TableA.where(Col_B: "YYY").update_all(Col_B: "XXX"...
This should be done in a rake task... ``` namespace :onetime do task :update_my_data => :environment do TableA.where(Col_B: "YYY").update_all(Col_B: "XXX") end end ``` Then after you deploy: `rake onetime:update_my_data` At my company we delete the contents of the onetime namespace rake task after it's bee...
15,531,319
I need to update a table data in database using RAILS migrations. ``` Sample: Table: Table_A(Col_A(number), Col_B(varchar),...) Query: UPDATE Table_A SET Col_B = "XXX" where Col_B = "YYY" ``` What would be the best way to do this using RAILS Migrations. I am not even sure if RAILS migrations is the way to go for up...
2013/03/20
[ "https://Stackoverflow.com/questions/15531319", "https://Stackoverflow.com", "https://Stackoverflow.com/users/518445/" ]
It's usually better to do these sorts of big data updates in a rake task. I usually write them so they have two versions: rake change\_lots\_of\_data:report and rake change\_lots\_of\_data:update. The 'report' version just executes the where clause and spits out a list of what would be changed. The 'update' version use...
I prefer to do any database data changes in a rake task so that's it's 1. Obvious 2. Repeatable 3. Won't later be executed via `rake db:migrate` The code: ``` namespace :update do desc "Update table A to set Col_B to YYY" task :table_a => :environment do TableA.where(Col_B: "YYY").update_all(Col_B: "XXX"...
41,153,209
I was just example.com have the same thing for every page, even if it is ridiculous such as example.com/2u3094u2p3kj2lk4j? It doesn't seem to be making a redirect. If that isn't the case, what is it? What is the code behind it? Why is the code the same for everypage?
2016/12/14
[ "https://Stackoverflow.com/questions/41153209", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7277510/" ]
Looks like it was a Py2/3 syntax issue, luckily I was able to run 2to3.exe on the folder `C:\Anaconda3\Lib\site-packages\clang` and merge over the fixes [![cindex.py diff results Python 2 vs 3 syntax changes from 2to3.exe](https://i.stack.imgur.com/D4OJY.png)](https://i.stack.imgur.com/D4OJY.png) Now I'm in business....
How the heck 'pip' which I always used for python2.7 became pip for python3? ``` $ pip --version pip 1.5.6 from /usr/lib/python3/dist-packages (python 3.4) ``` But then the setup has been ran by python2.7, causing syntax error. Magic. I called the same, just but ensuring pip for python2.7: ``` pip2 install clang ...
26,487,704
I am using the following vba codes which im using to hide a set of rows and unhide rows depending on if a cell contains text or not, and they are causing my excel spreadsheet to be slow and unresponsive and causing the egg timer to show for about 10 seconds. If I take the code out It speeds things up so what can I do ...
2014/10/21
[ "https://Stackoverflow.com/questions/26487704", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4120297/" ]
The main issue is from the Worksheet\_Change event, but it could be applied to any event. The worksheet change is triggering each time you hide a column, so it's trying several times to hide the same columns, before (eventually) failing with an out of memory error: *Hide these columns... Oh, a worksheet change... Hid...
This works instantly for me: ``` Application.ScreenUpdating = False Select Case Range("K22") Case Is <> "" Rows("25:38").Hidden = False Rows("40:48").Hidden = True Case Else Rows("25:38").Hidden = True Rows("40:48").Hidden = False End Select Application.ScreenUpdating = True ```
7,775,737
I'm porting a FOSS package to HP-UX. I'm down to one compiler warning I just cannot figure out. I should note I'm using HP-UX's bundled free /usr/bin/cc, not the add-on purchased compiler, in order to make the package as widely usable as possible. The compile (which is just cc with no flags) says: ``` Warning 942: "g...
2011/10/15
[ "https://Stackoverflow.com/questions/7775737", "https://Stackoverflow.com", "https://Stackoverflow.com/users/607453/" ]
It seems that `Path` annotation exists in `jersey-core` library. I think you should include that library in your project
Add the **javax.ws.rs.jar** and import : ``` import javax.ws.rs.Path; ``` Is need to help!
48,695,462
I have a simple XML object `<person>` created with [`xml.etree.ElementTree`](https://docs.python.org/3/library/xml.etree.elementtree.html). ``` <person name='John' age='21' /> ``` I want to modify the XML element to remove the `age` attribute. ``` <person name='John' /> ``` I can access the attribute using [`.get...
2018/02/08
[ "https://Stackoverflow.com/questions/48695462", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3357935/" ]
You can try `del xml.attrib["age"]` ``` import xml.etree.ElementTree as ElementTree xml = ElementTree.Element('person', Name="john", age="21") print(xml.items()) del xml.attrib["age"] print(xml.items()) ``` Will produce: ``` [('Name', 'john'), ('age', '21')] [('Name', 'john')] ```
Use `xml.attrib.pop("age")`. ``` from xml.etree import ElementTree xml = ElementTree.Element('person', name="john", age="21") print(ElementTree.tostring(xml).decode()) xml.attrib.pop("age") print(ElementTree.tostring(xml).decode()) ``` Output: ``` <person name='John' age='21' /> <person name='John' /> ``` Expla...
8,474,595
I have a quite weird problem with some Android projects and Eclipse. I have a number of Android projects that all use much of the same code, and have therefore moved a lot of code into an Android Library project. This has, for a long time, worked quite well for three apps. Today, I wanted to use the library for a fourt...
2011/12/12
[ "https://Stackoverflow.com/questions/8474595", "https://Stackoverflow.com", "https://Stackoverflow.com/users/367379/" ]
I just hit this same problem. In my case I had it set properly for the Java build path but forgot to add the library. Go to Properties -> Android then click "Add..." in the Library section then add the library project. After that it ran as expected.
Sometimes the android plugin does not generate the resources very well which cause to such issues. Try following simple procedure: 1. Change some id in one of the layout xml and save the xml (any layout that is in the project will do). 2. After the project compiled by the plug in change the id back and save. If this ...
8,474,595
I have a quite weird problem with some Android projects and Eclipse. I have a number of Android projects that all use much of the same code, and have therefore moved a lot of code into an Android Library project. This has, for a long time, worked quite well for three apps. Today, I wanted to use the library for a fourt...
2011/12/12
[ "https://Stackoverflow.com/questions/8474595", "https://Stackoverflow.com", "https://Stackoverflow.com/users/367379/" ]
I just hit this same problem. In my case I had it set properly for the Java build path but forgot to add the library. Go to Properties -> Android then click "Add..." in the Library section then add the library project. After that it ran as expected.
I solved including the jar in the buildpath of the final project. The buildpath of the library apparently was not enough. It sucks, but at the least it works.
74,603
The numerical coincidence that triggered Dirac to postulate his Large Number Hypothesis can be summarized by expressing the proton-electron gravitational angular momentum in units $\hbar c$: $$\frac{G m\_p m\_e}{\hbar c} = 10^{-41.49}$$ and the Hubble parameter $H\_0$ (a measure for the inverse of the lifetime of the...
2013/08/19
[ "https://physics.stackexchange.com/questions/74603", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/1268/" ]
In 1988, Weinberg used an equivalent relation as an historical starting point for the weak anthropic principle, in his "The cosmological constant problem". I quote, page 7: > > An example is provided by what I think is the first use of anthropic arguments in modern physics, by Dicke (1961), in response to a problem p...
Weinberg Relation /1,2 / Mass pion ~ (hn^2*Ho/G*c)^1/3 . where hn = h/2π = reduced planck constant. Ho = Hubble constant. G = Newton constant. c = light speed. It is very surprised. Why pion mass is related to Hubble constant ? /1/ The well known Weinberg Relation for pion mass is calculated and explained /2/. Mas...
150,479
I'm working through a contour integral question, which is rounded off by finding the integral: $$\int^{\infty}\_{0} \frac{x-\sin(x)}{x^3} dx$$ I have already shown that the residue at $0$ of the function $$f(z)=\frac{1+iz-e^{iz}}{z^3}$$ on $\mathbb{C} - \{0\}$ is $\frac{1}{2}$, and that $$\int\_{\gamma\_R} f(z) d...
2012/05/27
[ "https://math.stackexchange.com/questions/150479", "https://math.stackexchange.com", "https://math.stackexchange.com/users/20801/" ]
Since the integrand is even, $$ \int^{\infty}\_{0} \frac{x-\sin(x)}{x^3}\,dx=\frac12\int^{\infty}\_{-\infty} \frac{x-\sin(x)}{x^3}\,dx. $$ Take $\epsilon>0$ small and $R>0$ large. The integral of $f(z)$ along the closed path formed by the segment $[\epsilon,R]$, the semi-circumference $\gamma\_R$ counterclockwise, the ...
Since the integrand has no singularities and the it vanishes on $x+it$ for $t\in[-1,0]$ as $|x|\to\infty$, we get $$ \begin{align} \int\_0^\infty\frac{x-\sin(x)}{x^3}\mathrm{d}x &=\frac12\int\_{-\infty}^\infty\frac{x-\sin(x)}{x^3}\mathrm{d}x\\ &=\frac12\int\_{-\infty-i}^{\infty-i}\frac{x-\sin(x)}{x^3}\mathrm{d}x\\ &=\f...
3,063,930
I have a simple string which is delimited by some character, let's say a comma. I should be able to create a TStringList and set it's delimiter to a comma then set the DelimitedText to the text I want to parse and it should be automaticlly parsed. The problem is when I look at the output it also includes spaces as del...
2010/06/17
[ "https://Stackoverflow.com/questions/3063930", "https://Stackoverflow.com", "https://Stackoverflow.com/users/332617/" ]
There's a StrictDelimiter property on the TStringList. Set it to True and it will only parse on the delimiter, not the spaces.
That's standard, documented behavior of the [`TStrings.DelimitedText`](http://docwiki.embarcadero.com/VCL/en/Classes.TStrings.DelimitedText) property. You want to set the [`StrictDelimiter`](http://docwiki.embarcadero.com/VCL/en/Classes.TStrings.StrictDelimiter) property to *true* to disable that behavior.