qid
int64
1
74.7M
question
stringlengths
15
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
4
30.2k
response_k
stringlengths
11
36.5k
32,526,935
I have several go routines and I use **unbuffered channels** as sync mechanism. I'm wondering if there is anything wrong in this(e.g. compared with a WaitGroup implementation). A known **"drawback"** that I'm aware of is that two go routines may stay blocked until the 3rd(last) one completes because the channel is no...
2015/09/11
[ "https://Stackoverflow.com/questions/32526935", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4063955/" ]
`\z` only matches the very end of the string. `\Z` also matches the very end of the string, but if the string ends with a newline, then `\Z` also matches immediately before the newline. So, for example, these five are true: ``` 'foo' =~ m/foo\z/ 'foo' =~ m/foo\Z/ "foo\n" =~ m/foo\Z/ "foo\n" =~ m/foo\n\z/ "foo\n" =~ ...
* `\A` matches zero characters at position 0. * `\z` matches zero characters at the end of the string. * `\Z` matches zero characters at the end of the string and at a trailing line feed. * `^` without `/m` is the same as `\A`. * `^` with `/m` matches zero characters at position 0 and after a line feed. * `$` without ...
26,651,494
I have a such hierarchy: ``` public interface IModule { void Method1(); void Method2(); } public interface IPublic { IModule Module { get; } } ``` In my stuff (feature toggle) i need to hide Method2() for a some time from public interface and make it internal. It will be used in tests, but will be hidde...
2014/10/30
[ "https://Stackoverflow.com/questions/26651494", "https://Stackoverflow.com", "https://Stackoverflow.com/users/529332/" ]
On the first iteration of: ``` for(int j=arr.length;j>i+1;j--){ arr[j]=arr[j-1]; } ``` You will access `arr[arr.length]` which is out of bounds. You need to start the cycle from `arr.length - 1`, to make sure you are never accessing an invalid cycle.
Array index is always starts with zero 0. For e.g. `int a[]=new int[10];` means first index is a[0] last index is a[9] not a[10]. Since 0 to 9 there are 10 memory locations which is called array length. for instance by calling a[10] which is index is out of bounds throws an `ArrayoutofboundsException`. In your co...
52,160,923
I am using Jenkins to deploy a war file in GlassFish 4 server.But unable to deploy war file in Glassfish 4 server. I am following below process. [![enter image description here](https://i.stack.imgur.com/fdIxd.png)](https://i.stack.imgur.com/fdIxd.png) But it gives following error at the build time. > > ERROR:...
2018/09/04
[ "https://Stackoverflow.com/questions/52160923", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9046596/" ]
I was able to delopy to glassfish 4 using any one method from following two methods: 1. Method 1 Using new version of Deploy to container Plugin You can clone following from github (Note: you can try with new version of plugin) <https://github.com/jenkinsci/deploy-plugin/tree/205715c3556ade8d8665de677ebb41e35ee64793...
Example using Windows batchfile ``` @ECHO OFF :: BAT START GLASSFISH 5 SERVER ECHO ============================ ECHO STOPING GLASSFISH 5 ECHO ============================ tasklist | find /i "java.exe" && taskkill /im java.exe /F || echo process "java.exe" not running. ECHO ============================ ECHO NETWORK IN...
52,160,923
I am using Jenkins to deploy a war file in GlassFish 4 server.But unable to deploy war file in Glassfish 4 server. I am following below process. [![enter image description here](https://i.stack.imgur.com/fdIxd.png)](https://i.stack.imgur.com/fdIxd.png) But it gives following error at the build time. > > ERROR:...
2018/09/04
[ "https://Stackoverflow.com/questions/52160923", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9046596/" ]
Change the Glassfish hostname to 127.0.0.1 or localhost it's work for me!
Example using Windows batchfile ``` @ECHO OFF :: BAT START GLASSFISH 5 SERVER ECHO ============================ ECHO STOPING GLASSFISH 5 ECHO ============================ tasklist | find /i "java.exe" && taskkill /im java.exe /F || echo process "java.exe" not running. ECHO ============================ ECHO NETWORK IN...
11,807,447
I'm wanting to know if it is possible to convert this code below, so that it only needs 1 query instead of allot more query's? the items table is filled with well over 10k items, and the below way, just takes so long, is there a faster way of displaying the uncategorised item? ``` $CD1=mysql_query("select * FROM items...
2012/08/04
[ "https://Stackoverflow.com/questions/11807447", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1535726/" ]
You should use outer join and where clause to filter items with no categories ``` SELECT i.* FROM items i LEFT OUTER JOIN category c ON i.sub = c.id WHERE c.id IS NULL ```
One common way to find rows in one table that don't have corresponding rows in another is with a left join: ``` select id, sub from items i left join category c on i.sub = c.sub where c.sub is null ``` One note, you should avoid `select *` in anything other than test code.
24,252,387
I have an algorithm that takes data, sorts it, analyzes it, and then returns scores for the sorted data. However, the scores correspond to the sorted data, and I'd really like to return scores that correspond to the unsorted data. I figured there had to be some default R function that does this, but I've had no luck fi...
2014/06/16
[ "https://Stackoverflow.com/questions/24252387", "https://Stackoverflow.com", "https://Stackoverflow.com/users/996838/" ]
what about just: ``` orig = rnorm(100000) ord = order(orig) new = orig[ord] reprod = rep(0,length(new)) reprod[ord] = new ```
One nice thing about the ordering vector (the result of the `order` function) is that if you run `order` on the result it gives you the inverse sorting, in other words it tells you how to unsort. Here is a quick example of what I think you are trying to do in a simple way ``` > orig <- rnorm(10) > ord <- order(orig) >...
68,369
Can I user **form\_alter** to move move "description" below the "label" for a field in a form? Let´s say I want to move the "description" of the "body" field for the basic page content type.
2013/04/01
[ "https://drupal.stackexchange.com/questions/68369", "https://drupal.stackexchange.com", "https://drupal.stackexchange.com/users/1352/" ]
Have a look at [Label help module](http://drupal.org/project/label_help). It just creates a second help field that will appear directly below the form element's label. It is a simple way to turn around the problem. Or try something like ``` jQuery(document).ready(function ($) { // move the help text from below t...
Here's a generic way using jQuery ``` '.form-group p.help-block' ``` is the child element is the text you want to move. ``` '.form-group label' ``` is the parent element - this where you want to put the text. This will move each child element within it's own parent element. Works for any elements you want to...
68,369
Can I user **form\_alter** to move move "description" below the "label" for a field in a form? Let´s say I want to move the "description" of the "body" field for the basic page content type.
2013/04/01
[ "https://drupal.stackexchange.com/questions/68369", "https://drupal.stackexchange.com", "https://drupal.stackexchange.com/users/1352/" ]
You can't move it, but you can always work around things in Drupal. A [hook\_form\_alter()](http://api.drupal.org/api/drupal/modules!system!system.api.php/function/hook_form_alter/7) or better [hook\_form\_FORM\_ID\_alter()](http://api.drupal.org/api/drupal/modules!system!system.api.php/function/hook_form_FORM_ID_alt...
This isn't a very Drupally solution, but it was an easy front-end fix. Styles were designed to work with the Olivero 9.5.2 theme. It uses jQuery to move the elements around in the DOM after the page has been loaded (for text fields and fieldgroups so far) This moves the descriptions up under the labels: ``` $=jQuery;...
68,369
Can I user **form\_alter** to move move "description" below the "label" for a field in a form? Let´s say I want to move the "description" of the "body" field for the basic page content type.
2013/04/01
[ "https://drupal.stackexchange.com/questions/68369", "https://drupal.stackexchange.com", "https://drupal.stackexchange.com/users/1352/" ]
You can't move it, but you can always work around things in Drupal. A [hook\_form\_alter()](http://api.drupal.org/api/drupal/modules!system!system.api.php/function/hook_form_alter/7) or better [hook\_form\_FORM\_ID\_alter()](http://api.drupal.org/api/drupal/modules!system!system.api.php/function/hook_form_FORM_ID_alt...
Here's a generic way using jQuery ``` '.form-group p.help-block' ``` is the child element is the text you want to move. ``` '.form-group label' ``` is the parent element - this where you want to put the text. This will move each child element within it's own parent element. Works for any elements you want to...
68,369
Can I user **form\_alter** to move move "description" below the "label" for a field in a form? Let´s say I want to move the "description" of the "body" field for the basic page content type.
2013/04/01
[ "https://drupal.stackexchange.com/questions/68369", "https://drupal.stackexchange.com", "https://drupal.stackexchange.com/users/1352/" ]
Welcome to the debate. it has been going on for some time. Check out this discussion for D8: [Make position of #description configurable](http://drupal.org/node/314385) and this: [Form Field Description should be between Label and Field](http://drupal.org/node/1122894). This will give you a perspective on the 5 years ...
This isn't a very Drupally solution, but it was an easy front-end fix. Styles were designed to work with the Olivero 9.5.2 theme. It uses jQuery to move the elements around in the DOM after the page has been loaded (for text fields and fieldgroups so far) This moves the descriptions up under the labels: ``` $=jQuery;...
68,369
Can I user **form\_alter** to move move "description" below the "label" for a field in a form? Let´s say I want to move the "description" of the "body" field for the basic page content type.
2013/04/01
[ "https://drupal.stackexchange.com/questions/68369", "https://drupal.stackexchange.com", "https://drupal.stackexchange.com/users/1352/" ]
Have a look at [Label help module](http://drupal.org/project/label_help). It just creates a second help field that will appear directly below the form element's label. It is a simple way to turn around the problem. Or try something like ``` jQuery(document).ready(function ($) { // move the help text from below t...
This can be done with [hook\_form\_alter()](https://api.drupal.org/api/drupal/modules!system!system.api.php/function/hook_form_alter/7) and [#field\_prefix](https://api.drupal.org/api/drupal/developer!topics!forms_api_reference.html/7#field_prefix). For example, we can take the *description* of the *body* field for the...
68,369
Can I user **form\_alter** to move move "description" below the "label" for a field in a form? Let´s say I want to move the "description" of the "body" field for the basic page content type.
2013/04/01
[ "https://drupal.stackexchange.com/questions/68369", "https://drupal.stackexchange.com", "https://drupal.stackexchange.com/users/1352/" ]
You can't move it, but you can always work around things in Drupal. A [hook\_form\_alter()](http://api.drupal.org/api/drupal/modules!system!system.api.php/function/hook_form_alter/7) or better [hook\_form\_FORM\_ID\_alter()](http://api.drupal.org/api/drupal/modules!system!system.api.php/function/hook_form_FORM_ID_alt...
Welcome to the debate. it has been going on for some time. Check out this discussion for D8: [Make position of #description configurable](http://drupal.org/node/314385) and this: [Form Field Description should be between Label and Field](http://drupal.org/node/1122894). This will give you a perspective on the 5 years ...
68,369
Can I user **form\_alter** to move move "description" below the "label" for a field in a form? Let´s say I want to move the "description" of the "body" field for the basic page content type.
2013/04/01
[ "https://drupal.stackexchange.com/questions/68369", "https://drupal.stackexchange.com", "https://drupal.stackexchange.com/users/1352/" ]
Have a look at [Label help module](http://drupal.org/project/label_help). It just creates a second help field that will appear directly below the form element's label. It is a simple way to turn around the problem. Or try something like ``` jQuery(document).ready(function ($) { // move the help text from below t...
You can't move it, but you can always work around things in Drupal. A [hook\_form\_alter()](http://api.drupal.org/api/drupal/modules!system!system.api.php/function/hook_form_alter/7) or better [hook\_form\_FORM\_ID\_alter()](http://api.drupal.org/api/drupal/modules!system!system.api.php/function/hook_form_FORM_ID_alt...
68,369
Can I user **form\_alter** to move move "description" below the "label" for a field in a form? Let´s say I want to move the "description" of the "body" field for the basic page content type.
2013/04/01
[ "https://drupal.stackexchange.com/questions/68369", "https://drupal.stackexchange.com", "https://drupal.stackexchange.com/users/1352/" ]
Have a look at [Label help module](http://drupal.org/project/label_help). It just creates a second help field that will appear directly below the form element's label. It is a simple way to turn around the problem. Or try something like ``` jQuery(document).ready(function ($) { // move the help text from below t...
Drupal 7 -------- The module [Form element layout](https://www.drupal.org/project/fel "Form Element Layout") solves this both at API level and through the Field settings UI. As a developer you would use the FAPI attribute `#description_display` and set it `before` if you want it between the `#title` and `#children`, ...
68,369
Can I user **form\_alter** to move move "description" below the "label" for a field in a form? Let´s say I want to move the "description" of the "body" field for the basic page content type.
2013/04/01
[ "https://drupal.stackexchange.com/questions/68369", "https://drupal.stackexchange.com", "https://drupal.stackexchange.com/users/1352/" ]
Drupal 7 -------- The module [Form element layout](https://www.drupal.org/project/fel "Form Element Layout") solves this both at API level and through the Field settings UI. As a developer you would use the FAPI attribute `#description_display` and set it `before` if you want it between the `#title` and `#children`, ...
Here's a generic way using jQuery ``` '.form-group p.help-block' ``` is the child element is the text you want to move. ``` '.form-group label' ``` is the parent element - this where you want to put the text. This will move each child element within it's own parent element. Works for any elements you want to...
68,369
Can I user **form\_alter** to move move "description" below the "label" for a field in a form? Let´s say I want to move the "description" of the "body" field for the basic page content type.
2013/04/01
[ "https://drupal.stackexchange.com/questions/68369", "https://drupal.stackexchange.com", "https://drupal.stackexchange.com/users/1352/" ]
Drupal 7 -------- The module [Form element layout](https://www.drupal.org/project/fel "Form Element Layout") solves this both at API level and through the Field settings UI. As a developer you would use the FAPI attribute `#description_display` and set it `before` if you want it between the `#title` and `#children`, ...
This can be done with [hook\_form\_alter()](https://api.drupal.org/api/drupal/modules!system!system.api.php/function/hook_form_alter/7) and [#field\_prefix](https://api.drupal.org/api/drupal/developer!topics!forms_api_reference.html/7#field_prefix). For example, we can take the *description* of the *body* field for the...
17,076,984
Little bit of a silly question, but I am learning maybe you can teach me something!! I sometimes have mysqli queries that are 5 or 6 lines long, I first test them using phpmyadmin where I can press enter to "lay them out" neater for me to see when coding. If I copy and paste them into my php file, they won't work beca...
2013/06/12
[ "https://Stackoverflow.com/questions/17076984", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1844960/" ]
PHP doesn't care much about what lines things are on - that's what the semicolons are there for. And neither does MySQL, so you could easily do this: ``` $query = "SELECT ... FROM ... WHERE ..."; ``` And that can definitely help readability when it comes to longer queries!
You can use heredoc, but you should have no problem with line breaks in a string. I often have strings span multiple lines. Heredoc would be a good choice for you though. <http://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc>
17,076,984
Little bit of a silly question, but I am learning maybe you can teach me something!! I sometimes have mysqli queries that are 5 or 6 lines long, I first test them using phpmyadmin where I can press enter to "lay them out" neater for me to see when coding. If I copy and paste them into my php file, they won't work beca...
2013/06/12
[ "https://Stackoverflow.com/questions/17076984", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1844960/" ]
PHP doesn't care much about what lines things are on - that's what the semicolons are there for. And neither does MySQL, so you could easily do this: ``` $query = "SELECT ... FROM ... WHERE ..."; ``` And that can definitely help readability when it comes to longer queries!
I'm picky about the query layout in php, especially when it comes to long complicated queries. It just makes it so much more readable. My Preference ------------- Personally I like the way this looks, ``` $query = "SELECT ". " * ". "FROM ". " people ". "where ". " people.name = 'bob'"; ``` Why...
17,076,984
Little bit of a silly question, but I am learning maybe you can teach me something!! I sometimes have mysqli queries that are 5 or 6 lines long, I first test them using phpmyadmin where I can press enter to "lay them out" neater for me to see when coding. If I copy and paste them into my php file, they won't work beca...
2013/06/12
[ "https://Stackoverflow.com/questions/17076984", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1844960/" ]
You can use heredoc, but you should have no problem with line breaks in a string. I often have strings span multiple lines. Heredoc would be a good choice for you though. <http://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc>
I'm picky about the query layout in php, especially when it comes to long complicated queries. It just makes it so much more readable. My Preference ------------- Personally I like the way this looks, ``` $query = "SELECT ". " * ". "FROM ". " people ". "where ". " people.name = 'bob'"; ``` Why...
8,074,642
I have a library project in which I define an action bar in layout file `action_bar.xml` like this : ``` <?xml version="1.0" encoding="utf-8"?> <merge xmlns:android="http://schemas.android.com/apk/res/android"> <LinearLayout style="@style/actionBar" /> </merge> ``` The corresponding style element is...
2011/11/10
[ "https://Stackoverflow.com/questions/8074642", "https://Stackoverflow.com", "https://Stackoverflow.com/users/500865/" ]
Even though eclipse gave me this error. I was able to run the app which was using the library project and the behaviour seen was the expected one. I think this is something to do with eclipse.
@Promod, You have opened a Linear layout in Action\_bar.xml. But you have not added any items inside the linear layout. 1. Linear layout needs minimum parameters like, layout\_width, layout\_height. Try adding them.
8,074,642
I have a library project in which I define an action bar in layout file `action_bar.xml` like this : ``` <?xml version="1.0" encoding="utf-8"?> <merge xmlns:android="http://schemas.android.com/apk/res/android"> <LinearLayout style="@style/actionBar" /> </merge> ``` The corresponding style element is...
2011/11/10
[ "https://Stackoverflow.com/questions/8074642", "https://Stackoverflow.com", "https://Stackoverflow.com/users/500865/" ]
This appears to be a documented ADT bug [here](http://code.google.com/p/android/issues/detail?id=21051) and [here](http://code.google.com/p/android/issues/detail?id=21404) and still exists in ADT R16.
@Promod, You have opened a Linear layout in Action\_bar.xml. But you have not added any items inside the linear layout. 1. Linear layout needs minimum parameters like, layout\_width, layout\_height. Try adding them.
8,074,642
I have a library project in which I define an action bar in layout file `action_bar.xml` like this : ``` <?xml version="1.0" encoding="utf-8"?> <merge xmlns:android="http://schemas.android.com/apk/res/android"> <LinearLayout style="@style/actionBar" /> </merge> ``` The corresponding style element is...
2011/11/10
[ "https://Stackoverflow.com/questions/8074642", "https://Stackoverflow.com", "https://Stackoverflow.com/users/500865/" ]
Even though eclipse gave me this error. I was able to run the app which was using the library project and the behaviour seen was the expected one. I think this is something to do with eclipse.
This appears to be a documented ADT bug [here](http://code.google.com/p/android/issues/detail?id=21051) and [here](http://code.google.com/p/android/issues/detail?id=21404) and still exists in ADT R16.
8,074,642
I have a library project in which I define an action bar in layout file `action_bar.xml` like this : ``` <?xml version="1.0" encoding="utf-8"?> <merge xmlns:android="http://schemas.android.com/apk/res/android"> <LinearLayout style="@style/actionBar" /> </merge> ``` The corresponding style element is...
2011/11/10
[ "https://Stackoverflow.com/questions/8074642", "https://Stackoverflow.com", "https://Stackoverflow.com/users/500865/" ]
Even though eclipse gave me this error. I was able to run the app which was using the library project and the behaviour seen was the expected one. I think this is something to do with eclipse.
launch eclipse with the **-clean** option and your problem is fixed. It will take about 30 seconds longer to launch though
8,074,642
I have a library project in which I define an action bar in layout file `action_bar.xml` like this : ``` <?xml version="1.0" encoding="utf-8"?> <merge xmlns:android="http://schemas.android.com/apk/res/android"> <LinearLayout style="@style/actionBar" /> </merge> ``` The corresponding style element is...
2011/11/10
[ "https://Stackoverflow.com/questions/8074642", "https://Stackoverflow.com", "https://Stackoverflow.com/users/500865/" ]
This appears to be a documented ADT bug [here](http://code.google.com/p/android/issues/detail?id=21051) and [here](http://code.google.com/p/android/issues/detail?id=21404) and still exists in ADT R16.
launch eclipse with the **-clean** option and your problem is fixed. It will take about 30 seconds longer to launch though
536,984
Is there a fairly clean way to migrate from Mint (Petra, Cinnamon, 64bit) to Ubuntu (14.04 LTS, Gnome, 64bit) without losing most of my setup and application installs? FWIW, /var and /home are on separate volumes from /boot and /
2014/10/14
[ "https://askubuntu.com/questions/536984", "https://askubuntu.com", "https://askubuntu.com/users/36126/" ]
1. Backup the home folder 2. Wipe the partition and install Ubuntu from scratch. 3. Restore the home folder. I wish there was an easy tool for migrating between distributions, but I don't think anything like that exists.
try **AptOnCD** install aptoncd in Mint :- `sudo apt-get install aptoncd` ![Create a backup](https://i.stack.imgur.com/KVes7.png) ![enter image description here](https://i.stack.imgur.com/sXKhK.png) ![enter image description here](https://i.stack.imgur.com/sKssQ.png) After taking backup **(.ISO)** from Mint then i...
10,248,888
I have console applicaiotn that currently uses CAsyncSocket. I need to implement SSL so after some searching I found this project: <http://www.codeproject.com/Articles/3915/CAsyncSslSocketLayer-SSL-layer-class-for-CAsyncSoc> For some reason same simple code that works fine on GUI code does not work in console app. Has...
2012/04/20
[ "https://Stackoverflow.com/questions/10248888", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1283791/" ]
Not at all. In the case of arr[0], **arr** has a well defined address. In the case of \*arr, **arr** is just uninitialized. *After your EDIT*, where you initialize the **const arr** with an array defined just before : there would just be no difference in the content of the variables, but in the actions you would be ...
A zero-length array points to a specific address, the beginning of the array. After the end of the array, you will have undefined data, in this case, at the address pointed to. ``` int arr[0]; int* ptr; // arr is a reliable value; // *arr is not; // ptr is not; ``` One way this is useful: <http://gcc.gnu.org/online...
10,248,888
I have console applicaiotn that currently uses CAsyncSocket. I need to implement SSL so after some searching I found this project: <http://www.codeproject.com/Articles/3915/CAsyncSslSocketLayer-SSL-layer-class-for-CAsyncSoc> For some reason same simple code that works fine on GUI code does not work in console app. Has...
2012/04/20
[ "https://Stackoverflow.com/questions/10248888", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1283791/" ]
Not at all. In the case of arr[0], **arr** has a well defined address. In the case of \*arr, **arr** is just uninitialized. *After your EDIT*, where you initialize the **const arr** with an array defined just before : there would just be no difference in the content of the variables, but in the actions you would be ...
A locally declared zero-length array is illegal in C++ so it's not the same as an unallocated pointer.
10,248,888
I have console applicaiotn that currently uses CAsyncSocket. I need to implement SSL so after some searching I found this project: <http://www.codeproject.com/Articles/3915/CAsyncSslSocketLayer-SSL-layer-class-for-CAsyncSoc> For some reason same simple code that works fine on GUI code does not work in console app. Has...
2012/04/20
[ "https://Stackoverflow.com/questions/10248888", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1283791/" ]
A locally declared zero-length array is illegal in C++ so it's not the same as an unallocated pointer.
A zero-length array points to a specific address, the beginning of the array. After the end of the array, you will have undefined data, in this case, at the address pointed to. ``` int arr[0]; int* ptr; // arr is a reliable value; // *arr is not; // ptr is not; ``` One way this is useful: <http://gcc.gnu.org/online...
19,479,196
Is there a better way to do this to reduce code duplication? Maybe somehow loop the 'pagesTop' array? The following function is initialized on the windows scroll event. Thanks. ``` function redrawSideNav() { var pagesTop = new Array(); $('.page').each(function(index, elem){ pagesTop[index] = $(this)...
2013/10/20
[ "https://Stackoverflow.com/questions/19479196", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1317703/" ]
It provides HTTP content based on a string. Example: -------- Adding the content on HTTPResponseMessage Object ``` response.Content = new StringContent("Place response text here"); ```
Every response that is basically text encoded can be represented as `StringContent`. Html reponse is text too (with proper content type set): ``` response.Content = new StringContent("<html><head>...</head><body>....</body></html>") ``` On the other side, if you download/upload file, that is binary content, so it c...
19,479,196
Is there a better way to do this to reduce code duplication? Maybe somehow loop the 'pagesTop' array? The following function is initialized on the windows scroll event. Thanks. ``` function redrawSideNav() { var pagesTop = new Array(); $('.page').each(function(index, elem){ pagesTop[index] = $(this)...
2013/10/20
[ "https://Stackoverflow.com/questions/19479196", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1317703/" ]
It provides HTTP content based on a string. Example: -------- Adding the content on HTTPResponseMessage Object ``` response.Content = new StringContent("Place response text here"); ```
Whenever I want to send an object to web api server I use StringContent to add format to HTTP content, for example to add Customer object as json to server: ``` public void AddCustomer(Customer customer) { String apiUrl = "Web api Address"; HttpClient _client= new HttpClient(); string Jso...
19,479,196
Is there a better way to do this to reduce code duplication? Maybe somehow loop the 'pagesTop' array? The following function is initialized on the windows scroll event. Thanks. ``` function redrawSideNav() { var pagesTop = new Array(); $('.page').each(function(index, elem){ pagesTop[index] = $(this)...
2013/10/20
[ "https://Stackoverflow.com/questions/19479196", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1317703/" ]
StringContent class creates a formatted text appropriate for the http server/client communication. After a client request, a server will respond with a `HttpResponseMessage`and that response will need a content, that can be created with the `StringContent` class. Example: ``` string csv = "content here"; var respon...
Every response that is basically text encoded can be represented as `StringContent`. Html reponse is text too (with proper content type set): ``` response.Content = new StringContent("<html><head>...</head><body>....</body></html>") ``` On the other side, if you download/upload file, that is binary content, so it c...
19,479,196
Is there a better way to do this to reduce code duplication? Maybe somehow loop the 'pagesTop' array? The following function is initialized on the windows scroll event. Thanks. ``` function redrawSideNav() { var pagesTop = new Array(); $('.page').each(function(index, elem){ pagesTop[index] = $(this)...
2013/10/20
[ "https://Stackoverflow.com/questions/19479196", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1317703/" ]
Whenever I want to send an object to web api server I use StringContent to add format to HTTP content, for example to add Customer object as json to server: ``` public void AddCustomer(Customer customer) { String apiUrl = "Web api Address"; HttpClient _client= new HttpClient(); string Jso...
Every response that is basically text encoded can be represented as `StringContent`. Html reponse is text too (with proper content type set): ``` response.Content = new StringContent("<html><head>...</head><body>....</body></html>") ``` On the other side, if you download/upload file, that is binary content, so it c...
19,479,196
Is there a better way to do this to reduce code duplication? Maybe somehow loop the 'pagesTop' array? The following function is initialized on the windows scroll event. Thanks. ``` function redrawSideNav() { var pagesTop = new Array(); $('.page').each(function(index, elem){ pagesTop[index] = $(this)...
2013/10/20
[ "https://Stackoverflow.com/questions/19479196", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1317703/" ]
StringContent class creates a formatted text appropriate for the http server/client communication. After a client request, a server will respond with a `HttpResponseMessage`and that response will need a content, that can be created with the `StringContent` class. Example: ``` string csv = "content here"; var respon...
Whenever I want to send an object to web api server I use StringContent to add format to HTTP content, for example to add Customer object as json to server: ``` public void AddCustomer(Customer customer) { String apiUrl = "Web api Address"; HttpClient _client= new HttpClient(); string Jso...
26,720,109
For the following code: ``` class A { public: const int cx = 5; }; ``` Here, an instance of cx will be created for every object of A. Which seems a waste to me, as cx can never be modified. Actually, I don't see any reason why compiler shouldn't enforce making a const data member static. Can anybody please expla...
2014/11/03
[ "https://Stackoverflow.com/questions/26720109", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2790081/" ]
A const data member does not have to be the same for all instances. You can initialize it in the constructor. ``` class A { public: A(int n) :cx(n) {} const int cx; }; int main() { A a1(10); A a2(100); } ```
> > Actually, I don't see any reason why compiler shouldn't enforce making > a const data member static. > > > Have you considered that `cx` might be initialized in the constructor with a value known at run-time - and varying between different instances of `A`? `const` members make assignment to them impossibl...
26,720,109
For the following code: ``` class A { public: const int cx = 5; }; ``` Here, an instance of cx will be created for every object of A. Which seems a waste to me, as cx can never be modified. Actually, I don't see any reason why compiler shouldn't enforce making a const data member static. Can anybody please expla...
2014/11/03
[ "https://Stackoverflow.com/questions/26720109", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2790081/" ]
A const data member does not have to be the same for all instances. You can initialize it in the constructor. ``` class A { public: A(int n) :cx(n) {} const int cx; }; int main() { A a1(10); A a2(100); } ```
If the value is initialized with a constant, as in your example, it's probably better that it be static. But that's not always the case; it's quite frequent to have something like: ``` class Matrix { const int myRowCount; const int myColumnCount; std::vector<double> myData; // ... public: Matrix( ...
26,720,109
For the following code: ``` class A { public: const int cx = 5; }; ``` Here, an instance of cx will be created for every object of A. Which seems a waste to me, as cx can never be modified. Actually, I don't see any reason why compiler shouldn't enforce making a const data member static. Can anybody please expla...
2014/11/03
[ "https://Stackoverflow.com/questions/26720109", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2790081/" ]
A const data member does not have to be the same for all instances. You can initialize it in the constructor. ``` class A { public: A(int n) :cx(n) {} const int cx; }; int main() { A a1(10); A a2(100); } ```
There are some limitations on using non-static const member. Let's say there's class Employee. First, although the compiler can generate a correctly-working copy constructor , it cannot generate an assignment operator. If a program creates two Employee objects e1 and e2, the statement e1 = e2 will cause a compiler dia...
26,720,109
For the following code: ``` class A { public: const int cx = 5; }; ``` Here, an instance of cx will be created for every object of A. Which seems a waste to me, as cx can never be modified. Actually, I don't see any reason why compiler shouldn't enforce making a const data member static. Can anybody please expla...
2014/11/03
[ "https://Stackoverflow.com/questions/26720109", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2790081/" ]
> > Actually, I don't see any reason why compiler shouldn't enforce making > a const data member static. > > > Have you considered that `cx` might be initialized in the constructor with a value known at run-time - and varying between different instances of `A`? `const` members make assignment to them impossibl...
If the value is initialized with a constant, as in your example, it's probably better that it be static. But that's not always the case; it's quite frequent to have something like: ``` class Matrix { const int myRowCount; const int myColumnCount; std::vector<double> myData; // ... public: Matrix( ...
26,720,109
For the following code: ``` class A { public: const int cx = 5; }; ``` Here, an instance of cx will be created for every object of A. Which seems a waste to me, as cx can never be modified. Actually, I don't see any reason why compiler shouldn't enforce making a const data member static. Can anybody please expla...
2014/11/03
[ "https://Stackoverflow.com/questions/26720109", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2790081/" ]
> > Actually, I don't see any reason why compiler shouldn't enforce making > a const data member static. > > > Have you considered that `cx` might be initialized in the constructor with a value known at run-time - and varying between different instances of `A`? `const` members make assignment to them impossibl...
There are some limitations on using non-static const member. Let's say there's class Employee. First, although the compiler can generate a correctly-working copy constructor , it cannot generate an assignment operator. If a program creates two Employee objects e1 and e2, the statement e1 = e2 will cause a compiler dia...
25,203,148
I have a view and I want to draw a shape on it (circle for example) after click. ![enter image description here](https://i.stack.imgur.com/FM4Md.png) I've tried to do this but there are two problems - 1. onDraw is never called. 2. Not sure the setLayoutParams(v.getLayoutParams) will give me the result I want. ``` ...
2014/08/08
[ "https://Stackoverflow.com/questions/25203148", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2463875/" ]
As I'm sure you'll need to customize this quite a bit, I've left things rather generic. The following example will animate a blue circle being drawn clockwise, starting from the east (0 degrees), on top of the View's content when the View is clicked. ``` public class CircleView extends View { private static final ...
If you want to mess with drawing of the object you should override`public void draw(Canvas canvas)` and not `protected void onDraw(Canvas canvas)` EDIT:Please read comments, this first statement of my answer is probably wrong but I would use a FrameLayout or a RelativeLayout and put the images one on top of another. T...
25,203,148
I have a view and I want to draw a shape on it (circle for example) after click. ![enter image description here](https://i.stack.imgur.com/FM4Md.png) I've tried to do this but there are two problems - 1. onDraw is never called. 2. Not sure the setLayoutParams(v.getLayoutParams) will give me the result I want. ``` ...
2014/08/08
[ "https://Stackoverflow.com/questions/25203148", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2463875/" ]
As I'm sure you'll need to customize this quite a bit, I've left things rather generic. The following example will animate a blue circle being drawn clockwise, starting from the east (0 degrees), on top of the View's content when the View is clicked. ``` public class CircleView extends View { private static final ...
I suggest, create two imageView with same dimensions, set the image you want to display on image view and then make the second image invisible . For example : ``` circleimage.setVisibility(View.INVISIBLE);//now its hidden(do it OnCreate) ``` and then show 2ndimage when 1stimage is clicked(do it in onclick of 1st im...
1,494,168
> > Prove that if A is an infinite set and $|A| = |B|$ then $|A| = |A \cup B|$. > > > I don't know how to get an injection from $A∪B$ to $A$. I thought about considering $A\times B$, but don't see how that could work.
2015/10/23
[ "https://math.stackexchange.com/questions/1494168", "https://math.stackexchange.com", "https://math.stackexchange.com/users/261769/" ]
$$|A |\leq|A \cup B|\leq|A| +| B|\leq 2|A |$$ Note that sin $A$ is infinite set so $2|A |=|A |$
The equality of $|A|$ and $|B|$, and Cantor-Schroeder-Bernstein theorem allows us to reduce to proving $|A|=|A\coprod A|$. This is accomplished by writing $A=\coprod\_{S}\mathbb{N}$, and noting $A\coprod A=\coprod\_{S}\mathbb{N}\coprod\coprod\_{S}\mathbb{N}=\coprod\_{S}(\mathbb{N}\coprod \mathbb{N})$, we are reduced to...
4,145,023
I'm writing a java program running at Linux. Below is the java method ``` createHinted3gpFile (String localfile) { ArrayList<String> cmdArray = new ArrayList<String>(); String hintedFile = localfile+".hint"; cmdArray.add("cp"); cmdArray.add(localfile); cmdArray.add(hintedFile); System.out.print...
2010/11/10
[ "https://Stackoverflow.com/questions/4145023", "https://Stackoverflow.com", "https://Stackoverflow.com/users/391648/" ]
`/usr/local/bin/MP4Box, -3gp, -hint, /opt/myproject/contents/29443b_3gp.hint` Perhaps these commas are the reason for your exit value. How do you run this from command line? Perhaps this way? `/usr/local/bin/MP4Box -3gp -hint /opt/myproject/contents/29443b_3gp.hint` If yes, then you need to strip out the commas bef...
127 means "command not found". `/usr/local/bin/MP4Box,` - is there a comma really?
45,311
If my opponent attacks my planeswalker (who has 1 loyalty counter) with two creatures (power 1 and 3 respectively), can I absorb the attack of the creature with power 3 with my planeswalker and only take one damage to my health? Or do I treat it like the creature has trample and take three damage to my health?
2019/02/27
[ "https://boardgames.stackexchange.com/questions/45311", "https://boardgames.stackexchange.com", "https://boardgames.stackexchange.com/users/26609/" ]
Neither. Treat your planeswalker as if they are a separate player, one that you can use your creatures to block for. If there is trample damage when your block, that damage goes to your planeswalker, not you. If you don't block (or do block and there's trample) and that damage is more than enough to kill your planeswal...
Creatures attacking your planeswalker, not you as a player, will only damage said planeswalker (or any blocking creatures). It doesn't matter whether they deal lethal damage to the planeswalker and/or have trample or not. In this particular scenario, the creatures will deal 4 damage to the planeswalker, but 0 to you. ...
45,311
If my opponent attacks my planeswalker (who has 1 loyalty counter) with two creatures (power 1 and 3 respectively), can I absorb the attack of the creature with power 3 with my planeswalker and only take one damage to my health? Or do I treat it like the creature has trample and take three damage to my health?
2019/02/27
[ "https://boardgames.stackexchange.com/questions/45311", "https://boardgames.stackexchange.com", "https://boardgames.stackexchange.com/users/26609/" ]
Creatures attacking your planeswalker, not you as a player, will only damage said planeswalker (or any blocking creatures). It doesn't matter whether they deal lethal damage to the planeswalker and/or have trample or not. In this particular scenario, the creatures will deal 4 damage to the planeswalker, but 0 to you. ...
You take no damage. a planeswalker is a separate player, so you take no damage, the planeswalker is just super dead.
45,311
If my opponent attacks my planeswalker (who has 1 loyalty counter) with two creatures (power 1 and 3 respectively), can I absorb the attack of the creature with power 3 with my planeswalker and only take one damage to my health? Or do I treat it like the creature has trample and take three damage to my health?
2019/02/27
[ "https://boardgames.stackexchange.com/questions/45311", "https://boardgames.stackexchange.com", "https://boardgames.stackexchange.com/users/26609/" ]
Creatures attacking your planeswalker, not you as a player, will only damage said planeswalker (or any blocking creatures). It doesn't matter whether they deal lethal damage to the planeswalker and/or have trample or not. In this particular scenario, the creatures will deal 4 damage to the planeswalker, but 0 to you. ...
At the point the attackers are declared your opponent must declare whether the creatures are attacking you or the planeswalker. If they decide to attack the planeswalker with 1/1 creature and you with the 3/3 creature then you will take damage. If they are both attacking the planeswalker, then the planeswalker will tak...
45,311
If my opponent attacks my planeswalker (who has 1 loyalty counter) with two creatures (power 1 and 3 respectively), can I absorb the attack of the creature with power 3 with my planeswalker and only take one damage to my health? Or do I treat it like the creature has trample and take three damage to my health?
2019/02/27
[ "https://boardgames.stackexchange.com/questions/45311", "https://boardgames.stackexchange.com", "https://boardgames.stackexchange.com/users/26609/" ]
Neither. Treat your planeswalker as if they are a separate player, one that you can use your creatures to block for. If there is trample damage when your block, that damage goes to your planeswalker, not you. If you don't block (or do block and there's trample) and that damage is more than enough to kill your planeswal...
You take no damage. a planeswalker is a separate player, so you take no damage, the planeswalker is just super dead.
45,311
If my opponent attacks my planeswalker (who has 1 loyalty counter) with two creatures (power 1 and 3 respectively), can I absorb the attack of the creature with power 3 with my planeswalker and only take one damage to my health? Or do I treat it like the creature has trample and take three damage to my health?
2019/02/27
[ "https://boardgames.stackexchange.com/questions/45311", "https://boardgames.stackexchange.com", "https://boardgames.stackexchange.com/users/26609/" ]
Neither. Treat your planeswalker as if they are a separate player, one that you can use your creatures to block for. If there is trample damage when your block, that damage goes to your planeswalker, not you. If you don't block (or do block and there's trample) and that damage is more than enough to kill your planeswal...
At the point the attackers are declared your opponent must declare whether the creatures are attacking you or the planeswalker. If they decide to attack the planeswalker with 1/1 creature and you with the 3/3 creature then you will take damage. If they are both attacking the planeswalker, then the planeswalker will tak...
45,311
If my opponent attacks my planeswalker (who has 1 loyalty counter) with two creatures (power 1 and 3 respectively), can I absorb the attack of the creature with power 3 with my planeswalker and only take one damage to my health? Or do I treat it like the creature has trample and take three damage to my health?
2019/02/27
[ "https://boardgames.stackexchange.com/questions/45311", "https://boardgames.stackexchange.com", "https://boardgames.stackexchange.com/users/26609/" ]
At the point the attackers are declared your opponent must declare whether the creatures are attacking you or the planeswalker. If they decide to attack the planeswalker with 1/1 creature and you with the 3/3 creature then you will take damage. If they are both attacking the planeswalker, then the planeswalker will tak...
You take no damage. a planeswalker is a separate player, so you take no damage, the planeswalker is just super dead.
35,757,169
I need to populate the contents of a SQL Server table with the contents of another. I have one table, `Document Items`, which contains (say) `VendorPartNumber` and `UnitCost` columns. I then have another table, `PO Items`, with `VendorPartNumber` and `UnitCost`. What do I need to do to get the relevant column conten...
2016/03/02
[ "https://Stackoverflow.com/questions/35757169", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6009845/" ]
If it is for one time operation: If Part Oder Number is unique key in both tables, you can use the sub select statement from source table and set the values to 2nd table. Ex: ``` update PO Items set VendorPartNumber = (select VendorPartNumber from Document Items wh...
You can try with: ``` insert into POItems (VendorPartNumber, UnitCost) values (select VendorPartNumber, UnitCost from DocumentItems); ``` You can add where clause if you need.
35,757,169
I need to populate the contents of a SQL Server table with the contents of another. I have one table, `Document Items`, which contains (say) `VendorPartNumber` and `UnitCost` columns. I then have another table, `PO Items`, with `VendorPartNumber` and `UnitCost`. What do I need to do to get the relevant column conten...
2016/03/02
[ "https://Stackoverflow.com/questions/35757169", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6009845/" ]
``` update dbo.[PO Items] set VendorPartNumber = di.VendorPartNumber, UnitCost = di.UnitCost from DocumentItems di where [PO Items].[{key column name}] = di.[{key column name}] ```
You can try with: ``` insert into POItems (VendorPartNumber, UnitCost) values (select VendorPartNumber, UnitCost from DocumentItems); ``` You can add where clause if you need.
35,757,169
I need to populate the contents of a SQL Server table with the contents of another. I have one table, `Document Items`, which contains (say) `VendorPartNumber` and `UnitCost` columns. I then have another table, `PO Items`, with `VendorPartNumber` and `UnitCost`. What do I need to do to get the relevant column conten...
2016/03/02
[ "https://Stackoverflow.com/questions/35757169", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6009845/" ]
``` update dbo.[PO Items] set VendorPartNumber = di.VendorPartNumber, UnitCost = di.UnitCost from DocumentItems di where [PO Items].[{key column name}] = di.[{key column name}] ```
If it is for one time operation: If Part Oder Number is unique key in both tables, you can use the sub select statement from source table and set the values to 2nd table. Ex: ``` update PO Items set VendorPartNumber = (select VendorPartNumber from Document Items wh...
427,015
I am thinking about a collaborative effort, where several people would need to insert data; for different reasons, it would be most convenient that this data is in `bibtex` format (the references format for `latex`). Now, I know [JabRef reference manager](http://jabref.sourceforge.net/) as a GUI that people may be wi...
2012/05/21
[ "https://superuser.com/questions/427015", "https://superuser.com", "https://superuser.com/users/39752/" ]
Ok, found some options after browsing: * PHP/MySQL application called [PHP BibTeX Database Manager](http://www.rennes.supelec.fr/ren/perso/etotel/PhpBibtexDbMng/); cannot find any screenshots of it; but I guess it can manage different users, and it can export to a `bib` file. * There is also a way to have `jabref` co...
Do you look for a tool like [I, librarian](http://www.bioinformatics.org/librarian/)? You may try th online demo:
46,278,860
I'm in need of some assistance to condense my code. I've created quite a large spreadsheet for orders and invoices for my company. With its size and the amount of code, it's pretty slow in execution. The coding I would like some help with should first of all copy cells in column A & B of the current active row then lo...
2017/09/18
[ "https://Stackoverflow.com/questions/46278860", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5734760/" ]
You'll have to configure the Spring Bean in charge of creating the JSON your service is returning. First off, you need to define the Jackson Object Mapper Bean that your converter will use to create the JSON: ``` <bean class="com.fasterxml.jackson.databind.ObjectMapper" id="objectMapper"> <property name="dateForm...
if you have access to the ObjectMapper, you can also set it as a property programmatically ``` ObjectMapper mapper = new ObjectMapper(); mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); mapper.setDateFormat(new ISO8601DateFormat()); ```
46,278,860
I'm in need of some assistance to condense my code. I've created quite a large spreadsheet for orders and invoices for my company. With its size and the amount of code, it's pretty slow in execution. The coding I would like some help with should first of all copy cells in column A & B of the current active row then lo...
2017/09/18
[ "https://Stackoverflow.com/questions/46278860", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5734760/" ]
You'll have to configure the Spring Bean in charge of creating the JSON your service is returning. First off, you need to define the Jackson Object Mapper Bean that your converter will use to create the JSON: ``` <bean class="com.fasterxml.jackson.databind.ObjectMapper" id="objectMapper"> <property name="dateForm...
Another way is to configure the `MessageConverter` after they have been populated/configured by the framework: ```java @EnableWebMvc @Configuration public class AppConfiguration implements WebMvcConfigurer { @Override public void extendMessageConverters(List<HttpMessageConverter<?>> converters) { for (...
46,278,860
I'm in need of some assistance to condense my code. I've created quite a large spreadsheet for orders and invoices for my company. With its size and the amount of code, it's pretty slow in execution. The coding I would like some help with should first of all copy cells in column A & B of the current active row then lo...
2017/09/18
[ "https://Stackoverflow.com/questions/46278860", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5734760/" ]
Another way is to configure the `MessageConverter` after they have been populated/configured by the framework: ```java @EnableWebMvc @Configuration public class AppConfiguration implements WebMvcConfigurer { @Override public void extendMessageConverters(List<HttpMessageConverter<?>> converters) { for (...
if you have access to the ObjectMapper, you can also set it as a property programmatically ``` ObjectMapper mapper = new ObjectMapper(); mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); mapper.setDateFormat(new ISO8601DateFormat()); ```
27,293,994
How to parse `ZoneDateTime` from string that doesn't contain `zone` and others fields? Here is test in Spock to reproduce: ``` import spock.lang.Specification import spock.lang.Unroll import java.time.ZoneId import java.time.ZoneOffset import java.time.ZonedDateTime import java.time.format.DateTimeFormatter @Unroll...
2014/12/04
[ "https://Stackoverflow.com/questions/27293994", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1049542/" ]
> > *Now I see only one way: create array with dimension [args] + 1 and copy all items to new array.* > > > There is no simpler way. You need to create a new array and include `myobj` as last element of the array. ``` String[] args2 = Arrays.copyOf(args, args.length + 1); args2[args2.length-1] = myobj; sys(args2)...
You may call `sys()` twice if the order doesn't care: ``` T myobj=new T(); sys(myobj); sys(args); ``` If you can't use this, switch to collections (eg. LinkedList) for all of your functions.
27,293,994
How to parse `ZoneDateTime` from string that doesn't contain `zone` and others fields? Here is test in Spock to reproduce: ``` import spock.lang.Specification import spock.lang.Unroll import java.time.ZoneId import java.time.ZoneOffset import java.time.ZonedDateTime import java.time.format.DateTimeFormatter @Unroll...
2014/12/04
[ "https://Stackoverflow.com/questions/27293994", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1049542/" ]
> > *Now I see only one way: create array with dimension [args] + 1 and copy all items to new array.* > > > There is no simpler way. You need to create a new array and include `myobj` as last element of the array. ``` String[] args2 = Arrays.copyOf(args, args.length + 1); args2[args2.length-1] = myobj; sys(args2)...
If you can use [Guava](http://code.google.com/p/guava-libraries/), then you can do: ``` sys(ObjectArrays.concat(myobj, args)) ```
27,293,994
How to parse `ZoneDateTime` from string that doesn't contain `zone` and others fields? Here is test in Spock to reproduce: ``` import spock.lang.Specification import spock.lang.Unroll import java.time.ZoneId import java.time.ZoneOffset import java.time.ZonedDateTime import java.time.format.DateTimeFormatter @Unroll...
2014/12/04
[ "https://Stackoverflow.com/questions/27293994", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1049542/" ]
> > *Now I see only one way: create array with dimension [args] + 1 and copy all items to new array.* > > > There is no simpler way. You need to create a new array and include `myobj` as last element of the array. ``` String[] args2 = Arrays.copyOf(args, args.length + 1); args2[args2.length-1] = myobj; sys(args2)...
Java 8 solution: ``` sys(Stream.concat(Arrays.stream(args), Stream.of(myobj)).toArray(T[]::new)); ```
27,293,994
How to parse `ZoneDateTime` from string that doesn't contain `zone` and others fields? Here is test in Spock to reproduce: ``` import spock.lang.Specification import spock.lang.Unroll import java.time.ZoneId import java.time.ZoneOffset import java.time.ZonedDateTime import java.time.format.DateTimeFormatter @Unroll...
2014/12/04
[ "https://Stackoverflow.com/questions/27293994", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1049542/" ]
You may call `sys()` twice if the order doesn't care: ``` T myobj=new T(); sys(myobj); sys(args); ``` If you can't use this, switch to collections (eg. LinkedList) for all of your functions.
If you can use [Guava](http://code.google.com/p/guava-libraries/), then you can do: ``` sys(ObjectArrays.concat(myobj, args)) ```
27,293,994
How to parse `ZoneDateTime` from string that doesn't contain `zone` and others fields? Here is test in Spock to reproduce: ``` import spock.lang.Specification import spock.lang.Unroll import java.time.ZoneId import java.time.ZoneOffset import java.time.ZonedDateTime import java.time.format.DateTimeFormatter @Unroll...
2014/12/04
[ "https://Stackoverflow.com/questions/27293994", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1049542/" ]
You may call `sys()` twice if the order doesn't care: ``` T myobj=new T(); sys(myobj); sys(args); ``` If you can't use this, switch to collections (eg. LinkedList) for all of your functions.
Java 8 solution: ``` sys(Stream.concat(Arrays.stream(args), Stream.of(myobj)).toArray(T[]::new)); ```
27,293,994
How to parse `ZoneDateTime` from string that doesn't contain `zone` and others fields? Here is test in Spock to reproduce: ``` import spock.lang.Specification import spock.lang.Unroll import java.time.ZoneId import java.time.ZoneOffset import java.time.ZonedDateTime import java.time.format.DateTimeFormatter @Unroll...
2014/12/04
[ "https://Stackoverflow.com/questions/27293994", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1049542/" ]
If you can use [Guava](http://code.google.com/p/guava-libraries/), then you can do: ``` sys(ObjectArrays.concat(myobj, args)) ```
Java 8 solution: ``` sys(Stream.concat(Arrays.stream(args), Stream.of(myobj)).toArray(T[]::new)); ```
9,523,550
When I write validation code for a web form, I usually assume that the content of a field is valid and attempt to prove that it is invalid. Is it a better practice to assume that the content of the field is invalid and then attempt to prove that it is valid? A very simple example (pseudo code): ``` function isValid( ...
2012/03/01
[ "https://Stackoverflow.com/questions/9523550", "https://Stackoverflow.com", "https://Stackoverflow.com/users/603502/" ]
You have identified the fundamental problem. Your query is running in the UI thread and blocks that thread whilst it runs. No UI updates can occur, timer messages cannot fire etc. > > I think the best solution is to move the execution of the ProxyMethods to a separate thread. However, there **must** be an existing so...
In case anyone wants to know, the solution was rather simple to implement. We now have a working elapsed time clock [0:00] that increments anytime the client app is waiting for the DataSnap server to service a request. In essence, this is what we did. (*A special thanks to those who share their solutions -- which helpe...
9,523,550
When I write validation code for a web form, I usually assume that the content of a field is valid and attempt to prove that it is invalid. Is it a better practice to assume that the content of the field is invalid and then attempt to prove that it is valid? A very simple example (pseudo code): ``` function isValid( ...
2012/03/01
[ "https://Stackoverflow.com/questions/9523550", "https://Stackoverflow.com", "https://Stackoverflow.com/users/603502/" ]
You have identified the fundamental problem. Your query is running in the UI thread and blocks that thread whilst it runs. No UI updates can occur, timer messages cannot fire etc. > > I think the best solution is to move the execution of the ProxyMethods to a separate thread. However, there **must** be an existing so...
Using the above idea, I made a simple solution that will work for all classes (automatically). I created TThreadCommand and TCommandThread as follows: ``` TThreadCommand = class(TDBXMorphicCommand) public procedure ExecuteUpdate; override; procedure ExecuteUpdateAsync; end; TCommandThread =...
9,523,550
When I write validation code for a web form, I usually assume that the content of a field is valid and attempt to prove that it is invalid. Is it a better practice to assume that the content of the field is invalid and then attempt to prove that it is valid? A very simple example (pseudo code): ``` function isValid( ...
2012/03/01
[ "https://Stackoverflow.com/questions/9523550", "https://Stackoverflow.com", "https://Stackoverflow.com/users/603502/" ]
You have identified the fundamental problem. Your query is running in the UI thread and blocks that thread whilst it runs. No UI updates can occur, timer messages cannot fire etc. > > I think the best solution is to move the execution of the ProxyMethods to a separate thread. However, there **must** be an existing so...
> > How did you force the compiler to use your modified > Data.DBXCommand.pas? > > > By putting modified Data.DBXCommand.pas in your project folder.
9,523,550
When I write validation code for a web form, I usually assume that the content of a field is valid and attempt to prove that it is invalid. Is it a better practice to assume that the content of the field is invalid and then attempt to prove that it is valid? A very simple example (pseudo code): ``` function isValid( ...
2012/03/01
[ "https://Stackoverflow.com/questions/9523550", "https://Stackoverflow.com", "https://Stackoverflow.com/users/603502/" ]
In case anyone wants to know, the solution was rather simple to implement. We now have a working elapsed time clock [0:00] that increments anytime the client app is waiting for the DataSnap server to service a request. In essence, this is what we did. (*A special thanks to those who share their solutions -- which helpe...
> > How did you force the compiler to use your modified > Data.DBXCommand.pas? > > > By putting modified Data.DBXCommand.pas in your project folder.
9,523,550
When I write validation code for a web form, I usually assume that the content of a field is valid and attempt to prove that it is invalid. Is it a better practice to assume that the content of the field is invalid and then attempt to prove that it is valid? A very simple example (pseudo code): ``` function isValid( ...
2012/03/01
[ "https://Stackoverflow.com/questions/9523550", "https://Stackoverflow.com", "https://Stackoverflow.com/users/603502/" ]
Using the above idea, I made a simple solution that will work for all classes (automatically). I created TThreadCommand and TCommandThread as follows: ``` TThreadCommand = class(TDBXMorphicCommand) public procedure ExecuteUpdate; override; procedure ExecuteUpdateAsync; end; TCommandThread =...
> > How did you force the compiler to use your modified > Data.DBXCommand.pas? > > > By putting modified Data.DBXCommand.pas in your project folder.
59,138,113
I would like to filter for names where all the values in column a are nan this is what I have tried ``` full.groupby('name')['opp'].isna().any(1) ``` however this returns the error message: ``` AttributeError: Cannot access callable attribute 'isna' of 'SeriesGroupBy' objects, try using the 'apply' method ``` he...
2019/12/02
[ "https://Stackoverflow.com/questions/59138113", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7158458/" ]
Inspired by the answer of Thomas but unable to make his code work the following did the trick for me: ``` const [showPopover, setShowPopover] = useState<{open: boolean, event: Event | undefined}>({ open: false, event: undefined, }); <IonPopover isOpen={showPopover.open} event={showPopover.event} onDid...
From [the docs](https://ionicframework.com/docs/api/popover#presenting): > > To present a popover, call the present method on a popover instance. In order to position the popover relative to the element clicked, a click event needs to be passed into the options of the the present method. If the event is not passed, t...
7,835,250
What's the meaning of `"L"` behind any number`(e.g 153L=?,648L=?)` I am getting the value `2432902008176640000L` while i am typing `math.factorial(20)` in python2.7 interpreter. May be some ppl find it a silly question but i dont know anything about this "L" thing.So please help me to increase my knowledge.
2011/10/20
[ "https://Stackoverflow.com/questions/7835250", "https://Stackoverflow.com", "https://Stackoverflow.com/users/934123/" ]
It means that the number is a [`long` Integer](http://docs.python.org/library/stdtypes.html#numeric-types-int-float-long-complex), and can store larger numbers.
That means the number is a `Long`, meaning it is stored using more bytes and can contain larger values
7,835,250
What's the meaning of `"L"` behind any number`(e.g 153L=?,648L=?)` I am getting the value `2432902008176640000L` while i am typing `math.factorial(20)` in python2.7 interpreter. May be some ppl find it a silly question but i dont know anything about this "L" thing.So please help me to increase my knowledge.
2011/10/20
[ "https://Stackoverflow.com/questions/7835250", "https://Stackoverflow.com", "https://Stackoverflow.com/users/934123/" ]
It 's a `Long` integer. More about it, in the **[Python docs: 5.4. Numeric Types](http://docs.python.org/library/stdtypes.html#numeric-types-int-float-long-complex)**
That means the number is a `Long`, meaning it is stored using more bytes and can contain larger values
2,645
I am trying to find a good, free blu-ray movie player for my computer running Windows 8... Here are my current Options which I have looked into already: 1. VLC Player 2.1 does support Blu-ray, but is has a lot of work to do... I have tried the CODEC work around for support also 2. CyberLinks PowerDVD is good, for the...
2014/03/23
[ "https://softwarerecs.stackexchange.com/questions/2645", "https://softwarerecs.stackexchange.com", "https://softwarerecs.stackexchange.com/users/1869/" ]
I see you've been having trouble. Check out PotPlayer. Supports Windows 8 perfectly, too. :) <http://www.videohelp.com/tools/PotPlayer>
The **Blu-ray playback addon** [(direct download link)](http://vlc-bluray.whoknowsmy.name/files/KEYDB.cfg) pack for VLC may be what you are looking for. See [here](https://forum.videolan.org/viewtopic.php?f=14&t=105955) for instructions on how to use it. * It will make Blu-ray support in VLC just work. * It is free as...
568
At my business most of the employees use the word *inactivate* frequently. Is this proper grammar? I've always used *deactivate*.
2010/08/12
[ "https://english.stackexchange.com/questions/568", "https://english.stackexchange.com", "https://english.stackexchange.com/users/231/" ]
The New Oxford American Dictionary reports just an example of sentence with inactivate. > > inactivate ɪnˈæktəˌveɪt/ > > verb [transitive] > > make inactive or inoperative: *household bleach does not inactivate the virus* | [as adjective] (inactivated) *an inactivated polio vaccine*. > > > Outside that c...
Dictionary.com says: > > in·ac·ti·vate /inˈaktəˌvāt/ > > Verb: Make inactive or inoperative: *inactivate the virus*. > > > And according to Google *deactivate* has 8,180,000 results; *inactivate* has 17,600,000 results, implying it is even used more. Though there may be some specific domain in which it is use...
568
At my business most of the employees use the word *inactivate* frequently. Is this proper grammar? I've always used *deactivate*.
2010/08/12
[ "https://english.stackexchange.com/questions/568", "https://english.stackexchange.com", "https://english.stackexchange.com/users/231/" ]
There are 88 examples of *inactivate* in the Corpus of Contemporary American English and 102 for *deactivate*, showing they occur with about equal frequency. Most of the examples for *inactivate*, though, are used in a biological context, talking about inactivating viruses, genes, and “potent mutagenic compounds”, for ...
The New Oxford American Dictionary reports just an example of sentence with inactivate. > > inactivate ɪnˈæktəˌveɪt/ > > verb [transitive] > > make inactive or inoperative: *household bleach does not inactivate the virus* | [as adjective] (inactivated) *an inactivated polio vaccine*. > > > Outside that c...
568
At my business most of the employees use the word *inactivate* frequently. Is this proper grammar? I've always used *deactivate*.
2010/08/12
[ "https://english.stackexchange.com/questions/568", "https://english.stackexchange.com", "https://english.stackexchange.com/users/231/" ]
There are 88 examples of *inactivate* in the Corpus of Contemporary American English and 102 for *deactivate*, showing they occur with about equal frequency. Most of the examples for *inactivate*, though, are used in a biological context, talking about inactivating viruses, genes, and “potent mutagenic compounds”, for ...
Dictionary.com says: > > in·ac·ti·vate /inˈaktəˌvāt/ > > Verb: Make inactive or inoperative: *inactivate the virus*. > > > And according to Google *deactivate* has 8,180,000 results; *inactivate* has 17,600,000 results, implying it is even used more. Though there may be some specific domain in which it is use...
568
At my business most of the employees use the word *inactivate* frequently. Is this proper grammar? I've always used *deactivate*.
2010/08/12
[ "https://english.stackexchange.com/questions/568", "https://english.stackexchange.com", "https://english.stackexchange.com/users/231/" ]
There are 88 examples of *inactivate* in the Corpus of Contemporary American English and 102 for *deactivate*, showing they occur with about equal frequency. Most of the examples for *inactivate*, though, are used in a biological context, talking about inactivating viruses, genes, and “potent mutagenic compounds”, for ...
When I was in the military way back in the seventies, we frequently used "active" and "inactive", and we used the very "activate" but never "inactivate". Contemporary usage seems to derive chiefly from the computer industry ('inactivate' and 'inactivated' are frequently used in programming commentary.
568
At my business most of the employees use the word *inactivate* frequently. Is this proper grammar? I've always used *deactivate*.
2010/08/12
[ "https://english.stackexchange.com/questions/568", "https://english.stackexchange.com", "https://english.stackexchange.com/users/231/" ]
There are 88 examples of *inactivate* in the Corpus of Contemporary American English and 102 for *deactivate*, showing they occur with about equal frequency. Most of the examples for *inactivate*, though, are used in a biological context, talking about inactivating viruses, genes, and “potent mutagenic compounds”, for ...
Another word that is used with a similar meaning is **de-** activate. But "inactivate" is perfectly fine.
568
At my business most of the employees use the word *inactivate* frequently. Is this proper grammar? I've always used *deactivate*.
2010/08/12
[ "https://english.stackexchange.com/questions/568", "https://english.stackexchange.com", "https://english.stackexchange.com/users/231/" ]
According to OneLook, it is a word in 25 dictionaries: <http://www.onelook.com/?w=inactivate> * verb: make inactive * verb: release from military service or remove from the active list of military service
Dictionary.com says: > > in·ac·ti·vate /inˈaktəˌvāt/ > > Verb: Make inactive or inoperative: *inactivate the virus*. > > > And according to Google *deactivate* has 8,180,000 results; *inactivate* has 17,600,000 results, implying it is even used more. Though there may be some specific domain in which it is use...
568
At my business most of the employees use the word *inactivate* frequently. Is this proper grammar? I've always used *deactivate*.
2010/08/12
[ "https://english.stackexchange.com/questions/568", "https://english.stackexchange.com", "https://english.stackexchange.com/users/231/" ]
The New Oxford American Dictionary reports just an example of sentence with inactivate. > > inactivate ɪnˈæktəˌveɪt/ > > verb [transitive] > > make inactive or inoperative: *household bleach does not inactivate the virus* | [as adjective] (inactivated) *an inactivated polio vaccine*. > > > Outside that c...
When I was in the military way back in the seventies, we frequently used "active" and "inactive", and we used the very "activate" but never "inactivate". Contemporary usage seems to derive chiefly from the computer industry ('inactivate' and 'inactivated' are frequently used in programming commentary.
568
At my business most of the employees use the word *inactivate* frequently. Is this proper grammar? I've always used *deactivate*.
2010/08/12
[ "https://english.stackexchange.com/questions/568", "https://english.stackexchange.com", "https://english.stackexchange.com/users/231/" ]
The New Oxford American Dictionary reports just an example of sentence with inactivate. > > inactivate ɪnˈæktəˌveɪt/ > > verb [transitive] > > make inactive or inoperative: *household bleach does not inactivate the virus* | [as adjective] (inactivated) *an inactivated polio vaccine*. > > > Outside that c...
Another word that is used with a similar meaning is **de-** activate. But "inactivate" is perfectly fine.
568
At my business most of the employees use the word *inactivate* frequently. Is this proper grammar? I've always used *deactivate*.
2010/08/12
[ "https://english.stackexchange.com/questions/568", "https://english.stackexchange.com", "https://english.stackexchange.com/users/231/" ]
According to OneLook, it is a word in 25 dictionaries: <http://www.onelook.com/?w=inactivate> * verb: make inactive * verb: release from military service or remove from the active list of military service
Another word that is used with a similar meaning is **de-** activate. But "inactivate" is perfectly fine.
568
At my business most of the employees use the word *inactivate* frequently. Is this proper grammar? I've always used *deactivate*.
2010/08/12
[ "https://english.stackexchange.com/questions/568", "https://english.stackexchange.com", "https://english.stackexchange.com/users/231/" ]
According to OneLook, it is a word in 25 dictionaries: <http://www.onelook.com/?w=inactivate> * verb: make inactive * verb: release from military service or remove from the active list of military service
When I was in the military way back in the seventies, we frequently used "active" and "inactive", and we used the very "activate" but never "inactivate". Contemporary usage seems to derive chiefly from the computer industry ('inactivate' and 'inactivated' are frequently used in programming commentary.
4,546,275
I'm creating a wizard (really, a glorified survey) using jQuery Wizard Redux. I have several images (created in Illustrator) which I want the user to select from, which would act as their "submission" for each step of the wizard. e.g. [this world map I made in Flash Catalyst](http://harrisonfjord.com/worldmap/Main.swf...
2010/12/28
[ "https://Stackoverflow.com/questions/4546275", "https://Stackoverflow.com", "https://Stackoverflow.com/users/556006/" ]
You could use an [image map](http://www.w3.org/TR/html401/struct/objects.html#h-13.6) by defining a [map and area elements](http://www.w3.org/TR/html401/struct/objects.html#h-13.6.1) (polyline) for each region. --- **update** I would create transparent `.png` files that get overlaid (*each one holding a region*) and...
You could also use the HTML5 `canvas` tag to draw the elements themselves and then each element (continent) would be click-able exactly on the boundaries. <http://joncom.be/code/excanvas-world-map/>
73,588,731
Suppose I have a class with a lot of members and nested members and do this call and one of the variables is null (other than the last on each side of the equation): ``` Obj.Field.NextField.NextNextField = NextObj.OtherField.NextOtherField.NextNextOtherField; ``` I will get a NullReferenceException saying that an ob...
2022/09/02
[ "https://Stackoverflow.com/questions/73588731", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8677558/" ]
You have your results array nested within another array. See screen grab shows `[Array(8)]` and item 0 is `['Leon', ...` So either: ```js Cypress.Commands.add("getId", (user, passwd) => { let arr = [] cy.getToken(user, passwd) .then((token) => { cy.request({ method: "GET", url: "/users...
[`cy.log()` yields null.](https://docs.cypress.io/api/commands/log#Yields) Try just returning the value instead of the one assigned. ```js .then(() => { return arr.indexOf("c@c.com") }); ... ```
71,330,630
I want to populate an existing column with values that continually add onto the row above. This is easy in Excel, but I haven't figured out a good way to automate it in R. If we had 2 columns in Excel, A and B, we want cell B2 to =B1+A2, and cell B3 would = B2+A3. How can I do this in R? ``` #example dataframe df <- ...
2022/03/03
[ "https://Stackoverflow.com/questions/71330630", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18094438/" ]
Since you didn't provide any data, or even explain what you want to show exactly on the y-axis, I will answer with what *should* work: ```py fig.update_yaxes(tickformat=".2s") # will format to 2 sigfigs ``` If you want regularly-spaced tick values for the y-axis, you can either pass a list of values, or use `dtick`...
For newcomers, **if you find your y-axis tick format is in a weird format** like mine, please make sure from the `type of the column` (`GDP` in my case). In my case, it was string because I converted a numpy array of 3 columns to dataframe and I did not pay attention to the fact that numpy array convert all values to s...
52,803,067
I am using complex object to render ag-grid column. **Employee Name(street)** John (st. lucy One) John (st. lucy Two) **For example this is json:** ``` { "employee":[ "name": "John", "address":[ { "street":"st. lucy One", "postalcode":"jkjkjk" ...
2018/10/14
[ "https://Stackoverflow.com/questions/52803067", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2985842/" ]
I am unsure if you want to check for discord invite links specifically, or if you want to check for all links. Either way, you can use `message.content.includes`. Example: ``` bot.on('message', (message) => { //whenever a message is sent if (message.content.includes('discord.gg/'||'discordapp.com/invite/')) { //if ...
You can try this: ``` bot.on(`message`, async message => { const bannedWords = [`discord.gg`, `.gg/`, `.gg /`, `. gg /`, `. gg/`, `discord .gg /`, `discord.gg /`, `discord .gg/`, `discord .gg`, `discord . gg`, `discord. gg`, `discord gg`, `discordgg`, `discord gg /`] try { if (bannedWords.some(word => ...
52,803,067
I am using complex object to render ag-grid column. **Employee Name(street)** John (st. lucy One) John (st. lucy Two) **For example this is json:** ``` { "employee":[ "name": "John", "address":[ { "street":"st. lucy One", "postalcode":"jkjkjk" ...
2018/10/14
[ "https://Stackoverflow.com/questions/52803067", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2985842/" ]
I find this is the best: ``` let regx = /^((?:https?:)?\/\/)?((?:www|m)\.)? ((?:discord\.gg|discordapp\.com))/g let cdu = regx.test(message.content.toLowerCase().replace(/\s+/g, '')) ``` Tell me if it works!
``` let regexp = /^(?:(?:https?|ftp):\/\/)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-...
52,803,067
I am using complex object to render ag-grid column. **Employee Name(street)** John (st. lucy One) John (st. lucy Two) **For example this is json:** ``` { "employee":[ "name": "John", "address":[ { "street":"st. lucy One", "postalcode":"jkjkjk" ...
2018/10/14
[ "https://Stackoverflow.com/questions/52803067", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2985842/" ]
You can try this: ``` bot.on(`message`, async message => { const bannedWords = [`discord.gg`, `.gg/`, `.gg /`, `. gg /`, `. gg/`, `discord .gg /`, `discord.gg /`, `discord .gg/`, `discord .gg`, `discord . gg`, `discord. gg`, `discord gg`, `discordgg`, `discord gg /`] try { if (bannedWords.some(word => ...
``` let regexp = /^(?:(?:https?|ftp):\/\/)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-...
52,803,067
I am using complex object to render ag-grid column. **Employee Name(street)** John (st. lucy One) John (st. lucy Two) **For example this is json:** ``` { "employee":[ "name": "John", "address":[ { "street":"st. lucy One", "postalcode":"jkjkjk" ...
2018/10/14
[ "https://Stackoverflow.com/questions/52803067", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2985842/" ]
You can try this: ``` bot.on(`message`, async message => { const bannedWords = [`discord.gg`, `.gg/`, `.gg /`, `. gg /`, `. gg/`, `discord .gg /`, `discord.gg /`, `discord .gg/`, `discord .gg`, `discord . gg`, `discord. gg`, `discord gg`, `discordgg`, `discord gg /`] try { if (bannedWords.some(word => ...
You can check this using [Regular Expressions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions) (RegEX) **Example**: ``` // The message to check for a Discord link var message = "Hi, please join discord.gg/a2dsc for cool conversations"; // The message will be tested on "discord.gg/{...
52,803,067
I am using complex object to render ag-grid column. **Employee Name(street)** John (st. lucy One) John (st. lucy Two) **For example this is json:** ``` { "employee":[ "name": "John", "address":[ { "street":"st. lucy One", "postalcode":"jkjkjk" ...
2018/10/14
[ "https://Stackoverflow.com/questions/52803067", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2985842/" ]
I find this is the best: ``` let regx = /^((?:https?:)?\/\/)?((?:www|m)\.)? ((?:discord\.gg|discordapp\.com))/g let cdu = regx.test(message.content.toLowerCase().replace(/\s+/g, '')) ``` Tell me if it works!
You can check this using [Regular Expressions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions) (RegEX) **Example**: ``` // The message to check for a Discord link var message = "Hi, please join discord.gg/a2dsc for cool conversations"; // The message will be tested on "discord.gg/{...
52,803,067
I am using complex object to render ag-grid column. **Employee Name(street)** John (st. lucy One) John (st. lucy Two) **For example this is json:** ``` { "employee":[ "name": "John", "address":[ { "street":"st. lucy One", "postalcode":"jkjkjk" ...
2018/10/14
[ "https://Stackoverflow.com/questions/52803067", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2985842/" ]
What you are doing works but you don't need `.then()` just leave the `message.channel.send()` as it is.
You can check this using [Regular Expressions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions) (RegEX) **Example**: ``` // The message to check for a Discord link var message = "Hi, please join discord.gg/a2dsc for cool conversations"; // The message will be tested on "discord.gg/{...
52,803,067
I am using complex object to render ag-grid column. **Employee Name(street)** John (st. lucy One) John (st. lucy Two) **For example this is json:** ``` { "employee":[ "name": "John", "address":[ { "street":"st. lucy One", "postalcode":"jkjkjk" ...
2018/10/14
[ "https://Stackoverflow.com/questions/52803067", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2985842/" ]
I am unsure if you want to check for discord invite links specifically, or if you want to check for all links. Either way, you can use `message.content.includes`. Example: ``` bot.on('message', (message) => { //whenever a message is sent if (message.content.includes('discord.gg/'||'discordapp.com/invite/')) { //if ...
I find this is the best: ``` let regx = /^((?:https?:)?\/\/)?((?:www|m)\.)? ((?:discord\.gg|discordapp\.com))/g let cdu = regx.test(message.content.toLowerCase().replace(/\s+/g, '')) ``` Tell me if it works!
52,803,067
I am using complex object to render ag-grid column. **Employee Name(street)** John (st. lucy One) John (st. lucy Two) **For example this is json:** ``` { "employee":[ "name": "John", "address":[ { "street":"st. lucy One", "postalcode":"jkjkjk" ...
2018/10/14
[ "https://Stackoverflow.com/questions/52803067", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2985842/" ]
What you are doing works but you don't need `.then()` just leave the `message.channel.send()` as it is.
``` let regexp = /^(?:(?:https?|ftp):\/\/)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-...
52,803,067
I am using complex object to render ag-grid column. **Employee Name(street)** John (st. lucy One) John (st. lucy Two) **For example this is json:** ``` { "employee":[ "name": "John", "address":[ { "street":"st. lucy One", "postalcode":"jkjkjk" ...
2018/10/14
[ "https://Stackoverflow.com/questions/52803067", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2985842/" ]
I am unsure if you want to check for discord invite links specifically, or if you want to check for all links. Either way, you can use `message.content.includes`. Example: ``` bot.on('message', (message) => { //whenever a message is sent if (message.content.includes('discord.gg/'||'discordapp.com/invite/')) { //if ...
What you are doing works but you don't need `.then()` just leave the `message.channel.send()` as it is.
52,803,067
I am using complex object to render ag-grid column. **Employee Name(street)** John (st. lucy One) John (st. lucy Two) **For example this is json:** ``` { "employee":[ "name": "John", "address":[ { "street":"st. lucy One", "postalcode":"jkjkjk" ...
2018/10/14
[ "https://Stackoverflow.com/questions/52803067", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2985842/" ]
I am unsure if you want to check for discord invite links specifically, or if you want to check for all links. Either way, you can use `message.content.includes`. Example: ``` bot.on('message', (message) => { //whenever a message is sent if (message.content.includes('discord.gg/'||'discordapp.com/invite/')) { //if ...
``` let regexp = /^(?:(?:https?|ftp):\/\/)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-...
652
I am solving (or say, trying to find good solutions for) an arbitrary combinatorial optimization problem, think of it as a Vehicle Routing Problem with a bunch of side constraints that are not relevant for this question. I coded an Adaptive Large Neighborhood Search (ALNS) for it. I want to explore "easy" opportuniti...
2019/06/21
[ "https://or.stackexchange.com/questions/652", "https://or.stackexchange.com", "https://or.stackexchange.com/users/48/" ]
Another paradigm to parallelize search heuristics is the Backbone strategy. See for example [this paper](https://www.sciencedirect.com/science/article/pii/0010465596000628). The main idea is to run multiple instances of an arbitrary heuristic in parallel, and then compare the resulting solutions of each instance. "st...
I've implemented **reproducible** **parallelization** on a number of Local Search variants **with incremental score calculation** (= delta constraint and fitness evaluation). Some of our requirements you might be able to forgo (most notably OO/FP support), but others (such as not sacrificing incremental calculation) ar...
226,056
Consider a motorboat maneuvering on the surface of a lake, Is it possible for the boat to have accelerated motion in the x axis and unaccelerated motion in y direction?
2015/12/26
[ "https://physics.stackexchange.com/questions/226056", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/102189/" ]
> > Is it possible for the boat to have accelerated motion in the x axis and unaccelerated motion in y direction? > > > Yes, it's perfectly possible. The following is *just one example* of such a situation. [![Boat on a lake.](https://i.stack.imgur.com/8OUQn.png)](https://i.stack.imgur.com/8OUQn.png) Firstly, mo...
Your question isn't very clear but I think I get the gist of it. But yes, if there's no resistive force, you can have unaccelerated motion in a direction perpendicular to the direction of acceleration without the accelerating force affecting its direction or magnitude since it does no work on it. ($W = FS cos \theta$) ...
32,058
Salt baking requires a lot of salt. I want to use ice cream rock salt for salt baking because it normally comes in bulk size. But I've been told that the rock salt used for ice cream is not fit for consumption. However, is it safe to use it to salt bake other foods? [I.e. Shrimp.](http://www.foodnetwork.com/recipes/alt...
2013/02/19
[ "https://cooking.stackexchange.com/questions/32058", "https://cooking.stackexchange.com", "https://cooking.stackexchange.com/users/11554/" ]
There are some kinds of rock salt that *are* meant for consumption ("food-grade"), and recipes like that salt-baked shrimp intend you to use that sort. While you're not directly eating the salt, it does come into contact with the shrimp, and there's water there to spread things around, so really, you are eating a bit o...
My food-grade bulk inexpensive salt is water softener salt - the granular stuff that's similar to rock salt, in shape and size, but clean - not the "pelleted" stuff. *This would match @Cascabel's description in a comment above.* You do need to buy 40 lbs at a time but it keeps well if you keep it sealed and dry, you ca...
32,058
Salt baking requires a lot of salt. I want to use ice cream rock salt for salt baking because it normally comes in bulk size. But I've been told that the rock salt used for ice cream is not fit for consumption. However, is it safe to use it to salt bake other foods? [I.e. Shrimp.](http://www.foodnetwork.com/recipes/alt...
2013/02/19
[ "https://cooking.stackexchange.com/questions/32058", "https://cooking.stackexchange.com", "https://cooking.stackexchange.com/users/11554/" ]
Reading through the [transcript](http://www.goodeatsfanpage.com/Season7/Salt/salt.htm) on that episode of Good Eats it seems that he intended for the recipe to be done with the ice cream type rock salt: > > I also like plain old rock salt. Not only is it good for de-snowing, de-icing your, your front stoop, it's good...
My food-grade bulk inexpensive salt is water softener salt - the granular stuff that's similar to rock salt, in shape and size, but clean - not the "pelleted" stuff. *This would match @Cascabel's description in a comment above.* You do need to buy 40 lbs at a time but it keeps well if you keep it sealed and dry, you ca...
124,773
A (master) thesis about the development and assessment of an algorithm has some limitations. The method chapter is organized as follows: * Algorithm Description * Simulated Scenarios * Evaluation method The algorithm itself is not optimal and potential flaws exist in some modules. The simulated scenarios were selecte...
2019/02/11
[ "https://academia.stackexchange.com/questions/124773", "https://academia.stackexchange.com", "https://academia.stackexchange.com/users/104321/" ]
There are two main academic tracks I'm aware of that care about craft bookbinding, in a way that is beyond hobby: fine arts, and "library and archives". In schools of fine arts it is not uncommon to have "3D design" classes that can include craft binding concepts and techniques as an option. Other classes can focus o...
It is possible that there are some academic programs. They would be more likely at a Community College, I think. But you might be able to obtain an internship or apprenticeship at some custom publisher or even a major book publisher. To find such an opportunity I'd suggest the following steps. Your local library has ...
124,773
A (master) thesis about the development and assessment of an algorithm has some limitations. The method chapter is organized as follows: * Algorithm Description * Simulated Scenarios * Evaluation method The algorithm itself is not optimal and potential flaws exist in some modules. The simulated scenarios were selecte...
2019/02/11
[ "https://academia.stackexchange.com/questions/124773", "https://academia.stackexchange.com", "https://academia.stackexchange.com/users/104321/" ]
It is possible that there are some academic programs. They would be more likely at a Community College, I think. But you might be able to obtain an internship or apprenticeship at some custom publisher or even a major book publisher. To find such an opportunity I'd suggest the following steps. Your local library has ...
The closest program would probably be a Library Science degree (e.g. MLS, MLIS). The actual percentage of the program that would directly deal with physical book construction and repair is almost certainly quite low, but what you will likely encounter in these programs are *fellow enthusiasts* who share your love of bo...
124,773
A (master) thesis about the development and assessment of an algorithm has some limitations. The method chapter is organized as follows: * Algorithm Description * Simulated Scenarios * Evaluation method The algorithm itself is not optimal and potential flaws exist in some modules. The simulated scenarios were selecte...
2019/02/11
[ "https://academia.stackexchange.com/questions/124773", "https://academia.stackexchange.com", "https://academia.stackexchange.com/users/104321/" ]
There are two main academic tracks I'm aware of that care about craft bookbinding, in a way that is beyond hobby: fine arts, and "library and archives". In schools of fine arts it is not uncommon to have "3D design" classes that can include craft binding concepts and techniques as an option. Other classes can focus o...
The closest program would probably be a Library Science degree (e.g. MLS, MLIS). The actual percentage of the program that would directly deal with physical book construction and repair is almost certainly quite low, but what you will likely encounter in these programs are *fellow enthusiasts* who share your love of bo...