text:
Q: How do I fix cells in Excel that contain formulas, but are showing as empty cells? I have tried to find this scenario somewhere but haven't been able to find any useful resources.
Essentially, I have performed some work in Excel and upon returning to the file the row sizes were so large the file could not used properly, and the cells were blank. The row sizes was an easy fix, however the blank cells are strange because they still contain text/formulae.
Has anyone seen this issue before, and know how to fix it?
Thanks!!!!
In this image, you can see that the selected sell contains some text
Here, if I double click to edit the cell contents, there seems to be some kind of disconnect between the location of the cell, and where Excel is allowing me to edit the text

A: I think you should start working with "formulatext()" Excel function: if you have a formula, this returns a full string

A: I've seen issues like this in the past and have always first tried the "Text to Columns" Data Tool on the Data Menu.  I have used this when cells are unexpectedly blank, or when my dates are registering as dates or formulas are registering as formulas.  It might help.


text:
Q: Insert new row inside DataGridView In my VB class I have defined this attribute as class variable:
Friend WithEvents dgw As System.Windows.Forms.DataGridView

Somewhere in the same class is defined a property:
Private Sub mySub(...)
    Dim aDataAdapter As SqlDataAdapter
    Dim aDataSet = New DataSet

    aDataAdapter = New SqlDataAdapter("exec something")
    aDataAdapter.Fill(aDataSet)
    Me.dgw.DataSource = aDataSet.Tables(0)

    ' [PLACEHOLDER]
End Sub

This code do its job: data are readed from the database and are inserted inside the grid. Now I would manually add new row inside that grid so I wrote this code in place of [PLACEHOLDER]:
Dim emptyRow As DataGridViewRow
emptyRow.SetValues(New String() {"a", "b", "c", "d", "e"})
Me.dgw.Rows.Insert(2, emptyRow)

but nothing happen to the DataGridView (i.e. No rows are inserted). What's wrong?

A: Your datagrid bound to a data source, so then you should be adding rows in that data source
Dim drCopy as DataRow
Dim tbl as DataTable = aDataSet.Tables(0)

drCopy=tbl.NewRow()
drCopy.item(0)="a"
drCopy.item(1)="b"
drCopy.item(2)="c"
drCopy.item(3)="d"
drCopy.item(4)="e"

tbl.Rows.Add(drCopy)

Me.dgw.datasource = tbl

redpajama_set_name: RedPajamaStackExchange


text:
Q: How can I set the contentType of a blob on Azure using azure-cli? I am trying to update the contentType of an uploaded file or at least be able to reupload a file with the correct contentType.
In my case I am uploading css but it gives it a content type of application/octet-stream by default.
The command line reference doesn't show how to manage the properties of a blob as far as I can tell
Edit
If you just create the file apparently you can use
azure storage blob create -f {file_name} -p contentType=text/css
But I still haven't found a way to edit one yet.

A: You can now set blob properties using az storage blob update from the Azure CLI (source on GitHub).  For example, to set the Content-Type of a blob named $blob in a container named $container to text/css:
az storage blob update -c "$container" -n "$blob" --content-type text/css

A: Looking at the source code here, I don't think it is possible to update blob's properties using azure-cli.
If you're interested, you can use Node SDK for Azure Storage and update blob properties. For example, look at the sample code below:
var AZURE = require('azure-storage');
var blobService = AZURE.createBlobService("<account name>", "<account key>");
var container = '<blob container name>';
var blob = '<blob name>';
var newContentType = '<new content type e.g. text/css>'
blobService.getBlobProperties(container, blob, function(error, result, response) {
    if (!error) {
        var contentType = result.contentType;
        var cacheControl = result.cacheControl;
        var contentEncoding = result.contentEncoding;
        var contentMD5 = result.contentMD5;
        var contentLanguage = result.contentLanguage;
        var options = {
            'contentType': newContentType,
            'cacheControl': cacheControl,
            'contentEncoding': contentEncoding,
            'contentMD5': contentMD5,
            'contentLanguage': contentLanguage,
        };
        blobService.setBlobProperties(container, blob, options, function(error, result, response) {
            if (!error) {
                console.log('Properties updated successfully!');
            } else {
                console.log(error);
            }
        });
    } else {
        console.log(error);
    }
});


text:
Q: python: indentation error : indent does not match any outer indentation level I am having trouble with indentation. can someone help me please:errors are in the first and second if statements
data_graph = {"a" : ["b", "d", "f"],"b" : ["c", "f"],"c" : ["d"],"d" : ["b"],"e" : ["d", "f"],"f" : ["d"]
}

def depth_first_search(data_graph):
def depth_first(nodes_visited, data_graph, nodes):

    if nodes in nodes_visited:
        pass
    else:
        nodes_visited[len(nodes_visited):] =[nodes]
        print ("Nodes visited:", nodes, len(nodes_visited))

    for i in data_graph[nodes]:
        if i in nodes_visited:
            pass
        else:
            depth_first( nodes_visited,data_graph, i)

nodes_visited = []
while  (len(data_graph) > len(nodes_visited)):
     for nodes in data_graph:
        if nodes in nodes_visited:
            pass
        else:
            depth_first(nodes_visited, data_graph, nodes)

depth_first_search(data_graph)

A: Note the nested function was not indented.
data_graph = {"a" : ["b", "d", "f"],"b" : ["c", "f"],"c" : ["d"],"d" : ["b"],"e" : ["d", "f"],"f" : ["d"]
}

# you need to indent this function inside a function
def depth_first_search(data_graph):
    def depth_first(nodes_visited, data_graph, nodes):

        if nodes in nodes_visited:
            pass
        else:
            nodes_visited[len(nodes_visited):] =[nodes]
            print ("Nodes visited:", nodes, len(nodes_visited))

        for i in data_graph[nodes]:
            if i in nodes_visited:
                pass
            else:
                depth_first( nodes_visited,data_graph, i)

    nodes_visited = []
    while  (len(data_graph) > len(nodes_visited)):
         for nodes in data_graph:
            if nodes in nodes_visited:
                pass
            else:
                depth_first(nodes_visited, data_graph, nodes)

    depth_first_search(data_graph)


text:
Q: To Print no of copies and specific page, get input from msgbox In vba I want to print documents
To print N th page and N no. of cpoies, as per the input given by user.
I want to get inputs using msg box.
Thanks in advance.....!

A: You should use PrintOut method and InputBox (type:1).


text:
Q: Parsing JSON with Javascript I have a webservice (RestEasy) returning a JSON object containing a List<..> element. I am trying to parse the results in a Javascript for loop. If the List<> element has 2 or more elements, all is well. If the List<> element has only one element, the Javascript loop breaks.
This is because the JSON respresentation actually changes when there is only one element. For example:
{"parent":[{"a":1},{"b":2}]}

works just fine ... but for some reason, the JSON looks like this for one child:
{"parent":{"a":1}}

Note ... that the array indicator [] is missing.
Is that standard JSON? This type of notation forces ugly, unnecessary checks in my javascript for existence or size, etc of an expected array ...
Is this consistent standard practice? Why doesn't JSON return a list of one?
{"parent":[{"a":1}]}

Is this possibly an artifact of my server side and would other server side generators actually build a different JSON representation? I even tried to use dojo.forEach and it works great until it reaches the single element array that unfortunalty, lacks any type of list notation.

A: This has nothing to do with the JSON format. The JSON format absolutely distinguishes between {"a":1} (an object) and [{"a":1}] (an array containing an object as its only element).
Seeing it behave differently is a bug in the server-side generator. You'd have to dig into that code to find out why it would choose to misrepresent single-element arrays.

A: This is not a problem with JSON per se. JSON is merely a set of lexical rules. Rather, it sounds like a poor design or implementation of the REST web service.
If the specification says it will change the structure based on whether there is one item or several, then I would say it's a surprising design that violates the "principle of least astonishment." If the specification doesn't say this, then it would be a bug in the web service.

A: This is an artifact of your server side. Might be your framework supplies the datastructure to the JSON generator in this way, I guess it's not the problem of the generator itself.

A: Whilst not a JS/JSON problem, a JS workaround is available like so:
if(data["parent"]["child"] instanceof Array) {
    $.each(data["parent"]["child"], function(i, attr) {
         var myVal = attr["@name"];
         //now do something
     });
}
else {
     var myVal = data["parent"]["child"]["@name"];
     // do something
}


text:
Q: How much do you need to prove when finding splitting fields? When asked to find a splitting field for a polynomial over some field, how much do you need to prove ? For example, do you need to prove that the element in the extension is not in the original field? Specifically Am I going into too much detail here;  splitting field of $(x^2-3)(x^2-5)$ over $Q(\sqrt{ 2})$. Am I thinking of this correctly? ? Or can I just say for example for $x^2 − 2$ the roots are $\{±\sqrt{2}\}$
; hence, a splitting field is $\Bbb Q(\sqrt{2})$.

A: The splitting field of a polynomial $p(x) \in F[x]$ for some field $F$ is the minimal field extension $K/F$ over which $p$ splits entirely into linear factors. So, knowing this, to prove $K$ is in fact the splitting field of $p$, you need to prove two things: all roots of $p$ lie in $K$ and any field extension $K'/F$ containing all roots of $p$ necessarily has $K \subseteq K'$.
Note that this definition is dependent upon the field $F$. For instance, for the polynomial you gave: $p(x)= (x^2-3)(x^2-5)$, the splitting field of $p$ over $\mathbb{R}$ is precisely $\mathbb{R}$, while the splitting field over $\mathbb{Q}$ is $\mathbb{Q}( \sqrt{3}, \sqrt{5})$.
So for your first question: "do I need to prove that some element in the extension is not in the original field?" Well, no, not necessarily, consider the above case when the field is $\mathbb{R}$.
So for example let $p(x)= x^2-2$. If we consider $p(x) \in \mathbb{R}[x]$, a proof that the splitting field is $\mathbb{R}$ could look like this:
Note that $p(x)= (x-\sqrt{2})(x+\sqrt{2})$ and $\pm \sqrt{2} \in \mathbb{R}$, so $p$ splits over $\mathbb{R}$. Moreover, any field extension of $\mathbb{R}$ contains $\mathbb{R}$ by definition, so $\mathbb{R}$ is in fact the splitting field.
On the other hand, let's look at $p(x) \in \mathbb{Q}[x]$:
Note that $p(x)= (x-\sqrt{2})(x+\sqrt{2})$ and $\pm \sqrt{2} \in \mathbb{Q}(\sqrt{2})$, so $p$ splits over $\mathbb{Q}(\sqrt{2})$. Moreover, suppose $K/\mathbb{Q}$ is a field extension over which $p$ splits entirely. Then $\pm \sqrt{2} \in K$ and $\mathbb{Q} \subseteq K$, so $\mathbb{Q}(\sqrt{2}) \subseteq K$. Since $K$ was arbitrary, $\mathbb{Q} (\sqrt{2})$ is the splitting field of $p$ over $\mathbb{Q}$.
Now in this last argument, proving that $\mathbb{Q}(\sqrt{2}) \neq \mathbb{Q}$ is a different question, and this amounts to proving that $\sqrt{2}$ is not rational. In fact, I could also say the splitting field is $\mathbb{Q}(\sqrt{2}, - \sqrt{2})$. The point is that adjoining both roots of $p$ to the base field is not necessarily an incorrect answer, but it is certainly not the most efficient way of giving the splitting field and, in the above case, we may remove $-\sqrt{2}$ because this is already an element of $\mathbb{Q}(\sqrt{2})$.


