text:
Q: Vertical CSS Multi-Level Menu That Positions Itself at the Top of the div, not at the 1st Menu Option's Position Most CSS vertical menus have their second level and third layer menus popping out right beside the 1st level menu. This creates a space if you go to the third option in the first level menu. The second level menu from that third option is positioned only as high as the third menu first level item. Thus, there's a space above the second level menu, all the way up to the first level menu first selection.
How would I go about making it so that the second level menu that pops out would be at the highest first level menu selection?
I made a graphic to further iterate this.

http://i.imgur.com/v1UIk.png

http://i.imgur.com/weEwn.png
In the first image, when you hover over Purchase, the menu pops out to the side. Instead, I want the menu to pop out above, at the Products area. I want it so that even if I go to Products, Purchase, Support, Downloads...etc, that second level menu ALWAYS pops out at the top of the menu/Products.
In my actual menu, each level will only have four options, so there will be no issues hovering over and keeping the menu active.
Does anyone have a link or an idea on how to get this done?
Thanks - and I hope I explained it well..lol.
EDIT:
*I took this off of a website, I realize there's a ton of syntax errors like missing quotes and such. I'm just trying to get it to work before I fix anything and refine it.
CSS
#menu ul {
    margin: 0;
    padding: 0;
    list-style: none;
    width: 150px; /* Width of Menu Items */
    border-bottom: 1px solid #ccc;
}

#menu ul li {
    position: relative;
}

#menu li ul {
    position: absolute;
    left: 149px; /*Set 1px less than menu width */
    top: 0;
    display: block;
}

#menu li:hover ul {
    display: block;
}

#menu li:hover>ul {
    visibility:visible;
}

#menu ul ul {
    visibility:hidden;
}

/* Fix IE. Hide from IE Mac \*/
* html #menu ul li { float: left; height: 1%; }
* html #menu ul li a { height: 1%; }
/* End */

/* Make-up syles */

#menu ul, li {
    margin: 0 0 0 0;
}

/* Styles for Menu Items */
#menu ul a {
    display: block;
    text-decoration: none;
    color: #777;
    background: #fff; /* IE6 Bug */
    padding: 5px;
    border: 1px solid #ccc;
    border-bottom: 0;
}

/* Hover Styles */
#menu ul a:hover {
    color: #E2144A;
    background: #f9f9f9;
}

/* Sub Menu Styles */
#menu li ul a {
    text-decoration: none;
    color: #77F;
    background: #fff; /* IE6 Bug */
    padding: 5px;
    border: 1px solid #ccc;
    border-bottom: 0;
}

/* Sub Menu Hover Styles */
#menu li ul a:hover {
    color: #E2144A;
    background: #f9f9f9;
}

/* Icon Styles */
#menu ul a.submenu {background:#fff url("r_arrow.gif") no-repeat right; }
#menu ul a.submenu:hover {background:#f9f9f9 url("r_arrow.gif") no-repeat right;}

html:

Products

All

CodeCharge

CodeCharge Studio

DemoCharge Studio

Comparison

CodeCharge Studio

DemoCharge Studio

Downloads

CodeCharge

CodeCharge Studio

DemoCharge Studio

Support

Support

Forums

KB

Purchase

Store

Resellers

Affiliate

Company

About Us

Contact Us

Press Releases

IE Fix:

A: In your CSS, change #menu ul to position: relative:
#menu ul
{
    margin: 0;
    padding: 0;
    position: relative;
    list-style: none;
    width: 150px; /* Width of Menu Items */
    border-bottom: 1px solid #ccc;
}

And remove the relative positioning from #menu ul li:
#menu ul li
{
    /*position: relative;*/
}

This makes it a little difficult to get over to the subitems, though.
Here's a demo: http://jsfiddle.net/KvaTC/

A: If you give each ul that is a submenu an id, then you can specify in CSS for that ID a negative top value of whatever is necessary for each one.  I would recommend setting a height value for the li tags concerned for two reasons, it will tell every browser to render them at the same height and you can calculate the negatives required - no javascript required to do this.
So, take out the top:0 in the following code block so it is like this:
#menu li ul {
  position: absolute;
  left: 149px; /*Set 1px less than menu width */
  display: block;
}

Then set a height for each li concerned:
#menu ul li {
  position: relative;
  height:30px;
}

Then for each submenu ul give an id (I show the first one as an example):

Products

All

CodeCharge

CodeCharge Studio

DemoCharge Studio

Comparison

CodeCharge Studio

DemoCharge Studio

Then the CSS:
#submenu1 {
  top:0px;
}

Each subsequent id would then need negative values for whatever is required for them to be at the top. so for the second, now they have a definite height of 30px would be:
#submenu2 {
  top:-30px;
}

JSFiddle: http://jsfiddle.net/Psyrus/C3xqX/


text:
Q: How to encode strings like edit does in C#? I am writing C# application that need to print data to POS STAR printer using RawPrinterHelper.
My printing works fine except when I sending characters like ŽĆČĐŠ.
Then I get wrong data printed out.
Until now my research give me following results.
If I in PowerShell open good old edit and in txt file write my characters (ŽĆČĐŠ)
and send that to printer I get print out as I wish
I can't that repeat using Notepad
How I can in C# encode my sting to looks like that one from command prompt (EIDTor). So
when I send data to printer it print Desire fonts as it looks like in Windows environment.
I did also try to print using Star driver and their C# sample for sending data directly to printer but without success.
EDIT:

I did it, and for others Who in generally have troubles printing directly on Star printers using C#
here is code for sample app from Star IO Programming Tool  for using their driver.
using System;
using System.Text;
using StarMicronics.StarIO; // added as a reference from the "Dependencies" directory
                            // requires StarIOPort.dll, which is copied to the output directory by the Post-Build event

namespace TestEnkodera
{
    class Program
    {
        static void Main(string[] args)
        {
            string portName = "LPT1";
            string portSettings = string.Empty;
            string print = string.Empty;

            //Select code page
            //Decimal  27  29  116  n
            print += string.Format("{0}{1}{2}{3}{4}", (char)27, (char)29, (char)116, (char)5, Environment.NewLine);

            print += "Đ Š Ž Ć Č ž ć č ć \n";

            IPort port = null;
            port = StarMicronics.StarIO.Factory.I.GetPort(portName, portSettings, 10 * 1000);
            //byte[] command = ASCIIEncoding.ASCII.GetBytes(print); //This was orginal code provided by STAR

            Encoding ec = Encoding.GetEncoding(852); //Here is way to set CODEPAGE to match with printer CODE PAGE
            byte[] command = ec.GetBytes(print);
            uint totalSizeCommunicated = WritePortHelper(port, command);
            StarMicronics.StarIO.Factory.I.ReleasePort(port);
            Console.ReadKey();
        }
        private static uint WritePortHelper(IPort port, byte[] writeBuffer)
        {
            uint zeroProgressOccurances = 0;
            uint totalSizeCommunicated = 0;
            while ((totalSizeCommunicated < writeBuffer.Length) && (zeroProgressOccurances < 2)) // adjust zeroProgressOccurances as needed
            {
                uint sizeCommunicated = port.WritePort(writeBuffer, totalSizeCommunicated, (uint)writeBuffer.Length - totalSizeCommunicated);
                if (sizeCommunicated == 0)
                {
                    zeroProgressOccurances++;
                }
                else
                {
                    totalSizeCommunicated += sizeCommunicated;
                    zeroProgressOccurances = 0;
                }
            }
            return totalSizeCommunicated;
        }
    }
}

A: If you're taking of the DOS editor, you're dealing with a legacy encoding.
Have a look at this link: http://msdn.microsoft.com/en-us/library/cc488003.aspx
At some time you're converting characters to bytes to send them to the printer. You probably do that using an StreamWriter or so. Now you have to supply this "converter" the correct encoding, which in the end does convert the characters to the correct byte representation for the printer, so that the extended characters match.
A list of encodings (for DOS codepages) can be found here: http://msdn.microsoft.com/en-us/library/system.text.encoding.aspx - a common one is ibm850 (western european).
Edit: I found the following information online, maybe it helps (I actually think that code page 0 "Normal" is #850 Latin-1):
Star Micronics Character Code Tables Reference

Code Page | Description
0         | Normal
1         | #437 USA, Std Europe
2         | Katakana
3         | #437 USA, Std Europe
4         | #858 Multilingual
5         | #852 Latin-2
6         | #860 Portuguese
7         | #861 Icelandic
8         | #863 Canadian French
9         | #865 Nordic
10        | #866 Cyrillic Russian
11        | #855 Cyrillic Bulgarian
12        | #857 Turkey
13        | #852 Israel
14        | #864 Arabic
15        | #737 Greek
16        | #851 Greek
17        | #869 Greek
18        | #929 Greek
19        | #772 Lithuanian
20        | #774 Lithuanian
21        | #874 Thai

redpajama_set_name: RedPajamaStackExchange


text:
Q: How to add session and cookies for login app? I have done the following app using Node js,mongo db and angular js ,
How to add sesssion and cookie for profile page to be visible only on logged in?
I have the program in github
https://github.com/dhanyamj/loginapp.git

A: For Client-Side sessions you can use $cookies service of Angularjs to manage cookies.
More info here
You can also manage Localstorage and Sessionstorage in Angularjs using this library
ngStorage
Remember this is only for client side sessions, you also have to create server-side sessions in Node.

A: Do following

*

*On login route return session in login success response (nodejs)

*When you got success in login controller then set session to cookie or create authService to save session.

*Send that session value to each authorized api send in headers

*On private route you have to add resolve and check if it is valid i.e is authorized or not other wise redirect to login page.

Hope this will give you an idea to authorize.

A: You can use node passport js Local strategy for your authentication middleware. Then do this
function isAuthenticated(req, res, next) {

       // CHECK IF LOGIN
        if (req.user.authenticated)
            return next();

        // IF A USER ISN'T LOGGED IN, THEN REDIRECT THEM SOMEWHERE
        res.redirect('/login');
    }

Then in your route pass the function
route.get('/profile', isAuthenticated, function(req, res) {
        res.render('profile');
    });

If the user is login it views the profile while if not they will be redirected to your login page.


text:
Q: Deriving conditional independence from product rule of probability I am reading Mathematics for Machine Learning and, in the Summary Statistics and Independence section, the author derives the conditional independence of two random variables given a third RV using the product rule of probability $ p(\boldsymbol{x},\boldsymbol{y}) = p(\boldsymbol{y}\vert\boldsymbol{x})p(\boldsymbol{x})$ (Eq 6.22) as follow

Now, I don't understand how the author derives Equation 6.56 from the product rule of probability (Eq 6.22).
Can someone please show me the full derivation and explain the intuition (if any) ?

A: Using conditional probability formulas:
$$\begin{align}p(x,y|z)=\frac{p(x,y,z)}{p(z)}=\frac{p(x|y,z)p(y,z)}{p(z)}=\frac{p(x|y,z)p(y|z)p(z)}{p(z)}=p(x|y,z)p(y|z)\end{align}$$
Intuitively, the product rule still holds when we add any number of RVs to the given sides of each product term in both LHS and RHS.


text:
Q: how to wrap text inside a specific width and height using javascript with scroll up and scroll down Im very new in javascript and i'm using it to create an interactive website but there is a problem. Since i just started all i know is how to warpText my content and i don't know how can i make a code in javascript that has the function that if the wrapText overflow in the given width and height. a scroll up and down will appear and help navigate the ones that are not sceen.
this is what i use:
function wrapText(text, x, y, maxWidth, lineHeight)
{
  var words = text.split('');
  var line = '';
  for(var n = 0; n < words.length; n++)
  {
    var testLine = line + words[n] + '';
    var metrics = content.measureText(testLine);
    var testWidth = metrics.width;
    if(testWidth > maxWidth)
    {
      context.fillText(line, x, y);
      line = words[n] + '';y += lineHeight;
    }
    else {
           line = textLine;
         }
   }
context.fillText(line, x, y);
}

in function draw:
wrapText(currentText, 45, 460, 800, 20);

A: Here's my jsFiddle solution. I think your solution requires just plain HTML/CSS:
HTML:

...

And your CSS:
#foo {
    width: 400px;
    height: 300px;
    background-color: yellowgreen;
}

