qid int64 1 74.7M | question stringlengths 15 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 4 30.2k | response_k stringlengths 11 36.5k |
|---|---|---|---|---|---|
4,172,306 | I would like to hide a piece of Javascript from my source code. Ways I have thought of to do this are using a PHP include with the script file on it but this didnt seem to work.
Does anyone have any suggestions for me?
If you need a copy of my script just ask.
Thanks in advance,
Callum | 2010/11/13 | [
"https://Stackoverflow.com/questions/4172306",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/506399/"
] | You can't hide JavaScript source, since it's needs to be transferred to the browser for execution. What you can do is obfuscate your code by using a compressor. I believe jQuery uses Google's [Closure compiler](http://googlecode.blogspot.com/2009/11/introducing-closure-tools.html). | Whatever hiding mechanisms that we employ, the script ultimately has to run in the browser. Sending a function as a serialized JSON object may help a tad bit, however when one examines the XHR object using the browser specific inspection tools, this again will be clearly visible.
[Here](http://tallymobile.com/test3.ht... |
4,172,306 | I would like to hide a piece of Javascript from my source code. Ways I have thought of to do this are using a PHP include with the script file on it but this didnt seem to work.
Does anyone have any suggestions for me?
If you need a copy of my script just ask.
Thanks in advance,
Callum | 2010/11/13 | [
"https://Stackoverflow.com/questions/4172306",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/506399/"
] | You can't hide JavaScript source, since it's needs to be transferred to the browser for execution. What you can do is obfuscate your code by using a compressor. I believe jQuery uses Google's [Closure compiler](http://googlecode.blogspot.com/2009/11/introducing-closure-tools.html). | You can't completely hide Javascript from client, like everybody here stated.
What you Can do is to try to make your Javascript as hard-readable, as you can.
One way of doing this is to [obfuscate](http://javascriptobfuscator.com/default.aspx) it. Before obfuscating, name your functions and variables randomly, so th... |
4,172,306 | I would like to hide a piece of Javascript from my source code. Ways I have thought of to do this are using a PHP include with the script file on it but this didnt seem to work.
Does anyone have any suggestions for me?
If you need a copy of my script just ask.
Thanks in advance,
Callum | 2010/11/13 | [
"https://Stackoverflow.com/questions/4172306",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/506399/"
] | You can't hide JavaScript source, since it's needs to be transferred to the browser for execution. What you can do is obfuscate your code by using a compressor. I believe jQuery uses Google's [Closure compiler](http://googlecode.blogspot.com/2009/11/introducing-closure-tools.html). | I think the best you could do is 1) put it into a separate .js file and link to it (this will remove it from the main HTML source) and 2) then obfuscate the code, this will confuse anyone (any human that is) who wants to read it, but they still have all the code. Since JavaScript is run client-side a copy of the script... |
4,172,306 | I would like to hide a piece of Javascript from my source code. Ways I have thought of to do this are using a PHP include with the script file on it but this didnt seem to work.
Does anyone have any suggestions for me?
If you need a copy of my script just ask.
Thanks in advance,
Callum | 2010/11/13 | [
"https://Stackoverflow.com/questions/4172306",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/506399/"
] | Whatever hiding mechanisms that we employ, the script ultimately has to run in the browser. Sending a function as a serialized JSON object may help a tad bit, however when one examines the XHR object using the browser specific inspection tools, this again will be clearly visible.
[Here](http://tallymobile.com/test3.ht... | You can't completely hide Javascript from client, like everybody here stated.
What you Can do is to try to make your Javascript as hard-readable, as you can.
One way of doing this is to [obfuscate](http://javascriptobfuscator.com/default.aspx) it. Before obfuscating, name your functions and variables randomly, so th... |
4,172,306 | I would like to hide a piece of Javascript from my source code. Ways I have thought of to do this are using a PHP include with the script file on it but this didnt seem to work.
Does anyone have any suggestions for me?
If you need a copy of my script just ask.
Thanks in advance,
Callum | 2010/11/13 | [
"https://Stackoverflow.com/questions/4172306",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/506399/"
] | Whatever hiding mechanisms that we employ, the script ultimately has to run in the browser. Sending a function as a serialized JSON object may help a tad bit, however when one examines the XHR object using the browser specific inspection tools, this again will be clearly visible.
[Here](http://tallymobile.com/test3.ht... | I think the best you could do is 1) put it into a separate .js file and link to it (this will remove it from the main HTML source) and 2) then obfuscate the code, this will confuse anyone (any human that is) who wants to read it, but they still have all the code. Since JavaScript is run client-side a copy of the script... |
22,559,982 | I get this error from SQLPackage: "An item with the same key has already been added"
What is the meaning? Google won't help me..
>
> "c:\Program Files (x86)\Microsoft SQL Server\110\DAC\bin\sqlpackage.exe" /Action:DeployReport /SourceFile:"XXX.dacpac" /Profile:"publish.xml" OutputPath:"Report.xml"
>
>
>
Generatin... | 2014/03/21 | [
"https://Stackoverflow.com/questions/22559982",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2794445/"
] | I just ran into this issue. For anyone else who gets this, try the following.
1. Delete the [project].dbmdl file in the root of the project folder.
2. Close and re-open the project.
3. Clean the solution/project.
4. Build the DACPAC again.
5. Publish/Script/Report the DACPAC.
I believe it is related to a cache of the... | I was having the same issue. The weird thing was I could publish from Visual Studio without a problem, but as soon as I tried to publish from the command-line using SqlPackage I got this error.
For me it turned out that there were duplicate SqlCmdVariable's in my \*.publish.xml file. I removed the duplicates and now p... |
22,559,982 | I get this error from SQLPackage: "An item with the same key has already been added"
What is the meaning? Google won't help me..
>
> "c:\Program Files (x86)\Microsoft SQL Server\110\DAC\bin\sqlpackage.exe" /Action:DeployReport /SourceFile:"XXX.dacpac" /Profile:"publish.xml" OutputPath:"Report.xml"
>
>
>
Generatin... | 2014/03/21 | [
"https://Stackoverflow.com/questions/22559982",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2794445/"
] | I just ran into this issue. For anyone else who gets this, try the following.
1. Delete the [project].dbmdl file in the root of the project folder.
2. Close and re-open the project.
3. Clean the solution/project.
4. Build the DACPAC again.
5. Publish/Script/Report the DACPAC.
I believe it is related to a cache of the... | I got the same error when deploying with SqlPackage.exe (with VS the deployment worked) but it wasn't an error in the publish file.
My problem was, that I added the msdb two times with different versions.
So please don't forget to check the Database-References for any duplicates. |
22,559,982 | I get this error from SQLPackage: "An item with the same key has already been added"
What is the meaning? Google won't help me..
>
> "c:\Program Files (x86)\Microsoft SQL Server\110\DAC\bin\sqlpackage.exe" /Action:DeployReport /SourceFile:"XXX.dacpac" /Profile:"publish.xml" OutputPath:"Report.xml"
>
>
>
Generatin... | 2014/03/21 | [
"https://Stackoverflow.com/questions/22559982",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2794445/"
] | I was having the same issue. The weird thing was I could publish from Visual Studio without a problem, but as soon as I tried to publish from the command-line using SqlPackage I got this error.
For me it turned out that there were duplicate SqlCmdVariable's in my \*.publish.xml file. I removed the duplicates and now p... | I got the same error when deploying with SqlPackage.exe (with VS the deployment worked) but it wasn't an error in the publish file.
My problem was, that I added the msdb two times with different versions.
So please don't forget to check the Database-References for any duplicates. |
511,693 | I have 3 images that I want to rotate when a button is clicked.
image1, image2, image3.
If the image is at image1, then when clicked it should show image2 (and so on, in order of image1, .., image3).
When I am at image3, it should then hide the image, i.e. don't display it.
I need some help with the javascript func... | 2009/02/04 | [
"https://Stackoverflow.com/questions/511693",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/39677/"
] | You can get a background-image by accessing it from the [.css(name) method](http://docs.jquery.com/CSS/css#name):
```
$("#sector1").css("background-image");
```
Without managing your list of images in an array or some other fashion, you're going to have to check each background-image to know when it's time to hide y... | Here's a thing that works.
Each overlay is initially hidden with CSS. Each time your button is clicked, all the overlays are hidden, then one is revealed based on some data stored on the button. If the data reaches the max number overlays + 1, none are shown and the data is reset to 0.
Markup
```
<div id="containe... |
511,693 | I have 3 images that I want to rotate when a button is clicked.
image1, image2, image3.
If the image is at image1, then when clicked it should show image2 (and so on, in order of image1, .., image3).
When I am at image3, it should then hide the image, i.e. don't display it.
I need some help with the javascript func... | 2009/02/04 | [
"https://Stackoverflow.com/questions/511693",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/39677/"
] | You can get a background-image by accessing it from the [.css(name) method](http://docs.jquery.com/CSS/css#name):
```
$("#sector1").css("background-image");
```
Without managing your list of images in an array or some other fashion, you're going to have to check each background-image to know when it's time to hide y... | In response to Bendeway's answer above, you'll need to insert before
```
list.find('img:eq(0)').show();
```
the following line:
```
list.find('img').hide();
```
This will hide all the images before it starts rotating through them. |
511,693 | I have 3 images that I want to rotate when a button is clicked.
image1, image2, image3.
If the image is at image1, then when clicked it should show image2 (and so on, in order of image1, .., image3).
When I am at image3, it should then hide the image, i.e. don't display it.
I need some help with the javascript func... | 2009/02/04 | [
"https://Stackoverflow.com/questions/511693",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/39677/"
] | Do you have to use the background image?
If not, here's a little code sample for what I would do.
```
<html>
<head>
<style type="text/css">
#imageRotater { list-style-type:none; }
#imageRotater, .imageRotater li { margin:0px auto; padding: 0px; }
#imageRotater img { display:none; }
</style>
<script typ... | Here's a thing that works.
Each overlay is initially hidden with CSS. Each time your button is clicked, all the overlays are hidden, then one is revealed based on some data stored on the button. If the data reaches the max number overlays + 1, none are shown and the data is reset to 0.
Markup
```
<div id="containe... |
511,693 | I have 3 images that I want to rotate when a button is clicked.
image1, image2, image3.
If the image is at image1, then when clicked it should show image2 (and so on, in order of image1, .., image3).
When I am at image3, it should then hide the image, i.e. don't display it.
I need some help with the javascript func... | 2009/02/04 | [
"https://Stackoverflow.com/questions/511693",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/39677/"
] | Do you have to use the background image?
If not, here's a little code sample for what I would do.
```
<html>
<head>
<style type="text/css">
#imageRotater { list-style-type:none; }
#imageRotater, .imageRotater li { margin:0px auto; padding: 0px; }
#imageRotater img { display:none; }
</style>
<script typ... | In response to Bendeway's answer above, you'll need to insert before
```
list.find('img:eq(0)').show();
```
the following line:
```
list.find('img').hide();
```
This will hide all the images before it starts rotating through them. |
39,335,501 | I have the following code. It seems the reading sequence is wrong. Any help?
```
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
typedef struct punct{
int x;
int y;
}COORD;
typedef struct nod{
COORD *coord;
struct nod *urm;
}NOD;
int main()
{
NOD *head= malloc( sizeof(NOD) );
scanf("%d", &head->coord->x ... | 2016/09/05 | [
"https://Stackoverflow.com/questions/39335501",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6650016/"
] | You haven't initialized `head->coord`. Dereferencing uninitialized pointers result in [undefined behaviour](https://en.wikipedia.org/wiki/Undefined_behavior). You need to do something like:
```
head->coord = malloc( sizeof (COORD) );
```
You should also check the return value of `malloc()` for failures. | You did not initialize the coord variable so you shoud malloc some space for that too.
`head->coord = malloc( sizeof (COORD) );`
But in this case it might be best to put COORD in NOD instead of referencing to it!
So:
```
typedef struct nod{
COORD coord;
struct nod *urm;
}NOD;
```
You should only really mak... |
8,908,172 | I'm using <http://benalman.com/projects/jquery-hashchange-plugin/> to listen for hash changes in my project, but his plugin is outdated and does not work with newer versions of browsers such as Firefox 9 and IE9.
Searched on Google and here but could not find any other plugin.
Or is it enough to just use this code t... | 2012/01/18 | [
"https://Stackoverflow.com/questions/8908172",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/565319/"
] | You can't add base64 support to IE7 using a library. This is a feature that can't be added using JavaScript. | I don't think you can do this in IE7, however you can use MTHML instead to get inline images, here's a good post on it: <http://www.phpied.com/mhtml-when-you-need-data-uris-in-ie7-and-under/>. |
39,064,709 | I have a database that looks like this SQL Fiddle: <http://sqlfiddle.com/#!9/aa02e/1>
```
CREATE TABLE Table1
(`Store` varchar(1), `Date` date, `Product` varchar(2), `Weekday` int, `Month` int, `Revenue` float)
;
INSERT INTO Table1
(`Store`, `Date`, `Product`, `Weekday`, `Month`, `Revenue`)
VALUES
('a', '... | 2016/08/21 | [
"https://Stackoverflow.com/questions/39064709",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2591138/"
] | The weekday average is tricky. Your query is getting the average "order size" per weekday. But you want the total revenue.
One method is to first aggregate by weekday, but that is a bit of a mess. Instead, you can use this trick of calculating the average by dividing the total revenue by the number of days:
```
SELEC... | ```
SELECT
t1.store,
SUM(CASE WHEN Month = 1 THEN Revenue ELSE NULL END) AS REVENUE_JAN,
SUM(CASE WHEN Month = 2 THEN Revenue ELSE NULL END) AS REVENUE_FEB,
daily.REVENUE_THU,
daily.REVENUE_FRI
FROM Table1 t1
JOIN (
SELECT
Store,
weekday,
avg(CASE WHEN weekday = 4 THEN sum_rev END) as REVENUE_TH... |
39,064,709 | I have a database that looks like this SQL Fiddle: <http://sqlfiddle.com/#!9/aa02e/1>
```
CREATE TABLE Table1
(`Store` varchar(1), `Date` date, `Product` varchar(2), `Weekday` int, `Month` int, `Revenue` float)
;
INSERT INTO Table1
(`Store`, `Date`, `Product`, `Weekday`, `Month`, `Revenue`)
VALUES
('a', '... | 2016/08/21 | [
"https://Stackoverflow.com/questions/39064709",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2591138/"
] | The weekday average is tricky. Your query is getting the average "order size" per weekday. But you want the total revenue.
One method is to first aggregate by weekday, but that is a bit of a mess. Instead, you can use this trick of calculating the average by dividing the total revenue by the number of days:
```
SELEC... | How about this solution it return average for chosen day of chosen store
```
CREATE PROCEDURE sumForDayStore(IN vday INTEGER, IN vStore VARCHAR(50))
BEGIN
DECLARE totalDays INTEGER;
DECLARE totalRevenu INTEGER;
SET totalDays = (SELECT count(*) FROM Table1 WHERE WeekDay = vDay AND store = vStore);
SET ... |
39,064,709 | I have a database that looks like this SQL Fiddle: <http://sqlfiddle.com/#!9/aa02e/1>
```
CREATE TABLE Table1
(`Store` varchar(1), `Date` date, `Product` varchar(2), `Weekday` int, `Month` int, `Revenue` float)
;
INSERT INTO Table1
(`Store`, `Date`, `Product`, `Weekday`, `Month`, `Revenue`)
VALUES
('a', '... | 2016/08/21 | [
"https://Stackoverflow.com/questions/39064709",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2591138/"
] | The weekday average is tricky. Your query is getting the average "order size" per weekday. But you want the total revenue.
One method is to first aggregate by weekday, but that is a bit of a mess. Instead, you can use this trick of calculating the average by dividing the total revenue by the number of days:
```
SELEC... | How about this one:
```
SELECT mnth.Store, REVENUE_JAN, REVENUE_FEB, avg(rthu) REVENUE_THU, avg(rfri) REVENUE_FRI
FROM
(Select Store, sum(case when Month = 1 then Revenue else NULL END) REVENUE_JAN,
sum(case when Month = 2 then Revenue else NULL END) REVENUE_FEB
From Table1 group by Store) as mnth
join
(Select ... |
39,064,709 | I have a database that looks like this SQL Fiddle: <http://sqlfiddle.com/#!9/aa02e/1>
```
CREATE TABLE Table1
(`Store` varchar(1), `Date` date, `Product` varchar(2), `Weekday` int, `Month` int, `Revenue` float)
;
INSERT INTO Table1
(`Store`, `Date`, `Product`, `Weekday`, `Month`, `Revenue`)
VALUES
('a', '... | 2016/08/21 | [
"https://Stackoverflow.com/questions/39064709",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2591138/"
] | ```
SELECT
t1.store,
SUM(CASE WHEN Month = 1 THEN Revenue ELSE NULL END) AS REVENUE_JAN,
SUM(CASE WHEN Month = 2 THEN Revenue ELSE NULL END) AS REVENUE_FEB,
daily.REVENUE_THU,
daily.REVENUE_FRI
FROM Table1 t1
JOIN (
SELECT
Store,
weekday,
avg(CASE WHEN weekday = 4 THEN sum_rev END) as REVENUE_TH... | How about this solution it return average for chosen day of chosen store
```
CREATE PROCEDURE sumForDayStore(IN vday INTEGER, IN vStore VARCHAR(50))
BEGIN
DECLARE totalDays INTEGER;
DECLARE totalRevenu INTEGER;
SET totalDays = (SELECT count(*) FROM Table1 WHERE WeekDay = vDay AND store = vStore);
SET ... |
39,064,709 | I have a database that looks like this SQL Fiddle: <http://sqlfiddle.com/#!9/aa02e/1>
```
CREATE TABLE Table1
(`Store` varchar(1), `Date` date, `Product` varchar(2), `Weekday` int, `Month` int, `Revenue` float)
;
INSERT INTO Table1
(`Store`, `Date`, `Product`, `Weekday`, `Month`, `Revenue`)
VALUES
('a', '... | 2016/08/21 | [
"https://Stackoverflow.com/questions/39064709",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2591138/"
] | ```
SELECT
t1.store,
SUM(CASE WHEN Month = 1 THEN Revenue ELSE NULL END) AS REVENUE_JAN,
SUM(CASE WHEN Month = 2 THEN Revenue ELSE NULL END) AS REVENUE_FEB,
daily.REVENUE_THU,
daily.REVENUE_FRI
FROM Table1 t1
JOIN (
SELECT
Store,
weekday,
avg(CASE WHEN weekday = 4 THEN sum_rev END) as REVENUE_TH... | How about this one:
```
SELECT mnth.Store, REVENUE_JAN, REVENUE_FEB, avg(rthu) REVENUE_THU, avg(rfri) REVENUE_FRI
FROM
(Select Store, sum(case when Month = 1 then Revenue else NULL END) REVENUE_JAN,
sum(case when Month = 2 then Revenue else NULL END) REVENUE_FEB
From Table1 group by Store) as mnth
join
(Select ... |
169,529 | I have found what I think is another bug in tikz-cd v0.9b. Take the following code:
```
\documentclass[11pt]{article}
\usepackage{amsmath} %maths
\usepackage{tikz-cd}
\usetikzlibrary{arrows}
\title{}
\date{}
\tikzset{
commutative diagrams/.cd,
arrow style = tikz,
di... | 2014/04/04 | [
"https://tex.stackexchange.com/questions/169529",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/49257/"
] | If you look closely, the other horizontal arrow is also slightly inclined. You can use the perpendicular coordinate system:
```
(Names) edge [commutative diagrams/hook] (N.west|-Names)
```
and
```
(T) edge [commutative diagrams/hook] node [below] {$\eta_{T}$} (TTilde.west|-T)
```
or better yet, use `tikz-cd` dire... | The upper horizontal arrow is not quite horizontal. However there is no problem if you use a very simple `tikzcd` environment – and the code is much shorter (4lines in all!) for the same result. Just compare both ways of doing things:
```
\documentclass[10pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath} ... |
37,618,629 | I probably didn't word that title correctly, so let me explain what I'm trying to do.
I need to find cycles in a series of data. So let’s say I have all of my data in column A of an Excel spreadsheet. If a condition that I’m looking for is true in, say, cell A7, I want to check to check if it’s true in every second ce... | 2016/06/03 | [
"https://Stackoverflow.com/questions/37618629",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4724559/"
] | When you're working with weights, always give `0dp` as the height or width for the children depending on the `orientation` and let the weight do the measurements.
So your `RelativeLayout`'s width should be 0dp, same for the rest. I am guessing thats the problem. | Yes, the behaviour is quite expected.
You are using,
```
android:layout_width="wrap_content"
```
for your `TextView`. So it would try to **wrap its entire contents** and adjust its size accordingly.
As the content is large and it is ellipsized, the **TextView takes the maximum width available** to it to wrap all o... |
37,618,629 | I probably didn't word that title correctly, so let me explain what I'm trying to do.
I need to find cycles in a series of data. So let’s say I have all of my data in column A of an Excel spreadsheet. If a condition that I’m looking for is true in, say, cell A7, I want to check to check if it’s true in every second ce... | 2016/06/03 | [
"https://Stackoverflow.com/questions/37618629",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4724559/"
] | When you're working with weights, always give `0dp` as the height or width for the children depending on the `orientation` and let the weight do the measurements.
So your `RelativeLayout`'s width should be 0dp, same for the rest. I am guessing thats the problem. | the problem is you are also setting widths in dp which screw up weight, try setting them to 0dp
```
<ImageView
android:id="@+id/item_img_screen_type"
android:layout_width="0dp"
android:layout_height="60dp"
android:layout_weight="0.2"
/>
<RelativeLayout
android:layout_width="0dp"
android:lay... |
44,842,641 | We received a serious customer feedback. The customer says he's getting the error on the screenshot as soon as he installs our app from the google play store. In all our test cases we didn't received this error once. So I'm really out of ideas, there are no special applications on this device and it's a very new Androi... | 2017/06/30 | [
"https://Stackoverflow.com/questions/44842641",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5428228/"
] | I had this issue in Huawei android 8 version before ,and this is the solution worked for me:
>
> the solution that worked for me is to upgrade all the libraries you use in Gradle project side and Gradle app side.
>
>
>
this is my answer, please check it for more information:
[how to fix 'The application is infec... | There has been one occurrence in my previous experience where there was a similar report for one of our apps.
It turns out that some of the anti spyware/antivirus programs available for Android mark applications as potential viruses based on the permissions requested. For example permissions of "Making Phone Calls" or... |
63,663,198 | I have a dataset that looks like this:
```
expiration_date payment_date amount_payed
2019-01 2019-02 100.00
2019-01 2019-03 50.00
2019-02 2019-05 150.00
2019-03 2019-06 150.00
2019-04 2019-08 40.00
2019-04 2019-08 110.0... | 2020/08/30 | [
"https://Stackoverflow.com/questions/63663198",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14192969/"
] | Try using openssh instead (install the [OpenSSH client for Windows 10](https://phoenixnap.com/kb/generate-ssh-key-windows-10))
Then type:
```
ssh-keygen -m PEM -P "" -t rsa
```
That should create a `%USERPROFILE%\.ssh\id_rsa(.pub)` key file pair (private/public)
Copy the `id_rsa.pub` public key to your remote serv... | One issue that I have experienced with this is my key had a passphrase on it. I solved the problem by removing the passphrase.
Inside a terminal window:
```
ssh-keygen -p
```
1. Type in the name of the key you want to change
2. Enter the old passphrase
3. Enter the new passphrase
4. Enter the new passphrase again |
34,571,823 | I am trying to access the data from my JSON file to be used **within** my controller for further manipulation using Angular. To start, here are the first couple entries of the file 'cards.json'
```
{ "TheGrandTournament": [
{
"name": "Buccaneer",
"cardSet": "The Grand Tournament",
"type": "Minion",
"rarity": "... | 2016/01/02 | [
"https://Stackoverflow.com/questions/34571823",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4862536/"
] | Replace:
$scope.data = response.data;
with:
$scope.data = response.data.TheGrandTournament; | Try to replace:
```
$scope.cardData = angular.fromJson($scope.data[0]);
```
with:
```
$scope.cardData = angular.fromJson($scope.data["TheGrandTournament"][0]);
``` |
34,571,823 | I am trying to access the data from my JSON file to be used **within** my controller for further manipulation using Angular. To start, here are the first couple entries of the file 'cards.json'
```
{ "TheGrandTournament": [
{
"name": "Buccaneer",
"cardSet": "The Grand Tournament",
"type": "Minion",
"rarity": "... | 2016/01/02 | [
"https://Stackoverflow.com/questions/34571823",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4862536/"
] | You should move `$scope.data` into the success callback of the promise:
```
$http({method: $scope.method, url: $scope.url}).
then(function(response) {
$scope.cardData = response.data.TheGrandTournament;
console.log("Read file", $scope.url, "successfully.");
console.log($scope.cardData);
}, function(res... | Try to replace:
```
$scope.cardData = angular.fromJson($scope.data[0]);
```
with:
```
$scope.cardData = angular.fromJson($scope.data["TheGrandTournament"][0]);
``` |
34,571,823 | I am trying to access the data from my JSON file to be used **within** my controller for further manipulation using Angular. To start, here are the first couple entries of the file 'cards.json'
```
{ "TheGrandTournament": [
{
"name": "Buccaneer",
"cardSet": "The Grand Tournament",
"type": "Minion",
"rarity": "... | 2016/01/02 | [
"https://Stackoverflow.com/questions/34571823",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4862536/"
] | You should move `$scope.data` into the success callback of the promise:
```
$http({method: $scope.method, url: $scope.url}).
then(function(response) {
$scope.cardData = response.data.TheGrandTournament;
console.log("Read file", $scope.url, "successfully.");
console.log($scope.cardData);
}, function(res... | Replace:
$scope.data = response.data;
with:
$scope.data = response.data.TheGrandTournament; |
110,855 | I'm trying to create a browser moba-like game using three.js. I'm using `WASD` for movement and the player rotation follows the mouse with mousemove then lookAt() the intersection.
**The problem:**
As I start to move the mouse rapidly and doing other stuff like movement or shooting the game starts to lag and slow no... | 2015/11/05 | [
"https://gamedev.stackexchange.com/questions/110855",
"https://gamedev.stackexchange.com",
"https://gamedev.stackexchange.com/users/74332/"
] | I suggest that you don't directly couple browser-input-events to your game-logic. I would do something like this:
In your `mousemove` event-handler, read the current screen position and store it as a variable.
In your game-update loop, get the latest mouse-position (the variable you stored previously) and calculate t... | Why do you need to use ray casting?
Simply get the direction vector (vector between actor and mouse pointer) and have the character face that direction. If it's in 3d you might need to convert from screen to world coordinates.
If you want more detailed answer you should provide some code. |
1,376 | I just wanted to add furigana to a good answer written by someone else but I get the following error:
>
> Edits must be at least 6 characters; is there something else to improve in this post?
>
>
>
This seems like a silly rule especially as I just wanted to add furigana to make an answer easier to understand. | 2015/05/18 | [
"https://japanese.meta.stackexchange.com/questions/1376",
"https://japanese.meta.stackexchange.com",
"https://japanese.meta.stackexchange.com/users/1805/"
] | This only applies to edits made by [<2000 rep users](https://japanese.stackexchange.com/help/privileges/edit) (in particular, it won't affect you any longer) since in this case edits will be added to the review queue and need to be reviewed by two people. I guess the idea behind "at least 6 characters" is that very sho... | I'm fairly certain this rule is a default enforced in nearly all stackexchange communities. It would probably be removed if it was made a priority, but currently it doesn't seem too big of a problem.
Another possible reason is to avoid short edits, furigana, kanji correction and occasionally a few spelling mistake cor... |
64,975,361 | Struggling a bit here, could use some expertise.
**Sample string:**
(Single string but multi-line code fenced here so it doesn't run off the screen)
`message_string = '{"Message": "Lab Test Type \"thing1 [Phase 1]\"` `requires the following additional Lab Test Types to be recorded` `when Passing: \"thing2 (ug/g) [Ph... | 2020/11/23 | [
"https://Stackoverflow.com/questions/64975361",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5976033/"
] | It's called [Event Bubbling in JavaScript and Event Propagation](https://www.sitepoint.com/event-bubbling-javascript/). Please check it out. So what happens is, the event is passed to the parents, something like this:
[](https://i.stack.imgur.com/4zoRd.png)
And here's an ... | You can prevent this by calling `event.stopPropagation();`, this happens because the click event propagates through the DOM tree triggering the click event of parent elements. |
39,500,181 | I am getting the E488 error in gvim. My `.vimrc` file starts as follows
```
set guifont=Courier\ 10 Pitch\ 16
set backspace=2
set backspace=indent,eol,start
syntax on
``` | 2016/09/14 | [
"https://Stackoverflow.com/questions/39500181",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6832927/"
] | For one, you're missing a backslash in your first command:
```
set guifont=Courier\ 10\ Pitch\ 16
```
You can use `:let` here to avoid the escaping:
```
let &guifont = 'Courier 10 Pitch 16'
```
But that should have given you a `E518: Unknown option: Pitch\ 16` instead.
In any case, Vim has given you a line numbe... | Ditto for what Ingo Karkat said, but you can also use underscores in place of spaces (at least in the Win32 GUI).
Try reading through `:h guifont` and `:h E488` as well. |
22,800,800 | I need to download large audio files from a web server from within a corona sdk app, and have been looking at using `network.download()` or possibly `network.request()` for this purpose.
Because much of the user base will be in areas that have poor or intermittent network coverage, I would like to improve robustness ... | 2014/04/02 | [
"https://Stackoverflow.com/questions/22800800",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/213555/"
] | please replace local\_ldlibs with full path.
```
LOCAL_LDLIBS := $(LOCAL_PATH)/jniLibs/lsonivox.so \\path to the lsonivox
``` | Yes, it appears to have some problem with your path. However, the preferred way to use any pre-built 3rd party library is to use the `include $(PREBUILT_SHARED_LIBRARY)` method.
As such, I suppose this is probably mostly a duplicate of:
[NDK: How to include Prebuilt Shared Library Regardless of Architecture](https://... |
26,231 | I need to convert a fixed price bundle to a dynamic price bundle. Does anyone have a solution that is easy to implement on bulk? | 2014/07/07 | [
"https://magento.stackexchange.com/questions/26231",
"https://magento.stackexchange.com",
"https://magento.stackexchange.com/users/3132/"
] | `qty_backordered` set to `NULL` means your item was in stock in requested quantity by the moment of order was placed.
Other result means you have a problem with your installation. I'd suggest disabling 3rd party extensions to test if the problem is off-core. | Something like this ?
```
$items = $order->getItems();
$hasBackorderedItems = false;
foreach($items as $item){ // loop though all items in order checking the backorder qty
if($item->getQtyBackordered() > 0){
$hasBackorderedItems = true; // order has back order item stop loop
break;
}
}
```
... |
26,231 | I need to convert a fixed price bundle to a dynamic price bundle. Does anyone have a solution that is easy to implement on bulk? | 2014/07/07 | [
"https://magento.stackexchange.com/questions/26231",
"https://magento.stackexchange.com",
"https://magento.stackexchange.com/users/3132/"
] | To add it to the Email:
```
app/design/frontend/default/<your_template>/template/email/order/items/order/default.phtml
```
and find this ~line 31:
```
<strong style="font-size:11px;"><?php echo $this->htmlEscape($_item->getName()) ?></strong>
```
Add the following line right after that:
```
<?php if ($_ite... | Something like this ?
```
$items = $order->getItems();
$hasBackorderedItems = false;
foreach($items as $item){ // loop though all items in order checking the backorder qty
if($item->getQtyBackordered() > 0){
$hasBackorderedItems = true; // order has back order item stop loop
break;
}
}
```
... |
26,231 | I need to convert a fixed price bundle to a dynamic price bundle. Does anyone have a solution that is easy to implement on bulk? | 2014/07/07 | [
"https://magento.stackexchange.com/questions/26231",
"https://magento.stackexchange.com",
"https://magento.stackexchange.com/users/3132/"
] | To add it to the Email:
```
app/design/frontend/default/<your_template>/template/email/order/items/order/default.phtml
```
and find this ~line 31:
```
<strong style="font-size:11px;"><?php echo $this->htmlEscape($_item->getName()) ?></strong>
```
Add the following line right after that:
```
<?php if ($_ite... | `qty_backordered` set to `NULL` means your item was in stock in requested quantity by the moment of order was placed.
Other result means you have a problem with your installation. I'd suggest disabling 3rd party extensions to test if the problem is off-core. |
26,231 | I need to convert a fixed price bundle to a dynamic price bundle. Does anyone have a solution that is easy to implement on bulk? | 2014/07/07 | [
"https://magento.stackexchange.com/questions/26231",
"https://magento.stackexchange.com",
"https://magento.stackexchange.com/users/3132/"
] | `qty_backordered` set to `NULL` means your item was in stock in requested quantity by the moment of order was placed.
Other result means you have a problem with your installation. I'd suggest disabling 3rd party extensions to test if the problem is off-core. | We just ran into the same problem as the topic starter.
But we work with configurable products, and I just figured out the qty\_backordered field is set to the child order\_item (simples) only. The problem is that in the emails the items displayed are the parent order\_items (configurables) which have indeed the qty\_b... |
26,231 | I need to convert a fixed price bundle to a dynamic price bundle. Does anyone have a solution that is easy to implement on bulk? | 2014/07/07 | [
"https://magento.stackexchange.com/questions/26231",
"https://magento.stackexchange.com",
"https://magento.stackexchange.com/users/3132/"
] | `qty_backordered` set to `NULL` means your item was in stock in requested quantity by the moment of order was placed.
Other result means you have a problem with your installation. I'd suggest disabling 3rd party extensions to test if the problem is off-core. | If using Magento 2 (tested on 2.4.3):
copy below file
>
> vendor/magento/module-sales/view/frontend/templates/email/items/order/default.phtml
>
>
>
into
>
> app/design/frontend/Vendor/theme/Magento\_Sales/templates/email/items/order/default.phtml
>
>
>
After `<p class="sku"><?= $block->escapeHtml(__('SKU')... |
26,231 | I need to convert a fixed price bundle to a dynamic price bundle. Does anyone have a solution that is easy to implement on bulk? | 2014/07/07 | [
"https://magento.stackexchange.com/questions/26231",
"https://magento.stackexchange.com",
"https://magento.stackexchange.com/users/3132/"
] | To add it to the Email:
```
app/design/frontend/default/<your_template>/template/email/order/items/order/default.phtml
```
and find this ~line 31:
```
<strong style="font-size:11px;"><?php echo $this->htmlEscape($_item->getName()) ?></strong>
```
Add the following line right after that:
```
<?php if ($_ite... | We just ran into the same problem as the topic starter.
But we work with configurable products, and I just figured out the qty\_backordered field is set to the child order\_item (simples) only. The problem is that in the emails the items displayed are the parent order\_items (configurables) which have indeed the qty\_b... |
26,231 | I need to convert a fixed price bundle to a dynamic price bundle. Does anyone have a solution that is easy to implement on bulk? | 2014/07/07 | [
"https://magento.stackexchange.com/questions/26231",
"https://magento.stackexchange.com",
"https://magento.stackexchange.com/users/3132/"
] | To add it to the Email:
```
app/design/frontend/default/<your_template>/template/email/order/items/order/default.phtml
```
and find this ~line 31:
```
<strong style="font-size:11px;"><?php echo $this->htmlEscape($_item->getName()) ?></strong>
```
Add the following line right after that:
```
<?php if ($_ite... | If using Magento 2 (tested on 2.4.3):
copy below file
>
> vendor/magento/module-sales/view/frontend/templates/email/items/order/default.phtml
>
>
>
into
>
> app/design/frontend/Vendor/theme/Magento\_Sales/templates/email/items/order/default.phtml
>
>
>
After `<p class="sku"><?= $block->escapeHtml(__('SKU')... |
41,049,602 | I am experiencing an issue with a Quad Tree implementation I am working on in C#. In the file Tree.cs, the following line will cause a Stack Overflow Exception, starting consistently around 50 objects in the tree (probably enough to cause the first branch of the bottom right quad):
```
else
{
//bottom right
Tr... | 2016/12/08 | [
"https://Stackoverflow.com/questions/41049602",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/95710/"
] | You need to revise the way you're creating the sub-trees. When you create the fourth sub-tree (bottom right quadrant), you're using the following numbers:
```
(max_w / 2) + 1, max_w, (max_h / 2) + 1, max_h
```
This always results in the same dimensions (101, 200, 101, 200) for the bottom right quadrant branch becaus... | So it seems that I needed logic to test if creating a new set of nodes would be viable. I decided I wanted a node to have a minimum width of 10, so I changed this code:
```
//push a ball onto the tree
public void PushB(Ball b)
{
if(leaf)
{
BallList.Add(b);
if (BallList.Count > thresh_hold)
... |
26,333,242 | I'm new to titanium and alloy framework. I have created the models to store some data. I am able to insert and retrieve the data. I don't know How to update the row.
As suggest I did as follows,
```
var userLang = Alloy.Collections.userLanguage;
var models = Alloy.createModel("userLanguage");
models.fetch({id:... | 2014/10/13 | [
"https://Stackoverflow.com/questions/26333242",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3300593/"
] | >
> ...I need titanium query...
>
>
>
I guess that you are talking about Backbone. If so then below you can see an example how to update a model.
You can find more informations here: <http://docs.appcelerator.com/titanium/latest/#!/guide/Alloy_Sync_Adapters_and_Migrations>
```
var model = Alloy.createModel("user... | to update a model you should first get it from the collection
```
var userLang = Alloy.Collections.userLanguage;
userLang.fetch();
var langModel=userLang.get({
id:1
});
```
then use set to modify model's properties
```
langModel.set({
languageText:'new value'
});
```
then save it
```
l... |
57,241,008 | I have a scenario wherein I check the value of SharePreferences based on the value it will redirect the user to HomePage or LandingPage. I am not sure where did I got wrong? but I am getting this error below: I guess its not getting the context right any idea how do I get it?.
>
> Unhandled Exception: Navigator opera... | 2019/07/28 | [
"https://Stackoverflow.com/questions/57241008",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5232341/"
] | This is how i enabled dataBinding in kotlin gradle file :
```
dataBinding {
isEnabled = true
}
```
Voila ;)
hope this help someone | EDIT: in 2019 `databinding.isEnabled = true` *was* the correct way to enable databinding.
Please now refer to the accepted solution for the right way to do this.
The problem turned out to be in my file naming. While migrating to Kotlin DSL, I had inadvertently renamed the `gradle.properties` file to `gradle.propertie... |
57,241,008 | I have a scenario wherein I check the value of SharePreferences based on the value it will redirect the user to HomePage or LandingPage. I am not sure where did I got wrong? but I am getting this error below: I guess its not getting the context right any idea how do I get it?.
>
> Unhandled Exception: Navigator opera... | 2019/07/28 | [
"https://Stackoverflow.com/questions/57241008",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5232341/"
] | ```
android {
...
buildFeatures {
dataBinding = true
}
...
```
<https://developer.android.com/studio/preview/features?hl=en> | EDIT: in 2019 `databinding.isEnabled = true` *was* the correct way to enable databinding.
Please now refer to the accepted solution for the right way to do this.
The problem turned out to be in my file naming. While migrating to Kotlin DSL, I had inadvertently renamed the `gradle.properties` file to `gradle.propertie... |
57,241,008 | I have a scenario wherein I check the value of SharePreferences based on the value it will redirect the user to HomePage or LandingPage. I am not sure where did I got wrong? but I am getting this error below: I guess its not getting the context right any idea how do I get it?.
>
> Unhandled Exception: Navigator opera... | 2019/07/28 | [
"https://Stackoverflow.com/questions/57241008",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5232341/"
] | This is how i enabled dataBinding in kotlin gradle file :
```
dataBinding {
isEnabled = true
}
```
Voila ;)
hope this help someone | and for ViewBinding you can use :
```
viewBinding.isEnabled = true
``` |
57,241,008 | I have a scenario wherein I check the value of SharePreferences based on the value it will redirect the user to HomePage or LandingPage. I am not sure where did I got wrong? but I am getting this error below: I guess its not getting the context right any idea how do I get it?.
>
> Unhandled Exception: Navigator opera... | 2019/07/28 | [
"https://Stackoverflow.com/questions/57241008",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5232341/"
] | This is how i enabled dataBinding in kotlin gradle file :
```
dataBinding {
isEnabled = true
}
```
Voila ;)
hope this help someone | You can use it like this:
```
android {
buildFeatures {
dataBinding = true
// for view binding:
// viewBinding = true
}
}
``` |
57,241,008 | I have a scenario wherein I check the value of SharePreferences based on the value it will redirect the user to HomePage or LandingPage. I am not sure where did I got wrong? but I am getting this error below: I guess its not getting the context right any idea how do I get it?.
>
> Unhandled Exception: Navigator opera... | 2019/07/28 | [
"https://Stackoverflow.com/questions/57241008",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5232341/"
] | ```
android {
...
buildFeatures {
dataBinding = true
}
...
```
<https://developer.android.com/studio/preview/features?hl=en> | and for ViewBinding you can use :
```
viewBinding.isEnabled = true
``` |
57,241,008 | I have a scenario wherein I check the value of SharePreferences based on the value it will redirect the user to HomePage or LandingPage. I am not sure where did I got wrong? but I am getting this error below: I guess its not getting the context right any idea how do I get it?.
>
> Unhandled Exception: Navigator opera... | 2019/07/28 | [
"https://Stackoverflow.com/questions/57241008",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5232341/"
] | ```
android {
...
buildFeatures {
dataBinding = true
}
...
```
<https://developer.android.com/studio/preview/features?hl=en> | You can use it like this:
```
android {
buildFeatures {
dataBinding = true
// for view binding:
// viewBinding = true
}
}
``` |
42,233,915 | Let me explain shortly. I have this encryptor in python:
It uses PyCrypto library.
```
from Crypto import Random
from Crypto.Cipher import AES
from Crypto.Util import Counter
iv = Random.new().read(8)
encryptor = AES.new(
CRYPTOGRAPHY_KEY, // 32 bytes
AES.MODE_CTR,
counter=Counter.new(64, prefix=iv),
... | 2017/02/14 | [
"https://Stackoverflow.com/questions/42233915",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5738705/"
] | If you are trying to use AES-256 (you are using 32 bytes key), then you need to have [Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files](http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html) installed. And this has to be installed wherever this application need... | I believe you are encountering an issue where Java expects the `IV` to be fully-formed (`16 bytes`) when using `AES/CTR/NoPadding` while Python accepts an `8 byte` *prefix* and generates its own counter in the other `64 bits` (`8 bytes`).
I have example code for cross-platform compatibility in [this answer](https://s... |
53,333,556 | I'm trying to use JDK 11 [HttpClient](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/package-summary.html) to make requests through a corporate proxy which requires authentication by login and password. According to JDK's [intro](https://openjdk.java.net/groups/net/httpclient/intro.html)... | 2018/11/16 | [
"https://Stackoverflow.com/questions/53333556",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3507435/"
] | You have to set the "Proxy-Authorization" header on the request.
```
HttpClient httpClient = HttpClient.newBuilder()
.version(HTTP_1_1)
.proxy(ProxySelector.of(new InetSocketAddress("proxy.mycompany.com", 3128)))
.build();
String encoded = new String(Base64.getEncoder().encode("login:password"... | By default, basic authentication with the proxy is disabled when tunneling through an authenticating proxy since java 8u111.
You can re-enable it by specifying `-Djdk.http.auth.tunneling.disabledSchemes=""` on the java command line.
See the [jdk 8u111 release notes](https://www.oracle.com/technetwork/java/javase/8u1... |
53,333,556 | I'm trying to use JDK 11 [HttpClient](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/package-summary.html) to make requests through a corporate proxy which requires authentication by login and password. According to JDK's [intro](https://openjdk.java.net/groups/net/httpclient/intro.html)... | 2018/11/16 | [
"https://Stackoverflow.com/questions/53333556",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3507435/"
] | By default, basic authentication with the proxy is disabled when tunneling through an authenticating proxy since java 8u111.
You can re-enable it by specifying `-Djdk.http.auth.tunneling.disabledSchemes=""` on the java command line.
See the [jdk 8u111 release notes](https://www.oracle.com/technetwork/java/javase/8u1... | Use
```
System.setProperty("jdk.http.auth.proxying.disabledSchemes", "");
System.setProperty("jdk.http.auth.tunneling.disabledSchemes", "");
```
Construct your http client with proxy selector and authenticator
```
HttpClient client = HttpClient.newBuilder()
.authenticator(yourCustomAuthenticator)
.proxy(you... |
53,333,556 | I'm trying to use JDK 11 [HttpClient](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/package-summary.html) to make requests through a corporate proxy which requires authentication by login and password. According to JDK's [intro](https://openjdk.java.net/groups/net/httpclient/intro.html)... | 2018/11/16 | [
"https://Stackoverflow.com/questions/53333556",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3507435/"
] | You have to set the "Proxy-Authorization" header on the request.
```
HttpClient httpClient = HttpClient.newBuilder()
.version(HTTP_1_1)
.proxy(ProxySelector.of(new InetSocketAddress("proxy.mycompany.com", 3128)))
.build();
String encoded = new String(Base64.getEncoder().encode("login:password"... | Use
```
System.setProperty("jdk.http.auth.proxying.disabledSchemes", "");
System.setProperty("jdk.http.auth.tunneling.disabledSchemes", "");
```
Construct your http client with proxy selector and authenticator
```
HttpClient client = HttpClient.newBuilder()
.authenticator(yourCustomAuthenticator)
.proxy(you... |
13,276,147 | I have a program and once the is button clicked I want a message to appear that will tell user that the computer is rebooting (with ok/cancel option), then the computer will reboot. Yet the kicker is, I want it to reboot into safe mode. Then when the user is logged into safe mode, it will automatically start a program ... | 2012/11/07 | [
"https://Stackoverflow.com/questions/13276147",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1786775/"
] | You can call a process that runs this command
```
bcdedit /set {current} safeboot Minimal
```
then make your application a windows service and add a registry key with the name of the service to
>
> HKEY\_LOCAL\_MACHINE\SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\Your
> Service Name
>
>
> | You can reset the safeboot parameter by putting a value in the registry at, `HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce`
and it will run once the user reboots into safe mode
I'm not sure about this part, but I use this in a batch file to reset the bcdedit value, so it may, or may not work with your progra... |
23,850,698 | I am an error in my view:
```
undefined method `each' for nil:NilClass
<tbody>
<% @invoices.each do |invoice| %>
<tr>
<td><%= invoice.invoiceDate%></td>
<td><%= invoice.invoiceNumber %></td>
```
Here is my invoice controller index:
```
def index
@invoices = Invoice.all
end
```
Most posts... | 2014/05/24 | [
"https://Stackoverflow.com/questions/23850698",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1547174/"
] | Since you're using `@invoices` in your show view, you need to actually set `@invoices` in your `show` method, rather than your `index` method. So, add the following code to your controller, and you should be all set.
```
def show
@invoices = Invoice.all
end
``` | >
> that belong to that task order
>
>
>
You'll be best doing that like this:
```
#config/routes.rb
resources :task_orders
#app/controllers/task_orders_controller.rb
Class TaskOrdersController < ApplicationController
def show
@task_order = TaskOrder.find params[:id]
@invoices = @task_order.invoice... |
80,923 | I'm working an a very large scale projects, where the compilation time is **very** long. What tools can I use (preferably open source) on Linux, to find the most heavily included files and that optimize their useages?
Just to be clearer, I need a tool which will, given the dependencies, show me which headers are the mo... | 2008/09/17 | [
"https://Stackoverflow.com/questions/80923",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12371/"
] | From the root level of the source tree and do the following (\t is the tab character):
```
find . -exec grep '[ \t]*#include[ \t][ \t]*["<][^">][">]' {} ';'
| sed 's/^[ \t]*#include[ \t][ \t]*["<]//'
| sed 's/[">].*$//'
| sort
| uniq -c
| sort -r -k1 -n
```
Line 1 get all the include lines.
Line ... | If you wish to know which files are included most of all, use this bash command:
>
> find . -name '*.cpp' -exec egrep '^[:space:]*#include[[:space:]]+["<][[:alpha:][:digit:]\_.]+[">]' {} \;
>
>
>
> >
> > | sort | uniq -c | sort -k 1rn,1
> >
> > | head -20
> >
> >
> >
>
>
>
It will display top 20 files ... |
80,923 | I'm working an a very large scale projects, where the compilation time is **very** long. What tools can I use (preferably open source) on Linux, to find the most heavily included files and that optimize their useages?
Just to be clearer, I need a tool which will, given the dependencies, show me which headers are the mo... | 2008/09/17 | [
"https://Stackoverflow.com/questions/80923",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12371/"
] | Use [ccache](http://ccache.samba.org/). It will hash the inputs to a compilation, and cache the results, which will drastically increase the speed of these sorts of compiles.
If you wanted to detect the multiple includes, so that you could remove them, you could use makedepend as Iulian Șerbănoiu suggests:
```
makede... | IIRC gcc could create dependency files. |
80,923 | I'm working an a very large scale projects, where the compilation time is **very** long. What tools can I use (preferably open source) on Linux, to find the most heavily included files and that optimize their useages?
Just to be clearer, I need a tool which will, given the dependencies, show me which headers are the mo... | 2008/09/17 | [
"https://Stackoverflow.com/questions/80923",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12371/"
] | Using the Unix philosophy of "gluing together many small tools" I'd suggest writing a short script that calls gcc with the -M (or -MM) and -MF (OUTFILE) options (As detailed [here](http://gcc.gnu.org/onlinedocs/gcc-4.3.2/gcc/Preprocessor-Options.html#Preprocessor-Options)). That will generate the dependency lists for t... | Bash scripts found in the page aren't good solution. It works only on simple project. In fact, in large project, like discribe in header page, C-preprocessor (#if, #else, ...) are often used. Only good software more complex, like [makedepend](http://www.xfree86.org/current/makedepend.1.html) or [scons](http://www.scons... |
80,923 | I'm working an a very large scale projects, where the compilation time is **very** long. What tools can I use (preferably open source) on Linux, to find the most heavily included files and that optimize their useages?
Just to be clearer, I need a tool which will, given the dependencies, show me which headers are the mo... | 2008/09/17 | [
"https://Stackoverflow.com/questions/80923",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12371/"
] | If you wish to know which files are included most of all, use this bash command:
>
> find . -name '*.cpp' -exec egrep '^[:space:]*#include[[:space:]]+["<][[:alpha:][:digit:]\_.]+[">]' {} \;
>
>
>
> >
> > | sort | uniq -c | sort -k 1rn,1
> >
> > | head -20
> >
> >
> >
>
>
>
It will display top 20 files ... | This is not exactly what you are searchng for, and it might not be easy to setup, but may be you could have a look at lxr : lxr.linux.no is a browseable kernel tree.
In the search box, if you enter a filename, it will give you where it is included.
But this is still guessing, and it does not track chained dependencies... |
80,923 | I'm working an a very large scale projects, where the compilation time is **very** long. What tools can I use (preferably open source) on Linux, to find the most heavily included files and that optimize their useages?
Just to be clearer, I need a tool which will, given the dependencies, show me which headers are the mo... | 2008/09/17 | [
"https://Stackoverflow.com/questions/80923",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12371/"
] | The answers [here](https://stackoverflow.com/questions/42308/tool-to-track-include-dependencies) will give you tools which track #include dependencies. But there's no mention of optimization and such.
Aside: The book "Large Scale C++ Software Design" should help. | You might want to look at distributed compiling, see for example [distcc](http://distcc.samba.org/) |
80,923 | I'm working an a very large scale projects, where the compilation time is **very** long. What tools can I use (preferably open source) on Linux, to find the most heavily included files and that optimize their useages?
Just to be clearer, I need a tool which will, given the dependencies, show me which headers are the mo... | 2008/09/17 | [
"https://Stackoverflow.com/questions/80923",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12371/"
] | If you wish to know which files are included most of all, use this bash command:
>
> find . -name '*.cpp' -exec egrep '^[:space:]*#include[[:space:]]+["<][[:alpha:][:digit:]\_.]+[">]' {} \;
>
>
>
> >
> > | sort | uniq -c | sort -k 1rn,1
> >
> > | head -20
> >
> >
> >
>
>
>
It will display top 20 files ... | IIRC gcc could create dependency files. |
80,923 | I'm working an a very large scale projects, where the compilation time is **very** long. What tools can I use (preferably open source) on Linux, to find the most heavily included files and that optimize their useages?
Just to be clearer, I need a tool which will, given the dependencies, show me which headers are the mo... | 2008/09/17 | [
"https://Stackoverflow.com/questions/80923",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12371/"
] | Tools like [doxygen](http://www.doxygen.org) (used with the graphviz options) can generate dependency graphs for include files... I don't know if they'd provide enough overview for what you're trying to do, but it could be worth trying. | IIRC gcc could create dependency files. |
80,923 | I'm working an a very large scale projects, where the compilation time is **very** long. What tools can I use (preferably open source) on Linux, to find the most heavily included files and that optimize their useages?
Just to be clearer, I need a tool which will, given the dependencies, show me which headers are the mo... | 2008/09/17 | [
"https://Stackoverflow.com/questions/80923",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12371/"
] | Bash scripts found in the page aren't good solution. It works only on simple project. In fact, in large project, like discribe in header page, C-preprocessor (#if, #else, ...) are often used. Only good software more complex, like [makedepend](http://www.xfree86.org/current/makedepend.1.html) or [scons](http://www.scons... | IIRC gcc could create dependency files. |
80,923 | I'm working an a very large scale projects, where the compilation time is **very** long. What tools can I use (preferably open source) on Linux, to find the most heavily included files and that optimize their useages?
Just to be clearer, I need a tool which will, given the dependencies, show me which headers are the mo... | 2008/09/17 | [
"https://Stackoverflow.com/questions/80923",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12371/"
] | Using the Unix philosophy of "gluing together many small tools" I'd suggest writing a short script that calls gcc with the -M (or -MM) and -MF (OUTFILE) options (As detailed [here](http://gcc.gnu.org/onlinedocs/gcc-4.3.2/gcc/Preprocessor-Options.html#Preprocessor-Options)). That will generate the dependency lists for t... | If you wish to know which files are included most of all, use this bash command:
>
> find . -name '*.cpp' -exec egrep '^[:space:]*#include[[:space:]]+["<][[:alpha:][:digit:]\_.]+[">]' {} \;
>
>
>
> >
> > | sort | uniq -c | sort -k 1rn,1
> >
> > | head -20
> >
> >
> >
>
>
>
It will display top 20 files ... |
80,923 | I'm working an a very large scale projects, where the compilation time is **very** long. What tools can I use (preferably open source) on Linux, to find the most heavily included files and that optimize their useages?
Just to be clearer, I need a tool which will, given the dependencies, show me which headers are the mo... | 2008/09/17 | [
"https://Stackoverflow.com/questions/80923",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12371/"
] | Using the Unix philosophy of "gluing together many small tools" I'd suggest writing a short script that calls gcc with the -M (or -MM) and -MF (OUTFILE) options (As detailed [here](http://gcc.gnu.org/onlinedocs/gcc-4.3.2/gcc/Preprocessor-Options.html#Preprocessor-Options)). That will generate the dependency lists for t... | You might want to look at distributed compiling, see for example [distcc](http://distcc.samba.org/) |
14,159,851 | I've installed RestKit into Xcode and it builds fine. However, I seem to be missing at lot of classes. I am trying to add The RKRequestDelegate class as a delegate to one of my view controllers but this delegate does not exist. I'm also missing RKRequest class.
I've looked in the RestKit folder on my hard drive and I c... | 2013/01/04 | [
"https://Stackoverflow.com/questions/14159851",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/260506/"
] | You probably didn't do anything wrong – it seems RestKit no longer contains RKRequestDelegate as of 0.20.0
You can compare the API docs for [0.10.3](http://restkit.org/api/0.10.3/) and [0.20.0-pre6](http://restkit.org/api/0.20.0-pre6/) to verify this.
Depending on what you wanted to use RKRequestDelegate for, you cou... | Here's a wiki about upgrading from 0.10.x to 0.20.0:
>
> <https://github.com/RestKit/RestKit/wiki/Upgrading-from-v0.10.x-to-v0.20.0>
>
>
>
As you see, really a big change.. And for `RKRequestDelegate`, as it said:
>
> The delegate protocols RKRequestDelegate and RKObjectLoaderDelegate have been removed from the... |
35,478,679 | Context: I have a project with some utilities to do things like data fixing. Each utility is a Java application, i.e. class with `main()` method. I want to define them as Spring Boot applications so I can use the `ApplicationRunner` and `ApplicationArguments` facility. The Spring configuration is defined via annotation... | 2016/02/18 | [
"https://Stackoverflow.com/questions/35478679",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/587365/"
] | Firstly, only one class should be annotated with @SpringBootApplication. As you've noticed in your answer, this defines the external "main" entry point. I would recommend this is a different class to your `ApplicationRunner` classes for clarity and conceptual separation.
To only have some but not all runners run, I've... | I found a workaround while experimenting with my minimal example.
`@SpringBootApplication` is just an alias for `@ComponentScan`, `@EnableAutoConfiguration` and `@Configuration`. By applying them separately, I discovered that it's the `@Configuration` annotation that causes this behaviour. If I only apply the other 2,... |
41,316,369 | I'm writing a function to split a string into a pointer to pointer, If separator is space, I want to split only the words that are not inside quotes. e.g `Hello world "not split"` should return
```
Hello
world
"not split"
```
somehow the function split the words inside the quotes and doesn't split words outside the ... | 2016/12/24 | [
"https://Stackoverflow.com/questions/41316369",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3858806/"
] | You need a state machine with two states, on quote and off quote. When you hit a quote, flip the state. When you hit a space, convert to a newline if off quote, not if on quote.
(You will quickly want to make it more elaborate to allow string escapes etc, the state machine approach scales up to that). | try this (fix and reduce)
```
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
typedef struct token {
const char *top;
const char *end;//point to next character
} Token;
Token getToken(const char **sp, char sep){
const char *s = *sp;
const char *top, *end;
Token token = { NULL, NULL};
... |
652,251 | For some odd reason my table of contents doesn't add indentation for each subsection.
Should I recreate it or can I reformat it? 
Note: there's a lot more content than just this, so it wouldn't be a two second recreate. | 2013/09/30 | [
"https://superuser.com/questions/652251",
"https://superuser.com",
"https://superuser.com/users/257927/"
] | Figured out one way,

Using the **Increase Indent** button
However there are two cases
* Case 1: It works perfectly for the item
* Case 2: The item jumps all the way to the right side of the the Table of Contents, so you have to hit backspace at th... | The ToC field can gather information from paragraphs of particular styles and TC fields. In the ToC, you can specify the level that you want each paragraph style to appear at. If you are using TC fields, OTTOMH you can specify the level in the field. When Word generates the ToC, it applies the paragraph style TOC1 to L... |
652,251 | For some odd reason my table of contents doesn't add indentation for each subsection.
Should I recreate it or can I reformat it? 
Note: there's a lot more content than just this, so it wouldn't be a two second recreate. | 2013/09/30 | [
"https://superuser.com/questions/652251",
"https://superuser.com",
"https://superuser.com/users/257927/"
] | Figured out one way,

Using the **Increase Indent** button
However there are two cases
* Case 1: It works perfectly for the item
* Case 2: The item jumps all the way to the right side of the the Table of Contents, so you have to hit backspace at th... | You need to edit the TOC styles and fix the indentation. [This page](http://office.microsoft.com/en-nz/word-help/format-a-table-of-contents-HA102322411.aspx) on the Office help site gives a good walkthrough on how to edit the TOC styles. |
652,251 | For some odd reason my table of contents doesn't add indentation for each subsection.
Should I recreate it or can I reformat it? 
Note: there's a lot more content than just this, so it wouldn't be a two second recreate. | 2013/09/30 | [
"https://superuser.com/questions/652251",
"https://superuser.com",
"https://superuser.com/users/257927/"
] | Figured out one way,

Using the **Increase Indent** button
However there are two cases
* Case 1: It works perfectly for the item
* Case 2: The item jumps all the way to the right side of the the Table of Contents, so you have to hit backspace at th... | Try clearing the tab setting in the TOC setup and *then* using the increase indent button (in TOC setup, not the Home tab):
1. Go to References tab >> Table of Contents >> Custom Table of Contents...>> Modify >> Select to Highlight **TOC2** (or the applicable level you need to fix) >> Modify >> Format >> Tabs...>> Cl... |
652,251 | For some odd reason my table of contents doesn't add indentation for each subsection.
Should I recreate it or can I reformat it? 
Note: there's a lot more content than just this, so it wouldn't be a two second recreate. | 2013/09/30 | [
"https://superuser.com/questions/652251",
"https://superuser.com",
"https://superuser.com/users/257927/"
] | Figured out one way,

Using the **Increase Indent** button
However there are two cases
* Case 1: It works perfectly for the item
* Case 2: The item jumps all the way to the right side of the the Table of Contents, so you have to hit backspace at th... | Ok, I think I found the right way to do it:
* Open the “text styles” dialog via the little arrow on the bottom-right of the styles panel or `Ctrl``Alt``Shift``S`
* Scroll to the "TOC 1" to "TOC 10" styles which correspond to the different TOC levels
* Edit the corresponding style
By doing it this way, the style is ke... |
1,117,332 | I am running a FreeBSD server and I have been sent a warning that spam has been sent from my server. I do not have it set as an open relay and I have customized the sendmail configuration. I'd like to know who is sending what email along with their username, email subject line as well as a summary of how much mail they... | 2009/07/13 | [
"https://Stackoverflow.com/questions/1117332",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10366/"
] | One idea is to alias sendmail to be a custom script, which simply cats the sendmail arguments to the end of a log before calling sendmail in the usual manner. | Can you give some sample logs? I think you're best bet would be to look through them with either grep or cut to get the source/destinations that are being sent too. Also, you could write a Perl script to automate it once you have the correct regex. This would be the best option. |
1,117,332 | I am running a FreeBSD server and I have been sent a warning that spam has been sent from my server. I do not have it set as an open relay and I have customized the sendmail configuration. I'd like to know who is sending what email along with their username, email subject line as well as a summary of how much mail they... | 2009/07/13 | [
"https://Stackoverflow.com/questions/1117332",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10366/"
] | You can also monitor all system calls to `write` and `read` functions by executing:
```
ps auxw | grep sendmail | awk '{print"-p " $2}' | xargs strace -s 256 -f 2>&1 | grep -E $'@|(([0-9]+\.){3}[0-9]+)' | tee -a "/var/log/sendmail-logs.log"
```
This will give you direct access to the information, you cannot go deep... | Can you give some sample logs? I think you're best bet would be to look through them with either grep or cut to get the source/destinations that are being sent too. Also, you could write a Perl script to automate it once you have the correct regex. This would be the best option. |
1,117,332 | I am running a FreeBSD server and I have been sent a warning that spam has been sent from my server. I do not have it set as an open relay and I have customized the sendmail configuration. I'd like to know who is sending what email along with their username, email subject line as well as a summary of how much mail they... | 2009/07/13 | [
"https://Stackoverflow.com/questions/1117332",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10366/"
] | One idea is to alias sendmail to be a custom script, which simply cats the sendmail arguments to the end of a log before calling sendmail in the usual manner. | If FreeBSD have default config, you have only one way to handle output mail, check what sending through you sendmail system in `/etc/mail`.
All output mail must be logged by `/var/log/maillog` |
1,117,332 | I am running a FreeBSD server and I have been sent a warning that spam has been sent from my server. I do not have it set as an open relay and I have customized the sendmail configuration. I'd like to know who is sending what email along with their username, email subject line as well as a summary of how much mail they... | 2009/07/13 | [
"https://Stackoverflow.com/questions/1117332",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10366/"
] | One idea is to alias sendmail to be a custom script, which simply cats the sendmail arguments to the end of a log before calling sendmail in the usual manner. | You can also monitor all system calls to `write` and `read` functions by executing:
```
ps auxw | grep sendmail | awk '{print"-p " $2}' | xargs strace -s 256 -f 2>&1 | grep -E $'@|(([0-9]+\.){3}[0-9]+)' | tee -a "/var/log/sendmail-logs.log"
```
This will give you direct access to the information, you cannot go deep... |
1,117,332 | I am running a FreeBSD server and I have been sent a warning that spam has been sent from my server. I do not have it set as an open relay and I have customized the sendmail configuration. I'd like to know who is sending what email along with their username, email subject line as well as a summary of how much mail they... | 2009/07/13 | [
"https://Stackoverflow.com/questions/1117332",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10366/"
] | You can also monitor all system calls to `write` and `read` functions by executing:
```
ps auxw | grep sendmail | awk '{print"-p " $2}' | xargs strace -s 256 -f 2>&1 | grep -E $'@|(([0-9]+\.){3}[0-9]+)' | tee -a "/var/log/sendmail-logs.log"
```
This will give you direct access to the information, you cannot go deep... | If FreeBSD have default config, you have only one way to handle output mail, check what sending through you sendmail system in `/etc/mail`.
All output mail must be logged by `/var/log/maillog` |
23,138,658 | I'm not sure how to search for this and hence I started a new question.
I have a table in the following structure
```
----------------------------------------
| TALKS | PERSON
----------------------------------------
| Networks | John Doe
| Steganography | Alex
| Assembly | Mar... | 2014/04/17 | [
"https://Stackoverflow.com/questions/23138658",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1750101/"
] | ```
Car lowestPrice = cars.get(0);
for(Car car : cars) {
if(car.price<lowestPrice.price) {
lowestPrice = car;
}
}
```
Concerning the red underlined ArrayList ... replace it with
```
ArrayList<Vehicles> yourlist = new ArrayList<Vehicles>();
``` | If you want to use approach you mentioned in OP you can declare `static` variable for `vehicles` class and in `contructor` you can check whether price is lower than actual minimum
**But my advice is to use `Comparator` or `Comparable` because this is their natural use. Also values of objects can be changed throughout ... |
23,138,658 | I'm not sure how to search for this and hence I started a new question.
I have a table in the following structure
```
----------------------------------------
| TALKS | PERSON
----------------------------------------
| Networks | John Doe
| Steganography | Alex
| Assembly | Mar... | 2014/04/17 | [
"https://Stackoverflow.com/questions/23138658",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1750101/"
] | ```
Car lowestPrice = cars.get(0);
for(Car car : cars) {
if(car.price<lowestPrice.price) {
lowestPrice = car;
}
}
```
Concerning the red underlined ArrayList ... replace it with
```
ArrayList<Vehicles> yourlist = new ArrayList<Vehicles>();
``` | As you want to sort the items of the list you can use the `Collections.sort(List<T> list, Comparator<? super T> c)` method and provide own [Comparator](http://docs.oracle.com/javase/7/docs/api/java/util/Comparator.html)
```
class VechiclePriceComparator implements Comparator<vechiles> {
public int compare(vechiles ... |
23,138,658 | I'm not sure how to search for this and hence I started a new question.
I have a table in the following structure
```
----------------------------------------
| TALKS | PERSON
----------------------------------------
| Networks | John Doe
| Steganography | Alex
| Assembly | Mar... | 2014/04/17 | [
"https://Stackoverflow.com/questions/23138658",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1750101/"
] | You could use a TreeMap with the price as the key and the vehicles object as the value. It would then be sorted by price, and you would have all of the information for the vehicle as the value. | If you want to use approach you mentioned in OP you can declare `static` variable for `vehicles` class and in `contructor` you can check whether price is lower than actual minimum
**But my advice is to use `Comparator` or `Comparable` because this is their natural use. Also values of objects can be changed throughout ... |
23,138,658 | I'm not sure how to search for this and hence I started a new question.
I have a table in the following structure
```
----------------------------------------
| TALKS | PERSON
----------------------------------------
| Networks | John Doe
| Steganography | Alex
| Assembly | Mar... | 2014/04/17 | [
"https://Stackoverflow.com/questions/23138658",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1750101/"
] | You could use a TreeMap with the price as the key and the vehicles object as the value. It would then be sorted by price, and you would have all of the information for the vehicle as the value. | As you want to sort the items of the list you can use the `Collections.sort(List<T> list, Comparator<? super T> c)` method and provide own [Comparator](http://docs.oracle.com/javase/7/docs/api/java/util/Comparator.html)
```
class VechiclePriceComparator implements Comparator<vechiles> {
public int compare(vechiles ... |
26,376,176 | In Perl, how can I get the expression of a capture that has matched in a regex?
```
$s = 'aaazzz';
$s =~ s/(a+)|(b+)|(c+)/.../;
$s =~ s/(?<one>a+)|(?<two>b+)|(?<three>c+)/.../;
```
I mean the expression (e.g. `a+`), not the string `aaa`.
I need the expression of both numbered and named captures. | 2014/10/15 | [
"https://Stackoverflow.com/questions/26376176",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1461988/"
] | I'd do something like:
```
use strict;
use warnings;
my @regexes = (
qr/(a+)/,
qr/(b+)/,
qr/(c+)/,
);
my $string = 'aaazzz';
foreach my $re(@regexes) {
if ($string =~ $re) {
print "Used regex is $re\n";
}
}
```
**Output:**
```
Used regex is (?^:(a+))
``` | You could assemble your regex from components and then test which groups matched. For demo purposes, I have only used match and not match and the replace operator 's', but same principle applies.
```
$s = 'aaazzz';
$part1 = '(a+)';
if ( $s =~ /$part1|(b+)|(c+)/ ) {
if ($1) {
print("$part1 matched\n");
... |
14,636,217 | Is there a Way with Javascript to add Help bubbles over an input Box?
For example when you you hover over an input for Name: ***\_*\_\_\_\_** it would say like First Name????
Thanks
An example is this <https://edit.europe.yahoo.com/registration?.intl=uk>
When you go over the name field it says First name in a bubbl... | 2013/01/31 | [
"https://Stackoverflow.com/questions/14636217",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2011151/"
] | Do you mean the [title attribute](http://www.w3.org/TR/html401/struct/global.html#h-7.4.3)?
```
<input type="text" title="First Name" />
``` | As said in another answer you can add a title attribute to a html tag to have a tool tip display.
Or if you are after the behaviour where information is displayed somewhere on the page telling you about the text box you have selected you can; dynamically add to a div using document.createElement() and appendChild() w... |
78,664 | I have the ODE $$y' = y^2-4$$
I want to draw the direction field and draw the solutions that satisfy $$y(0)=-4$$ and $$y(0)=0$$ without solving the equation.
So i am writing $$y^2-4 = c$$ and then i start giving values to c in order to calculate y.
$$c = 0, y=\_{-}^{+}2$$
$$c = 1, y=\_{-}^{+}\sqrt{5}$$
$$\vdots$$
T... | 2011/11/03 | [
"https://math.stackexchange.com/questions/78664",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/18835/"
] | You are given the equation for y' which tells you the slope of y at any point. So try picking various values of y to see what direction y should be moving. For example at t = 1, say y = 3, then y' = 5. So at the point {1, 3} you can draw a sharp upward pointing vector (arrow on vector would point to about 1 o'clock). T... | What riotburn said. Also, to draw the solution curves, start at the point (0, -4) and trace the path that follows the arrows. Do the same for (0, 0). |
16,053,308 | I have a vector of values such as the following:
```
1
2
3
NaN
4
7
NaN
NaN
54
5
2
7
2
NaN
NaN
NaN
5
54
3
2
NaN
NaN
NaN
NaN
4
NaN
```
How can I use
>
> interp1
>
>
>
in such way that only a variable amount of consecutive NaN-values would be interpolated? That is for example I would want to interpolate only tho... | 2013/04/17 | [
"https://Stackoverflow.com/questions/16053308",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1565754/"
] | First of all, find the positions and lengths of all sequences of `NaN` values:
```
nan_idx = isnan(x(:))';
nan_start = strfind([0, nan_idx], [0 1]);
nan_len = strfind([nan_idx, 0], [1 0]) - nan_start + 1;
```
Next, find the indices of the `NaN` elements not to interpolate:
```
thr = 3;
nan_start = nan_start(nan_len... | I know this is an bad habit in matlab, but I would think this particular case requires a loop:
```
function out = f(v)
out = zeros(numel(v));
k = 0;
for i = 1:numel(v)
if v(i) ~= NaN
if k > 3
out(i-k:i - 1) = ones(1, k) * NaN;
else
out(i-k: i - 1) = interp1();%TODO: c... |
42,816,538 | What im trying to do is only display records created for a customer that only has more then one ticketnumber in a certain month.
```
Select name,ticketnumber, title,
description,statename,personname,charge,createdon
from case
Where sum(ticketnumber) > 2 AND createdon >= '2017-01-01' ;
```
i have tried
```
select s... | 2017/03/15 | [
"https://Stackoverflow.com/questions/42816538",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5152559/"
] | To limit the check to a single month, not just after some date, you can use `dateadd(month, datediff(month, 0, createdon ) , 0)` to truncate a date down to the first of a month.
Assuming you are identifying your customer by `personname`:
using `exists()`:
```
select
name
, ticketnumber
, title
, descripti... | I usually just do this
```
SELECT Total from (select sum(ticketnumber) AS total from case)A
Where Total>2
``` |
6,825,686 | I am so confused. I am trying to create a tic tac toe game using windows c++ visual. So far I was doing good until I kept getting errors. I tried looking for help but none of the answers seemed right. This is my practice problem.
1. Implement displayBoard to display Tic Tac Toe board.
2. Prompt User for a box on the b... | 2011/07/26 | [
"https://Stackoverflow.com/questions/6825686",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/862807/"
] | you need a statement to go after the if
even if its just a ;
but maybe you want
```
if (c > '9' || c < '0')
cout << "Not a Number!";
``` | Ok, so the issue here is the "if" statement. The problem is that you haven't closed the if statement. So what the compiler sees is
```
cout << "Enter box: ";
char c;
cin.get(c);
if(c > '9' || c < '0')
{
//Compiler thinks that it should only convert the character
//to a number if you got the *wrong* number
... |
6,825,686 | I am so confused. I am trying to create a tic tac toe game using windows c++ visual. So far I was doing good until I kept getting errors. I tried looking for help but none of the answers seemed right. This is my practice problem.
1. Implement displayBoard to display Tic Tac Toe board.
2. Prompt User for a box on the b... | 2011/07/26 | [
"https://Stackoverflow.com/questions/6825686",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/862807/"
] | you need a statement to go after the if
even if its just a ;
but maybe you want
```
if (c > '9' || c < '0')
cout << "Not a Number!";
``` | ```
//Play Tic Tac Toe game between user and computer
#include<iostream>
#include<cstdio>
#include<stdlib.h>
#include<time.h>
using namespace std;
char BLANK='B';
/***************** Display the Matrix **********************************************/
//Display the matrix
void display(char matrix[3][3])
{
for(int i... |
26,091 | I wrote this simple function in CoffeeScript to see if elements are found in an array:
```
isFoundIn = (searchTerm, arrayToSearch) ->
returnVal = false
for a in arrayToSearch
returnVal = true if searchTerm is a
returnVal
```
Usage:
```
isFoundIn('james', ['robert', 'michael', 'james'])`
```
would return... | 2013/05/13 | [
"https://codereview.stackexchange.com/questions/26091",
"https://codereview.stackexchange.com",
"https://codereview.stackexchange.com/users/24998/"
] | Expanding on my comment above:
Your `isFoundIn` function can be rewritten as simply
```
isFoundIn = (term, array) -> array.indexOf(term) isnt -1
```
`indexOf` uses the strict `===` comparison, which is what CoffeeScript also uses for `is` - i.e. it's equivalent to your code.
One could extend the native JS Array pr... | Any reason to not use `item in ary` syntax? it compiles down to a slightly convoluted usage of `.indexOf >=0` but it is the coffeescript way. |
26,091 | I wrote this simple function in CoffeeScript to see if elements are found in an array:
```
isFoundIn = (searchTerm, arrayToSearch) ->
returnVal = false
for a in arrayToSearch
returnVal = true if searchTerm is a
returnVal
```
Usage:
```
isFoundIn('james', ['robert', 'michael', 'james'])`
```
would return... | 2013/05/13 | [
"https://codereview.stackexchange.com/questions/26091",
"https://codereview.stackexchange.com",
"https://codereview.stackexchange.com/users/24998/"
] | Expanding on my comment above:
Your `isFoundIn` function can be rewritten as simply
```
isFoundIn = (term, array) -> array.indexOf(term) isnt -1
```
`indexOf` uses the strict `===` comparison, which is what CoffeeScript also uses for `is` - i.e. it's equivalent to your code.
One could extend the native JS Array pr... | If you want to make it "more like CoffeeScript", use array comprehensions:
```
isFoundIn = (searchTerm, arrayToSearch) ->
return true for item in arrayToSearch when item is searchTerm
false
``` |
26,091 | I wrote this simple function in CoffeeScript to see if elements are found in an array:
```
isFoundIn = (searchTerm, arrayToSearch) ->
returnVal = false
for a in arrayToSearch
returnVal = true if searchTerm is a
returnVal
```
Usage:
```
isFoundIn('james', ['robert', 'michael', 'james'])`
```
would return... | 2013/05/13 | [
"https://codereview.stackexchange.com/questions/26091",
"https://codereview.stackexchange.com",
"https://codereview.stackexchange.com/users/24998/"
] | Expanding on my comment above:
Your `isFoundIn` function can be rewritten as simply
```
isFoundIn = (term, array) -> array.indexOf(term) isnt -1
```
`indexOf` uses the strict `===` comparison, which is what CoffeeScript also uses for `is` - i.e. it's equivalent to your code.
One could extend the native JS Array pr... | The `in` in CoffeScript is essentially the same as Ruby's `include?`. You may write following Ruby version
```
['robert', 'michael', 'james'].include? 'james'
```
in CoffeeScript as
```
'james' in ['robert', 'michael', 'james']
```
You can use following if you want to add `include` to Array prototype:
```
Array:... |
26,091 | I wrote this simple function in CoffeeScript to see if elements are found in an array:
```
isFoundIn = (searchTerm, arrayToSearch) ->
returnVal = false
for a in arrayToSearch
returnVal = true if searchTerm is a
returnVal
```
Usage:
```
isFoundIn('james', ['robert', 'michael', 'james'])`
```
would return... | 2013/05/13 | [
"https://codereview.stackexchange.com/questions/26091",
"https://codereview.stackexchange.com",
"https://codereview.stackexchange.com/users/24998/"
] | Any reason to not use `item in ary` syntax? it compiles down to a slightly convoluted usage of `.indexOf >=0` but it is the coffeescript way. | If you want to make it "more like CoffeeScript", use array comprehensions:
```
isFoundIn = (searchTerm, arrayToSearch) ->
return true for item in arrayToSearch when item is searchTerm
false
``` |
26,091 | I wrote this simple function in CoffeeScript to see if elements are found in an array:
```
isFoundIn = (searchTerm, arrayToSearch) ->
returnVal = false
for a in arrayToSearch
returnVal = true if searchTerm is a
returnVal
```
Usage:
```
isFoundIn('james', ['robert', 'michael', 'james'])`
```
would return... | 2013/05/13 | [
"https://codereview.stackexchange.com/questions/26091",
"https://codereview.stackexchange.com",
"https://codereview.stackexchange.com/users/24998/"
] | The `in` in CoffeScript is essentially the same as Ruby's `include?`. You may write following Ruby version
```
['robert', 'michael', 'james'].include? 'james'
```
in CoffeeScript as
```
'james' in ['robert', 'michael', 'james']
```
You can use following if you want to add `include` to Array prototype:
```
Array:... | If you want to make it "more like CoffeeScript", use array comprehensions:
```
isFoundIn = (searchTerm, arrayToSearch) ->
return true for item in arrayToSearch when item is searchTerm
false
``` |
183,521 | I'm trying to deploy a tabular model to a server using the "Analysis Services Deployment Wizard".
When attempting to deploy,I get the below error.
>
> The JSON DDL request failed with the following error: Failed to execute XMLA. Error returned: 'The column 'Date Offset' in table 'Date' has invalid bindings specified... | 2017/08/15 | [
"https://dba.stackexchange.com/questions/183521",
"https://dba.stackexchange.com",
"https://dba.stackexchange.com/users/47517/"
] | The problem in this case was that I was trying to replace an existing column also named 'Date Offset' - this was not a calculated column, but taken from the source table.
Resolution was to do the deployment in 2 phases, first remove the old column, then deploy again to add the new calculated column. | I was able to solve this by deleting the cube completely off of the server before doing another deploy. |
183,521 | I'm trying to deploy a tabular model to a server using the "Analysis Services Deployment Wizard".
When attempting to deploy,I get the below error.
>
> The JSON DDL request failed with the following error: Failed to execute XMLA. Error returned: 'The column 'Date Offset' in table 'Date' has invalid bindings specified... | 2017/08/15 | [
"https://dba.stackexchange.com/questions/183521",
"https://dba.stackexchange.com",
"https://dba.stackexchange.com/users/47517/"
] | The problem in this case was that I was trying to replace an existing column also named 'Date Offset' - this was not a calculated column, but taken from the source table.
Resolution was to do the deployment in 2 phases, first remove the old column, then deploy again to add the new calculated column. | Tried different methods like renaming column and removed filters applied, didn't solved this issue.
At the end this issue fixed by just deleting existing cube and redeployed |
183,521 | I'm trying to deploy a tabular model to a server using the "Analysis Services Deployment Wizard".
When attempting to deploy,I get the below error.
>
> The JSON DDL request failed with the following error: Failed to execute XMLA. Error returned: 'The column 'Date Offset' in table 'Date' has invalid bindings specified... | 2017/08/15 | [
"https://dba.stackexchange.com/questions/183521",
"https://dba.stackexchange.com",
"https://dba.stackexchange.com/users/47517/"
] | The problem in this case was that I was trying to replace an existing column also named 'Date Offset' - this was not a calculated column, but taken from the source table.
Resolution was to do the deployment in 2 phases, first remove the old column, then deploy again to add the new calculated column. | In my case, I remove duplicated columns and the error persisted.
It only worked when I did **delete model in azure** --> analysis services. |
56,329,240 | I am building a library database.
I want to write a query that returns the available books on the library(their isbns,titles,author names,pubname,categoryName and the Number of copies available.
My query involves the following relations (with bold are the primary keys) :
**Book (ISBN**, title,pubYear,numpages, pub... | 2019/05/27 | [
"https://Stackoverflow.com/questions/56329240",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11345445/"
] | Don't join the tables directly when they are not perfectly related. A book's category is not really related to a book's author. With two authors and two categories, which author would you combine with which category? It makes no sense to combine them (and possibly end up with all combinations). So, aggregate first and ... | >
> Still a bit confused..Could you explain me where the mistake exactly
> is and how could I fix this?
>
>
>
Not really meant as a answer, as this "comment" is way to large.
But a more SQL 92 valid rewrite would be more or less like below.
But as you didn't provide example data and expected results iám real... |
28,540,465 | Actually I am getting a string with HTML tags from the server in my app and I receive it in `NSString` then I pass this string to a `UIWebView` to show the data as HTML.
I want to localize these string in to Italian language.
How can I localize this HTML string? | 2015/02/16 | [
"https://Stackoverflow.com/questions/28540465",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4445157/"
] | Replace all the localized text by %@ :
```
<html> <head><link rel='stylesheet' type='text/css' href='cummins_black.css' /><p><span style="font-size: 18px; font-family: helvetica;">%@</span><br /><span style="font-size: 18px; font-family: helvetica;">%@</span><br /><br /><blink class='blink'><span style="font-size: 18p... | You either have to get a localized string from your server.
Or you have to **parse** the received string and replace the found strings with their localizations.
It would be much better to have a web service returning no HTML but just data (e.g. in JSON format) and you construct the HTML yourself so it is optimized ... |
6,288,261 | How can I get values between two dates in Codeigniter query function? Here is my model and sample code.
```
function get_promo() {
$today = date('Y-m-d');
$query = $this->db->query('SELECT FROM tbl_event WHERE event_id = $id AND event_startdate <= $today
AND event_enddate >= $today');
return $query;
}
... | 2011/06/09 | [
"https://Stackoverflow.com/questions/6288261",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/415699/"
] | I think u need to user date\_format(), more information in this link <http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_date-format>.
Try this code:
```
$today = date('Y-m-d');
$query = $this->db->query("SELECT FROM tbl_event WHERE event_id = $id AND DATE_FORMAT(event_startdate ,'%Y-%m-%d')... | You need to use the right format. Try this:
```
$todaystart = date('Y-m-d 00:00:00');
$todayend = date('Y-m-d 23:59:59');
$query = $this->db->query('SELECT FROM tbl_event WHERE event_id = $id AND event_startdate <= ? AND event_enddate >= ?', array($todaystart, $todayend));
```
EDIT: your query is wrong. ... |
6,288,261 | How can I get values between two dates in Codeigniter query function? Here is my model and sample code.
```
function get_promo() {
$today = date('Y-m-d');
$query = $this->db->query('SELECT FROM tbl_event WHERE event_id = $id AND event_startdate <= $today
AND event_enddate >= $today');
return $query;
}
... | 2011/06/09 | [
"https://Stackoverflow.com/questions/6288261",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/415699/"
] | Looking into the errors, it seems that your queries are not escaped properly. Add single or double quotes to fix it. Check @danneth answer. Use [Query Binding](http://www.codeigniter.com/user_guide/database/queries.html#query-bindings) which is simple and secure or even more use [Active Record](http://www.codeigniter.c... | You need to use the right format. Try this:
```
$todaystart = date('Y-m-d 00:00:00');
$todayend = date('Y-m-d 23:59:59');
$query = $this->db->query('SELECT FROM tbl_event WHERE event_id = $id AND event_startdate <= ? AND event_enddate >= ?', array($todaystart, $todayend));
```
EDIT: your query is wrong. ... |
6,288,261 | How can I get values between two dates in Codeigniter query function? Here is my model and sample code.
```
function get_promo() {
$today = date('Y-m-d');
$query = $this->db->query('SELECT FROM tbl_event WHERE event_id = $id AND event_startdate <= $today
AND event_enddate >= $today');
return $query;
}
... | 2011/06/09 | [
"https://Stackoverflow.com/questions/6288261",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/415699/"
] | I think you need qoutes around your date (i.e. '2011-06-08'). try this
```
function get_promo() {
$today = date('Y-m-d');
$query = $this->db->query(
"SELECT FROM tbl_event WHERE event_id = {$id} AND event_startdate <= '{$today}'
AND event_enddate >= '{$today}'");
return $query;
}
```
If... | You need to use the right format. Try this:
```
$todaystart = date('Y-m-d 00:00:00');
$todayend = date('Y-m-d 23:59:59');
$query = $this->db->query('SELECT FROM tbl_event WHERE event_id = $id AND event_startdate <= ? AND event_enddate >= ?', array($todaystart, $todayend));
```
EDIT: your query is wrong. ... |
6,288,261 | How can I get values between two dates in Codeigniter query function? Here is my model and sample code.
```
function get_promo() {
$today = date('Y-m-d');
$query = $this->db->query('SELECT FROM tbl_event WHERE event_id = $id AND event_startdate <= $today
AND event_enddate >= $today');
return $query;
}
... | 2011/06/09 | [
"https://Stackoverflow.com/questions/6288261",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/415699/"
] | ```
$this->db->where('date_start <=',date('Y-m-d'));
$this->db->where('date_end >=',date('Y-m-d'));
$query = $this->db->get('table');
``` | You need to use the right format. Try this:
```
$todaystart = date('Y-m-d 00:00:00');
$todayend = date('Y-m-d 23:59:59');
$query = $this->db->query('SELECT FROM tbl_event WHERE event_id = $id AND event_startdate <= ? AND event_enddate >= ?', array($todaystart, $todayend));
```
EDIT: your query is wrong. ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.