text: Q: How to integrate TeamCity with Perforce Swarm test run status? Swarm can call a URL, and provide the changelist number and two callback URLs: one to report test failure and one to report success (Swarm integration API). Is it possible to integrate this API with Teamcity builds? Teamcity definitely supports remote runs for a given Perforce changelist, so the question is probably whether it can call back the provided URLs...


text:
Q: Why jQuery validation is not fired when addMethod is called within an object method? I have this cute class:
validations.js
var Validation = function () {

    var load= function () {

        $.validator.addMethod("noweirdstuff", function (value, element) {
            return !(/\W/.test(value));}, "Username has invalid characters. Only letters, numbres & underscores allowed.");

        $.validator.unobtrusive.adapters.add("noweirdstuff", function (options) {
            options.rules["noweirdstuff"] = true;
            if (options.message) { options.messages["noweirdstuff"] = options.message;}
        });
    }

    return {
        init: function () {
            load();
        }
    };

}();

validations.js is bundled and minified with all javascript code into single file. Then, I'm using per page script to load only required code. In this case:
Validation.init();

But it doesn't seem fire the validation. I'm 100% sure that Validation.init() is being called.
It only works when I take it outside:
validations.js
 var Validation = function () {

        var load = function () {
         // goodbye adding validation
        }

        return {
            init: function () {
                load();
            }
        };

 }();

 $.validator.addMethod("noweirdstuff", function (value, element) {
                        return !(/\W/.test(value));}, "Username has invalid characters. Only letters, numbres & underscores allowed.");

 $.validator.unobtrusive.adapters.add("noweirdstuff", function (options) {
                        options.rules["noweirdstuff"] = true;
                        if (options.message) { options.messages["noweirdstuff"] = options.message;}
                    });

Why?

A: This is because you are registering your custom script validators after the page is loaded. The validation rules are applied to the whole document once unobtrusive validator loads, if your rules and validators haven't been added to the stack by then, they will be ignored.
I believe you could call $.validator.unobtrusive.parse(document) after you have added your rules and validators, I'm not 100% sure this would work or if would apply validators twice.
Edit: Rephrased the answer
Edit: Added possible solution

redpajama_set_name: RedPajamaStackExchange


text:
Q: Trouble with naming conventions in MVC I've always hated the scaffolding in MVC, so I decided to design my own Models, Views and Controllers. I have a model called CEmployee, a controller called ManageCEmployeeController, and a folder within the View folder called ManageCEmployee. The problem is that when I try to add a model inside the Index.cshtml file (which is in the previously mentioned folder) I get a few errors, which you can see here: http://imgur.com/YZZHTHn
According to some stuff I've found online, I've fulfilled all the conventions.
Any ideas?

A: Judging by your header tag I am going to say that you are wanting to list some data from your datasource. @using EmployeesTracking.Models is fine but you are going to provide a list to this view. You need to let the view know you are fixing to throw a list of data at it by declaring
     @using System.Collections.Generic;
     @using EmployeesTracking.Models;
     @model IEnumerable<CEmployees>;

IEnumerable is a list of data. This tells the view that the controller has already looked at your model class CEmployee and has a list of data ready to display.
Now I know you said you didn't like the scaffolding, but it is a great way to get started and you can simply take out what you don't want real easy.

A: Remove the semi-colon (;) from your @model declaration:
@using System.Collections.Generic;
@using EmployeesTracking.Models;

//No semi-colon terminator needed...
@model CEmployee

Hth...