.wrap {
    overflow-y: auto;
}


text:
Q: On how double precision numbers are encoded in a pdf file Imagine the following tikz/pgfplots code:
% compile as: lualatex --jobname=figname-f1 figname.tex
\documentclass[10pt]{book}
\usepackage{tikz}
\usepackage{pgfplots}
\pgfplotsset{compat=1.6}
\pgfrealjobname{figname}
\pdfminorversion=5
\pdfobjcompresslevel=6
\pdfcompresslevel=9
\begin{document}
\beginpgfgraphicnamed{figname-f1}%
\begin{tikzpicture}
\begin{axis}[width=14cm,height=6cm,scale only axis,axis lines=left,axis]
\addplot3 coordinates{
(8.27605704077856,0.505526531790625,1.15577754382534e-05)
(8.27605704077856,1.01105306358125,4.16291426502054e-06)
(8.27605704077856,1.51657959537188,3.77146738938349e-06)
.... % many more lines similar to the one above
};

This tex file is about 3Mb. Compile it to get figname-f1.pdf. Now replace by zero all the third components that are very small, ie:
\addplot3 coordinates{
(8.27605704077856,0.505526531790625,0)
(8.27605704077856,1.01105306358125,0)
(8.27605704077856,1.51657959537188,0)
.... % many more lines similar to the one above
};

This new tex file is about 2Mb. Compile it.
In the personal examples I am working on, the two .pdf files are of the same size, about 530kb. Is that expected?

A: It is important to note that (La)TeX interprets the code and generates output. Output in this instance is the resulting PDF which, in its binary form, consists of a bunch of shapes (circles, lines, rectangles and some embedded content like fonts, perhaps).
It may be that the interpretation of (2,3) results in a generalized representation of (2.0000000,3.0000000) in PDF binary form, thereby inflating the size of the resulting PDF to accommodate for accuracy up to 7 decimals*. However, this also means that specifying accuracy beyond 7 decimals may be rounded/truncated (or deflated). This standardization on the output side of things results in similar-sized PDFs even though the input may very dramatically in terms of its precision under the condition that you keep the number & type of objects/shapes the same.
Whether you place an object/shape in your code (input) at position (2,3), position (2.0,3.0), position (2.0001,3.0001) or at position (2.718281828459045,3.141592653589793), the result (output) will still be the same object/shape in two dimensions in the PDF. So, the same size output is expected.
* I'm not sure about the accuracy used in PDF binaries. This was just an example.


text:
Q: Understanding "PREDICT" function output in python lightGBM implementation When using the Python PREDICT method in lightGBM with predict_contrib = TRUE, I get an array of [n_samples, n_features +1]. What does the n_feature+1 correspond to? I thought first that it could be the log odds of class 1 but the value does not correspond to the right probability.

A: Suppose that you are doing regression from X ϵ Rn to y ϵ R1. For a given point, x, You can view the model prediction f(x) as a linear function of the feature contributions such as : f(x) = contribution(x1) + contribution (x2) + ... + contribution(xn) + mean(y)
The first n columns of your array correspond to the contribution of your n features respectively and the last column is the prediction without any information, here the mean of your output y. If you sum up those n+1 values, you will obtain the prediction f(x).
For classification, you obtain the "raw prediction". Depending on the objective you selected, you will have to convert it to probability (the "prediction") using softmax or logit function.
PS: Hope its clear despite my poor editing!


text:
Q: Talking to a HID I have a sensor developed by PNI Corp called the spacepoint-fusion. I need to interface with this device in C++ and continuously read new data from the device.
When I plug the device into my computer, I see /dev/hidraw1 and /dev/hidraw2 show up. Also /dev/usb/hiddev0 shows up.
My problem is that I have no idea how to read these devices. I can't find any examples or documentation online. I don't even know where to start with this. I have been looking at libhid and hiddev as possible solutions, but as of yet, I can't figure out how to use either of these libraries.
So how do I read from this human interface device in c++ on a linux machine? Examples would be greatly appreciated.
Thanks.

A: Try running hexdump on the hidraw devices and create some input on your 'spacepoint-fusion'.
$ hexdump -C /dev/hidraw1

If you get some useful data, then the easiest way would be to use open() and read() to get the input from the device. Each read() should return one packet of information from your device. You'll need some documentation for your device, or be prepared to reverse engineer what the packets mean.

A: You should use the libusb library: http://libusb.sourceforge.net/doc/index.html
   #include <libusb.h>

Another way is read /dev/usb/hiddev0 as simple file with read, write system calls.
See the: man open, man 2 read, man 2 write.
   #include <fcntl.h>
   #include <unistd.h>

A: You've got a complicated road ahead of you.  You will first need information about the "spacepoint-fusion" (hopefully it came with documentation).
Some initial values such as Product ID/Vendor ID can be gained with the terminal command:
lsusb

Next, you will probably need to know the Endpoints, which could again be found using:
lsusb -v

From this, you can find what addresses on the device can be written to, and what addresses can be read from (and possibly the size of the read/write buffers).  But this is as far as you can get without proper documents.  You will need to know what values to write to the device, and what values to expect back from the device.
Assuming you DO know what values to read/write from/to the device try and follow this example:
http://www.lvr.com/code/generic_hid.c
I am also making the assumption that your device is HID compliant, which does not have to be the case at all.  Anyway, I wish you well on your USB journey.


text:
Q: Entity Framework combine lambda expressions from different entities I have 2 lambda expressions that are virtually the same. One returns Expression<Func<Person, bool>> and the other returns Expression<Func<Admission, bool>>.
There is a direct relationship between these 2 entities. A Person can have many Admissions.
The two expressions look like this:
Person expression:
public static Expression<Func<Person, bool>> SearchPerson(string searchTerm)
{
    if(string.IsNullOrEmpty(searchTerm))
    {
        return p => true;
    }

    return p => p.Nhino.Contains(searchTerm) ||
                p.Firstname.Contains(searchTerm) ||
                p.Lastname.Contains(searchTerm) ||
                p.Pfname.Contains(searchTerm);
}

Admission expression:
public static Expression<Func<Admission, bool>> SearchPerson(string searchTerm)
{
    if(string.IsNullOrEmpty(searchTerm))
    {
        return a => true;
    }

    return a => a.Person.Nhino.Contains(searchTerm) ||
                a.Person.Firstname.Contains(searchTerm) ||
                a.Person.Lastname.Contains(searchTerm) ||
                a.Person.Pfname.Contains(searchTerm);
}

These search expressions are used extensively throughout the system.
Notice that the return statements are virtually identical, and if our client wants to add more search criteria to the list I want to have this logic in one place and not have to update it for both the Admission and Person expressions.
Is there a way to create an expression or similar that can be used in both the People.Where() clause and the Admissions.Where() clause (or even other Parent/Child relationships that want to search by the same Person criteria) without duplicating code?

A: Provided that you have control over the design of these classes, you can implement an interface with a predicate function.
For example:
public interface ITestable
{
    Func<string, bool> Predicate { get; }
}

public class Admission : ITestable
{
    // ...other members...

    public Person Person { get; }

    public Expression<Func<string, bool>> Predicate =>
        x => Person.Predicate(x);
}

public class Person : ITestable
{
    // ...other members...

    public Expression<Func<string, bool>> Predicate =>
        x => string.IsNullOrEmpty(x) || FirstName.Contains(x) || LastName.Contains(x);
}

// The calling code:
IQueryable<ITestable> people =
    source.Where(x => x.Predicate(searchTerm));


text:
Q: Cross-platform support for `data_files` with `setup.py` + `pip` What would be a cross-platform way of shipping data_files with setup.py (compatible with pip)?
From the official documentation, one needs to write:
setup(...,
    data_files=[('bitmaps', ['bm/b1.gif', 'bm/b2.gif']),
                ('config', ['cfg/data.cfg']),
                ('/etc/init.d', ['init-script'])]
    )

and 'bitmaps', etc. are the sub-directories where those files should go (relative to sys.prefix).
However, this is sub-optimal for cross-platform installations where the standard sub-dir will depend on the system.
Additionally, installing the package in developer mode will not place the files where they will later be after the installation, making this process of finding/using resources ultimately hard / annoying to debug.
I have looked into appdirs, but it seems difficult to make it work properly during installation, e.g. if using the user directory for data this gets actually tied to my development environment.
The reason I am asking this is because I have a small Python package that implements a simple GUI and I would like to ship an icon with it.
For the record, I am OK with processing setup.py with setuptools.

A: As suggested in the comments, for bundling resource files, I'd rather use package_data and place the files under some package dir. Example:
project
├── pkg1
│   ├── __init__.py
│   └── icons
│       └── image.png
└── pkg2
    └── __init__.py

Packaging in the setup.py script:
from setuptools import setup

setup(
    ...
    package_data={'pkg1': ['icons/image.png']},
)

Update for accessing resource files in code:
Python 3.7 introduced importlib.resources which replaces the old pkg_resources
functionality and offers a modern resource machinery that utilizes pathlib:
filepath = importlib_resources.path('pkg1', 'icons/image.png')

For Python 3.6 and older, there's a backport named importlib_resources. The version-agnostic example is thus:
import sys

if sys.version_info >= (3, 7):
    from importlib import resources as importlib_resources
else:
    import importlib_resources

filepath = importlib_resources.path('pkg1', 'icons/image.png')

Use importlib_resources instead of pkg_resources where possible.
Original answer, for the history only
To reference the resource files in code, use pkg_resources:
import pkg_resources

filepath = pkg_resources.resource_filename('pkg1', 'icons/image.png')

The cross-platform support is thus handled by pkg_resources. Refer to ResourceManager API for available resource access functions.

A: Update
Check out the  solution from  @hoefling
The data_files options specify the files to upload for your package.
From the docs:

No directory information from files is used to determine the final location of the installed file; only the name of the file is used.

If you want to build cross platform directory paths, use the os module
import os

path = os.path.join('root', 'directory')

If you want to determine the platform when someone tries to build your package, use the sys module
import sys

current_platform = sys.platform.lower()
is_windows = current_platform.startswith('win')
is_ubuntu =  'ubuntu' in current_platform
is_mac = 'darwin' in current_platform

if is_windows:
     ... # windows specific dayta

elif is_ubuntu:
     ....

else:
    raise Exception('Platform not supported')


