text:
Q: Disable dropdown list in MVC3 I have filled up dropdown as:
Controller:
var db = new TransFormezEntities()
ViewBag.fldCountry_ID = new SelectList(db.tblCountries, "fldCountry_ID",
                                    "fldCountryName", stateDetails.fldCountry_ID)

View

Country

<div class="display-field" id = "fldCountry_ID">
      @Html.DropDownList("fldCountry_ID", "[Select]")
</div>

I want to make it readonly or disable how can i please ?

A: try following code snippets
For disabled
  Html.DropDownList("fldCountry_ID", ViewBag.fldCountry_ID ,
                                       new { @disabled = "disabled" })

For readonly
Html.DropDownList("fldCountry_ID", ViewBag.fldCountry_ID ,
                                  new { @readonly = "true" })


text:
Q: Why AngularJS sends X-XSRF-TOKEN header as JSON string? Angular sets the X-XSRF-TOKEN header to the value of the XSRF-TOKEN cookie:
var xsrfValue = isSameDomain(config.url, $browser.url())
                ? $browser.cookies()[config.xsrfCookieName || defaults.xsrfCookieName]
                : undefined;
if (xsrfValue) {
  headers[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue;
}

But, if one sets the XSRF-TOKEN cookie using $cookieStore (for Rails integration, for example):
$cookieStore.put("XSRF-TOKEN", "my_token");

the cookie is stored as JSON string:
put: function(key, value) {
  $cookies[key] = angular.toJson(value);
}

This means that the header will have the extra double quotes:
X-XSRF-TOKEN    "my_token"

Why Angular doesn't call fromJson() when it sets the value of the header so that the header will look like this:
X-XSRF-TOKEN    my_token

?
That would save us from removing the extra double quotes on the server side.
Am I missing something obvious here?
Note: I'm not looking for workarounds. I'm trying to understand whether this behavior is the intended behavior, and if yes, what is the rationale?

A: Here is the official answer I got:

The real problem here is that you are trying to use the $cookieStore
  for the wrong purpose. The $cookieStore is an abstraction on top of
  $cookie, which works with objects and serializes them to JSON. If you
  want to assign the XSRF token then just use $cookie to write it, which
  works directly with strings.

In other words, one should do:

$cookies["XSRF-TOKEN"] = "my_token"; // Stored as: my_token

rather than:

$cookieStore.put("XSRF-TOKEN", "my_token");   // Stored as: "my_token"

redpajama_set_name: RedPajamaStackExchange


text:
Q: Why do I see different files in Visual Studio Code terminal and Linux terminal? I noticed that a lot of commands were missing when using VSCode terminal. So I tried a ls -l / on both my distro's and VSCode's terminals.
Linux Mint Xfce Terminal:
livy@linux-mint:~$ ls -l /
total 2097252
drwxr-xr-x   2 root root       4096 Aug 13 15:13 bin
drwxr-xr-x   4 root root       4096 Aug 13 15:15 boot
drwxr-xr-x   2 root root       4096 Aug 13 15:06 cdrom
drwxr-xr-x  20 root root       4260 Aug 15 08:40 dev
drwxr-xr-x 147 root root      12288 Aug 13 16:46 etc
drwxr-xr-x   4 root root       4096 Aug 13 15:06 home
lrwxrwxrwx   1 root root         33 Aug 13 15:07 initrd.img -> boot/initrd.img-4.15.0-54-generic
lrwxrwxrwx   1 root root         33 Aug 13 15:04 initrd.img.old -> boot/initrd.img-4.15.0-54-generic
drwxr-xr-x  23 root root       4096 Aug 13 15:07 lib
drwxr-xr-x   2 root root       4096 Jul 29 19:15 lib64
drwx------   2 root root      16384 Aug 13 14:59 lost+found
drwxr-xr-x   2 root root       4096 Jul 29 19:14 media
drwxr-xr-x   2 root root       4096 Jul 29 19:14 mnt
drwxr-xr-x   3 root root       4096 Aug 13 15:18 opt
dr-xr-xr-x 214 root root          0 Aug 15 08:40 proc
drwx------   4 root root       4096 Aug 13 15:07 root
drwxr-xr-x  32 root root        940 Aug 15 08:41 run
drwxr-xr-x   2 root root      12288 Aug 13 15:14 sbin
drwxr-xr-x   2 root root       4096 Jul 29 19:14 srv
-rw-------   1 root root 2147483648 Aug 15 08:40 swapfile
dr-xr-xr-x  13 root root          0 Aug 15 09:31 sys
drwxrwxrwt  15 root root       4096 Aug 15 08:53 tmp
drwxr-xr-x  11 root root       4096 Jul 29 19:14 usr
drwxr-xr-x  11 root root       4096 Jul 29 19:50 var
lrwxrwxrwx   1 root root         30 Aug 13 15:07 vmlinuz -> boot/vmlinuz-4.15.0-54-generic

And here is the result from VSCode terminal:
livy@linux-mint:~$ ls -l /
total 2097204
drwxr-xr-x   6 nfsnobody nfsnobody       4096 Aug 13 16:00 app
lrwxrwxrwx   1 livy      livy               7 Aug 15 09:13 bin -> usr/bin
drwxr-xr-x   2 livy      livy              80 Aug 15 09:13 boot
drwxr-xr-x   2 nfsnobody nfsnobody       4096 Aug 13 15:06 cdrom
drwxr-xr-x   5 livy      livy             340 Aug 15 09:13 dev
drwxr-xr-x  15 livy      livy             860 Aug 15 09:13 etc
drwxr-xr-x   4 nfsnobody nfsnobody       4096 Aug 13 15:06 home
lrwxrwxrwx   1 livy      livy              33 Aug 15 09:13 initrd.img -> boot/initrd.img-4.15.0-54-generic
lrwxrwxrwx   1 livy      livy              33 Aug 15 09:13 initrd.img.old -> boot/initrd.img-4.15.0-54-generic
lrwxrwxrwx   1 livy      livy               7 Aug 15 09:13 lib -> usr/lib
lrwxrwxrwx   1 livy      livy               9 Aug 15 09:13 lib64 -> usr/lib64
drwx------   2 nfsnobody nfsnobody      16384 Aug 13 14:59 lost+found
drwxr-xr-x   2 nfsnobody nfsnobody       4096 Jul 29 19:14 media
drwxr-xr-x   2 nfsnobody nfsnobody       4096 Jul 29 19:14 mnt
drwxr-xr-x   3 nfsnobody nfsnobody       4096 Aug 13 15:18 opt
dr-xr-xr-x 209 nfsnobody nfsnobody          0 Aug 15 09:13 proc
drwxr-xr-x   6 livy      livy             160 Aug 15 09:13 run
lrwxrwxrwx   1 livy      livy               8 Aug 15 09:13 sbin -> usr/sbin
drwxr-xr-x   2 nfsnobody nfsnobody       4096 Jul 29 19:14 srv
-rw-------   1 nfsnobody nfsnobody 2147483648 Aug 15 08:40 swapfile
drwxr-xr-x   7 livy      livy             140 Aug 15 09:13 sys
drwxr-xr-x   4 livy      livy              80 Aug 15 09:13 tmp
drwxr-xr-x  12 nfsnobody nfsnobody       4096 Aug 13 16:00 usr
drwxr-xr-x   7 livy      livy             160 Aug 15 09:13 var
lrwxrwxrwx   1 livy      livy              30 Aug 15 09:13 vmlinuz -> boot/vmlinuz-4.15.0-54-generic

From the file owners, permissions, and modification date... it looks like they are working on different file systems. VSCode's /bin even points to /usr/bin, while it is not the case in Xfce terminal. The strange thing is that I can still use VSCode's terminal to navigate my home directory (/home/livy) and make changes to files. It even sources the content of my ~/.bashrc file.
What I am missing here?

A: I was having this exact same issue and discovered that the cause was that VSCode was installed as a Flatpak package. Uninstall it (be it a snap or a Flatpak package) and install the .deb file distributed by Microsoft.


text:
Q: Find the value of- $\lim_{x \rightarrow -\infty}\sum_{k=1}^{1000} \frac{x^k}{k!}$
QUESTION: Find the value of-  $$\lim_{x \rightarrow -\infty}\sum_{k=1}^{1000} \frac{x^k}{k!}$$

MY ANSWER: Since $x→-\infty$ therefore the summation will look like-
$$ \frac{-\infty^1}{1!}+ \frac{-\infty^2}{2!} + \frac{-\infty^3}{3!} + \frac{-\infty^4}{4!}$$
Now, we know that $${-\infty^{even}}=\infty$$
And $1000$ can be broken down into 500 pairs. And since $k$ is finite the terms will look like $$ -\infty + \infty -\infty +\infty-.....$$
Hence, we can conclude that the overall limit of the summation will tend to zero.
Am I correct?
Thank you for your help.

A: One may observe that, for $x\neq0$,
$$
\sum_{k=1}^{1000} \frac{x^k}{k!}=\color{red}{\frac{x^{1000}}{1000!}}\times\left(\color{red}1+\frac{1000!}{x\times999!}+\frac{1000!}{x^2\times998!}+\cdots+ \frac{1000!}{x^{1000}\times1!}\right)
$$ giving that
$$
\begin{align}
\lim_{x \rightarrow -\infty}{\sum_{k=1}^{1000} \frac{x^k}{k!}} &=\lim_{x \rightarrow -\infty} \color{red}{\frac{x^{1000}}{1000!}}\times \lim_{x \rightarrow -\infty}\left(\color{red}1+\frac{1000!}{x\times999!}+\frac{1000!}{x^2\times998!}+\cdots+ \frac{1000!}{x^{1000}\times1!}\right)
\\\\&=\lim_{x \rightarrow -\infty} \color{red}{\frac{x^{1000}}{1000!}}\times \color{red}1
\\\\&=\infty.
\end{align}
$$


text:
Q: Configurations for Solr NLP Integeration I wish to use OpenNLP with SOLR . I have gone through the SOLR wiki and all the configurations given in it for the same. are there some special request handlers that need to be written? If no then what all configurations are there that can be made in schema and config file to get the SOLR NLP integration up and running.
I have used Open NLP individually for other text analysis processes.
Thanks in advance.

A: There seem to be some instructions from Solr team on setting that up here: http://wiki.apache.org/solr/OpenNLP.


text:
Q: Get key code with javascript input event I need to grab the input from keyboard and put it in a div. I also want to grab copy pasted string from the editor. So I am using input event instead of keyup.
To do this I need to grab the char code and convert it to a string. But I found that e.which won't work with input (at least not working with me, not quite sure about others). It is returning 0 everytime.
I want to keep the "input" event. So how do I get the key code for this event?

var editor=document.getElementById('editor');
var content=document.getElementById('content');

editor.addEventListener('input',function(e){
    alert(e.which);
});
#editor{
    position:relative;
    width:500px;
    height:400px;
    border:1px solid black;
    word-wrap: break-word;
    padding-left:4px;
    padding-right:4px;
    padding-bottom:1em;
    box-sizing:border-box;
    overflow:scroll;
}