text:
Q: URL syntax for connecting with server from the client side I went around the Internet for this question and I just can't figure it out.
I am developing a Java Application on Netbeans and I'm connecting to the H2 Database Engine through Netbeans IDE. I am not interested in using the console.
The code to connect to H2 is as follows (from the client side):
Connection connt = null;
String url = "jdbc:h2:tcp://" + SERVER_IP + ":" + SERVER_PORT + "//C:/Databases/businessApp;";
connt = DriverManager.getConnection(url, "sa", "");

When the code reaches the .getConnection() method, it stays there and does nothing.
I am almost sure that there is something wrong with the URL syntax.
SERVER_IP and SERVER_PORT are defined earlier and are not null.

A: I think semi colon(;) after "businessApp" is the culprit. Try after removing it.

A: I think the culpript is your final connection string which looks like
"jdbc:h2:tcp://192.168.1.154:8080//C:/Databases/businessApp"

and h2 apparently doesn't recognize UNC paths.
The above under GNU/Linux instead would work because of the different convention used for paths:
"jdbc:h2:tcp://192.168.1.154:8080/home/user/Databases/businessApp"

The solution I found is to add a slash after the port number, your string would thus become:
"jdbc:h2:tcp://192.168.1.154:8080/C:/Databases/businessApp"

this works both in Linux and Windows


text:
Q: jQuery How to count the no of rows in table by distinct column value How can I count the distinct table rows by table column?
Example:

        NAME
        TECHNOLOGY

        john
        jQuery

       mark
       css

       blah
       css

       abc
       css

       xyz
       jQuery

I want Out put:
css : 3
jQuery : 2

here I don't know what technology is come in that cell but, I need to get the no of rows by the technology
Thanks in advance

A: var byTechnology = {};

$("table tbody td:nth-child(2)").each(function () {
    var tech = $.trim( $(this).text() );

    if ( !(byTechnology.hasOwnProperty(tech)) ) {
        byTechnology[tech] = 0;
    }

    byTechnology[tech]++;
});

console.log(byTechnology);
// {
//     css: 3,
//     jQuery: 2
// }

A: Call function below on load. Check this jsFiddle out - http://jsfiddle.net/pqzKa/2/
function count()
{

var map = {};

$("tbody tr td:nth-child(2)").each(function(i, val){
              var key = $(val).text();
               if (key in map)
                   map[key]=map[key] + 1;
               else
                   map[key] = 1;
              });

var result='';
for(var key in map)
{
 result += key + ':' + map[key] + '\n';
}
alert(result);
}

The function builds a hashmap called map.
It then iterates over the second cell of each tr in tbody and checks to see if it is present in the map. If not, it adds it to the hashmap with a count of 1. If yes, it increments the count by 1.
I hope this helps.

A: Another route might be to write a more generic function for counting people who use certain technologies.
Assuming your using jQuery and your table has an id 'tech' you could do something like this
counter = function(textMatch){
    count=0;
    //loop through all
 s
    $('#tech').find('tbody tr').each(function( index ) {
        //if second  contains matching text update counter
        if($($(this).find('td')[1]).text() == textMatch){
            count++
        }
    });
    return count;
}

console.log('Number of people using CSS is ' + counter('css'));
console.log('Number of people using CSS is ' + counter('jQuery'));

//and so on


text:
Q: ASP button not working So I am trying to insert a button in my company's sharepoint site with asp.  The button appears correctly, but I can't get it to go to a certain page when I click it.  When I click it it just refreshes the page.  I want it to go to this link... http://www.w3schools.com/ .  Can someone help me fix this?
    <WebPartPages:WikiContentWebpart frametype="none" chrometype="None" runat="server" partorder="1" __WebPartId="{9852E1FB-0E97-47D1-BC63-0A8D2D953F9D}" id="g_9852e1fb_0e97_47d1_bc63_0a8d2d953f9d">
        <content>
        <div>

            <asp:Button runat="server" Text="Add New Item" id="Button1" Font-Bold="True" onclick="window.location='http://www.w3schools.com/'"></asp:Button> </div>
        </content>
    </WebPartPages:WikiContentWebpart>

A: <asp:Button runat="server" Text="Add New Item" id="Button1" Font-Bold="True"
     OnClientClick="window.location='http://www.w3schools.com/'; return false;">   </asp:Button>

You need to change two things:

*

*Since this is a client side handler, use OnClientClick.

*Return false after setting the location so that the default event (post back) is not fired.


text:
Q: Why in particle physics the background of resonance is a decaying exponential? When in particle physics they plot the mass histogram we see a resonance on top of a decaying exponential background?
Why is the background modeled to be that way? what is the physical explanation?
Thanks.

A: Decaying exponentials are the result of there being a fixed probability of any specific member of a population being removed.  Once removed, the population decreases and so the rate of decay also decreases.  The rate of decay is therefore associated with a particular time scale related to the change in population.  The same model works if the population is growing - it still leads to an exponential, just one that's growing.


text:
Q: How can I modify the Object constructor When I run the following code
var ExtendedObject = function() {
  this.standard = 5;
};

Object = ExtendedObject.bind(Object);
var p = new Object();
console.dir(p.standard);

, the output is

5

as expected.
If I instead instantiate the variable p as an object literal like this:
var ExtendedObject = function() {
  this.standard = 5;
};

Object = ExtendedObject.bind(Object);
var p = {};
console.dir(p.standard);

The result is

undefined

I am trying to find a way to modify the constructor of Object such that I can add some standard content to all new objects being created.

A: No, it is absolutely impossible to redefine how an object literal evaluates; it will always become a native object with the builtin Object.prototype, not a subclass or anything and it will also not invoke a custom constructor.
This is in fact a security feature, as it prevents JSON hijacking.

… such that I can add some standard content to all new objects being created