text:
Q: why must use "npx" to cek version program on npm global? I have a problem when I use the npm command. why when I use the npm command to check the version program must use npx? it does not work when I don't use npx
For example when I use Vue --version to check cli vue version
vue --version
bash: vue: command not found

npx vue --version
@vue/cli 5.0.6

npx error

A: Try updating your PATH variable with this command:
export PATH=$PATH:/Users/denis/.npm-global/bin

Updating Node/NPM might help too.


text:
Q: Set line length for output in Python's argparse Currently I am using the following code to initialize my ArgumentParser:
parser = argparse.ArgumentParser(description="Help line 1\n" +
                                             "Help line 2",
                                 formatter_class=argparse.RawTextHelpFormatter)

Which, after adding some arguments, gives me the following output:
/usr/bin/python3.6 /data/Poseidon/dev/Python/trident.py -h
usage: trident.py [-h] [--verbose] [--images] --source SOURCE --network
                  NETWORK

Help line 1
Help line 2

I would rather not have the "NETWORK" argument in the "usage" part of the help output in the next line, but on the same line. Is there any way to tell argparse to not add newlines in the list of arguments?

A: Try this:
parser = argparse.ArgumentParser(description="Help line 1\n" +
                                             "Help line 2",
                                 formatter_class=lambda prog: argparse.RawTextHelpFormatter(prog, width=99999))

If you do this, take note of this comment from HelpFormatter.__doc__:

Only the name of this class is considered a public API. All the methods provided by the class are considered an implementation detail.

A: The better resolution (comparing to https://stackoverflow.com/a/53283500/10418734) is

*

*Create a class that formats with a desired width

class _WidthFormatter(argparse.RawTextHelpFormatter):
    def __init__(self, prog: Text) -> None:
        super().__init__(prog, width=99999)

*And use the class

parser = argparse.ArgumentParser(
    description=(
        "Help line 1\n"
        "Help line 2"
    ),
    formatter_class= _WidthFormatter
)

This solution is preferred as formatter_class argument in argparse.ArgumentParser expects to use a class, not a class instance.


text:
Q: Which part of the C++ standard allow to declare variable in parenthesis? Consider the following code:
int main() {
    int(s);
}

I am surprised by the fact that it creates valid variable s. Can anyone explain what's happening here?

A: Just to add to the other answers; in the grammar summary for declarators (C++14 [dcl.decl]/4) you can find:
ptr-declarator:
    noptr-declarator

noptr-declarator:
    ( ptr-declarator )

(I have omitted other details of the grammar).  You can see from this that any declarator may be parenthesized and it would still match the same grammar rule.

A: [dcl.meaning] in the Standard says:

In a declaration T D where D has the form ( D1 ) the type of the contained declarator-id is the same as that of the contained declarator-id in the declaration T D1.
Parentheses do not alter the type of the embedded declarator-id, but they can alter the binding of complex declarators.

More simply, you can put parentheses around anything considered a "declarator" in the C++ grammar.  (Loosely speaking, a declarator is a part of a declaration without the initial specifiers and types which contains one name.)
In your example, the identifier s is a declarator, so you're allowed to put parentheses around it and the meaning doesn't change.
The reason for this, as the second quoted sentence hints, is that it can be necessary when things get more complicated.  One example:
int * a [10];     // a is an array of ten pointers to int.
int ( * b ) [10]; // b is a pointer to an array of ten ints.


text:
Q: How to set listview border in JavaFX I've tried digging through the JavaFX CSS reference and googling but have been unsuccessful in figuring out how to remove the border on a listview in JavaFX.
I've tried setting the border and stroke widths to 0px. I've tried setting the border/stroke colors to transparent. No matter what I do, there is what looks to be a 1px solid black border around the listview.
Any ideas on how to get rid of it?

A: Try
list.setStyle("-fx-background-insets: 0 ;");


text:
Q: wcf binding properties What happens when WCF binding properties like MaxReceivedMessageSize, OpenTimeout, ReceiveTimeout, SendTimeout and Security on the client program have different values than server program ones? Thanks.

A: Security settings: you will not be able to connect / execute operations if you use different security mechanisms. The server decides how it wants to control security, and the client has to conform to his demands.
Otherwise: nothing specific really. Of course when you run into a MessageSize boundary, or hit a timeout, the client will receive an exception message if it has happened on the server side, or generate an exception if it happened on the client side.

A: Specifically in security, properties like SecurityMode (Message or Transport), ClientCredentialType (Message or Transport) must be match in server and client, or am I wrong??

A: As C. Evenhuis said, the security stuff is determined by the server, but in general, you want to be careful with the other settings as well.  If the server will send a max size message of n bytes, then it doesn't help for the client to attempt to accept something much larger.
In my experience, a lot of engineers get confused when they try to increase one of these other settings on the client and don't get the result they're expecting.  This is usually because they forget about the relevant settings on the server side.
If you don't have a view into what settings the server is configured for (one of the few beefs I have with WCF), then it will be more difficult to know the boundaries you can set for your client.


text:
Q: How to take backup of before deleting using $pull in mongodb? I have following query that deletes some inner json docs. I want to backup the docs which will be deleted by this query. Is there any way to take such backup in mongodb.
    db.dataDetails.update_many(
    {
        "uid":
        {
            "$gte": batchMin,
            "$lt": batchMax
        }
    },
    {
        "$pull":
        {
            "s":
            {
                "ad":
                {
                    "$lte": cdate
                }
            },
            "o":
            {
                "ad":
                {
                    "$lte": cdate
                }
            }
        }
    })


text:
Q: duplicate years and days in UIDatePicker there is a weird problem with UIDatePicker when I set its calendar to NSIslamicCalendar or NSIslamicCivilCalendar like this:
picker.calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSIslamicCalendar];

And try to choose a first day or a last day of a random year, I notice that the current selected year is duplicated and the 2nd day of the month appears before the 1st day, as you can see in the following screenshot :

where Muharram is the name of the first month and Dhu'l-Hijjah is  the name of the last month of the islamic calendar.
is this a bug in the UIDatePicker or should I do some workaround to get rid of this glitch ?
p.s. this is noticed in iOS 6 & 7 simulators and there is no other properties has been set for the picker except for its calendar property.

A: I had the same problem, finally I realized that it is a bug in the picker and ended up with a custom picker, Apple dudes didn't bother themselves to create a perfect Islamic calendar, but they have put a little effort to customize the picker to fit the Hijri date, you can report this bug to Apple by the way.
I suggest not to count on it, you need to do a good work customizing it or you can start working on a custom picker for Hijri date.

A: it looks like that the islamic calender never have 31 days in month, so instead of date 31 the they have written 2.which is disabled all time,so i think you dont need to worry about it.it looks like bug to manage the calender with all other locality calenders.