text:
Q: Mouse Behavior on a WebPage – I don't want text being marked I am working on a web-Based Kalendar Application (multi-user). The Application is nearly ready, but one thing is not so good. I want to give the User the chance, to mark several times at one time. That's why, i made a mousedown-function, on every field, and a mouseup-function as well. That way, I get the first marked field, and the last. All fields in the middle can be calculated by the id!
Now the problem: While I am moving the mouse, the browser marks the text. I want another mouse behavior. I want the mouse to draw a rectangle, so that the user sees, where he started, an so that no text within the document gets marked! This is very important. Do you know, how to solve the problem? I already deactivated the right-Click Menu, an set my own menu, but this is to hard for me :(. I have already searched the web with google, but actually I do not really know, which keywords could help here.
PS: I am using jQuery, maybe it could help in this situation.

A: Here's a script to disable text selection:
http://www.dynamicdrive.com/dynamicindex9/noselect.htm
If you have jQuery, you can use bind like:
$('#demo').bind('selectstart',function(e) {
    e.preventDefault();
});

Here's a JSFiddle:
http://jsfiddle.net/Nk9ec/2/

A: OK, i found out, what was wrong. Your Code is for IE only. I am using Firefox, and I optimize my Application to Firefox! Well now, i managed disabling selecting text, with that function:
$(document).ready(function() {
    $(document)[0].oncontextmenu = function() {return false;}
    $('#id').mousedown(function(event) {
        checkClk(event);
        return false;
    });
});

The function checkClk(event) controls the Clicking-Behavior.
Beside I managed to make the mouse-Pointer standart-Pointer with css:
body {
    cursor: default;
}

All I need is now, to figure out, how I can draw a rectangle, when I move the mous, holding the left Button clicked. I want the Application look like the operating-System.
If you click and hold the mouse down, there is an Rectangle (like this: http://img21.imageshack.us/i/markiert.png/). Does anyone know, wheather this is possible without making a div, which size depends on the Mouseposition?


text:
Q: Swipe in android ViewPager using Fragment and TabLayout scroll not Working I added the new Toolbar, Tablayout and Viewpager in my android app. I want to create a swipe application for this I am using ViewPager. swipe and Tablayout scroll is not working on this.
main.xml
<RelativeLayout
    android:id="@+id/main_layout"
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">

    <android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="60dp"
        android:minHeight="?attr/actionBarSize"
        android:background="@color/toolbar"
        app:popupTheme="@style/ThemeOverlay.AppCompat.Light">

        <Spinner
            android:id="@+id/customspinner"
            android:layout_width="180dp"
            android:layout_height="46dp"
            android:layout_centerHorizontal="true"
            android:layout_centerVertical="true"
            android:background="@color/toolbar"
            android:layout_gravity="right"
            android:dropDownWidth="500dp"
            android:dropDownVerticalOffset="100dp"
            />

    </android.support.v7.widget.Toolbar>

    <android.support.design.widget.TabLayout
        app:tabMode="scrollable"
        android:id="@+id/tab_layout"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/toolbar"
        android:background="@color/list_background"
        android:elevation="10dp"
        android:minHeight="?attr/actionBarSize"
        android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"/>

        <android.support.v4.view.ViewPager
            android:id="@+id/pager"
            android:layout_width="match_parent"
            android:layout_height="fill_parent"
            android:layout_below="@id/tab_layout"/>

    <android.support.v4.widget.DrawerLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/drawer_layout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_below="@+id/toolbar"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true">

        <FrameLayout
            android:id="@+id/frame_container1"
            android:layout_width="match_parent"
            android:layout_height="match_parent" />

        <ExpandableListView
            android:id="@+id/list_slidermenu"
            android:layout_width="360dp"
            android:layout_height="match_parent"
            android:layout_gravity="start"
            android:background="@color/list_background"
            android:choiceMode="singleChoice"
            android:dividerHeight="1dp"
            android:divider="@android:color/darker_gray"
            android:groupIndicator="@null" >
        </ExpandableListView>

    </android.support.v4.widget.DrawerLayout>

</RelativeLayout>

DrawerLayout goes hide When I change place of DrawerLayout and TabLayout.
Thank You.

A: Did you use this?
// Setting the ViewPager For the SlidingTabsLayout
    tabs.setViewPager(pager);

A: You have to add this to change tabs with page and vice versa.
    viewPager.addOnPageChangeListener(newTabLayout.TabLayoutOnPageChangeListener(tabLayout));
    tabLayout.setTabsFromPagerAdapter(mAdapter);


text:
Q: What does middle-click on the taskbar do? I know it's supposed to lower the current window, but it has very unexpected behaviour when used on the taskbar. Once one makes the connection that it lowers a maximized window, it sort of becomes logical. But before knowing that that was the purpose, to me it seemed like it randomly switched focus.
Maybe some explanation is in order for new users...


text:
Q: Exposing OnclientClick function in user control asp.net C#
Possible Duplicate:
expose and raise event of a child control in a usercontrol in c#

I have user control with one html input button.
On page I am consuming that user control. How can I expose onclient event of that input button inside user control so if that button client so i can call page function.
<uc2:UC_LayoutSelector ID="UC_LayoutSelector1" runat="server" OnClientLayoutSelect="UC_LayoutSelector1_MyPageFunction" />

 <script type="text/javascript">

        function UC_LayoutSelector1_MyPageFunction(e) {
            alert(e);
        }
    </script>

A: Depending on what you are trying to achieve, you may just want to create a public property of the onclient property of the input button. If you are trying to capture the moment when the user clicks that button, you will want to cause a postback with the javascript function and raise the event control programmatically. That will allow you to trap the event on the parent page.


text:
Q: Как сделать так, чтоб по нажатию на кнопку в TextView был текст с определённой строки элемента EditText Я хочу сделать так: ввёл я текст в EditText, например, "Привет, Мир!" на 7-ой строке (текст можно вводить случайный), нажал на кнопку и текст вывелся в TextView (не весь, а 7-ая строка)

A: *

*Вбиваем в гугл android edittext get line

*Идём по первой ссылке

*Копируем код:
String multiLines = streetEt.getText().toString();
String[] streets;
String delimiter = "\n";

streets = multiLines.split(delimiter);

Т.е., если разделитель строк - перенос строки ("\n"), то, получив весь текст методом getText(), мы можем разбить его на части (на массив строк) методом split, принимающим разделитель строк.


text: Q: Windows 7 Forbid connecting to a specific wireless network Does anyone know how to tell windows 7 to bar a wireless network? It keeps logging into a random open one with no bandwidth my neighbors have instead of the good one we have here. I keep unchecking "automatically log in if available" and it keeps re-checking itself. I want it to NEVER log into this network no matter what without manual intervention. I do not want to disable auto connecting, just tell it "do not ever connect to this one without my express permission".


text:
Q: Search not working in public facing SharePoint 2019 I have an on-premise SharePoint 2019 communication site that manages the public facing site with anonymous access. The search is working fine in the on-prem site but not in the public facing site as it shows the following error message.
Before it was the CORS policy error which has been fixed but now, it is showing this error message. I have followed almost all the articles on Microsoft.Office.Server.Search.REST.SearchServiceException error but no luck.


text:
Q: How can I round a Decimal value upto a precision so that the total number of digits doesnot cross 15? I need to round values like 25979.699999999997 to 15 digits so it becomes 25979.7 and does not contain any insignificant zeroes.
Background:
I am trying to parse an excel file using OpenXML SDK, and there a decimal value such as 25979.7 is read as 25979.699999999997.
When MS excel shows the value, it always rounds them to 15 digits and removes trailing zeroes so it becomes 25979.7, but when I am reading using OpenXML SDK it does not do that automatically.
Any idea?
EDIT: Actually I don't want to modify the value, just want to display in that format(as a string).

A: Well, you can try not so complicated math:
var x = 25979.699999999997;
var y = Math.Round(x, 15 - (int)Math.Floor(Math.Log10(x) + 1));

y will be exactly 25979.7
Here we calculating number of digits before decimal separator as
Math.Floor(Math.Log10(x) + 1)

and subtracting it from 15 gives us remaining fractional digits to round to.

A: Simply format your (umodified) value to get a nicly formated string:
double val = double.Parse("25979.699999999997");
string formatted = val.ToString("g");

The g formatting will do all the work for you.


text:
Q: Can't access iframe of different origin in the parent jsp Quick example for the kind of functionality required (just for exampple):
http://www.indeed.hk/cmp/Calvin-Klein-Jeans-&-Calvin-Klein-Underwear/jobs/Part-Time-Sales-Associate-1643e24903d9f4c7
If you click on apply-now button, it shows an iframe.
I am having a project where I am trying to access an iframe of different origin, say https: //subdomain.example.com, on a jsp page of origin say http://www.example.com but it gives me the following error:

Failed to read the 'contentDocument' property from 'HTMLIFrameElement': Blocked a frame with origin http://www.example.com from accessing a frame with origin https://subdomain.example.com. The frame requesting access has a protocol of "http", the frame being accessed has a protocol of "https". Protocols must match.

Lets call the parent jsp page as parent.jsp, and the iframe jsp as iframe.jsp.
parent.jsp is on server S, and the project name is xyznet
iframe.jsp is on server R, and the project name is xyz
Here is a piece of code from the parent.jsp
<%
    java.util.Map model = (java.util.Map)pageContext.findAttribute("model");
%>
<html>
 <body>
 <h1> This is the parent page
    <iframe id="quick-apply-frame" name="iframe-name" src="       <%=https: //sub.domain.com/apply.html?ref=${model.x.y}" onload="quickSetParams();">
    </iframe>
<script>
 function quickSetParams() {
 $("[name=iframe-name]").contents().find("[name=iframe-param-name]").val(${model.value1}');
}
</body>
</html>

And here is piece of code from the iframe.jsp
<html>
<body>
<form action="xyz.html">
    <input name="iframe-parm-name" value=""/>
     <input name="iframe-parm-name2" value="${model.parm2}" />
</form>
</body>
</html>

Handler which loads the iframe.jsp is a SimpleFormController, located on server R
I have come across some solutions where the data is transferred directly using javascript, but I need a handler for this, and so, a direct javascript redirect or nesting of iframes would not work for me

A: Thanks James for some leads. I finally got it working!
I still dont completely understand how it works, but here is what I did:
I dont load the iframe.jsp (located in https: //sub.domain.com) at the same time as the parent.jsp is loaded. Means, the src of the iframe is not set initially.
 Instead, I call a javascript function to load the iframe once the "showIframe" button in the parent is clicked. I got a suggestion from someone that to crack cross domain security issue, you have to set the src of the iframe via javascript after the page loads.
Some more pointers other can explore is CORS, where you add a parameter like this in your ssl.conf or httpd.conf (apache configuration)
Header set Access-Control-Allow-Origin "http://www.domain.com" . It basically grants permission to access to the domain mentioned


text:
Q: WPF ProgressBar Loaded event only triggering once I'm using MVVM and have my MainWindow with the following property binding:
<ContentControl x:Name="MainContentControl" Content="{Binding CurrentPage}" Margin="10,50,10,38"/>

On a button click, I am setting CurrentPage to the new view binding, which has a ProgressCarControl on it:
private void HomeButtonClick(object obj)
        {
            CurrentPage = new HomeViewModel();
        }

<ProgressBar Cursor="Hand"
            Name="EffortProgressBar" Value="{Binding Home.Effort, Mode=TwoWay}" Foreground="{Binding RelativeSource={RelativeSource Mode=Self},
            Path=Value, Converter={StaticResource ProgressForegroundConverter}}"
            Height="12" Canvas.Left="30" Canvas.Top="75" Width="25" RenderTransformOrigin="0.5,0.5">
            <ProgressBar.RenderTransform>
                <TransformGroup>
                    <ScaleTransform ScaleY="-1"/>
                    <SkewTransform/>
                    <RotateTransform/>
                    <TranslateTransform/>
                </TransformGroup>
            </ProgressBar.RenderTransform>
            <ProgressBar.Triggers>
                <EventTrigger RoutedEvent="ProgressBar.Loaded">
                    <BeginStoryboard>
                        <Storyboard >
                            <DoubleAnimation Storyboard.TargetProperty="Value" From="0" To="{Binding Home.Effort, Mode=TwoWay}" Duration="0:0:01"/>
                        </Storyboard>
                    </BeginStoryboard>
                </EventTrigger>
            </ProgressBar.Triggers>
        </ProgressBar>

When I click the homebutton to load the page, the ProgressBar animates correctly, but when I click the button again, the ProgressBar does not animate.
Is there a different event to subscribe to to achieve this? Or will this not be possible?

A: The DataTemplate doesn't get reloaded when you set the source property that the Content property of the ContentControl is bound to a new value of the same type.
The easiest workaround would probably be to clear the Content by setting the CurrentPage property to null just before you set it back to a new instance of the HomeViewModel. For this to work you need to return to the caller and let the dispatcher update the UI before you reset the CurrentPage property:
private async void HomeButtonClick(object obj)
{
    if (CurrentPage != null && CurrentPage is HomeViewModel)
    {
        CurrentPage = null;
        await Task.Delay(1);
    }
    CurrentPage = new HomeViewModel();
}

This should force the view to be reloaded.


text:
Q: Update large number of row in MySQL table I'm using relational database(MySQL 5.7). On this database i have a table called customer_transaction. On this table i have 4 columns: id, customer_id, type, amount
|id|customer_id |type     |amount|
|--|------------|---------|------|
|1 |44          |Credit   |50    |
|2 |44          |Credit   |20    |
|3 |44          |Debit    |30    |
|4 |10          |Credit   |30    |

now i am introduce a new balance column(current balance) on this table like below.
|id|customer_id |type     |amount|balance|
|--|------------|---------|------|-------|
|1 |44          |Credit   |50    |50     |
|2 |44          |Credit   |20    |70     |
|3 |44          |Debit    |30    |40     |
|4 |10          |Debit    |30    |-30    |

The problem is, on the customer transaction table, their was nearly millions of row and all balance column was 0.00.
So i want to re-sync all balance data. But i'm confused how to recalculate and update all those row. Can i update this by MySQL query or calculate and update from my application (Laravel-PHP).

A: In MySQL 5.x, where window functions are not available, an option uses a correlated subquery to compute the balance:
update customer_transaction ct
inner join (
    select
        id,
        (
            select sum(case type when 'Credit' then amount when 'Debit' then -amount end)
            from customer_transaction ct2
            where ct2.customer_id = ct1.customer_id and ct2.id <= ct1.id
        ) balance
    from customer_transaction ct1
) ctx on ctx.id = ct.id
set ct.balance = ctx.balance


text:
Q: Update two dimensional array using useState I want to update my 2d array with useState.
It looks like:
[[null, null, null, null, null], [null, null, null, null, null], [null, null, null, null, null], [null, null, null, null, null], ...n]

You can imagine the array as rows and columns. Each column has the same value (null).
What I want is to assign the value I want to the first element of that 2d array every time a function is called.

*

*(First invoke): [[myValue, null, null, null], ...n]

*(Second invoke): [[myValue, myValue, null, null], ...n]

*(Third invoke): [[myValue, myValue, myValue, null], ...n]

*(Fourth invoke) [[myValue, myValue, myValue, myValue], [myValue,null,null,null] ...n]

I tried several ways to do this but unfortunately without success. I will share the code below.
What is the shortest way to do this?
The code I tried:
  const [data, setData] = useState(
    Array.from({ length: 6 }, (v) => Array.from({ length: 5 }, (v) => null))
  );
      const addFunc = (e) => {
        let value = e.target.value;

        // first way
        setData(
          data.map(([...row]) => {
            row.map((col) => {
              if (col === null) {
                return [...row, [...col, value]];
              }
            });
          })
        );

        // second way
        setData((val) => {
          for (var i = 0; i < data.length; i++) {
            for (var z = 0; z < data[i].length; z++) {
              if (data[i][z] == null) {
                return [...val, (val[i][z] = value)];
              }
            }
          }
        });
      };

A: Since it sounds like you want to effectively "iterate" through the 2-d array data I suggest keeping a "count" or some current "index" value that is incremented each update. Create a utility function that converts this "count" into a computed "row" and "column" index that you want to update.
Example:
const [count, setCount] = useState(0);
const [data, setData] = useState(Array(6).fill(Array(5).fill(null)));

const countToRowCol = (count) => {
  return {
    row: Math.floor(count / 5), // 5 is the inner array length
    col: count % 5
  };
};

const addFunc = () => {
  setData((data) =>
    data.map((row, i) =>
      i === countToRowCol(count).row
        ? row.map((el, j) => (j === countToRowCol(count).col ? myValue : el))
        : row
    )
  );
  setCount((c) => c + 1);
};

addFunc is just mapping the previous state's arrays into new array references for the matching row/column index, otherwise just shallow copies the previous state.


text:
Q: Удаление из 1 списка другого по не точному вхождению Имею 2 списка:
a_one = ['работа','школьный','учиться','работать','портфель']
b_one = ['раб', 'школ']

Мне нужно из списка a удалить список b, как видно список b у нас имеет не точное вхождение фразы, по этой причине я так понимаю, мне нужно использовать регулярные выражения.
Просто перебор таким способом, не работает:
for i in a_one:
    if i in b_one:
        print(i)

A: У меня вот так получилось простыми циклами сделать
a_one = ['работа', 'школьный', 'учиться', 'работать', 'портфель']
b_one = ['раб', 'школ']
res = set()

for i in a_one:
    for j in b_one:
        if j in i:
            res.add(i)
        else:
            continue

print(list(set(a_one) ^ res))   # ['учиться', 'портфель']

A: Если годится сложить в новый список, а не чистить существующий, то можно так:
https://ideone.com/vjZd3X
a = ['работа','школьный','учиться','работать','портфель']
b = ['раб', 'школ']

res = [x for x in a if all(y not in x for y in b)]

print(res)


text:
Q: How do I use Hooks (before / after) with cucumber-js-tsflow? I'm currently writing a proof of concept automation solution in Typescript using cucumber-js-tsflow, and I'm trying to replicate the Hooks setup that I have previously implemented in other solutions that used specflow.
Firstly I thought I would add a before and after hook to a separate hooks file at the location features/support/hooks.ts, as it was a proof of concept I just wanted it to log some text to the console:
import { binding, before, after } from 'cucumber-tsflow';

@binding()
export class Hooks {
  @before()
  public static logMessageToConsoleBeforeTestRun(): void {
    console.log('Before test message.');
  }

  @after()
  public static logMessageToConsoleAfterTestRun(): void {
    console.log('After test message.');
  }
}

The above didn't log the expected message to the console when I came to run the scenarios.
I then tried to simplify things, by adding the same code above to the steps file rather than the hooks file and reran, but its still not writing the expected message to the console.
In creating the above code I did follow the documentation in the readme file for cucumber-js-tsflow (https://github.com/timjroberts/cucumber-js-tsflow#readme), but there isnt a huge amount of detail and I'm realy unsure what I could have missed.
Has anyone else had a similar issue and been able to overcome it?

A: There are 2 changes what you need to do in your hooks file:
1) Do not create hooks file as a class
2) Use below format:
let { setDefaultTimeout, After, Before, AfterAll, BeforeAll } = require('cucumber');

Before({tags: '@tagName'}, async function() {

console.log('print your info');
});

This block will be executed when ever you tried to execute a scenario which is tagged with that specified tag name mentioned in above code.

A: I had the same issue and found that I was not including (requiring) my hooks files whilst running the tests.
I have Typescript and Cucumber setup according to this article and my cucumber.js file had to be updated to require my hooks
// cucumber.js
let common = [
  'features/**/*.feature', // Specify our feature files
  '--require-module ts-node/register', // Load TypeScript module
  '--require src/step-definitions/**/*.ts', // Load step definitions
  '--require src/hooks/**/*.ts', // Load hooks
  '--format progress-bar', // Load custom formatter
  '--format node_modules/cucumber-pretty' // Load custom formatter
].join(' ');

module.exports = {
  default: common
};


text:
Q: Rails 3.2.2 SQL Query Builder I'm trying to avoid reinventing the wheel here. I'm looking for a GEM that will take an existing Model and allow a user to choose the Fields they want to display in a View along with Filter criteria for the chosen fields.  This input would then build a generic data grid with the results.  A similar question was asked in 2009 SQL query builder in rails and I'm wondering if anyone knows if anything has been created in the interim?

A: You could try one of these:
https://github.com/lunich/table_for
https://github.com/bogdan/datagrid


text:
Q: Prove that there exists infinitely many prime numbers of the form 4k+3 for some integer k. We shall prove this theorem by contradiction. Assume $p_n$ is the largest prime number of the form 4$k_n$+3 for some n $\in$ $\mathbb{N}$. Consider an odd value of n. Even if n is even, we could miss one of the prime numbers to get an odd n. Now, consider
\begin{align*}
N &= 2(4 k_1 +3)(4 k_2 +3)(4k_3+3)...(4 k_n +3) + 1 \\
  &= 4m + 2\cdot 3^n + 1 \\
  &= 4m + 2\cdot (4-1)^n + 1 \\
  &= 4m + 2\cdot 4a -2 + 1 \\
  &= 4m + 2\cdot 4a -1 \\
  &= 4m + 3
\end{align*}
for some m,a $\in$ $\mathbb{N}$
Two cases are possible. N is definitely not divisible by 4$k_i$+3 i $\in$ [1,n].

*

*All numbers between 4$k_n$+3 and N are composite $\implies$ they are formed from a unique prime factorisation of the finite set of prime numbers. Then N is prime. so contradiction.

*There is a new prime between 4$k_n$+3 and N of the form 4k+3 so N is a multiple of that prime(Note that N cannot be a multiple of 4k+1 since we have 2 occurring only once in our expression for N-1), which any way is again a contradiction.

My prof said that this proof misses some cases but I am unable to figure out which case. Please help. I feel pretty confident of my proof.

A: We shall prove this theorem by contradiction. Assume $p_n$ is the largest prime number of the form 4$k_n$+3 for some n $\in$ $\mathbb{N}$. Now, consider
\begin{align*}
N &= 4(4 k_1 +3)(4 k_2 +3)(4k_3+3)...(4 k_n +3) - 1 \\
  &=4m+3
\end{align*}
for some m $\in$ $\mathbb{N}$
N is definitely not divisible by any of 4$k_i$+3 i $\in$ [1,n].
Now either N is prime or N has at least one prime factor of the form 4$k$+3 apart from itself, not in this list since if N had all prime factors of the form 4k+1, then N would have been of the form (4$u_1$+1)(4$u_2$+1)(4$u_3$+1)...(4$u_n$+1) = 4l+1 only. so a contradiction. Hence proved.
I accommodated some of Peter's changes, hope this proof is correct.

A: Your self-answer proof has logical gaps; I started editing it, but ended up just rewriting it:

Asssume that there are finitely many primes of the form $4k+3;$ let them be $p_1,p_2,\ldots,p_n.$
Let $N=4p_1 p_2 \ldots p_n-1=4(p_1 p_2 \ldots p_n-1)+3.$ Since $N$ is odd, each of its prime divisors must be of the form $4k+1$ or $4k+3.$
The identity $$(4r+1)(4s+1)=4(4rs+r+s)+1$$ shows that products of numbers of the form $4k+1$ are of the same form. Thus, since $N$ is not of this form, it has a prime divisor not of this form.
Hence, $N$ has a prime divisor $q$ of the form $4k+3,$ which is one of $p_1,p_2,\ldots,p_n.$ Therefore, $$q\mid N\quad \text {and} \quad q\mid p_1 p_2 \ldots p_n\\ q\mid(4p_1 p_2 \ldots p_n-N) \\ q\mid1,$$ i.e., $q$ is not prime. Since this is a contradiction, our assumption is false; thus, there are infinitely many primes of the form $4k+3.$


text:
Q: Fourier series of: $[\log(\sin x)]^2$ What is the Fourier expansion of:

$${ \left[ \log\left( \sin x \right)  \right]  }^{ 2 }$$

This is a well known Fourier series:

$$-\log(\sin x )=\sum_{k=1}^\infty\frac{\cos(2kx)}{k}+\log(2)$$

I couldn't proceed through this. I also tried using: $\sin x=\frac { { e }^{ ix }-{ e }^{ -ix } }{ 2i } $
But still I couldn't get it. Please help.
Is it possible to get a general form of Fourier expansion for:

$${ \left[ \log\left( \sin x \right)  \right]  }^{ n }$$

A: I don't know if it satisfies you, but using $\log \sin x$ expansion I found the follwing: $$
(\ln\sin x)^2=\ln^2 2-\left (x-\frac{\pi}{2}\right )^2 + \left (x-\frac{\pi}{2}\right )\sin x-2\ln2\cos x+\sum_{k=2}^{\infty}2\left (\frac{(k-2)!}{k!}-\frac{\ln2}{k}\right )\cos2kx+\left (x-\frac{\pi}{2}\right )\frac{\sin2kx}{k}
$$
If you like it I will give you details to find it (and, with a strong effort, also the formulation for any power).


text:
Q: Count all numbers in php string How can I count all numbers in string to get their sum?
Example string:
G12103108 : 0.00 Troy oz. | U20072491 : 12.10 USD | U27811285 : 0.55 USD | U41125827 : 0.00 USD | U47329193 : 0.00 USD | E30010787 : 10.01 EUR

How can I get the result?
22.66

I tried
count(array_filter(str_split($str),'is_numeric'));

with no luck

A: This should work for you:
(Here i simply use preg_match_all() to get all float numbers after :. And after that i count all values together with array_sum())
<?php

    $str = "G12103108 : 0.00 Troy oz. | U20072491 : 12.10 USD | U27811285 : 0.55 USD | U41125827 : 0.00 USD | U47329193 : 0.00 USD | E30010787 : 10.01 EUR";
    preg_match_all('!:\s(\d+\.*\d*)!', $str, $matches);
    echo array_sum($matches[1]);

?>

Output:
22.66


text:
Q: ip not rejected - iptables I was trying to reject a specific IP from connecting to my web server, so I used the following command:
# iptables -A INPUT -s 65.55.44.100 -j DROP
# service iptables save

After killing all httpd processes and restarting httpd, the IP is still showing up in netstat in the follwing format:
::ffff:65.55.44.100:port

Shouldn't the new iptable rule deny this IP from connecting?

A: That is IPv6 and it is managed via ip6tables.
ip6tables -A INPUT -s ::ffff:65.55.44.100 -j DROP


text:
Q: Qt QSqlDatabase after searching all day, I could not find answer to my question. My question is:
Why ODBC driver returns second value, not first, code was taken from
https://wiki.qt.io/Handling_Microsoft_Excel_file_format
In while LOOP at first step I see value of two, however in excel I have 1. Why?
Any help appreciated
The code is:
srcdb.setDatabaseName("DRIVER={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)};DBQ=" + QString(getSettings("folderpath") + '/' + file));
        if(srcdb.open()) {
            QSqlQuery query("SELECT * FROM [" + QString("Sheet1") + "$A1:A3]"); // Select range, place A1:B5 after $
            while (query.next()) {
                QString column = query.value(0).toString();
                qDebug() << column;
            }
        }

A: Found this in the wiki:

By default OBDC uses the first row as names for the columns, you can
  change this whith the 'FirstRowHasNames' option in the connection
  settings. Keep in mind that you are using a database and that each
  column has his own datatype. So if your second row contains text and
  your third row contains numbers, sql wil pick one of these datatypes.
  If a few rows contain text and the rest of them contains floating
  numbers, sql wil make the text appear and will make the numbers
  disappear.

So thats why "2" is shown as first.


text:
Q: Client never receives response from service on kubernetes I have the following configuration:

*

*A kubernetes cluster based on k3s, deployed on a private cloud.

*A service runs on this cluster behind and nginx-based ingress. The service's task is to read a file sent by the client, and upload it to an S3 database.

*I have a client (running on a docker container) that sends https requests to upload files to this service.

For each of those requests, it is expected that the server takes about 2 to 3 minutes to respond.
My problem is that some responses issued by our service don't reach the client (the client timeouts after waiting 15mn), even though the client itself successfully sent its HTTP requests, and the service successfully processed it and responded. In particular I can see from the nginx logs that the response 200 is returned by our service, yet the client does not receive this response.
Here is an example of nginx log from which I deduce our service responded 200:
10.42.0.0 - [10.42.0.0] - - [10/Oct/2019:09:55:12 +0000] \"POST /api/upload/ot_35121G3118C_1.las HTTP/1.1\" 200 0 \"-\" \"reqwest/0.9.20\" 440258210 91.771 [file-upload-service-8000] [] 10.42.0.6:8000 0 15.368 200 583d70db408b6be596f5012e7893a3c3\n

For example, I tried to let the client perform requests continuously during 24h (waiting for the sever to respond before issuing a new request), and about one or two requests per hours have this problem while the 18 others behave as expected.
Because nginx tells me a 200 response was returned by our service, it feels like the response was lost somewhere between the nginx ingress and the client. Any idea about what causes this problem? Is there a way for me to debug this?
EDIT:
To clarify, the exact ingress controller I'm using is nginx-ingress ingress controller, deployed with helm.
Also, the failure rate is completely random. The tendency is 1 or 2 per hour, but it can sometimes be more or less. In addition it does not seem to be correlated to the size of the file to upload nor to the number of requests that succeeded so far.


text:
Q: How delete image files after unit test finished? In unit test I create 3 objects (articles) at the beginning. After test complete I notice that there are 3 images in media_root folder.
Question: How to delete that images which was created after test finished?
P.S. I tried to use next code but it delete media_root folder.
def tearDown(self):
        rmtree(settings.MEDIA_ROOT, ignore_errors=True)

NOTE: Problems in methods test_article_form_valid and test_article_crud.
tests.py:
class ArticleTestCase(TestCase):
    def setUp(self):
        self.image = open(os.path.join(BASE_DIR, 'static/images/tests/image.jpg'), "r")

    def test_article_form_valid(self):
        data = {
            'head': 'TEXT',
        }
        files_data = {
            'image': SimpleUploadedFile(
                name=self.image.name,
                content=self.image.read(),
                content_type='image/jpeg'
            )
        }
        form = ArticleForm(data=data, files=files_data)
        self.assertTrue(form.is_valid())  <-- ERROR

    def test_article_crud(self):
        response = self.client.get(reverse("article:article_create"))
        self.assertEquals(response.status_code, 200)
        response = self.client.post(
            reverse("article:article_create"),
            data={
                'head': 'TEST',
                'image': self.image
            },
            follow=True,
            format='multipart'
        )
        self.assertEqual(response.status_code, 200)
        self.assertEqual(Article.objects.all().count(), 1) <-- ERROR

    def test_article_view(self):
        first_article = Article.objects.create(
            pk=150,
            head='First',
            image=SimpleUploadedFile(
                name=self.image.name,
                content=self.image.read(),
                content_type='image/jpeg'
            )
        )

        second_article = Article.objects.create(
            pk=160,
            head='Second',
            image=SimpleUploadedFile(
                name=self.image.name,
                content=self.image.read(),
                content_type='image/jpeg'
            )
        )

        third_article = Article.objects.create(
            pk=170,
            head='Third',
            image=SimpleUploadedFile(
                name=self.image.name,
                content=self.image.read(),
                content_type='image/jpeg'
            )
        )
        [***]

ERROR:
FAIL: test_article_crud (article.tests.ArticleTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/nurzhan/CA/article/tests.py", line 55, in test_article_crud
    self.assertEqual(Article.objects.all().count(), 1)
AssertionError: 0 != 1

======================================================================
FAIL: test_article_form_valid (article.tests.ArticleTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/nurzhan/CA/article/tests.py", line 117, in test_article_form_valid
    self.assertTrue(form.is_valid())
AssertionError: False is not true

A: I found this article and it worked to me
import shutil, tempfile
from django.test import TestCase, override_settings

MEDIA_ROOT = tempfile.mkdtemp()

@override_settings(MEDIA_ROOT=MEDIA_ROOT)
class MeuPetTest(TestCase):
    @classmethod
    def tearDownClass(cls):
        shutil.rmtree(MEDIA_ROOT, ignore_errors=True)
        super().tearDownClass()

A: I believe the best solution is to create a directory that will contain a '/media' folder, this directory can then be deleted in the tearDown function.
Based on this article, I tried the solution and it worked perfectly. You won't even notice the creation and deletion of the test directory and the files created in your tests won't be in your default media location.
from django.test import override_settings
import shutil

TEST_DIR = 'test_data'

class SomeTests(TestCase):
    ...

    # use the `override_settings` decorator on
    # those methods where you're uploading images

    @override_settings(MEDIA_ROOT=(TEST_DIR + '/media'))
    def test_file_upload(self):
        ...
        # your code
        ...

...

# then create a tearDownModule function
# to remove the `TEST_DIR` folder at the
# end of tests

def tearDownModule():
    print "\nDeleting temporary files...\n"
    try:
        shutil.rmtree(TEST_DIR)
    except OSError:
        pass

If you want to implement this solution in DRF, your code should look like this:
from django.test import override_settings
import shutil
from rest_framework.test import APITestCase

TEST_DIR = 'test_data'

class SomeTest(APITestCase):
    ...

    # use the `override_settings` decorator on
    # those methods where you're uploading images

    # do this if any logic exists to create files
    # in your setUp
    @override_settings(MEDIA_ROOT=(TEST_DIR + '/media'))
    def setUp(self):
        ...
        # your code
        ...

    @override_settings(MEDIA_ROOT=(TEST_DIR + '/media'))
    def test_file_upload(self):
        ...
        # your code
        ...

    def tearDown(self):
        print "\nDeleting temporary files...\n"
        try:
            shutil.rmtree(TEST_DIR)
        except OSError:
            pass

A: Use tempfile module in python, use it as settings.MEDIA_ROOT in the TestCase setUp() method,
from django.conf import settings
import tempfile

def setUp(self):
    settings.MEDIA_ROOT = tempfile.mkdtemp()

Then, the files created in the test will be automatically removed when the test is finished.
UPDATE:
Then, the files created in the test will not be automatically removed when the test is finished, so do not forget to delete the temporary directory after finishing the test.

A: For me best solution was to write a function which delete images and add it into test class tearDown method.
def delete_test_image():
    images_path = os.path.join(PROJECT_PATH, 'media/images')
    files = [i for i in os.listdir(images_path)
             if os.path.isfile(os.path.join(images_path, i))
             and i.startswith('test_image_')]

    for file in files:
        os.remove(os.path.join(images_path, file))


text:
Q: Node js - error state of a callback in a loop I am using node js to send push notifications to Android devices using GCM and want to delete the device id if I get an error message from Google. The code snippet is attached and runs in a loop (i is number of device ids).
My issue is that if the call returns an error (err4), all future loops return if(err4) as true and all the ids after the first error are deleted. Why is the err4 not getting reset?
for(var i = 0; i < noofdeviceIds; i++){

// some more code here to create the 'message'.

(function(i) {
  gcm.send(message, function(err4, messageId){
    if (err4) {
    console.log("\nError occured: Notification could not be sent with error: ", err4);//
    if(err4 == 'NotRegistered' || err4 == 'InvalidRegistration'){
       console.log("\nRemoving the entry from the DB.");
        var removeEntryQuery = "DELETE FROM devicereg WHERE deviceregId = '" + deviceregIds[i] + "'";
    req._dbConnection.query(removeEntryQuery, function(err5, row) {
        if(row!=0){console.log("\nDB returned: ", row);}
      });
    }
  }
else {
    console.log("\nMessage sent with message ID: ", messageId);
      }
});
})(i);
}


text:
Q: Creating a database in flask sqlalchemy I'm building a Flask app with Flask-SQLAlchemy and I'm trying to write a script that will create a Sqlite3 database without running the main application. In order to avoid circular references, I've initialized the main Flask app object and the SQLAlchemy database object in separate modules. I then import and combine them in a third file when running the app. This works fine when I'm running the app, as the database is built and operates properly when create rows and query them. However, when I try to import them in another module, I get the following error:
RuntimeError: application not registered on db instance and no applicationbound to current context

My code looks like the following:
root/create_database.py
from application.database import db
from application.server import app

db.init_app(app)

db.create_all()

root/run.sh
export FLASK_APP=application/server.py
flask run

root/application/init.py
from database import db
from server import app

db.init_app(app)

from routes import apply_routes
apply_routes(app)

root/application/database.py
from flask_sqlalchemy import SQLAlchemy
db = SQLAlchemy()

root/application/server.py
from flask import Flask
import os
app = Flask(__name__)

path = os.path.dirname( os.path.realpath(__file__) )
database_path = os.path.join(path, '../mydb.sqlite')

app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///' + database_path

root/application/models/init.py
from user import User

root/application/models/user.py
from application.database import db

class User(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    username = db.Column(db.String(80), unique=True)
    password = db.Column(db.String(120))

    def __init__(self, username, password):
        self.username = username
        self.password = password

In my create_database.py script I'm trying to make sure that the SQLAlchemy db instance is configured with the config details from the app object, but it doesn't seem to be connecting for some reason. Am I missing something important here?

A: You either have to create a request or you have to create the models with sqlalchemy directly. We do something similar at work and chose the former.
Flask lets you create a test request to initialize an app. Try something like
from application.database import db
from application.server import app

with app.test_request_context():
     db.init_app(app)

     db.create_all()


text:
Q: hide unwanted element from list of elements using jquery I have a list of div just like this:

ALL WORKS

Residential

Commercial

1

2

3

4

5

There are 3 menus: ALL WORKS, Residential, Commercial. If I click Residential, all "portfolio-item" beside "portfolio-cat-1" will be hidden. The same goes for Commercial, all div "portfolio-item" beside "portfolio-cat-2" will be hidden.
I use .not() for this. Here is my jquery code:
$(".portfolio-categories a").click(function(e){
    e.preventDefault();

    var id=$(this).attr("id").split("-")[1];

    $(".portfolio-item").not(".portfolio-cat-"+id).fadeOut(400, function(){
        alert("done");
    });
});

The problem is, when I click Residential (cat-1) all portfolio-cat-1 div are hidden instead of portfolio-cat-2. What went wrong? Is it not .not() that I should use?
Any help would be appreciated.

A:

$(".portfolio-categories a").click(function(e){
    e.preventDefault();

    var id=$(this).attr("id").split("-")[1];
    console.log(id)
    $(".portfolio-item:not(.portfolio-cat-"+id+")").fadeOut(400, function(){
        console.log("done");
    });
});

ALL WORKS

Residential

Commercial

1

2

3

4

5

Try using the selector :not()

A: $(".portfolio-item").fadeIn(400).not(".portfolio-cat-"+id).fadeOut(400);

You need to bring back the previously hidden elements using fadeIn
Try the above line


text:
Q: Rails undefined method in datables.rb I am following the Railscast on remote data for DataTables.  To make it work, you create a datatable.rb
I'm trying to define a select that is used in 3 places in the datatable.rb
This is the code:
class Workorders3Datatable

delegate :params, :h, :link_to, :number_to_currency, to: :@view

def initialize(view)
  @view = view
end

def mygroupsopenwos(user)
  select("workorders.*").joins("left outer join empgroups ON empgroups.workgroup_id=workorders.workgroup_id").where("empgroups.employee_id = ?", user).where("wostatus_id NOT IN (?)", [231, 230, 9263, 9264, 232] )
end

def as_json(options = {})
  {
      sEcho: params[:sEcho].to_i,
      iTotalRecords: workorders.mygroupsopenwos(current_user).count,
      iTotalDisplayRecords: workorders.mygroupsopenwos(current_user).total_entries,,
      aaData: data
  }
end

private

def data
  workorders.mygroupsopenwos(current_user).map do |workorder|
    [
...

But, I get the following error:
NoMethodError - undefined method `mygroupsopenwos' for #<ActiveRecord::Relation:0x007f9b046ccb08>:

How do I define mygroupsopenwos so I can use it?  Should I put it in the controller?

A: remove the workorders. before workorders.mygroupsopenwos(current_user)
mygroupsopenwos is an instance method declared a few lines up!


text:
Q: DrawingML insert/paste drawing into a Word document I am a complete beginner with DrawingML. I am trying to figure out if I can define a shape using the language, save it in some format and import it directly into a drawing canvas inside a Word document.
The motivation behind this is to enable users save an on-line generated graph as a file and import it into a canvas inside a Word document. The graph nodes should be connected so that when a node is dragged it will also mode the connector. My understanding is that it is possible to create such drawings using DrawingML but am not sure how to import such drawing into a document.

A: You can create a Flat OPC XML file containing your DrawingML.
Then you add it to your docx open in Word.  You can do that using VBA (a macro), or VSTO (a Word Add-In).
For more on Flat OPC XML, see http://blogs.msdn.com/b/ericwhite/archive/2008/09/29/the-flat-opc-format.aspx
You can add the Flat OPC XML using Range.InsertXml.  See also Can I use VSTO instead of Open XML to manipulate altChunk features?
VSTO is a .NET thing.  Generally you'd code in C# or VB.NET.  You can use Microsoft's Open XML SDK as necessary.  So Java doesn't usually have a role.  Having said that, I do know of companies that are committed to Java server side and using docx4j there, and want to use the same technology client side, and so use docx4j IKVM'd as a DLL.  In this context, that could be how you create your DrawingML (ie using JAXB), then produce the Flat OPC XML.


text:
Q: Angular Performance: DOM Event causes unnecessary function calls I have a simple page with an input element that has a DOM event (input). The HTML page also calls a function that just outputs something via console.log. Now when I open the page, it will show the log, but when I type something into the input field, it will also trigger the function EVERY time I type something.. (Actually, when I type a letter, it will console.logs TWICE every time)
Why does this happen? How to prevent it? I read some things about changeDetection, but is there another solution?
HTML:
{{test()}}

<input class="input-msg" [value]="textValue" (input)="textValue = $event.target.value;">

.ts:
export class TestComponent implements OnInit {

  constructor() {
  }

  test() {
    console.log('test message');
  }
}

Expected Behavior:
The {{test()}} should not be called when typing something into the input field

A: Since you're calling a function in one of the data-binding syntaxes, whenever Angular performs Change Detection, it will call this method.
Before for a function, anything that cases is the value that it returns. And for Angular to know that the returned value has changed, Angular will have to run it.
This is the exact same issue that people have raised a several questions here:

*

*Angular: Prevent DomSanizer from updating on DOM Events

*Angular performance: ngStyle recalculates on each click on random input

*Angular 7 ,Reactive Form slow response when has large data
You might want to read through these threads to understand what's going on here and how you can fix this issue.

The solution is to basically design your implementation in such a way, that it never calls a method in one of the data-binding syntaxes, i.e.

*

*In String Interpolation - {{ methodCall() }}

*In Property Binding - [propertyName]="methodCall()"

*In Attribute Binding - [class.className]="methodCall()" / [style.style-name]="methodCall()"
An alternative solution is do move this code to a Child Component and configure the changeDetectionStrategy on that child component to ChangeDetectionStrategy.OnPush


text:
Q: How to deploy bpel project on ODE server My BPEL project working fine in my local . But i need to deploying that project on my server how can i export BPEL project war file or something else ??

A: Finally Found it.
Hope it helps.

*

*Zip the files in below structure.
So suppose you have BPELDemo.bpel BPELDemowsdl.wsdl deploy.xml
The BPELDemo.zip should Directly content these files.
NO other Fodler Structure.

*then go to localhost:8080/ode/index.hmtl. go to deployment tab.

Select the ZIP file, and Give name as BPELDemo and Click OK.
This will dpeloy the the BPEL correctly.


text: Q: React navigation.navigate for prop drilling I am creating a form consisting of multiple screens that will require adding data to an object. This object is to be submitted at the end of the form. There are of course multiple ways for prop drilling to the final page. One method is to use the UseContext hook, but would it also be legitimate to use navigation.navigate(route, {params}) for prop drilling? I found this a much easier way to do the task without writing much extra code.


text:
Q: Speechless mathematical proofs.
Do you have proofs without word?

Your proofs are not necessary has zero word, you may add a bit explanations.
As an example, I has a "Speechless proof" for
$$\frac{1}{4}+\frac{1}{4^2}+\frac{1}{4^3}+...=\frac{1}{3}$$

I welcome all aspects of mathematical proofs. Thank you.

A: The best one I have ever seen is to prove $$1 + 2 + 3 + \cdots + n = \dfrac{n(n+1)}2$$

A: Found this great one surfing the web recently.
$$
\displaystyle \huge \frac12+\frac14+\frac18+\frac1{16}+\frac1{32}+\ldots =1
$$

A:
Reciprocals of squares converge.

A: Part of the proof in my blog post is done with my own ad-hoc diagrams..

The question is: How many "tours" (paths that visit every single square exactly once) are there in a 4x10^12 grid under the condition the tour must start in the top left square and finish in the bottom left square. (Credit to the guys at projecteuler.net for thinking up another great problem)
If we let T(n) be the formula for the number of tours in a 4xn grid, we need to find T(10^12). One approach is to find a recurrence relation. A trick is to realize there are only two possible ending columns. Try follow my working if you can, sorry It's messy :)

A: Here's one showing the area of a disk is $\pi R^2$.


text:
Q: One PS+ Plus account on primary ps4 allow multiplayer on Call of Duty to all local accounts? Myself and three brothers share one PS4. We have an account with ps+ subscritpion we all share. I was wondering if we made two more local accounts if each of those accounts would be able to play Black Ops 3 multiplayer under seperate online psn accounts when it comes out? The PS4 account is activated as out primary ps4.

A: You can make two more PSN accounts and then make them as sub accounts under Settings > Parental Controls > Sub Account Management in the account that has PS+


text:
Q: Access EnvDTE from msbuild code when building in Visual Studio When I do a build from Visual Studio, on post-build I execute a PowerShell script from MSBuild using the PowerShell MSBuild Task (http://powershellmsbuild.codeplex.com/). In this PowerShell code I would like to add/modify items to my project using Visual Studio automation (through the EnvDTE object).
The exact case is:
For each X.asmx file in my project I need to add Xwsdl.aspx and Xdisco.aspx file that don't need compilation. I only want to do this if these files are not generated yet, or if the asmx file is newer than the current Xwsdl.aspx and Xdisco.aspx files. In case you wonder why I need these additional files: it's a SharePoint thing.
Addition:
Just added the following PowerShell code in the executed script:
$process = [System.Diagnostics.Process]::GetCurrentProcess()
Write-Host "Process name: $($a.ProcessName)"
Which returns:
Process name: devenv
Which means that msbuild is executed in the context of the Visual Studio process.


text:
Q: Confusion about a proof of Jordan Holder theorem

This proof is in Aluffi's algebra chapter $0$.
Why the composition series of $K$ exist? I can't see it.Thanks for your help in advance.

A: Hint:  If $G$ has a composition series and $K \unlhd G$ is normal, then $K$ has a composition series (whose length is no greater than that of the given composition series of $G$).   To see this, consider the series obtained by intersecting $K$ with the given composition series for $G$.  This is not necessarily a composition series, but it is close.


text:
Q: How to deploy PhoneGap App to Android TABLET Market? I built a phonegap app that is simply an launcher to a website.  You download the app, click on it, and it will open up your web browser at a specific url.
People with android phones see this app in the Google Play market.  People with Samsung Galaxy Tab do not see this app in the Google Play Market.  How do I make this app accessible to people with Galaxy Tab?

A: As I commented, AndroidManifest file of your app does supply information like required screen size for the app, minimum DPI, etc. You may need to set those values to match screensizes of Tablets, and then it'll show up in Play Store for tablets as well.
For more info, you may wanna look at this and this.


text:
Q: Running service application response HTTP Status 404 I deploy https://blogs.sap.com/2017/09/15/library-manager-for-sap-web-ide/ on the sap hana cloud platform and I can see, that the application is running:

When I click on the application URL it says HTTP Status 404.
What am I doing wrong?

A: I found the answer in an SAP UI5 course page and verified it with my application. It mentions that the application URL shown in the cockpit is only the root URL. You need to append an relative path to it. To see your relative path, you can run the application from Web IDE, and then copy the path from the slash after the host name. For example, if the Web IDE test URL is https://webidetesting-trial.dispatcher.hanatrial.ondemand.com/webapp/test/flpSandbox.html#ManageProducts-display, copy the "webapp/test/flpSandbox.html#ManageProducts-display" part and paste it after the application URL.


text:
Q: Toggling table cell background between Block and None I'm using style.display = "none" to hide a table cell but when I then use style.display = "block" to reveal it again it has a transparent background whereas before I hide it it has a solid background. How can I unhide a cell such that the background remains solid?
(In the image below when I float over the other 'menu' items the light-blue highlight covers the whole cell, but on Cut, Copy & Paste it only highlights the words)

HTML:

       Attach photos

       Insert a sentence

       Clear

       Save changes

       Cut

       Copy

       Paste

JavaScript:
// Show all menu items...
document.getElementById("menuPhrase").style.display = "block";
document.getElementById("menuCut").style.display = "block";
document.getElementById("menuCopy").style.display = "block";
document.getElementById("menuPaste").style.display = "block";
if (fieldType=="droplist") {
 // Hide Phrase, Cut, Copy, Paste...
 document.getElementById("menuPhrase").style.display = "none";
 document.getElementById("menuCut").style.display = "none";
 document.getElementById("menuCopy").style.display = "none";
 document.getElementById("menuPaste").style.display = "none";
}

CSS:
td.popupitem {
 padding-top: 4px;
 padding-bottom: 4px;
 padding-left: 4px;
 padding-right: 10px;
 cursor: pointer;
 background-color: white;
}

A: try style.display = "table-cell" instead of block (I'm assuming you initially didn't change the default display value for td, which is table-cell)

A: try the following on that cell:
 border:0px;


text:
Q: Get only rows where all required types are met We have the following structure in our datadase:

*

*An area can have one or more ticket_types.

*A ticket_type can have one or more required license_types.

*A user can have one or more licenses.

*A license has one license_type.

Now we want to get only areas where the user has all the required licenses.
For example:
**required_license_types:**
ticket_type_id: 1 | licenses_type_id: 1
ticket_type_id: 1 | licenses_type_id: 2

**licenses**
user_id: 1 | license_type_id: 1
user_id: 1 | license_type_id: 3
user_id: 1 | license_type_id: 4

We were thinking about a LEFT JOIN, but then we will get also rows with NULL, which MIN cant process.
What would also work, would be todo this in a scheduled job and save it to another table, then we would lack of actuality, but performance would be better.
Any ideas how to solve this?
thanks in advance!

A: As far as the database is concerned, you have 2 problems (queries):
First you need to find all the areas the user has a license in
Then you need to find all the licenses the area requires
Depending on the existence of duplicates, you could do it by counting the number of results for each query, but I would run them separately and then make the small number of comparisons in the program your dispatched the SQL query from.
To not return rows that have NULL fields you want an INNER JOIN
i.e.
SELECT * from licenses AS l WHERE u.id = '<the user>'
INNER JOIN required_license_types AS rlt ON rlt.license_type_id = l.license_type_id
INNER JOIN ticket_types AS tt ON a.id = tt.area_id
INNER JOIN users AS u ON l.user_id = u.id

and
SELECT * from required_license_types AS rlt WHERE a.id = '<the area>'
INNER JOIN ticket_types AS tt ON tt.id = rtl.ticket_type_id
INNER JOIN areas AS a ON tt.area_id = a.id

A: Per MySQL documentation - Left Join and Right Join Optimization--

If there is a row in A that matches the WHERE clause, but there is no row in B that matches the ON condition, an extra B row is generated with all columns set to NULL.

So yes, you may get NULL rows, given the ON condition is not met. As such, I would recommend using INNER JOIN


text:
Q: Equivalent output of PowerShell's get-date, but using bash This is a small piece of a larger script which in PowerShell returns the current date of a specified region, in that language.  According to my own use it's in the format:  "22 December 2022"
Example of a PowerShell script which uses get-time and CultureInfo to return the date in Albanian is:
#   Print todays date with full month in Albanian
$today = get-date -format "dd MM yyyy"
$day = get-date -Date "$today"
$culture = [CultureInfo]'sq-al'
$day.ToString('%d MMMM yyyy', $culture)
$albanian = "$($day.ToString('%d MMMM yyyy', $culture))"

This would return

22 dhjetor 2022

I am interested in finding out if this is possible using just bash?


text:
Q: Unittest for a PCL - LINQ method fails We like to use TTD and with Xamarin we use NUnit for that. In our project we have a PCL and a monodroid/montouch project. We have also iOS and Android integrationtest-projects (with NUnit but with the special testrunner).
My problem is that real unittests (the fast ones executed NOT in the simulator) we use for TTD don't work with the PCL (and there it's most important) as soon as we use LINQ-extension-methods like for example
Enumerable.Any()

The exception we get is always:
could not load file or assembly system.core 2.0.5.0

If we don't use linq methods, everything works fine... Maybe as info: in the integrationtest-projects we can execute this tests without problem, with our without LINQ extensions.
The PCL looks like that:
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<RootNamespace>XYLib</RootNamespace>
<AssemblyName>XYLib</AssemblyName>
<TargetFrameworkProfile>Profile136</TargetFrameworkProfile>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>

And the unittest-project is a Xamarin-Studio "NUnit Library Project" (we also tried a lot of other project-types without success).
I spent a lot of time for googling this problem. According to this post, it should work this way: How to run unit tests for Xamarin library projects (iOS and Android)?
Can anybody help me with this? Or is it not possible?

A: Do the unit tests fail when you use LINQ extensions in the unit test code or in the PCL code that's being called by the unit tests?
If you're returning a deferred LINQ query from the PCL and then applying a LINQ extension from what could effectively be a different version of LINQ, I could see where there might be trouble. In which case, try using .ToList() to force the query to execute before you apply your unit test-specific LINQ code.


text:
Q: Install another helm chart, for each value in a parent helm chart I have a helm chartX :-
values.yaml:
someList : a,b,c
templates:

*

*deployServiceA.yaml

Now, I want to install another helm chartY, for each entry in the someList.
example, if someList has a,b and c, I want to install a helm chart Y, in namespace fx-a, fx-b and fx-c
how can I achieve this using helm charts?
How can


text:
Q: Best freeware defect tracking software for Windows? I'm looking for a freeware defect tracking solution. I have experience with Mercury Quality Center, but I hear that comes with a five-digit pricetag. I need something for my personal projects. Webforms (i.e. ASP.NET) would be preferrable. Anything good out there?

A: I don't like BugZilla, it's very powerful but has an horrible user interface. I'd recommend Mantis or Trac. Nothing in ASP.NET in my basket.

A: If its to be used solely by you, you can get a Fogbugz account for free. But it only allows up to 2 users while still being free.
I'm currently using it with a friend for my senior project

A: I am with the Mantis supporters.  We adopted it on our team to migrate off of a very old version of TeamTrack, and we have been very impressed.  However, we were very close to using Trac instead.
And Jira, boy if we were only given the money to buy it, we would have used that in a heartbeat.  Out of all the issue trackers I reviewed, none came CLOSE to the fluidity and flexibility of JIRA while still supporting the basic functionality really well.

A: You can use Bugzilla. It is open source and a lot of projects use it.

A: I really like Mantis.  It's not quite as powerful as Bugzilla, but you can easily get it running and configured how you like it fairly quickly.

A: Jira also has a personal licence available.  It is not asp.net based, but it installs easily enough, and since you aren't going to be developing on it, the technology it is build with should not matter much.
Trac is an option that is free regardless of the number of users.  If you use subversion, Trac has nice integration with it.

A: I'm partial to Eventum by MySQL. Free, lightweight, highly configurable and I've used it in almost all my projects.


text:
Q: How to open twitter bootstrap modal in a PHP query I'm trying to open a modal boostrap in this query. The problem I have is when I click to 'More Info' open all modals of the query, and i want to open only which I clicked. Thanks.
<?php

$consult= "SELECT * FROM `films`";
$result = $conexion -> query($consult);

if ($result) {
    $cont3 = 0; //ID of the film

    while ($nfila = $resultado -> fetch_object()) {
        $film = "film".$cont3; //To make a unique ID to each film

        echo "<form role='form' id='$film'>
                image."'>

".$nfila->title." (".$nfila->year.")
                <button type='button' class='btn btn-default' data-toggle='modal' data-target='.bs-example-modal-lg'>More Info</button>

                                <button tyle='button' class='close' data-dismiss='modal' aria-hidden='true'>×</button>

".$nfila->title."

                                image."'>

Original Title: ".$nfila->tituloOriginal."

Year: ".$nfila->anio."

Country: ".$nfila->pais."

Sinopsis: ".$nfila->sinopsis."

                                <button type='button' class='btn btn-default' data-dismiss='modal'>Cerrar</button>

        ";
        echo "</form>";
        $cont3++;
    }
} else {
     echo "There was a error to load the films";
}

?>

A: That's because you're opening targeting modal with bs-example-modal-lg class. And it's same for all the modals.
What you need to do is give unique class to each modal. To do this assign a class with counter at the end, which will give uniqueness to it.
Update your code like this,
while ($nfila = $resultado->fetch_object()) {
    $film = "film" . $cont3; //To make a unique ID to each film
    echo "<form role='form' id='$film'>
                              image . "'>

" . $nfila->title . " (" . $nfila->year . ")
                              <button type='button' class='btn btn-default' data-toggle='modal' data-target='.customModalClass" . $cont3 . "'>More Info</button>

                            <button tyle='button' class='close' data-dismiss='modal' aria-hidden='true'>×</button>

" . $nfila->title . "

                            image . "'>

Original Title: " . $nfila->tituloOriginal . "

Year: " . $nfila->anio . "

Country: " . $nfila->pais . "

Sinopsis: " . $nfila->sinopsis . "

                            <button type='button' class='btn btn-default' data-dismiss='modal'>Cerrar</button>

";
    echo "</form>";
    $cont3++;
}

In above code we have assigned a customModalClass class to each modal with $cont3 counter at the end to make it unique.

A: You have to pass unique class,
Below is my code it will help you,
<?php
        $consult= "SELECT * FROM `films`";
        $result = $conexion -> query($consult);

    if($result){
        $cont3=0; //ID of the film
        $i=0;
        while($nfila = $resultado -> fetch_object()){
            $film="film".$cont3; //To make a unique ID to each film
            $i++;
            echo "<form role='form' id='$film'>
                  image."'>

".$nfila->title." (".$nfila->year.")
                  <button type='button' class='btn btn-default' data-toggle='modal' data-target='.modal". $i."'>More Info</button>

                <button tyle='button' class='close' data-dismiss='modal' aria-hidden='true'>×</button>

".$nfila->title."

                image."'>

Original Title: ".$nfila->tituloOriginal."

Year: ".$nfila->anio."

Country: ".$nfila->pais."

Sinopsis: ".$nfila->sinopsis."

                <button type='button' class='btn btn-default' data-dismiss='modal'>Cerrar</button>

";

            echo "</form>";
            $cont3++;
        }
        }
         else{
             echo "There was a error to load the films";
        }
      ?>

A: you have a wrong data-target:
<button type='button' class='btn btn-default' data-toggle='modal'   data-target='.bs-example-modal-lg'>More Info</button>

All of your modals have this class, so just do something like:

Once you have an id, change the buttons data-target:
data-target='#modal_$film'

Hope that helps


text:
Q: Is there any way to implement a reverse look-up of the the values in my Flot graph? As the input to my graph, I feed the X and Y values of five points, out of which Flot generates a graph.
For the next step in my program, I want to be able to receive the Y value when I enter an X value. I went through the documentation and did not find anything of substance, I was wondering whether I could get some suggestions as to how to go about doing something like this?

A: Just call flot.getData() That will return all your x/y points, and you can find it in  there
// Pseudo-code, not tested
function getX(flot, x) {
    var data = flot.getData()[0]; // Get the first series
    for (var i = 0; i < data.length; i ++) {
        if (data[0] === x) { // first item is x
            return data[1]; // second item is y
        }
    }
}

I initially thought you wanted to get the point from an x/y coordinate, leaving it here since it could be useful to someone else in the future....
Each flot object has methods called

*

*plot.c2p = canvasToAxisCoords;

*plot.p2c = axisToCanvasCoords;

They are how you can convert from x,y into coordinates and back


text:
Q: Additional Queries in a Crystal Report I have a crystal report that gets its data from one stored procedure, this works fine and I have a nice grouped report with this data, showing information about a particular report,
However, this report also needs to have a number of graphs in the footer. These graphs draw their data from a different table, and so a different stored procedure. If I add this stored procedure to my existing report, I have to link it to the main stored procedure, this data can be linked, as there is a relationship - its about the same account, but the relationship is not really relevant to the report. When I do this I then end up with lots of duplicated data in the main report, the data in the graph is also wrong.
Can anyone explain the way Crystal reports works when there are more than one SQL queries used, and what the best way to accomplish what I need - a report showing both the main data set, and some graphs, which are about the same account, but use different data sets.

A: You need to use subreports for your charts - each individual chart will need to be in a separate subreport linked to its own query/stored procedure.
Crystal displays its data based on a single query.  By joining the result sets from your stored procedures, you are creating, in effect, a new query.  The result of this new query is the reason that your data is duplicating (due to your join).
Each subreport is allowed to have its own query that can be linked to the main report with any number of parameters.  It is the only way to have multiple independent queries appear on a Crystal Report.


text:
Q: My application runs as sudo, how do I make it git pull using my user's credentials? I run my application as sudo but I need it to use a git pull based on the information in ~/.gitconfig and ~/.netrc files my current user has. How do I do this without putting my credentials in the root user account.

A: According to the sudo man page, changing the HOME environment variable may be the default behavior, but it doesn't have to be. If the HOME environment variable is not updated, you can probably just not change anything and it will work. Check the sudoers man page for more information about sudo policies, including updating the HOME environment variable.
This StackOverflow question covers finding a user's home directory programmatically. You could use this approach (obviously not using HOME environment variable approach, if that gets changed by sudo). Note that getuid returns the "real" UID of the calling process, which will be the user you want (geteuid gets the effective UID instead, which in your case would be root). You can then find the user's configuration and credential files, and use them, or possibly just (temporarily or otherwise) edit your process' HOME environment variable before calling git functions.
You could also just have your program take a path to a git configuration and/or credential file as a parameter. Users would need to supply these manually, but you could then pass them down to git in your program.
Important caveat: All of these suggestions operate on the assumption that the user can be trusted (that is, if the user can call sudo, they are allowed to completely take over the system).
If your program uses a custom sudo policy that allows it to be called by untrusted users (or is setuid root itself and executable by untrusted users), then you need to be much more careful. For example, an untrusted user that wanted to access something using another user's git credentials might create a symlink to the target user's configuration / credential file(s), then use your program (or might pass the other user's profile, if you went with the command line argument approach). The best way to mitigate this threat, aside from "don't run your program as root", is to use seteuid(getuid()) to temporarily lower your effective UID to your user's real UID, which means attempting to access other users' files will result in denied access. You can restore the effective UID afterward, if needed.


text:
Q: Why select retain the value previously selected after reload I have a following page where I set default selected item in drop down list. I select a new value from select drop down list .After page refresh that value is selected but not the default selected.I am using Mozilla Firefox.This is not happening in chrome. What is the reason for this behavior in Firefox(version-35.0.1).
I need to know why different things happening in chrome and in firefox.

<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">

<link rel="stylesheet" type="text/css" href="style.css">

<form name="" action="auth.php" method ="post">

Student Name:
<input type="text" name="student_name" required>

Mobile No/Email
<input type="text" name="mobile" required>

Examination:
<select name="exam"id="exam"onchange="myFunction()" required>
                          <option value="hs"selected>HS</option>
                          <option value="cbse">CBSE</option>
                          <option value="icse">ICSE</option>
                          <option value="other">OTHER</option>
            </select>

        <input type="hidden" name="other_exam" id="other_exam">

Board:
<select name="board" onchange="myFunction1()"id="board"required>
                          <option value="WBCHSE" selected>W.B.C.H.S.E</option>
                          <option value="cbse">C.B.S.E</option>
                          <option value="icse">I.C.S.E</option>
                          <option value="other">OTHER</option>
            </select>
        	<input type="hidden" name="other_board" id="other_board">

Roll No
<input type="text" name="roll"required>

Year of Passing
                        <select name="yop"required>
                             <option value="2013"selected>2013</option>
                             <option value="2014">2014</option>
                             <option value="2015">2015</option>
                             </select>

<input type="reset" name="submit" value="Reset">

<input type="submit" name="submit" value="Next">

</form>


text:
Q: how to check if a value inside an array is larger than a certain value alright so my question is probably stupid and I don't even know if it can be done but I have inserted some elements into an array through scanner, and I have put it through a certain calculation . The calculation results are also stored inside another array. what I want to do is to see if these calculated values are larger than 0. I want these calculated values to be printed along side the + or - sign. so what I was thinking is to have 2 sets of printing statements where if the sign value of the calculated amount is >0 it will proceed a print statement where as if it is <0 it will proceed another print statement. But I don't know how to check if a element inside array is larger or smaller than zero.  Spare my explanation I tried my best to not make it hard to understand.
so lets say the user inputs 14. which would then go through the calculation process and store 2 inside the array.[(14-10)/2]. so since this is bigger than zero , i want a print statement to execute in a way that i can get +2 as the answer.
assume the user enters 8. which would go through the calculation process and store -2[(8-10)/2], and since -2 is stored here it is <0 and there for i want a separate statement to get executed.
My issue is i dont know how to check if a element inside an array is 0 or not. there are 5 elements inside the array and i want to check if all of them are above or below zero and print different statements for each.
thank you so much in advance.I am using java btw.
    int[] bonus=new int[6]; // this is used to store the keyboard entries

    if(bonus[]<0) {       //used this to check the condition and if the conditon
    System.out.println(level);
    System.out.println("your str=" + bonus[0]);

   else{System.out.println("your str=+" +bonus[0]);
       }

bonus is the arrayName i have used and 0 is the first slot in which the value entered through keyboard for str is stored after the calculation process.Note:there are few coding prior to that including the array executions which i have not stated hoping this would be enough

A: I managed to get through this using a for loop i and iterating through it i managed to check if they were 0 and/or above .Thank you for those who read and tried to go through this


text:
Q: opening a webpage in lightbox i am using this light box, please guide is it possiable to open the webpage instead of picture .
I have tried with the following approaches  but they didn't  worked
Search google

A: Fancybox Or Thickbox are better option if you want to use iFrame .


text:
Q: Are $\mathbb{R}^1$ and $\mathbb{R}^2$ the same infinity? I've seen a proof that shows that rational numbers are not the same infinity as real numbers.
I'm curious if there is a proof that shows $\mathbb{R}^1$ and $\mathbb{R}^2$ are the same infinity. If so, is there a way to map from one to the other for all points?


text:
Q: I can't use a .xml file that place in drawable folder, for my app's background I want to design an Info Form in my application, but when I'm using of my custom background, app crashed. somebody can help me to resolve it.
This is my .xml codes
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity"
    android:layout_margin="10dp"
    android:gravity="center"
    android:background="@drawable/main_activity_background" >

    <LinearLayout
        android:id="@+id/edittext_layout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal" >

        <EditText
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="7"
            android:hint="User Name"
            android:textAllCaps="false" />
       </LinearLayout>

    <androidx.appcompat.widget.AppCompatButton
        android:layout_width="match_parent"
        android:layout_height="45dp"
        android:text="Submit"
        android:textAllCaps="false"
        android:textSize="17sp"
        android:background="@drawable/button_color"
        android:textColor="@color/white"
        android:layout_marginTop="10dp"
        android:layout_marginRight="5dp"
        android:layout_marginLeft="5dp"
        android:layout_below="@+id/devide_line" />

</RelativeLayout>

And this is codes' of XML file related to drawable
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">

    <item>

        <shape>

            <gradient

                android:endColor="#FAEBD7"
                android:angle="180"
                android:type="radial"/>

            <corners
                android:radius="300dp" />

        </shape>

    </item>

</selector>

A: Wrap your drawable xml code in <layer-list> tag
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">

    <item>

        <shape>

            <gradient

                android:endColor="#FAEBD7"
                android:angle="180"
                android:type="radial"

                />

            <corners

                android:radius="300dp"

                />

        </shape>

    </item>

<layer-list>

A: As you have only one item in drawable xml then you can use directly <shape>tag in drawable file like below code:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
    <gradient
        android:endColor="#FAEBD7"
        android:angle="180"
        android:type="radial"/>
    <corners
        android:radius="300dp" />
</shape>

<layer-list> is a drawable object that manages arrays of other drawable objects in the specific order, For example:
<layer-list>
 <item>
  <shape/>
 </item>
 <item>
  <shape/>
 </item>
</layer-list>

For more info regarding drawable resources you can check this link


text:
Q: What is a word for 'the one thing' that you don't want someone to do? It's really hard to explain it, I remember someone using the word and then telling me what it meant about 2 years ago. I think the context that they used it in was in their relationship and their partner didn't want to be constantly asking for them to change, but they had the one thing that they didn't want him to do and it was to be friends with this other girl. I think they used the word like this: 'It was her [...], she didn't want me to be friends with blah blah'. The only way I can really think to explain the word is that I think it is sort of similar to 'one-off' but more specifically being about a specific one off that can't happen, almost like a request. The one thing that you don't want to happen or someone to do. Sorry, this explanation has been really bad. Thanks for your time.

A: It's a dealbreaker:

A term popularized by Liz Lemon from 30 rock which is used to describe the event which led to a breakup with someone or something

A deal breaker is 'the catch' that a particular individual cannot overlook and ultimately outweighs any redeeming quality the individual may possess.
Urban Dictionary

You can see the term used this way in the following articles:

*

*What's Your Deal Breaker in a Relationship?

*The Top 9 Relationship Deal Breakers

A: You could possibly be thinking of the word "verboten," but it doesn't quite fit into your example sentence. It basically means "forbidden."
Definition of verboten
Another option could be "taboo," which seems to have social or religious undertones.
Definition of taboo

A: I believe the term you're looking for is pet-peeve.
This is defined by Merriam-Webster for English language learners as:

something that annoys or bothers a person very much

Hope this is helpful!

A: off the table is a term that means , in my words, that the thing described "non-negotiable by choice and notice"
Note, it is not "a thing" (your title) but a state.  "Which things are off the table?"  would be an important thing to want to know when starting negotiations.
Two parties in a contractual dispute in normal business agreement with many contingencies and mutual responsibilities might need to be renegotiated and responsibilities reassigned.  In an office space lease there might be issues with signage and parking spaces and lease expiration and share of common area maintenance and representations about noise or if a promise was made to re-landscape the exterior or who was responsible for air-conditioning.
If the contract was being renegotiated, the tenant might say "the building signage is 'off the table' " to mean "it's a complete waste of time to bring that up, we'll move before we give in on that" etc.
'dealbreaker' (another answer) might be the thing..
.. but "take it off the table" is the act , and 'off the table' is the state of that thing.


text:
Q: YouTube, Content ID; Is there a way to check if some content is under copyright? I have a live stream that I set up and monitor through YouTube APIs,
It has happened to me that I get the following warning:
We've detected copyrighted audio in your stream. Your stream may be temporarily blocked.
Is there a way to check this beforehand, with an API or something, so that I could prevent this content from being streame, before it reaches YouTube?
Note: I know the pedantic answer to this would be: all content is under copyright. But please note that many content owners allow their media to be used as long as they can monetize from it (that's pretty much the spirit of Content ID). Some others don't allow it and that's when you may get a copyright notice.


text:
Q: Installing conda packages when not being logged in to my organizational network fails when using corporate's ssl-certificate In order to be able to install conda and pip packages from within my organizational network I configured conda to use my corporate's .pem file using:
conda config --set ssl_verify <pathToMyFile>.pem
Everything works fine with downloading and installing packages but as soon as I am not logged in to the network (e.g. because I am working from home) I can't install any packages anymore. It seems that I have to be logged in to my corporate's network when using the respective .pem file.
Specifically I am getting the following error:
Collecting package metadata (repodata.json): failed

CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://conda.anaconda.org/conda-forge/linux-64/repodata.json>

This problem has already been discussed here where user @payala summed up the problem in the comment section:

Yes, but then this will only work while you are within your
organization's network. If you are using a notebook and you exit the
network, it will not work. What can be done that supports adding this
certificate in addition to the ones already used by conda? –  payala

One solution would be to follow the suggestion from user @user6020015 who says:

if you leave your organization's network, you can just comment out
that line in .condarc with a # and uncomment when you return.

However, this seems very tedious to me, because I would have to comment and uncomment this line of code several times per week. Is there a solution to solve this?

A: I'd probably add some shorthand commands to the shell (e.g., ~/.bashrc), like...
function conda_work() {
  conda config --set ssl_verify <pathToMyFile>.pem
}

function conda_play() {
  conda config --remove-key ssl_verify
}

to quickly toggle the setting.


text:
Q: Can I change the cursor and/or background color of my JQGrid while "Loading" message is present? When my jqgrid is "Loading" (initially, after a column sort, or when the user clicks the refresh button) can I change the cursor or the background color of the grid? The user can see the "Loading" message, but sometimes the message is too far down the grid to be very visible.
Thanks for your help. I am fully willing to read up on this if you point me to the correct resources.

A: You can use the option
loadui: "block"

which will show the overlay having classes "ui-widget-overlay" and "jqgrid-overlay" over the whole grid. It will display the overlay additionally to the text "Loading..." (the text are defined in $.jgrid.defaults.loadtext). The background of the overlay are defined in jQuery UI style which you use. So the users will clearly see the notification about the loading and all controls of the grid will be blocked during the loading. If you want to customize the background of the overlay you can do this in the Themeroller (see the part "Screen for Overlays").
I recommend you additionally to read the answer which shows how to change the position of the "Loading..." text to the visible part of the screen.

A: Yes you can. Just override the style:
.ui-jqgrid .loading { cursor: wait; }


text:
Q: Game increases node count drastically and freezes I have created two nodes, a projectile node and a target node, each with their respective categories and when they both contact each other, both are removed and depending on the projectile, even more projectiles appear.
The projectiles also are removed when they touch the edge of the screen.
Everything works fine until after a "wave" of targets (I created a method to occasionally spawn 5 targets in a set design) appear and scroll across the screen and projectiles are all over the place contacting more and more targets, now I would understand the node count increasing, but the amount is no where near the amount, the game then lags to the point of the FPS being 2 FPS and the game eventually freezing and the node count stuck to 700.
didBeginContact Method
static inline Enemies *nodeFromBody(SKPhysicsBody *body1, SKPhysicsBody *body2, uint32_t category) {
Enemies *node = nil;
if (body1.categoryBitMask & category) {
    node = (Enemies *)body1.node;
}
else if (body2.categoryBitMask & category) {
    node = (Enemies *)body2.node;
}
return node;
}

-(void)didBeginContact:(SKPhysicsContact *)contact {
SKPhysicsBody *firstBody, *secondBody;

SKSpriteNode *projectile = nil;
SKSpriteNode *offScreen = nil;
Enemies *target = nil;

firstBody = contact.bodyA;
secondBody = contact.bodyB;

projectile = nodeFromBody(firstBody, secondBody, projectileCategory);
offScreen = nodeFromBody(firstBody, secondBody, offScreenCategory);
target = nodeFromBody(firstBody, secondBody, targetsCategory);

if (projectile && target) {

    if ([projectile.name isEqualToString:@"firstShot"]) {
        NSLog(@"firstShot");
        [projectile removeAllActions];
        [projectile removeFromParent];
        [ProjectilePatterns pattern1:self spawnPoint:target.position];
        [target removeAllActions];
        [target removeFromParent];
        [Enemies wave1:self spawnPoint:CGPointMake(CGRectGetMidX(self.frame) - 525, CGRectGetMidY(self.frame) - 50)];
    }
}

enemyClassMethod
// These are the regular targets, the other method that spawns the wave is essentially creating new enemies and returns them positioned in certain positions.

+(Enemies *)wave1:(SKScene *)scene spawnPoint:(CGPoint)location {

SKAction *delay = [SKAction waitForDuration:5];
SKAction *remove = [SKAction removeFromParent];
SKAction *delayAndRemove = [SKAction sequence:@[delay, remove]];

Enemies *enemy1 = [[Enemies alloc] init];
enemy1 = [Enemies spriteNodeWithColor:[SKColor blackColor] size:CGSizeMake(30, 30)];
enemy1.position = location;
enemy1.physicsBody = [SKPhysicsBody bodyWithRectangleOfSize:enemy1.size];
enemy1.physicsBody.categoryBitMask = targetsCategory;
enemy1.physicsBody.contactTestBitMask = projectileCategory;
enemy1.physicsBody.collisionBitMask = 0;

[scene addChild:enemy1];
[enemy1 runAction:delayAndRemove];
[enemy1.physicsBody applyImpulse:CGVectorMake(12, 0)];

return enemy1;
}

Projectile Pattern
+(ProjectilePatterns *)pattern1:(SKScene *)scene spawnPoint:(CGPoint)location {

SKAction *rotate = [SKAction rotateByAngle:1 duration:0.1];
SKAction *rotateForever = [SKAction repeatActionForever:rotate];

ProjectilePatterns *patternBomb = [[ProjectilePatterns alloc] init];
patternBomb = [ProjectilePatterns spriteNodeWithImageNamed:@"contactBomb"];
patternBomb.position = CGPointMake(location.x + 10, location.y);
patternBomb.physicsBody = [SKPhysicsBody bodyWithRectangleOfSize:patternBomb.size];
patternBomb.physicsBody.categoryBitMask = projectileCategory;
patternBomb.physicsBody.contactTestBitMask = targetsCategory | offScreenCategory;
patternBomb.physicsBody.collisionBitMask = 0;
patternBomb.physicsBody.friction = 0;
patternBomb.physicsBody.linearDamping = 0;
patternBomb.name = @"p1";

ProjectilePatterns *patternBomb2 = [[ProjectilePatterns alloc] init];
patternBomb2 = [ProjectilePatterns spriteNodeWithImageNamed:@"contactBomb"];
patternBomb2.position = CGPointMake(location.x - 10, location.y);
patternBomb2.physicsBody = [SKPhysicsBody bodyWithRectangleOfSize:patternBomb2.size];
patternBomb2.physicsBody.categoryBitMask = projectileCategory;
patternBomb2.physicsBody.contactTestBitMask = targetsCategory | offScreenCategory;
patternBomb2.physicsBody.collisionBitMask = 0;
patternBomb2.physicsBody.friction = 0;
patternBomb2.physicsBody.linearDamping = 0;
patternBomb2.name = @"p1";

[scene addChild:patternBomb];
[patternBomb runAction:rotateForever];
[patternBomb.physicsBody applyImpulse:CGVectorMake(5, 0)];

[scene addChild:patternBomb2];
[patternBomb2 runAction:rotateForever];
[patternBomb2.physicsBody applyImpulse:CGVectorMake(-5, 0)];

return patternBomb;
return patternBomb2;
}

I should also note that the scene's physicsWorld gravity is (0,0). I did this so the impulses movement would be constant.


text:
Q: Is 2 times Manhattan distance still an admissible in N puzzle searching problem using A star? I know Manhattan distance is an admissible heuristic function since it doesn't overestimate the cost of moving a tile to the correct location. But my question is
If I double h, say scale up each of the Manhattan distances by a factor of 2, or the factor of the corresponding tile value (e.g., h'=9*h if we are moving tile 9, 2*h if we move 2).
Is it still admissible? My feeling is it's not since it overestimate the true cost. So for this specific problem, is Manhattan distance the most dominant heuristic function possible?
taking this as an example, starting with
1 2 3
4 5 6
7 0 8

we want
1 2 3
4 5 6
7 8 0

Apparently we only need one move (swap 0 and 8) and guaranteed to find a solution, so admissible or non admissible at this point doesn't matter. But in general, does 2*MD an admissible heuristic function? How do we justify this?