A: It is because input is not a KeyboardEvent and Event.which is a property of KeyboardEvent.
So if you want to get e.which then you need to use one of the available keyboard events like keypress, keyup or keydown


text:
Q: Find Upper Right Point of Rotated Rectangle in AS3 (Flex) I have a rectangle of any arbitrary width and height. I know X,Y, width, and height. How do I solve the upper right hand coordinates when the rectangle is rotated N degrees? I realized if it were axis aligned I would simply solve for (x,y+width). Unforunatly this doesn't hold true when I apply a transform matrix on the rectangle to rotate it around its center.

A: It's usually easiest and fastest to let Flash's display code do these kinds of things for you. Create an empty Sprite and put it inside the rectangle's display object at the corner you want to track. Then, find the location of that sprite in the coordinate space of your choice:
var p:Point = new Point(0,0);
myRectangle.myCornerSprite.localToGlobal( p );
someDisplayObject.globalToLocal( p ); // for a coord space besides the stage

This gets you out of making any assumptions about the rectangle's design (i.e. registration point), and works even if the rectangle should be skewed or scaled as well as being rotated. Plus, this will be much easier to implement and maintain then a mess of cosines and whatnot.
(Note that the code above assumes that "upper right" refers to a specific corner - if you want to examine whichever corner happens to upper-rightmost at the moment, I'd simply add do the same thing with a sprite at all four corners, and pick whichever is to the upper right in global coords.)

A: You just have to calculate the point on a circle for the given radius. The center of your rectangle will be the circle's origin and any corner will be a point on the circle's circumference. You need to use trigonometry to calculate the new point using the rotation. I don't have time right now to explain all this, but here is a link to a decent 2D Javascript library I've used in the past and which should give you everything you need (bearing in mind that the math is virtually the same in Javascript and ActionScript) to work it out for yourself.
http://jsdraw2d.jsfiction.com/viewsourcecode.htm


text:
Q: AngularJS and RequireJS dispose controller I have been reading about AngularJS and RequireJS in order to load dynamically controllers on the fly.
This is the best tutorial I have found by Dan Wahlin:
http://weblogs.asp.net/dwahlin/archive/2013/05/22/dynamically-loading-controllers-and-views-with-angularjs-and-requirejs.aspx
My concern is how to dispose a controller when you don't need it. Because loading controllers on the fly at the end will come up with a lot of JavaScript loaded in the browser. EXTJS Loader I think has that functionality.
Appreciate any comment.
Thanks


text:
Q: Bootstrap: Display text on hover image I am creating a website for the first time with Bootstrap3 and have a page with 3 images which will be links to galleries. These images are not thumbnails.
I have alternative images (B+W) for hovering and so my code currently changes the image from colour to B+W on hover.
I want to be able to also include a text overlay on hover so people will know to click through to the gallery. So, I'm looking to add text on hover to the B+W image. Alternatively, I would make the colour image less opaque and add text to that, if it's easier!
Here's my html code currently.

Thanks in advance.

A: try adding a title attribute :


text:
Q: Python - Regular expression to extract data from a variable I am trying to extract the name stored in the variable below. I am trying to extract using regular expression but I am getting a invalid syntax error.
import re
var = 'Thomas/Male/'
output = re.search('([\w.-]+)/([\w.-]+)', var)
if output:
    print output.group(1)

Expected output 1 : Thomas
Expected output 2 : Male
Could anyone help on this. Thanks

A: Check variables, and in python3 print() not print
import re
var = 'Thomas/Male/'
output = re.search('([\w.-]+)/([\w.-]+)', var)
if output:
    print(output.group(0))
    print(output.group(1))
    print(output.group(2))

Output:
Thomas/Male
Thomas
Male

A: You can use str.split
var = 'Thomas/Male/'
var = var.split("/")
print(var[0], " = " ,var[1])

Output:
Thomas = Male

A: You can search for alphanumeric characters:
import re
var = 'Thomas/Male/'
name, gender = re.findall('\w+', var)

Output:
'Thomas'
'Male'

A: If the data is always in the form you posted (something/somethingElse/) you could probably accomplish this easier by using split() rather than regex:
var = 'Thomas/Male/'
var_split = var.split('/')
print(var_split[0])
print(var_split[1])

Output:
Thomas
Male


text:
Q: Multiple objects in a ThreadLocal Can we set more than one object in a ThreadLocal ?

A: You can have multiple ThreadLocal and you can have an object in it which contains multiple objects.
e.g.
final ThreadLocal<Map<String, String>> localProperties = new ThreadLocal<Map<String, String>>() {
     public Map<String, String> initialValue() {
           return new LinkedHashMap<String, String>();
     }
});

A: A thread local is a local variable of the current thread; so each thread gets exactly one value. But the value can be an instance, so you can put a map in there, for example or a custom type which collects all the values that you want.

A: We can create multiple ThreadLocal objects in a single Thread and access it using a particular ThreadLocal object's get() method.
Actually a ThreadLocal has a static inner class called ThreadLocalMap and its a customized hashmap, where key in this customized map is ThreadLocal object and value is value to be stored.
Every thread holds the reference of this threadLocalMap object.


text:
Q: Access value of object from json_decode I'm trying to access at value of key->value,
this is my var_dump of $data = json_decode($_POST['data']);
array(8) {
    [0]=> object(stdClass) {
        ["key"]=> string(7) "address"
        ["value"]=> string(16) "via le mani dal "
    }
    [1]=> object(stdClass) {
        ["key"]=> string(21) "tempistica_in_vendita"
        ["value"]=> string(18) "Tra più di 3 mesi"
    }
}

how can I access to "Tra più di 3 mesi" asking the value of tempistica_in_vendita ?

A: You can use array_column() to access the value via the key. array_column can also work with objects.
$value = array_column($data,"value","key")["tempistica_in_vendita"];
echo $value; //Tra più di 3 mesi

If further values are required, it is advisable to create an array $dataKeyValue:
$dataKeyValue = array_column($data,"value","key");


text:
Q: could not resolve type R.anim I have  three projets involved on this issue
First project API (Contains the interface)
Second project draw my menu and calls the interface method
mItemClick.expandViewPageAdapter((BaseActivity)getActivity());

And the third project implements the interface
public class FragmentFullMenuSmartphone extends Fragment implements PerformActionController {

@Override
public void expandViewPageAdapter(BaseActivity activity) {
  activity
            .getSupportFragmentManager()
            .beginTransaction()
            .setCustomAnimations(R.anim.translate_left_full_from_end,
                    R.anim.translate_left_full_from_start,
                    R.anim.translate_right_full_to_start,
                    R.anim.translate_right_full_to_end)
            .replace(R.id.transactional_content_smartphone, new FragmentViewPager(),FragmentViewPager.TAG).addToBackStack(BACKSTACK_FULL_MENU).commit();

}

The problem is: I can´t find the mynamespace.R class if I call android.R it´s ok.
adding more info:
My interface is in project 1 (API)
import br.com.bb.android.BaseActivity;

public interface PerformActionController {

    void expandViewPageAdapter(BaseActivity activity);

}

My class that calls the interface method
public class MenuContentFragment extends FacebankTabFragment implements OnFinishLoadFaceBankService {

private static PerformActionController mItemClick;

public static MenuContentFragment newInstance(PerformActionController itemClick) {
    mItemClick = itemClick;
    MenuContentFragment mcf = new MenuContentFragment();

    return mcf;
}