text:
Q: Server.UrlEncode apostrophe(') in Firefox So I have a Hyperlink called lnkTwitter:
And I'm trying to set the url in the code behind:
lnkTwitter.NavigateUrl = string.Format("http://www.twitter.com/home?status={0}", Server.UrlEncode("I'm Steven"));
When I do that and hover over the link, the url displays correctly in the status bar as "http://www.twitter.com/home?status=I'm+Steven", but the actual url, if I click on the link or look at the link's properties, is "http://www.twitter.com/home?status=I%27m+Steven".
For some reason, this only happens in Firefox; in IE, I am taken to the correct url.

A: Have you tried to view source code?
If source is ok, then there's no troubles with your code.

A: Firefox just likes to unescape the urls that it shows. While this can be confusing it should not cause your code or the sites you link to (twitter, in this case) any problems.
If you follow the link and then copy the url and paste it into Notepad or something then you should get the escaped form that was actually used instead of the unescaped form that was displayed.

A: Uri.EscapeDataString, Uri.EscapeUriString, HttpUtility.UrlEncode and HttpUtility.UrlPathEncode are available to use in C# out of the box, they can not convert all the characters exactly the same way as JavaScript escape function does.
Solution: Use JScript.Net's own implementation. Simply reference the Microsoft.JScript.dll and use the Microsoft.JScript.GlobalObject.escape() method to encode your url.


text:
Q: .htaccess pretty url's for legacy files I've taken over a project which has references to "lorem.php" not making use of Mod Rewrite unfortunately, I'm finding it an eye sore and would love to knock the extension off (at least).
The ideal URL would look like "/process-app" would map to "/processApp.php"
My issue is the camelCase naming convention used throughout everything.

*

*I can't rename the files due to legacy URL's being referenced

*Doing individual file references for every file is out of the question due to the amount of files that exist, a dynamic solution is required

I doubt there is a way to capitalize the first letter of the variable within the rule?
Here is what I have:
RewriteEngine On
RewriteRule ^([a-z]+)-([A-z]+)?$ $1$2.php

But the URL to make the correct file reference needs to be "/process-App"

A:
I doubt there is a way to capitalize the first letter of the variable
  within the rule?

Don't doubt, it is possible.
In httpd.conf add this into vhost block domain:
RewriteMap upper int:toupper

Then, in your htaccess:
RewriteEngine on
RewriteRule ^([a-z]+)-([a-z])([a-z]+)$ $1${upper:$2}$3.php [L]
RewriteRule ^([a-z]+)-([A-Z][a-z]+)$ $1$2.php [L]


text:
Q: async Module Error Handling , is there a way i can identify which block of callback is throwing error. If we have a function any way we can identify which call back is throwing an error
  Async.parallel({
 function one:(){
 },function two(){}
},function(err,results){
//any way we can identify which call back is throwing an error
});

It is needed because for some calls i need to show a n error page for some i just need to show the page irrespective of the error.

A: An error value is returned back from whichever async operation returned an error.  You just need to make sure that each operation returns an indentifiable error value.  If it's an error object (which is recommended), you can add any custom properties you want to it.  Then, in your final error handler, you can look at the properties on the error object and see what properties are on it, what values they have and therefore which path caused the error.
If you want more specific help than that, you will need to show us your actual code for the async operations so we can make more specific code recommendations.


text:
Q: PostgreSQL 13.2 on Windows won't accept passwords and editing pg_hba.conf doesn't work I installed PostgreSQL 13.2 on Windows. The service is running, but when I use psql -Upostgres to connect it always fails password authentication even though I am entering the right password. I read that if you set the METHOD to trust in pg_hba.conf then it shouldn't even ask for passwords. I did that and then restarted the service--it still asks for the password and fails.
I've run out of ideas on what to try, so I thought I'd try here. Any thoughts?

A: The problem was that a docker container was running that was using port 5432 so postgres was using port 5433. I had thought that the docker container was stopped, so I had put it completely out of my mind. When I used psql without specifying a port, it was attempting to connect to the db running in the docker container, which had a different password for the user postgres. (This also explained why changing METHOD to trust in pg_hba.conf didn't work: it was the wrong instance of postgres that I was connecting to.)


text:
Q: Аналог в c# многомерного массива строк из php как в C# в массив string[] добавить значения типа многомерного как в php
типа такого

$array['klucchslovo'] = "znachenie"; - именно текст

в C# все облазал так и не понял

public string[] arr = { }; дальше не знаю...

И как потом к этим ключам обращаться

A: Используйте словарь.
Мини-пример с разными возможностями словаря:
var myDict = new Dictionary<string, string>()
{
    { "key1", "value1" },
    { "key2", "value2" },
};

myDict.Add("key3", "value3");

if(myDict.Keys.Contains("key1"))
{
    Console.WriteLine("key1 is present in myDict");
    Console.WriteLine($"its value is={myDict["key1"]}");
}
else
{
    Console.WriteLine("key1 is NOT present in myDict");
}

Console.WriteLine();

if (myDict.Keys.Contains("key4"))
{
    Console.WriteLine("key4 is present in myDict");
}
else
{
    Console.WriteLine("key4 is NOT present in myDict");
}

Console.WriteLine();

foreach (var element in myDict)
{
    Console.WriteLine($"key={element.Key},{element.Value}");
}

Console.WriteLine();

Console.WriteLine($"Количество элементов {myDict.Count}");

Вывод:

Словари бывают не только строковые, начните изучение с этого примера, а потом двигайтесь в сторону изучения других вариантов.
Ссылки по теме:

*

*MSDN Класс Dictionary.KeyCollection

*Коллекция Dictionary


text:
Q: Deeplabv3 re-train result is skewed for non-square images I have issues fine-tuning the pretrained model deeplabv3_mnv2_pascal_train_aug in Google Colab.
When I do the visualization with vis.py, the results appear to be displaced to the left/upper side of the image if it has a bigger height/width, namely, the image is not square.
The dataset used for the fine-tune is Look Into Person. The steps done to do so are:

*

*Create dataset in deeplab/datasets/data_generator.py

_LIP_INFORMATION = DatasetDescriptor(
    splits_to_sizes={
        'train': 30462,
        'train_aug': 10582,
        'trainval': 40462,
        'val': 10000,
    },
    num_classes=19,
    ignore_label=255,
)

_DATASETS_INFORMATION = {
    'cityscapes': _CITYSCAPES_INFORMATION,
    'pascal_voc_seg': _PASCAL_VOC_SEG_INFORMATION,
    'ade20k': _ADE20K_INFORMATION,
    'cihp': _CIHP_INFORMATION,
    'lip': _LIP_INFORMATION,
}

*Conversion to tfrecord

!python models/research/deeplab/datasets/build_voc2012_data.py \
  --image_folder="/content/drive/MyDrive/TFM/lip_trainval_images/TrainVal_images/train_images" \
  --semantic_segmentation_folder="/content/drive/MyDrive/TFM/lip_trainval_segmentations/TrainVal_parsing_annotations/train_segmentations" \
  --list_folder="/content/drive/MyDrive/TFM/lip_trainval_images" \
  --image_format="jpg" \
  --output_dir="train_lip_tfrecord/"

!python models/research/deeplab/datasets/build_voc2012_data.py \
  --image_folder="/content/drive/MyDrive/TFM/lip_trainval_images/TrainVal_images/val_images" \
  --semantic_segmentation_folder="/content/drive/MyDrive/TFM/lip_trainval_segmentations/TrainVal_parsing_annotations/val_segmentations" \
  --list_folder="/content/drive/MyDrive/TFM/lip_trainval_images" \
  --image_format="jpg" \
  --output_dir="val_lip_tfrecord/"

*Training

!python deeplab/train.py --logtostderr \
  --training_number_of_steps=40000 \
  --train_split="train" \
  --model_variant="mobilenet_v2" \
  --atrous_rates=6 \
  --atrous_rates=12 \
   --atrous_rates=18 \
   --output_stride=16 \
   --decoder_output_stride=4 \
   --train_batch_size=1 \
   --dataset="lip" \
   --train_logdir="/content/drive/MyDrive/TFM/checkpoint_lip_mobilenet" \
   --dataset_dir="/content/drive/MyDrive/TFM/trainval_lip_tfrecord/" \
   --fine_tune_batch_norm=false \
   --initialize_last_layer=false \
   --last_layers_contain_logits_only=false

*Visualization

!python deeplab/vis.py --logtostderr \
  --vis_split="val"
  --model_variant="mobilenet_v2"
  --atrous_rates=6 \
  --atrous_rates=12 \
   --atrous_rates=18 \
   --output_stride=16 \
   --decoder_output_stride=4 \
   --dataset="lip" \
   --checkpoint_dir="/content/drive/MyDrive/TFM/checkpoint_lip_mobilenet" \
   --vis_logdir="/content/drive/My Drive/TFM/eval_results_lip" \
   --dataset_dir="/content/drive/My Drive/TFM/trainval_lip_tfrecord" \
   --max_number_of_iterations=1 \
   --eval_interval_secs=0

With the following steps, an example of the problem I´m facing is:
Original image
Deeplabv3 result
I don´t know if I´m missing something important or if it needs more training. However, training does not seem to be a solution since loss its at the moment going up and down from 1.5 to 0.5, aprox.
Thanks in advance.

A: After some time, I did find a solution for this problem. An important thing to know is that, by default, train_crop_size and vis_crop_size are 513x513.
The issue was due to vis_crop_size being smaller than the input images, so vis_crop_size is needed to be greater than the max dimension of the biggest image.
In case you want to use export_model.py, you must use the same logic than vis.py, so your masks are not cropped to 513 by default.


text:
Q: Dynamic select query in a SP will not show up columns in SQL Report Builder Any solution to show the columns in SQL Report Builder
I tried using a temporary table with following steps

*

*Create a Temp table outside the dynamic query

*Alter its columns inside the dynamic query by adding your dynamic columns

*Then add your result set to it inside dynamic query

*Write select statement of that temp table outside the dynamic query

Query with dynamically added columns @ColumnLevel.
INSERT INTO #TempTreeView (ID, ParentId, '+@ColumnLevel+' ,FileSize)**

Error occurred:

Msg 207, Level 16, State 1, Line 9
      Invalid column name 'xxxx'.?

If i can get result then with the help of the temp table columns SQL Report Builder will display it while generating the report. Any helps to solve this issue is appreciable.


text:
Q: How do I access static members of a c# library from c++ code? I have been given a library written in C# and I need to use it in a C++ project.  The C# library has been exported to a .tlb type library, which I can successfully import into my C++ project by using the #import directive.
Being utterly unfamiliar with COM I can't for the life of me figure out how to get at static member functions on any classes.  Here's how I access it in C#:
void Function()
{
    StaticClass.StaticMethod();
}

And then you get into the C++ side, what gets generated in the .tlh file is:
struct __declspec(uuid("some big long thing"))
/* dual interface */_StaticClass;
//long while later
_COM_SMARTPTR_TYPEDEF(_StaticClass, __uuidof(_StaticClass));

So I'm trying to figure out how to get use of the static class and haven't had any luck with Google.  The only example anywhere else in any other project I have access to gives me something similar to this:
_StaticClassPtr s = _StaticClassPtr(__uuidof(_StaticClass));

but the example I have isn't for a static class anyway.
Basically I'm stuck with nowhere to even really start.  This fails with "Unhandled exception at  in <executable>: Microsoft C++ exception: _com_error at memory location <location>"

Edit:  Since @dxiv informed me static methods aren't usable with COM interop, there's another option marked 'obsolete' that does not use static members -- problem is I get exactly the same exception when I construct the instance with similar syntax:
IInstanceClassPtr p = _IInstanceClassPtr(__uuidof(_InstanceClass));

The same exception is thrown, "_com_error at memory location"

A: Reading your question you would like to use C# using COM Interop. What I done is something like this. Starting from the assumption that COM is the acronym of Component Object Model and to use it you need an instantiable, local or remote, object. The example below creates an "in-proc" instance of the CLR object.
Create an interface which is exposed to COM:
namespace MyNamespace
{
    /// <summary>
    /// Provides an entry point for COM clients.
    /// </summary>
    [ComVisible(true)]
    [Guid("A9E6D7FE-34FD-4A6B-9EB2-DC91F4AE567B")]
    public interface IMyAccessor
    {
         void ExecuteStaticMethod();
         // add anything else like methods, property,
    }
}

then implement the interface in a C# class:
namespace MyNamespace
{
    /// <summary>
    /// The implementation of IMyAccessor.
    /// </summary>
    [ComVisible(true)]
    [Guid("C65A7F81-641C-4F17-B34A-DEB88B4158E8")]
    [ProgId("MyCompany.MyAccessor")]
    [ClassInterface(ClassInterfaceType.None)]
    [ComDefaultInterface(typeof(IMyAccessor))]
    public sealed class MyAccessor: IMyAccessor
    {
        public void ExecuteStaticMethod() { StaticClass.StaticMethod(); }
    }
}

export the TLB and import it in C++ project (MyAccessor is only a name I used here) in the header file of your C++ class using the following clause:
#import "MyAccessor.tlb"
Within the class header add a line like the following:
MyNamespace::IMyAccessorPtr m_IMyAccessor;

And in the class implementation use the following:
        HRESULT hr = m_IMyAccessor.CreateInstance(__uuidof(MyNamespace::MyAccessor));
        if (FAILED(hr))
        {
            // do something if failed
        }

        m_IMyAccessor->ExecuteStaticMethod(); // this will execute your static method in C#

NOTE: when exporting the TLB use the correct switchs. In an x64 environment (/win64) must be used to have the right pointer size: normally tlbexp returns pointer usable in a 32bit environment. This is important if you want to extend the class with more sofistcated methods.
NOTE 2: if the returned HRESULT from CreateInstance is something like "class not registered", remember to execute the registration of the TLB wih REGTLIB.


text:
Q: How to DFS a 2D array to record paths from leftmost column to rightmost column? Here I want to use DFS to traverse in a 2D array from leftmost column to rightmost column, each element can go to its upper right element or right element or lower right element. I need to record each possible path. For example, here I have:
1 2 3
4 5 6
7 8 9

Then the possible paths will be 123, 126, 153, 156, 159, 423, 426, 453, 456, 459, 486, 489, 753, 756, 759, 786, 789
Now my idea is straightforward backtrack:
public int findSolution(int[][] array) {
        List<List<Integer>> availablePaths = new ArrayList<List<Integer>>();
        for (int i = 0; i < array.length; i++) {
            List<Integer> tempList = new ArrayList<Integer>();
            dfs(array, availablePaths, tempList, 0, i);
        }
        int res = 0;
        int min = Integer.MAX_VALUE;
        for (List<Integer> path : availablePaths) {
            min = Integer.MAX_VALUE;
            for (Integer cur : path) {
                if (cur < min) {
                    min = cur;
                }
            }
            if (min > res) {
                res = min;
            }
        }
        return res;
    }

    public void dfs(int[][] array, List<List<Integer>> availablePaths, List<Integer> tempList, int curCol, int curRow) {
        if (tempList.size() == array[0].length) {
            availablePaths.add(new ArrayList<Integer>(tempList));
            return;
        }
        tempList.add(array[curRow][curCol]);
        int startRow;
        int endRow;
        // Next Column
        if (curRow == 0) {
            startRow = 0;
            endRow = curRow+1;
        } else if (curRow == array.length-1) {
            startRow = curRow - 1;
            endRow = curRow;
        } else {
            startRow = curRow - 1;
            endRow = curRow + 1;
        }
        for (int i = startRow; i <= endRow; i++) {
            dfs(array, availablePaths, tempList, curCol + 1, i);
            tempList.remove(tempList.size()-1);
        }
    }

However, this can not work because of ArrayIndexOutOfBoundsException, so I guess my code has wrong idea.
Could someone give a solution to solve this problem?

A: The following DFS implementation solves your problem. I added your example as a test case as well.Basically, we start a new dfs on each cell on the first column. In each dfs call, as long as the current cell is in bound, we add it to the current path in a list. If the current cell is already the last column, add the path stored in the list to the final result.
The dx, dy arrays are a concise way of implementing the 3 possible moves.
import java.util.ArrayList;
import java.util.List;

public class Solution {
    private static int[] dx = {-1,0,1}, dy = {1,1,1};
    public static List<List<Integer>> dfsForAllPaths(int[][] grid) {
        List<List<Integer>> res = new ArrayList<>();
        if(grid == null) {
            return res;
        }
        for(int i = 0; i < grid[0].length; i++) {
            dfsHelper(grid, i, 0, res, new ArrayList<>());
        }
        return res;
    }

    private static void dfsHelper(int[][] grid, int x, int y, List<List<Integer>> res, List<Integer> list) {
        if(!isInBound(grid, x, y)) {
            return;
        }
        list.add(grid[x][y]);
        if(y == grid[0].length - 1) {
            res.add(new ArrayList<>(list));
        }
        for(int dir = 0; dir < 3; dir++) {
            int newX = x + dx[dir], newY = y + dy[dir];
            dfsHelper(grid, newX, newY, res, list);
        }
        list.remove(list.size() - 1);
    }

    private static boolean isInBound(int[][] grid, int x, int y) {
        return x >= 0 && x < grid.length && y >= 0 && y < grid[0].length;
    }
    public static void main(String[] args) {
        int[][] grid = {{1,2,3},{4,5,6},{7,8,9}};
        List<List<Integer>> res = dfsForAllPaths(grid);
        for(int i = 0; i < res.size(); i++) {
            System.out.println(res.get(i));
        }
    }
}


text:
Q: Конвертация кода из java в с++ Есть код, написанный на Java:
    public class KeyCallback extends GLFWKeyCallback
    {
        public static final boolean[] keys = new boolean[65536];

        @Override
        public void invoke(long window, int key, int scancode, int action, int mods)
        {
            keys[key] = action != GLFW.GLFW_RELEASE;
        }
    }

Как написать то же самое, только на C++?

A: KeyCallback.h
class KeyCallback : public GLFWKeyCallback {
    public :
        static bool keys[];
        void invoke(long window, int key, int scancode, int action, int mods) override;
}

KeyCallback.cpp
void KeyCallback::invoke(long window, int key, int scancode, int action, int mods) {
    keys[key] = action != GLFW.GLFW_RELEASE;
}

bool KeyCallback::keys[] = new bool[65536]


text:
Q: Изменение цвета движущегося div'a каждые 20px на рандомный Написал все что мне нужно, только что то не могу вдуплить, как мне описать инструкцию что-бы рандомный колор менялся каждые 20 пикселей на новый. Ну и еще добавлю, что только на чистом js.
Спасибо!

<!DOCTYPE html>

        <title>Kwadrat - JS</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">

A: Вот так, например:
if (currentValue % 20 === 0){
    but.style.background = "#" + Math.random().toString(16).slice(2, 8);
}

var but = document.getElementById("but");
        var direction;
        var currentValue = 0;
        var width = screen.width;
        var maxwidth = width - 100;
        var position = maxwidth /2;

        but.style.background = "#" + Math.random().toString(16).slice(2, 8);

        function run(){
            if(currentValue === maxwidth) direction = -5;
            if(currentValue === 0) direction = 5;
            if (currentValue >= position) {
            but.style.width = "100px";
            but.style.height = "100px";
        } else {
            but.style.width = "50px";
            but.style.height = "50px";
        }

            currentValue += direction;
            but.style.left = currentValue + "px";
            if(currentValue%20 === 0){
              but.style.background = "#" + Math.random().toString(16).slice(2, 8);
            }
        }
        window.onload = function(){
            var interval = setInterval(run,50);
        };

Правда Ваш способ получения цвета не идеален
Math.random().toString(16)

не обязательно будет нужной длины, например

console.log((0.5).toString(16))

Можно сделать так:

var color = '#';
while (color.length < 7)
   color += Math.random().toString(16).substring(2);
color = color.substring(0, 7);
console.log(color);


text:
Q: docker.io package reports missing only on EC2 I'm trying to install Docker on a Debian Jessie EC2 image. Specifically, I'm using this AMI: https://wiki.debian.org/Cloud/AmazonEC2Image/Jessie. On a locally running Debian machine sudo apt-get install docker.io does the trick. However, if I run that on an EC2 instance booted from the official Debian EC2 AMI I get:
admin@ip-10-136-121-82:~$ sudo apt-get install docker.io
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package docker.io is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'docker.io' has no installation candidate

Things I've tried:

*

*Running apt-get update before the above install command

*Changing /etc/apt/sources.list so it's identical to what I'm using successfully locally, then apt-get update and then retry the install

*apt-get dist-upgrade, a reboot, and then retrying the install

None of the above work. At this point my best guess is that the AMI uses a different, Xen compatible kernel which isn't Docker compatible and somehow apt is smart enough to know that and hide incompatible packages, but that's a wild guess and, if correct, I don't know of a good way to correct that and still use the official Debian AMI.
any help?

A: Turns out jessie removed docker.io today and not all repos had updated when I did these experiments. To make things extra confusing, http.docker.net is really a broker service that sends you to other mirrors so EC2 was seeing one, up to date, mirror while my local box was seeing a mirror that still had docker.io available.
Package history: https://packages.qa.debian.org/d/docker.io.html


text:
Q: E: Unable to locate package lib-nl Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package lib-nl
can some one help on this

A: Library for dealing with netlink sockets is named libnl-3-200 in all currently supported versions of Ubuntu. To install it open the terminal and type:
sudo apt update
sudo apt install libnl-3-200


text:
Q: webjobs in azure for a springBatch project I am new in azure and trying to deploy  my spring Batch project as a web jobs in azure.Can somebody help me with the process or changes require to do in my spring batch project before add in webjobs as a jar .
I have tried with  export jar and  add  that jar as webjob in azure service but its not working for me .
and also help me with how can i export a jar file from my spring Batch proeject

A: To create an executable jar, the jar must have a MANIFEST.MF class that points to the main class. I guess azure webjobs will try to execute the main class without arguments, so you cannot use org.springframework.batch.core.launch.support.CommandLineJobRunner directly.
So you'll need to write a custom main class, something like:
public class ApplicationMain {

  public static void main(String[] args) {

    SpringApplication app = new SpringApplication(Application.class);
    app.setWebEnvironment(false);
    ConfigurableApplicationContext ctx = app.run(args);
    JobLauncher jobLauncher = ctx.getBean(JobLauncher.class);
    JobParameters jobParameters = new JobParametersBuilder()
        .add...
        .toJobParameters();

    jobLauncher.run(ctx.getBean("...",  Job.class), jobParameters);

    System.exit(0);
  }
}

In your MANIFEST.MF file, you will then need:
Main-Class: com.something.ApplicationMain

If that's not working for you, please specify additional details in your question.


text:
Q: Can we create tables in PGADMIN4 without specifying the datatype's length? I am new to PostgresSQL and using pgadmin4 on my Windows machine, While creating tables came across datatypes like- char and char[] and also char Varying and char Varying[].
I want to know is there a method by which I can create an attribute name specifying the datatype but not length?

A: the datatype like char or varchar will do the work you want to do

A: Yes: use the text data type. It performs just as well and has no length limit (there is an absolute size limit of 1GB though).


text:
Q: Database Sizes error; Arithmetic overflow error converting expression to data type int I am using the below query to pull back database sizes for our SQL instances.
This cannot pull data larger than 2TB back because of the maximum number the int data type can pull back. How do I go about altering the query to return the database size, no matter how large the dbs?
SELECT
sys.databases.name,
CONVERT(VARCHAR,SUM(size) * 8/1024) +' MB' AS [Total_Size]
FROM        sys.databases
JOIN        sys.master_files
ON          sys.databases.database_id=sys.master_files.database_id
GROUP BY    sys.databases.name
ORDER BY    sys.databases.name

A: SUM(size) will return an int because the size column is int. Convert the column to a larger type, either with an explict CAST or an implicit conversion to avoid the overflow.
Below is an example that multiplies size by numeric constant 1.0 so the expression returns a numeric(13,1), resulting in numeric(38,1) after the SUM function:
SELECT
sys.databases.name,
CONVERT(VARCHAR,SUM(size*1.0) * 8/1024) +' MB' AS [Total_Size]
FROM        sys.databases
JOIN        sys.master_files
ON          sys.databases.database_id=sys.master_files.database_id
GROUP BY    sys.databases.name
ORDER BY    sys.databases.name;

A: You SUM up all the sizes, then do the multiplication (then division), but along the way if the numbers get too big, you can overflow the int limit. There are a few ways you can work around that.
Primarily, you want to convert your numbers to a bigger datatype before doing the math to get the larger scale. Then convert again for your display formatting, if you're doing that in T-SQL, and don't have an app to do it.
A few cautionary notes.

*

*float is just an estimate. Don't use it if you need actual numbers. It does some internal rounding that can bite you, particularly when doing math. Note that if you just multiply an int by 1.0 it will implicitly convert to an float, not numeric

*Be sure to specify the length on varchar. Declaring varchar without length can have surprising results.

*I also added table aliases to make the code more readable for a future you.

*sys.master_files will contain the startup size for tempdb. It will not have the current size. To get the current size, you'll need to look at the metadata in the database itself by querying tempdb.sys.database_files.

I maintain an open source DBA database that contains a stored procedure that does all of this for you as well. You can look at Check_FileSize on GitHub and the corresponding blog post
I've stepped through some of the details in this query, with comments in line. I'll let the comments & query stand alone in unpacking the solution, but the last two columns will give you two different options, depending on whether you need to maintain a decimal place or not. Decimals can be very helpful if you convert into larger units, like GB or TB.
SELECT
        DbName = d.name,
      --This will throw an int overflow
        --TotalFileSizePagesInt = SUM(mf.size),
      --This will do an implicit conversion to float
      --It's kind of lazy, but easy. But also confusing & magical to the reader.
        TotalFileSizePagesFloat = SUM(mf.size*1.0),
      --This will do an explict numeric conversion
      --This is a bit more typing but crystal clear to the reader.
        TotalFileSizePagesNumber = SUM(CONVERT(numeric(15,2), mf.size)),
      --This will do an explict numeric conversion, plus the math conversion to MB
      --Note that the math "moves" the decimal to more than 2 digits
        TotalFileSizeMBNumber = SUM(CONVERT(numeric(15,2), mf.size)*8/1024),
      --We can maintain 2 decimals just by converting again.
        TotalFileSizeMBNumberRounded = CONVERT(numeric(15,2),(SUM(CONVERT(numeric(15,2), mf.size)*8/1024))),
      --Or, if we don't need to maintain decimals, we can just use bigint in the first place
        TotalFileSizeMBBigInt = SUM(CONVERT(bigint, mf.size)*8/1024),
      --And now we can add your "MB" label back in
        TotalFileSizeMBNumberWithLabel = CONVERT(varchar(50),CONVERT(numeric(15,2),(SUM(CONVERT(numeric(15,2), mf.size)*8/1024)))) + ' MB',
        TotalFileSizeMBBigingWithLabel = CONVERT(varchar(50),SUM(CONVERT(bigint, mf.size)*8/1024)) + ' MB'
FROM     sys.databases AS d
JOIN     sys.master_files AS mf
             ON d.database_id = mf.database_id
GROUP BY d.name
ORDER BY d.name
``

A: You need to CAST size to BIGINT first. The max size for a BIGINT is quite large. (9,223,372,036,854,775,807) LINK
SELECT
sys.databases.name,
CONVERT(VARCHAR,SUM(TRY_CAST(size AS BIGINT)) * 8/1024) +' MB' AS [Total_Size]
FROM        sys.databases
JOIN        sys.master_files
ON          sys.databases.database_id=sys.master_files.database_id
GROUP BY    sys.databases.name
ORDER BY    sys.databases.name


text:
Q: Docker error !!! bash: docker.exe: command not found i installed docker toolbox in window 10 home and now on execute command it show me an error bash:
docker.exe: command not found

A: Found this issue by having a similar error zsh: command not found: docker.exe
My issue was an entry in the ~/.zshrc file that had an alias to docker.exe.
By commenting out the alias and source ~/.zshrc the file, docker was able to run.


text:
Q: Header.php & Side bar loading wrong in WordPress Regarding my sidebar widget on WordPress. I would like it to load like this all in one column after the main content on mobile devices, which I had before but not sure what caused it to go wrong.   Image of previous correct loading
Its also loading incorrectly on desktop post pages too.
The page I need help with.
Seems like there is something I have or that is missing in my child theme's header.php that is causing my right sidebar widgets to load wrong.
I am using the Twenty Eleven theme.  Below is code for my current LIVE header.php

<?php
/**
 * Header template for the theme
 *
 * Displays all of the  section and everything up till
.
 *
 * @package WordPress
 * @subpackage Twenty_Eleven
 * @since Twenty Eleven 1.0
 */
?><!DOCTYPE html>

<html <?php language_attributes(); ?>>

<meta charset="<?php bloginfo( 'charset' ); ?>" />
<meta name="viewport" content="width=device-width" />
<title><?php
    // Print the <title> tag based on what is being viewed.
    global $page, $paged;

    wp_title( '|', true, 'right' );

    // Add the blog name.
    bloginfo( 'name' );

    // Add the blog description for the home/front page.
    $site_description = get_bloginfo( 'description', 'display' );
    if ( $site_description && ( is_home() || is_front_page() ) )
        echo " | $site_description";

    // Add a page number if necessary:
    if ( $paged >= 2 || $page >= 2 )
        echo ' | ' . sprintf( __( 'Page %s', 'twentyeleven' ), max( $paged, $page ) );

    ?></title>
<link rel="profile" href="http://gmpg.org/xfn/11" />
<link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" />
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />

<?php
    /*
     * We add some JavaScript to pages with the comment form
     * to support sites with threaded comments (when in use).
     */
    if ( is_singular() && get_option( 'thread_comments' ) )
        wp_enqueue_script( 'comment-reply' );

    /*
     * Always have wp_head() just before the closing
     * tag of your theme, or you will break many plugins, which
     * generally use this hook to add elements to  such
     * as styles, scripts, and meta tags.
     */
    wp_head();
?>

<body <?php body_class(); ?>>

            <hgroup>

<a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?>

<?php bloginfo( 'description' ); ?>

            </hgroup>

            <?php
                // Check to see if the header image has been removed
                $header_image = get_header_image();
                if ( $header_image ) :
                    // Compatibility with versions of WordPress prior to 3.4.
                    if ( function_exists( 'get_custom_header' ) ) {
                        /*
                         * We need to figure out what the minimum width should be for our featured image.
                         * This result would be the suggested width if the theme were to implement flexible widths.
                         */
                        $header_image_width = get_theme_support( 'custom-header', 'width' );
                    } else {
                        $header_image_width = HEADER_IMAGE_WIDTH;
                    }
                    ?>
            <a href="<?php echo esc_url( home_url( '/' ) ); ?>">
                <?php
                        // Compatibility with versions of WordPress prior to 3.4.
                        if ( function_exists( 'get_custom_header' ) ) {
                            $header_image_width  = get_custom_header()->width;
                            $header_image_height = get_custom_header()->height;
                        } else {
                            $header_image_width  = HEADER_IMAGE_WIDTH;
                            $header_image_height = HEADER_IMAGE_HEIGHT;
                        }
                        ?>
                    <img src="<?php header_image(); ?>" width="<?php echo $header_image_width; ?>" height="<?php echo $header_image_height; ?>" alt="" />

            <?php endif; // end check for removed header image ?>

            <?php
                // Has the text been hidden?
                if ( 'blank' == get_header_textcolor() ) :
            ?>
                <div class="only-search<?php if ( $header_image ) : ?> with-image<?php endif; ?>">
                <?php get_search_form(); ?>

            <?php
                else :
            ?>
                <?php get_search_form(); ?>
            <?php endif; ?>

<?php _e( 'Main menu', 'twentyeleven' ); ?>

                <?php /* Allow screen readers / text browsers to skip the navigation menu and get right to the good stuff. */ ?>

<a class="assistive-text" href="#content" title="<?php esc_attr_e( 'Skip to primary content', 'twentyeleven' ); ?>"><?php _e( 'Skip to primary content', 'twentyeleven' ); ?>

<a class="assistive-text" href="#secondary" title="<?php esc_attr_e( 'Skip to secondary content', 'twentyeleven' ); ?>"><?php _e( 'Skip to secondary content', 'twentyeleven' ); ?>

                <?php /* Our navigation menu. If one isn't filled out, wp_nav_menu falls back to wp_page_menu. The menu assigned to the primary location is the one used. If one isn't assigned, the menu with the lowest ID is used. */ ?>
                <?php wp_nav_menu( array( 'theme_location' => 'primary' ) ); ?>

When I replace it with the parent themes default header.php script (below) the problem with the right sidebar orientation gets fixed but then for some reason my sites header logo gets switched to the featured image so it inherits a different problem.
Below is the parent theme's header.php script

<?php
/**
 * Header template for the theme
 *
 * Displays all of the  section and everything up till
.
 *
 * @package WordPress
 * @subpackage Twenty_Eleven
 * @since Twenty Eleven 1.0
 */
?><!DOCTYPE html>

<html <?php language_attributes(); ?>>

<meta charset="<?php bloginfo( 'charset' ); ?>" />
<meta name="viewport" content="width=device-width" />
<title>
<?php
    // Print the <title> tag based on what is being viewed.
    global $page, $paged;

    wp_title( '|', true, 'right' );

    // Add the blog name.
    bloginfo( 'name' );

    // Add the blog description for the home/front page.
    $site_description = get_bloginfo( 'description', 'display' );
if ( $site_description && ( is_home() || is_front_page() ) ) {
    echo " | $site_description";
}

    // Add a page number if necessary:
if ( ( $paged >= 2 || $page >= 2 ) && ! is_404() ) {
    /* translators: %s: Page number. */
    echo esc_html( ' | ' . sprintf( __( 'Page %s', 'twentyeleven' ), max( $paged, $page ) ) );
}

?>
    </title>
<link rel="profile" href="https://gmpg.org/xfn/11" />
<link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>?ver=20190507" />
<link rel="pingback" href="<?php echo esc_url( get_bloginfo( 'pingback_url' ) ); ?>">

<?php
    /*
     * We add some JavaScript to pages with the comment form
     * to support sites with threaded comments (when in use).
     */
if ( is_singular() && get_option( 'thread_comments' ) ) {
    wp_enqueue_script( 'comment-reply' );
}

    /*
     * Always have wp_head() just before the closing
     * tag of your theme, or you will break many plugins, which
     * generally use this hook to add elements to  such
     * as styles, scripts, and meta tags.
     */
    wp_head();
?>

<body <?php body_class(); ?>>
<?php wp_body_open(); ?>

            <hgroup>

<a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?>

<?php bloginfo( 'description' ); ?>

            </hgroup>

            <?php
                // Check to see if the header image has been removed.
                $header_image = get_header_image();
            if ( $header_image ) :
                // Compatibility with versions of WordPress prior to 3.4.
                if ( function_exists( 'get_custom_header' ) ) {
                    /*
                     * We need to figure out what the minimum width should be for our featured image.
                     * This result would be the suggested width if the theme were to implement flexible widths.
                     */
                    $header_image_width = get_theme_support( 'custom-header', 'width' );
                } else {
                    $header_image_width = HEADER_IMAGE_WIDTH;
                }
                ?>
            <a href="<?php echo esc_url( home_url( '/' ) ); ?>">
                <?php
                /*
                 * The header image.
                 * Check if this is a post or page, if it has a thumbnail, and if it's a big one
                 */
                $image = false;
                if ( is_singular() && has_post_thumbnail( $post->ID ) ) {
                    $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), array( $header_image_width, $header_image_width ) );
                }
                if ( $image && $image[1] >= $header_image_width ) {
                    // Houston, we have a new header image!
                    echo get_the_post_thumbnail( $post->ID, 'post-thumbnail' );
                } else {
                    // Compatibility with versions of WordPress prior to 3.4.
                    if ( function_exists( 'get_custom_header' ) ) {
                        $header_image_width  = get_custom_header()->width;
                        $header_image_height = get_custom_header()->height;
                    } else {
                        $header_image_width  = HEADER_IMAGE_WIDTH;
                        $header_image_height = HEADER_IMAGE_HEIGHT;
                    }
                    ?>
                    <img src="<?php header_image(); ?>" width="<?php echo esc_attr( $header_image_width ); ?>" height="<?php echo esc_attr( $header_image_height ); ?>" alt="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" />
                    <?php
                } // End check for featured image or standard header.
                ?>

            <?php endif; // End check for removed header image. ?>

            <?php
                // Has the text been hidden?
            if ( 'blank' === get_header_textcolor() ) :
                $header_image_class = '';
                if ( $header_image ) {
                    $header_image_class = ' with-image';
                }
                ?>
            <div class="only-search<?php echo $header_image_class; ?>">
                <?php get_search_form(); ?>

                <?php
                else :
                    ?>
                    <?php get_search_form(); ?>
            <?php endif; ?>

