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 |
|---|---|---|---|---|---|
40,298,854 | Hi there am building an android quiz application. I have all my necessary activities(result activity, question activity etc) I even have my Sqlite database with about 50 questions. For each game or session the user is given 10 questions which are answered and result given to the user. **What I want to achieve is each t... | 2016/10/28 | [
"https://Stackoverflow.com/questions/40298854",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5839345/"
] | One way to work with your case is subclassing `NSRegularExpression` and override `replacementString(for:in:offset:template:)` method.
```
class ToUpperRegex: NSRegularExpression {
override func replacementString(for result: NSTextCheckingResult, in string: String, offset: Int, template templ: String) -> String {
... | This doesn't answer the question pertaining regex, but might be of interest for readers not necessarily needing to use regex to perform this task (rather, using native Swift)
```
extension String {
func camelCased(givenSeparators separators: [Character]) -> String {
let charChunks = characters.split { sepa... |
4,664,864 | Is it necessary to use the second line here?
```
$("message",xml).each(function(id) {
message = $("message",xml).get(id);
msgID = $("msgID",message).text();
```
Isn't there some kind of 'this' keyword to eliminate the second line?
Thanks! | 2011/01/12 | [
"https://Stackoverflow.com/questions/4664864",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/557855/"
] | ```
$('message', xml).each(function() {
var msgID = $(this).find('msgID').text();
}
```
Assuming this structure:
```
<root>
<message>
<msgID>123</msgID>
</message>
<message>
<msgID>234</msgID>
</message>
<message>
<msgID>345</msgID>
</message>
</root>
``` | When you're in [an `.each()`](http://api.jquery.com/each/), `this` will represent the current item in the iteration.
The `.each()` also gives you 2 parameters. The first is the current index number of the iteration, and the second is the item in the iteration, same as `this`.
```
$("message",xml).each(function( idx, ... |
38,372,137 | I like to move post under parent page, by default WordPress makes them appear from the root homepage ex: <http://www.example.com/new-article>
I would like to move the articles URL so that they appear under that ex: <http://www.example.com/blog/new-article>.
Does anyone know how to make WordPress move posts under a sp... | 2016/07/14 | [
"https://Stackoverflow.com/questions/38372137",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3955028/"
] | You have to go your dashboard >> Settings >> Permalinks
Select: "Custom Structure" and make your own permalinks by putting
/blog/%postname%/
on the field there.
See for better that what you want.
You can read up here:
<http://codex.wordpress.org/Using_Permalinks>
and here:
<https://codex.wordpress.org/Settings_Per... | You should
1. create the page "blog"
2. edit the child page
3. set the parent page via the widget on the right side of the edit screen |
38,372,137 | I like to move post under parent page, by default WordPress makes them appear from the root homepage ex: <http://www.example.com/new-article>
I would like to move the articles URL so that they appear under that ex: <http://www.example.com/blog/new-article>.
Does anyone know how to make WordPress move posts under a sp... | 2016/07/14 | [
"https://Stackoverflow.com/questions/38372137",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3955028/"
] | You have to go your dashboard >> Settings >> Permalinks
Select: "Custom Structure" and make your own permalinks by putting
/blog/%postname%/
on the field there.
See for better that what you want.
You can read up here:
<http://codex.wordpress.org/Using_Permalinks>
and here:
<https://codex.wordpress.org/Settings_Per... | Actually I just have realized that this is pretty easy.
In **WordPress >> Setting >>Permalinks** I have changed the permalink structure to *example.com/%category%/%postname%* and got the desired result
Now, I want to edit my category page e.g. *example.com/cat1*. It seems WordPress doesn't allow such thing, am I righ... |
3,259,910 | **Sorry for the long post, but most of it is code spelling out my scenario:**
I'm trying to execute a dynamic query (hopefully through a stored proceedure) to retrieve results based on a variable number of inputs.
If I had a table:
```
(dbo).(People)
ID Name Age
1 Joe 28
2 Bob 32
3 Alan 26
4 ... | 2010/07/15 | [
"https://Stackoverflow.com/questions/3259910",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/351207/"
] | You could use an IF statement:
```
IF LEN(@ids) > 0
BEGIN
SELECT *
FROM dbo.People
WHERE ID IN (SELECT n FROM @ids)
END
ELSE
BEGIN
SELECT *
FROM dbo.People
END
```
Otherwise, [consider making the query real dynamic SQL (minding pitfalls of course)](http://www.sommarskog.se/dynamic_sql.html). | You can try:
```
NOT EXISTS (SELECT 1 FROM @ids)
OR EXISTS (SELECT 1 FROM @ids where n = Id)
```
But these better be small tables - this query will probably not play very well with any indexes on your tables. |
3,259,910 | **Sorry for the long post, but most of it is code spelling out my scenario:**
I'm trying to execute a dynamic query (hopefully through a stored proceedure) to retrieve results based on a variable number of inputs.
If I had a table:
```
(dbo).(People)
ID Name Age
1 Joe 28
2 Bob 32
3 Alan 26
4 ... | 2010/07/15 | [
"https://Stackoverflow.com/questions/3259910",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/351207/"
] | Try:
```
(Id IN (SELECT n FROM @ids) OR NOT EXISTS (SELECT * FROM @ids))
``` | You can try:
```
NOT EXISTS (SELECT 1 FROM @ids)
OR EXISTS (SELECT 1 FROM @ids where n = Id)
```
But these better be small tables - this query will probably not play very well with any indexes on your tables. |
3,259,910 | **Sorry for the long post, but most of it is code spelling out my scenario:**
I'm trying to execute a dynamic query (hopefully through a stored proceedure) to retrieve results based on a variable number of inputs.
If I had a table:
```
(dbo).(People)
ID Name Age
1 Joe 28
2 Bob 32
3 Alan 26
4 ... | 2010/07/15 | [
"https://Stackoverflow.com/questions/3259910",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/351207/"
] | You could use an IF statement:
```
IF LEN(@ids) > 0
BEGIN
SELECT *
FROM dbo.People
WHERE ID IN (SELECT n FROM @ids)
END
ELSE
BEGIN
SELECT *
FROM dbo.People
END
```
Otherwise, [consider making the query real dynamic SQL (minding pitfalls of course)](http://www.sommarskog.se/dynamic_sql.html). | A quick fix:
```
(`%,' + Id + ',%' like ',' + @ids + ',' or @ids is null)
and (`%,' + Name + ',%' like ',' + @names + ',' or @names is null)
```
So if the user passes `@ids = 1,2`, the first row gives:
```
`%,1,%' like ',1,2,'
```
It's a good idea to filter out spaces before and after comma's. :) |
3,259,910 | **Sorry for the long post, but most of it is code spelling out my scenario:**
I'm trying to execute a dynamic query (hopefully through a stored proceedure) to retrieve results based on a variable number of inputs.
If I had a table:
```
(dbo).(People)
ID Name Age
1 Joe 28
2 Bob 32
3 Alan 26
4 ... | 2010/07/15 | [
"https://Stackoverflow.com/questions/3259910",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/351207/"
] | Try:
```
(Id IN (SELECT n FROM @ids) OR NOT EXISTS (SELECT * FROM @ids))
``` | A quick fix:
```
(`%,' + Id + ',%' like ',' + @ids + ',' or @ids is null)
and (`%,' + Name + ',%' like ',' + @names + ',' or @names is null)
```
So if the user passes `@ids = 1,2`, the first row gives:
```
`%,1,%' like ',1,2,'
```
It's a good idea to filter out spaces before and after comma's. :) |
1,042,915 | I am currently using Ubuntu 17.10 and am trying to upgrade to the 18.04 LTS new version.
After clicking on the "Upgrade" option in the Software Updater I am presented with a release notes window which has another "Upgrade" option. After choosing it I am presented with a 'do-release upgrade' screen which disappears as ... | 2018/06/02 | [
"https://askubuntu.com/questions/1042915",
"https://askubuntu.com",
"https://askubuntu.com/users/836619/"
] | This is a [known issue](https://launchpad.net/bugs/1646260) with the `en_IL` locale and Python. Probably your `/etc/default/locale` file includes this line:
```
LANG=en_IL
```
Edit that file and change the line to:
```
LANG=en_IL.UTF-8
```
At next login you'll hopefully be able to upgrade successfully. | run this command to solve this problem
```
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
``` |
122,906 | I'm using IIS6 Manager to setup the SMTP service on Windows Server 2008 Web Edition.
There seems to be a conflict (port 25?) which means that I cannot start and stop the Default SMTP server within IIS6. I can start and stop it with the services.msc snap in and this is reflected in state of the SMTP server in IIS6 mana... | 2010/03/16 | [
"https://serverfault.com/questions/122906",
"https://serverfault.com",
"https://serverfault.com/users/-1/"
] | To answer the port conflict issue, run `netstat -ano` and check which PID is using port 25. You can check the process using Task Manager by matching it with PID seen in netstat -ano. By default inetinfo.exe has control over port 25. | HEy Vivek
Yes, your advice showed up a conflict with MESMTPC which is obviously the other SMTP server.
How many SMTP servers are there!!
Which is the best one to use or are they the same one with different management tools? |
5,920,051 | I want to install my tomcat v7.0.12 as a service on my Windows 2008 Server.
On the tomcat page I found [this tutorial](http://tomcat.apache.org/tomcat-7.0-doc/windows-service-howto.html#Installing_services). But there isn't a `service.bat` file in my installation dir.
In the service overview of WS2008 it isn't possibl... | 2011/05/07 | [
"https://Stackoverflow.com/questions/5920051",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/705763/"
] | To Start Tomcat7 Service :
* Open cmd, go to bin directory within "Apache Tomcat 7" folder. You will see some this like `C:\..\bin>`
* Enter above command to start the service: `C:\..\bin>service.bat install`. The service will get started now.
* Enter above command to start tomcat7w monitory service. If you have issue... | I have spent a couple of hours looking for the magic configuration to get Tomcat 7 running as a service on Windows Server 2008... no luck.
I do have a solution though.
My install of Tomcat 7 works just fine if I just jump into a console window and run...
```
C:\apache-tomcat-7.0.26\bin\start.bat
```
At this point ... |
5,920,051 | I want to install my tomcat v7.0.12 as a service on my Windows 2008 Server.
On the tomcat page I found [this tutorial](http://tomcat.apache.org/tomcat-7.0-doc/windows-service-howto.html#Installing_services). But there isn't a `service.bat` file in my installation dir.
In the service overview of WS2008 it isn't possibl... | 2011/05/07 | [
"https://Stackoverflow.com/questions/5920051",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/705763/"
] | I have spent a couple of hours looking for the magic configuration to get Tomcat 7 running as a service on Windows Server 2008... no luck.
I do have a solution though.
My install of Tomcat 7 works just fine if I just jump into a console window and run...
```
C:\apache-tomcat-7.0.26\bin\start.bat
```
At this point ... | There are a lot of answers here, but many overlook a few points. I ran into the same issue and it was likely due to a combination of being a complete neophyte when it comes to tomcat. Even more I am rather new to web servers in general. I consider myself somewhat proficient user of windows, but I guess not proficient e... |
5,920,051 | I want to install my tomcat v7.0.12 as a service on my Windows 2008 Server.
On the tomcat page I found [this tutorial](http://tomcat.apache.org/tomcat-7.0-doc/windows-service-howto.html#Installing_services). But there isn't a `service.bat` file in my installation dir.
In the service overview of WS2008 it isn't possibl... | 2011/05/07 | [
"https://Stackoverflow.com/questions/5920051",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/705763/"
] | To Start Tomcat7 Service :
* Open cmd, go to bin directory within "Apache Tomcat 7" folder. You will see some this like `C:\..\bin>`
* Enter above command to start the service: `C:\..\bin>service.bat install`. The service will get started now.
* Enter above command to start tomcat7w monitory service. If you have issue... | 1. Edit service.bat – Swap two lines so that they appear in following order:
if not “%JAVA\_HOME%“ == ““ goto got JdkHome
if not “%JRE\_HOME%“ == ““ goto got JreHome
2. Open cmd and run command service.bat install
3. Open Services and find Apache Tomcat 7.0 Tomcat7. Right click and Properties. Change its startup type ... |
5,920,051 | I want to install my tomcat v7.0.12 as a service on my Windows 2008 Server.
On the tomcat page I found [this tutorial](http://tomcat.apache.org/tomcat-7.0-doc/windows-service-howto.html#Installing_services). But there isn't a `service.bat` file in my installation dir.
In the service overview of WS2008 it isn't possibl... | 2011/05/07 | [
"https://Stackoverflow.com/questions/5920051",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/705763/"
] | 1. Edit service.bat – Swap two lines so that they appear in following order:
if not “%JAVA\_HOME%“ == ““ goto got JdkHome
if not “%JRE\_HOME%“ == ““ goto got JreHome
2. Open cmd and run command service.bat install
3. Open Services and find Apache Tomcat 7.0 Tomcat7. Right click and Properties. Change its startup type ... | I had a similar problem, there isn't a **service.bat** in the zip version of tomcat that I downloaded ages ago.
I simply downloaded a new [64-bit Windows zip](http://mirror.nus.edu.sg/apache/tomcat/tomcat-7/v7.0.37/bin/apache-tomcat-7.0.37-windows-x64.zip) version of tomcat from <http://tomcat.apache.org/download-70.c... |
5,920,051 | I want to install my tomcat v7.0.12 as a service on my Windows 2008 Server.
On the tomcat page I found [this tutorial](http://tomcat.apache.org/tomcat-7.0-doc/windows-service-howto.html#Installing_services). But there isn't a `service.bat` file in my installation dir.
In the service overview of WS2008 it isn't possibl... | 2011/05/07 | [
"https://Stackoverflow.com/questions/5920051",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/705763/"
] | I just had the same issue and could only install tomcat7 as a serivce using the "32-bit/64-bit Windows Service Installer" version of tomcat:
<http://tomcat.apache.org/download-70.cgi> | There are a lot of answers here, but many overlook a few points. I ran into the same issue and it was likely due to a combination of being a complete neophyte when it comes to tomcat. Even more I am rather new to web servers in general. I consider myself somewhat proficient user of windows, but I guess not proficient e... |
5,920,051 | I want to install my tomcat v7.0.12 as a service on my Windows 2008 Server.
On the tomcat page I found [this tutorial](http://tomcat.apache.org/tomcat-7.0-doc/windows-service-howto.html#Installing_services). But there isn't a `service.bat` file in my installation dir.
In the service overview of WS2008 it isn't possibl... | 2011/05/07 | [
"https://Stackoverflow.com/questions/5920051",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/705763/"
] | You can find the solution [here](http://tomcat.apache.org/tomcat-7.0-doc/windows-service-howto.html)!
Install the service named 'Tomcat7'
```
C:\>Tomcat\bin\service.bat install
```
There is a 2nd optional parameter that lets you specify the name of the service, as displayed in Windows services.
Install the service... | There are a lot of answers here, but many overlook a few points. I ran into the same issue and it was likely due to a combination of being a complete neophyte when it comes to tomcat. Even more I am rather new to web servers in general. I consider myself somewhat proficient user of windows, but I guess not proficient e... |
5,920,051 | I want to install my tomcat v7.0.12 as a service on my Windows 2008 Server.
On the tomcat page I found [this tutorial](http://tomcat.apache.org/tomcat-7.0-doc/windows-service-howto.html#Installing_services). But there isn't a `service.bat` file in my installation dir.
In the service overview of WS2008 it isn't possibl... | 2011/05/07 | [
"https://Stackoverflow.com/questions/5920051",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/705763/"
] | I have spent a couple of hours looking for the magic configuration to get Tomcat 7 running as a service on Windows Server 2008... no luck.
I do have a solution though.
My install of Tomcat 7 works just fine if I just jump into a console window and run...
```
C:\apache-tomcat-7.0.26\bin\start.bat
```
At this point ... | I had a similar problem, there isn't a **service.bat** in the zip version of tomcat that I downloaded ages ago.
I simply downloaded a new [64-bit Windows zip](http://mirror.nus.edu.sg/apache/tomcat/tomcat-7/v7.0.37/bin/apache-tomcat-7.0.37-windows-x64.zip) version of tomcat from <http://tomcat.apache.org/download-70.c... |
5,920,051 | I want to install my tomcat v7.0.12 as a service on my Windows 2008 Server.
On the tomcat page I found [this tutorial](http://tomcat.apache.org/tomcat-7.0-doc/windows-service-howto.html#Installing_services). But there isn't a `service.bat` file in my installation dir.
In the service overview of WS2008 it isn't possibl... | 2011/05/07 | [
"https://Stackoverflow.com/questions/5920051",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/705763/"
] | I just had the same issue and could only install tomcat7 as a serivce using the "32-bit/64-bit Windows Service Installer" version of tomcat:
<http://tomcat.apache.org/download-70.cgi> | I had a similar problem, there isn't a **service.bat** in the zip version of tomcat that I downloaded ages ago.
I simply downloaded a new [64-bit Windows zip](http://mirror.nus.edu.sg/apache/tomcat/tomcat-7/v7.0.37/bin/apache-tomcat-7.0.37-windows-x64.zip) version of tomcat from <http://tomcat.apache.org/download-70.c... |
5,920,051 | I want to install my tomcat v7.0.12 as a service on my Windows 2008 Server.
On the tomcat page I found [this tutorial](http://tomcat.apache.org/tomcat-7.0-doc/windows-service-howto.html#Installing_services). But there isn't a `service.bat` file in my installation dir.
In the service overview of WS2008 it isn't possibl... | 2011/05/07 | [
"https://Stackoverflow.com/questions/5920051",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/705763/"
] | You can find the solution [here](http://tomcat.apache.org/tomcat-7.0-doc/windows-service-howto.html)!
Install the service named 'Tomcat7'
```
C:\>Tomcat\bin\service.bat install
```
There is a 2nd optional parameter that lets you specify the name of the service, as displayed in Windows services.
Install the service... | Looks like now they have the bat in the zip as well
note that you can use windows sc command to do more
e.g.
```
sc config tomcat7 start= auto
```
yes the space before auto is NEEDED |
5,920,051 | I want to install my tomcat v7.0.12 as a service on my Windows 2008 Server.
On the tomcat page I found [this tutorial](http://tomcat.apache.org/tomcat-7.0-doc/windows-service-howto.html#Installing_services). But there isn't a `service.bat` file in my installation dir.
In the service overview of WS2008 it isn't possibl... | 2011/05/07 | [
"https://Stackoverflow.com/questions/5920051",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/705763/"
] | To Start Tomcat7 Service :
* Open cmd, go to bin directory within "Apache Tomcat 7" folder. You will see some this like `C:\..\bin>`
* Enter above command to start the service: `C:\..\bin>service.bat install`. The service will get started now.
* Enter above command to start tomcat7w monitory service. If you have issue... | I just had the same issue and could only install tomcat7 as a serivce using the "32-bit/64-bit Windows Service Installer" version of tomcat:
<http://tomcat.apache.org/download-70.cgi> |
1,125,085 | In Ubuntu 16.04 I installed a Compiz plugin with an alternative `alt`-`tab` switcher that had the nifty feature that until I let go of the `Alt` key, it *hid* all other windows and showed only the one I was about to switch to. This is very useful when one has a bunch of open terminals that don't look all that different... | 2019/03/12 | [
"https://askubuntu.com/questions/1125085",
"https://askubuntu.com",
"https://askubuntu.com/users/410876/"
] | You can use the **[Coverflow Alt-Tab](https://extensions.gnome.org/extension/97/coverflow-alt-tab/)** extension for GNOME shell. It's a
>
> Replacement of `Alt`-`Tab`, iterates through windows in a [cover-flow](https://en.wikipedia.org/wiki/Cover_Flow) manner.
>
>
>
[ or (stamptime BETWEEN @DateTo AND @DateFrom))
```
This updates, then returns the updated rows in a single statement. | Continuing on vulkanino's comment answer, something like this:
```
ALTER PROCEDURE [dbo].[GetLeads]
@DateTo datetime = null,
@DateFrom datetime = null
AS
UPDATE
lead
SET
Downloaded = 1
WHERE
((@DateTo is null AND @DateFrom IS null) or (stamptime BETWEEN @DateTo AND @Date... |
9,131,083 | I have a select stored procedure and I am trying to make it so the results it bring down it also updates a column called `Downloaded` and marks those rows as downloads.
For example, I pull down 10 rows those 10 rows I also want to update the `Downloaded` column to true all in the same stored procedure. Is this possib... | 2012/02/03 | [
"https://Stackoverflow.com/questions/9131083",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Continuing on vulkanino's comment answer, something like this:
```
ALTER PROCEDURE [dbo].[GetLeads]
@DateTo datetime = null,
@DateFrom datetime = null
AS
UPDATE
lead
SET
Downloaded = 1
WHERE
((@DateTo is null AND @DateFrom IS null) or (stamptime BETWEEN @DateTo AND @Date... | Your best bet might be to use an OUTPUT statement with the UPDATE.
<http://blog.sqlauthority.com/2007/10/01/sql-server-2005-output-clause-example-and-explanation-with-insert-update-delete/>
```
DECLARE @TEMPTABLE
(
name <type>
, lastname <type>
, title <type>
, company <type>
, address <type>
... |
9,131,083 | I have a select stored procedure and I am trying to make it so the results it bring down it also updates a column called `Downloaded` and marks those rows as downloads.
For example, I pull down 10 rows those 10 rows I also want to update the `Downloaded` column to true all in the same stored procedure. Is this possib... | 2012/02/03 | [
"https://Stackoverflow.com/questions/9131083",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | You can simply `OUTPUT` the updated rows;
```
UPDATE lead
SET Downloaded = 1
OUTPUT INSERTED.*
WHERE ((@DateTo is null AND @DateFrom IS null) or (stamptime BETWEEN @DateTo AND @DateFrom))
```
This updates, then returns the updated rows in a single statement. | Your best bet might be to use an OUTPUT statement with the UPDATE.
<http://blog.sqlauthority.com/2007/10/01/sql-server-2005-output-clause-example-and-explanation-with-insert-update-delete/>
```
DECLARE @TEMPTABLE
(
name <type>
, lastname <type>
, title <type>
, company <type>
, address <type>
... |
45,184,169 | I have a create form where if the specific `Medicine` exist, its number of supply will update or added with the new entry however if the specific `Medicine` doesn't exist, it will create a new batch of data.
Im having trouble at understanding how update works in MVC.
Here is the error:
Store update, insert, or delet... | 2017/07/19 | [
"https://Stackoverflow.com/questions/45184169",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Here you go with the solution <https://jsfiddle.net/1aL33df4/>
```js
$('li').hover(function(){
if( typeof $(this).prev().attr('id') != 'undefined')
console.log("Previous Element ID: " + $(this).prev().attr('id'));
if( typeof $(this).next().attr('id') != 'undefined')
console.log("Next Element ID: " ... | 1. Use .next() or .prev() to get respective li
2. use .attr() to get the id
3. use hasClass() to test if li has active class
```js
var pliid = $("ul li.active").prev('li').attr('id');
var nliid = $("ul li.active").next('li').attr('id');
console.log("prev li id is " + pliid)
console.log("prev li is active " + $("u... |
67,233,521 | I just updated from Terraform v0.11.11 to v0.12.1 and I am now seeing these issues. I get the whole list in a list thing but I have tried every which way to fix this with no luck. I have removed the LBracket after ***cidr\_blocks = [*** with no luck I have tried warpping in ***${}*** no go. I have tried removing the lb... | 2021/04/23 | [
"https://Stackoverflow.com/questions/67233521",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7959591/"
] | You can check out the Document Viewer from the LEADTOOLS Nuget here:
WPF Viewer: <https://www.nuget.org/packages/Leadtools.Document.Viewer.Wpf/>
WinForms Viewer: <https://www.nuget.org/packages/Leadtools.Document.Viewer.WinForms/>
Just as a disclaimer, I am an employee of this vendor.
It supports viewing PDFs and o... | You can evaluate PDF Viewer controls for WinForms/WPF by DevExpress. You can easily customize these controls as your needs dictate.
* [PDF Viewer for WinForms](https://www.devexpress.com/products/net/controls/winforms/pdf-viewer/)
* [PDF Viewer for WPF](https://www.devexpress.com/products/net/controls/wpf/pdf_viewer/) |
9,116,914 | There is a table view with three sections. The last section may contain many items. I need to show a button on the navigation bar as soon as the table view is showing only the last section (e.g. user scrolled the cells up so that the first and second view became invisible).
So basically how to detect that the table vi... | 2012/02/02 | [
"https://Stackoverflow.com/questions/9116914",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/745250/"
] | UITableView class has to methods:
>
>
> ```
> - (NSArray *)indexPathsForVisibleRows;
> - (NSArray *)indexPathsForRowsInRect:(CGRect)rect;
>
> ```
>
>
Have you tried them? Do they help? | You could try to iterate over UITableView's indexPathsForVisibleRows to see if the cells in the relevant section are contained in the array. |
9,116,914 | There is a table view with three sections. The last section may contain many items. I need to show a button on the navigation bar as soon as the table view is showing only the last section (e.g. user scrolled the cells up so that the first and second view became invisible).
So basically how to detect that the table vi... | 2012/02/02 | [
"https://Stackoverflow.com/questions/9116914",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/745250/"
] | UITableView class has to methods:
>
>
> ```
> - (NSArray *)indexPathsForVisibleRows;
> - (NSArray *)indexPathsForRowsInRect:(CGRect)rect;
>
> ```
>
>
Have you tried them? Do they help? | You can use the tableview delegate to check which section cells are being created by checking it's indexpath.
* (UITableViewCell \*)tableView:(UITableView \*)tableView cellForRowAtIndexPath:(NSIndexPath \*)indexPath;
Or you can use the below function to get cells that are visible and then check for to which section i... |
10,908,376 | I can compile this program which was provided to me, but that I must further develop. I have some questions about it:
```
#include <sys/types.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#define TIMEOUT (20)
int main(int argc, char *argv[])
{
pid_t pid;
if(... | 2012/06/06 | [
"https://Stackoverflow.com/questions/10908376",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/108207/"
] | First, you need to `#include <string.h>` to get rid of that warning.
Second, the OS is probably preventing you from executing programs on the `/media/Lexar` filesystem, no matter what their permission bits are. If you type `mount` you'll probably see the `noexec` option for `/media/Lexar`. | >
> warning: incompatible implicit declaration of built-in function ‘strlen’ [enabled by default]
>
>
>
You need to include `#include<string.h>` because `strlen()` is declared in it.
Try running the exe on some other location in your filesystem and not the mounted partition as the error indicates for some reason ... |
9,981,968 | We are in the process of setting up our IT infrastructure on Amazon EC2.
Assume a setup along the lines of:
X production servers
Y staging servers
Log collation and Monitoring Server
Build Server
Obviously we have a need to have various servers talk to each other. A new build needs to be scp'd over to a staging server.... | 2012/04/02 | [
"https://Stackoverflow.com/questions/9981968",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1187552/"
] | A very good method of handling access to a collection of EC2 instances is using a [Bastion Host](http://en.wikipedia.org/wiki/Bastion_host).
All machines you use on EC2 should disallow SSH access to the open internet, except for the Bastion Host. Create a new security policy called "Bastion Host", and only allow port... | Create two set of keypairs, one for your staging servers and one for your production servers. You can give you developers the staging keys and keep the production keys private.
I would put the new builds on to S3 and have a perl script running on the boxes to pull the lastest code from your S3 buckets and install them... |
71,167 | Does a generic rulebook exist for the system behind Apocalypse World (Powered by the Apocalypse)? | 2015/11/17 | [
"https://rpg.stackexchange.com/questions/71167",
"https://rpg.stackexchange.com",
"https://rpg.stackexchange.com/users/25864/"
] | There is no generic edition of Apocalypse World — that is, an edition with the setting stripped out and “just” the rules.
This is for the simple reason that the rules effectively *are* the setting, so there's no way to have “just” the rules. All the other Powered by the Apocalypse games were created by playing and stu... | The closest I've seen to generic rules from a full game of Powered by the Apocalypse is The Bureau, which is a free game. |
867,734 | I am new to setting up SSL-certificates and working with servers in general, so please bear with me as I try to explain the situation I have put myself in.
I recently acquired an Comodo EssentialSSL Wildcard license that is going to be used for securing my server. The server I am configuring is for use with Kolab. Kol... | 2017/08/09 | [
"https://serverfault.com/questions/867734",
"https://serverfault.com",
"https://serverfault.com/users/429905/"
] | I solved the problem by checking that the order of my intermediate bundle file was correctly formatted and changed it from a .ca-bundle to a .pem and added the following line to my imapd.conf:
```
tls_ca_path: /etc/ssl/certs
``` | If you got the following error while `openssl s_client -showcerts -connect example.com:443`:
>
> verify error:num=20:unable to get local issuer certificate
>
>
>
You need to make sure you include [CA's Bundle](https://comodosslstore.com/resources/comodo-ca-bundle-certificate-chain/) certificates.
>
> When Comod... |
19,601,318 | Is there anything I can add to emacs that will make as much as possible in as many modes as possible colorized, including bold and italic? | 2013/10/26 | [
"https://Stackoverflow.com/questions/19601318",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/279695/"
] | In addition to using [color or custom *themes*](http://www.emacswiki.org/emacs/ColorTheme), as @Link mentioned, some modes provide for multiple levels of such syntax highlighting (called font-locking). See user option `font-lock-maximum-decoration`.
And some 3rd-party libraries specifically add more highlighting, some... | Perhaps you are looking for [colour or custom *themes*](http://www.emacswiki.org/emacs/ColorTheme)? I'm not sure if you could do bold or italic, but I'm pretty sure there may be a plugin for that. |
19,601,318 | Is there anything I can add to emacs that will make as much as possible in as many modes as possible colorized, including bold and italic? | 2013/10/26 | [
"https://Stackoverflow.com/questions/19601318",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/279695/"
] | In addition to using [color or custom *themes*](http://www.emacswiki.org/emacs/ColorTheme), as @Link mentioned, some modes provide for multiple levels of such syntax highlighting (called font-locking). See user option `font-lock-maximum-decoration`.
And some 3rd-party libraries specifically add more highlighting, some... | This is derived from a popular twilight theme, which can just be inserted into your `.emacs` file and then modified by you in any manner you see fit:
```
(set-mouse-color "sienna1")
(set-cursor-color "#DDDD00")
(custom-set-faces
'(default ((t (:background "#141414" :foreground "#CACACA"))))
'(blue ((t (:foregrou... |
15,877,854 | I have got the following Data Frame "j" ...
and want to convert to a matrix of zeros and ones,
like below, but i looking for a more easy way to convert it in R...the matrix represent the positions of the values of the data frame,..For example the matrix is (81x3)...if i have got an "1" in the df, an "1" will be write i... | 2013/04/08 | [
"https://Stackoverflow.com/questions/15877854",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2257002/"
] | Feels quirky, but this is what I came up with:
```
g <- h <- i <- c(1:3)
j<-expand.grid(g,h,i)
tmp<-c(0,0,0)
t(sapply(t(j),function(x,tmp){ tmp[x]<-1;tmp }, tmp))
``` | @ndoogan's approach works, but it seems like it would make much more sense to just use matrix indexing for this:
Here's your "j" `data.frame`:
```
j <- expand.grid(replicate(3, 1:3, FALSE))
```
And your empty `matrix`, "m":
```
m <- matrix(0, 81, 3)
```
The "i" would just be `1:nrow(m)`, and you can turn your "j... |
63,970,864 | I'm using Preact for the first time.
I simply created a new project with preact-cli and this default template: <https://github.com/preactjs-templates/default>.
In `app.js` I'm trying to use this code:
```js
import { Router } from 'preact-router';
import Header from './header';
import Home from '../routes/home';
imp... | 2020/09/19 | [
"https://Stackoverflow.com/questions/63970864",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10088259/"
] | *Disclaimer: I work on Preact.*
Our debug addon (`preact/debug`) will print this error whenever an invalid object is passed as a child that doesn't match the expected return type of `h/createElement`, usually called `vnode`:
```
const invalidVNode = { foo: 123 };
<div>{invalidVNode}</div>
```
In your case your comp... | Reactjs is a component library. At the core it has a function like
```
React.createElement(component, props, ...children)
```
Here the first parameter is the component that you want to render.
When you are putting `await sleep(3000)` the function is not returning any valid children/html object rather it is returnin... |
542,671 | I would like to implement the 100Mbps single pair automotive ethernet specified in 802.3bw, otherwise known as **100BASE-T1**. I was told that in order to troubleshoot and test on this standard, the scope must be capable of 1 Ghz. Is this accurate? Why would this be necessary as opposed to an oscilloscope that is well ... | 2021/01/14 | [
"https://electronics.stackexchange.com/questions/542671",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/146587/"
] | Sounds like you want a protocol tester more than you want an oscilloscope. But oh well, that's not the question here.
>
> I was told that in order to troubleshoot and test on this standard, the scope must be capable of 1 GHz
>
>
>
No. Even wikipedia will tell you that it only requires CAT3 cabling, and that doesn... | There are two aspects to Ethernet connectivity: signal integrity and content. You’d use an oscilloscope with suitable differential probes to capture the raw signals and analyze them with (usually) an Ethernet signal analysis package on the oscilloscope. That’s probably over $10k worth of equipment - if you aren’t in th... |
3,657,111 | How can I verify if the file is binary or text without to open the file? | 2010/09/07 | [
"https://Stackoverflow.com/questions/3657111",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/396841/"
] | Schrödinger's cat, I'm afraid.
There is no way to determine the contents of a file without opening it. The filesystem stores no metadata relating to the contents.
If not opening the file is not a hard requirement, then there are a number of solutions available to you.
**Edit:**
It has been suggested in a number ... | There is no way of being certain without looking inside the file. Hoewever, you don't have to open it with an editor and see for yourself to have a clue. You may want to look into the `file` command: <http://linux.die.net/man/1/file> |
3,657,111 | How can I verify if the file is binary or text without to open the file? | 2010/09/07 | [
"https://Stackoverflow.com/questions/3657111",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/396841/"
] | The correct way to determine the type of a file is to use the file(1) command.
You also need to be aware that UTF-8 encoded files are "text" files, but may contain non-ASCII data. Other encodings also have this issue. In the case of text encoded with a [code page](http://en.wikipedia.org/wiki/Code_page), it may not be... | There is no way of being certain without looking inside the file. Hoewever, you don't have to open it with an editor and see for yourself to have a clue. You may want to look into the `file` command: <http://linux.die.net/man/1/file> |
3,657,111 | How can I verify if the file is binary or text without to open the file? | 2010/09/07 | [
"https://Stackoverflow.com/questions/3657111",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/396841/"
] | Schrödinger's cat, I'm afraid.
There is no way to determine the contents of a file without opening it. The filesystem stores no metadata relating to the contents.
If not opening the file is not a hard requirement, then there are a number of solutions available to you.
**Edit:**
It has been suggested in a number ... | If you are attempting to do this from a command shell then the `file` command will take a guess at what filetype it is. If it is text then it will generally include the word text in its description.
I am not aware of any 100% method of determining this but the file command is probably the most accurate. |
3,657,111 | How can I verify if the file is binary or text without to open the file? | 2010/09/07 | [
"https://Stackoverflow.com/questions/3657111",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/396841/"
] | Schrödinger's cat, I'm afraid.
There is no way to determine the contents of a file without opening it. The filesystem stores no metadata relating to the contents.
If not opening the file is not a hard requirement, then there are a number of solutions available to you.
**Edit:**
It has been suggested in a number ... | In unix, a file is just some bytes. So, without opening the file, you cannot figure out 100% that's it's ASCII or Binary.
You can just use tools available to you and dig deeper to make it fool proof.
1. file
2. cat -v |
3,657,111 | How can I verify if the file is binary or text without to open the file? | 2010/09/07 | [
"https://Stackoverflow.com/questions/3657111",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/396841/"
] | The correct way to determine the type of a file is to use the file(1) command.
You also need to be aware that UTF-8 encoded files are "text" files, but may contain non-ASCII data. Other encodings also have this issue. In the case of text encoded with a [code page](http://en.wikipedia.org/wiki/Code_page), it may not be... | If you are attempting to do this from a command shell then the `file` command will take a guess at what filetype it is. If it is text then it will generally include the word text in its description.
I am not aware of any 100% method of determining this but the file command is probably the most accurate. |
3,657,111 | How can I verify if the file is binary or text without to open the file? | 2010/09/07 | [
"https://Stackoverflow.com/questions/3657111",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/396841/"
] | The correct way to determine the type of a file is to use the file(1) command.
You also need to be aware that UTF-8 encoded files are "text" files, but may contain non-ASCII data. Other encodings also have this issue. In the case of text encoded with a [code page](http://en.wikipedia.org/wiki/Code_page), it may not be... | In unix, a file is just some bytes. So, without opening the file, you cannot figure out 100% that's it's ASCII or Binary.
You can just use tools available to you and dig deeper to make it fool proof.
1. file
2. cat -v |
46,732,891 | I'm not certain if the title is the right way to word what I'm asking, sorry if it's not, but what I'm trying to do is create a memory match game using GUI. I have an array, and I've got the button printing an element from the array at random, but, the issue is, that I can have the same element printing multiple times.... | 2017/10/13 | [
"https://Stackoverflow.com/questions/46732891",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8098654/"
] | >
> Is there a way to get the SCM checkout credentials from what is specified in the GUI level of the job, so i don't have to hard code the credential ID in the script.
>
>
>
Yes. If you are using **Pipeline script from SCM**, you can get the Credentials ID with the following snippet:
```
scm.getUserRemoteConfigs... | It's not possible to get the library credentials ID within the pipeline script.
The best you can do is get the version (branch name) for the library. For example, `env.getProperty("library.<NAME>.version")` where `<NAME>` is the name of your shared library.
I had to migrate jobs to a new Jenkins instance and ran int... |
46,732,891 | I'm not certain if the title is the right way to word what I'm asking, sorry if it's not, but what I'm trying to do is create a memory match game using GUI. I have an array, and I've got the button printing an element from the array at random, but, the issue is, that I can have the same element printing multiple times.... | 2017/10/13 | [
"https://Stackoverflow.com/questions/46732891",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8098654/"
] | >
> Is there a way to get the SCM checkout credentials from what is specified in the GUI level of the job, so i don't have to hard code the credential ID in the script.
>
>
>
Yes. If you are using **Pipeline script from SCM**, you can get the Credentials ID with the following snippet:
```
scm.getUserRemoteConfigs... | You could just migrate all the credentials from the old Jenkins instance to the new one before you start configuring the jobs. Then delete what you don't use later, if needed.
<https://support.cloudbees.com/hc/en-us/articles/115001634268-How-to-migrate-credentials-to-a-new-Jenkins-instance-> |
122,749 | I am making quite some binaries, scripts etc that I want to install easily (using my own rpms). Since I want them accessible for everyone, my intuition would be to put them in /usr/bin;
* no need to change PATH
however; my executables now disappear in a pool of all the others; how can I find back all the executables ... | 2014/04/02 | [
"https://unix.stackexchange.com/questions/122749",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/64031/"
] | If you bundle your binaries into your own RPMs then it's trivial to get a list of what they are and where they were installed.
### Example
```
$ rpm -ql httpd| head -10
/etc/httpd
/etc/httpd/conf
/etc/httpd/conf.d
/etc/httpd/conf.d/README
/etc/httpd/conf.d/autoindex.conf
/etc/httpd/conf.d/userdir.conf
/etc/httpd/conf... | Binaries not part of the system or distribution are usually in
```
/usr/local/bin
```
the directory is usually in the standard `$PATH` so that your binaries will be found. |
122,749 | I am making quite some binaries, scripts etc that I want to install easily (using my own rpms). Since I want them accessible for everyone, my intuition would be to put them in /usr/bin;
* no need to change PATH
however; my executables now disappear in a pool of all the others; how can I find back all the executables ... | 2014/04/02 | [
"https://unix.stackexchange.com/questions/122749",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/64031/"
] | If you bundle your binaries into your own RPMs then it's trivial to get a list of what they are and where they were installed.
### Example
```
$ rpm -ql httpd| head -10
/etc/httpd
/etc/httpd/conf
/etc/httpd/conf.d
/etc/httpd/conf.d/README
/etc/httpd/conf.d/autoindex.conf
/etc/httpd/conf.d/userdir.conf
/etc/httpd/conf... | An obvious suggestions is to name your binaries or your packages in a special way. So for example you could prefix them with `cm-`, per your initials as given in this post. If you are installing rpms they need to go into `/usr/bin` (if they are user level executables), per the FHS. They should not go into `/usr/local/b... |
565,916 | >
> Calculate the indefinite integral
> $$\int e^{\sin^2(x)+ \cos^2(x)}\,dx.$$
>
>
>
Not sure how to do this | 2013/11/13 | [
"https://math.stackexchange.com/questions/565916",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/108618/"
] | Well, it's not hard at all. $$\int e^{\sin^2(x)+\cos^2(x)}\,dx= \int e^1\,dx,$$ since $\sin^2(x)+\cos^2(x)=1$. So $e^1$ is a constant and you can pull this out of the integral. which will leave you with $e\int\,dx$, which is just $ex+C$. Hope this helps. | **Hint**: $$\sin^2(x) + \cos^2(x) = 1$$ so therefore
$$e^{\sin^2(x) + \cos^2(x)} = ....?$$ |
68,034,282 | I am trying to load data from parquet file in AWS S3 into snowflake table. But getting the below error. Could you please help.
```
SQL compilation error: PARQUET file format can produce one and only one column of type variant or object or array.
Use CSV file format if you want to load more than one column.
```
Parq... | 2021/06/18 | [
"https://Stackoverflow.com/questions/68034282",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13274071/"
] | This documentation explains how to load parquet data into multiple columns:
[Loading Parquet](https://docs.snowflake.com/en/user-guide/script-data-load-transform-parquet.html)
**UPDATE**
I'm not sure if the comment below is a response to my answer and, if it is, what the relevance of it is? Did you read the document ... | This issue was resolved after creating table as below
```
create or replace table temp_log (
logcontent VARIANT);
``` |
68,034,282 | I am trying to load data from parquet file in AWS S3 into snowflake table. But getting the below error. Could you please help.
```
SQL compilation error: PARQUET file format can produce one and only one column of type variant or object or array.
Use CSV file format if you want to load more than one column.
```
Parq... | 2021/06/18 | [
"https://Stackoverflow.com/questions/68034282",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13274071/"
] | This documentation explains how to load parquet data into multiple columns:
[Loading Parquet](https://docs.snowflake.com/en/user-guide/script-data-load-transform-parquet.html)
**UPDATE**
I'm not sure if the comment below is a response to my answer and, if it is, what the relevance of it is? Did you read the document ... | In my case the error message was raised because I was running the command as
```
COPY INTO my_db.my_schema.my_table
FROM (
SELECT *
FROM @my_stage
) FILE_FORMAT = ( TYPE = PARQUET );
```
Instead each column should be specified as `$1:my_column` in the 'select statement', for example:
```
COPY INTO my_db.my_... |
68,034,282 | I am trying to load data from parquet file in AWS S3 into snowflake table. But getting the below error. Could you please help.
```
SQL compilation error: PARQUET file format can produce one and only one column of type variant or object or array.
Use CSV file format if you want to load more than one column.
```
Parq... | 2021/06/18 | [
"https://Stackoverflow.com/questions/68034282",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13274071/"
] | This documentation explains how to load parquet data into multiple columns:
[Loading Parquet](https://docs.snowflake.com/en/user-guide/script-data-load-transform-parquet.html)
**UPDATE**
I'm not sure if the comment below is a response to my answer and, if it is, what the relevance of it is? Did you read the document ... | I use these 2 sql to load the data into table,
first: use this SQL to create the table sql
```
with cols as (
select COLUMN_NAME || ' ' || TYPE col
from table(
infer_schema(
location=>'@LANDING/myFile.parquet'
, file_format=>'LANDING.default_parquet'
)
)
),
temp as (
select 'create o... |
64,008,128 | I have the following table structure:
```
+------------+------------+--------------+-------------+
| Column One | Column Two | Column Three | Column Four |
+------------+------------+--------------+-------------+
| 1001 | 6000 | 3000 | 200 |
+------------+------------+--------------+-------... | 2020/09/22 | [
"https://Stackoverflow.com/questions/64008128",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/394601/"
] | You can use elasticsearch **input** on *employees\_data*
In your filters, use the elasticsearch **filter** on *transaction\_data*
```
input {
elasticsearch {
hosts => "localost"
index => "employees_data"
query => '{ "query": { "match_all": { } } }'
sort => "code:desc"
scroll => "5m"
doci... | As long as I know, this can not be happened just using elasticsearch APIs. To handle this, you need to set a unique ID for documents that are relevant. For example, the code that you mentioned in your question can be a good ID for documents. So you can reindex the first index to the third one and use UPDATE API to upda... |
64,008,128 | I have the following table structure:
```
+------------+------------+--------------+-------------+
| Column One | Column Two | Column Three | Column Four |
+------------+------------+--------------+-------------+
| 1001 | 6000 | 3000 | 200 |
+------------+------------+--------------+-------... | 2020/09/22 | [
"https://Stackoverflow.com/questions/64008128",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/394601/"
] | You don't need Logstash to do this, Elasticsearch itself supports that by leveraging the [`enrich processor`](https://www.elastic.co/guide/en/elasticsearch/reference/current/ingest-enriching-data.html).
First, you need to create an enrich policy (use the smallest index, let's say it's `employees_data` ):
```
PUT /_en... | As long as I know, this can not be happened just using elasticsearch APIs. To handle this, you need to set a unique ID for documents that are relevant. For example, the code that you mentioned in your question can be a good ID for documents. So you can reindex the first index to the third one and use UPDATE API to upda... |
64,008,128 | I have the following table structure:
```
+------------+------------+--------------+-------------+
| Column One | Column Two | Column Three | Column Four |
+------------+------------+--------------+-------------+
| 1001 | 6000 | 3000 | 200 |
+------------+------------+--------------+-------... | 2020/09/22 | [
"https://Stackoverflow.com/questions/64008128",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/394601/"
] | You can use elasticsearch **input** on *employees\_data*
In your filters, use the elasticsearch **filter** on *transaction\_data*
```
input {
elasticsearch {
hosts => "localost"
index => "employees_data"
query => '{ "query": { "match_all": { } } }'
sort => "code:desc"
scroll => "5m"
doci... | You don't need Logstash to do this, Elasticsearch itself supports that by leveraging the [`enrich processor`](https://www.elastic.co/guide/en/elasticsearch/reference/current/ingest-enriching-data.html).
First, you need to create an enrich policy (use the smallest index, let's say it's `employees_data` ):
```
PUT /_en... |
2,651,022 | I have created my custom MembershipProvider. I have used an instance of the class DBConnect within this provider to handle database functions. Please look at the code below:
```
public class SGIMembershipProvider : MembershipProvider
{
#region "[ Property Variables ]"
private int newPasswordLength = 8;
pri... | 2010/04/16 | [
"https://Stackoverflow.com/questions/2651022",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/123514/"
] | From what I can see, [`MembershipProvider`](http://msdn.microsoft.com/en-us/library/system.web.security.membershipprovider.aspx) is not `IDisposable` (nor is [`ProviderBase`](http://msdn.microsoft.com/en-us/library/system.configuration.provider.providerbase.aspx)), so we're really talking about garbage collection here,... | For this specific scenario, I would recommend directly creating your DB connection inside of each method you need it in, instead of storing a reference to it. Wrap it in a using statement and let the framework dispose it for you.
The reason I recommend this approach is that you aren't saving any resources by hanging o... |
61,132,631 | When working with Java streams, we can use a collector to produce a collection such as a stream.
For example, here we make a stream of the `Month` enum objects, and for each one generate a `String` holding the localized name of the month. We collect the results into a `List` of type `String` by calling [`Collectors.to... | 2020/04/10 | [
"https://Stackoverflow.com/questions/61132631",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/642706/"
] | `Collectors.toUnmodifiableList`
===============================
Yes, there is a way: [`Collectors.toUnmodifiableList`](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/stream/Collectors.html#toUnmodifiableList())
Like [`List.copyOf`](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/j... | In Java 8 we could use [`Collectors.collectingAndThen`](https://docs.oracle.com/javase/8/docs/api/java/util/stream/Collectors.html#collectingAndThen-java.util.stream.Collector-java.util.function.Function-).
```
List < String > monthNames =
Arrays
.stream( Month.values() )
.map( month -> month.getDi... |
4,629,946 | Authlogic hasn't been updated in a few months and, while it seems to work in Rails 3, still has a ton of deprecation warnings.
Is there a particularly good fork of it I can/should use instead? I'm tempted to fork it and maintain an "authlogic-rails3" gem. | 2011/01/07 | [
"https://Stackoverflow.com/questions/4629946",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/168143/"
] | I'm using this and seems to be fine. <https://github.com/odorcicd/authlogic/tree/rails3> | I've created my own, which I'm pondering naming authlogic-rails3: <http://github.com/jjb/authlogic> |
55,787,018 | Using .NET Core 3 preview 4, the "API" template for a F# ASP.NET MVC project fails to build. This is without any changes to the template whatsoever.
[](https://i.stack.imgur.com/cWJ87.png)
This is the code that fails:
```fs
type Start... | 2019/04/21 | [
"https://Stackoverflow.com/questions/55787018",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/304174/"
] | In order to switch ASP.NET Core 3.0 back to use JSON.NET, you will need to reference the [`Microsoft.AspNetCore.Mvc.NewtonsoftJson` NuGet package](https://www.nuget.org/packages/Microsoft.AspNetCore.Mvc.NewtonsoftJson). That will contain the `AddNewtonsoftJson` extension method.
In C#, this would look like this:
```
... | For me this helped:
1. Code in Startup.cs
`services.AddControllers().AddNewtonsoftJson(x => x.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore);`
2. Upgrade all Nuget Packages to 3.1.8 (3.1.3 was not working) |
55,787,018 | Using .NET Core 3 preview 4, the "API" template for a F# ASP.NET MVC project fails to build. This is without any changes to the template whatsoever.
[](https://i.stack.imgur.com/cWJ87.png)
This is the code that fails:
```fs
type Start... | 2019/04/21 | [
"https://Stackoverflow.com/questions/55787018",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/304174/"
] | In order to switch ASP.NET Core 3.0 back to use JSON.NET, you will need to reference the [`Microsoft.AspNetCore.Mvc.NewtonsoftJson` NuGet package](https://www.nuget.org/packages/Microsoft.AspNetCore.Mvc.NewtonsoftJson). That will contain the `AddNewtonsoftJson` extension method.
In C#, this would look like this:
```
... | It's work for me, Install the NewtonsoftJson package from NuGet
"dotnet add package Microsoft.AspNetCore.Mvc.NewtonsoftJson --version 3.1.0"
version 3.1.0 working for ASP.NET Core 3.0 and use the Following Code-
```
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_3_0)
.AddNewtonsoftJson(... |
55,787,018 | Using .NET Core 3 preview 4, the "API" template for a F# ASP.NET MVC project fails to build. This is without any changes to the template whatsoever.
[](https://i.stack.imgur.com/cWJ87.png)
This is the code that fails:
```fs
type Start... | 2019/04/21 | [
"https://Stackoverflow.com/questions/55787018",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/304174/"
] | In order to switch ASP.NET Core 3.0 back to use JSON.NET, you will need to reference the [`Microsoft.AspNetCore.Mvc.NewtonsoftJson` NuGet package](https://www.nuget.org/packages/Microsoft.AspNetCore.Mvc.NewtonsoftJson). That will contain the `AddNewtonsoftJson` extension method.
In C#, this would look like this:
```
... | Add package: Microsoft.AspNetCore.Mvc.NewtonsoftJson
Package details: <https://www.nuget.org/packages/Microsoft.AspNetCore.Mvc.NewtonsoftJson>
Call `AddNewtonsoftJson()` extension method as mentioned below
```
// This method gets called by the runtime. Use this method to add services to the container.
p... |
55,787,018 | Using .NET Core 3 preview 4, the "API" template for a F# ASP.NET MVC project fails to build. This is without any changes to the template whatsoever.
[](https://i.stack.imgur.com/cWJ87.png)
This is the code that fails:
```fs
type Start... | 2019/04/21 | [
"https://Stackoverflow.com/questions/55787018",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/304174/"
] | Add package: Microsoft.AspNetCore.Mvc.NewtonsoftJson
Package details: <https://www.nuget.org/packages/Microsoft.AspNetCore.Mvc.NewtonsoftJson>
Call `AddNewtonsoftJson()` extension method as mentioned below
```
// This method gets called by the runtime. Use this method to add services to the container.
p... | For me this helped:
1. Code in Startup.cs
`services.AddControllers().AddNewtonsoftJson(x => x.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore);`
2. Upgrade all Nuget Packages to 3.1.8 (3.1.3 was not working) |
55,787,018 | Using .NET Core 3 preview 4, the "API" template for a F# ASP.NET MVC project fails to build. This is without any changes to the template whatsoever.
[](https://i.stack.imgur.com/cWJ87.png)
This is the code that fails:
```fs
type Start... | 2019/04/21 | [
"https://Stackoverflow.com/questions/55787018",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/304174/"
] | Add package: Microsoft.AspNetCore.Mvc.NewtonsoftJson
Package details: <https://www.nuget.org/packages/Microsoft.AspNetCore.Mvc.NewtonsoftJson>
Call `AddNewtonsoftJson()` extension method as mentioned below
```
// This method gets called by the runtime. Use this method to add services to the container.
p... | It's work for me, Install the NewtonsoftJson package from NuGet
"dotnet add package Microsoft.AspNetCore.Mvc.NewtonsoftJson --version 3.1.0"
version 3.1.0 working for ASP.NET Core 3.0 and use the Following Code-
```
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_3_0)
.AddNewtonsoftJson(... |
334,844 | I have installed Magento 2.4 successfully in localhost. When I tried to open the link (http://localhost/magento3/) it's showing not found. But all the Magento directories in the same folder(magento3). Please any let me know how to fix this issue.
[](h... | 2021/03/30 | [
"https://magento.stackexchange.com/questions/334844",
"https://magento.stackexchange.com",
"https://magento.stackexchange.com/users/72786/"
] | I suggest you to use bulk api endpoints, for better performance.
Tier price updates the endpoint is
```
{{host}}/rest/async/bulk/V1/products/tier-prices/
```
or
```
{{host}}/rest/all/async/bulk/V1/products/tier-prices/
```
or
```
{{host}}/rest/<storecode>/async/bulk/V1/products/tier-prices/
```
Here an exam... | There is no built in bulk update option for updating tier pricing.
>
> Rather than entering tier prices manually for each product, it can be
> more efficient to import the pricing data.
>
>
>
Have a look at the documentation for importing tier price data here <https://docs.magento.com/user-guide/system/data-impor... |
334,844 | I have installed Magento 2.4 successfully in localhost. When I tried to open the link (http://localhost/magento3/) it's showing not found. But all the Magento directories in the same folder(magento3). Please any let me know how to fix this issue.
[](h... | 2021/03/30 | [
"https://magento.stackexchange.com/questions/334844",
"https://magento.stackexchange.com",
"https://magento.stackexchange.com/users/72786/"
] | we recently published a module that does exactly what you need. You can find it here <https://marketplace.magento.com/customgento-module-mass-update-tier-prices-m2.html>. | There is no built in bulk update option for updating tier pricing.
>
> Rather than entering tier prices manually for each product, it can be
> more efficient to import the pricing data.
>
>
>
Have a look at the documentation for importing tier price data here <https://docs.magento.com/user-guide/system/data-impor... |
606,985 | So, if I run a program through the menus in gnome-shell, is there a way to view `stdout` and `stderr`? Or is there some kind of hack to achieve this functionality?
Or is everything just sent to `/dev/null`? | 2013/06/13 | [
"https://superuser.com/questions/606985",
"https://superuser.com",
"https://superuser.com/users/102044/"
] | Usually, `gdm`/session start-up scripts redirect `stderr` & `stdout` to either:
```
~/.xsession-errors
```
or
```
~/.cache/gdm/session.log
```
With `systemd` and recent `gdm` versions, everything is redirected to `systemd journal`, so one way to get that output is:
```
journalctl -b _PID=$(pgrep gnome-session)
... | The command suggested by don\_crissti didn't show anything for me, but I just do:
```
journalctl -f
```
in a terminal tab that I always leave open (and opens automatically on boot) so I have realtime feedback of all logging from systemd on my computer.
If desired, you can use the match filters from journalctl to li... |
14,911,356 | ive just installed titanium and the android sdk for development. In my project i have an index.html but its not loading that when i do a build, it keeps loading a 'welcome to titanium' html page which for the life of me i just can't find anywhere to see where its being loaded from.
How the heck do i set *my* index.htm... | 2013/02/16 | [
"https://Stackoverflow.com/questions/14911356",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2058234/"
] | Sounds like you created a default alloy project, all the `app/controllers/index.xml` file does is load another controller, probably called FirstView or something like that. Look through your `views` directory inside the `app` directory for another `.xml` file.
The structure of Alloy is that the `index.xml` file is loa... | I think you are working with titanium alloy.
if so, your file should be index.xml and not index.html
index.xml contains as a child node of node.
for allow project you can find index.xml file and for the same file there is a controller file in folder app/controller/index.js.
in index.js file there must b a following... |
14,911,356 | ive just installed titanium and the android sdk for development. In my project i have an index.html but its not loading that when i do a build, it keeps loading a 'welcome to titanium' html page which for the life of me i just can't find anywhere to see where its being loaded from.
How the heck do i set *my* index.htm... | 2013/02/16 | [
"https://Stackoverflow.com/questions/14911356",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2058234/"
] | Sounds like you created a default alloy project, all the `app/controllers/index.xml` file does is load another controller, probably called FirstView or something like that. Look through your `views` directory inside the `app` directory for another `.xml` file.
The structure of Alloy is that the `index.xml` file is loa... | It should be `index.xml` and body should be like this:
```
<Alloy>
<Window id="xyz">
</Window>
</Alloy>
```
Then there should be `index.js` file where you have to call this xml file by id:
```
$.xyz.open();
``` |
14,911,356 | ive just installed titanium and the android sdk for development. In my project i have an index.html but its not loading that when i do a build, it keeps loading a 'welcome to titanium' html page which for the life of me i just can't find anywhere to see where its being loaded from.
How the heck do i set *my* index.htm... | 2013/02/16 | [
"https://Stackoverflow.com/questions/14911356",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2058234/"
] | I think you are working with titanium alloy.
if so, your file should be index.xml and not index.html
index.xml contains as a child node of node.
for allow project you can find index.xml file and for the same file there is a controller file in folder app/controller/index.js.
in index.js file there must b a following... | It should be `index.xml` and body should be like this:
```
<Alloy>
<Window id="xyz">
</Window>
</Alloy>
```
Then there should be `index.js` file where you have to call this xml file by id:
```
$.xyz.open();
``` |
206,737 | I have a question about comparing the points within two plots.
I would like to compare two plots and find the minimum distance among their points, in order to find the nearest/common points (i.e., those ones with minimum or zero-distance) and plot it (overlapping).
What I did was to extract the coordinates of the re... | 2019/09/23 | [
"https://mathematica.stackexchange.com/questions/206737",
"https://mathematica.stackexchange.com",
"https://mathematica.stackexchange.com/users/67505/"
] | Since most of the points in your two data sets coincide and none of them has a nearest neighbor that is very far away when the total scale of the two plots is taken into consideration, I recommend visualizing the spacial relation between the points by plotting the points of one dataset and showing the offset of the nea... | ```
distance = DistanceMatrix[seq1, seq2]
points = Position[distance, x_ /; x < 0.1]
ListPlot[{seq1[[First /@ points]], seq2[[Last /@ points]]}]
``` |
65,286,995 | I'm attempting to make a widget extension with two text labels and an image. The two labels need to be in the top left and the image in the bottom right. I've been unable to get this working correctly.
Is there a proper way of doing this without having to use a Spacer() or an overlay image which isn't what I need. Ver... | 2020/12/14 | [
"https://Stackoverflow.com/questions/65286995",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14601731/"
] | There are a bunch of ways to build a layout like that. What you have is almost working, you just need a `Spacer` between the text and image to shove the image down:
```
VStack (alignment: .leading) {
Text("Title")
.font(.headline)
.fontWeight(.regular)
.lineLimit(1)
Text("subtitle")
... | I think I've managed to get this working, well as close as I could get it. Seems to be a bit better than before. Mildly satisfied but working now.
```
ZStack {
VStack (alignment: .leading){
Text("Title")
.font(.body)
.fontWeight(.bold)
.lineLimit(1)
... |
55,020,721 | I want to insert an image to the database using servlet. i have created images folder inside web pages and i want sent the to that folder. here is my code.
**CompanyReg.jsp**
```
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-t... | 2019/03/06 | [
"https://Stackoverflow.com/questions/55020721",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9960448/"
] | yes thats because the image is not in that folder. so when submitting your form you need to copy the image to the folder you created. here is a sample code to copy the image to your folder
```
public void copyFile(String fileName,String fileType, InputStream in) {
try {
//relativeWebPath is the pat... | ```
Part filePart = request.getPart("photo");
//Retrieves <input type="file" name="file">
fileName = Paths.get(filePart.getSubmittedFileName()).getFileName().toString(); // MSIE fix.
uploadedInputStream = filePart.getInputStream();
```
Try this code |
365,019 | I was thinking recently about what might happen if you were to place a block of material in the middle of a complete vacuum. Obviously there's not going to be a way to ever achieve such a scenario but what would happen if you were to put a block of let's say steel at 100C in a vacuum such that the block is not in conta... | 2017/10/25 | [
"https://physics.stackexchange.com/questions/365019",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/165190/"
] | The block of steel would lose energy via black body radiation. All objects at a temperature above absolute zero according the the priciples of black body radiation. A steel block at 100 degress C will radiate in the infrared. A typical blackbody spectrum is shown below. Notice how the frequecy gets smaller as the objec... | the sun is a block of material in the middle of a complete vacum. Although its not in contact with any material it loses energy through radiation.Radiation does not need an indermidiate medium in order to exchange energy. I also believe that there are ways to achieve the same with a block of steel in a given tempreratu... |
365,019 | I was thinking recently about what might happen if you were to place a block of material in the middle of a complete vacuum. Obviously there's not going to be a way to ever achieve such a scenario but what would happen if you were to put a block of let's say steel at 100C in a vacuum such that the block is not in conta... | 2017/10/25 | [
"https://physics.stackexchange.com/questions/365019",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/165190/"
] | The block of steel would lose energy via black body radiation. All objects at a temperature above absolute zero according the the priciples of black body radiation. A steel block at 100 degress C will radiate in the infrared. A typical blackbody spectrum is shown below. Notice how the frequecy gets smaller as the objec... | An answer cannot be given unless you make a statement about the vacuum which can have em waves (radiation) travelling through it.
Your block will lose energy by radiating it out as electromagnetic waves (mainly infra-red) but at the same time it might also be receiving radiation from whatever is outside it.
You wil... |
365,019 | I was thinking recently about what might happen if you were to place a block of material in the middle of a complete vacuum. Obviously there's not going to be a way to ever achieve such a scenario but what would happen if you were to put a block of let's say steel at 100C in a vacuum such that the block is not in conta... | 2017/10/25 | [
"https://physics.stackexchange.com/questions/365019",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/165190/"
] | The block of steel would lose energy via black body radiation. All objects at a temperature above absolute zero according the the priciples of black body radiation. A steel block at 100 degress C will radiate in the infrared. A typical blackbody spectrum is shown below. Notice how the frequecy gets smaller as the objec... | The amount of energy will depend on the mass of the block and what it is made up of. A small body will lose energy at such a slow rate that it can outlast our sun. |
27,972,844 | the problem is I got large text file. Let it be
```
a=c("atcgatcgatcgatcgatcgatcgatcgatcgatcg")
```
I need to compare every 3rd symbol in this text with value (e.g. `'c'`) and if true, I want to add `1` to counter `i`.
I thought to use `grep` but it seems this function wouldn't suite for my purpose.
So I need your ... | 2015/01/15 | [
"https://Stackoverflow.com/questions/27972844",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3445783/"
] | **Edited to provide a solution that's fast for much larger strings:**
If you have a very long string (on the order of millions of nucleotides), the lookbehind assertion in my original answer (below) is too slow to be practical. In that case, use something more like the following, which: (1) splits the string apart bet... | Compare every third character with `"c"`:
```
grepl("^(.{2}c)*.{0,2}$", a)
# [1] FALSE
```
Extract characters 4 to 10:
```
substr(a, 4, 10)
# [1] "gatcgat"
``` |
27,972,844 | the problem is I got large text file. Let it be
```
a=c("atcgatcgatcgatcgatcgatcgatcgatcgatcg")
```
I need to compare every 3rd symbol in this text with value (e.g. `'c'`) and if true, I want to add `1` to counter `i`.
I thought to use `grep` but it seems this function wouldn't suite for my purpose.
So I need your ... | 2015/01/15 | [
"https://Stackoverflow.com/questions/27972844",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3445783/"
] | This is a simple approach using R primitives:
```
sum("c"==(strsplit(a,NULL))[[1]][c(FALSE,FALSE,TRUE)])
[1] 3 # this is the right answer.
```
The Boolean pattern `c(FALSE,FALSE,TRUE)` is replicated to be as long as the input string and then is used to index it. It can be adjusted to match a different element or fo... | Compare every third character with `"c"`:
```
grepl("^(.{2}c)*.{0,2}$", a)
# [1] FALSE
```
Extract characters 4 to 10:
```
substr(a, 4, 10)
# [1] "gatcgat"
``` |
27,972,844 | the problem is I got large text file. Let it be
```
a=c("atcgatcgatcgatcgatcgatcgatcgatcgatcg")
```
I need to compare every 3rd symbol in this text with value (e.g. `'c'`) and if true, I want to add `1` to counter `i`.
I thought to use `grep` but it seems this function wouldn't suite for my purpose.
So I need your ... | 2015/01/15 | [
"https://Stackoverflow.com/questions/27972844",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3445783/"
] | **Edited to provide a solution that's fast for much larger strings:**
If you have a very long string (on the order of millions of nucleotides), the lookbehind assertion in my original answer (below) is too slow to be practical. In that case, use something more like the following, which: (1) splits the string apart bet... | This is a simple approach using R primitives:
```
sum("c"==(strsplit(a,NULL))[[1]][c(FALSE,FALSE,TRUE)])
[1] 3 # this is the right answer.
```
The Boolean pattern `c(FALSE,FALSE,TRUE)` is replicated to be as long as the input string and then is used to index it. It can be adjusted to match a different element or fo... |
176,409 | I've done some changes in master page in SharePoint Designer. After that I'm trying to roll back to the original of master page.
It's showing error
>
> Something went wrong
>
>
>
I need to get my original master page . | 2016/04/11 | [
"https://sharepoint.stackexchange.com/questions/176409",
"https://sharepoint.stackexchange.com",
"https://sharepoint.stackexchange.com/users/53154/"
] | The page layouts need to reside in the master page gallery (under \_catalogs/masterpage). You could create a feature with a module to deploy them there, and then make your features A and B be dependent on this one via [feature dependency](https://msdn.microsoft.com/en-us/library/ee231535.aspx) | The \_layouts directory doesn't store page layouts, they need to be provisioned to the master page gallery.
The best option in your case would be to write Feature A with a module that would provision your page layout to the master page gallery and then you can write your Feature B with Feature dependency as Fran sugg... |
56,481 | I need to understand message queue services. Available services I know out there are Amazon SQS and IronMQ.
What are they exactly? When should I use either one of them? Can you provide a real-world example? | 2013/12/26 | [
"https://webmasters.stackexchange.com/questions/56481",
"https://webmasters.stackexchange.com",
"https://webmasters.stackexchange.com/users/34751/"
] | Your website doesn't have 100,000 keywords. Your *pages* have *X* number of keywords. Google isn't ranking your entire website. They're ranking each *page*. Thus your meta keywords (which aren't used for ranking purposes anymore and haven't been for a very long time) should focus on the keywords for that *page*. It sho... | ```
I have 100000 keywords on my website. But I can't put them in Meta keyword tag
```
Google doesn’t use the keywords meta tag in web search. [Here](http://www.mattcutts.com/blog/keywords-meta-tag-in-web-search/) is the news from Matt Cutts.
If you make a function that displays 20 keywords in the footer of our webs... |
56,481 | I need to understand message queue services. Available services I know out there are Amazon SQS and IronMQ.
What are they exactly? When should I use either one of them? Can you provide a real-world example? | 2013/12/26 | [
"https://webmasters.stackexchange.com/questions/56481",
"https://webmasters.stackexchange.com",
"https://webmasters.stackexchange.com/users/34751/"
] | Your website doesn't have 100,000 keywords. Your *pages* have *X* number of keywords. Google isn't ranking your entire website. They're ranking each *page*. Thus your meta keywords (which aren't used for ranking purposes anymore and haven't been for a very long time) should focus on the keywords for that *page*. It sho... | If you are looking for the best way to proceed, I would say (if you insist):
Create unique and compelling content with the keywords (put 2-4 per content) and create content for all the 10,000 of them (you may hire content writers for the same) and put them on your website.
If you want to proceed with the way you jus... |
50,980,143 | I have a issue when I want to create my emulator using Tizen Studio version 2.4 on Ubuntu 14.4 LTS
[](https://i.stack.imgur.com/uzJ9N.png)
I can not see the platforms for Tizen TV, anw, when I choice any platform and click OK
[![enter image descript... | 2018/06/22 | [
"https://Stackoverflow.com/questions/50980143",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5676318/"
] | finally, I find out the solution,
I install TV Extensions-40 in Extension SDK tab, It's will create my TV emulator for me
[](https://i.stack.imgur.com/xXRNj.png) | you have to visit configuration section from package manager and then enabled SDK for TV |
52,592,479 | My anchor even after applying CSS styles to it when it's disabled still acts like hyperlink. Changes colour when hovered on.
[](https://i.stack.imgur.com/TByid.png)
[](https://i.stack... | 2018/10/01 | [
"https://Stackoverflow.com/questions/52592479",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9559251/"
] | It seems like your css selector is wrong. The `disabled` pseudo class only works with input fields and not with anchors.
```
input[disabled="disabled"], input.disabled {
/* whatever you want */
}
```
Besides that, idk how you handle the addition of the `clickable` class, you need to handle that in order to n... | If you are using Angular, you should be able to use a conditional class with the [ngClass attribute](https://angular.io/api/common/NgClass). Not sure if you are using Angular 2, 3, 4, 5, or JS (here's the [JS link for ng-class](https://docs.angularjs.org/api/ng/directive/ngClass)).
I think I would make the clickable i... |
154,953 | I have installed `tomcat7` (using `apt-get install`) and whenever I want to start `tomcat7` it says :
```
* no JDK found - please set JAVA_HOME
```
I have set `JAVA_HOME` in my `bash.bashrc` and also in `~/.bashrc` and when I issue `echo $JAVA_HOME` I clearly see that this variable is pointing to my jdk's root folde... | 2012/06/23 | [
"https://askubuntu.com/questions/154953",
"https://askubuntu.com",
"https://askubuntu.com/users/7111/"
] | You can try this: Just press `Ctrl`+`Alt`+`T` on your keyboard to open Terminal. When it opens, run the command below.
```
gksudo gedit /etc/default/tomcat7
```
When the file opens, uncomment the line that sets the JAVA\_HOME variable.

Save and r... | Just add following line in /etc/default/tomcat7 at where JAVA\_HOME variable is defined
```
JAVA_HOME=/usr/lib/jvm/java-7-oracle
```
then run command
```
sudo service tomcat7 restart
``` |
154,953 | I have installed `tomcat7` (using `apt-get install`) and whenever I want to start `tomcat7` it says :
```
* no JDK found - please set JAVA_HOME
```
I have set `JAVA_HOME` in my `bash.bashrc` and also in `~/.bashrc` and when I issue `echo $JAVA_HOME` I clearly see that this variable is pointing to my jdk's root folde... | 2012/06/23 | [
"https://askubuntu.com/questions/154953",
"https://askubuntu.com",
"https://askubuntu.com/users/7111/"
] | You can try this: Just press `Ctrl`+`Alt`+`T` on your keyboard to open Terminal. When it opens, run the command below.
```
gksudo gedit /etc/default/tomcat7
```
When the file opens, uncomment the line that sets the JAVA\_HOME variable.

Save and r... | Tomcat will not actually use your JAVA\_HOME environmente variable, but look in some predefined locations and in the JAVA\_HOME variable set inside the startup script, as other answers point out.
If you don't like messing with the tomcat startup script, you could create a symlink for your preferred java installation, w... |
154,953 | I have installed `tomcat7` (using `apt-get install`) and whenever I want to start `tomcat7` it says :
```
* no JDK found - please set JAVA_HOME
```
I have set `JAVA_HOME` in my `bash.bashrc` and also in `~/.bashrc` and when I issue `echo $JAVA_HOME` I clearly see that this variable is pointing to my jdk's root folde... | 2012/06/23 | [
"https://askubuntu.com/questions/154953",
"https://askubuntu.com",
"https://askubuntu.com/users/7111/"
] | You can try this: Just press `Ctrl`+`Alt`+`T` on your keyboard to open Terminal. When it opens, run the command below.
```
gksudo gedit /etc/default/tomcat7
```
When the file opens, uncomment the line that sets the JAVA\_HOME variable.

Save and r... | Open terminal
```
echo $JAVA_HOME
```
Copy the result. Then
```
sudo -H gedit /etc/default/tomcat7
```
Replace `#JAVA_HOME=/usr/lib/jvm/openjdk-6-jdk` with the output you copied from `$JAVA_HOME`. |
154,953 | I have installed `tomcat7` (using `apt-get install`) and whenever I want to start `tomcat7` it says :
```
* no JDK found - please set JAVA_HOME
```
I have set `JAVA_HOME` in my `bash.bashrc` and also in `~/.bashrc` and when I issue `echo $JAVA_HOME` I clearly see that this variable is pointing to my jdk's root folde... | 2012/06/23 | [
"https://askubuntu.com/questions/154953",
"https://askubuntu.com",
"https://askubuntu.com/users/7111/"
] | You can try this: Just press `Ctrl`+`Alt`+`T` on your keyboard to open Terminal. When it opens, run the command below.
```
gksudo gedit /etc/default/tomcat7
```
When the file opens, uncomment the line that sets the JAVA\_HOME variable.

Save and r... | Adding to the answer of Mitch (the accepted answer above), check your `/usr/lib/jvm/` directory. Usually, java is installed there itself.
You might have oracle java installed or you might have a latest version of java installed. Just checkout the directories at `/usr/lib/jvm/` and add the one your java is in.
For me,... |
154,953 | I have installed `tomcat7` (using `apt-get install`) and whenever I want to start `tomcat7` it says :
```
* no JDK found - please set JAVA_HOME
```
I have set `JAVA_HOME` in my `bash.bashrc` and also in `~/.bashrc` and when I issue `echo $JAVA_HOME` I clearly see that this variable is pointing to my jdk's root folde... | 2012/06/23 | [
"https://askubuntu.com/questions/154953",
"https://askubuntu.com",
"https://askubuntu.com/users/7111/"
] | Tomcat will not actually use your JAVA\_HOME environmente variable, but look in some predefined locations and in the JAVA\_HOME variable set inside the startup script, as other answers point out.
If you don't like messing with the tomcat startup script, you could create a symlink for your preferred java installation, w... | Just add following line in /etc/default/tomcat7 at where JAVA\_HOME variable is defined
```
JAVA_HOME=/usr/lib/jvm/java-7-oracle
```
then run command
```
sudo service tomcat7 restart
``` |
154,953 | I have installed `tomcat7` (using `apt-get install`) and whenever I want to start `tomcat7` it says :
```
* no JDK found - please set JAVA_HOME
```
I have set `JAVA_HOME` in my `bash.bashrc` and also in `~/.bashrc` and when I issue `echo $JAVA_HOME` I clearly see that this variable is pointing to my jdk's root folde... | 2012/06/23 | [
"https://askubuntu.com/questions/154953",
"https://askubuntu.com",
"https://askubuntu.com/users/7111/"
] | Open terminal
```
echo $JAVA_HOME
```
Copy the result. Then
```
sudo -H gedit /etc/default/tomcat7
```
Replace `#JAVA_HOME=/usr/lib/jvm/openjdk-6-jdk` with the output you copied from `$JAVA_HOME`. | Just add following line in /etc/default/tomcat7 at where JAVA\_HOME variable is defined
```
JAVA_HOME=/usr/lib/jvm/java-7-oracle
```
then run command
```
sudo service tomcat7 restart
``` |
154,953 | I have installed `tomcat7` (using `apt-get install`) and whenever I want to start `tomcat7` it says :
```
* no JDK found - please set JAVA_HOME
```
I have set `JAVA_HOME` in my `bash.bashrc` and also in `~/.bashrc` and when I issue `echo $JAVA_HOME` I clearly see that this variable is pointing to my jdk's root folde... | 2012/06/23 | [
"https://askubuntu.com/questions/154953",
"https://askubuntu.com",
"https://askubuntu.com/users/7111/"
] | Just add following line in /etc/default/tomcat7 at where JAVA\_HOME variable is defined
```
JAVA_HOME=/usr/lib/jvm/java-7-oracle
```
then run command
```
sudo service tomcat7 restart
``` | Adding to the answer of Mitch (the accepted answer above), check your `/usr/lib/jvm/` directory. Usually, java is installed there itself.
You might have oracle java installed or you might have a latest version of java installed. Just checkout the directories at `/usr/lib/jvm/` and add the one your java is in.
For me,... |
154,953 | I have installed `tomcat7` (using `apt-get install`) and whenever I want to start `tomcat7` it says :
```
* no JDK found - please set JAVA_HOME
```
I have set `JAVA_HOME` in my `bash.bashrc` and also in `~/.bashrc` and when I issue `echo $JAVA_HOME` I clearly see that this variable is pointing to my jdk's root folde... | 2012/06/23 | [
"https://askubuntu.com/questions/154953",
"https://askubuntu.com",
"https://askubuntu.com/users/7111/"
] | Tomcat will not actually use your JAVA\_HOME environmente variable, but look in some predefined locations and in the JAVA\_HOME variable set inside the startup script, as other answers point out.
If you don't like messing with the tomcat startup script, you could create a symlink for your preferred java installation, w... | Adding to the answer of Mitch (the accepted answer above), check your `/usr/lib/jvm/` directory. Usually, java is installed there itself.
You might have oracle java installed or you might have a latest version of java installed. Just checkout the directories at `/usr/lib/jvm/` and add the one your java is in.
For me,... |
154,953 | I have installed `tomcat7` (using `apt-get install`) and whenever I want to start `tomcat7` it says :
```
* no JDK found - please set JAVA_HOME
```
I have set `JAVA_HOME` in my `bash.bashrc` and also in `~/.bashrc` and when I issue `echo $JAVA_HOME` I clearly see that this variable is pointing to my jdk's root folde... | 2012/06/23 | [
"https://askubuntu.com/questions/154953",
"https://askubuntu.com",
"https://askubuntu.com/users/7111/"
] | Open terminal
```
echo $JAVA_HOME
```
Copy the result. Then
```
sudo -H gedit /etc/default/tomcat7
```
Replace `#JAVA_HOME=/usr/lib/jvm/openjdk-6-jdk` with the output you copied from `$JAVA_HOME`. | Adding to the answer of Mitch (the accepted answer above), check your `/usr/lib/jvm/` directory. Usually, java is installed there itself.
You might have oracle java installed or you might have a latest version of java installed. Just checkout the directories at `/usr/lib/jvm/` and add the one your java is in.
For me,... |
51,459,555 | I'm trying to replicate this shortcut for easily generating an adder while separating the output carry and the result:
```
reg [31:0] op_1;
reg [31:0] op_2;
reg [31:0] sum;
reg carry_out;
always @(posedge clk)
{ carry_out, sum } <= op_1 + op_2;
```
In my case, it's Ok to use the nonstandard `ieee.STD_LOGIC_UNSI... | 2018/07/21 | [
"https://Stackoverflow.com/questions/51459555",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2180200/"
] | Too bad that VHDL 2008 is not an option. If it was, the following would make it:
```
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
entity foo is
port(
clk: in std_ulogic;
a, b: in u_unsigned(31 downto 0);
s: out u_unsigned(31 downto 0);
co: out std_ulogic
);
end ... | You have to extend op\_1, op\_2 to 33 bits (Adding a zero at the top as the numbers are unsigned, for signed values you would replicate the top bit). The result (sum) also must be 33 bits.
Do a normal 33+33 bit addition (with all the conversions in VHDL).
Then split off the sum[32] as the carry. |
49,718,008 | First of all, before any of you marks this post as duplicate, please check my code if the solution isn't implemented yet.
OK, so I've been trying to resolve this issue for what's now close to three weeks and still can't wrap my head around it.
I'm trying to make an HTML signature for a company and I'm almost at the en... | 2018/04/08 | [
"https://Stackoverflow.com/questions/49718008",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2359063/"
] | First of all the images need to be hosted somewhere (cloud, website, etc) to be able to be displayed when someone open your mail, since you cannot attach them every time in email content. I advise you to use plain text since some webmail services or even email client can block the images, therefore your contact informa... | The solution to your problem is simple, you didn't add the height and width to all of your images. I guessed at the height of the image on the left (87px), set the three images on the right at a width of 140 and a height of 29 (87/3=29) and ran the results through Litmus.com. With the added height and widths for the im... |
30,386,989 | I am trying to use the League of Legends API and request data on a certain user. I use the line
```
var user = getUrlVars()["username"].replace("+", " ");
```
to store the username. However, when I do the XMLHttpRequest with that username, it'll put %20 instead of a space.
```
y.open("GET", "https://na.api.pvp... | 2015/05/22 | [
"https://Stackoverflow.com/questions/30386989",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4093160/"
] | When you're creating a URL, you should use `encodeURIComponent` to encode all the special characters properly:
```
y.open("GET", "https://na.api.pvp.net/api/lol/na/v1.4/summoner/by-name/"+encodeURIComponent(user), false);
``` | What you're experiencing is correct behaviour and is called URL encoding. HTTP requests have to conform to certain standards. The first line is always made up of three parts delimited by a space:
1. Method (GET, POST, etc.)
2. Path (i.e. /api/lol/na/v1.4/summoner/by-name/the%20man)
3. HTTP version (HTTP/1.1, HTTP/1.0,... |
30,386,989 | I am trying to use the League of Legends API and request data on a certain user. I use the line
```
var user = getUrlVars()["username"].replace("+", " ");
```
to store the username. However, when I do the XMLHttpRequest with that username, it'll put %20 instead of a space.
```
y.open("GET", "https://na.api.pvp... | 2015/05/22 | [
"https://Stackoverflow.com/questions/30386989",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4093160/"
] | When you're creating a URL, you should use `encodeURIComponent` to encode all the special characters properly:
```
y.open("GET", "https://na.api.pvp.net/api/lol/na/v1.4/summoner/by-name/"+encodeURIComponent(user), false);
``` | Actually there are no "spaces" in the summoner names on Riot's side. So:
```
https://na.api.pvp.net/api/lol/na/v1.4/summoner/by-name/the man
```
Becomes:
```
https://na.api.pvp.net/api/lol/na/v1.4/summoner/by-name/theman
```
Have a look at this: <https://developer.riotgames.com/discussion/community-discussion/sh... |
30,386,989 | I am trying to use the League of Legends API and request data on a certain user. I use the line
```
var user = getUrlVars()["username"].replace("+", " ");
```
to store the username. However, when I do the XMLHttpRequest with that username, it'll put %20 instead of a space.
```
y.open("GET", "https://na.api.pvp... | 2015/05/22 | [
"https://Stackoverflow.com/questions/30386989",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4093160/"
] | Actually there are no "spaces" in the summoner names on Riot's side. So:
```
https://na.api.pvp.net/api/lol/na/v1.4/summoner/by-name/the man
```
Becomes:
```
https://na.api.pvp.net/api/lol/na/v1.4/summoner/by-name/theman
```
Have a look at this: <https://developer.riotgames.com/discussion/community-discussion/sh... | What you're experiencing is correct behaviour and is called URL encoding. HTTP requests have to conform to certain standards. The first line is always made up of three parts delimited by a space:
1. Method (GET, POST, etc.)
2. Path (i.e. /api/lol/na/v1.4/summoner/by-name/the%20man)
3. HTTP version (HTTP/1.1, HTTP/1.0,... |
56,159,327 | I have wrote a function that converts a format (eg. April 16, into 16.04.) It does the job, but unfortunately it doesn't convert days lower than 10. (April 5, is not converted into 05.05.) Any idea why's that? Thanks.
```js
var replaceArry = [
[/January 1, /gi, '01.01.'],
[/January 2, /gi, '02.01.'],
[/Januar... | 2019/05/16 | [
"https://Stackoverflow.com/questions/56159327",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9389198/"
] | You can remove the entire array and format your dates like this:
```
var date = new Date("April 5");
var m = date.getMonth() < 10 ? "0" + (date.getMonth() + 1) + "." : (date.getMonth() + 1) + ".";
var d = date.getDate() < 10 ? "0" + (date.getDate()) + ".": date.getDate() + ".";
var formatted = d + m;
```
`console.l... | Alternatively, you could use the `Date` and `String` features of JavaScript like this:
```js
let dateString = "April 5, 2019";
let customFormat = new Date(dateString)
.toLocaleString('en-GB', { month: "2-digit", day: "2-digit"})
.substring(0, 5)
.split('/')
// .reverse()
.join('.');
console.log(cus... |
21,379,986 | I am trying to change checkout/cart.phtml through layout update in my module's layout file i.e. mymodule.xml
```
<layout>
<checkout_cart_index>
<reference name="checkout.cart">
<action method="setCartTemplate"><value>mymodule/checkout/cart.phtml</value></action>
</reference>
</check... | 2014/01/27 | [
"https://Stackoverflow.com/questions/21379986",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2978099/"
] | Ankita, What I'm about to write is the *actual* way to get what you want. While the official answer by John Hickling will work, it is not how Magento intended the main cart template to be modified.
Magento deliberately chose to use different methods for setting the cart templates, namely, `setCartTemplate` and `setEmp... | The method is setTemplate not setCartTemplate, like so:
```
<layout>
<checkout_cart_index>
<reference name="checkout.cart">
<action method="setTemplate"><value>mymodule/checkout/cart.phtml</value></action>
</reference>
</checkout_cart_index>
</layout>
``` |
21,211 | I have developed a method to process images I use for my research. It's nothing revolutionary but I think it might be useful to others than me, and why not, be worthy of being published somewhere (at least for me to cite when I use it).
As it is outside my primary field of research, nobody in my direct lab vicinity c... | 2014/05/20 | [
"https://academia.stackexchange.com/questions/21211",
"https://academia.stackexchange.com",
"https://academia.stackexchange.com/users/10643/"
] | There is not much of a "formal feedback" system associated with the arxiv. I say "not much" instead of "none" because the arxiv apparently does do some degree of automatic tracking of citations to its papers. For instance [this arxiv submission](http://arxiv.org/abs/1208.0977) contains a link to a MO post in which my p... | You need to find a way to advertise your work so that people find it on arXiv, use it, then eventually cite it and criticize it.
The main advantages of arXiv are:
* the publication timing. When you submit to some closed review journal or conference, you are months before an official decision. During this time (that c... |
21,211 | I have developed a method to process images I use for my research. It's nothing revolutionary but I think it might be useful to others than me, and why not, be worthy of being published somewhere (at least for me to cite when I use it).
As it is outside my primary field of research, nobody in my direct lab vicinity c... | 2014/05/20 | [
"https://academia.stackexchange.com/questions/21211",
"https://academia.stackexchange.com",
"https://academia.stackexchange.com/users/10643/"
] | There is not much of a "formal feedback" system associated with the arxiv. I say "not much" instead of "none" because the arxiv apparently does do some degree of automatic tracking of citations to its papers. For instance [this arxiv submission](http://arxiv.org/abs/1208.0977) contains a link to a MO post in which my p... | The arXiv is a tool for establishing a presence, but it does not market or disseminate your results. It merely places them in a certain category and presents title, author, and sometimes abstract in a summary fashion, depending on how one uses it. Some researchers get RSS and email updates in their favorite areas about... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.