 protected void buildMenuItem(ItemDeMenuTransacional item, boolean isSubmenu) {
    containerItem.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            ItemDeMenuTransacional selectedItem = (ItemDeMenuTransacional)v.getTag();

            if (selectedItem.isLeaf()) {
                mItemClick.expandViewPageAdapter((BaseActivity)getActivity());
    }
}

Thanks in advance.

A: android.R is for system resources (stock icons, etc.). Your R class is for your own assets. If R cannot be resolved, it usually means there's an error in one of your resource files, preventing the R class from being generated.

A: Are you using Android Studio? I've found that AS sometimes decides to forget where your R file is. Restarting Android Studio works for me.

A: I did a workaround for this issue.
I declare the resource as a instance variable
like:
private final int resource = <mynamespace>.R.anim.<animname>

and I use this latter. I didn´t understand why this specifically method can´t find my resource file. Well I will keep looking.
If anyone figure it out please let me know.
Thank you guys.

A: I finally figured out what was going on! I was compiling it in a Nexus 5 phone with android L. And this version is still full of bugs. I tested in another phones and everything is ok now.
Thanks everybody!


text:
Q: Google Analytics using iframe parent as referrer for link Having an issue while updating a clients project.There are three sites, A, B and C, all on separate domains. Site A loads site B in an iframe with a link to site C. Through Google Analytics, when the link to site C is clicked, site B (the iframe) is listed as its referral source. The client would like site A (the iframes parent) to be the referral source. Is this possible?
Currently we just add a query string with site A's url on the link to site C for them to see which client site it is coming from, but they would like it more direct.


text:
Q: How to capture a SecurityTokenExpiredException in OWIN middleware? I have a Web API with OWIN that uses JwtBearerAuthenticationOptions (.Net Framework 4.5.2) to validate authentication tokens.
While following this excellent article by Rui Figueiredo in order to add a Refresh Token ability to the API, it seems I don't have JwtBearerEvents in OWIN. E.g. This code works for me in ASP.NET Core (in ConfigureServices):
services.AddAuthentication(x =>
{
    x.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme;
    x.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme;
})
.AddJwtBearer(x =>
{
    x.RequireHttpsMetadata = false;
    x.SaveToken = true;
    x.TokenValidationParameters = GetDefaultValidationParameters();
    x.Events = new JwtBearerEvents
    {
        OnAuthenticationFailed = context =>
        {
            if (context.Exception.GetType() == typeof(SecurityTokenExpiredException))
            {
                context.Response.Headers.Add("Token-Expired", "true");
            }
            return Task.CompletedTask;
        }
    };
});

I can't seem to grasp how to achieve the same using the OWIN pipeline. What I've tried is inserting a middleware in ConfigureAuth:
private static void ConfigureAuth(IAppBuilder pApp)
{
    pApp.Use(async (context, next) =>
    {
        try
        {
            await next.Invoke();
        }
        catch (SecurityTokenExpiredException)
        {
            context.Response.Headers.Add("Token - Expired", new[] { "true" });
            throw;
        }
    });
    var issuer = "issuer";
    var audience = "all";
    var key = Encoding.ASCII.GetBytes("MySecretKey");
    pApp.UseJwtBearerAuthentication(
        new JwtBearerAuthenticationOptions
        {
            AuthenticationMode = Microsoft.Owin.Security.AuthenticationMode.Active,
            AllowedAudiences = new[] { audience },
            IssuerSecurityKeyProviders = new IIssuerSecurityKeyProvider[]
            {
                new SymmetricKeyIssuerSecurityKeyProvider(issuer, key)
            },
            TokenValidationParameters = tokenValidationParameters,
            TokenHandler = new CustomJWTTokenHandler()
        });
}

But to no avail. The 401 status comes without the Token-Expired header in this case.
Does anybody have any pointers on how to do this properly in Katana?

A: Solved it. Following the lead of these answers I added a custom authorization attribute to my base controller, i.e:
public class CustomAuthorization : AuthorizeAttribute
{
    protected override void HandleUnauthorizedRequest(HttpActionContext actionContext)
    {
        base.HandleUnauthorizedRequest(actionContext);
        var ctx = actionContext;
        var token = ctx.Request.Headers.Authorization.Parameter;
        var handler = new CustomJWTTokenHandler();
        if (ctx.Response.StatusCode == HttpStatusCode.Unauthorized && handler.TokenHasExpired(token))
        {
            ctx.Response.Headers.Add("Token-Expired", "true");
        }
    }
}

and implemented an expiration check in my CustomJWTTokenHandler class like this:
public bool TokenHasExpired(string tokenString)
{
    var token = ReadToken(tokenString);
    var hasExpired = token.ValidTo < DateTime.UtcNow;
    return hasExpired;
}

HTH


text:
Q: JS/jQuery Call function from dynamically loaded JS file? I'm having issues with calling functions from within dynamically loaded JS files.
The setup: I have a main JavaScript "framework", which handles dynamic page calling with HTML5 history, globally required functions, etc. All active links when pressed are handled by my function instead of having the page load. In my main JavaScript file I have a function let's say foo() that I'm trying to use in my dynamic JavaScript file.
Currently the way the dynamic pages are setup, is that at the end of the files in the HTML there are lines of specific JavaScript files needed to run that page with just

They load up and work, however if I call the foo() function from within that files.js - it returns as not defined.
How do I get the dynamically loaded JavaScript files to "see" the functions I have written in my global JavaScript file?
Thanks
Edit:
Defined in global.js, that is included in the :
function foo() {
    alert('bar');
}

Then,
$.get('dynamicPage.html', function(html) {
    $('#content').html(html);
}

With the source:

This is my dynamic page

The foo(); function call returns as undefined

A: Take a look at the getScript() function. Could you could load your js files after page load?
http://api.jquery.com/jquery.getscript/

A: Try encapsulating in a document ready statement.

$(document).ready(function () { foo(); });


text:
Q: GoogleCodeJam code solves tests but submission gives RE I've written this code as a part of this problem while practicing for Google Code Jam.
Here's the code I'm submitting
def hcf(a, b):
    if a == 0:
        return b
    return hcf(b%a, a)

t = int(input().strip())
for i in range(1, t+1):
    n, l = [int(x) for x in input().strip().split()]
    cipher = [int(x) for x in input().strip().split()]
    n = int(hcf(cipher[0], cipher[1]))
    decipher = [cipher[0] // n, n, cipher[1] // n]
    for j in range(2, l):
        decipher.append(cipher[j] // decipher[j])
    key = list(set(decipher))
    key.sort()
    s = "".join([chr(65+key.index(j)) for j in decipher])
    print("Case #{}: {}".format(i, s))

This screenshot will show you that a submission with the given sample test data is working.
Snapshot of test run on website
However, when I submit the code, there is a runtime error and test cases are skipped. There's a screenshot below.
Submission Error
The website does not show you the actual error message or the test case during which it occurred. Is there something wrong with my code? What can I change?


text:
Q: The meaning of the percent sign in LaTeX coding
Possible Duplicate:
What is the use of percent signs (%) at the end of lines?

I know that % is commonly used to uncomment parts of the code, but recently I read that there is another use for the percentage sign but I don't remember what it was neither where I read it.
For example in the following code % was placed at the end of several lines. What does % do in this case? (If required, I will provide a MWE.)
\newif\ifintoc
\def\@schapter#1{%
  \if@twocolumn
    \if@at@twocolumn
      \@makeschapterhead{#1}%
    \else
      \@topnewpage[\@makeschapterhead{#1}]%
    \fi
  \else
    \@makeschapterhead{#1}\@afterheading
  \fi
  \ifintoc
    \stepcounter{specialchapter}%
    \addcontentsline{toc}{chapter}{\protect\numberline{\thespecialchapter}#1}%
  \fi
}


text:
Q: Is the expression "confound it" a euphemism? I've sometimes heard people say, 'confound it'. So, I'm wondering whether this is considered a euphemism.

A: To some extent this is a matter of personal opinion.  I think "confound it" is just another mild interjection to express frustration, like "darn!" or "drat!" or "rats!"  Meanwhile, a euphemism is a "nice" word that is used in place of a "not nice" word, such as saying "darn it!" instead of "damn it!" (which in some social situations would be considered an unspeakable expletive).
It's possible that some people say "confound it" as a mild substitute for a stronger expletive such as "fuck it" ... but no one I know does this.


text:
Q: Not able to import packages after build and install using setup.py I've seen many posts related to setup.py installation and build. although I'm not able to figure out a solution for my case.
Directory structure of my code base is:
release
├── lib
│   ├── __init__.py
│   └── calculator.py
├── release
│   ├── __init__.py
│   ├── __pycache__
│   ├── add
│   │   ├── __init__.py
│   │   ├── __pycache__
│   │   └── few_addition.py
│   ├── calculator.egg-info
│   │   ├── PKG-INFO
│   │   ├── SOURCES.txt
│   │   ├── dependency_links.txt
│   │   └── top_level.txt
│   └── sub
│       ├── __init__.py
│       └── few_subtraction.py
└── setup.py

lib.calculator.py contains below code:
def addition(a,b):
    return a+b

def subtraction(a,b):
    return a - b

release.add.few_addition.py contains:
from lib.calculator import addition

def check_3_4():
    print (addition(3,4))

release.sub.few_subtraction.py contains:
from lib.calculator import subtraction

def check_3_4():
    print (subtraction(3,4))

I tried to package release folder using setup.py
from setuptools import setup

setup(
    name="calculator",
    version='0.1',
    package_dir={'': 'release'},
    packages=['add','sub'],
)

But when I'm trying to import this package after installation (using pip3 install --editable . ), getting the error:
ModuleNotFoundError: No module named 'calculator'

Import code line is:
from release.add import check_3_4

Although I see successfully installed calculator package.
Am I doing anything wrong in setup.py?
Purpose is to release two modules add and subtract.

A: You don't need the package_dir line. You need to change the packages line to packages=setuptools.find_packages(), or list all the packages and sub-packages: packages=['lib', 'release', 'release.add', 'release.sub']:
import setuptools

setuptools.setup(
    name='calculator',
    version='0.1',
    packages=setuptools.find_packages(),
    # or packages=['lib', 'release', 'release.add', 'release.sub'],
)


text:
Q: Slow query time with Postgres 10 inside Docker vs bare-metal for AWS Linux 2 I've been trying to deploy Postgres within Docker for portability reason, and noticed that query performance as measured by "explain analyze" has been painfully slow compared to bare metal.
For a table with 1.7 million rows, a query on bare metal Postgres takes about 1.2 sec vs 4.8 sec on Dockered Postgres, an increase of 4 times! This comparison is done with the same mounted volume for both bare-metal and Docker (for Docker, I'm using the -v option) The volume is a gp2 volume, mounted through AWS console, 60GB
Couple of things I tried:

*

*Increase shared memory buffer option in postgresql.conf, which has negligible effect

*Tried several volume mapping options (delegated, cached, consistent)

*Upgrading Docker from 17.06-ce to 17.12-ce

This is all done in AWS Linux 2 instance. At this point I'm hoping to get more suggestions on what to do to improve performance.
The docker run command I use:
docker run -p 5432:5432 --name postgres -v /vol/pgsql/10.0/data:/var/lib/postgresql/data postgres:latest


text:
Q: Kotlin program results in error when using blockhound I have a sceanrio wherein the code is as such:
import kotlinx.coroutines.runBlocking
import reactor.blockhound.BlockHound
    BlockHound.install()
    val throwable: Throwable = assertThrows {
        runBlocking {
            // Calling some method
            }
        }

This code fails in some scenarios with message: reactor.blockhound.BlockingOperationError: Blocking call! jdk.internal.misc.Unsafe#park
Can anyone please help me resolve this?


text:
Q: EF fluent API c# cascade delete issue I am having problems configuring a model to not cascade delete.
The modeL.
public class Hit
{
    public int Id { get; set; }

    // Foreign Key
    public int AccountId { get; set; }

    // Foreign Key
    public int LeadId { get; set; }

    //navigation properties
    [ForeignKey("LeadId")]
    public Lead lead { get; set; }

    //navigation properties
    [ForeignKey("AccountId")]
    public Account account { get; set; }

}

Fluent API:
 modelBuilder.Entity<Hit>()
          .HasRequired(t => t.lead)
          .WithMany()
          .HasForeignKey(t => t.LeadId)
          .WillCascadeOnDelete(false);

When I try to migrate it, i get this in create table on Hit:
.ForeignKey("dbo.Accounts", t => t.AccountId, cascadeDelete: true)
.ForeignKey("dbo.Leads", t => t.Lead_Id)
.ForeignKey("dbo.Leads", t => t.LeadId, cascadeDelete: true)

What I want to achieve for both leads and accounts is this in the migration script:
.ForeignKey("dbo.Leads", t => t.LeadId)

How should I go about doing this? Its prbably easy, but I am new to all this:(
EDIT 1:
I added this to the fluent API:
 modelBuilder.Entity<Lead>().HasMany(i => i.Hits).WithOptional().HasForeignKey(s=> s.LeadId).WillCascadeOnDelete(false);

Which remove cascadelete from:  .ForeignKey("dbo.Leads", t => t.LeadId)
However, I also want to remove it from:
 .ForeignKey("dbo.Accounts", t => t.AccountId, cascadeDelete: true)

The easy solution would be to remove it from the migration script. But I would like how to do this with FLuent API or other methods.
Any ideas?

A: Like I already said in the comments above, if you use Fluent API for mapping your FKs remove the [ForeignKey] attributes from your navigation properties.
You can then do non-cascading mappings like this:
modelBuilder.Entity<Hit>().HasOptional(m => m.account).WithMany().HasForeignKey(m
=> m.AccountId).WillCascadeOnDelete(false);

Finally you have to check if your FK columns should be optional or required, for optional mappings change your FK properties AccountId and LeadId to data type int?, otherwise you have to change the HasOptional() part of your FK mappings to HasRequired().

A: Define your model like so:
public class Hit
{
    public int Id { get; set; }

    public virtual Lead Lead { get; set; }

    public virtual Account Account { get; set; }
}

The virtual keyword will let Entity Framework know you are defining a foreign key and will match on Id automatically.
Remove the HasRequired(t => t.lead).WithMany() part from Fluent API. If a property is required it cannot exist without it and will cascade on delete.


text:
Q: Cramér-Rao Lower Bound-Exponential distribution Let $X$ be a random draw from an Exponential($\theta$) distribution, which has a density $p_\theta(x)=\theta^{-1}e^{-x/\theta}$ with an unknown $\theta>0.$
a) Compute the Crámer-Rao lower bound for unbiased estimation of $g(\theta)=\theta^k, k\in N$.
b) Find the UMVUE of $g(\theta)=\theta^k, k\in N$.
c) Compute the variance of the UMVUE from b). For which $k\in N$, if any, does the UMVUE attain the CR-bound from a)?
My idea: for a), the Crámer-Rao lower bound would be (I think) $\frac{g'(\theta)^2}{I(\theta)} $ with $I(\theta)=-E_{\theta}[l''_{\theta}(X)]=1/\theta^2$ (here $l_\theta$ is MLE) so one would get $\frac{g'(\theta)^2}{I(\theta)} = \frac{(k \theta^{k-1})^2}{1/\theta^2}=k^2\theta^{2k} $. I'm not sure though if this is correct.
As for b) my first guess was to take a look at moment k of X and $E[X^k]=k!\theta^k$. I wanted to apply Lehmann-Scheffé Lemma, but I had no idea how to do that because of $k!$

A: a)

I'm not sure though if this is correct.

If you have a single observation yes it is! If you have a size-$n$ random sample you get
$$V(T)\geq \frac{k^2\theta^{2k}}{n}$$
b) Observe that $T=\overline{X}_n$ is unbiased estimator for $\theta$ and it is a function of $S=\Sigma_iX_i$, complete and sufficient statistics...thus T is UMVUE for $\theta$
Given this, one may suspect that $[\overline{X}_n]^k$ is UMVUE for $\theta^k$. To verify this it can be useful to calculate the expectation of
$$T_k=[\Sigma_iX_i]^k$$
This is easy because $\Sigma_iX_i$ has a known distribution (it's a gamma) and $T_k$ is function of $S$, complete and sufficient statistics.
Thus all you have to do, once you have calculated the expectation of $T_k$ is to correct, if necessary, its bias


text:
Q: git add for each laravel's "artisan generate" command Is there any way to add to git every auto-generated (by laravel artisan) file with one simple command? I forgot to add new files to git everytime I run php artisan make:migration or similar!

A: You can do the following, but mind you, the solution below will add any untracked files, so it will be helpful when the only untracked files are the ones that are being generated by the artisan command.
Create a git alias that adds any untracked files (the alias is to make it easier to write the command). Run this to edit the git config:
git config --global --edit

Then add the following alias:
[alias]
adduntracked=!git add $(git ls-files -o --exclude-standard)

You can now append && git adduntracked after the artisan command to add the new files, all in one line:
php artisan make:migration the_migration_name && git adduntracked


text:
Q: Shader including another shader? Is it possible, using XNA 4, to include a Shader within another shader?  I know you could do this within 3.1, but I seem to be having trouble getting this to work?  If you can, any pointers would be great.
EDIT
//---------------------------------------------------------------------------//
// Name : Rain.fx
// Desc : Rain particle effect using cylindrical billboards
// Author   : Justin Stoecker. Copyright (C) 2008-2009.
//---------------------------------------------------------------------------//

#include "common.inc"  // It's this line that causes me a problem

float4x4 matWorld;

float3 vVelocity;
float3 vOrigin;         // min point of the cube area
float fWidth;           // width of the weather region (x-axis)
float fHeight;          // height of the weather region (y-axis)
float fLength;          // length of the weather region (z-axis)

... Rest of file ...

The "common.inc" file has variables in there, but I was wondering if you could put methods in there as well?

A: Yes it's possible, from memory I think the basic effect example shader example from the MS App Hub does it.
In any case, see code below!
In FractalBase.fxh
float4x4 MatrixTransform : register(vs, c0);

float2 Pan;
float Zoom;
float Aspect;

float ZPower = 2;

float3 Colour = 0;
float3 ColourScale = 0;

float ComAbs(float2 Arg)
{

}

float2 ComSquare(float2 Arg)
{

}

int GreaterThan(float x, float y)
{

}

float4 GetColour(int DoneIterations, float MaxIterations, float BailoutTest, float OldBailoutTest, float BailoutFigure)
{

}

void SpriteVertexShader(inout float4 Colour    : COLOR0,
                        inout float2 texCoord : TEXCOORD0,
                        inout float4 position : SV_Position)
{
    position = mul(position, MatrixTransform);

    // Convert the position into from screen space into complex coordinates
    texCoord = (position) * Zoom * float2(1, Aspect) - float2(Pan.x, -Pan.y);
}

In FractalMandelbrot.fx
#include "FractalBase.fxh"

float4 FractalPixelShader(float2 texCoord : TEXCOORD0, uniform float Iterations) : COLOR0
{

}

technique Technique1
{
    pass
    {
        VertexShader = compile vs_3_0 SpriteVertexShader();
        PixelShader = compile ps_3_0 FractalPixelShader(128);
    }
}

A: #includes work like this:
The preprocessor loads your main .fx file, and parses it, looking for anything that starts with a #. #includes cause the preprocessor to load the referenced file and insert its contents into the source buffer. Effectively, your #include directive is replaced by the entire contents of the included file.
So, yes, you can define anything in your #includes that you can define in a regular .fx file. I use this for keeping lighting functions, vertex type declarations, etc in common files that are used by several shaders.


text:
Q: How to make Widget small as its parent allows in Flutter? I want to create a Widget with the same layout as bellow.
+===================+ => A not fixed height widget
|  ---------------  |
| |               | |
| |               | | => Image()
|  ---------------  |
|  ~~~~~~~~~        | => Text()
|  ~~~~~~~~~~~~~    | => Text()
+===================+

How could I make the Image Widget small as its parent allows in Flutter? I also as much as possible if I have a big parent Widget, also.

A: Expanded inside the Column would do the trick you wanted. You can change height and width of the Container. Expanded flex will fill the percentage of the parent height.
import 'package:flutter/material.dart';

class Question5 extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(),
      body: Container(
        color: Colors.grey.shade300,
        width: MediaQuery.of(context).size.width, //you can change width here
        height: MediaQuery.of(context).size.height, //you can change height here
        child: Column(
          children: <Widget>[
            Expanded(
              child: Image.network(
                'https://www.visioncritical.com/hubfs/Imported_Blog_Media/BLG_Andrew-G_-River-Sample_09_13_12.png',
                fit: BoxFit.cover,
              ),
            ),
            Text(
              'Some title here',
              style: TextStyle(
                fontSize: 25.0,
              ),
            ),
            Text(
              'Some subtitle here',
              style: TextStyle(
                fontSize: 15.0,
              ),
            ),
          ],
        ),
      ),
    );
  }
}