<?php _e( 'Main menu', 'twentyeleven' ); ?>

                <?php
                /*
                 * Our navigation menu. If one isn't filled out, wp_nav_menu() falls back to wp_page_menu().
                 * The menu assigned to the primary location is the one used.
                 * If one isn't assigned, the menu with the lowest ID is used.
                 */
                wp_nav_menu( array( 'theme_location' => 'primary' ) );
                ?>

Seems that my current child theme's header.php on single posts orients the right sidebar to load all the way to the right and in its own awkward column after the main content and this does not look right.
Image of current incorrect loading
I would like it to load this way all in one column after the main content, which I had before but not sure what caused it to go wrong.   Image of previous correct load
Need helping fixing this. Any help would be greatly appreciated! Thank you


text:
Q: Map excel values by category I have a table containing main and secondary values for different documents (each document having its own id as a number which can have decimals).
From this source table, I want to obtain another one with a mapping between values and documents and for each mapping I want to see if the value is "main" or "secondary" for that document in the original table.
I already have the first two columns created in the mapping table, but I can't figure out what formula to use for the 3rd column.
So far I have tried XLOOKUP but it doesn't seem to work because some documents show up more than once in the original table.
Starting table:

Desired result:

A: Here is one way:

Formula in C8:
=FILTER(A$1:B$1,BYCOL((A$2:B$4=A8)*(ISNUMBER(FIND(","&CHAR(10)&B8&",",","&CHAR(10)&C$2:C$4&","))),LAMBDA(a,SUM(a))))