That's a horrible idea and will break every library you'd ever use in this environment (including all functions you'd write yourself). However, if you insist on having a common (not individual!) property on all objects, you might consider defining it on Object.prototype. Not that I would recommend it, but at least do it correctly.

A: You can create a class and extend it from Object.

class MyObject extends Object {
  constructor() {
     super();
     this.standard = 5;
  }
}

const obj = new MyObject();
console.log(obj);

A: Define the property on the prototype of Object like this:

Object.defineProperty(Object.prototype, 'standard', {
  value: 5,
  writable: true,
  enumerable: true,
  configurable: true
});
var p = {};

console.dir(p.standard);

A: This may be a helpful link that discuss about JavaScript objects. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Working_with_Objects


text:
Q: No email received in Outlook web access unless forwarding is enabled to another account I'm not receiving any email in Outlook (nothing in spam, trash etc), however, if I set up forwarding to a gmail address I can receive the mail. POP is disabled and shouldn't be deleting mail from the server so I can't fathom this one.
Has anyone else experienced this?


text:
Q: Structuremap 3 constructor that accepts list of all registered types/instances I have an object which expects an IEnumerable<IPluginType> as a parameter to it's constructor. I also have a line in my container configuration which adds all implementers of IPluginType:
x.Scan(s =>
{
    ...

    s.AddAllTypesOf<IPluginType>();
});

I've confirmed via container.WhatDoIHave() that the expected implementers are registered, but the IEnumerable is not being populated.
I guess I'm being a little optimistic thinking that Structuremap will know what I mean, how can I tell it?

A: If the IPluginTypes are definitely registered in the Container as you say, StructureMap does resolve it correctly and pass one of each registered type into the IEnumerable. As you found, you need to use interfaces, not abstract types.
Here is a complete working example (or as a dotnetfiddle):
using System;
using System.Collections.Generic;
using StructureMap;

namespace StructureMapTest
{
    public class Program
    {
        public static void Main(string[] args)
        {
            var container = new Container();
            container.Configure(x =>
            {
                x.Scan(s =>
                {
                    s.AssemblyContainingType<IPluginType>();
                    s.AddAllTypesOf<IPluginType>();
                });

                x.For<IMyType>().Use<MyType>();
            });

            var myType = container.GetInstance<IMyType>();
            myType.PrintPlugins();
        }
    }

    public interface IMyType
    {
        void PrintPlugins();
    }

    public class MyType : IMyType
    {
        private readonly IEnumerable<IPluginType> plugins;

        public MyType(IEnumerable<IPluginType> plugins)
        {
            this.plugins = plugins;
        }

        public void PrintPlugins()
        {
            foreach (var item in plugins)
            {
                item.DoSomething();
            }
        }
    }

    public interface IPluginType
    {
        void DoSomething();
    }

    public class Plugin1 : IPluginType
    {
        public void DoSomething()
        {
            Console.WriteLine("Plugin1");
        }
    }

    public class Plugin2 : IPluginType
    {
        public void DoSomething()
        {
            Console.WriteLine("Plugin2");
        }
    }
}


text:
Q: loop that breaks when program closes How would I check with this command ps aux | grep java to make a while loop that would end if this process is off?
The idea is so if the server, in my case a minecraft server, crashes or closes then the backup stops.

A: while pidof java &> /dev/null; do
      sleep 1;
done


text:
Q: MobileFirst- Security test for Desktop environment We are trying to validate the usage of MFP to develop our desktop web site. However, I'm trying to understand the security test for desktop environment.
MFP provides the ability to add the security test for the desktop in the application-descriptor.xml:
<desktopBrowser cacheManifest="no-use" securityTest="VALUE"/>.

My application is configured to use the following two security tests, one for Mobile and the other for Adapters:
Mobile:
<customSecurityTest name="BankingTestMobile">
            <test realm="wl_antiXSRFRealm" step="2"/>
            <test realm="wl_authenticityRealm" step="2"/>
            <test realm="wl_remoteDisableRealm" step="2"/>
            <test mode="perSession" realm="wl_directUpdateRealm" step="1"/>
            <test isInternalUserID="true" realm="wl_anonymousUserRealm" step="2"/>
            <test isInternalDeviceID="true" realm="wl_deviceNoProvisioningRealm" step="2"/>
        </customSecurityTest>

Adapter:
<webSecurityTest name="BankingTest">
            <testUser realm="BankingRealm"/>
        </webSecurityTest>

My Realm is:
<realm loginModule="BankingLoginModule" name="BankingRealm">
            <className>com.worklight.integration.auth.AdapterAuthenticator</className>
            <parameter name="login-function" value="MBCAuthenticationAdapter.onAuthRequired"/>
            <parameter name="logout-function" value="MBCAuthenticationAdapter.onLogout"/>
        </realm>

*

*What is the security test needed to protect the desktop app?

*Is there a documentation clarifying this as I couldn't find any on the knowledge centre.

I have tried using the adapter security test for desktop, but the init call started to fail.
Server version: 7.1.0.00.20161006-0540

A: The optional securityTest attribute of desktopBrowser works just like any other platform.
See https://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/7.1/authentication-security/authentication-concepts/classic-security-model/#protectApp
It allows you to protect the entire application with a security test of your choice. Meaning as soon as someone connects to the MobileFirst server from this desktop app, the defined security test will be triggered.
It's up to you to choose. Or not put anything.
On a side note, keep in mind that the Desktop environment does not support OAuth, which means you cannot use WLResourceRequest nor Java Adapters.


text:
Q: Run IPython in a script I am trying to do some scripting with IPython, but I am finding that it behaves very differently in a script to when I run an interactive shell.
For example, I can run the following interactively:
In [1]: %profile
default

In [2]: ls /
bin/   cdrom/  etc/   initrd.img@      lib/    lib64/       media/  opt/   root/  sbin/  sys/  usr/  vmlinuz@
boot/  dev/    home/  initrd.img.old@  lib32/  lost+found/  mnt/    proc/  run/   srv/   tmp/  var/  vmlinuz.old@

In [3]: mkdir tmpdir

In [4]: cd tmpdir
/home/alex/tmp/tmpdir

No problem.
However, none of these commands works when I run them in a script:
#!/usr/bin/ipython3

%profile
ls /
mkdir tmpdir
cd tmdir

I get an error:
$ ./tmp.py
  File "/home/alex/tmp/tmp.ipython", line 3
    %profile
    ^
SyntaxError: invalid syntax

I have tried running this by:

*

*calling the file directly as above,

*calling it explicitly with ipython: `ipython3 tmp.py'

*passing the -i or --profile=sh arguments to ipython when calling it with ipython

*changing the file extension to .ipython and .ipy
My question:
Why is it behaving differently in a script to the shell?  How can I get IPython to run these commands in a script?

A: They are working due to IPython magic but they are shell commands and do not work in Python. To get them consider the subprocess library. Where you would have spaces in a shell command instead have comma-separated values in the list.
import subprocess
subprocess.check_call(['ls'])
subprocess.check_call(['ls', '-a'])


text:
Q: Accelerate ball over time I have a ball which need to accelerate during time, but give a very little force. I tried to accelerate with Time.deltatime divided with specific values but it doesn't work.
This is my sample of code (to start game, you need a one tap and ball is moving with constant speed) and my question is how can automatically accelerating a ball during time.
void Start ()
{
    Application.targetFrameRate = 60;
    gameStart = false;

}

void Update ()
{
    if (!gameStart)
    {
        if (Input.touchCount >= 1)
        {
            gameStart = true;
            GetComponent<Rigidbody2D> ().AddForce (new Vector2 (1f, 0.5f) * force);

        }
    }
}

A: You can try this, I have not changed any variable names to maintain familiarity with your original code
Rigidbody2D myRigidbody
void Awake(){ myRigidbody = GetComponent<Rigidbody2D>(); }

void Start ()
{
    Application.targetFrameRate = 60;
    gameStart = false;

    // Invokes the method setGameStartToFalse in 2 seconds, then repeatedly every 1 seconds.
    InvokeRepeating("setGameStartToFalse", 2f, 1.0F);
}

void FixedUpdate ()
{
    if (!gameStart)
    {
        if (Input.touchCount >= 1)
        {
            gameStart = true;
            myRigidbody.AddForce(new Vector2 (1f, 0.5f) * force);
        }
    }
}

void setGameStartToFalse()
{
    gameStart = false;
}

A: In  Update() method you set gamestart to true so the application will not execute the code inside the first if until you will set again gamestart to false. You also must check that MonoBehaviour is enabled or Update will not execute


text:
Q: GROUP_CONCAT returning single result I have two tables I am trying to get results from: table in the Users table while table 2 is the education background table.
Let say user A has multiple schools he inserted into the education table. if I fetch details from education and join it to users table the record will return by the number of education details inserted by user A.
for instance, if I say select * from users u left join education e on u.id=e.fid it returns back the number of times his details appears in education table.
So, I decided to use the query this way:
SELECT j.dob,j.id,j.sname,j.fname, j.mname,j.gender,j.localg,j.stateng,j.phone,j.mails,j.confirm_no,j.edate, GROUP_CONCAT(e.qualification SEPARATOR ', '), GROUP_CONCAT(e.course SEPARATOR ', '), GROUP_CONCAT(e.years SEPARATOR ', ') FROM jobseeker j LEFT JOIN education e ON j.id=e.fid  WHERE j.training_approval_status=1 AND j.confirm_no LIKE 'A%'

but it only returned a single row. What am I doing wrong? Or in what better way can I get the results.


text:
Q: knockout console log and observable undefined I've seen comments on console logging observables but it doesn't seem to work for me. Additionally my app isn't starting up with a the default var that I was expecting.
The two questions are together because I suspect they're related somehow.
Here is the fiddle.
HTML
<select data-bind="options: widgets, optionsText: 'name', value: current_widget, optionsCaption: 'Choose...'"></select>
<input data-bind="value: current_widget() ? current_widget().name : 'nothing'" />

Javascript
var cdta = {};
$(document).ready(function(){

    cdta.widgets_data = [{ "name": "foo", "id": "1"},{ "name": "bar", "id": "2"},{ "name": "bash", "id": "3"},{ "name": "baq","id": "4"}];

    cdta.local = {};
    cdta.local.current_widget = { "name": "foo", "id": "1"};

    alert('current_widget starting value should be: ' + cdta.local.current_widget.name);

    function app() {
        var self = this;

        //widgets
        self.widgets = ko.observableArray(cdta.widgets_data);

        // which widget to display from a local source
        alert('about to asign a current_widget named:' + cdta.local.current_widget.name);
        self.current_widget = ko.observable(cdta.local.current_widget);
    }
    ko.applyBindings(new app());

    alert('after applying bindings name of current widget: ' + current_widget().name);
    //expecting foo
    //but doesn't alert because current_widget isnt defined
});

A: There are couple of issues in your code.

*

*current_widget is a property of app, so you need to do something like this
var app = new app();
ko.applyBindings(app);
alert('after applying bindings name of current widget: ' + app.current_widget().name);

*Since you are using value and optionsCaption bidnings, knockout will set the observable that's bound to value to undefined by default. If you remove optionsCaption binding it will work. If you need optionsCaption and you need to select initial value, you will have to reset it after applying bindings:
var app = new app();
ko.applyBindings(app);
app.current_widget(cdta.widgets_data[0]); //you have to select an object from the array, not a completely unrelated object cdta.local.current_widget
alert('after applying bindings name of current widget: ' + app.current_widget().name);

UPDATE:
I was wrong on #2. You don't have to reset value after applying bindings. The real problem is that you use completely unrelated object (not from the array) for initial value. This will fix the issue:
cdta.local.current_widget = cdta.widgets_data[0];

A: But variable/method current_widget indeed undefined. KnockoutJS doesn't generate gloabal variables.
If You want to access viewModel data outside of viewModel, then You need to store it  somewhere(variable, window, etc).
var cdta = {};
$(document).ready(function(){
    //...
    function app() {
       //...
    }
    window.app = new app();
    ko.applyBindings(window.app);

    alert('after applying bindings name of current widget: '
      + window.app.current_widget().name);
    //expecting foo
});


text:
Q: Elastic Collisions - Equation not working? This is the question:
When cars are equipped with flexible bumpers, they will bounce off each other during low-speed collisions, thus causing less damage. In one such accident, a 1850 kg car traveling to the right at 1.60 m/s collides with a 1450 kg car going to the left at 1.10 m/s . Measurements show that the heavier car's speed just after the collision was 0.270 m/s in its original direction. You can ignore any road friction during the collision.
I solved this problem correctly with conservation of momentum: (m1v1 + m2v2)i = (m1v1 + m2v2)f. The result was 0.597 m/s.
However, when I attempted to use the equations for elastic collisions, shown here:
I ended up with v2,f = 1.927 m/s. Why is the second equation in the picture wrong? I thought that if a collision is elastic, these equations always apply.

A: I suspect the discrepancy arises because the collision was not elastic.

A: The equations for plastic collision with a coefficient of restitution $\epsilon$ are
$$\begin{aligned}
  v_1^f & = \frac{m_1 - \epsilon m_2}{m_1+m_2}v_1 + \frac{\epsilon m_2+m_2}{m_1+m_2} v_2  \\
  v_2^f & = \frac{\epsilon m_1+m_1}{m_1+m_2} v_1 + \frac{m_2 - \epsilon m_1}{m_1+m_2} v_2
\end{aligned} $$


text:
Q: Is this really the process for authenticating users with the Google platform using Xamarin? I am following the tutorial located here: https://developer.xamarin.com/guides/xamarin-forms/cloud-services/authentication/oauth/
I got to the step titled: Presenting the Sign-In User Interface.
It says that, "When the Login method is invoked, the sign-in user interface is presented to the user in a tab from the device's web browser."
Now is this really the process when using Xamarin?
Because the other apps I've downloaded and played with don't open the browser and then open a new tab to give me a choice of which account to choose. Those apps pop up a small page on top of the app and allows me to select an account.
If this Xamarin process is different I am not going to use it when developing my app. Please clear this up for me thanks.

A: There is no such thing as as "Xamarin's way of oAuth".
oAuth is about authenticating users through 3rd parties like Google, Facebook, Twitter etc. There are different oAuth flows which are mostly used: the implicit grant and the authorisation code grant. For mobile apps the implicit flow is common because auth code flow involves the app keeping a secret which a mobile cannot really guarantee. For a great overview of these flows I can recommend this lecture from Xamarin.University.
These flows are the same no matter which underlying development stack you are using.
The documentation you are referring to is using a library to help using these flows: Xamarin.Auth. As a matter of fact you don't have to use this library at all. This library helps with storing tokens, sending requests that include the required tokens, detect endpoint redirects etc. Part of using this library is presenting the UI where the 3rd party vendors login form is shown.
This is what you do when calling:
var presenter = new Xamarin.Auth.Presenters.OAuthLoginPresenter();
presenter.Login(authenticator);

The actual implementation of presenting the UI is platform specific. On iOS the UI os shown modally if that's how you are coding it. If you change this code to show the UI as a small popup floating on top of existing content, you can of course do this. This is true for any given platform.


text:
Q: Asp.Net, DataGrid with dynamic columns doesn't fire SortCommand event i have a simple DataGrid with some columns defined in .aspx(A) and some columns added programmatically in code behind(B).
The problem is that click on the header of columns (B) doesn't fire the SortCommand event; columns (A) works fine.
I noticed that re-DataBind() datasource at Page_Load make the things works, but i would avoid to do that becouse datasource can be very large(no session so) and retrive it is expansive.
Thanks.


text:
Q: Is vigenary a real word? I was interested in determining words to describe ordinal Latinate series numbering above orders of 10 (i.e., "denary").
I found "duodenary", which makes sense based on the latin root duodecim, meaning 'twelve.' (see also etymology of the duodenum of the small intestine -- duodeni, meaning 'in twelves.').
However, I found no evidence of other ordinal numbering adjectives other than that for 20.
I have two questions:

*

*Here, here and here suggest that "vigenary" is the Latinate ordinal term for "twentieth" (or "of the twentieth order"). However, none of these sources come across as legitimate. Can anyone confirm for me (through a more trustworthy and proper source) that "vigenary" is in fact the proper word to use here?

*Do other Latinate ordinal adjectives (for orders > 10) exist?

A: Probably not. Vigesimal is a word, but the series primary, secondary, tertiary… seems to cover only numbers from 1 to 10 and 12:
https://en.oxforddictionaries.com/explore/what-comes-after-primary-secondary-tertiary

A: Vigenary is marked by the OED as rare, but the alternative vicenary is not so marked.

Vicenary  ... adj.    'Belonging to twenty' (Bailey, 1727); based on the number twenty. Cf. vigenary adj.

*

*a1831  G. Peacock Arithm. in Encycl. Metrop. (1845) I. 371/1   Such a practice would naturally lead to the formation of a vicenary scale of numeration.

*1834   Penny Cycl. II. 337/2   In France the scale from 60 to 100 is strictly vicenary (by twenties).

The root of both 'vigenary' and 'vicenary' is from Latin vīcēnārius, in turn from vīcēnī, the distributive form of vīgintī ('twenty').


text:
Q: Invalid update: invalid number of rows in section 0, the number of rows contained in an existing section after update I keep getting this error when I swipe and delete a UITableCell

Terminating app due to uncaught exception
  NSInternalInconsistencyException, reason: Invalid update: invalid
  number of rows in section 0.  The number of rows contained in an
  existing section after the update (11) must be equal to the number of
  rows contained in that section before the update (11), plus or minus
  the number of rows inserted or deleted from that section (0 inserted,
  1 deleted) and plus or minus the number of rows moved into or out of
  that section (0 moved in, 0 moved out).

func tableView(_ tableView: UITableView, trailingSwipeActionsConfigurationForRowAt indexPath: IndexPath) -> UISwipeActionsConfiguration? {
    let delete = deleteAction(at: indexPath)
    tableView.reloadData()
    print(listOfCoins)
    print(listOfCoins.count)
    return UISwipeActionsConfiguration(actions: [delete])
}

func deleteAction(at indexPath: IndexPath) -> UIContextualAction {
    let action = UIContextualAction(style: .destructive, title: "Delete") { (action, view, nil) in
        self.listOfCoins.remove(at: indexPath.row)
       self.tableView.deleteRows(at: [indexPath], with: .automatic)
        self.tableView.reloadData()
        }
    action.title = "Delete"
    action.backgroundColor = .red
    return action
}

I've tried taking out "self.tableView.deleteRows" which allows the app to run and deletes the indexPath from my source, but I don't know why the cell doesn't disappear when 'tableView.reloadData()' is called afterwards.

A: You only need
self.listOfCoins.remove(at: indexPath.row)
self.tableView.deleteRows(at: [indexPath], with: .automatic)

So remove this
let delete = deleteAction(at: indexPath)
tableView.reloadData() // remove this line

And
self.tableView.deleteRows(at: [indexPath], with: .automatic)
self.tableView.reloadData() // remove this line

func tableView(_ tableView: UITableView, trailingSwipeActionsConfigurationForRowAt indexPath: IndexPath) -> UISwipeActionsConfiguration? {
    let delete = deleteAction(at: indexPath)
    print(listOfCoins)
    print(listOfCoins.count)
    return UISwipeActionsConfiguration(actions: [delete])
}

func deleteAction(at indexPath: IndexPath) -> UIContextualAction {
    let action = UIContextualAction(style: .destructive, title: "Delete") { (action, view, nil) in
        self.listOfCoins.remove(at: indexPath.row)
        self.tableView.deleteRows(at: [indexPath], with: .automatic)
    }
    action.title = "Delete"
    action.backgroundColor = .red
    return action
}


text:
Q: Add multiple condition to group by and having clause 3I have the following query
SELECT deal_id, max(test_value) - min(test_value) AS deviation
  FROM  table
  WHERE run_date >= Dateadd(month, -4, Getdate())
  and test_alias='BOND_P'
  group by deal_id
  having (max(test_value) - min(test_value)) BETWEEN 1.79 AND 4.5

and
     SELECT deal_id, max(test_value) - min(test_value) AS deviation
  FROM  ems.cdotests
  WHERE run_date >= Dateadd(month, -3, Getdate())
  and test_alias='CAA/CCC'
  group by deal_id
  having (max(test_value) - min(test_value)) BETWEEN 2.79 AND 2

I need to combine the this query so that i can get the output as the
1: result set of query 1 intersected with result set of query 2
2: result set of query 1 unioned with result set of query 2

'Intersect' or 'Union' will depend upon the parameter passed to the stored procedure
Ps Note: The run date criteria between the two query can be different
Any help would be appreciated

A: IF @myBitParameter = 0
  SELECT deal_id, max(test_value) - min(test_value) AS deviation
  FROM  [table]
  WHERE run_date >= Dateadd(month, -4, Getdate())
  and test_alias='BOND_P'
  group by deal_id
  having (max(test_value) - min(test_value)) BETWEEN 1.79 AND 4.5

  UNION ALL --or UNION, if you don't want duplicates

  SELECT deal_id, max(test_value) - min(test_value) AS deviation
  FROM  ems.cdotests
  WHERE run_date >= Dateadd(month, -3, Getdate())
  and test_alias='CAA/CCC'
  group by deal_id
  having (max(test_value) - min(test_value)) BETWEEN 2.79 AND 2

ELSE
  SELECT deal_id, max(test_value) - min(test_value) AS deviation
  FROM  [table]
  WHERE run_date >= Dateadd(month, -4, Getdate())
  and test_alias='BOND_P'
  group by deal_id
  having (max(test_value) - min(test_value)) BETWEEN 1.79 AND 4.5

  INTERSECT

  SELECT deal_id, max(test_value) - min(test_value) AS deviation
  FROM  ems.cdotests
  WHERE run_date >= Dateadd(month, -3, Getdate())
  and test_alias='CAA/CCC'
  group by deal_id
  having (max(test_value) - min(test_value)) BETWEEN 2.79 AND 2

I feel like there should be a way to do this cleaner with CTE's, but don't have time to fool with it any more.  Someone feel free to clean this up or make a better answer out of it.


text:
Q: How should I allow others to dynamically find web services? I have been fighting with this for a while now. I need to prototype SOA, and with it, the registry. I have been fiddling with jUDDIv3 on JBoss SOA Platform 5, but there don't appear to be any tools that allow me to publish to a v3 jUDDI registry. See my related questions here and here.
I realize after reading comments on those questions, and some articles on the internet (like this one) that UDDI is failing or dead, however my organization has some legacy tech we need to work with.
Also, my supervisor (I'm an intern) is adamant about sticking to standards. In principle, I agree with this, but perhaps a dead standard really isn't a much of a standard if nobody uses it.
In short, I need to provide the registry component of Service Oriented Architecture. It probably needs to be UDDI, so that it fits with the legacy tech, and satisfies the standard. Whatever the solution, it would be best if there were tools available that allow me to publish web services to that registry.
This problem has dragged on much longer than I would have liked. Any small piece of advice is really appreciated.

A: You may use WS-Discovery. WS-Discovery is a standard protocol for discovering services and service endpoints. This enables service clients to search for services based on a given criteria and bind with the discovered services. There are tow modes of WS-Discovery,
ad-hoc - servers advertise the services they have using a UDP multicast protocol
managed mode - servers and clients use an intermediary known as the discovery proxy for all service discovery purposes.
You can simply try this out with WSO2 Platform (free and open source under apache2 license). Please follow [1] to see a simple scenario of WS-Discovery in managed mode.
[1] http://charithaka.blogspot.com/2010/04/ws-discovery-with-wso2-carbon.html


text:
Q: MPI returns incorrect results for one of processes I'm learning MPI now and wrote simple C program that uses MPI_Scatter and MPI_Reduce as follows:
int main(int argc, char **argv)
{
        int mpirank, mpisize;
        int tabsize = atoi(*(argv + 1));

        MPI_Init(&argc, &argv);
        MPI_Comm_rank(MPI_COMM_WORLD, &mpirank);
        MPI_Comm_size(MPI_COMM_WORLD, &mpisize);

        unsigned long int sum = 0;
        int rcvsize = tabsize / mpisize;
        int *rcvbuf = malloc(rcvsize * sizeof(int));
        int *tab = malloc(tabsize * sizeof(int));
        int totalsum = 0;

        if(mpirank == 0){

                for(int i=0; i < tabsize; i++){
                        *(tab + i) = 1;
                }

        }
                MPI_Scatter(tab, tabsize/mpisize, MPI_INT, rcvbuf, tabsize/mpisize, MPI_INT, 0, MPI_COMM_WORLD);

        for(int i=0; i < tabsize/mpisize; i++){
                sum += *(rcvbuf + i);
        }

        printf("%d sum = %ld %d\n", mpirank, sum, tabsize/mpisize);
        MPI_Reduce(&sum, &totalsum, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD);

        if(mpirank == 0){
                printf("The totalsum = %li\n", totalsum);
        }

        MPI_Finalize();

        return 0;
}

The program gives inconsitient results and I don't understand why. For example:
$ mpirun -np 4 03_array_sum 120000000
1 sum = 29868633 30000000
2 sum = 30000000 30000000
0 sum = 30000000 30000000
3 sum = 30000000 30000000
The totalsum = 119868633

Here process 1 didn't count all elements given to it by MPI_Scatter.
UPDATE:
As user @Gilles Gouaillardet wrote below in the accepted answer I have run the code in a loop thirty times for both versions, with empty $OMPI_MCA_pml and set to "^ucx". When flag is empty for one run 8 out of 30 gives wrong values, when flag is set all runs are correct. Then I run same on Debian GNU/Linux 7 (wheezy) with OpenMPI 1.4.5 and all runs were correct with empty flag. Looks like something is wrong with OpenMPI 4.0.4 and/or Fedora 33.

A: I was able to reproduce the issue in the very same environment.
I do not know whether the root cause is within Open MPI or UCX.
Meanwhile, you can
mpirun --mca pml ^ucx ...

or
export OMPI_MCA_pml=^ucx
mpirun ...

or add into /etc/openmpi-x86_64/openmpi-mca-params.conf
pml = ^ucx


text:
Q: How to display items in two columns in a ListView I'm looking to layout a ListView in a Windows 8.1 app so that its elements wrap to (at most) two columns that read in order like a newspaper and scroll vertically, e.g.,
1 4
2 5
3

The closest I've gotten is:
<ListView.ItemsPanel>
    <ItemsPanelTemplate>
        <WrapGrid Orientation="Horizontal" MaximumRowsOrColumns="2" />
    </ItemsPanelTemplate>
</ListView.ItemsPanel>

but since MaximumRowsAndColumns is interpreted per the Orientation, the result is
1 2
3 4
5

switching the Orientation to Vertical gives me
1 2 3
4 5

Am I going to need a custom panel to do this?  Another tactic is perhaps a gridview within a scrollviewer, but that seems a little hacky to me.

A: You should use ItemsWrapGrid :
<ListView.ItemsPanel>
    <ItemsPanelTemplate>
        <ItemsWrapGrid />
    </ItemsPanelTemplate>
</ListView.ItemsPanel>

This will give you the result that you want :
1 4
2 5
3


text:
Q: Define the Minpts paramter in Local Outlier Factor I would like to know, how can I find the correct number ok k in the LOF algorithm?
There are many example's code in Python for the K-means, but nothing for LOF.
Thank you


text:
Q: How to load My Jar to ClassPath at runtime through Java Coding? I am working with Swing in Net Beans. I have my own jar which contains classes and methods inside it. I will call those classes and methods using JAVA Reflection API but before that I want to load my Jar into class path at run time. I have a J Button and on click of that I am getting Jar Name and Jar path. But I am failing to load Jar to classpath at run time. Got some links but were not helpful. Please provide me with simple example. I should load my jar to classpath. That's the only problem for me.I will take care of that. Please help.

A: You can load classes at run time through the use of a ClassLoader, take a look at URLClassLoader for example
File yourJarFile = ...;
URLClassLoader classLoader = new URLClassLoader(new URL[]{yourJarFile.toURI().toURL()});

This will then allow you to load classes and instantiate them...
Class class = classLoader.loadClass("fully.qualified.packagename.to.your.AwesomeClass");

You can then instantiate them using something like...
Object obj = class.newInstance();

Or reflection if you want to use a specific constructor.  Just remember, you won't be able to reference these classes directly within the current class loader context, as the current class loader knows nothing about them


text:
Q: Open facebook post/pageurl with facebook session within app in uiwebview I am using latest Facebook iOS Sdk for Facebook integration. I am able to perform login and graph api/FQL operation very well. But now I want to open Facebook post/pageurl with facebook session within app in UIWebView after login. So, anyone know how to do it?

A: To do this you have to force Facebook webView login
// Initialize a session object
FBSession *session = [[FBSession alloc] init];
// Set the active session
[FBSession setActiveSession:session];
// Open the session
[session openWithBehavior: FBSessionLoginBehaviorForcingWebView
        completionHandler:^(FBSession *session,
                            FBSessionState status,
                            NSError *error) {
            // Respond to session state changes,
            // ex: updating the view
        }];

The webView based login will add some login cookies to your app (cookies manager)
 Next:
When you open post in webView load the cookies:
// req is NSURLRequest that you pass to your UIWebView
// this code should be before loading the UIWebView
NSArray *cooks = [[NSHTTPCookieStorage sharedHTTPCookieStorage]cookiesForURL:req.URL];
[self addCookies:cooks forRequest:req];

Here is the implementation for addCookies:forRequest:
- (void)addCookies:(NSArray *)cookies forRequest:(NSMutableURLRequest *)request
{
    if ([cookies count] > 0)
    {
        NSHTTPCookie *cookie;
        NSString *cookieHeader = nil;
        for (cookie in cookies)
        {
            if (!cookieHeader)
            {
                cookieHeader = [NSString stringWithFormat: @"%@=%@",[cookie name],[cookie value]];
            }
            else
            {
                cookieHeader = [NSString stringWithFormat: @"%@; %@=%@",cookieHeader,[cookie name],[cookie value]];
            }
        }
        if (cookieHeader)
        {
            [request setValue:cookieHeader forHTTPHeaderField:@"Cookie"];
        }
    }
}


text:
Q: What could cause "PROCEDURE schema.identity does not exist" using MySQL and Hibernate? Using Java, Hibernate, and MySQL I persist instances of a class like this using the Hibernate support from Spring.
@Entity
public class MyEntity implements Serializable {

  private Long id;

  @Id
  @GeneratedValue(strategy = GenerationType.AUTO)
  public Long getId() {
    return id;
  }

  public void setId(Long id) {
    this.id = id;
  }
}

This generally works fine. But now and then when trying to persist such an entity, I get this:
java.sql.SQLException: PROCEDURE schema.identity does not exist

The underlying MySQL error is:
SQL Error: 1305, SQLState: 42000

This is a regular MySQL error described in the MySQL manual.
My problem is that this system worked for months without any problem. Only recently I discovered the error described above. Do you have any ideas what could have caused this problem? What does Hibernate look for and doesn't find?
If this question should be on serverfault, feel free to migrate it :)

A: In this post:
http://forums.mysql.com/read.php?39,96721,96721#msg-96721
They had the same type of errors and fixed it buy upgrading their MySQL connector to the latest one, but that was back in 2007.  I hope that helps.

A: Identity() is a h2 specific database function that some framework code tries to trigger via sql.
MySql does not know it, so it throws the BadSyntax Exception.
If you happen to use Spring Security with acl support, like me, then
JdbcMutableAclService is the problem.
The java-docs state:

"The default settings are for HSQLDB. If you are using a different
  database you  will probably need to set the sidIdentityQuery(String)
  and  classIdentityQuery(String) classIdentityQuery properties
  appropriately".

Those   values default to "call identity()", which is unknown by MySql.
The new right values are stated by
this answer

A: Came across the same exception today and found this post helped.
The problem I had is that I started tomcat first but failed to start the mysql. After I started mysql, the app worked for most of the part but failed to insert a record with above exception. Restarted tomcat resolved this problem.

A: It happened to me too with spring hibernate and MySQL...
I think the error appear not alway but sometime if the tomcat server,
so i fixed the problem only restarting the tomcat server with MySQL on.

A: For anyone still struggling with this issue. Ensure you have configured the right hibernate dialect for your sql version.
I changed:
   <property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect"/>

to
   <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>

And it worked for me.
My Sql version is 5.7 and that was the right dialect
https://docs.jboss.org/hibernate/orm/3.5/javadocs/org/hibernate/dialect/MySQL5Dialect.html


text:
Q: How to determine start of data payload in TCP packet? I'm writing program for monitoring FTP traffic using raw sockets. Now, I am able to determine start of data in TCP packet using this code:
// char * packet;
// struct * iphdr;
// struct * tcphdr;

// ...
// check, whether sniffed ethernet frame contains IP and TCP

char * data;
data = (packet + sizeof (struct ethhdr) + sizeof (struct tcphdr) + (header_ip->ihl * 4) + header_tcp->doff) + 4;

This works fine, but I have to add the "magic" number 4 to data pointer. Without adding it, the final string starts with few meaningless characters.
Is there any clean solution how to determine start of transfered data? (without using any specialized libraries such as libcap etc.)
Thanks.

A: Check the header specifications in RFC 793, RFC 1122, and RFC 3168.  Some of the flags affect the header size, most obviously the options and maximum segment size fields.


text:
Q: Continuous SPAM from certain IP/s hosting provider, how to report them if not responding at abuse@company.mail last maybe 4 weeks is coming SPAM e-mails from various domains. In common is that when i paste the source code of the e-mail to
https://www.spamcop.net
is detected this provider and their mailbox: abuse@des.capital
i have reported this activity to des capital numerous times via spamcop and also manually to info@des...(got no reply) no effect. I would block the sender, but it is from various domains and various mail content, so i do not know how to block in Thunderbird.
When check "From" in one of the e-mail source and check hostname IP, i see "server9.lindhint.info has address 212.193.29.252"
whois on that IP:
inetnum:        212.193.28.0 - 212.193.31.255
netname:        Serveri0n
org:            ORG-DCB8-RIPE
country:        NL
admin-c:        AA35882-RIPE
tech-c:         TA7409-RIPE
status:         ASSIGNED PA
mnt-by:         RELCOMGROUP-EXT-MNT
created:        2020-12-02T15:36:18Z
last-modified:  2021-05-11T06:56:00Z
source:         RIPE

organisation:   ORG-DCB8-RIPE
org-name:       Des Capital B.V.
country:        NL
org-type:       LIR
address:        Krammer 8
address:        3232HE
address:        Brielle
address:        NETHERLANDS

Question: can i contact their IP/network provider or some authority that can force them to cease the SPAM, which, how? RIPE claims "There is nothing we can do if a network operator chooses not to reply." I am not from the country of this host.
Update: it came to my attention that "Serveri0n" (mentioned in "netname" whois) have a colocation customer whose customer is likely the SPAMmer. Serveri0n acted quickly to prevent SPAM. Thank you (answers still welcome)


text:
Q: How to get a different link dynamically for each option tag value? I am creating a form through which customers can purchase an online service.
The form contains a dropdown list with a 'select' & 'option' tag.
The dropdown list is created to choose a billing cycle (6 months, 1 year, 2 years, 3 years)
I want to send the user to different addresses depending on the selection of a billing cycle.
For example:

*

*If 6 months is selected and "Order now" is clicked, the customer will be send to link 1.

*If 1 year is selected and "Order now" is clicked, the customer will be send to link 2.

*If 2 years is selected and "Order now" is clicked, the customer will be sent to link 3.

I want to change the value of the href attribute dynamically for the ORDER NOW button for each billing cycle.
How to do the same?

A: Try following script.

<html>
<head>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js" ></script>
</head>
<body>

<select id="selProduct">
    <option value=1>6 mths</option>
    <option value=2>1 yr</option>
</select>

<input type=button value="Order Now" id="btnOrder" />

<script type="text/javascript">

 $(document).ready(function(){

    $('#btnOrder').click(function(){
        if( $('#selProduct').val() == '1')
            window.location='http://msn.com';
        if( $('#selProduct').val() == '2')
            window.location='http://yahoo.com';
    });
 });

</script>

</body>
   </html>

A: As you mentioned in your comment below you have 3 forms, sorry I was not made aware of this as your question does not state that there is more than one so I have updated my answer, see below.
Javascript
<script type="text/javascript">
    var order = function() {
       //Check which option was selected for product_1 and re-direct
       if (document.getElementById("product_1").value == "6 months"){ document.getElementById("product_1").value = "Select"; window.location.replace('product1_6months.php','_blank'); }
       if (document.getElementById("product_1").value == "1 year"){ document.getElementById("product_1").value = "Select"; window.location.replace('product1_1year','_blank'); }
       if (document.getElementById("product_1").value == "2 year"){ document.getElementById("product_1").value = "Select"; window.location.replace('product1_2year','_blank'); }
       if (document.getElementById("product_1").value == "3 year"){ document.getElementById("product_1").value = "Select"; window.location.replace('product1_3year','_blank'); }

       //Check which option was selected for product_2 and re-direct
       if (document.getElementById("product_2").value == "6 months"){ document.getElementById("product_2").value = "Select"; window.location.replace('product2_6months.php','_blank'); }
       if (document.getElementById("product_2").value == "1 year"){ document.getElementById("product_2").value = "Select"; window.location.replace('product2_1year.php','_blank'); }
       if (document.getElementById("product_2").value == "2 year"){ document.getElementById("product_2").value = "Select"; window.location.replace('product2_2year.php','_blank'); }
       if (document.getElementById("product_2").value == "3 year"){ document.getElementById("product_2").value = "Select"; window.location.replace('product2_3year.php','_blank'); }

       //Check which option was selected for product_3 and re-direct
       if (document.getElementById("product_3").value == "6 months"){ document.getElementById("product_3").value = "Select"; window.location.replace('product3_6months.php','_blank'); }
       if (document.getElementById("product_3").value == "1 year"){ document.getElementById("product_3").value = "Select"; window.location.replace('product3_1year.php','_blank'); }
       if (document.getElementById("product_3").value == "2 year"){ document.getElementById("product_3").value = "Select"; window.location.replace('product3_2year.php','_blank'); }
       if (document.getElementById("product_3").value == "3 year"){ document.getElementById("product_3").value = "Select"; window.location.replace('product3_3year.php','_blank'); }
    }
</script>

HTML
<form action="" method="post" name="product_1">
<select id="product_1">
    <option value="Select" selected>Select</option>
    <option value="6 months">6 months</option>
    <option value="1 year">1 year</option>
    <option value="2 year">2 year</option>
    <option value="3 year">3 year</option>
</select>
</form>

<form action="" method="post" name="producs_2">
<select id="product_2">
    <option value="Select" selected>Select</option>
    <option value="6 months">6 months</option>
    <option value="1 year">1 year</option>
    <option value="2 year">2 year</option>
    <option value="3 year">3 year</option>
</select>
</form>

<form action="" method="post" name="product_3">
<select id="product_3">
    <option value="Select" selected>Select</option>
    <option value="6 months">6 months</option>
    <option value="1 year">1 year</option>
    <option value="2 year">2 year</option>
    <option value="3 year">3 year</option>
</select>
</form>

<input name="order" type="button" value="Order Now" onClick="order()">

Example


text:
Q: Problems for Hail0.2 working on Azure DataBrick Hello? Anyone who can help for Hail 0.2 on Azure DataBrick?
After pip install  lots of problems came out....
can't find Java Package , import hail.plot , hl.init()
According to document
https://docs.azuredatabricks.net/applications/genomics/tertiary/hail.html#create-a-hail-cluster
I've pip install hail
set  ENABLE_HAIL=true       in Cluster Environment Setting
However
import hail as hl
hl.init(sc, idempotent=True)

AttributeError: module 'hail' has no attribute 'init'

Also another document
https://docs.azuredatabricks.net/applications/genomics/tertiary/hail.html
import hail as hl
import hail.expr.aggregators as agg
hl.init(sc, idempotent=True)

ModuleNotFoundError: No module named 'hail.expr'

Anyone can give a solution?
Thanks a lot !!!

A: Are you using the genomics runtime? See https://learn.microsoft.com/en-us/azure/databricks/runtime/genomicsruntime#dbr-genomics to launch a cluster with the genomics runtime. Then Hail will be installed if you set the ENABLE_HAIL=true environment variable.

A: You may want to move to Azure HDInsight, and follow the instructions on the following page, under the Microsoft Azure section:
https://hail.is/docs/0.2/cloud/other_cloud_providers.html
This should get you up and running!


text:
Q: QR Code in Base64 encoding for KSA E-Invoicing In Java How to Create HEXA and BASE 64 QR code for E-Invoicing Saudia Arabia.
There is problem converting hexa to base64 but that is not readable in E-Invoicing system.

A: The Complete Code for this HEXA and BASE64 string to generate QR code.
import org.apache.commons.codec.DecoderException;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.codec.binary.Hex;

import java.nio.charset.StandardCharsets;

public class TestMain {

    public static void main(String args[]) throws DecoderException {
        String tag1 = getHexString(1, "Irfan Nasim");
        String tag2 = getHexString(2, "1234567891");
        String tag3 = getHexString(3, "2021-11-17");
        String tag4 = getHexString(4, "300.00");
        String tag5 = getHexString(5, "75.00");

        String finalString = tag1 + tag2 + tag3 + tag4 + tag5;
        byte[] decodedHex = Hex.decodeHex(finalString.toCharArray());
        String result = Base64.encodeBase64String(decodedHex);
        System.out.println("==> " + result);

    }

    static String getHexString(int tagNo, String tagValue) {
        String tagNumLengthHexString = Integer.toHexString(tagNo);

        int tagValueLength = tagValue.length();
        String tagValueLengthHexString = Integer.toHexString(tagValueLength);

        byte[] tagValueBytes = tagValue.getBytes(StandardCharsets.UTF_8);
        String tagValueHexString = Hex.encodeHexString(tagValueBytes);

        return (0 + tagNumLengthHexString) + (0 + tagValueLengthHexString) + tagValueHexString;
    }
}


text:
Q: MySQL UNION ALL returning only the first table I have a very simple query - I want to get one column with all of the emails from table1(650 rows) and table2(550 rows):
SELECT email
FROM table1
UNION ALL
SELECT email
FROM table2

The result has 650 rows, which is the number of rows in table1. The result should have 1200 rows- the actual sum of both tables' rows.
If I switch the SELECT statements' order - The result has table2's rows - 550.
Any idea why this is happening?
I'm using PhpMyAdmin 4.5.1 with MariaDB 10.1.16 (MySQL)

A: Did some more research, Apparantly this is a phpMyAdmin bug.
See What is phpMyAdmin doing to my UNION ALL query?


text:
Q: Autocomplete for parent objects with jedi-vim I use jedi-vim for completion and it does the thing pretty well. But for some reason I have troubles with completion for parent objects.
For example:
class A:
    variable = 1

class B(A):
    # Won't find any pattern here, only __builtin__.vars
    var # here I hit <C-space>

Is there any settings I should add in my .vimrc or it's just how jedi works? I also dig some issue tracker and didn't find something useful.

A: Speaking as the author of Jedi: This is something that has never really been supported in Jedi. It might have worked, but it was definitely never tested. Please add an issue to the tracker.
It's a bit similar to https://github.com/davidhalter/jedi/issues/585. This is something that isn't completable in a "normal" way. It's rather something that, because of its semantics, can (should?) be enabled.

A: It works very well for me.
But I use a different version of the Jedi.
My bundle is here: https://github.com/FBruynbroeck/jedi-vim
(Attention, at the end of the class B, you wrote a ';' instead of ':')


text:
Q: Dropdown menu to select vector layer from current displayed layers in qgis I'm trying to write a python plugin to create an input file for an urban climate model out of three shape files. One of the shape files contains the buildings (polygon), one the trees (point), and the third one the center point of the new model input file (point).
I therefore need a function to select one layer out of the currently displayed ones. I tried messing around with
qgis.utils.iface.legendInterface().layers()

but then I get some ugly output like
qgis.core.QgsVectorLayer object at 0xb4b6f5c.
Is there a possibility to get readable names out of this? Or is there an easier way to select the layers?
Any ideas or help greatly appreciated!

A: You're returning the layer itself. Go one step further and return the name (property) of the layer. Like this:
layers = qgis.utils.iface.legendInterface().layers()

for layer in layers:
    layerName = layer.name()
    print layerName #or do something else with the name


text:
Q: Gravity Forms HTML Block Bug I recently discovered a bug with gravity forms and I was wondering if you guys could help me and the community.
So, the problem it's with HTML content. I attached the images here. Basically, everything works just fine, when starting a new form, the HTML content it's displayed accordingly.
https://ibb.co/DRJrCzw
 But when someone goes to the next page and then comes back to the first one, the content it's displayed like in the image nr.2.
 https://ibb.co/Qrz8Wbd

A: This fixed it for me!
JacKrac (https://www.reddit.com/user/JacKrac/)
Assuming you are a paying customer, have you reached out to support?
With that said, I believe it is because you are using shortcodes in the text.
The second time you visit it, the form content is likely rendered a different way compared to when the page first loads, likely with an Ajax request and/or javascript the second time around and the shortcode is not being processed.
One thing to try would be to copy the generated HTML and paste that into the HTML block in gravity forms, removing all the shortcode.
So, basically:
Open a text editor and save the current content you have in Gravity Forms, so you have a backup of it.
Open a page to view the form and then use your browser's HTML inspector to copy the HTML
Paste the HTML into gravity forms
If that fixes it, I would still reach out to them and ask them about how shortcode is handled within the html block and also let them know you think you found an issue.


text:
Q: UIPageControllerView recycle pages reducing memory usage I am trying to implement Pagecontroller to show images in horizontal order. But memory goes higher and higher after each swipe. Any solution for reducing memory usage?
I have 100 images that each of them nearly 200kb. But memory usages goes up to 800mb while scrolling.
Note : It gives memory warning on real device but app does not crush.
Here are the classes that I have used for controlling pages.
import UIKit

class PageViewController: UIViewController, UIPageViewControllerDataSource {

    // MARK: - Variables
    private var pageViewController: UIPageViewController?
    var contentImages = [String]()
    // Initialize it right away here

    // MARK: - View Lifecycle
    override func viewDidLoad() {
        super.viewDidLoad()

        for index in 0...93 {
           contentImages.append("pages-\(index).jpg")
        }

        createPageViewController()
        setupPageControl()
    }

    private func createPageViewController() {

        let pageController = self.storyboard!.instantiateViewControllerWithIdentifier("PageController") as UIPageViewController
        pageController.dataSource = self

        if contentImages.count > 0 {
            let firstController = getItemController(0)!
            let startingViewControllers: NSArray = [firstController]
            pageController.setViewControllers(startingViewControllers, direction: UIPageViewControllerNavigationDirection.Forward, animated: false, completion: nil)
        }

        pageViewController = pageController
        addChildViewController(pageViewController!)
        self.view.addSubview(pageViewController!.view)
        pageViewController!.didMoveToParentViewController(self)
    }

    private func setupPageControl() {
        let appearance = UIPageControl.appearance()
        appearance.pageIndicatorTintColor = UIColor.grayColor()
        appearance.currentPageIndicatorTintColor = UIColor.whiteColor()
        appearance.backgroundColor = UIColor.darkGrayColor()
    }

    // MARK: - UIPageViewControllerDataSource

    func pageViewController(pageViewController: UIPageViewController, viewControllerBeforeViewController viewController: UIViewController) -> UIViewController? {

        let itemController = viewController as PageItemController

        if itemController.itemIndex > 0 {
            return getItemController(itemController.itemIndex-1)
        }

        return nil
    }

    func pageViewController(pageViewController: UIPageViewController, viewControllerAfterViewController viewController: UIViewController) -> UIViewController? {

        let itemController = viewController as PageItemController

        if itemController.itemIndex+1 < contentImages.count {
            return getItemController(itemController.itemIndex+1)
        }

        return nil
    }

    private func getItemController(itemIndex: Int) -> PageItemController? {

        if itemIndex < contentImages.count {
            let pageItemController = self.storyboard!.instantiateViewControllerWithIdentifier("ItemController") as PageItemController
            pageItemController.itemIndex = itemIndex
            pageItemController.imageName = contentImages[itemIndex]
            return pageItemController
        }

        return nil
    }

    // MARK: - Page Indicator

    func presentationCountForPageViewController(pageViewController: UIPageViewController) -> Int {
        return contentImages.count
    }

    func presentationIndexForPageViewController(pageViewController: UIPageViewController) -> Int {
        return 0
    }

}

Item Controller
import UIKit

class PageItemController: UIViewController {

    // MARK: - Variables
    var itemIndex: Int = 0
    var imageName: String = "" {

        didSet {

            if let imageView = contentImageView {
                imageView.image = UIImage(named: imageName)
            }

        }
    }

    @IBOutlet var contentImageView: UIImageView?

    // MARK: - View Lifecycle
    override func viewDidLoad() {
        super.viewDidLoad()
        contentImageView!.image = UIImage(named: imageName)
    }
}

A: If you create an UIImage with imageNamed the image will be cached. You can try some of the other constructor methods without caching. But usually the image caching just works.
For example you could try NSBundle.pathForResource(_:ofType:) and UIImage.init(contentsOfFile:).
Or you have some kind of memory leak in the code. I don't know enough Swift to spot any in your code.

A: What's going on here is that UIImage(named:) is caching your image data forever. It's really, seriously, meant to be used only for things that are a) small b) frequently used c) essential to your interface.
In Objective-C you can get at the internal method +_flushSharedImageCache on memory warning, or you could call the internal +removeImageNameFromCache(imageName) when your controller is dealloc'd, if there's some really really good reason to not bother writing your own cache.
But in Swift, just write your own cache and keep a max of a handful of most recently used images in it, it's easy. Here's how I dealt with this kind of problem back when iPhones had 128MB RAM: http://www.alexcurylo.com/blog/2009/01/13/imagenamed-is-evil/


text:
Q: SUM Ranges depending on value with VBA I'm trying to do the following with VBA. Imagine I have some data as it follows:

I would like my final result to be the sum of every data that is between "BEGINDATA" and "ENDDATA". So it would look like this:

My goal is to obtain the green data and write it next to "ENDDATA"
Any idea or suggestion?
Thank you so much!!

A: Try:
Option Explicit

Sub test()

    Dim Lastrow As Long, BeginData As Long, EndData As Long, i As Long

    With ThisWorkbook.Worksheets("Sheet1")

        Lastrow = .Cells(.Rows.Count, "A").End(xlUp).Row

        For i = 1 To Lastrow

            If .Range("A" & i).Value = "BEGINDATA" Then
                BeginData = i
            ElseIf .Range("A" & i).Value = "ENDDATA" Then
                EndData = i
            End If

            If EndData > BeginData Then
                .Range("B" & i).Value = Application.Sum(.Range("B" & BeginData + 1 & ":B" & EndData - 1))
            End If

        Next i

    End With

End Sub

Another Version:
Option Explicit

Sub test()

    Dim Lastrow As Long, BeginData As Long, EndData As Long, i As Long

    With ThisWorkbook.Worksheets("Sheet1")

        Lastrow = .Cells(.Rows.Count, "A").End(xlUp).Row

        For i = 1 To Lastrow

            If .Range("A" & i).Value = "BEGINDATA" Then
                BeginData = i
            ElseIf .Range("A" & i).Value = "ENDDATA" Then
                EndData = i
            End If

            If EndData > BeginData Then
                With .Range("B" & i)
                    .Value = Application.Sum(Sheet1.Range("B" & BeginData + 1 & ":B" & EndData - 1))
                    .Interior.Color = vbGreen
                End With
            End If

        Next i

    End With

End Sub

A: You can also achieve this using Find which will be faster then looping
Option Explicit
Sub Demo()
    Dim BeginData As Range, EndData As Range
    Dim FirstBeginAddress As String

    ' Update with your range
    With Sheet1.Columns(1)
        Set BeginData = .Find(what:="BEGINDATA", after:=.Cells(.Cells.Count), LookIn:=xlValues, lookat:=xlWhole)

        If Not BeginData Is Nothing Then
            FirstBeginAddress = BeginData.Address
            Set EndData = .Find("ENDDATA", after:=BeginData)
            Do
                Debug.Print "BeginAddress", BeginData.Address
                If Not EndData Is Nothing And EndData.Row > BeginData.Row Then
                    Debug.Print "EndAddress", EndData.Address
                    '' For Formula
                    EndData.Offset(0, 1).Formula = "=SUM(" & Range(BeginData.Offset(1, 1), EndData.Offset(-1, 1)).Address & ")"
                    '' For value
                    'EndData.Offset(0, 1).Value2 = Application.Sum(Range(BeginData.Offset(1, 1), EndData.Offset(-1, 1)))
                    Set EndData = .Find("ENDDATA", after:=EndData)
                Else
                    Err.Raise 998, "Demo", "Unable to find Data Footer"
                End If
                Set BeginData = .Find("BEGINDATA", after:=BeginData)
            Loop Until BeginData Is Nothing Or BeginData.Address = FirstBeginAddress
        Else
            Err.Raise 999, "Demo", "Unable to find Data Header"
        End If
    End With
End Sub


text:
Q: Android: Populating a Table with an Arraylist from another Activity I need to be pointed in the right direction here.
I've got an Arraylist(String) of names, and an Arraylist(String) of ratings. I want to display the names in column 1, and the rating values in column 2 in such a way that the user can see the name, and the rating they gave beside it in a tablelayout in the next activity.
The arraylists exist in the main activity, and need to be sent to the next activity, let's call it 'Activity Two'. Not sure how to achieve this with Arraylists.
So, basically. I need to know..
How to create a table layout column that will display the user entered data dynamically, and receives that data from an Arraylist in another activity.
Any advice is greatly appreciated my fellow Wizards.

A: One suggestion is to simple write the data out to a SharedData.  Then you could call it back from any activity at any time.
I do this to have preferences set in one view that are then used later by a widget.  Same app.  Different views.  Same data.
To clarify:
I think I used to wrong term in saying SharedData.  What I really should have said was "SharedPreferences".
The way it works is, at some point in your activity, you write the data out.  You just tell it what values to write to what keys, and there it is.  In the background, the system stores an XML file unique to your app.  Once that file is there, any other activity in your app can call it up to retrieve the values.
The full explanation for this can be found here:
http://developer.android.com/guide/topics/data/data-storage.html
I use this for an app where the actual main activity is a Widget.  The preferences for that widget are called up from SharedPreferences.  Those preferences are initially written in a normal full screen activity.  Once you set them, you close the activity, and the next time the widget updates, it grabs the current values.

A: If you already have the information for your ArrayList and are simply calling a new Intent to open you should be able to pass this information in a Bundle to the new class. Since ArrayList implements Serializable you can pass the entire array to the new intent in a bundle and then load that in the new intent that you created.
    // Class that you have the ArrayList in MainActivity
    ArrayList<String> names = new ArrayList<>();
    names.add("NAME 1");
    names.add("NAME 2");

    ArrayList<String> ratings = new ArrayList<>();
    ratings.add("10");
    ratings.add("8");

    // Create the Bundle and add the ArrayLists as serializable
    Bundle bundle = new Bundle();
    bundle.putSerializable("NAMES", names);
    bundle.putSerializable("RATINGS", ratings);

    // Start new intent with ArrayList Bundle passed in
    Intent intent = new Intent(this, ActivityTwo.class);
    intent.putExtra("KEY", bundle);
    startActivity(intent);

Now that you have passed in the ArrayLists you need to extract that information in the new Intent that you called. This should be done in the onCreate of ActivityTwo
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_phone_list_custom);

    // Get Extras that were passed in
    Bundle extras = getIntent().getExtras();

    // Not null then we can do stuff with it
    if (extras != null) {
        // Since we passed in a bundle need to get the bundle that we passed in with the key  "KEY"
        Bundle arrayListBundle = extras.getBundle("KEY");
        // and get whatever type user account id is

        // From our Bundle that was passed in can get the two arrays lists that we passed in - Make sure to case to ArrayList or won't work
        ArrayList<String> names = (ArrayList) arrayListBundle.getSerializable("NAMES");
        ArrayList<String> ratings = (ArrayList) arrayListBundle.getSerializable("RATINGS");

        // TODO Make this do more than just log
        Log.i(TAG, "Name=" + names.get(0) + " Rating=" + ratings.get(0));
        Log.i(TAG, "Name=" + names.get(1) + " Rating=" + ratings.get(1));

    }


text:
Q: Error in Office 2010 when deploying as part of .wim? We're deploying Windows onto PCs with a very simple VM image setup, capture, and deploy using WinPE and imagex to create a single .wim with no network dependencies or capabilities involved in the setup process aside from adding the PC to the domain using our naming convention. It's quite a humble and truly "thrown together" solution, but it works well enough for our purposes (despite demonstrated need for more attention paid, but I digress).
The only true issue I'm having with this is our Office 2010 install. I've installed Office, repaired it, and reinstalled it several times (all pre-sysprep, as it must be there before sysprep), but I always get this error pop-up on the first run of any Office application that reads:
"Microsoft Access 2010 requires Visual Basic for Applications. If you continue, Visual Basic for Applications will be installed."
The message specifies Access no matter which Office application runs. Even after this goes through, Outlook no longer recognizes and sets itself up with domain usernames. It must be done manually. However, it Office has a repair operation run before any Office application is launched, everything works perfectly and without error.
Given the rest of the machine works perfectly on deployment, I'm heavily leaning toward the sentiment that Office was never meant to be deployed via sysprep & image capture.
Is this true? More to the point, is there a way around this without spreading the system into MDT, SCCM, etc?


text:
Q: Prove $3$ is a primitive root modulo $p$ given $\;p\equiv 2 \;\text{mod}\; 3\;$, $\;p-1=4q\;$, for $q$ prime. Let $p$ be a prime number which satisfies the following two conditions:
(i) $p\equiv 2 \;\text{mod}\; 3$
(ii) $p-1=4q$ where $q$ is also a prime number.
Show:
(a) that $3^4\not\equiv 1\; \text{mod}\; p$
(b) that $3^{2q}\not\equiv 1\; \text{mod}\; p$
(c) now that $3$ is a primitive root modulo $p$. [Hint: Use the results from parts (a) and (b).]
Now I haven't gotten very far with this at all. I've tried using the fact that there has to be a primitive root mod $p$ and then assumed that $3^4\equiv 1\; \text{mod}\; p$ and tried to find a contradiction but to no avail. I've found that $4|kp$ where $k\in \mathbb{Z}$. Not sure if I can infer from that, that $4|p$ which would be a contradiction. I'm not sure if there is something that I'm fundamentally missing as it seems to lead you into the question. Any hints would be appreciated.

A: Outline: We find the order of $3$ modulo $p$. This order must divide $p-1$, that is, $4q$. Note that $q$ is an odd prime. So the possible orders of $3$ modulo $p$ are $1,2,4,q,2q,4q$. We need to show the order is $4q$, so we need to eliminate the other possibilities. Together, (a) and (b)  do that.
Proving (a) can be done by calculation. To prove (b), it is enough to show that $3$ is not a quadratic residue of $p$. That can be done using the given information, and Reciprocity.


text:
Q: Is 'the tedious' the same as 'tedious things'? I mean, does it mean 'tedious tasks' in the context?

According to the consulting firm McKinsey, knowledge workers spend up
  to 60 percent of their time looking for information, responding to
  emails, and collaborating with others. By using social technologies,
  those workers can become up to 25 percent more productive. The need
  for productivity gains through working harder and longer has a limit
  and a human toll. The solution is to enable people to work smarter,
  not just by saying it, but by putting smart tools and improved
  processes in place so that people can perform at enhanced levels.
  Think of it as the robotassisted human, given superpowers through the
  aid of technology. Our jobs become enriched by relying on robots to do
  the tedious while we work on increasingly more sophisticated tasks.

Stretch: How to Future-Proof Yourself for Tomorrow's Workplace
By Karie Willyerd, Barbara Mistick

A: Yes, tedious tasks or tedious work- your interpretation is correct.
Edit- for reference, here's what Merriam-Webster says about this use of "the" (definition 3b):

—used as a function word before a singular substantivized adjective to indicate an abstract idea

// an essay on the sublime

https://www.merriam-webster.com/dictionary/the


text:
Q: How to evaluate Sum with Singularities? I derived equation of sum from the following problem,
$\int_{a}^{b}\sum_{n=0}^{\infty} cos^n(x)dx$.
Using the following definitions,
$cos(x)=\frac{e^{ix}+e^{-ix}}{2}$ and $(a+b)^n=\sum_{m=0}^{n}\binom {n}m a^{n-m}b^m$,
my solution to the above is,
$\sum_{n=0}^{\infty}\sum_{m=0}^{n} \binom {n}m (-i)\frac{e^{i(n-2m)}}{n-2m} $.
However, Mathematica cannot evaluate this summation because of singularities. Either my derivation is incorrect although steps are valid or I must add conditionals to this summation evaluation (if it is valid way to do).  If my derivation is correct, how do I evaluate this summation,
Sum[Sum[-I*Binomial[n,m]*Exp[I*(n-2*m)/(n-2*m)),{m,0,n}],{n,0,100}]

Is there a way to avoid singularities? Like $n \neq 2m$

A: A direct approach to your problem works
sum = Sum[Cos[x]^n, {n, 0, ∞}]
(* 1/(1 - Cos[x]) *)

Integrate[sum, x]
(* -Cot[x/2] *)

Of course, the answer is only valid if the interval doesn't span a singularity (where Cos[x]==1)


text:
Q: Removing blank lines and spaces in text file using batch I have a batch file which is checking the value of a registry key.
I have the file reading the value and deleting the blank line at the beginning of the file, but there are still spaces in the output which need removing.
The script appears not to read the output properly if it contains spaces.
Here is the code I am using:
@echo off

md c:\temp
md c:\temp\Reg_Test

reg query HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319 /v SchUseStrongCrypto > c:\temp\Reg_test\AfterRegUpdate32.log

findstr /v /r /c:"^$" /c:"^\ *$" /c:"^\ *$" "C:\temp\Reg_Test\AfterRegUpdate32.log" >> "C:\temp\Reg_Test\AfterRegUpdate32.txt"

exit

It appears to do everything I need except for deleting the spaces. I know there is something simple I am missing here. Any help will be greatly appreciated.

A: Is this what you're trying to retrieve:
@Echo Off
MD "C:\temp\Reg_Test" 2>Nul
(For /F "EOL=H Tokens=2*" %%A In (
    'Reg Query "HKLM\SOFTWARE\Microsoft\.NETFramework\v4.0.30319" /V "SchUseStrongCrypto" 2^>Nul'
) Do Echo %%B)>"C:\temp\Reg_Test\AfterRegUpdate32.txt"


text:
Q: Is there an example for manim Button Mobject? I'm running into a little issue here when reading the source code of manimgl.
In the interactive.py file, it implements a Button Mobject and it needs a on_click method to be passed into. I don't know how to implement such a thing and I don't really know what add_mouse_press_listner is.
Is there any example? Or can anybody explain how those methods can be implemented?
I tried to find the association with on_mouse_press, but I don't know how to use that as well. So, I'm kind of stuck here.


text:
Q: Gradle can't find tools.jar I found this post but the answer did not solve my problem. The answers only address windows systems and provide file paths which are not helpful for the OS I am running.
I am running openSUSE Leap 15 with Java 1.8, changing the OS or Java version is not an option.
When I try to build with the command ./gradlew clean build i get the following error:
:buildtools:compileJava FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':buildtools:compileJava'.
> Could not find tools.jar. Please check that /usr/lib64/jvm/java-1.8.0-openjdk-1.8.0/jre contains a valid JDK installation.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 15.364 secs

I have checked my Java installation like this:
 $> rpm -qa | grep java
javapackages-tools-5.0.0+git20180104.9367c8f6-lp150.1.2.x86_64
timezone-java-2018g-lp150.2.13.1.noarch
java-1_8_0-openjdk-1.8.0.181-lp150.2.6.1.x86_64
libjavascriptcoregtk-4_0-18-2.20.5-lp150.2.6.1.x86_64
java-1_8_0-openjdk-headless-1.8.0.181-lp150.2.6.1.x86_64

I also checked out JAVA_HOME:
$> echo $JAVA_HOME
/usr/lib64/jvm/jre-1.8.0-openjdk

A: The comments inspired me to find a solution. Apparently installing the package java-1_8_0-openjdk will only provide the OpenJDK 8 runtime environment. I wrongly expected it to include the development tools because of the 'jdk' in its name (Java Development Kit).
My problem was solved by simply installing the package java-1_8_0-openjdk-devel which actually includes the development tools, like this: sudo zypper in java-1_8_0-openjdk-devel.
The command zypper se jdk can help you to figure out the status of your jdk installation. After installing the package java-1_8_0-openjdk-devel you should see an i+ next to the package name. You should be able to spot the following two lines:
i+ | java-1_8_0-openjdk        | OpenJDK 8 Runtime Environment      | package
i+ | java-1_8_0-openjdk-devel  | OpenJDK 8 Development Environment  | package


text:
Q: How to load test java REST web service without using any tool I have a REST Service method and need to load test it.
Unfortunately i don't have admin rights to my laptop and can not install/download any tool.
Need to know the capacity of the REST service (web project in tomcat) like how many concurrent requests it can handle. I don't require any other information or details.
Here are some details about the REST api:
Method: POST
Technology: Spring MVC
Response object is very complex and huge form, requiring 100's of objects.

Is there any way to do it using core java application (post to a REST URL, get the response, and find maximum concurrent requests supported by API)
In core java i can use apache http, spring or core java 7/8

A: I am able to do load testing using following code using java 7 Executors and URLConnection :
public class POSTProcessor {

    class ManagedProcessor implements Callable {

    public void postMessage() {
        //Test execute single call for REST web service with URLConnection
    }

    @Override
    public Object call() throws Exception {
        postMessage();
        return null;
    }

    }

    public static void main(String[] args) {
        long time1 = System.currentTimeMillis();
        int size = 200;
        ExecutorService loadExecutor = Executors.newFixedThreadPool(size);
        POSTProcessor threadRunner = new POSTProcessor();
        List jobs = new ArrayList();
        for(int i=0;i<size;i++){
            ManagedProcessor exec = threadRunner.new ManagedProcessor() ;
            jobs.add(exec);
        }
        try {
            loadExecutor.invokeAll(jobs);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        long time2 = System.currentTimeMillis();

        System.out.println("Time delay: " + ( (time2 - time1)/size));
        loadExecutor.shutdown();
    }
}


text:
Q: Does appending a list to another list in F# incur copying of underlying objects or just the pointers? I've always thought that appending a list to another one meant copying the objects from the first list and then pointing to the appended list as described for example here.
However, in this blog post and in its comment, it says that it is only the pointers that are copied and not the underlying objects.
So what is correct?

A: Drawing from Snowbear's answer, a more accurate image of combining two lists (than the one presented in the first referred article in the question) would be as shown below.
let FIRST = [1;2;3]
let SECOND = [4;5;6]
let COMBINED = FIRST @ SECOND

A:
In the functional world, lists are immutable. This means that node sharing is possible because the original lists will never change. Because the first list ends with the empty list, its nodes must be copied in order to point its last node to the second list.

If you mean this statement then the answer is seems to be pretty simple. Author of the first article is talking about list node elements when he says nodes. Node element is not the same as the list item itself. Take a look at the pictures in the first article. There are arrows going from every element to the next node. These arrows are pointers. But integer type (which is put into the list) has no such pointers. There is probably some list node type which wraps those integers and stores the pointers. When author says that nodes must be copies he is talking about these wrappers being copied. The underlying objects (if they were not value types as in this case) would not be cloned, new wrappers will point to the same object as before.

A: F# lists hold references (not to be confused with F#'s ref) to their elements; list operations copy those references (pointers), but not the elements themselves.
There are two ways you might append items to an existing list, which is why there seems to be a discrepancy between the articles (though they both look to be correct):

*

*Cons operator (::): The cons operator prepends a single item to an F# list, producing a new list. It's very fast (O(1)), since it only needs to call a very simple constructor to produce the new list.

*Append operator (@): The append operator appends two F# lists together, producing a new list. It's not as fast (O(n)) because in order for the elements of the combined list to be ordered correctly, it needs to traverse the entire list on the left-hand-side of the operator (so copying can start at the first element of that list). You'll still see this used in production if the list on the left-hand-side is known to be very small, but in general you'll get much better performance from using ::.


text:
Q: How to play sound in notification extension service? My code:
NSString *soundFilePath = [[NSBundle mainBundle] pathForResource:@"autumn_leaves" ofType:@"m4a"];
NSURL *soundFileURL = [NSURL fileURLWithPath:soundFilePath];

NSError *error;
AVAudioPlayer *player = [[AVAudioPlayer alloc] initWithContentsOfURL:soundFileURL
                                               error:&error];
player.numberOfLoops = -1; //Infinite

[player play];

How can I play a sound using avplayer in notification extension service?


text:
Q: Cannot implicitly convert type 'void' to 'bool' Why is this bit of code:
    protected bool IsServerPeer(InitRequest initRequest)
    {
        return _subServerCollection.IsServerPeer(initRequest);
    }

creating the error:
Cannot implicitly convert type 'void' to 'bool'

A: Probably because _subServerCollection.IsServerPeer() has the return type void

A: Check the return value from _subServerCollection.IsServerPeer. It might not returning boolean value. From the error message the above method might have return type void(nothing returned from the method).


text:
Q: Integration of Spring Oauth2 implementation with the HTML front end using javascript I am implementing spring oauth2 for securing my rest api. Basically i am limiting the use of rest api to particular users rather then limiting to every users.
I had implemented the backend and secured my api using spring oauth2.
I am following this steps:
1)Send the GET request with the five parameters.
localhost:8080/SpringRestSecurityOauth/oauth/token?grant_type=password&client_id=Awyi123nasdk89&client_secret=asdj39m32@#$s&username=rahul@gmail&password=rahul@9831
2) Server validates the user with the help of spring security and return the json response with access code.
{
"access_token": "22cb0d50-5bb9-463d-8c4a-8ddd680f553f",
"token_type": "bearer",
"refresh_token": "7ac7940a-d29d-4a4c-9a47-25a2167c8c49",
"expires_in": 119
}
3)I access protected resources by passing this access token as a parameter, the request goes something like this:
localhost:8080/SpringRestSecurityOauth/api/users/?access_token=8c191a0f-ebe8-42cb-bc18-8e80f2c4238e
4) In case the token is expired, user needs to get a new token using its refreshing token that was accepted in step(2). A new access token request after expiration looks something like this:
localhost:8080/SpringRestSecurityOauth/oauth/token?grant_type=refresh_token&client_id=restapp&client_secret=restapp&refresh_token=7ac7940a-d29d-4a4c-9a47-25a2167c8c49
All the above step are working fine. Now i need to implement this on my client side. So that a particular client can access this call. I am using HTML/CSS as client side technology.
How client can get the access token? Should it be stored in the browser local storage? Or it should be generated every time the rest call is been made?
Any example would help me to proceed further.

A: I'm implementing my project like you. I use angularjs and get the access token from response json then store it into cookies.
This link provide sample code for you: http://www.baeldung.com/rest-api-spring-oauth2-angularjs. (See Frontend - Password Flow).
Because refresh token should keep secret and the client is html app, you should see this link http://www.baeldung.com/spring-security-oauth2-refresh-token-angular-js for handling refresh token.
For html client, after obtaining access token using refresh token when access token is expired, I use http-auth-interceptor ([http]://witoldsz.github.io/angular-http-auth/) to retry all rest requests failed because of expired access token.
I'm sorry that I have not enough reputation to post more than 2 links.