text:
Q: Pulldown resistor value for an NPN transistor to switch a solid state relay I've got a basic setup which allows me to control 230V AC by switching a solid state relay on/off.
I'm using a Raspberry Pi's GPIO output pin and a general-purpose NPN transistor (BC547B) to allow a current to flow through the relay, here's my schematic:

Resistor R1 allows me to limit the current flowing through the SSR (The SSR accepts 4-32V, max 15mA). Assuming the transistor has a 150x voltage gain, this should be about 10mA.
(Is this right?)
Resistor R2 acts as a pulldown resistor so that the transistor stays closed when the GPIO pin is turned off/disconnected. However, I don't know what value to choose for this resistor.
After some research I found out that the resistor's value should be between 10kOhm and 100kOhm but does it have to be greater than R1? If so, what happens if the resistance is too great?
So my question is: Does R1's value make any sense and if so, does R2's value depend on it?
Additional information:
Here's a link to the SSR datasheet (The LED-indicated, random-on 240VAC relay).

A: You do need a resistor in series with the base but a better design would also put a resistor in series with the SSR's LED to limit the current unambiguously and not be reliant on hFE of the transistor.
So, I would make the base series resistor 1 kohm and this would force about 2.5 mA into the base. This will likely saturate the collector down to about 0.1 volts so that it is acting like a switch.
Whatever volt drop is specified by the SSR data sheet for its LED is then subtracted from 5V to determine the voltage across the LED current limiting resistor. The SSR data sheet will inform you of the nominal LED current so then you can calculate this resistor using ohms law.

A: Put a R3 between the collector of the transistor and the SSR.  For a given transistor the gain (hFE) varies by manufacturing lot and temperature. With R3 the current through the SSR will be independent of the transistor gain.
So the saturation voltage of a NPN transistor is about 0.2 volts with 10 ma current for the SSR, R3 = (5 - 0.2) / 0.010 = 480.  The standard value of 420 would give (5 - 0.2) / 420 or 11.4 ma.  The standard value of 560 would give (5 - 0.2) / 560 or 8.57 ma.  Since the 11.4 is below the 15 ma limit, choose R3 as 420.
With small plastic NPN transistors, the gain is 50 to 150.  To drive the transistor into saturation, we need at least 11.4 / 50 or 0.228 ma into the base.
When saturated, the base to emitter voltage will be 0.7 for silicon, R1 will be
(3.3 - 0.7) / 0.000228 = 11.403 ohms.  So picking 10K ohms would drive (3.3 - 0.7) / 10000 = 0.26 ma into the base.   Which would be sufficient for 0.26 * 50 or 13 ma of collector current.  With R3 limiting us to just 11.4 ma, the transistor should stay in saturation.
R2 is in the circuit to bled off the charge that will collect in the base of the transistor from the leakage from the collector into the base, when the GPIO is disconnected. The base must not be allowed to float up toward the 0.7 volt range or the transistor will turn on.
A rule of thumb is that R2 is 10 times the value of R1 or 100K.  You can look on the specs for the transistor and check the leakage current.  Multiplying the leakage by 100K should yield a voltage that should be much smaller than 0.7 volts.
Now, with the base of the transistor in parallel with R2, some of the current will flow into the base and some into R2.  In saturation, the current into R2 is 0.7 / 100K or 0.007 ma.   This is small compared to the 0.260 ma into the base and can be safely ignored.


text:
Q: Update cloned element automatically on original element update -JQuery Lets consider below scenario:

Some text

Now using JQuery:
 $vdom = $(".org").clone();

Now I will do some changes to my original element as
 $(".org p ").text("Changed text");

If I executes $vdom.find('p').text() it is still giving "Some text". How to update the cloned element automatically according to changes happened to the original element.
$vdom.find('p').text("changed text"), is fine for this context, but I want to automate this where every change to original element should persists in cloned element.
Is there any library to achieve this.