Or, for older versions:
=INDEX(A$1:B$1,SUMPRODUCT((A$2:B$4=A8)*(ISNUMBER(FIND(","&CHAR(10)&B8&",",","&CHAR(10)&C$2:C$4&","))*COLUMN(A1:B1))))


text:
Q: Exclude a dependent file from VSS in Visual Studio 2008 I have a file, let's say MySchema.xsd, within a folder in a C# project.  I am auto-generating a class, MySchema.cs, through the use of a pre-build action that runs xsd.exe on it.  I can include MySchema.cs in my project, and VS2008 automatically makes it a dependent file of MySchema.xsd.
I need to include MySchema.xsd in source control (Visual Source Safe 2005) but exclude the generated output.  This blog entry has a tip that does exactly what I want, except that the menu option "Exclude 'MySchema.cs' from source control" does not exist.  It seems that this menu option does not appear for dependent items.  I do have that option for MySchema.xsd, but that is not what I want.
I have tried temporarily making MySchema.cs independent by editing the .csproj file, then excluding the file.  That worked, but when I went to make the file dependent again, MySchema.xsd is also excluded.
Another solution could be just to name the output of xsd.exe something else, then exclude that file.  However, I would like to avoid renaming if possible.
Is there another solution I have missed?

A: What about removing it from source control but still include in in the project?


