qid
int64
1
74.7M
question
stringlengths
0
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
2
48.3k
response_k
stringlengths
2
40.5k
27,778,593
I am trying to install node.js on Red Hat Enterprise Linux Server release 6.1 using the following command: ``` sudo yum install nodejs npm ``` I got the following error: ``` Error: Package: nodejs-0.10.24-1.el6.x86_64 (epel) Requires: libssl.so.10(libssl.so.10)(64bit) Error: Package: nodejs-devel-0.10.24...
2015/01/05
[ "https://Stackoverflow.com/questions/27778593", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4088696/" ]
NodeJS provides a setup script that must run before you install it with yum ``` curl -sL https://rpm.nodesource.com/setup | bash - ``` Then the yum command should work ``` yum install -y nodejs ``` <https://github.com/joyent/node/wiki/installing-node.js-via-package-manager#enterprise-linux-and-fedora>
It worked for me. Run both commands as super user. ``` sudo curl --silent --location https://rpm.nodesource.com/setup_8.x | bash - sudo yum install -y nodejs ```
27,778,593
I am trying to install node.js on Red Hat Enterprise Linux Server release 6.1 using the following command: ``` sudo yum install nodejs npm ``` I got the following error: ``` Error: Package: nodejs-0.10.24-1.el6.x86_64 (epel) Requires: libssl.so.10(libssl.so.10)(64bit) Error: Package: nodejs-devel-0.10.24...
2015/01/05
[ "https://Stackoverflow.com/questions/27778593", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4088696/" ]
Just as per <https://nodejs.org/en/download/package-manager/> you have to launch: ``` curl --silent --location https://rpm.nodesource.com/setup_4.x | bash - ``` or ``` curl --silent --location https://rpm.nodesource.com/setup_6.x | bash - ``` depending on NodeJS version you need. Then simply run ``` yum -y inst...
I recommend using `dnf` to install the version of NodeJS you need because `yum` will likely pull the wrong version. As seen [Here](https://linuxconfig.org/how-to-install-node-js-on-redhat-8-linux) List the available versions; ``` sudo dnf module list nodejs ``` Install the one you want: ``` sudo dnf module install...
27,778,593
I am trying to install node.js on Red Hat Enterprise Linux Server release 6.1 using the following command: ``` sudo yum install nodejs npm ``` I got the following error: ``` Error: Package: nodejs-0.10.24-1.el6.x86_64 (epel) Requires: libssl.so.10(libssl.so.10)(64bit) Error: Package: nodejs-devel-0.10.24...
2015/01/05
[ "https://Stackoverflow.com/questions/27778593", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4088696/" ]
Just as per <https://nodejs.org/en/download/package-manager/> you have to launch: ``` curl --silent --location https://rpm.nodesource.com/setup_4.x | bash - ``` or ``` curl --silent --location https://rpm.nodesource.com/setup_6.x | bash - ``` depending on NodeJS version you need. Then simply run ``` yum -y inst...
It worked for me. Run both commands as super user. ``` sudo curl --silent --location https://rpm.nodesource.com/setup_8.x | bash - sudo yum install -y nodejs ```
27,778,593
I am trying to install node.js on Red Hat Enterprise Linux Server release 6.1 using the following command: ``` sudo yum install nodejs npm ``` I got the following error: ``` Error: Package: nodejs-0.10.24-1.el6.x86_64 (epel) Requires: libssl.so.10(libssl.so.10)(64bit) Error: Package: nodejs-devel-0.10.24...
2015/01/05
[ "https://Stackoverflow.com/questions/27778593", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4088696/" ]
I don't have the rep to comment on jfredys' answer, but wanted to add an addendum. His answer is correct for certain environments I assume, but it failed for me as I was running into the error: **Your distribution, identified as "redhat-release-server-6Server-6.6.0.2.el6.x86\_64", is not currently supported, please co...
It worked for me. Run both commands as super user. ``` sudo curl --silent --location https://rpm.nodesource.com/setup_8.x | bash - sudo yum install -y nodejs ```
27,778,593
I am trying to install node.js on Red Hat Enterprise Linux Server release 6.1 using the following command: ``` sudo yum install nodejs npm ``` I got the following error: ``` Error: Package: nodejs-0.10.24-1.el6.x86_64 (epel) Requires: libssl.so.10(libssl.so.10)(64bit) Error: Package: nodejs-devel-0.10.24...
2015/01/05
[ "https://Stackoverflow.com/questions/27778593", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4088696/" ]
NodeJS provides a setup script that must run before you install it with yum ``` curl -sL https://rpm.nodesource.com/setup | bash - ``` Then the yum command should work ``` yum install -y nodejs ``` <https://github.com/joyent/node/wiki/installing-node.js-via-package-manager#enterprise-linux-and-fedora>
Just as per <https://nodejs.org/en/download/package-manager/> you have to launch: ``` curl --silent --location https://rpm.nodesource.com/setup_4.x | bash - ``` or ``` curl --silent --location https://rpm.nodesource.com/setup_6.x | bash - ``` depending on NodeJS version you need. Then simply run ``` yum -y inst...
27,778,593
I am trying to install node.js on Red Hat Enterprise Linux Server release 6.1 using the following command: ``` sudo yum install nodejs npm ``` I got the following error: ``` Error: Package: nodejs-0.10.24-1.el6.x86_64 (epel) Requires: libssl.so.10(libssl.so.10)(64bit) Error: Package: nodejs-devel-0.10.24...
2015/01/05
[ "https://Stackoverflow.com/questions/27778593", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4088696/" ]
if this command is not working then visit ... <https://rpm.nodesource.com/setup> in your browser It gives instructions on how to use wget instead. ``` wget -qO- https://rpm.nodesource.com/setup | bash - ``` maybe that will help someone!
I recommend using `dnf` to install the version of NodeJS you need because `yum` will likely pull the wrong version. As seen [Here](https://linuxconfig.org/how-to-install-node-js-on-redhat-8-linux) List the available versions; ``` sudo dnf module list nodejs ``` Install the one you want: ``` sudo dnf module install...
27,778,593
I am trying to install node.js on Red Hat Enterprise Linux Server release 6.1 using the following command: ``` sudo yum install nodejs npm ``` I got the following error: ``` Error: Package: nodejs-0.10.24-1.el6.x86_64 (epel) Requires: libssl.so.10(libssl.so.10)(64bit) Error: Package: nodejs-devel-0.10.24...
2015/01/05
[ "https://Stackoverflow.com/questions/27778593", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4088696/" ]
IMO the answer by @Eric Soyke should be marked as the correct one. One thing to change in case you want node v4, is to replace 'setup' with 'setup\_4.x'. The sequence of commands (at least for a root user) is this: ``` curl -kL https://rpm.nodesource.com/setup > ~/nodeInstall.sh # or for v4 / v6: # curl -kL https://...
I recommend using `dnf` to install the version of NodeJS you need because `yum` will likely pull the wrong version. As seen [Here](https://linuxconfig.org/how-to-install-node-js-on-redhat-8-linux) List the available versions; ``` sudo dnf module list nodejs ``` Install the one you want: ``` sudo dnf module install...
27,778,593
I am trying to install node.js on Red Hat Enterprise Linux Server release 6.1 using the following command: ``` sudo yum install nodejs npm ``` I got the following error: ``` Error: Package: nodejs-0.10.24-1.el6.x86_64 (epel) Requires: libssl.so.10(libssl.so.10)(64bit) Error: Package: nodejs-devel-0.10.24...
2015/01/05
[ "https://Stackoverflow.com/questions/27778593", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4088696/" ]
I don't have the rep to comment on jfredys' answer, but wanted to add an addendum. His answer is correct for certain environments I assume, but it failed for me as I was running into the error: **Your distribution, identified as "redhat-release-server-6Server-6.6.0.2.el6.x86\_64", is not currently supported, please co...
IMO the answer by @Eric Soyke should be marked as the correct one. One thing to change in case you want node v4, is to replace 'setup' with 'setup\_4.x'. The sequence of commands (at least for a root user) is this: ``` curl -kL https://rpm.nodesource.com/setup > ~/nodeInstall.sh # or for v4 / v6: # curl -kL https://...
27,778,593
I am trying to install node.js on Red Hat Enterprise Linux Server release 6.1 using the following command: ``` sudo yum install nodejs npm ``` I got the following error: ``` Error: Package: nodejs-0.10.24-1.el6.x86_64 (epel) Requires: libssl.so.10(libssl.so.10)(64bit) Error: Package: nodejs-devel-0.10.24...
2015/01/05
[ "https://Stackoverflow.com/questions/27778593", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4088696/" ]
NodeJS provides a setup script that must run before you install it with yum ``` curl -sL https://rpm.nodesource.com/setup | bash - ``` Then the yum command should work ``` yum install -y nodejs ``` <https://github.com/joyent/node/wiki/installing-node.js-via-package-manager#enterprise-linux-and-fedora>
if this command is not working then visit ... <https://rpm.nodesource.com/setup> in your browser It gives instructions on how to use wget instead. ``` wget -qO- https://rpm.nodesource.com/setup | bash - ``` maybe that will help someone!
27,778,593
I am trying to install node.js on Red Hat Enterprise Linux Server release 6.1 using the following command: ``` sudo yum install nodejs npm ``` I got the following error: ``` Error: Package: nodejs-0.10.24-1.el6.x86_64 (epel) Requires: libssl.so.10(libssl.so.10)(64bit) Error: Package: nodejs-devel-0.10.24...
2015/01/05
[ "https://Stackoverflow.com/questions/27778593", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4088696/" ]
I don't have the rep to comment on jfredys' answer, but wanted to add an addendum. His answer is correct for certain environments I assume, but it failed for me as I was running into the error: **Your distribution, identified as "redhat-release-server-6Server-6.6.0.2.el6.x86\_64", is not currently supported, please co...
if this command is not working then visit ... <https://rpm.nodesource.com/setup> in your browser It gives instructions on how to use wget instead. ``` wget -qO- https://rpm.nodesource.com/setup | bash - ``` maybe that will help someone!
1,521,394
How can I send mail to Gmail using Perl? Here's what I'm trying: ``` my $mailer = Email::Send->new( { mailer => 'SMTP::TLS', mailer_args => [ Host => 'smtp.gmail.com', Port => 587, User => 'xxx', Password => 'xxx', ] } ); ...
2009/10/05
[ "https://Stackoverflow.com/questions/1521394", "https://Stackoverflow.com", "https://Stackoverflow.com/users/184311/" ]
Use [Net::SMTP::SSL](http://search.cpan.org/perldoc/Net::SMTP::SSL) to talk to GMail. See [MIME::Lite inline images](http://www.perlmonks.org/?node_id=784574) on [Perlmonks](http://www.perlmonks.org) for an example.
You can use [MIME::Lite](http://search.cpan.org/perldoc?MIME::Lite) to compose a message, which you then send to your local sendmail process. However, in order to talk to gmail's servers you need to [have SSL certificates set up](http://download.gna.org/hpr/fetchmail/FAQ/gmail-pop-howto.html). There's probably more det...
1,521,394
How can I send mail to Gmail using Perl? Here's what I'm trying: ``` my $mailer = Email::Send->new( { mailer => 'SMTP::TLS', mailer_args => [ Host => 'smtp.gmail.com', Port => 587, User => 'xxx', Password => 'xxx', ] } ); ...
2009/10/05
[ "https://Stackoverflow.com/questions/1521394", "https://Stackoverflow.com", "https://Stackoverflow.com/users/184311/" ]
Use [Net::SMTP::SSL](http://search.cpan.org/perldoc/Net::SMTP::SSL) to talk to GMail. See [MIME::Lite inline images](http://www.perlmonks.org/?node_id=784574) on [Perlmonks](http://www.perlmonks.org) for an example.
If you want to send mail to Gmail, you do the same thing you would do to send mail anywhere. If you want to send mail through Gmail, there is the [Email::Send::Gmail](http://search.cpan.org/dist/Email-Send-Gmail/) module. Merely typing your question in Google led me to [Sending Mail Through Gmail with Perl](http://www....
26,897,502
I have to segregate the even and odd numbers in a 2D array in java in two different rows (even in row 1 and odd in row two). I have included the output of my code bellow here is what I have: ``` class TwoDimensionArrays { public static void main(String[] args) { int sum = 0; int row = 2; in...
2014/11/12
[ "https://Stackoverflow.com/questions/26897502", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4092147/" ]
Instead of passing over the list twice try this: ``` for(int v = 0; v < 20; v++) { iArrays[v % 2][(int)v/2] = v; } ``` This will set `iArrays` to: ``` [[0,2,4,6,8,10,12,14,16,18], [1,3,5,7,9,11,13,15,17,19]] ``` What is happening is the `row` is being set to the remainder of `v % 2` (`0` if `v` is even, `1` ...
If I understand your question, one solution is to iterate the array from `0` to `COLUMN` and set each successive slot to two plus the previous slots value (starting with 0 for even and 1 for odd). Like, ``` public static void main(String arg[]) { final int ROW = 2; final int COLUMN = 10; int[][] iArrays = ...
54,241,950
This is my first question in Stackoverflow and I am not a professional developer, so be kind guys :) If any additional information is needed, just let me know. So, I am trying to create a flatlist for a delivery man showing his daily itinerary. In this example he has 4 address to go to. When he arrives at the first pl...
2019/01/17
[ "https://Stackoverflow.com/questions/54241950", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1075757/" ]
You can also try with one another approach as shown below. ``` Create Table Result(Id int, Title Varchar(10), Category Varchar(10), SubCategory Varchar(10), Value Int) Insert Into Result Values(1, 'Part-1','CatX', 'A', 100), (2 ,'Part-1','CatX', 'B', 0), (3 ,'Part-1','CatX', ...
Use `avg()` aggregate function ``` select Title,SubCategory ,avg(Value) from table_name group by Title,SubCategory ```
54,241,950
This is my first question in Stackoverflow and I am not a professional developer, so be kind guys :) If any additional information is needed, just let me know. So, I am trying to create a flatlist for a delivery man showing his daily itinerary. In this example he has 4 address to go to. When he arrives at the first pl...
2019/01/17
[ "https://Stackoverflow.com/questions/54241950", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1075757/" ]
You can also try with one another approach as shown below. ``` Create Table Result(Id int, Title Varchar(10), Category Varchar(10), SubCategory Varchar(10), Value Int) Insert Into Result Values(1, 'Part-1','CatX', 'A', 100), (2 ,'Part-1','CatX', 'B', 0), (3 ,'Part-1','CatX', ...
This would work ``` select Title, SubCategory, AVG(Value) from Table1 group by Title, subcategory ```
54,241,950
This is my first question in Stackoverflow and I am not a professional developer, so be kind guys :) If any additional information is needed, just let me know. So, I am trying to create a flatlist for a delivery man showing his daily itinerary. In this example he has 4 address to go to. When he arrives at the first pl...
2019/01/17
[ "https://Stackoverflow.com/questions/54241950", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1075757/" ]
You can also try with one another approach as shown below. ``` Create Table Result(Id int, Title Varchar(10), Category Varchar(10), SubCategory Varchar(10), Value Int) Insert Into Result Values(1, 'Part-1','CatX', 'A', 100), (2 ,'Part-1','CatX', 'B', 0), (3 ,'Part-1','CatX', ...
Here is solution : ``` using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Data; namespace ConsoleApplication97 { class Program { static void Main(string[] args) { DataTable dt = new DataTable(); dt.Columns.Add("ID", typeof...
35,079,608
I have an unordered dynamic list with same class list items. and I want to group the same class list items into one ul in the main ul. How can I group same class list items? I want to convert the below dynamic list ``` <ul> <li class="a1">Some Content</li> <li class="a1">Some Content</li> <li class="a1">...
2016/01/29
[ "https://Stackoverflow.com/questions/35079608", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5740672/" ]
Here a solution for you: HTML: ``` <ul id="BaseNode"> <li class="a1">A</li> <li class="a1">B</li> <li class="a1">C</li> <li class="a1">D</li> <li class="a2">E</li> <li class="a2">F</li> <li class="a3">G</li> </ul> ``` --- jQuery: ``` $(document).ready(function(){ var lis = $("#Base...
Try this, ```js var classes = {}; $('ul li').each(function() { classes[$(this).attr('class')] = $(this).attr('class'); }); $.each(classes,function(entry) { $("."+entry).wrapAll("<li>"+entry.toUpperCase()+"<ul></ul></li>"); }); ``` ```html <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.0/j...
11,324,750
I have table `types` and i want to build `selectbox` with all values from this table In my controller i wrote this code ``` $allRegistrationTypes = RegistrationType::model()->findAll(); $this->render('index', array('allRegistrationTypes' => $allRegistrationTypes)) ``` How build selectbox in view file ?
2012/07/04
[ "https://Stackoverflow.com/questions/11324750", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1221313/" ]
Well then its pretty simple all you need to do is first create List Data like ``` CHtml::ListData(allRegistrationTypes,'value you want to pass when item is selected','value you have to display'); ``` for ex ``` typeList = CHtml::ListData(allRegistrationTypes,'id','type'); ``` now remember both ***id and type are...
You would use [`CHtml::dropDownList`](http://www.yiiframework.com/doc/api/1.1/CHtml#dropDownList-detail), or [`activeDropDownList`](http://www.yiiframework.com/doc/api/1.1/CHtml#activeDropDownList-detail) if there is a "parent" model and you want to leverage its validation rules. If you want to make the `<select>` ele...
11,324,750
I have table `types` and i want to build `selectbox` with all values from this table In my controller i wrote this code ``` $allRegistrationTypes = RegistrationType::model()->findAll(); $this->render('index', array('allRegistrationTypes' => $allRegistrationTypes)) ``` How build selectbox in view file ?
2012/07/04
[ "https://Stackoverflow.com/questions/11324750", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1221313/" ]
You would use [`CHtml::dropDownList`](http://www.yiiframework.com/doc/api/1.1/CHtml#dropDownList-detail), or [`activeDropDownList`](http://www.yiiframework.com/doc/api/1.1/CHtml#activeDropDownList-detail) if there is a "parent" model and you want to leverage its validation rules. If you want to make the `<select>` ele...
Simplest Method to get "Select Box" in YII Framework: ``` <div class="row"> <?php echo $form->labelEx($model,'county'); $data = CHtml::listData(County::model()->findAll(), 'id', 'county'); $htmlOptions = array('size' => '1', 'prompt'=>'-- select county --', ); echo $form->listBo...
11,324,750
I have table `types` and i want to build `selectbox` with all values from this table In my controller i wrote this code ``` $allRegistrationTypes = RegistrationType::model()->findAll(); $this->render('index', array('allRegistrationTypes' => $allRegistrationTypes)) ``` How build selectbox in view file ?
2012/07/04
[ "https://Stackoverflow.com/questions/11324750", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1221313/" ]
Well then its pretty simple all you need to do is first create List Data like ``` CHtml::ListData(allRegistrationTypes,'value you want to pass when item is selected','value you have to display'); ``` for ex ``` typeList = CHtml::ListData(allRegistrationTypes,'id','type'); ``` now remember both ***id and type are...
Simplest Method to get "Select Box" in YII Framework: ``` <div class="row"> <?php echo $form->labelEx($model,'county'); $data = CHtml::listData(County::model()->findAll(), 'id', 'county'); $htmlOptions = array('size' => '1', 'prompt'=>'-- select county --', ); echo $form->listBo...
42,164,949
Hello I am new at c# and I am doing a small game that I need to play mp3 files. I've been searching about this and using wmp to do it, like this: ``` WindowsMediaPlayer myplayer = new WindowsMediaPlayer(); myplayer.URL = @"c:\somefolder\project\music.mp3"; myplayer.controls.play(); ``` I am able to play...
2017/02/10
[ "https://Stackoverflow.com/questions/42164949", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7547069/" ]
I think that your problem is the way you use `getResource()` : ``` Paths.get(getClass().getResource(filepath).toURI()); ``` You use a relative classpath (that is relative to the the current class location) to retrieve the `"extrapack-renew.sql"` file. It means that this resource has to be located inside this path...
My solution was to have the properties files NOT in the jar archive, contrary to what was asked in the original title of the question. I got it working, with a properties file sitting in the project home directory. ``` $ ll total 52K -rw-rw-r-- 1 stephane 10 févr. 13 10:49 application.properties -rw-r--r-- 1 stepha...
26,433,429
I have an app that has a textbox, validation control and a button. The problem is that if someone copies text from a word document inside the textbox, some of the special characters won't be allowed because of the validation control. But if I delete those special characters and we typed them, the validation control wor...
2014/10/17
[ "https://Stackoverflow.com/questions/26433429", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3896029/" ]
Copy the text into a `visibility: hidden` div with font styles equal to the textarea and a `max-width` that won't let it go beyond your number of columns. If the height of the hidden copy of the text exceeds your limit, remove the text that was added. The following is *close* to what you need. Unfortunately, it doesn'...
Set maxlength attr to 120 Example link is here <http://www.w3schools.com/tags/att_textarea_maxlength.asp>
26,433,429
I have an app that has a textbox, validation control and a button. The problem is that if someone copies text from a word document inside the textbox, some of the special characters won't be allowed because of the validation control. But if I delete those special characters and we typed them, the validation control wor...
2014/10/17
[ "https://Stackoverflow.com/questions/26433429", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3896029/" ]
This solution is quite simple and works for me: 1. Style your textarea with '**overflow:hidden**' and '**resize:none**'. This will hide the scroll bar and stop the user from resizing the textarea themselves. 2. Set the desired dimensions of your textarea. (i.e. rows="4" cols="50") 3. Use an **input** event handler to ...
Set maxlength attr to 120 Example link is here <http://www.w3schools.com/tags/att_textarea_maxlength.asp>
27,477,558
Here is the code for back button. I want to kill other activities by back button but its not working in one activity, but I have other activities and without one activity its working fine. Please help me out. ``` public void onClick(View v) { Intent intent = new Intent(getApplicationContext(), ...
2014/12/15
[ "https://Stackoverflow.com/questions/27477558", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4294246/" ]
Might be this code will help you: ``` public void onClick(View v) { Intent i = new Intent(getApplicationContext(), SomeActivity.class); i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(i); finish(); } ```
You have to set Flags according to API level : ``` Intent intent = new Intent(getApplicationContext(), MainActivity.class); if(Build.VERSION.SDK_INT >= 11) { intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK|Intent.FLAG_ACTIVITY_CLEAR_TOP|Intent.FLAG_ACTIVITY_CLEAR_TASK); } else { intent.setFlags(Intent.FLAG_ACTIV...
27,477,558
Here is the code for back button. I want to kill other activities by back button but its not working in one activity, but I have other activities and without one activity its working fine. Please help me out. ``` public void onClick(View v) { Intent intent = new Intent(getApplicationContext(), ...
2014/12/15
[ "https://Stackoverflow.com/questions/27477558", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4294246/" ]
Might be this code will help you: ``` public void onClick(View v) { Intent i = new Intent(getApplicationContext(), SomeActivity.class); i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(i); finish(); } ```
You can set `android:noHistory="true"` in activities tag in `AndroidManifest.xml` which you don't want to save in stack.
27,477,558
Here is the code for back button. I want to kill other activities by back button but its not working in one activity, but I have other activities and without one activity its working fine. Please help me out. ``` public void onClick(View v) { Intent intent = new Intent(getApplicationContext(), ...
2014/12/15
[ "https://Stackoverflow.com/questions/27477558", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4294246/" ]
Might be this code will help you: ``` public void onClick(View v) { Intent i = new Intent(getApplicationContext(), SomeActivity.class); i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(i); finish(); } ```
Try to define one local broadcast receiver on top most parent activity or base activity : ``` private final class KillReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { finish(); } } ``` Intialize and register broadcast receiver in onCreate() and unregis...
5,474,767
I'm trying to solve [this problem.](https://stackoverflow.com/questions/5461191/creating-screens-and-underlying-data-access-layer-dynamically-on-android) I was wondering if it's possible to use ORMLite (or modify it) to support this use case ? Thanks.
2011/03/29
[ "https://Stackoverflow.com/questions/5474767", "https://Stackoverflow.com", "https://Stackoverflow.com/users/306346/" ]
Just use [db4o](http://www.db4o.com/android/) and forget all the sql and mappings hassle. Model your objects and persist them directly.
Now, you could create a table of screens which could then have a field table with the name of the screen-id, field name, and other information. You could have a user-id in the screen table so each user could have an entry which corresponds to a list of fields. ``` public class Screen { String user; ... } public c...
35,161,201
I have gone through almost all posts for this error. But i was unable for figure out the issue. I have tried to change build.gradle repositories to mavenCentral() and have also tried make changes in app.gradle. I just though of adding volley into my app, from then the sync is getting failed. I have also tried file->Inv...
2016/02/02
[ "https://Stackoverflow.com/questions/35161201", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4994472/" ]
``` insert into table_a (f1, f2, f3, f4, f5, f6) select f1, f2, f3, f4, f5, f6 from ( ( select $1, $2, $3, f4, f5, f2, 1 from table_a where <conditionals> order by <ordering> limit 1 ) s union all select $1, $2, $3, '', '', null, 2 ) s (f1, f2, f3, f4, f5, f6, o) ...
Just another way if you want to use default value from table DDL instead of hardcoded in the query: ``` WITH t AS ( INSERT INTO table_a (f1, f2, f3, f4, f5, f6) SELECT $1, $2, $3, f4, f5, f2 FROM table_a WHERE <conditionals> ORDER BY <ordering> LIMIT 1 RETURNING *) -- ...
48,862,529
I understand [why control characters are illegal in XML 1.0](https://stackoverflow.com/questions/404107/why-are-control-characters-illegal-in-xml-1-0), but still I need to store them somehow in XML payload and I cannot find any recommendations about escaping them. I cannot upgrade to XML 1.1. How should I escape e.g. ...
2018/02/19
[ "https://Stackoverflow.com/questions/48862529", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4647853/" ]
One way is to use processing instructions: `<?hex 01?>`. But that only works in element content, not in attributes. And of course the processing instruction needs to be understood by the receiving application. You could also use elements: `<hex value="01"/>` but elements are visible in an XSD schema or DTD, while proc...
It's quite common in logging/printing of FIX messages to substitute SOH with another character like '|'. Could you do the same here?
48,862,529
I understand [why control characters are illegal in XML 1.0](https://stackoverflow.com/questions/404107/why-are-control-characters-illegal-in-xml-1-0), but still I need to store them somehow in XML payload and I cannot find any recommendations about escaping them. I cannot upgrade to XML 1.1. How should I escape e.g. ...
2018/02/19
[ "https://Stackoverflow.com/questions/48862529", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4647853/" ]
One way is to use processing instructions: `<?hex 01?>`. But that only works in element content, not in attributes. And of course the processing instruction needs to be understood by the receiving application. You could also use elements: `<hex value="01"/>` but elements are visible in an XSD schema or DTD, while proc...
My company ended up adding our own markup before XML: {1}. You also have to escape the { and } braces as {123} and {125}. The when reading the XML you have to do your own parse of the embedded codes.
49,160,125
I have and Application which has a **singleton** that stores information across the whole app. However, this is creating some data race issues when using the singleton from different threads. Here there is a very dummy and simplistic version of the problem: **Singleton** ``` class Singleton { static var shared ...
2018/03/07
[ "https://Stackoverflow.com/questions/49160125", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5761878/" ]
Thanks to @rmaddy comments which pointed me in the right direction I was able to solve the problem. In order to make the property `foo` of the `Singleton` thread safe, it need to be modified as follows: ``` class Singleton { static let shared = Singleton() private init(){} private let internalQueu...
**Swift Thread safe Singleton** [[GCD]](https://stackoverflow.com/a/61102990/4770877) [[Swift barrier flag for thread safe]](https://stackoverflow.com/questions/46732016/main-async-vs-main-sync-vs-global-async-in-swift3-gcd/61102990#61102990) You are able to implement Swift's Singleton pattern for concurrent envirom...
21,563,414
I am using aptana studio v 3.4.2.201308081805 on windows 7, I know that v 3.5 is available because I was prompted to update to 3.5 on a different computer. I have not received the update prompt on my macbook air or on my work computer. Does anyone know how to force aptana to update to v 3.5?
2014/02/04
[ "https://Stackoverflow.com/questions/21563414", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1922932/" ]
Aptana has removed version 3.5 due to several bugs. Current stable version is 3.4.2 You can check here [Aptana download](http://www.aptana.com/products/studio3/download)
Check out the other Stack Overflow question from [here](https://stackoverflow.com/questions/11182618/how-to-update-aptana-studio-to-the-latest). It's also about updating Aptana Studio. Basically, in your case, Aptana may not have the update sites list configured yet. You'll need to import the XML file containing these ...
62,315
After watching the thirteen films in the *Marvel Cinematic Universe*, I've been wondering if there is a longer running series of films that maps out a continuous storyline. [I've found this article on Wikipedia](https://en.wikipedia.org/wiki/List_of_film_series_with_more_than_twenty_entries), but I am unsure if any of...
2016/10/24
[ "https://movies.stackexchange.com/questions/62315", "https://movies.stackexchange.com", "https://movies.stackexchange.com/users/30280/" ]
According to [Wikipedia's entry for *Blondie* (the comic strip)](https://en.wikipedia.org/wiki/Blondie_(comic_strip)), of the 28 movies made based on the strip, at least the first 14 were a continuous series meeting your definition: > > Blondie was adapted into a long-running series of 28 low-budget theatrical B-fea...
**New Answer**: It is [The Land Before Time](https://en.wikipedia.org/wiki/The_Land_Before_Time_(franchise)#Films). There have been 14 movies in the series, but the 13th one is reboot. So, if we don't count it, there are still 12. > > The Land Before Time is a franchise of Universal Studios animated films centered o...
62,315
After watching the thirteen films in the *Marvel Cinematic Universe*, I've been wondering if there is a longer running series of films that maps out a continuous storyline. [I've found this article on Wikipedia](https://en.wikipedia.org/wiki/List_of_film_series_with_more_than_twenty_entries), but I am unsure if any of...
2016/10/24
[ "https://movies.stackexchange.com/questions/62315", "https://movies.stackexchange.com", "https://movies.stackexchange.com/users/30280/" ]
Beating the 14 movie streak of the Blondie movies, we now have **23** movies in the Marvel Cinematic Universe: 1. [Iron Man](https://en.wikipedia.org/wiki/List_of_Marvel_Cinematic_Universe_films#Iron_Man_(2008)) 2. [The Incredible Hulk](https://en.wikipedia.org/wiki/List_of_Marvel_Cinematic_Universe_films#The_Incredib...
**New Answer**: It is [The Land Before Time](https://en.wikipedia.org/wiki/The_Land_Before_Time_(franchise)#Films). There have been 14 movies in the series, but the 13th one is reboot. So, if we don't count it, there are still 12. > > The Land Before Time is a franchise of Universal Studios animated films centered o...
62,315
After watching the thirteen films in the *Marvel Cinematic Universe*, I've been wondering if there is a longer running series of films that maps out a continuous storyline. [I've found this article on Wikipedia](https://en.wikipedia.org/wiki/List_of_film_series_with_more_than_twenty_entries), but I am unsure if any of...
2016/10/24
[ "https://movies.stackexchange.com/questions/62315", "https://movies.stackexchange.com", "https://movies.stackexchange.com/users/30280/" ]
According to [Wikipedia's entry for *Blondie* (the comic strip)](https://en.wikipedia.org/wiki/Blondie_(comic_strip)), of the 28 movies made based on the strip, at least the first 14 were a continuous series meeting your definition: > > Blondie was adapted into a long-running series of 28 low-budget theatrical B-fea...
[The *Up* documentary series](https://en.wikipedia.org/wiki/Up_Series) currently consists of nine films spanning 55 years. The original film, [*Seven Up!*](https://www.imdb.com/title/tt0058578/), was released in 1964 and featured interviews with several 7-year-old British children from a variety of backgrounds. Since ...
62,315
After watching the thirteen films in the *Marvel Cinematic Universe*, I've been wondering if there is a longer running series of films that maps out a continuous storyline. [I've found this article on Wikipedia](https://en.wikipedia.org/wiki/List_of_film_series_with_more_than_twenty_entries), but I am unsure if any of...
2016/10/24
[ "https://movies.stackexchange.com/questions/62315", "https://movies.stackexchange.com", "https://movies.stackexchange.com/users/30280/" ]
Beating the 14 movie streak of the Blondie movies, we now have **23** movies in the Marvel Cinematic Universe: 1. [Iron Man](https://en.wikipedia.org/wiki/List_of_Marvel_Cinematic_Universe_films#Iron_Man_(2008)) 2. [The Incredible Hulk](https://en.wikipedia.org/wiki/List_of_Marvel_Cinematic_Universe_films#The_Incredib...
[The *Up* documentary series](https://en.wikipedia.org/wiki/Up_Series) currently consists of nine films spanning 55 years. The original film, [*Seven Up!*](https://www.imdb.com/title/tt0058578/), was released in 1964 and featured interviews with several 7-year-old British children from a variety of backgrounds. Since ...
29,774,038
Why is this query returning an error. I am trying to load the code for table as a constant string, the flag for data again a constant string, the time of insertion and the counts for a table. I thought, let me try and run the secelct before writing the inserts. But for some reason, it fails listing column names from ta...
2015/04/21
[ "https://Stackoverflow.com/questions/29774038", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1725647/" ]
The double quotes on the literals is a problem. Here is a simpler version that I tested successfully: ``` hive -e "select 'WEB' , '1Hr' , from_unixtime((unix_timestamp(substr(sysDate, 0, 11), 'dd/MMM/yyyy')), 'MM/dd/yyyy') as time, count(*) from weblog where year=2015 and month=04 and day=17 group by 1,2 , from_unixti...
Just leave out the constants in the `group by`. It isn't doing anything: ``` select "WEB" as src_cd, "1Hr" as Load_Flag, from_unixtime((unix_timestamp(substr(sysDate, 0, 11), 'dd/MMM/yyyy')), 'MM/dd/yyyy') as time, count(*) from weblog where year = 2015 and month = 04 and day = 17 group by from_unixtime((uni...
29,774,038
Why is this query returning an error. I am trying to load the code for table as a constant string, the flag for data again a constant string, the time of insertion and the counts for a table. I thought, let me try and run the secelct before writing the inserts. But for some reason, it fails listing column names from ta...
2015/04/21
[ "https://Stackoverflow.com/questions/29774038", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1725647/" ]
Just leave out the constants in the `group by`. It isn't doing anything: ``` select "WEB" as src_cd, "1Hr" as Load_Flag, from_unixtime((unix_timestamp(substr(sysDate, 0, 11), 'dd/MMM/yyyy')), 'MM/dd/yyyy') as time, count(*) from weblog where year = 2015 and month = 04 and day = 17 group by from_unixtime((uni...
There are two things. 1. Hive does not parse double quote or single quote in that way. So instead use back quote(`). 2. In group by clause either use the columnar position specifier or the direct functional translation.
29,774,038
Why is this query returning an error. I am trying to load the code for table as a constant string, the flag for data again a constant string, the time of insertion and the counts for a table. I thought, let me try and run the secelct before writing the inserts. But for some reason, it fails listing column names from ta...
2015/04/21
[ "https://Stackoverflow.com/questions/29774038", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1725647/" ]
The double quotes on the literals is a problem. Here is a simpler version that I tested successfully: ``` hive -e "select 'WEB' , '1Hr' , from_unixtime((unix_timestamp(substr(sysDate, 0, 11), 'dd/MMM/yyyy')), 'MM/dd/yyyy') as time, count(*) from weblog where year=2015 and month=04 and day=17 group by 1,2 , from_unixti...
There are two things. 1. Hive does not parse double quote or single quote in that way. So instead use back quote(`). 2. In group by clause either use the columnar position specifier or the direct functional translation.
43,123
I'm getting aversion when someone do things that I don't like. This happens when a person do and not on natural things like rain. But It is hard to recorgnise it as aversion because that aversion is not towards a person. I just don't like certain actions that affect me (Only the things that affects me in someway). I do...
2020/11/03
[ "https://buddhism.stackexchange.com/questions/43123", "https://buddhism.stackexchange.com", "https://buddhism.stackexchange.com/users/17744/" ]
Very good question, focused on real and useful problem. Mind generates aversion when things go contrary to what it believes is "right". This belief is called "attachment". For example you believe that only certain weather is good and that it should be that same weather most of the time. So the first technique is to r...
Not sure whether it is a Buddhist perspective, i would like to share few things which may be of some sense to you. Please excuse my immature writing skills. There are two streams of thoughts/ideas/concepts/feelings we are put up with in any life situation. In present case, first stream is the feeling/idea of aversion....
43,123
I'm getting aversion when someone do things that I don't like. This happens when a person do and not on natural things like rain. But It is hard to recorgnise it as aversion because that aversion is not towards a person. I just don't like certain actions that affect me (Only the things that affects me in someway). I do...
2020/11/03
[ "https://buddhism.stackexchange.com/questions/43123", "https://buddhism.stackexchange.com", "https://buddhism.stackexchange.com/users/17744/" ]
Very good question, focused on real and useful problem. Mind generates aversion when things go contrary to what it believes is "right". This belief is called "attachment". For example you believe that only certain weather is good and that it should be that same weather most of the time. So the first technique is to r...
You reflect aversion is harmful to yourself & others; it causes stress to yourself & can even lead to physical disease, such as cancer. If you get angry at the other person in the wrong way or place, you can lose your job, etc, or get suspended by politically correct authorities. You also reflect the Buddha taught the...
43,123
I'm getting aversion when someone do things that I don't like. This happens when a person do and not on natural things like rain. But It is hard to recorgnise it as aversion because that aversion is not towards a person. I just don't like certain actions that affect me (Only the things that affects me in someway). I do...
2020/11/03
[ "https://buddhism.stackexchange.com/questions/43123", "https://buddhism.stackexchange.com", "https://buddhism.stackexchange.com/users/17744/" ]
Very good question, focused on real and useful problem. Mind generates aversion when things go contrary to what it believes is "right". This belief is called "attachment". For example you believe that only certain weather is good and that it should be that same weather most of the time. So the first technique is to r...
The rain is cold. With too much rain we can die of exposure. Knowing a body is cold, we can shield it or take it to a dry place. The thought "I am cold" or "I am averse to cold" can be replaced with the simple thought, "there is wet. there is cold." Further thoughts can address the situation with "this is bearable" or ...
43,123
I'm getting aversion when someone do things that I don't like. This happens when a person do and not on natural things like rain. But It is hard to recorgnise it as aversion because that aversion is not towards a person. I just don't like certain actions that affect me (Only the things that affects me in someway). I do...
2020/11/03
[ "https://buddhism.stackexchange.com/questions/43123", "https://buddhism.stackexchange.com", "https://buddhism.stackexchange.com/users/17744/" ]
Very good question, focused on real and useful problem. Mind generates aversion when things go contrary to what it believes is "right". This belief is called "attachment". For example you believe that only certain weather is good and that it should be that same weather most of the time. So the first technique is to r...
"Come, bite your botty" sometimes help quick if telling angy children, or to "force" them looking, or need to look, into a mirror. Try it, when ever aversion arises.
31,532,828
``` import java.util.Date; import java.util.Timer; import java.util.TimerTask; import android.app.Service; import android.content.Context; import android.content.Intent; import android.location.Location; import android.location.LocationListener; import android.location.LocationManager; import android.os.Bundle; import...
2015/07/21
[ "https://Stackoverflow.com/questions/31532828", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4209039/" ]
in requestLocationUpdates method second parameter is minimum time interval between location updates, in milliseconds, So you just need to do this: ``` LocationManager locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE); locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 30 ...
try using ``` TimerTask scanTask; final Handler handler = new Handler(); mTimer = new Timer(); public void sendSMS(){ scanTask = new TimerTask() { public void run() { handler.post(new Runnable() { public void run() { //your method here whic...
31,532,828
``` import java.util.Date; import java.util.Timer; import java.util.TimerTask; import android.app.Service; import android.content.Context; import android.content.Intent; import android.location.Location; import android.location.LocationListener; import android.location.LocationManager; import android.os.Bundle; import...
2015/07/21
[ "https://Stackoverflow.com/questions/31532828", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4209039/" ]
According to Android Developer Reference Documentation [http://developer.android.com/reference/android/location/LocationManager.html#requestLocationUpdates(java.lang.String, long, float, android.location.LocationListener)](http://developer.android.com/reference/android/location/LocationManager.html#requestLocationUpda...
try using ``` TimerTask scanTask; final Handler handler = new Handler(); mTimer = new Timer(); public void sendSMS(){ scanTask = new TimerTask() { public void run() { handler.post(new Runnable() { public void run() { //your method here whic...
31,532,828
``` import java.util.Date; import java.util.Timer; import java.util.TimerTask; import android.app.Service; import android.content.Context; import android.content.Intent; import android.location.Location; import android.location.LocationListener; import android.location.LocationManager; import android.os.Bundle; import...
2015/07/21
[ "https://Stackoverflow.com/questions/31532828", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4209039/" ]
in requestLocationUpdates method second parameter is minimum time interval between location updates, in milliseconds, So you just need to do this: ``` LocationManager locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE); locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 30 ...
According to Android Developer Reference Documentation [http://developer.android.com/reference/android/location/LocationManager.html#requestLocationUpdates(java.lang.String, long, float, android.location.LocationListener)](http://developer.android.com/reference/android/location/LocationManager.html#requestLocationUpda...
41,614
> > * What does her parents do? > * What do her parents do? > > > Which one is correct? Can you have *does* and *do* in the same sentence like the first one? Would it be incorrect because parents is plural so *do* must be used throughout?
2014/12/10
[ "https://ell.stackexchange.com/questions/41614", "https://ell.stackexchange.com", "https://ell.stackexchange.com/users/-1/" ]
> > What do her parents do? > > > Here the subject of the sentence is *her parents*. Because *her parents* is plural the auxiliary verb *DO* must agree with the plural noun phrase, so we need *do* and not *does*. The auxiliary verb *DO* is the first verb in the sentence. This is the verb that moves in front of the...
The correct question is, "What do her parents do?" Since the word 'parents' is plural you would use 'do.' Of course if you had the word 'parent' instead of 'parents'you would use does. "What do her parents do?" "What does her parent do?"
41,614
> > * What does her parents do? > * What do her parents do? > > > Which one is correct? Can you have *does* and *do* in the same sentence like the first one? Would it be incorrect because parents is plural so *do* must be used throughout?
2014/12/10
[ "https://ell.stackexchange.com/questions/41614", "https://ell.stackexchange.com", "https://ell.stackexchange.com/users/-1/" ]
> > What do her parents do? > > > Here the subject of the sentence is *her parents*. Because *her parents* is plural the auxiliary verb *DO* must agree with the plural noun phrase, so we need *do* and not *does*. The auxiliary verb *DO* is the first verb in the sentence. This is the verb that moves in front of the...
I saw you're struggling between "parent" and parents. Let's start from your question. First, we need to see the subject here which is "parents", mean both of our mother and father, which means that this is a plural subject. For plural subject, you must use the root word. So,.... What does her parents do? (Wrong) Wha...
41,614
> > * What does her parents do? > * What do her parents do? > > > Which one is correct? Can you have *does* and *do* in the same sentence like the first one? Would it be incorrect because parents is plural so *do* must be used throughout?
2014/12/10
[ "https://ell.stackexchange.com/questions/41614", "https://ell.stackexchange.com", "https://ell.stackexchange.com/users/-1/" ]
Araucaria answered the part about which is correct. Yes, it's "do", because the subject is "her parents", which is plural, and so requires a plural verb. As to whether you can use the word "do" twice in a sentence: Sure you can. Maybe you're thinking of the common advice to avoid using the same word twice in a sentenc...
The correct question is, "What do her parents do?" Since the word 'parents' is plural you would use 'do.' Of course if you had the word 'parent' instead of 'parents'you would use does. "What do her parents do?" "What does her parent do?"
41,614
> > * What does her parents do? > * What do her parents do? > > > Which one is correct? Can you have *does* and *do* in the same sentence like the first one? Would it be incorrect because parents is plural so *do* must be used throughout?
2014/12/10
[ "https://ell.stackexchange.com/questions/41614", "https://ell.stackexchange.com", "https://ell.stackexchange.com/users/-1/" ]
To answer your specific question, *Can you have **does** and **do** in the same sentence like the first one?*, Yes, you can. You can have *do* twice, but not *does* twice. This is not a very helpful rule, however. The role that each word plays is very different in each case. The first use of *do*/*does* is just a way ...
The correct question is, "What do her parents do?" Since the word 'parents' is plural you would use 'do.' Of course if you had the word 'parent' instead of 'parents'you would use does. "What do her parents do?" "What does her parent do?"
41,614
> > * What does her parents do? > * What do her parents do? > > > Which one is correct? Can you have *does* and *do* in the same sentence like the first one? Would it be incorrect because parents is plural so *do* must be used throughout?
2014/12/10
[ "https://ell.stackexchange.com/questions/41614", "https://ell.stackexchange.com", "https://ell.stackexchange.com/users/-1/" ]
Araucaria answered the part about which is correct. Yes, it's "do", because the subject is "her parents", which is plural, and so requires a plural verb. As to whether you can use the word "do" twice in a sentence: Sure you can. Maybe you're thinking of the common advice to avoid using the same word twice in a sentenc...
I saw you're struggling between "parent" and parents. Let's start from your question. First, we need to see the subject here which is "parents", mean both of our mother and father, which means that this is a plural subject. For plural subject, you must use the root word. So,.... What does her parents do? (Wrong) Wha...
41,614
> > * What does her parents do? > * What do her parents do? > > > Which one is correct? Can you have *does* and *do* in the same sentence like the first one? Would it be incorrect because parents is plural so *do* must be used throughout?
2014/12/10
[ "https://ell.stackexchange.com/questions/41614", "https://ell.stackexchange.com", "https://ell.stackexchange.com/users/-1/" ]
To answer your specific question, *Can you have **does** and **do** in the same sentence like the first one?*, Yes, you can. You can have *do* twice, but not *does* twice. This is not a very helpful rule, however. The role that each word plays is very different in each case. The first use of *do*/*does* is just a way ...
I saw you're struggling between "parent" and parents. Let's start from your question. First, we need to see the subject here which is "parents", mean both of our mother and father, which means that this is a plural subject. For plural subject, you must use the root word. So,.... What does her parents do? (Wrong) Wha...
41,614
> > * What does her parents do? > * What do her parents do? > > > Which one is correct? Can you have *does* and *do* in the same sentence like the first one? Would it be incorrect because parents is plural so *do* must be used throughout?
2014/12/10
[ "https://ell.stackexchange.com/questions/41614", "https://ell.stackexchange.com", "https://ell.stackexchange.com/users/-1/" ]
It's "do". Think about the answer to the questions. "Her parents *does*" is incorrect, whereas > > Her parents do a mean chicken casserole. > > > Is natural sounding and correct.
The correct question is, "What do her parents do?" Since the word 'parents' is plural you would use 'do.' Of course if you had the word 'parent' instead of 'parents'you would use does. "What do her parents do?" "What does her parent do?"
41,614
> > * What does her parents do? > * What do her parents do? > > > Which one is correct? Can you have *does* and *do* in the same sentence like the first one? Would it be incorrect because parents is plural so *do* must be used throughout?
2014/12/10
[ "https://ell.stackexchange.com/questions/41614", "https://ell.stackexchange.com", "https://ell.stackexchange.com/users/-1/" ]
To answer your specific question, *Can you have **does** and **do** in the same sentence like the first one?*, Yes, you can. You can have *do* twice, but not *does* twice. This is not a very helpful rule, however. The role that each word plays is very different in each case. The first use of *do*/*does* is just a way ...
Araucaria answered the part about which is correct. Yes, it's "do", because the subject is "her parents", which is plural, and so requires a plural verb. As to whether you can use the word "do" twice in a sentence: Sure you can. Maybe you're thinking of the common advice to avoid using the same word twice in a sentenc...
41,614
> > * What does her parents do? > * What do her parents do? > > > Which one is correct? Can you have *does* and *do* in the same sentence like the first one? Would it be incorrect because parents is plural so *do* must be used throughout?
2014/12/10
[ "https://ell.stackexchange.com/questions/41614", "https://ell.stackexchange.com", "https://ell.stackexchange.com/users/-1/" ]
It's "do". Think about the answer to the questions. "Her parents *does*" is incorrect, whereas > > Her parents do a mean chicken casserole. > > > Is natural sounding and correct.
I saw you're struggling between "parent" and parents. Let's start from your question. First, we need to see the subject here which is "parents", mean both of our mother and father, which means that this is a plural subject. For plural subject, you must use the root word. So,.... What does her parents do? (Wrong) Wha...
41,614
> > * What does her parents do? > * What do her parents do? > > > Which one is correct? Can you have *does* and *do* in the same sentence like the first one? Would it be incorrect because parents is plural so *do* must be used throughout?
2014/12/10
[ "https://ell.stackexchange.com/questions/41614", "https://ell.stackexchange.com", "https://ell.stackexchange.com/users/-1/" ]
> > What do her parents do? > > > Here the subject of the sentence is *her parents*. Because *her parents* is plural the auxiliary verb *DO* must agree with the plural noun phrase, so we need *do* and not *does*. The auxiliary verb *DO* is the first verb in the sentence. This is the verb that moves in front of the...
It's "do". Think about the answer to the questions. "Her parents *does*" is incorrect, whereas > > Her parents do a mean chicken casserole. > > > Is natural sounding and correct.
65,811,090
My code worked fine but I changed some things and now it doesn't... When I type `!ping` in the any channel it doesn't work. * the bot is on the server and an admin. * I changed the token down there * here's the code: Does anyone see something?? ```js const Discord = require(`discord.js`), client = new Discord.Clien...
2021/01/20
[ "https://Stackoverflow.com/questions/65811090", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14081166/" ]
The problem is, you're using commas where you should be using semicolons, so JS will be interepreting this strangely which will give you undefined behaviour. You should also preferably prefix your variables with `let`, `var` or `const` otherwise this could also lead to undefined behaviour. It is recommended to use `let...
I've had problems in the past with using wrong quotation marks, that might be the case for you here as well Try to replace all your ` with ' or "
65,811,090
My code worked fine but I changed some things and now it doesn't... When I type `!ping` in the any channel it doesn't work. * the bot is on the server and an admin. * I changed the token down there * here's the code: Does anyone see something?? ```js const Discord = require(`discord.js`), client = new Discord.Clien...
2021/01/20
[ "https://Stackoverflow.com/questions/65811090", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14081166/" ]
I've had problems in the past with using wrong quotation marks, that might be the case for you here as well Try to replace all your ` with ' or "
I found a way to make it work. contact me on discord Moderpo#0172 if you wanna know the answer I'll have to find out what I did because I forgot lol
65,811,090
My code worked fine but I changed some things and now it doesn't... When I type `!ping` in the any channel it doesn't work. * the bot is on the server and an admin. * I changed the token down there * here's the code: Does anyone see something?? ```js const Discord = require(`discord.js`), client = new Discord.Clien...
2021/01/20
[ "https://Stackoverflow.com/questions/65811090", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14081166/" ]
The problem is, you're using commas where you should be using semicolons, so JS will be interepreting this strangely which will give you undefined behaviour. You should also preferably prefix your variables with `let`, `var` or `const` otherwise this could also lead to undefined behaviour. It is recommended to use `let...
I found a way to make it work. contact me on discord Moderpo#0172 if you wanna know the answer I'll have to find out what I did because I forgot lol
45,749,458
I am trying to identify lines in a file that have either 4 integer or 2 double values. My regular expression is as below: ``` var match = new Regex(@"^(?<Values>(((\d+\s*){4})|(\d+\.\d+\s*){2}))$"); ``` Sample of lines in the file getting parsed: ``` element 1 2 8 24 2 1 1 0 1 129 2 2 0 0 30.200001 1000.0000 208 ...
2017/08/18
[ "https://Stackoverflow.com/questions/45749458", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1762551/" ]
you directly store result into array. so your code should be like ``` $reader= \Excel::load(Input::file('import_file'))->toArray(); return redirect()->back()->with('reader', $reader); ```
You can try this: ``` Excel::load(Input::file('import_file'), function ($reader) { //Read and get excel rows... var $arrExcelData = array(); $arrExcelData = $reader->toArray(); return redirect()->back()->with('arrExcelData', $arrExcelData); }); ``` **Render data:** ``` @if(!empty(Session::get('arrEx...
5,706,194
I have inherited a .NET 4 VS2010 solution consisting of a WinForms app and a web service. I don't have access to a server that's running a copy of the web service but I have to run, debug, upgrade and test the project that accesses the web service as well as the web service code. Later, I also want to quickly switch b...
2011/04/18
[ "https://Stackoverflow.com/questions/5706194", "https://Stackoverflow.com", "https://Stackoverflow.com/users/686433/" ]
The easiest is to host the service locally in visual studio and change the service url to switch between the production service and the local one. You can automatically switch between the services by checking for Debug and Release modes using `#if` and `#else` directives. You can also use the interface to provide a st...
* Host your web service in IIS or using a local development web server (cassini) * Use *app.config* to store the address of the web server * Get the code to use the build the endpoint of the web service based on the app.config * Change web server address in the web.config to switch between servers.
62,653,757
I integrated React Froala Editor to my website. It's a simple project and I want to show paragraph select drop down. But it doesn't work. Is it related to version? ``` this.state = { model: ``, tags: [], config: { theme: 'foobar', heightMax: 800, height: 800, toolbarButtons:...
2020/06/30
[ "https://Stackoverflow.com/questions/62653757", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12067813/" ]
It seems that plugins are missing. Try to import plugins in your component: ``` import 'froala-editor/js/plugins.pkgd.min.js'; ```
The issue might be with the froala version you are using. Please update Froala version using > > npm update froala-editor > > > All the options are available in the trail version too. The same options worked for me with v3.1.0, check it below. [Froala editor](https://i.stack.imgur.com/m9Elj.png)
3,197,523
I have a question about camera calibration. I've followed approach shown in a book Learning OpenCV for camera calibration process. But the calibrated(undistorted) image is worse than the original one. Is it possible that my camera don't need calibration anymore?(means that the calibration is done by some driver or som...
2010/07/07
[ "https://Stackoverflow.com/questions/3197523", "https://Stackoverflow.com", "https://Stackoverflow.com/users/385826/" ]
The calibration cannot be done by the driver. If you're planning 3D reconstruction, then you cannot do without a calibration matrix.
Several things to check: 1. Have you verified the corner finder is working correctly (draw them on the calibration images and see if there are any outliers)? 2. Taken good calibration images? Visual inspection for blur, drastic perspective changes, etc. 3. Have good coverage of the image area with your calibration ima...
3,198,494
I am try in to get the ClientID of one of my server controls to appear in a Javascript in my aspx page. Obviously I am going about it the wrong way, but my intent should be made clear in the following: ``` doSomethingFirst(); var hid = "<% Response.Write(HidingField.ClientID) %>"; doSomethingElse(hid); ``` Any advi...
2010/07/07
[ "https://Stackoverflow.com/questions/3198494", "https://Stackoverflow.com", "https://Stackoverflow.com/users/316862/" ]
I'm doing a bit of guessing about your intent, so forgive me if I've guessed wrong, but I think this is what you're looking for: ``` doSomethingFirst(); var hid = document.getElementById('<%= HidingField.ClientID %>'); doSomethingElse(hid); ``` I assuming your intent is to get a reference to the DOM element represen...
Have you tried: ``` var hid = "<%= HidingField.ClientID %>"; ``` making sure that "HidingField" is the ID of the server control?
3,198,494
I am try in to get the ClientID of one of my server controls to appear in a Javascript in my aspx page. Obviously I am going about it the wrong way, but my intent should be made clear in the following: ``` doSomethingFirst(); var hid = "<% Response.Write(HidingField.ClientID) %>"; doSomethingElse(hid); ``` Any advi...
2010/07/07
[ "https://Stackoverflow.com/questions/3198494", "https://Stackoverflow.com", "https://Stackoverflow.com/users/316862/" ]
I'm doing a bit of guessing about your intent, so forgive me if I've guessed wrong, but I think this is what you're looking for: ``` doSomethingFirst(); var hid = document.getElementById('<%= HidingField.ClientID %>'); doSomethingElse(hid); ``` I assuming your intent is to get a reference to the DOM element represen...
It was the stupid missing semicolon. I apologized for wasting everyone's time.
28,592,077
> > HTTP/1.1 has served the Web well for more than fifteen years, but its > age is starting to show. > > > Can anybody explain what is the **main difference** between HTTP 1.1 and 2.0? Is there any change in the transport protocol?
2015/02/18
[ "https://Stackoverflow.com/questions/28592077", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
HTTP/2 supports queries multiplexing, headers compression, priority and more intelligent packet streaming management. This results in reduced latency and accelerates content download on modern web pages. [More details here.](https://daniel.haxx.se/http2/)
HTTP 2.0 is a **binary** protocol that multiplexes numerous streams going over a single (normally TLS-encrypted) TCP connection. The contents of each stream are HTTP 1.1 requests and responses, just encoded and packed up differently. HTTP2 adds a number of features to manage the streams, but leaves old semantics untou...
33,910,676
Problem ======= On one Form I have a Multilist where each item has a "name" and an "ID number". I'd like my app to do the following: After I select an item, it will go to the "profile" screen and then it will display all the information about that person, based on the "ID number" that I will get from the Storage. Qu...
2015/11/25
[ "https://Stackoverflow.com/questions/33910676", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5602982/" ]
I will suggest you use a MultiButton instead of Multilist, then you can add actionEvent to individual element. You can save individual element into static variables in the actionEvent and use it in the before show of your profile form. For example: Declare this globally: ``` private static String UserName = ""; ```...
I totally agree with Diamonds answer and I think that's the best/simplest way to create a list of items. However, if you do still want to use `MultiList` you need to implement a `ListModel` or use `DefaultListModel`. From your question I assume you just used the `MultiList` and filled out the values? In that case wh...
50,314
I wanna set 4 different wallpapers in my 4 workspaces by setting in CCMS (wallpaper plugin). It just only work if show\_desktop (gconf-editor->apps/nautilus/preference) is unchecked. But after that I can not right-click on my desktop anymore. Is it possible to make wallpaper-plugin work without "disable" my desktop?
2011/06/24
[ "https://askubuntu.com/questions/50314", "https://askubuntu.com", "https://askubuntu.com/users/20503/" ]
No. And to make it possible to save my answer ("no" is a bit short) this a possible workaround that changes your actions to open a file on the desktop from 1 move with the mouse and 1 click on an icon to 2 clicks on icons and 1 mouse move: You need to use places>desktop to get to your desktop icons. So you can add i...
i don't know if this helps or not, but i wanted to do the same thing. i have 3 different monitors (running via xinerama), and i want a different background on each one. i also want it to rotate every once in a while. the problem is that a lot of the software out there needs randr to run. but we can get around that. i ...
6,375,516
Ignore the .bat extensions, just a habit from the old dos batch file days. I have 2 simple shell scripts. I want to pass a filename with spaces (some file with spaces.ext) from little.bat to big.bat, as you can see below. It won't let me put the filename in single or double quotes. First one called little.bat: ``` ....
2011/06/16
[ "https://Stackoverflow.com/questions/6375516", "https://Stackoverflow.com", "https://Stackoverflow.com/users/710624/" ]
Escape spaces with another sed command. you can fine details about the idea here: [Escape a string for a sed replace pattern](https://stackoverflow.com/questions/407523/bash-escape-a-string-for-sed-search-pattern)
You can escape each space with a backslash: ``` some\ file\ with\ spaces.ext ``` That way, each space is passed on *quoted*, and the shell won't parse the space to mean "this is the end of one argument and the start of another".
75,925
I implemented an application run on Raspberry Pi 3 using Android Things. This application will be able to play `rtsp` video and output to screen via HDMI port. But the audio is not working with jack 3.5mm. Below is my code: ``` public class MainActivity extends AppCompatActivity { @Override protected void onC...
2017/12/01
[ "https://raspberrypi.stackexchange.com/questions/75925", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/77116/" ]
The problem is that if you connect the hdmi first, it will use the hdmi as the audio output. Try connecting the audio jack first. This solved it for me.
If you cannot get the 3.5" jack working, Android Things also supports USB audio as well. A viable solution might be to just get a $7 USB audio card that has 3.5mm jacks on it, something like this: [![Generic USB audio card with 3.5mm jacks for speaker and microphone](https://i.stack.imgur.com/6Z7hn.jpg)](https://i.sta...
75,925
I implemented an application run on Raspberry Pi 3 using Android Things. This application will be able to play `rtsp` video and output to screen via HDMI port. But the audio is not working with jack 3.5mm. Below is my code: ``` public class MainActivity extends AppCompatActivity { @Override protected void onC...
2017/12/01
[ "https://raspberrypi.stackexchange.com/questions/75925", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/77116/" ]
The problem is that if you connect the hdmi first, it will use the hdmi as the audio output. Try connecting the audio jack first. This solved it for me.
Add this line in `config.txt` file: ``` hdmi_ignore_edid_audio=1 ```
60,336,447
I have custom hash function for unordered\_set of vectors< int >: ``` struct VectorHash { int operator()(const vector<int> &V) const { int hsh=V[0] + V[1]; return hash<int>()(hsh); }}; ``` And for two such vectors I have the same hash equal 3: ``` vector<int> v1{2,1}; vector<int> v2{1,2}; ``` But when I ...
2020/02/21
[ "https://Stackoverflow.com/questions/60336447", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12937832/" ]
Hash isn't everything, what you're seeing here, is a collision. Both `std::vector<int>` have the same hash value here, but after hash is calculated, `std::unordered_map` will actually actually check for equality of elements using `operator==` to check for equality of elements, which fails in this case, and fails to fi...
> > I assume that if two elements in unordered\_set have the same hash then if I have v1 in my unordered\_set, find method should return true, when I try to find v2. > > > That assumption is incorrect, same hash doesn't mean objects are equal. [`unordered_map`](https://en.cppreference.com/w/cpp/container/unordere...
60,336,447
I have custom hash function for unordered\_set of vectors< int >: ``` struct VectorHash { int operator()(const vector<int> &V) const { int hsh=V[0] + V[1]; return hash<int>()(hsh); }}; ``` And for two such vectors I have the same hash equal 3: ``` vector<int> v1{2,1}; vector<int> v2{1,2}; ``` But when I ...
2020/02/21
[ "https://Stackoverflow.com/questions/60336447", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12937832/" ]
> > I assume that if two elements in unordered\_set have the same hash then if I have v1 in my unordered\_set, find method should return true, when I try to find v2. > > > That assumption is incorrect, same hash doesn't mean objects are equal. [`unordered_map`](https://en.cppreference.com/w/cpp/container/unordere...
If you happen to want unique identifiers but not automatically compare values, you could use an `(unordered_)map<int, vector<int>>` and use that VectorHash function to generate the int key: ``` unordered_map<int, vector<int>> map; int key=V[0] + V[1] map[key] = V; ```
60,336,447
I have custom hash function for unordered\_set of vectors< int >: ``` struct VectorHash { int operator()(const vector<int> &V) const { int hsh=V[0] + V[1]; return hash<int>()(hsh); }}; ``` And for two such vectors I have the same hash equal 3: ``` vector<int> v1{2,1}; vector<int> v2{1,2}; ``` But when I ...
2020/02/21
[ "https://Stackoverflow.com/questions/60336447", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12937832/" ]
> > I assume that if two elements in unordered\_set have the same hash then if I have v1 in my unordered\_set, find method should return true, when I try to find v2. > > > That assumption is incorrect, same hash doesn't mean objects are equal. [`unordered_map`](https://en.cppreference.com/w/cpp/container/unordere...
you need to provide a comparator to the `unordered_set` as well if you want the two elements to match, you can do something along the lines of this: ``` struct VectorComparator { bool operator()(const std::vector<int> & obj1, const std::vector<int> & obj2) const { if ((obj1[0] + obj1[1]) == (obj2[0] + obj2[1])...
60,336,447
I have custom hash function for unordered\_set of vectors< int >: ``` struct VectorHash { int operator()(const vector<int> &V) const { int hsh=V[0] + V[1]; return hash<int>()(hsh); }}; ``` And for two such vectors I have the same hash equal 3: ``` vector<int> v1{2,1}; vector<int> v2{1,2}; ``` But when I ...
2020/02/21
[ "https://Stackoverflow.com/questions/60336447", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12937832/" ]
Hash isn't everything, what you're seeing here, is a collision. Both `std::vector<int>` have the same hash value here, but after hash is calculated, `std::unordered_map` will actually actually check for equality of elements using `operator==` to check for equality of elements, which fails in this case, and fails to fi...
If you happen to want unique identifiers but not automatically compare values, you could use an `(unordered_)map<int, vector<int>>` and use that VectorHash function to generate the int key: ``` unordered_map<int, vector<int>> map; int key=V[0] + V[1] map[key] = V; ```
60,336,447
I have custom hash function for unordered\_set of vectors< int >: ``` struct VectorHash { int operator()(const vector<int> &V) const { int hsh=V[0] + V[1]; return hash<int>()(hsh); }}; ``` And for two such vectors I have the same hash equal 3: ``` vector<int> v1{2,1}; vector<int> v2{1,2}; ``` But when I ...
2020/02/21
[ "https://Stackoverflow.com/questions/60336447", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12937832/" ]
Hash isn't everything, what you're seeing here, is a collision. Both `std::vector<int>` have the same hash value here, but after hash is calculated, `std::unordered_map` will actually actually check for equality of elements using `operator==` to check for equality of elements, which fails in this case, and fails to fi...
you need to provide a comparator to the `unordered_set` as well if you want the two elements to match, you can do something along the lines of this: ``` struct VectorComparator { bool operator()(const std::vector<int> & obj1, const std::vector<int> & obj2) const { if ((obj1[0] + obj1[1]) == (obj2[0] + obj2[1])...
38,990,345
I hava a javaagent Jar `simpleAgent.jar`. I used it to redifine classes in it and I cached some classes to avoid redifine ``` public class Premain { private static Instrumentation instrumentation; private static final Map<String, Class> allLoadClassesMap = new ConcurrentHashMap<>(); public static void ...
2016/08/17
[ "https://Stackoverflow.com/questions/38990345", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6704318/" ]
Each JVM instance is separate and does not "know" about other JVMs unless you do something in application level. So, generally the answer is "yes, you can use the same jar either javaagent or not for as many JVM instances as you want."
A Javaaget is treated by the VM similarly to jar files on the class path. Those files are read only, all state is contained in the running VM such that they are safely shared among multiple processes.
71,906,448
I need to hide or to make some field completely hidden in some field in the item class. i have tried using jquery, javascript and html but the result is not too good. ``` <div class="item"> <label for="id_mobile_number">Mobile number:</label>: <input type="text" name="mobile_number" maxlength="12" requ...
2022/04/18
[ "https://Stackoverflow.com/questions/71906448", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18375924/" ]
You can hide siblings: ```css [for="id_user"], [for="id_user"] ~ * /* hide siblings */ { position: absolute; display: none } [for="id_idplan"], [for="id_idplan"] ~ * /* hide siblings */ { position: absolute; display: none } ``` ```html <div class="item"> <label for="id_mobile_number">Mobile number:<...
Since the release of [HTML5](https://html.spec.whatwg.org/multipage/) one can now simply do: ```html <div hidden>This div is hidden</div> ``` Note: This is not [supported](https://caniuse.com/hidden) by some old browsers, most notably IE < 11. Hidden Attribute Documentation ([MDN](https://developer.mozilla.org/en-US...
71,906,448
I need to hide or to make some field completely hidden in some field in the item class. i have tried using jquery, javascript and html but the result is not too good. ``` <div class="item"> <label for="id_mobile_number">Mobile number:</label>: <input type="text" name="mobile_number" maxlength="12" requ...
2022/04/18
[ "https://Stackoverflow.com/questions/71906448", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18375924/" ]
Maybe like this?? ```css #id_user { position: absolute; display: none } #id_idplan { position: absolute; display: none } label#hide_user {display:none;} select#hide_user {display:none;} ``` ```html <div class="item"> <label for="id_mobile_number">Mobile number::</labe...
Since the release of [HTML5](https://html.spec.whatwg.org/multipage/) one can now simply do: ```html <div hidden>This div is hidden</div> ``` Note: This is not [supported](https://caniuse.com/hidden) by some old browsers, most notably IE < 11. Hidden Attribute Documentation ([MDN](https://developer.mozilla.org/en-US...
71,906,448
I need to hide or to make some field completely hidden in some field in the item class. i have tried using jquery, javascript and html but the result is not too good. ``` <div class="item"> <label for="id_mobile_number">Mobile number:</label>: <input type="text" name="mobile_number" maxlength="12" requ...
2022/04/18
[ "https://Stackoverflow.com/questions/71906448", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18375924/" ]
You can hide siblings: ```css [for="id_user"], [for="id_user"] ~ * /* hide siblings */ { position: absolute; display: none } [for="id_idplan"], [for="id_idplan"] ~ * /* hide siblings */ { position: absolute; display: none } ``` ```html <div class="item"> <label for="id_mobile_number">Mobile number:<...
Maybe like this?? ```css #id_user { position: absolute; display: none } #id_idplan { position: absolute; display: none } label#hide_user {display:none;} select#hide_user {display:none;} ``` ```html <div class="item"> <label for="id_mobile_number">Mobile number::</labe...
31,451,935
While writing interface in java 8 i noticed behavior that i was able to define method in interface without any compile time error. ``` public interface AdvanceMediaPlayer { public static void playVlc(String fileName) { System.out.println("play VLC"); } public abstract void playMp4(String fileName);...
2015/07/16
[ "https://Stackoverflow.com/questions/31451935", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2828006/" ]
Java8 provides the ability to create default method implementations: <https://docs.oracle.com/javase/tutorial/java/IandI/defaultmethods.html>
> > `Java 8` introduces `“Default Method”`new feature, which allows > developer to add new methods to the interfaces without breaking the > existing implementation of these interface. It provides flexibility to > allow interface define implementation which will use as default in the > situation where a concrete cl...
31,451,935
While writing interface in java 8 i noticed behavior that i was able to define method in interface without any compile time error. ``` public interface AdvanceMediaPlayer { public static void playVlc(String fileName) { System.out.println("play VLC"); } public abstract void playMp4(String fileName);...
2015/07/16
[ "https://Stackoverflow.com/questions/31451935", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2828006/" ]
Java8 provides the ability to create default method implementations: <https://docs.oracle.com/javase/tutorial/java/IandI/defaultmethods.html>
Java 8 makes you able to declare static and default methods in interfaces. A static interface method can not be overridden by the implementing class. It can only be called like this: ``` AdvanceMediaPlayer.playVlc(fileName); ``` A default method can be overridden by the implementing class. It is declared with the `...
308,829
I have often heard developers mention that Java can't "*do [Real Time](https://en.wikipedia.org/wiki/Real-time_computing)*", meaning a Java app running on Linux cannot meet the requirements of a deterministic real-time system, such as something running on RIOT-OS, etc. I am trying to understand *why*. My [SWAG](https:...
2016/01/30
[ "https://softwareengineering.stackexchange.com/questions/308829", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/154753/" ]
A software is real time not when it is as fast as possible, but when it is guaranteed that a process completes within some determined time slot. In a soft real time system, it is good but not absolutely necessary that this is guaranteed. E.g. in a game, the calculations necessary for a frame should complete within the ...
From [wikipedia](https://en.wikipedia.org/wiki/Real-time_operating_system): > > A key characteristic of an RTOS is the level of its consistency concerning the amount of time it takes to accept and complete an application's task; the variability is jitter. > > > The important thing is that jitter is quantified for...
308,829
I have often heard developers mention that Java can't "*do [Real Time](https://en.wikipedia.org/wiki/Real-time_computing)*", meaning a Java app running on Linux cannot meet the requirements of a deterministic real-time system, such as something running on RIOT-OS, etc. I am trying to understand *why*. My [SWAG](https:...
2016/01/30
[ "https://softwareengineering.stackexchange.com/questions/308829", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/154753/" ]
From [wikipedia](https://en.wikipedia.org/wiki/Real-time_operating_system): > > A key characteristic of an RTOS is the level of its consistency concerning the amount of time it takes to accept and complete an application's task; the variability is jitter. > > > The important thing is that jitter is quantified for...
For starter, the vanilla Linux itself can't do real time. That's why [RTLinux](https://en.wikipedia.org/wiki/RTLinux) was developed. Lets say you run a few java processes on RTLinux, they would still be considered real time as all those processes are scheduled by the kernel, i.e. if one process is late, other processe...
308,829
I have often heard developers mention that Java can't "*do [Real Time](https://en.wikipedia.org/wiki/Real-time_computing)*", meaning a Java app running on Linux cannot meet the requirements of a deterministic real-time system, such as something running on RIOT-OS, etc. I am trying to understand *why*. My [SWAG](https:...
2016/01/30
[ "https://softwareengineering.stackexchange.com/questions/308829", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/154753/" ]
A software is real time not when it is as fast as possible, but when it is guaranteed that a process completes within some determined time slot. In a soft real time system, it is good but not absolutely necessary that this is guaranteed. E.g. in a game, the calculations necessary for a frame should complete within the ...
For starter, the vanilla Linux itself can't do real time. That's why [RTLinux](https://en.wikipedia.org/wiki/RTLinux) was developed. Lets say you run a few java processes on RTLinux, they would still be considered real time as all those processes are scheduled by the kernel, i.e. if one process is late, other processe...
25,937,168
I use a `entity` form type to provide a list of `Position` entities in a form. I use it often enough (each with the same "setup" code to customize it) that I've decided to make a custom form type from it for better re-use. Here's the current form type: ``` class PositionType extends AbstractType { private $om; ...
2014/09/19
[ "https://Stackoverflow.com/questions/25937168", "https://Stackoverflow.com", "https://Stackoverflow.com/users/899199/" ]
This is fairly easy to achieve. You can build an option that depends on another option. [OptionResolver Component - Default Values that Depend on another Option](http://symfony.com/doc/current/components/options_resolver.html#default-values-that-depend-on-another-option) Basically you will do: ``` $resolver ->se...
You could make use of the form options to pass a variable into the form builder. For example in controller; ``` public function createAction() { $form = $this->formFactory->create('client', $client, array('name' => 'create')); return $this->template->renderResponse('bundle:add.html.twig', array('form' => ...
29,456,031
I am running a simple client-server program written in python, on my android phone using QPython and QPython3. I need to pass some commandline parameters. How do I do that?
2015/04/05
[ "https://Stackoverflow.com/questions/29456031", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3211321/" ]
I found a couple of way of running a script that I imported from my Linux laptop. If I put `frets.py` in the `script3` directory, and create this script in the same directory: ``` import sys, os dir = '/storage/emulated/0/com.hipipal.qpyplus/scripts3/' os.chdir(dir) def callfrets(val): os.system(sys.execu...
Just write a wrapper script which get the parameters and pass to the real script using some function like execfile, and put the script into /sdcard/com.hipipal.qpyplus/scripts or /sdcard/com.hipipal.qpyplus/scripts3 (for qpython3). Then you can see the script in scripts when clicking the start button.
627,158
$$\nabla \times A = B$$ $A$ is vector magnetic potential, $\mathrm{Wb/m}$ $B$ is magnetic field intensity, $\mathrm{Wb/m^2}$ **Where does one more m come from for $B$?** *Is that from the gradient operator so it is in meter or something?*
2021/04/05
[ "https://physics.stackexchange.com/questions/627158", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/271720/" ]
It's kind of a funny misconception that the sun is yellow. I mean, astronomically speaking it is indeed a *yellow star*, more precisely [G-type main sequence / yellow dwarf](https://en.wikipedia.org/wiki/G-type_main-sequence_star)... but don't be fooled by the terminology: astronomically speaking, you'll also find that...
Sunlight is "white". Blue sky is due to Rayleigh scattering, where the intensity of scattered light depends on the fourth power of the frequency, then this is why the sky is blue, since blue is in the upper bound of the visible spectrum in frequency. This is because the molecules in atmosphere have a size much smaller ...
19,249,756
I have the regular wordpress code to display category description: ``` <?php echo category_description( $category_id ); ?> ``` But how can i display Woocommerce category description? @@ After one of the comment suggestion i added: ``` <?php if ( have_posts() ) { while ( have_posts()...
2013/10/08
[ "https://Stackoverflow.com/questions/19249756", "https://Stackoverflow.com", "https://Stackoverflow.com/users/713576/" ]
``` $args = array( 'taxonomy' => 'product_cat' ); $terms = get_terms('product_cat', $args); $count = count($terms); if ($count > 0) { foreach ($terms as $term) { echo $term->description; } } ``` Edit for Last answer: ``` <?php global $post; $args = array( 'taxonomy' => 'product_cat' ); $terms =...
You can display the product **category description** - use this code - ``` <?php global $post, $product; $categ = $product->get_categories(); $term = get_term_by ( 'name' , strip_tags($categ), 'product_cat' ); echo $term->description; ?> ```
19,249,756
I have the regular wordpress code to display category description: ``` <?php echo category_description( $category_id ); ?> ``` But how can i display Woocommerce category description? @@ After one of the comment suggestion i added: ``` <?php if ( have_posts() ) { while ( have_posts()...
2013/10/08
[ "https://Stackoverflow.com/questions/19249756", "https://Stackoverflow.com", "https://Stackoverflow.com/users/713576/" ]
``` $args = array( 'taxonomy' => 'product_cat' ); $terms = get_terms('product_cat', $args); $count = count($terms); if ($count > 0) { foreach ($terms as $term) { echo $term->description; } } ``` Edit for Last answer: ``` <?php global $post; $args = array( 'taxonomy' => 'product_cat' ); $terms =...
The main answer for some reason displayed more than one description for me. The answer below solved this for anyone with the same issue: <https://stackoverflow.com/a/19266706/2703913>
19,249,756
I have the regular wordpress code to display category description: ``` <?php echo category_description( $category_id ); ?> ``` But how can i display Woocommerce category description? @@ After one of the comment suggestion i added: ``` <?php if ( have_posts() ) { while ( have_posts()...
2013/10/08
[ "https://Stackoverflow.com/questions/19249756", "https://Stackoverflow.com", "https://Stackoverflow.com/users/713576/" ]
``` $args = array( 'taxonomy' => 'product_cat' ); $terms = get_terms('product_cat', $args); $count = count($terms); if ($count > 0) { foreach ($terms as $term) { echo $term->description; } } ``` Edit for Last answer: ``` <?php global $post; $args = array( 'taxonomy' => 'product_cat' ); $terms =...
[`the_archive_description()`](https://developer.wordpress.org/reference/functions/the_archive_description/) worked for my purposes when other (more complicated) solutions would not. Optional before and after string parameters can be added if needed.
19,249,756
I have the regular wordpress code to display category description: ``` <?php echo category_description( $category_id ); ?> ``` But how can i display Woocommerce category description? @@ After one of the comment suggestion i added: ``` <?php if ( have_posts() ) { while ( have_posts()...
2013/10/08
[ "https://Stackoverflow.com/questions/19249756", "https://Stackoverflow.com", "https://Stackoverflow.com/users/713576/" ]
You can display the product **category description** - use this code - ``` <?php global $post, $product; $categ = $product->get_categories(); $term = get_term_by ( 'name' , strip_tags($categ), 'product_cat' ); echo $term->description; ?> ```
The main answer for some reason displayed more than one description for me. The answer below solved this for anyone with the same issue: <https://stackoverflow.com/a/19266706/2703913>
19,249,756
I have the regular wordpress code to display category description: ``` <?php echo category_description( $category_id ); ?> ``` But how can i display Woocommerce category description? @@ After one of the comment suggestion i added: ``` <?php if ( have_posts() ) { while ( have_posts()...
2013/10/08
[ "https://Stackoverflow.com/questions/19249756", "https://Stackoverflow.com", "https://Stackoverflow.com/users/713576/" ]
[`the_archive_description()`](https://developer.wordpress.org/reference/functions/the_archive_description/) worked for my purposes when other (more complicated) solutions would not. Optional before and after string parameters can be added if needed.
The main answer for some reason displayed more than one description for me. The answer below solved this for anyone with the same issue: <https://stackoverflow.com/a/19266706/2703913>
73,573,550
The react docs boldly state that hooks shall only be called inside **"React functions"**: <https://reactjs.org/docs/hooks-rules.html#only-call-hooks-from-react-functions> "Don’t call Hooks from **regular JavaScript** functions." That raises the question what *precisely* distinguishes a React function from a regular ...
2022/09/01
[ "https://Stackoverflow.com/questions/73573550", "https://Stackoverflow.com", "https://Stackoverflow.com/users/857848/" ]
Whether the function is a component or not comes down to how you will use the function. Do you plan to render it as a JSX element, eg: `<f1 />`? If so, it's a react component and it can use hooks (though you will need to rename it to uppercase, as in `<F1 />`). During the render process, react will call your function, ...
**You get to decide whether a function is a React function, a custom function, or a regular function, which defines who can call it from where.** If F1 is a React function (functional component) you can call it as `<F1 />` but should not call it as `F1()`; if F1 is a regular function you can call it as `F1()` but shoul...
42,789,183
I have and angular service that I want to test. In one of his methods I am using $http of angular service. I am simply want to mock that function (to be more specific mock $http.post function) that would return whatever I want and inject this mock to my service test. I am tried to find solution and I found $httpBacken...
2017/03/14
[ "https://Stackoverflow.com/questions/42789183", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6848513/" ]
From the docs > > **pluginManagement**: is an element that is seen along side plugins. > Plugin Management contains plugin elements in much the same way, > except that rather than configuring plugin information for this > particular project build, it is intended to configure project builds > that inherit from th...
If your inherited project is in a different repo, you need another approach. Just add the parent as a dependency in the plugin. Note that you can't use this approach in `<reporting>` because it doesn't support plugin dependencies. ``` <build> <plugins> <plugin> <groupId>org.apache.maven.plugin...
48,275,998
How C++ handles cout of negative value of signed char? Is the behavour defined in C++11 standard? I am using MinGW C++ 11 compiler. It looks the signed value is converted to unsigned type by adding 256 and then prints extended ASCII characters. ``` signed char a=-35; std::cout<<a; ```
2018/01/16
[ "https://Stackoverflow.com/questions/48275998", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6446479/" ]
According to [this](http://en.cppreference.com/w/cpp/io/basic_ostream/operator_ltlt2), the following overload is selected: ``` template< class Traits > basic_ostream<char,Traits>& operator<<( basic_ostream<char,Traits>& os, signed char ch ); ``` And since `signed char` is not ...
Use type casting to `int`... ``` std::cout << (int)a; ``` ...or, following better C++ programming style (as Christian Hackl suggested): ``` std::cout << static_cast<int>(a); ``` This actually does not answer your questions (already been answered by Holt), but shows a solution to the problem.
48,275,998
How C++ handles cout of negative value of signed char? Is the behavour defined in C++11 standard? I am using MinGW C++ 11 compiler. It looks the signed value is converted to unsigned type by adding 256 and then prints extended ASCII characters. ``` signed char a=-35; std::cout<<a; ```
2018/01/16
[ "https://Stackoverflow.com/questions/48275998", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6446479/" ]
According to [this](http://en.cppreference.com/w/cpp/io/basic_ostream/operator_ltlt2), the following overload is selected: ``` template< class Traits > basic_ostream<char,Traits>& operator<<( basic_ostream<char,Traits>& os, signed char ch ); ``` And since `signed char` is not ...
Most of this is required behavior (and most of what isn't still borders on being required). To be specific, the C++ standard says that iostreams are associated with C-style input and output streams, so `cout` is associated with `stdout` (§[narrow.stream.objects]/3): > > The object `cout` controls output to a stream ...
22,599,917
I am using jQuery File Upload plugin (<http://blueimp.github.io/jQuery-File-Upload/>) for image upload for my website. I am trying to disable `UploadHandler.php` from generating thumbnail image on the server. After some searching, I found this: <https://github.com/blueimp/jQuery-File-Upload/issues/2223> My Code: ``` ...
2014/03/24
[ "https://Stackoverflow.com/questions/22599917", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1995781/" ]
The default `index.php` file should look like following. `error_reporting(E_ALL | E_STRICT); require('UploadHandler.php'); $upload_handler = new UploadHandler();` --- In your **`index.php`** file **before** the following function call `$upload_handler = new UploadHandler();` add the following code... ``` $options...
uncomment these lines in UploadHandler.php around line 103... ``` /*'thumbnail' => array( // Uncomment the following to force the max // dimensions and e.g. create square thumbnails: //'crop' => true, 'max_width' => 80, 'max_height' ...
72,097,711
I searched a lot and there are several questions like this however most of them do not have any answer or are not relevant to me. I'm using TypeORM(v0.2.45) with Postgres driver and my entities/schemas are working fine with `synchronize` mode enabled. My goal is to reverse generate migrations from the existing entiti...
2022/05/03
[ "https://Stackoverflow.com/questions/72097711", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8108312/" ]
Late to the party but maybe it will help someone else. TypeOrm compares your entities schema to the database schema for any changes. If not changes between the two are found, it will not create a new migration. Because you are using `sync: true`, you DB is already up to date with your orm code so no migration is gener...
try delete `dist` folder, re-run `npm run migration:generate Coffee`, or you can split `npm run build` and then generate migration later
433,009
I can't seem to be able to type in a password so that I may acquire access to #apt-get. I'm looking to update my system via terminal, but typing out my password does no good to get me into su, as the spaces stay blank, and what I know is the password won't go through. Has anyone else had this issue?
2014/03/12
[ "https://askubuntu.com/questions/433009", "https://askubuntu.com", "https://askubuntu.com/users/257348/" ]
This answer has screenshots for Gnome-Shell (Ubuntu Gnome 13.10). I suppose it will be similar for standard Unity, but if not, please chime in. First of all (and this is the most common problem), **to have AltGr working you need a keyboard layout which uses it**. For example, this is my keyboard layout (Settings -> R...
In order to set up the `Alt-Gr` key you must go to (setting -> keyboard -> layout settings -> keyboard settings -> then go to the typing tab -> press and hold the Alternative Keyboard Key setting -> move you mouse down to select the key you want to assign `Alt-Gr` to. ![enter image description here](https://i.stack.im...