A: You have to insert the clonned element into the body in order to have it to the DOM stack and then it can change with a global selector like this:
$(".org p ").text("Changed text");

Run this snippet and check both texts and the console output result:

var $vdom;
    $('#cloneEl').on('click', function() {
    $vdom = $(".org").clone();
    $('body').append($vdom);
});

$('#changeText').on('click', function() {
    $(".org p ").text("Changed text");
    console.log($vdom.find('p').text());
});

<button id="cloneEl">Clone org</button>
<button id="changeText">Change org text</button>

Some text


text:
Q: How to change button position go down (constraint layout) in kotlin android ? I need space to display a message once the button is clicked <Button
        android:id="@+id/heartRateButton"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginStart="4dp"
        android:text="@string/heartRate_button"
        android:backgroundTint="@color/midnight_blue"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintVertical_bias="0.647"

So basically what I want to change is the app:layout_constraintVertical_bias="0.647". But I need to be able to change it in the mainActivity.kt file instead of in the XML file.

A: You can use these lines of code to set vertical bias programmatically
//id of the button
val button: Button = findViewById(R.id.heartRateButton)

val newParam:ConstraintLayout.LayoutParams =
            (button.layoutParams as ConstraintLayout.LayoutParams)
newParam.verticalBias = 1.0f

button.layoutParams = newParam

A: Instead of moving the Button yourself, you might want to place the message TextView in the layout where the Button is now, and constrain the Button to sit below it
<TextView
        android:id="@+id/message"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/some_message"
        android:visibility="gone"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintVertical_bias="0.647"
/>

<Button
        android:id="@+id/heartRateButton"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginStart="4dp"
        android:text="@string/heartRate_button"
        android:backgroundTint="@color/midnight_blue"
        android:layout_marginTop="8dp"
        app:layout_goneMarginTop="0dp"
        app:layout_constraintTop_toBottomOf="message"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintStart_toStartOf="parent"
/>

So the message box is displayed where the Button was, and the Button is constrained below it with a top margin set. But there's also the layout_goneMarginTop attribute, which gives it a different margin when the thing it's constrained to has GONE for its visibility.
So basically, when the message box is set to GONE, it takes up no space in the layout, and the button moves up to where the message box would be, with no margin. When the message box is set to VISIBLE, it appears, and the button slides down below it, and applies a top margin to give it some space between the two. You just have to hide or show the message box in code by setting its visibility, the constraints do the rest!

If the message box isn't supposed to be exactly where the button is, you could try something with a Barrier constrained to the bottom of message and maybe a Guideline (or an empty View) where the Button should be. Set it so the barrier is pushed down to the lower of those two things, and constrain your button to that. That way, if the message box isn't visible, the Guideline or whatever is lower, and the Button fixes to that. If the message becomes visible, it pushes the barrier lower and moves the button down where it needs to be


text:
Q: How to inject/evaluate javascript in mobile safari during XCUITest automation? I am testing in mobile safari using XCTest framework. I want to inject/evaluate some javascript. Is it possible to do ? If yes, how ?
I am trying to automate in Mobile safari. I have some javascripts. I will evaluate them to get required  object details based on some input parameters. Before evaluating I need to inject javascripts.
I read about ActionExtensions, Can I use it for this purpose ?


text:
Q: Copy streams using rdbuf fails on empty input It is a well known method to copy a stream into another using rdbuf:
#include <iostream>
#include <fstream>

int main()
{
  std::ifstream in{"/tmp/foo.txt"};
  std::cerr << in.rdbuf();
  std::cerr << "Done\n";
}

However, this breaks (= sets the bad bit) my cerr when /tmp/foo.txt is empty.  As a result, Done\n is not displayed.
Why is that?  Observed with G++/libstdc++/GNU Linux and Clang++/libc++/OS X.

A: That seems to be the defined behaviour - see e.g. http://en.cppreference.com/w/cpp/io/basic_ostream/operator_ltlt:

If no characters were inserted, executes setstate(failbit)

I agree it's a bit unhelpful.


text:
Q: MS Access User Level Security for Form to be Read but Table to be Hidden Can user level security enable someone to access a form, but not access a table? I have a form that is connected to a table using a"SELECT" command. It does not "UPDATE" or "DELETE". I'd like for the user to access my form, but I don't want them to be able to view the details in the underlying table. I've tried all sorts of combinations in the user level security wizard, but for some reason, my form comes up blank, unless I give complete access to the user to do anything. Any ideas? By the way, I'm on Access 2003.

A: You could make an MDE and give it to your users.  If you do this, the users won't be able to see anything but the user interface you have provided.
If your tables are in the same Access database as the forms and queries, you first need to "split the database" into a frontend and backend.  See:
http://databases.about.com/od/tutorials/ss/splitaccessdb.htm
for information on how to do this.  The frontend contains everything but the tables.  The backend contains the tables.  The frontend is linked to the backend tables using "linked table" objects in the frontend.
Once the database is split, open the frontend in Access, and create an MDE by selecting Tools/Database Utilities/Make MDE File from the menu bar.  The MDE is what you provide to the users.  They open it the same way they would any other database, except that they can't design any of the objects.
Make sure that you have an AUTOEXEC macro defined in the frontend, so that when the MDE is opened by the user, it has an entry point.  The user cannot see any of the objects in the MDE, so if you don't have an AUTOEXEC macro to open the first form, nothing will happen when they try to open the MDE.
If you need the ability to manage the linked tables in the MDE by allowing the user to connect to the backend database with a File/Open dialog, see the following article:
http://www.mvps.org/access/tables/tbl0009.htm
OF course, none of this precludes your users from opening the backend database.  If you need stronger security, you can upsize the backend database to SQL Server Express.  More info here:
http://office.microsoft.com/en-us/access/HA102755371033.aspx