text:
Q: ANSI, ASCII, Unicode and encoding confusion with Python I was happily using BeautifulSoup and I'm also using a text file as input parameters of my Python script.
I then came across the famous "UnicodeEncodeError" error.
I've been reading questions here at SO but I'm still confused.
What does ASCII got to do with all of these?
What encoding do I use on my text editor (Notepad++)? ANSI? UTF-8?
Decoding a string to ASCII doesn't seem to always work (I'm guessing the string is in a different encoding coming from BeautifulSoup). How do I fix this?
Anyway any help and clarifications will be greatly appreciated.
Thanks!
edit:
reading BeautifulSoup's docs, it says that it only uses unicode but I'm still getting Unicode errors :(
  File "C:\Python26\lib\encodings\cp437.py", line 12, in encode
    return codecs.charmap_encode(input,errors,encoding_map)
UnicodeEncodeError: 'charmap' codec can't encode character u'\u300d' in position
 3: character maps to <undefined>

A: ANSI is not a character encoding (in common parlance it refers to certain escape sequences, though it's of course the acronym for the American National Standard Institute).  You can set the encoding in Notepad++ (and check what encoding you're using) -- hopefully utf-8, because that's a universal encoding (lets you represent any Unicode point).  You build unicode from your utf-8 encoded text with an explicit decode method call, or you read the file as unicode with a codecs.open (both require you to specify your encoding name -- again, hopefully 'utf8').

A:
What does ASCII got to do with all of these?

Python has no way to find out what encoding was used to store text, so it assumes ascii by default. However, ASCII defines only first 128 chars, so anything outside results in decode error (which is actually good thing, since it does not let you use incorrectly decoded strings around).
Most of the time your string would be in utf-8, since its most common way to encode Unicode, so its usually safe to do s.decode('utf-8') on str type strings (or use unicode(s, 'utf-8') call)
If you dont know in advance what kind of encoding text has, and it provides no encoding metadata, you can try using chardet module.
BeautifulSoup can output result in different encodings and ways, so you just need to specify that you want unicode there.

A: As of now (2014, 1, 23), for Notepad++ (NPP) there still seems to be a lot of recent/Unresolved BugReports/Discussions regarding the use of ANSI as a Notepad++ encoding term.
PROBLEM
Google: notepad++ ansi encoding
Results:
#4095 "ANSI as UTF-8" Misleading
#124 ansi encoding and german letters
The encoding that Notepad++ just calls "ANSI", does anyone know what to call it for Ruby?
Notepad++ Forum - Search discussion: ANSI encoding
SOLUTION
The following NPP Forum Discussion seems to point to the best SOLUTION for me.
See Encoding detection, ANSI (Windows 1252) vs. UTF-8 (w/o BOM)

Preferences -> New Document > Encoding > UTF8 without BOM" called
  Apply to opened ANSI files

I CHECKED the above as OPPOSED to the author who UNchecked it.
Then i begin my Python script as follows.
#!/usr/bin/python
# -*- coding: utf-8 -*-


text:
Q: Pronunciation problem : The word data : Is it pronounced dā-tə, or ˈda? Recently our Educational Ministry is trying to change the way how to evaluate the English skill of candidates of university tests and it hit on Yahoo! Japan's main page.
A comment says, in American English it is pronounced as ˈdā-tə, like, day-ta. On the other hand from my personal experience, I said native American speakers use da-tə, which in my opinion would be correct ( And I got 5 downvotes at my Q&A site simultaneously ).
Which one is correct or more prevalent?

A: In the U.S. the word is pronounced in at least two different ways, even among people working in the high tech industry where this word is most frequently invoked. Both pronunciations you mentioned are both possible and enjoy similar popularity.
Merriam Webster includes three different pronunciations.

/ˈdeɪtə/
  /ˈdætə/
  /ˈdɑːtə/

In the U.S. you can definitely hear the first two. /ˈdeɪtə/ is more popular among BrE speakers, or so I have heard.


text:
Q: Show that $\sup_y \inf_x h(x,y) \leq \inf_x \sup_y h(x,y)$
Here is what I have so far:
Since $h(x,y)$ has a bounded range, $\exists \sup, \inf$ for range $h(x,y)$. Then $h(x,y) \leq \sup \{h(x,y): y \in Y\} = f(x)$ and $h(x,y) \geq \inf\{h(x,y) : x \ in X \} = g(y)$. Thus we get the inequality $$g(y) \leq h(x,y) \leq f(x) \forall x \in X, \forall y \in Y $$
Now we see that $f(x)$ is an upper bound of $g(y)$. Here, I am not sure what I am trying to show from here. I think the last line reads that we want to show that the $\sup$ with respect to y * $\inf h(x,y) \leq$ $\inf$ with respect to x * $\sup h(x,y)$. Is this at least the right direction for thinking of the problem?

A: Your proof of the inequality $g(y) \leq f(x)$ is correct. Fix $x\in X$. As $g(y) \leq f(x)$ for all $y\in Y$, $f(x)$ is an upper bound of $\{ g(y) : y\in Y\}$. It follows that
$$
\sup \{ g(y) : y\in Y\} \leq f(x).
$$
As the above inequality holds for arbitrary $x\in X$, $\sup \{ g(y) : y\in Y\}$ is a lower bound of $\{ f(x) : x\in X\}$ and we get
$$
\sup \{ g(y) : y\in Y\} \leq \inf \{ f(x) : x\in X\}.
$$


text:
Q: Tool to draw workflow/flowchart of scripts execution and run it Am looking for a windows tool that lets me draw a workflow (scenario) of scripts execution and run it after that:
example of use case : i have 4 scripts : prepare.bat, compile.bat, load.bat and run.exe.
With this tool i'd like to draw the sequence :
compile->load->run
if one of the steps failed then do prepare->compile->load -> run.
thanx a lot.


text:
Q: fullcalender v5 resource set icons I'm using fullcalendar 5. The only problem that I have is that my icons wont display because it's using plain text.
I found the resourceLabelDidMount option to add a html element. However that applies to the parent and child and not to the child only.
resourceLabelDidMount: function(data) {
  var icon = document.createElement('strong');
  icon .innerHTML = '<i class="fa fa-check"></i>';

  data.el.querySelector('.fc-datagrid-cell-main') .appendChild(icon );
},

Is there a way to use a icon for the second and third child column?


text:
Q: Brownian motion integral Let $(B_t)$ be a standard Brownian motion, $f$ a continuous function and $X_t = \int_0^t f(s)B_s ds$.
I was able to prove that $(X_t)$ is a Gaussian process with zero mean and trying to find the covariance function of $(X_t)$ now. But I got so far is the following:
$\mathbb{E} \left( X_t X_s\right) = \mathbb{E}\left( \left(\int_0^t f(u)B_u du \right) \left( \int_0^s f(v)B_v dv\right)\right) = \int_0^t \int_0^s f(u)f(v)\mathbb{E}\left(B_u B_v \right)du dv$
$= \int_0^t \int_0^s f(u)f(v) \cdot \min(u,v) du dv$ (1).
(modulo Fubini's theorem justification).
I am having trouble with simplification of my result in (1), not sure whether I can simplify it further, or am I doing something wrong?
I would be grateful for any ideas or suggestion.
Thanks


text:
Q: Cherry-pick Jekyll collection output Setup:

*

*I have a Jekyll collection of 800 items

*I've set output: false as I don't need individual pages for each one, and want to save time on builds

*I do, however, want to be able to output: true on select items

Question
Is there a way to do this? I tried overriding the output variable in the selected item's front matter, but that didn't seem to make difference.
I do know about published: true/false, but I need for all files to be published:true for their data to remain available elsewhere in my site. This question pertains to their output as pages.

A: You can use two collections, one with output: true (col1) and the other with no output (col2).
Now if you want to loop over both collections in single pass, you can concatenate them :
{% assign all = site.col1 | concat: site.col2 %}

And if you have the same datas in both collections, you can sort item like this :
{% assign all = site.col1 | concat: site.col2 | sort: 'title' %}


text:
Q: Draw image without repainting surfaces from other controls I have a transparent image to draw on a control called Hex. I hold it on Form1, and have a generator called Map.
Under Paint(object, PaintEventArgs) of Hex I draw the image:
e.Graphics.DrawImage(foo.Properties.Resources.h, ClientRectangle);

But it keeps repainting surfaces from other controls:

How can I avoid this?
For code of Hex and Map: http://pastebin.com/XsjKc3Yf

A: I've went through the easiest way:

*

*Made Hex a special class.
public class Hex
{
    public Point Location;
    public Country Holder;

    public Hex(Country holder = null)
    {
        Holder = holder;
    }

    public void DrawMe(Graphics g)
    {
        g.DrawImage(Middle_Ages_Country.Properties.Resources.h, new Rectangle(Location, new Size(40, 40)));
    }
}

*Edited Map class, and created a new method DrawHexes which will be called when necessary. Also used buffered graphics as it takes some time to draw it all.
public Map(int rows, int columns, Form1 owner)
{
    int x = 40, y = 40;
    // Create map
    for (int row = 0; row < rows; row++)
    {
        List<Hex> r = new List<Hex>();
        for (int column = 0; column < columns; column++)
        {
            Hex h = new Hex(null)
            {
                Location = new System.Drawing.Point(x, y),
            };
            r.Add(h);
            x += 40;
        }
        Grid.Add(r);
        x -= columns * 40;
        x = (row % 2) * 20 + 20;
        y += 30;
    }
}

public void DrawHexes(Form1 owner)
{
    BufferedGraphicsContext context = BufferedGraphicsManager.Current;
    BufferedGraphics buf = context.Allocate(owner.CreateGraphics(), owner.ClientRectangle);

    buf.Graphics.Clear(Color.Red);

    foreach (List<Hex> row in Grid)
    {
        foreach (Hex h in row) h.DrawMe(buf.Graphics);
    }
    buf.Render();
}


text:
Q: How to make font bigger?
I try to make upn logo use JFrame. I make 3shape successly and I make upn letter but I can't make bigger how to make font bigger?
Pleas help me.
this is my code
   package test;

   import java.awt.*;

   import java.awt.Font;

   import javax.swing.*;

   public class UPN extends JPanel {

   public static void main(String[] args) {

   JFrame window = new JFrame("UPN");

   UPN content = new UPN();

   window.setContentPane(content);

   window.setSize(400,400);

   window.setLocation(100,100);

   window.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );

   window.setVisible(true);

   }
   private Font font;

   public void paint(Graphics g) {

     g.setColor(Color.RED);
     g.fillRect(250,100,100,100);

     g.setColor(Color.BLUE);
        int xpoints[] = {200, 140, 270};
        int ypoints[] = {80, 200, 200};
        int npoints = 3;
     g.fillPolygon(xpoints, ypoints, npoints);

     g.setColor(Color.YELLOW);
     g.fillOval(63,100,100,100);

g.setColor(Color.black);
g.drawString("UPN", 30, 150);

    }
   public void letter(){
       font=new Font("Helvetica",Font.BOLD,150);
        setFont(font);
   }

}

A: Try adding this line:
setFont(new Font("Helvetica", 1, 170));

A: It may be easier to just draw the jpeg or png to a JPanel and then add that to the Jframe. But if you want/need to keep using this, Java Oracle has all the methods relating to Font and how they work. You should look there for  questions like this one.
https://docs.oracle.com/javase/7/docs/api/java/awt/Font.html

A: I notice you never called your letter() function. Try that first.
Instead of:
g.setColor(Color.black);
g.drawString("UPN", 30, 150);

Delete the letter method and try:
g.setColor(Color.black);
setFont(new Font("Helvetica", 1, 170));
g.drawString("UPN", 30, 150);

You defined letter(), which will do what you want, but you never use it.


text:
Q: Crash when compiling null, at character offset null: Null check operator used on a null value IN FLUTTER DEMO I am learning flutter. today after finishing the installations and running the default flutter application i got this error, i did not touch any of the default code. please help me i have been applying the possible solutions for hours but nothing works, i even reinstalled everything.
I have everything installed in the latest version and 0 issues in flutter doctor.
  Crash when compiling null,
at character offset null:
Null check operator used on a null value
#0      InferableTypeBuilderMixin.type (package:front_end/src/fasta/builder/type_builder.dart:392:29)
#1      InferableTypeBuilder.inferType (package:front_end/src/fasta/builder/omitted_type_builder.dart:155:12)
#2      SourceLoader.performTopLevelInference (package:front_end/src/fasta/source/source_loader.dart:2358:19)
#3      KernelTarget.buildOutlines.<anonymous closure> (package:front_end/src/fasta/kernel/kernel_target.dart:532:14)
<asynchronous suspension>
#4      withCrashReporting (package:front_end/src/fasta/crash.dart:122:12)
<asynchronous suspension>
#5      _buildInternal (package:front_end/src/kernel_generator_impl.dart:139:7)
<asynchronous suspension>
#6      withCrashReporting (package:front_end/src/fasta/crash.dart:122:12)
<asynchronous suspension>
#7      generateKernel.<anonymous closure> (package:front_end/src/kernel_generator_impl.dart:47:12)
<asynchronous suspension>
#8      generateKernel (package:front_end/src/kernel_generator_impl.dart:46:10)
<asynchronous suspension>
#9      kernelForModule (package:front_end/src/api_prototype/kernel_generator.dart:100:11)
<asynchronous suspension>
#10     SingleShotCompilerWrapper.compileInternal (file:///C:/b/s/w/ir/cache/builder/sdk/pkg/vm/bin/kernel_service.dart:412:11)
<asynchronous suspension>
#11     Compiler.compile.<anonymous closure> (file:///C:/b/s/w/ir/cache/builder/sdk/pkg/vm/bin/kernel_service.dart:221:45)
<asynchronous suspension>
#12     _processLoadRequest (file:///C:/b/s/w/ir/cache/builder/sdk/pkg/vm/bin/kernel_service.dart:914:37)
<asynchronous suspension>

#0      InferableTypeBuilderMixin.type (package:front_end/src/fasta/builder/type_builder.dart:392:29)
#1      InferableTypeBuilder.inferType (package:front_end/src/fasta/builder/omitted_type_builder.dart:155:12)
#2      SourceLoader.performTopLevelInference (package:front_end/src/fasta/source/source_loader.dart:2358:19)
#3      KernelTarget.buildOutlines.<anonymous closure> (package:front_end/src/fasta/kernel/kernel_target.dart:532:14)
<asynchronous suspension>
#4      withCrashReporting (package:front_end/src/fasta/crash.dart:122:12)
<asynchronous suspension>
#5      _buildInternal (package:front_end/src/kernel_generator_impl.dart:139:7)
<asynchronous suspension>
#6      withCrashReporting (package:front_end/src/fasta/crash.dart:122:12)
<asynchronous suspension>
#7      generateKernel.<anonymous closure> (package:front_end/src/kernel_generator_impl.dart:47:12)
<asynchronous suspension>
#8      generateKernel (package:front_end/src/kernel_generator_impl.dart:46:10)
<asynchronous suspension>
#9      kernelForModule (package:front_end/src/api_prototype/kernel_generator.dart:100:11)
<asynchronous suspension>
#10     SingleShotCompilerWrapper.compileInternal (file:///C:/b/s/w/ir/cache/builder/sdk/pkg/vm/bin/kernel_service.dart:412:11)
<asynchronous suspension>
#11     Compiler.compile.<anonymous closure> (file:///C:/b/s/w/ir/cache/builder/sdk/pkg/vm/bin/kernel_service.dart:221:45)
<asynchronous suspension>
#12     _processLoadRequest (file:///C:/b/s/w/ir/cache/builder/sdk/pkg/vm/bin/kernel_service.dart:914:37)
<asynchronous suspension>

A: I had the same problem, after 3 days of searching I was able to fix the problem, just through deleting this Extension, if you don't have this extension but the problem persists, then the problem is definitely one extension, try disabling it one by one and reload vscode until you find it


text:
Q: How would I find an item in my linked list in java that matches another string or doesn't match the string? I have a custom generic linked list in java (it is not java's LinkedList or any of the collections).  My linked list has a node, a ListInterface, the actual LinkedList, a class file and a file with the main method. This linked list and classes are supposed to form a DVD inventory manager.  What I am trying to do is traverse the list and check to see if the string that the user has passed in is equal to the string of one of the variables of one of the objects in the linked list.
This is what I have so far:
    if (movies.isEmpty()) {
        movies.add(new Dvd(userMovie), movies.length()+1);
    } else if (!movies.isEmpty()) {
        for (int i = 1; i <= movies.length(); i++) {
            if (movies.get(i).getTitle().equals(userMovie)) {
                movies.get(i).addCopy();
            } else if (!movies.get(i).getTitle().equals(userMovie)) {
                movies.add(new Dvd(userMovie), movies.length()+1);
            }
        }
    }