A: What you're looking for is a RWOP query. That means "run with owner permission."
To make it work, assuming you've already run the security wizard on your front-end and back-end databases and have removed permissions for the users to even read the tables, you then create a saved query as the recordsource of your form. In the properties of the query, it is set by default to RUN PERMISSIONS as "user's." Change that to "owner's" and save the query. The query will run with whatever permissions on the base table the owner of the query has. If you are running as an administrator with full permissions, you'll want to set the permissions of the saved query to read-only (or create the query under a user logon that has read-only access to the tables -- it's much easier to do the former).
Some caveats:

*

*user-level security is tricky. If you miss even one step outlined in the ULS security white paper, your app won't be secured. The way to test this is to open Access with a default workgroup file and then see if you can access the objects in your database logged on as the default admin user. If you can, then you made a mistake somewhere along the line.

*user-level security is crackable by anyone who wants to. This doesn't mean it's not useful, it just means that it's not bullet-proof. I don't worry about that so much, as I consider security as much a people problem as a technical problem -- you have to give employees sufficient privileges to do their work, and you have trust them that they won't abuse the privileges you've given them.

*if you're running Access 2007 and using the ACCDB format, RWOP queries are not available to you, as Jet user-level security is not supported for the ACCDB format. If you're using MDB format, though, it will work just fine in A2007.


text:
Q: Bind BasicForm to Ext.Toolbar Hi I've got an Ext.Toolbar with form elements in it including a FileUploadField. I'd like to be able to submit this "form" using an Ext.form.BasicForm. How should I do this? Ideally it should behave as a FormPanel with a ToolbarLayout (though this doesn't render correctly).

A: I've just tried the other way and it seems to work ok (using a form inside a toolbar), at least for the rendering part...
You can try it out with this toolbar code...
var toolBarConversationList = new Ext.Toolbar({
  items:[
    {
      xtype: 'button',
      text: 'Some Button'
    },
    {xtype: 'tbfill'},
    {
      xtype: 'form',
      id: 'toolbarForm',
      border: false,
      bodyStyle: {
        background: 'transparent',
        marginTop: 3
      },
      items: [
        {
          xtype: 'textfield',
          name: 'form.text',
          fieldLabel: 'Some Text'
        }
      ]
    }
});

If you want you can style up the label with labelStyle on each field. If you want to include more fields you could use a column layout and form layout for each of the fields.
To submit the form you could use Ext.getCmp('toolbarForm').getForm().submit();
I hope this is what you're looking for...


text:
Q: Is it possible that voice or speech recognizer take input from speaker(incoming call voice)? Application Requirements :

*

*During a phone call application listens to the incoming phone call i.e incoming voice from speaker not the mic.

*Converts the caller's(the person who has make a call to you) voice to text.

*Finally display that converted text into the text view.

*It does all this conversion while the phone call is happening.

A: Sorry, no.  There is no supported way for an Android application to interact with the audio stream from a phone call.  Every method that I have heard of involves playing the phone call loudly out the speaker and capturing it with the microphone, and I wouldn't even be sure that works on all devices.


text:
Q: Как адаптировать фоновое изображение .header {
    background-color: #fff;
    position: sticky;
    top: 0;
    z-index: 20;
    min-height: 100px;
}
.about_carbonex {
    position: relative;
    background-image: url(../img/about_carbonex/about_carbonex.jpg);
    background-size: 100% 100%;
    background-repeat: no-repeat;
    min-width: 100vw;
    min-height: 90vh;
}

]
Понимаю что скорее всего неправильно задаю высоту обоих блоков, но по другому не знаю как сделать

A:

body {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

header {
  height: 100px;
  text-align: center;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  border: 3px solid red;
  z-index: 2;
  box-sizing: border-box;
}

.first-block {
  width: 100vw;
  height: calc(100vh - 100px);
  margin-top: 100px;
  background-image: url(https://shutterstock--c.na60.content.force.com/servlet/servlet.ImageServer?id=0150c0000049g7B&oid=00D30000001GgSC&lastMod=1501874864000);
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
}

  header

A: Пример

:root {
  --header-height: 100px;
}

body {
  margin: 0;
}

header {
  height: var(--header-height);
  text-align: center;
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 99;
  background-color: rgba(255,255,255,.9);
}

.hero {
  width: 100%;
  min-height: calc(100vh - var(--header-height));
  background: #555 url(https://placeimg.com/1000/1000/arch) no-repeat center top / cover;
}

.about {
  min-height: 100vh;
  background-color: #000;
}
header


text:
Q: Problem with read_shp() in NetworkX I'm trying to convert a shapefile of only line geometry (a street network) to a NetworkX graph to run some connectivity algorithms on it. I'm running into this issue:
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-
packages/networkx/readwrite/nx_shp.py", line 69, in read_shp
for lyr in shp:
TypeError: 'NoneType' object is not iterable

It seems to be an issue with the ogr module the fcn requires, but I believe (?) I downloaded it, and it doesn't raise the exception error written in the source code. Any ideas?
EDIT: here's my code snippet:
    import networkx as nx
print 'nx imported'
G=nx.DiGraph()
G=nx.read_shp('shpfile.shp', \
              simplify = False)
print "running fine"

It gets stuck at the read_shp() and doesn't run the print command at the end to confirm it's running correctly.

A: It seem to me that you don't understand the principles of Nextwokx (see nx_spatial does not read all shapefile features)
Networkx generate a networkx.DiGraph from the shapefile, with nodes and edges and only these nodes and edges are iterables, not the Graph
import networkx as nx
G = nx.read_shp('mylines.shp')
print(G.nodes())
[(1.0, 2.0), (3.0, 2.0), (0.0, 0.0), (3.0, 1.0), (4.0, 4.0), (2.0, 1.0), (2.0, 4.0), (1.0, 3.0), (2.0, 3.0), (1.0, 4.0), (4.0, 3.0), (4.0, 2.0), (3.0, 4.0), (1.0, 1.0)]
print(G.edges())
[((1.0, 2.0), (1.0, 1.0)), ((3.0, 2.0), (2.0, 1.0)), ((3.0, 1.0), (2.0, 1.0)), ((4.0, 4.0), (3.0, 4.0)), ((2.0, 1.0), (1.0, 1.0)), ((2.0, 4.0), (2.0, 3.0)), ((1.0, 3.0), (1.0, 2.0)), ((2.0, 3.0), (1.0, 2.0)), ((1.0, 4.0), (1.0, 3.0)), ((4.0, 3.0), (4.0, 2.0)), ((4.0, 2.0), (3.0, 2.0)), ((3.0, 4.0), (2.0, 3.0)), ((1.0, 1.0), (0.0, 0.0))]

Therefore, the error for lyr in shp TypeError: 'NoneType' object is not iterable is normal.
But you don't need to browse anything, use directly the resulting DiGraph


text:
Q: How should I set up a version of Linux so that it will use absolutely the smallest amount of RAM possible? I need to set up a bunch of virtual machines using virtualbox.  They are all going to be used for exactly one task, and nothing else.  I want to run as many as I possibly can at once, but have limited physical memory on my physical machine.   They are going to be running a python program, which uses OpenCV for image recognition, and Selenuim for automated web browsing.  I can't think of any reason why they need to have much of a desktop environment, although they DO need to be able to show gui applications in windows.  I have no need to use any 64 bit software.  I was thinking of using a 32 bit version of Debian with only OpenBox window manager, but I don't know if there is a lighter weight distribution, or lighter weight window manager out there.
Also, Once I figure out what version of Linux will require the least amount of memory to run smoothly, I will also need to know about what that amount of memory actually is, so that I know how to configure virtual box.
Any help will be much appreciated.

A: The answer to your question is highly subjective and comes down to time vs money.
The linux version which will use the least amount of memory starts off being  one you compile from source, eradicating everything you don't need.  I suspect this is beyond what you are trying to do.
Similarly, you have not described what the GUI is needed for or how (the comment "show gui application in windows) is highly ambiguous in context. By Windows do you mean XWindows or Microsoft Windows ?   I note that you don't need any Window manager in order to run an application which outputs to a GUI - you can just use an XWindows server - but even that is negotiable - it is possible for the output to be pushed to another XWindows server - thus you may be able to run multiple apps but only a single server.  If you are looking for a minimal, off-the-shelf Window manager, Openbox, LXDE and XFE are all considered lightweight.
Older versions of Linux require a lot less memory, but this may not be practical.  When I started, HARD DRIVES were less then a GIG in size and the OS came on floppy disks.

A: How about DSL, Damn Small Linux. The whole OS is 50MB.


text:
Q: Bootstrap  I am trying to built a site with Bootstrap. So far everything is going pretty much as planned. I would like a fixed navbar and I am using the built in function:

This is great and just what I need BUT I would like the navigation and title to start at the same place as the container instead of all the way to the left/right (still having the navbar going 100% in width. I have tried to put a container inside the navbar which was not the correct solution :-)

A: example

          <button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">

          </button>
          Bootstrap

                Home

                Get started

              ...

                Customize

or throw
.navbar {
    max-width: 1170px; /* width of .container */
    margin: 0 auto;
}

into the css

A: You should have a container class nested inside your navbar

your menu and logo go here

That will give you the same width as the body container if you do not have a fluid layout and will give auto margins to the container so it is centered in the middle of the screen. It will also keep the navbar itself at 100%


text:
Q: Developing an external Google drive sdk application Im  quite new to developing apps that make use of google drive and google api in general. I would like to know whether it is possible to have an application that exposes files saved on google drive without users having to login to their own google drive account. So in a sense the app would have an account and would list the documents that are currently stored on drive and users would be able to click on them ( via Google picker and not Drive UI) and view them.
Note: The app is an external ASP.NET MVC web application.
      I've looked at all the authentication samples available (DrEdit etc) on the Google dev      site but now of them seem to address my problem.

A: Seems like you could manually run through the authentication against your own Drive account, and then store the initial access token and refresh tokens in your CredentialStore implementation, which your app will continue to use.
CredentialStore is from the Java API - I'm sure there are equivalents in the .NET API.


text:
Q: How to show a WinForms Window in a WPF Grid or Viewbox In xml file:
<Viewbox name="viewbox1"></Viewbox>

In C# code-behind:
windowformClass window1 = new windowformClass(); // this is the WinForms object, not WPF
viewbox1.Child = window1;

When I assign window1 to viewbox1 it shows an error that cannot convert window form to System.Window.ElementUI
What's the right way to do that?

A: You should use WPF's interop host control for WinForms called WindowsFormsHost.
The code below was extracted and adapted from MSDN
// Create the interop host control.
System.Windows.Forms.Integration.WindowsFormsHost host =
    new System.Windows.Forms.Integration.WindowsFormsHost();

// Create your control.
windowformClass window1 = new windowformClass();

// Assign the control as the host control's child.
host.Child = window1;

// Set the interop host control as the ViewBox child.
viewbox1.Child = host;

A user reported a problem with hosting the WindowsFormHost inside a ViewBox. You should check that out in case you have problems with that too.
As you are (apparently) a newcomer, I'd like to give you a little tip:
There are plenty of resources on this subject on both MSDN and SO that could be found through a simple search on your favourite search engine.
Next time, try to find a solution before posting a question, as to keep only the best answers on the topic and save the moderators the work of closing questions as duplicates.
For more on that, check the help from SO


text:
Q: Contact form do not find submit.php file I added a contact form to the footer. Apparently it works fine in the main page, but if I go to any of the categories, lets say myblog.com/category/, the contact form is looking for submit.php at myblog.com/category/submit.php. Where I should put physically submit.php in order for contact form to find it in any category page?

A: Just from what you described it seems as if your <form> tag looks more or less like this:
<form method='post' action='submit.php'>

Try replacing it with:
<form method='post' action='http://www.mydomain.com/submit.php'>

A: It depends where you contact form is... if (As i imagain) its in your template folder you can use this to create an absolute path to it:
<form method='post' action='<?php get_bloginfo('template_url'); ?>/submit.php'>

If you places your "submit.php" in the top folder of your hosting account you
should use the same but without the "template" like so..
<form method='post' action='<?php get_bloginfo('url'); ?>/submit.php'>

.
To help you understand:
<?php get_bloginfo('template_url'); ?> = www.domain.com/wp-content/themes/yourTheme/
<?php get_bloginfo('url'); ?> = www.domain.com

.
Hope this helps.
Cheers, Sagive


text:
Q: Are $G$-limits of a slender group $G$ in the space of marked groups also slender? A group $G$ is slender if every subgroup $H \leq G$ is finitely generated. This includes polycyclic-by-finite groups. Such groups are also called noetherian.
Suppose that $L$ is a $G$-limit group in the sense that $L$ has a finite  generating set $X$ such that for every $n$, the ball $B_n$ of radius $n$ in the Cayley graph is isomorphic to some ball of radius $n$ in a Cayley graph of some subgroup of $G$. Then is it true that $L$ is itself slender? Does it change anything if $G$ is equationally noetherian?
What about smallness? If $G$ is small, then must a $G$-limit group also be small?
I suspect this may be a tough question, but maybe I'm missing something obvious. Any response would be much appreciated.

A: 1) Consider the semidirect product $G=\mathbf{Z}^2\rtimes\mathbf{Z}$ with action by the matrix $A=\begin{pmatrix}2 & 1 \\ 1 & 1\end{pmatrix}$. It has the presentation
$$\langle t,x,y\mid txt^{-1}=x^2y,\; tyt^{-1}=xy,\; [x,y]=1\rangle.$$
(It is actually generated by $(t,x)$).

Claim: some limit of markings on $G$ fails to be noetherian (although $G$ is)

[Added: this result was proved by Luc Guyot (Limits of metabelian groups. Internat. J. Algebra Comput. 22 (2012), no. 4, 1250031; ArXiv link, MR link), showing (2nd item of Theorem A therein) that suitable markings accumulate to the free metabelian group on 2 generators.]
Proof of the claim: [Edit: It's enough for purposes here to prove something weaker than Guyot's theorem, namely showing that some limit admits $\mathbf{Z}\wr\mathbf{Z}$ as a subgroup.] Consider the generating subset $(t^{n^2+1},t^n,x)$. There is a unique homomorphism $j_n$ from the wreath product $\langle s,x\mid [s^mxs^{-m}, x]=1,\forall m \in \mathbb{Z}\rangle$ to $G$ mapping $s$ to $s:=t^n$ and $x$ to $x$. We claim that it is injective in a ball of radius $p_n$ going to infinity with $n$. Once this is proved, this shows that some limit of copies of $G$ (any accumulation point for this choice of marking) contains a copy of $\mathbf{Z}\wr\mathbf{Z}$ and hence is not noetherian.
To prove the claim: assume the contrary. This means that some nontrivial element $w$ of the wreath product such that $j_n(w)=1$ for infinitely many $n$ (say $n\in I$, infinite set of integers). Clearly $w$ should be in the kernel of the canonical map to $\mathbf{Z}$, and therefore can be written $w=P(x)$ with $P\in\mathbf{Z}[u^{\pm 1}]$ (Laurent polynomial ring). Here for $P=\sum a_nu^n$, $P(x)$ means $\prod s^nx^{a_n}s^{-n}$. (This is a standard identification, since $\mathbf{Z}\wr\mathbf{Z}\simeq\mathbf{Z}[u^{\pm 1}]\rtimes\mathbf{Z}$).
That $j_n(w)=1$ means that, in $\mathbf{Z}^2$, $P(A^n)x=0$. Since $A$ is irreducible, that $P(A^n)$ has nontrivial kernel implies that it's zero. So for all $n\in I$, we have $P(A^n)=0$. But the $A^n$ have distinct eigenvalues (except for $n$ and $-n$), so infinitely of them cannot be killed by a single polynomial, contradiction.
Note that $G$ is linear over $\mathbf{Z}$, hence equationally Noetherian.
2) Small groups. Consider, for instance, a f.g. group $H$ containing all finite groups as subgroups (e.g., Neumann's group $\mathrm{Sym}_0(\mathbf{Z})\rtimes\mathbf{Z}$, or its finitely presented analogue due to Houghton), with no free subgroup.

Claim: some limit of markings on $H$ contains a free subgroup (although $H$ doesn't)

Fix a sequence of finite marked groups $(V_n,x_n,y_n)$ tending to the free groups on 2 generators. Then consider a sequence of generating subset of $H$, as a concatenation of a fixed generating subset of $H$, and a pair $(x'_n,y'_n)$ in $H$ generating a subgroup isomorphic to $(V_n,x_n,y_n)$ as marked group. Then any accumulation point of this sequence of marked groups has the property that the last two generators freely generated a free group.


text:
Q: Trouble with \b escape sequence in fprintf statement..? I am trying to write a program which reads a student number (7-digit string) from a file, replaces the first 3 digits with x's, and prints the result into a new file. I can accomplish what I'm trying to do using a printf statement (printing to the screen), but when using fprintf the result in the new file isn't what i want. Here is the relevant line of code:
studentno=1234567
fprintf(fp2, "%s\b\b\b\b\b\b\bxxx\t", studentno);

in a printf statement, the result is xxx4567, as intended. In an fprintf statement, however, when i open the new file it displays 1234567xxx. I'm really not sure why, as other escape sequences such as '\n' or '\t' seem to work the same in fprintf statements as they do in printf statements. If anybody could point me in the right direction as to why this is occurring, that would be great.

A: You are using it on a a FILE type.
If it is a file it will be upto the text editor to do what it wants. if it really is a terminal on the other end you would need to check if it handles those escape characters correctly.
it might even be that it is not allowed to use some escape characters with printf family of functions but I am not sure. It is easier if you can avoid them all together in my opinion.
Anyway I would recommended just rewriting the the printf or fprintf statement to do this:
fprintf(fp2, "xxx%s", studentno + 3);

this will write xxx and then start writing the chars from studentno from the 4th offset. Easier and will work for sure!

A: not sure what you mean by "when i open the new file". do you open it with an editor? cat? i suspect that  vi newfile may display different than cat newfile. because different software (canonical stdout vs your text editor) may display \b differently or not at all.
in any case, if you are trying to hide the first 3 digits of studentno on the screen, using backspaces is a bad way to go. unreliable and vulnerable. a hacker can easily get the full number by redirecting the output to file and there is no way to prevent it. i agree with rowan.G answer.

A: You´re mixing up format codes for printf/fprintf and terminal codes, which instruct the terminal to do something.
The allowable format codes for f/printf are listed here and you´ll notice \b isn´t one of them:
printf format codes references
What´s happening is that when you display the string you´re creating on your terminal, the terminal is applying the \b to backspace and effectively display the string as you want, but when you print it to file, it has no effect. There are a number of ways to do what you want, but I would suggest simply reading the student number in from file as a string, and manipulating it in an array.


text:
Q: Ansible error: "The Python 2 bindings for rpm are needed for this module" Im trying to pip install a requirements file in my python3 environment using the following task
pip:
  python3: yes
  requirements: ./requirements/my_requirements.txt
  extra_args: -i http://mypypi/windows/simple

I checked which version ansible is running  on the controller node (RH7) and it's 3.6.8
ansible-playbook 2.9.9
  config file = None
  configured module search path = ['/home/{hidden}/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.6/site-packages/ansible
  executable location = /usr/local/bin/ansible-playbook
  python version = 3.6.8 (default, Jun 11 2019, 15:15:01) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]
No config file found; using defaults

I am however getting the following error:
fatal: [default]: FAILED! => {"changed": false, "msg": "The Python 2 bindings for rpm are needed for this module. If you require Python 3 support use the `dnf` Ansible module
instead.. The Python 2 yum module is needed for this module. If you require Python 3 support use the `dnf` Ansible module instead."}

My controller node is running RH7.
The targets are centos7 (provisioned by vagrantfiles)
Does anyonek now how to solve this?

A: Modify
ansible-playbook

to
ansible-playbook -e ansible_python_interpreter=/usr/bin/python2

A: I had a similar problem with the "Amazon Linux 2" distribution that uses yum, but does not support dnf as of this writing.
As mentioned in the comments above, my problem was in the ansible-managed nodes (AWS EC2 instances running Amazon Linux 2) and not in the controller.
Solved it by imposing the use of python2,  adding ansible_python_interpreter=/usr/bin/python2 for this group of hosts in the ansible inventory file, as in the following snippet:
[amz_linux]
server2 ansible_host=ec2-xx-yy-zz-pp.eu-west-1.compute.amazonaws.com

[amz_linux:vars]
ansible_user=ec2-user
ansible_python_interpreter=/usr/bin/python2

Tried it with this playbook, adapted from a Redhat quick guide.
---
- hosts: amz_linux
  become: yes
  tasks:
   - name: install Apache server
     yum:
       name: httpd
       state: latest

   - name: enable and start Apache server
     service:
       name: httpd
       enabled: yes
       state: started

   - name: create web admin group
     group:
       name: web
       state: present

   - name: create web admin user
     user:
       name: webadm
       comment: "Web Admin"
       groups: web
       append: yes

   - name: set content directory group/permissions
     file:
       path: /var/www/html
       owner: root
       group: web
       state: directory
       mode: u=rwx,g=rwx,o=rx,g+s

   - name: create default page content
     copy:
       content: "Welcome to {{ ansible_fqdn}} on {{ ansible_default_ipv4.address }}"
       dest: /var/www/html/index.html
       owner: webadm
       group: web
       mode: u=rw,g=rw,o=r

Actual ansible-playbook run (after using ssh-add to add the instance private key to the ssh agent.)
$ ansible-playbook -i ansible/hosts ansible/apache_amz_linux.yaml

PLAY [amz_linux] **********************************************************************************************************

TASK [Gathering Facts] ****************************************************************************************************
The authenticity of host 'ec2-xxxxxxxxxxx.eu-west-1.compute.amazonaws.com (xxxxxxxxxxx)' can't be established.
ECDSA key fingerprint is SHA256:klksjdflskdjflskdfjsldkfjslkdjflskdjf/sdkfj.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
ok: [server2]

TASK [install Apache server] **********************************************************************************************
changed: [server2]

TASK [enable and start Apache server] *************************************************************************************
changed: [server2]

TASK [create web admin group] *********************************************************************************************
changed: [server2]

TASK [create web admin user] **********************************************************************************************
changed: [server2]

TASK [set content directory group/permissions] ****************************************************************************
changed: [server2]

TASK [create default page content] ****************************************************************************************
changed: [server2]

PLAY RECAP ****************************************************************************************************************
server2                    : ok=7    changed=6    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0

A: This error message can show if your ansible.cfg file's inventory entry is set to a non-existing file.


text:
Q: Spring Boot on Tomcat 9 Fails to Map Controllers (404's) My Spring boot application packaged as ROOT.war on tomcat9 using Java 11 appears to load successfully but fails to map the controllers. I can view every page by going right to the .jsp but my controller's map the URL's without .jsp. If I go to the mapped URL I get the standard 404 page.
This app works locally but expresses this behavior on my remote VM.
I've not seen this before and can't find anything relevant in my logs. I have another application with the exact same setup that works fine. What am I missing and/or what should I try next?
Here is my context file:
<?xml version="1.0" encoding="UTF-8"?>
<Context antiResourceLocking="true" path=""/>

Using standard spring application setup:
@SpringBootApplication
public class Application extends SpringBootServletInitializer{

    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }

And a basic request mapping and ModelAndView response:
@RestController
public class PageController extends BasePageController {
    private static final Logger LOGGER = LoggerFactory.getLogger(PageController.class);

    @Autowired       private Configuration configuration;

    @Autowired
    private OrderManager orderManager;

    @RequestMapping(value = "/", method=RequestMethod.GET)
    public ModelAndView indexSlash(HttpServletRequest arg0, HttpServletResponse arg1) {

This works fine locally and for another app with the same setup, making me think its some minor version issue. I am using tomcat 9.0.34 and Java 11.0.7. There is nothing in my app log. Here is my catalina.out file after startup:
NOTE: Picked up JDK_JAVA_OPTIONS:  --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED
31-May-2020 15:33:46.744 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version name:   Apache Tomcat/9.0.34
31-May-2020 15:33:46.748 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built:          Apr 3 2020 12:02:52 UTC
31-May-2020 15:33:46.748 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version number: 9.0.34.0
31-May-2020 15:33:46.749 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name:               Linux
31-May-2020 15:33:46.749 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version:            5.3.0-1022-azure
31-May-2020 15:33:46.749 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture:          amd64
31-May-2020 15:33:46.749 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home:             /usr/lib/jvm/java-11-openjdk-amd64
31-May-2020 15:33:46.749 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version:           11.0.7+10-post-Ubuntu-2ubuntu218.04
31-May-2020 15:33:46.750 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor:            Ubuntu
31-May-2020 15:33:46.750 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE:         /usr/local/tomcat9
31-May-2020 15:33:46.751 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME:         /usr/local/tomcat9
31-May-2020 15:33:46.786 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.lang=ALL-UNNAMED
31-May-2020 15:33:46.787 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.io=ALL-UNNAMED
31-May-2020 15:33:46.787 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED
31-May-2020 15:33:46.787 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=/usr/local/tomcat9/conf/logging.properties
31-May-2020 15:33:46.787 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
31-May-2020 15:33:46.788 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
31-May-2020 15:33:46.788 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
31-May-2020 15:33:46.789 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dorg.apache.catalina.security.SecurityListener.UMASK=0027
31-May-2020 15:33:46.789 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dignore.endorsed.dirs=
31-May-2020 15:33:46.789 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/usr/local/tomcat9
31-May-2020 15:33:46.789 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/usr/local/tomcat9
31-May-2020 15:33:46.792 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/usr/local/tomcat9/temp
31-May-2020 15:33:46.792 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent The APR based Apache Tomcat Native library which allows optimal performance in production environments was not $
31-May-2020 15:33:47.542 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
31-May-2020 15:33:47.606 INFO [main] org.apache.catalina.startup.Catalina.load Server initialization in [1,342] milliseconds
31-May-2020 15:33:47.738 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
31-May-2020 15:33:47.744 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet engine: [Apache Tomcat/9.0.34]
31-May-2020 15:33:47.800 INFO [main] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive [/usr/local/tomcat9/webapps/ROOT.war]
31-May-2020 15:33:47.831 INFO [main] org.apache.catalina.startup.ExpandWar.expand An expanded directory [/usr/local/tomcat9/webapps/ROOT] was found with a last modified time that did not match the associated W$
31-May-2020 15:33:54.545 INFO [main] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs $
31-May-2020 15:33:55.095 INFO [main] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [/usr/local/tomcat9/webapps/ROOT.war] has finished in [7,295] ms
31-May-2020 15:33:55.100 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/usr/local/tomcat9/webapps/host-manager]
31-May-2020 15:33:55.166 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/usr/local/tomcat9/webapps/host-manager] has finished in [66] ms
31-May-2020 15:33:55.167 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/usr/local/tomcat9/webapps/docs]
31-May-2020 15:33:55.207 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/usr/local/tomcat9/webapps/docs] has finished in [40] ms
31-May-2020 15:33:55.208 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/usr/local/tomcat9/webapps/examples]
31-May-2020 15:33:55.581 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/usr/local/tomcat9/webapps/examples] has finished in [373] ms
31-May-2020 15:33:55.581 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/usr/local/tomcat9/webapps/manager]
31-May-2020 15:33:55.625 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/usr/local/tomcat9/webapps/manager] has finished in [43] ms
31-May-2020 15:33:55.633 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
31-May-2020 15:33:55.667 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in [8,059] milliseconds

A: @RequestMapping is missing.
@RestController
@RequestMapping("/page")
public class PageController extends BasePageController { }

A: Okay, so as I expected, this was self inflicted. Turns out I had one dev machine set to build the project with Java 11 (same as my remote server) and another set to build the project with Java 14. The Java 14 version failed to deploy, go figure.
It's worth noting for others with the same symptoms that tomcat will explode and "deploy" a war that doesn't work so all the jsp, css, etc will show up yet the actual java code won't work. It also seems to be very limited in logging when this happen so you wont see anything indicating that it failed or why it failed.
To debug, I suggest using Nik's advise and set spring to debug level. I'd also suggest mirroring the dev environment exactly the same as the remote server to avoid these version alignment issues.


text:
Q: What properties can I set via an UIAppearance proxy? What properties can I set via an UIAppearance proxy? Apple's UIKit documentation does not list them. Is there a list of these properties?

A: Properties that can be set via UIAppearance are tagged with UI_APPEARANCE_SELECTOR in the corresponding header file.
To generate a list of properties tagged with UI_APPEARANCE_SELECTOR, you can use the following unix commands in a terminal:
cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/UIKit.framework/Headers
grep -H UI_APPEARANCE_SELECTOR ./* | sed 's/ __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_5_0) UI_APPEARANCE_SELECTOR;//'

Here is a list that I compiled using the above commands. This is for the 5.0 SDK. The corresponding getter methods have been omitted for brevity.

UIActivityIndicatorView
@property (readwrite, nonatomic, retain) UIColor *color

UIBarButtonItem
@property(nonatomic,retain) UIColor *tintColor
- (void)setBackgroundImage:(UIImage *)backgroundImage forState:(UIControlState)state barMetrics:(UIBarMetrics)barMetrics
- (void)setBackgroundVerticalPositionAdjustment:(CGFloat)adjustment forBarMetrics:(UIBarMetrics)barMetrics
- (void)setTitlePositionAdjustment:(UIOffset)adjustment forBarMetrics:(UIBarMetrics)barMetrics
- (void)setBackButtonBackgroundImage:(UIImage *)backgroundImage forState:(UIControlState)state barMetrics:(UIBarMetrics)barMetrics
- (void)setBackButtonTitlePositionAdjustment:(UIOffset)adjustment forBarMetrics:(UIBarMetrics)barMetrics
- (void)setBackButtonBackgroundVerticalPositionAdjustment:(CGFloat)adjustment forBarMetrics:(UIBarMetrics)barMetrics

[iOS 6.0]
- (void)setBackgroundImage:(UIImage *)backgroundImage forState:(UIControlState)state style:(UIBarButtonItemStyle)style barMetrics:(UIBarMetrics)barMetrics [iOS 6.0]

UIBarItem
- (void)setTitleTextAttributes:(NSDictionary *)attributes forState:(UIControlState)state

UINavigationBar
@property(nonatomic,retain) UIColor *tintColor
@property(nonatomic,copy) NSDictionary *titleTextAttributes
- (void)setBackgroundImage:(UIImage *)backgroundImage forBarMetrics:(UIBarMetrics)barMetrics
- (void)setTitleVerticalPositionAdjustment:(CGFloat)adjustment forBarMetrics:(UIBarMetrics)barMetrics

[iOS 6.0]
@property(nonatomic,retain) UIImage *shadowImage

[iOS 7.0]
@property(nonatomic,retain) UIColor *barTintColor
- (void)setBackgroundImage:(UIImage *)backgroundImage forBarPosition:(UIBarPosition)barPosition barMetrics:(UIBarMetrics)barMetrics
- (UIImage *)backgroundImageForBarPosition:(UIBarPosition)barPosition barMetrics:(UIBarMetrics)barMetrics
@property(nonatomic,retain) UIImage *backIndicatorImage
@property(nonatomic,retain) UIImage *backIndicatorTransitionMaskImage

UIPageControl
[iOS 6.0]
@property(nonatomic,retain) UIColor *pageIndicatorTintColor
@property(nonatomic,retain) UIColor *currentPageIndicatorTintColor

UIProgressView
@property(nonatomic, retain) UIColor* progressTintColor
@property(nonatomic, retain) UIColor* trackTintColor
@property(nonatomic, retain) UIImage* progressImage
@property(nonatomic, retain) UIImage* trackImage

UIRefreshControl
[iOS 6.0]
@property (nonatomic, retain) UIColor *tintColor
@property (nonatomic, retain) NSAttributedString *attributedTitle

UISearchBar
@property(nonatomic,retain) UIImage *backgroundImage
@property(nonatomic,retain) UIImage *scopeBarBackgroundImage
@property(nonatomic) UIOffset searchFieldBackgroundPositionAdjustment
@property(nonatomic) UIOffset searchTextPositionAdjustment
- (void)setSearchFieldBackgroundImage:(UIImage *)backgroundImage forState:(UIControlState)state
- (void)setImage:(UIImage *)iconImage forSearchBarIcon:(UISearchBarIcon)icon state:(UIControlState)state
- (void)setScopeBarButtonBackgroundImage:(UIImage *)backgroundImage forState:(UIControlState)state
- (void)setScopeBarButtonDividerImage:(UIImage *)dividerImage forLeftSegmentState:(UIControlState)leftState rightSegmentState:(UIControlState)rightState
- (void)setScopeBarButtonTitleTextAttributes:(NSDictionary *)attributes forState:(UIControlState)state
- (void)setPositionAdjustment:(UIOffset)adjustment forSearchBarIcon:(UISearchBarIcon)icon

[iOS 7.0]
@property(nonatomic,retain) UIColor *barTintColor
- (void)setBackgroundImage:(UIImage *)backgroundImage forBarPosition:(UIBarPosition)barPosition barMetrics:(UIBarMetrics)barMetrics
- (UIImage *)backgroundImageForBarPosition:(UIBarPosition)barPosition barMetrics:(UIBarMetrics)barMetrics

UISegmentedControl
@property(nonatomic,retain) UIColor *tintColor UI_APPEARANCE_SELECTOR;
- (void)setBackgroundImage:(UIImage *)backgroundImage forState:(UIControlState)state barMetrics:(UIBarMetrics)barMetrics
- (void)setDividerImage:(UIImage *)dividerImage forLeftSegmentState:(UIControlState)leftState rightSegmentState:(UIControlState)rightState barMetrics:(UIBarMetrics)barMetrics
- (void)setTitleTextAttributes:(NSDictionary *)attributes forState:(UIControlState)state
- (void)setContentPositionAdjustment:(UIOffset)adjustment forSegmentType:(UISegmentedControlSegment)leftCenterRightOrAlone barMetrics:(UIBarMetrics)barMetrics

UISlider
@property(nonatomic,retain) UIColor *minimumTrackTintColor
@property(nonatomic,retain) UIColor *maximumTrackTintColor
@property(nonatomic,retain) UIColor *thumbTintColor

UIStepper
[iOS 6.0]
@property(nonatomic,retain) UIColor *tintColor
- (void)setBackgroundImage:(UIImage*)image forState:(UIControlState)state
- (void)setDividerImage:(UIImage*)image forLeftSegmentState:(UIControlState)leftState rightSegmentState:(UIControlState)rightState
- (void)setIncrementImage:(UIImage *)image forState:(UIControlState)state
- (void)setDecrementImage:(UIImage *)image forState:(UIControlState)state

UISwitch
@property(nonatomic, retain) UIColor* onTintColor

[iOS 6.0]
@property(nonatomic, retain) UIColor *tintColor
@property(nonatomic, retain) UIColor *thumbTintColor
@property(nonatomic, retain) UIImage *onImage
@property(nonatomic, retain) UIImage *offImage

UITabBar
@property(nonatomic,retain) UIColor *tintColor
@property(nonatomic,retain) UIColor *selectedImageTintColor
@property(nonatomic,retain) UIImage *backgroundImage
@property(nonatomic,retain) UIImage *selectionIndicatorImage

[iOS 6.0]
@property(nonatomic,retain) UIImage *shadowImage

[iOS 7.0]
@property(nonatomic,retain) UIColor *barTintColor
@property(nonatomic) UITabBarItemPositioning itemPositioning
@property(nonatomic) CGFloat itemWidth
@property(nonatomic) CGFloat itemSpacing
@property(nonatomic) UIBarStyle barStyle

UITabBarItem
- (void)setTitlePositionAdjustment:(UIOffset)adjustment

UITableView
[iOS 6.0]
@property(nonatomic, retain) UIColor *sectionIndexColor
@property(nonatomic, retain) UIColor *sectionIndexTrackingBackgroundColor

[iOS 7.0]
@property (nonatomic) UIEdgeInsets separatorInset
@property(nonatomic, retain) UIColor *sectionIndexBackgroundColor

UITableViewCell
[iOS 7.0]
@property (nonatomic) UIEdgeInsets separatorInset

UITableViewHeaderFooterView
[iOS 6.0]
@property(nonatomic, retain) UIColor *tintColor

UIToolbar
@property(nonatomic,retain) UIColor *tintColor;
- (void)setBackgroundImage:(UIImage *)backgroundImage forToolbarPosition:(UIToolbarPosition)topOrBottom barMetrics:(UIBarMetrics)barMetrics

[iOS 6.0]
- (void)setShadowImage:(UIImage *)shadowImage forToolbarPosition:(UIToolbarPosition)topOrBottom

[iOS 7.0]
@property(nonatomic,retain) UIColor *barTintColor

(July 3, 2012): This list hasn't changed up til the most recent version of XCode (4.3.3).

(March 12, 2013): List updated for SDK 6.1. Properties that apply for iOS 6.0 (or greater) are listed under the [iOS 6.0] tag.

(Oct. 24, 2013): List updated for SDK 7.0. Properties that apply for iOS 7.0 (or greater) are listed under the [iOS 7.0] tag.