In English:
if the movies linked list is empty, add the movie that has been passed in (userMovie).
else if the movies linked list is not empty, check each item in the list to see if the movie that has been passed in already exists.  If it already exists, add a copy to it.  Else if the movie that has been passed in does not exist, add the movie to the list.
This all works except for the last part.
I add a movie when empty and get this:
 Star Wars 1 // one copy of star wars has been added

I then add the same movie again and the copies updates:
 Star Wars 2

I then try to add a different movie and it starts out at two copies instead of 1:
 Harry Potter 2

I then try to add that same movie again to see what happens and it gives me this:
Star Wars 1
Harry Potter 3
Harry Potter 2

A: the logic of the inner loop is not correct.
try this, you only want to add a new movie once, not once for every movie that does not match it's title.
if (movies.isEmpty()) {
    movies.add(new Dvd(userMovie), movies.length()+1);
} else if (!movies.isEmpty()) {
    boolean found = false;
    for (int i = 1; i <= movies.length(); i++) {
        if (movies.get(i).getTitle().equals(userMovie)) {
            movies.get(i).addCopy();
            found = true;
        }
    }
    if (!found) {
        movies.add(new Dvd(userMovie), movies.length()+1);
    }
}


text:
Q: Style broken and pixelated in a bootstrap modal using google chrome? I have an issue with the boostrap modals using the Inspinia theme. When i select a combobox or the tags input, the style of the modal brokes and gets pixelated. We didn't change any style file, somebody knows if it's a chrome issue?
here's a picture of the error

A: This is an open issue on the Bootstrap GitHub. Apparently, it is a bug in Chrome on Windows with GPU acceleration enabled. I guess we'll just have to wait until Chrome or Bootstrap release a fix.


text:
Q: How to design VR app with realtime mobile camera to detect things? I want to design VR app in android which detects/recognise things using camera. and show details.
I know about unity, but this shows assets provided while designing background like gaming set.
In augmented reality we can scan image and accordingly we get results, the same way I want using VR screen.

A: Check out Vuforia library for android. It works like a charm.
I have implemented what you're talking about. It'll take a little effort and time to get the hang of it. But it'll definitely work.


text:
Q: How to compute SMA for months based on weeks data? I have a dataframe with 100 Keys(column 1) and 6 months data (from Jan to June in column format like 2019_Jan_Week1,2019_Jan_Week2 etc. till June). Agenda is to forecast for future 3 months (from July to Sep) using Simple Moving Average of last 6 months. For instance, for July Week1 forecast the moving average should be calculated using 2019_Jan_Week1,2019,Feb_Week1,2019_Mar_Week1,2019_Apr_Week1,2019_May_Week1, and 2019_Jun_Week1.
The question is how to effective and speedily compute this operation?
Currently I am using For loop which takes huge amount of time?
I have tried using for loop, but it is taking huge amount of time.
counter=1
for keyIndex in range(0,len(finalForecastingData)):
    print(keyIndex)
    for forcastingMonthsIndex in range(31,columns):
        finalForecastingData.iloc[keyIndex,forcastingMonthsIndex] = finalForecastingData.iloc[keyIndex,counter]+finalForecastingData.iloc[keyIndex,counter+5]+finalForecastingData.iloc[keyIndex,counter+10]+finalForecastingData.iloc[keyIndex,counter+15]+finalForecastingData.iloc[keyIndex,counter+20]
        counter = counter+1
    counter=1

A: Welcome to stackoverflow.
You can very easily get a rolling mean with pandas .rolling('60d').mean(). For that you need to convert the time data into pandas Datetime format with pd.to_datetime() and set it as index with set_index().
You should also check out https://stackoverflow.com/help/minimal-reproducible-example. It really helps to give example data. With a sample DataFrame it becomes much easier to give you concrete code rather than a direction where to look.