text:
Q: How do I reference a subclass's parent view controller? Here you can see that I've set the delegate of my subclassed textView to itself:
import Foundation
class ImageCaptionTextView: UITextView, UITextViewDelegate {

    override func awakeFromNib() {
        super.awakeFromNib()
        delegate = self
    }

Now in my controller my delegate methods do not work. I'm using all the ImageCaptionTextView delegate methods in the ImageCaptionTextView subclass instead of where they previously were which was the controllers class.
Now there is some code I needed to add to the controller related textViewDidEndEditing delegate method for the ImageCaptionTextView but because the delegate method for the ImageCaptionTextView is set inside the ImageCaptionTextView subclass this new code added in controller won't work.
I'm starting to wonder whether I've just complicated things and should just move as much code as I can back into the controller. I just thought it made things a little cleaner for me.
So my question is:
How can I reference the ImageCaptionTextView's parent controller so instead of setting ImageCaptionTextView's delegate to itself i can set it to the controller?
Thanks for your time.

A: You could implement the delegate methods and then send the same message to the controller, but honestly that's naughty.
Consider doing everything you can in a controller using delegate methods before subclassing.  If you hit something that the delegate methods won't handle, subclass, but change as little as possible with the view class implementation.

A: I think this may help you..
First you need to define a delegate variable in your UITextView. This is a possible way to set it up:
class ImageCaptionTextView: UITextView, UITextViewDelegate {

    var delegate: UITextViewDelegate!

    override func awakeFromNib() {
        super.awakeFromNib()
        // delegate = self
    }
}

The exclamation mark means that the variable isn't yet initialised at declaration time but that it will latter in the code. It is thus not an optional and MUST be initialised somewhere.
Then in your UIViewController, you initialise that variable with a reference to your UITextView. An outlet in the storyboard should do the trick. If you have set the UIView programatically, it's even easier.
IBOutlet way:
@IBOutlet weak var imageCaptionTextView: UITextView!

// later in the code

imageCaptionTextView.delegate = self

Programatically:
let imageCaptionTextView = ImageCaptionTextView()
imageCaptionTextView.delegate = self

You should be good then ;)

A: I've never used swift before, but if it works like Objective-C, then the way to do this is to set your UITextView subclass's delegate property to it's parent view controller at the moment that it's created. i.e.
In parent VC (forgive me if it's in obj-c):
ImageCaptionTextView *myTextView = [ImageCaptionTextView new];
myTextView.delegate = self;

If this doesn't make any sense in swift then I'll just delete this answer. But I hope it helps!


text:
Q: How to put a Scrollarea with other Widgets in the Layout? I want to have other zones for different kind of menus and a scroll area for scrolling a 2D space, like an big image. The problem is once I use a scroll area It takes over everything. All the other widgets disappears.
Here's a demo code:
import sys
from PyQt5.QtWidgets import (QApplication, QMainWindow, QWidget,
QVBoxLayout, QFrame, QScrollArea, QHBoxLayout)

app = QApplication(sys.argv)

layout = QVBoxLayout()

b_widget=QWidget()
b_widget.setStyleSheet("background-color: blue")
r_widget=QWidget()
r_widget.setStyleSheet("background-color: red")
g_widget=QWidget()
g_widget.setStyleSheet("background-color: green")

scroll=QScrollArea()
scroll.setWidget(g_widget)

layout.addWidget(scroll)
layout.addWidget(r_widget)
layout.addWidget(b_widget)

widget = QWidget()
widget.setLayout(layout)

main=QMainWindow()
main.setCentralWidget(widget)

main.show()
app.exec()

Thank you for your help!

redpajama_set_name: RedPajamaStackExchange


text:
Q: Footnote is split between the two columns of my document The title says it all. It looks kind of awkward in my opinion. Here's my code:
\documentclass[twocolumn]{article}

\usepackage{booktabs, makecell, tabularx}
\renewcommand\theadfont{\normalsize}
\renewcommand\theadgape{}
\setcellgapes{2pt}
\newcolumntype{L}{>{\raggedright\arraybackslash}X}
\usepackage{caption}
\usepackage{textcomp}
\usepackage{graphicx}
\raggedbottom
\usepackage{amsmath,geometry}
\usepackage{rotating}
\usepackage{booktabs, makecell}
\usepackage[referable]{threeparttablex}
\usepackage{siunitx}
\usepackage[skip=1ex]{caption}
\usepackage{upquote}
\usepackage{balance}
\usepackage[lite]{mtpro2} % Times Roman math font
\usepackage{float}
\usepackage{wasysym}
\title{\LARGE \bf ECON 425 Term Paper}

\begin{document}

 Next, I introduce the data I used for this study, the Standard and Poor's Execucomp, arguably the golden standard for CEO compensation data\footnote{Florin, Hallock, and Webber (2010) hold that ``ExecuComp (Executive
    Compensation data base) is produced by Standard and Poor's Corporation and is surely the
    most widely used source of data for research on executive pay by academics.''}, and The Center for Research in Securities Prices (CRSP) data sets.

\end{document}

Thanks in advance for the help!

A: You may think of the following options:

*

*Write fewer footnotes. Instead, place the material in the body of the text.

*Write only (really) short footnotes.

*If two preceding options aren't feasible, just get used to the idea that occasionally, longish footnotes will have to be broken across pages or (in the case of a two-column document) across columns. I honestly don't see what's supposed to be so "awkward". To improve the aesthetics, you may want to consider loading the footmisc package with the options bottom and splitrule. The splitrule option makes LaTeX draw a full-width rule on the page with the trailing footnote material.

\documentclass[twocolumn]{article}
\raggedbottom
\usepackage{geometry}
\usepackage{lipsum} % filler text
\usepackage[splitrule,bottom]{footmisc} % <-- new
\hyphenation{execu-comp}

\title{\LARGE \bf ECON 425 Term Paper}

\begin{document}
\maketitle
\lipsum[1-2]

 Next, I introduce the data I used for this study, the Standard and Poor's ExecuComp, arguably the gold standard for CEO compensation data,\footnote{Florin, Hallock, and Webber (2010) hold that ``ExecuComp (Executive
    Compensation data base) is produced by Standard and Poor's Corporation and is surely the
    most widely used source of data for research on executive pay by academics.''} and The Center for Research in Securities Prices (CRSP) data sets.

\lipsum[3-5]
\end{document}


text:
Q: Win7 command-line bat file OS is Win 7 Home 32bit on A Dell Inspiron 3541 laptop.
I am working on making the *.inf file for a CD that will do the following things:

*

*install Dosbox.exe emulator

*make the directory on the hard drive for the DOS game

*copy the dos game from the CD to the dir that was made made on the hard drive.

What I have gotten done so far is below
@echo off
echo WELCOME TO WOLF3D COPYER.
echo This BAT file will 1st install Dosbox.
echo Then make the directory and copy the game to the HD.
pause
{I forgot to add this line, I am still working on the synctext} start=dosbox.exe
mkdir C:\dgames\dgames\wolf3d
copy

I am stuck on the syntax for the copy cmd that tells the inf file to look in the CD-ROM drive regardless of the drive letter. I remember the cmd been something like $%drive letter%$ or something like that. It has been a while since I used it. And all my notes in txt files are gone when the D: hard drive in the external USB case crashed. Does anyone know what that cmd syncwince is?

A: This will work, but you have to do run as administrator on script, otherwise fsutils will not work even if you are admin.
set cdrom=None
for %%d in (a b c d e f g h i j k l m n o p r s t u v w x y z) do (
    fsutil fsinfo drivetype %%d:|find "CD-ROM">nul&&set cdrom=%%d:
      )
echo %cdrom%

additionaly with setx command you can create permanent system environment variable for later reuse

A: The file you've provided is a BAT (batch) file, not an INF (install information used by MSIEXEC) file.
In a batch file, if you want to refer to files on the same drive as the batch file, you can replace the drive letter with %~d0 - that is, if DBINST.EXE is on the same drive as SETUP.BAT, and SETUP.BAT wants to run DBINST.EXE, it could be called as %~d0DBINST.EXE. You can find more information on this type of expression on SS64's Batch Parameter page in the section "Parameter Extensions".

A: I finely figured out the correct syntax for the copy line. It now works 100%. [COPY "test file.doc" "C:\dgames\dgames"]. Bellow is the completed bat file.
@echo off
echo WELCOME TO WOLF3D COPYER.
echo This BAT file will make the directory and copy the game to the HD.
pause
mkdir C:\dgames\dgames
cd /d "%~dp0"
cls
echo Your %~d0 drive.
cd %~d0
dir
cd temp
COPY  "test file.doc" "C:\dgames\dgames"
pause


text:
Q: Binding Handsontable cells to complex objects I'm trying to use Handsontable for some basic editing and number formatting.
The data, including formatting info is fetched from the server and would look similar to this:
var data = [
    [ { num:'1.1', color:'red' }, { num:'2.2', color:'green' } ],
    [ { num:'3.4', color:'yellow' }, { num:'4.4', color:'blue' } ]
];

Now, I would like to pass this data to my Handsontable and have each cell display/edit the .num values. By using a custom renderer and editor (briefly explained here: Understanding cell functions), I have found a solution that handles manual editing - see this JSFiddle:
http://jsfiddle.net/7akqc87x/5/
However, there are two problems with this solution:

*

*Pasting values (e.g. from Excel) doesn't work as intended - the pasted values completely overwrite the bound objects instead of updating their .num properties.

*Numeric validation doesn't work - if I add type: 'numeric' to the cellProperties, the first edited cell won't exit "edit mode", and no more cells can be edited.

Am I on the right track here? If so, how can I fix these two problems? If not, is there an easier (built-in?) way of binding cells to custom objects?
(I am aware that you can bind an entire row to a custom object - Object data source - but I haven't found a solution for individual cells)

A: Custom Cell Rendering:
In your Hands On Table settings you can add the following to display the num and the color as the background color from your object:
renderer: function(instance, td, row, col, prop, value, cellProperties) {
  if(value){
    td.innerHTML = value.num;
    td.style.backgroundColor = value.color;
  }
  return td;
},

http://docs.handsontable.com/0.18.0/demo-custom-renderers.html
Sounds like you were able to setup a custom editor, if not you there are instructions here:
http://docs.handsontable.com/0.18.0/tutorial-cell-editor.html
I don't know about pasting from excel with this, at the very least the custom editor would need to take only a single argument.  Only one is going to come from excell anyway.  Perhaps with hooks would be a good method to investigate for that.  Also, probably would want to start by extending the default editor also explained in the above docs rather than a complete custom one.

Setting the type to numeric doesn't work as it expects a number not a custom object.  The 'types' predefine a set of renderer, editor and validator as the example they give in the documentation you found:
 {
  renderer: Handsontable.NumericRenderer,
  editor: Handsontable.editors.TextEditor,
  validator: Handsontable.NumericValidator
}

https://github.com/handsontable/handsontable/wiki/Understanding-cell-functions


text:
Q: Bonds in graph theory I have a quick conceptual question regarding bonds in graph theory. In any graph $G$ is it true that any any maximal star is a bond?
(Definition: A bond is a cut set which does not contain any other cut set.)

A: No. Consider a star. Then the edges incident to the center vertex do not form a bond since each of the edges in it are also cuts.

A: For a vertex $v$ in a graph $G$, let $\delta(v)$ be the set of all edges incident with $v$ (so a maximal star). Then:

$\delta(v)$ is a bond if and only if $v$ is not a cut-vertex.

Proof: Let $C_1,\ldots,C_k$ be the components of the subgraph induced by $V\setminus v$. This induces a partition of $\delta(v)$ into subsets $S_1,\ldots,S_k$ where $S_i$ consists of all edges from $v$ to the vertices in $C_i$. If $v$ is a cut vertex, then $k\geq 2$ and so we see that any $S_i$ is an edge cut strictly contained in $\delta(v)$, so $\delta(v)$ is not a bond.
On the other hand, if $v$ is not a cut vertex then $k=1$ and $S_1=\delta(v)$. For any $T\subsetneq \delta(v)$, the graph $G-T$ is connected. This is because $C_1$ is connected and as there are edges from $v$ to $C_1$ not in $T$ we have that $v$ is connected to $C_1$. Hence $\delta(v)$ is a bond.


text:
Q: Dynamic jQuery CSS Property? I am having problems doing the following:
var direction = "left";
$('#elem').css({"margin-"+direction: "50px"});

Is it not possible to have dynamic properties like this?
Thank you

A: .css(propertyname, value) has a another variation that can take the property name and value as 2 different arguments
var direction = "left";
$('#elem').css("margin-"+direction, "50px");

If you want to use object format then, you can use the bracket notation to assign dynamic properties
var css = {};
css["margin-"+direction] = "50px";
$('#elem').css(css);

A: Remove Curlybraces({,}) and colon (:) in your jquery code, and try the below code
var direction = "left";
$('#elem').css("margin-"+direction, "50px");

A: You can create JAVASCRIPT object and then you can apply that object in to CSS.
Sample code:
var style = {property1:"value1", property2:"value2", property3:"value3"};

Then you can use below syntax to apply above property.
$('#element').css(style);

By using above way you can add dynamic properties and that would be apply using jQuery.
Hope this helps.


text:
Q: Cannot update PHP 5.4.16 to PHP 7.3 I am using RedHat Linux 7.9. I am trying to upgrade PHP 5.4.16 to PHP 7.3 commands I find in blog posts and questions, don't work for me.
For instance:
[root@username src]# php --version
PHP 5.4.16 (cli) (built: Mar 31 2020 17:30:32)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
[root@username src]# wget -q http://rpms.remirepo.net/enterprise/remi-release-7.rpm
[root@username src]# wget -q https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
[root@username src]# rpm -i remi-release-7.rpm epel-release-latest-7.noarch.rpm
warning: remi-release-7.rpm: Header V4 DSA/SHA1 Signature, key ID 00f97f56: NOKEY
    package epel-release-7-14.noarch is already installed
    package remi-release-7.9-2.el7.remi.noarch is already installed
[root@username src]# yum-config-manager --enable remi-php72
Loaded plugins: langpacks
[root@username src]# yum install php
Loaded plugins: langpacks, ulninfo
Package php-5.4.16-48.el7.aarch64 already installed and latest version
Nothing to do
[root@username src]# yum update
Loaded plugins: langpacks, ulninfo
No packages marked for update
[root@username src]# php --version
PHP 5.4.16 (cli) (built: Mar 31 2020 17:30:32)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies

So, how I can update PHP to newer version?


text:
Q: Regex find function in different codestyles given this sample text:
function foo()
foo: function()
foo()

I need to match the first 2 row and avoid the last one.
Actually I'm using this (on\s)?foo(:\sf)? but this is matching foo on the last row.
Since I use this regex to find functions in my text editor, I don't care too much about the effective selection (the editor outputs the line number when the regex matches, which is what I need).
Suggestions?

A: You're using two ? quantifiers, this allows the match of foo alone.
You could write the regex differently using a 'or' :
((on\sfoo)|(foo:\sf))


text:
Q: why python assign list values by reference We know this in Python
a= [1, 2]
b= [a, a]
print b
[[1, 2], [1, 2]]
a.append(3)
print b
[[1, 2, 3], [1, 2, 3]]

This is because b have reference of same list a and appending anthing in a also changes b.
My question is -- What is the use or advantage of this behavior?
Why Python assign list values by reference??
If I am doing b =[a,a] obusely it means I am interested in values of a not in what happens to a later on.
We can achieve this as
b=[a[:], a[:]]
#or
b=[a,a]
a=[]

but Why this is not the default behavior in python? Why Python is designed like this!!

A: In Python, Everything is an Object.
Remember this rule & you won't get confused anywhere.
In the above example, we can say that
b=[a,a]

Object of b is now a list
[object of a,object of a ]

So any modification to a is reflected here.
One interesting example to prove this is we all know tuples are immutable,
Now;
a=[1,2]

b=(0,a)

a.append(3)

print b # (0,[1,2,3])

Amazing, how did the tuple get modified here. Answer is same as above..

A:
If I am doing b =[a,a] obusely it means I am interested in values of a not in what happens to a later on.

I don't see why that's obvious at all. A list is just a way of holding things. I might be interested in the values of the things, but just as likely I'm interested in the things themselves - I want to pass them to a function that mutates them, for example.

A: Python assigns everything by reference. The = operator simply binds the name on the left side to the object on the right side. This only becomes obvious to most people when mutable objects are used on the right side, and then mutated by calling instance methods like .append().

A: Basically, it's a language design choice. It simplifies the semantics of Python to say that Python has names not variables. This way, the semantics of = are very simple: the LHS is simply a new name to refer to the RHS.


text:
Q: How to do conditional logging on file with .ini extension? I want to keep program's logs on logs.log file.
I have logging.ini file that keeps the config of logging.
[logging]
logging=false

[loggers]
keys=root

[handlers]
keys=consoleHandler

[formatters]
keys=simpleFormatter

[logger_root]
level=DEBUG
handlers=consoleHandler

[handler_consoleHandler]
class=StreamHandler
level=DEBUG
formatter=simpleFormatter
args=(sys.stdout,)

[formatter_simpleFormatter]
format=%(asctime)s - %(levelname)s - %(message)s
datefmt=%m/%d/%Y %I:%M:%S %p

I want to change if logging=true ;
class = FileHandler
args=('logs.log',)

How can i do that ?
Thanks,


text:
Q: Custom WF4 Activity with OutArgument and Assign Activity I am trying to write a custom activity by composing standard Activities, one of which is an Assign activity which is responsible for assigning a string value to an OutArgument, called 'TextOut', which I have defined on my custom Activity. The idea is that the workflow author that uses this custom Activity defines a variable in the Workflow and maps this to the TextOut OutArgument of my custom Activity. I'd like to achieve this with an iterative approach, since I have a requirement to dynamically create pick branches at runtime. I have left out this code to simplify my question.
The code for the Activity is shown below. This is probably not how it should be done, since it doesn't work :) The workflow which uses this Activity throws a validation error: "Value for a required activity argument 'To' was not supplied".
I'd like to get some advice on how to get my OutArgument working with an Assign child activity (so without calling .Set on my OutArgument).
public sealed class OutArgActivity : Activity
{
    public OutArgument<string> TextOut { get; set; }

    public OutArgActivity()
    {
        Assign assign = new Assign {
            To = this.TextOut,
            Value = new InArgument<string>(
                env => "this is my custom return value")
        };

        Sequence sequence = new Sequence();
        sequence.Activities.Add(assign);

        this.Implementation = () => sequence;
    }
}

A: Try using a ArgumentReference in your Assign activity like this:
public sealed class OutArgActivity : Activity
{
    public OutArgument<string> TextOut { get; set; }

    public OutArgActivity()
    {
        Assign<string> assign = new Assign<string>
        {
            To = new ArgumentReference<string>("TextOut"),
            Value = new InArgument<string>(
                env => "this is my custom return value")
        };

        Sequence sequence = new Sequence();
        sequence.Activities.Add(assign);

        this.Implementation = () => sequence;
    }
}

A: If you don't want to use magic strings you can do it this way.
public sealed class OutArgActivity : Activity
{
    public OutArgument<string> TextOut { get; set; }

    public OutArgActivity()
    {
        Assign<string> assign = new Assign<string>
        {
            To = new OutArgument<string>(ctx => TextOut.Get(ctx)),
            Value = new InArgument<string>(
                env => "this is my custom return value")
        };

        Sequence sequence = new Sequence();
        sequence.Activities.Add(assign);

        this.Implementation = () => sequence;
    }
}

This seems counter intuitive, but since the argument to the constructor of OutArgument<> is an Expression it is possible to convert it to a location reference. And that is exactly what happens.


text:
Q: How would I create a save file for my to-do list? So I have a to-do list and I have setup a basic server with node. I have stored all the data in the back-end, how would I save it to a file and read it when the page is loaded?

A: To create a file with Node.js you can use this function:
fs.writeFile('message.txt', 'Hello', (err) => {
  if (err) throw err;
  console.log('The file has been saved!');
});

To read from the file you would use:
fs.readFile('/etc/passwd', (err, data) => {
  if (err) throw err;
  console.log(data);
});

There may be other ways to acomplish this but these are the most common. More details in the documentation: https://nodejs.org/api/fs.html


text:
Q: Phalcon: How to get parameter in url using routing I want to get the "q" parameter value for urls like this:
http://api.domain.com/artist?callback=jQuery1710976531726308167_1400000891029&q=thanh&_=1400000895743

How to do that using routing in Phalcon? I try this but not matching:
$app->get("/artist?callback={callback:(.*)}&q={q:(.*)}&_={_:(.*)}", function ($q) {
    //my logic code
}

or
$app->get("/artist?callback=jQuery1710976531726308167_1400000891029&q=thanh&_=1400000895743", function () {
    //my logic code
}

A: In Phalcon, you use the Phalcon\Http\Request Object to retrieve your query string params.  If you are trying to define routes for Phalcon's Micro Framework, your route should be defined like this:
$app->get("/artist", function () {
    $request = new Phalcon\Http\Request();
    $q = $request->get('q');
    echo $q;
});

You do not define the route with the query string arguments. Your route will match the above based on the part preceding the question mark in the url.  Also, the passing of arguments into the anonymous function handling the get request is for REST arguments in the URL pattern.  Such as:
$app->get("/artist/{name}", function ($name) {
    echo $name;
});

A: You can do it in two ways, something like this:
Way 1: Using Get parameters
$this->request->get('artist');

Way 2: Using Router
in router:
$router->add("/artist/id/([a-zA-Z0-9\_\-])", array( 'controller' => 'index', 'action' => 'artist', 'name' => 'abc' ));

in Controller:
$id = $this->dispatcher->getParam("name");

Hope this will work fine.


text:
Q: double integration gives error object y not found I am trying to do this integration

I am trying this code
integrand_inner <- function(x, a, b) {(a * x^2 + b * y *x)*y}

integrand_outer <- Vectorize(
  function(y, a, b){
    integrate(integrand_inner,
              (bo - b)*y/(a-ao),
              1,
              a=a,
              b=b)$value
  }
)

revenue <- function(a){
  b <- sqrt(1-a^2)

  return(integrate(integrand_outer, 0, 1, a = a, b=b))
}

But I get the error
Error in f(x, ...) : object 'y' not found

I cannot figure out what is wrong.

A: Needed to add y as an argument to the function and pass it on.
integrand_inner <- function(x,y, a, b) {(a * x^2 + b * y *x)*y}

integrand_outer <- Vectorize(
  function(y, a, b){
    integrate(integrand_inner,
              (bo - b)*y/(a-ao),
              1,
              a=a,
              b=b,
              y=y)$value
  }
)

revenue <- function(a){
  b <- sqrt(1-a^2)

  return(integrate(integrand_outer, 0, 1, a = a, b=b))
}


text:
Q: How to add other filters criteria to a jquery script I'm using this jquery script to filter data by periods in between dates. Now I need add one more fielter criteria to it but I don't know jquery. Truly I would prefer to do this by using a plain vanilla javascript as I understand it better.
The second fielter criteria would by the "POSITION" column.

function filterRowsRelatorioPorItemTable() {

  var from = $('#datefilterfromRelatorioPorItemTable').val();
  var to = $('#datefiltertoRelatorioPorItemTable').val();

  if (!from && !to) { // no value for from and to
    return;

  }

  from = from || '2020-01-01'; // default from to a old date if it is not set
  to = to || '2999-12-31';

  var dateFrom = moment(from);
  var dateTo = moment(to);

  $('#RelatorioPorItemTable tr').each(function(i, tr) {
    var val = $(tr).find("td:nth-child(6)").text();
    var dateVal = moment(val, "DD/MM/YYYY");
    var visible = (dateVal.isBetween(dateFrom, dateTo, null, [])) ? "" : "none" ; // [] for inclusive
    $(tr).css('display', visible);

// setTimeout(CalColumnHistVendas, 1000);

  });

}

$('#datefilterfromRelatorioPorItemTable').on("change", filterRowsRelatorioPorItemTable);
$('#datefiltertoRelatorioPorItemTable').on("change", filterRowsRelatorioPorItemTable);

            INICIAL
            <input type="date"  id="datefilterfromRelatorioPorItemTable" data-date-split-input="true">

            FINAL
          <input type="date"  id="datefiltertoRelatorioPorItemTable" data-date-split-input="true">
             Position
          <input type="text"  id="PositionfiltertoRelatorioPorItemTable" >

            Name
            email
            Position
            Phone
            Price
               date

            John Doe
            john.doe@gmail.com
             Manager
            0123456789
            99.80
            15/02/2020

            Jane Vanda
            jane@vanda.org
            Helper
            9876543210
            349.51
            19/02/2020

            Marth Johnson
            Marth@batman.com
            Free lance
            6754328901
            500.50
            18/02/2020

            Alferd Penyworth
            alfred@batman.com
            Helper
            6754328901
            199.00
            25/05/2020

            Segio Smith
            Segio@gmail.com
            Free lance
            6754328901
            300.00
            19/02/2020

Thank you in advance

A: You could just add plain JS to do position filtering regardless of your date Jquery filter..
EDIT:
On user remark in comment I edited this to position filter to only filter results from first date filter.
When doing filter by date also add a class none;
$(tr).css('display', visible);

changed to:
$(tr).css('display', visible).addClass(visible);

And now when selecting the tr tag for position search filter only tr tag that does not have none class:
tr = table.getElementsByTagName('tr');

Change to:
tr = table.querySelectorAll('tr:not(.none)');

Now position filter works only on first result set as well as if dates are not entered...
Example with console.log:

function filterRowsRelatorioPorItemTable() {

  var from = $('#datefilterfromRelatorioPorItemTable').val();
  var to = $('#datefiltertoRelatorioPorItemTable').val();

  if (!from && !to) { // no value for from and to
    return;

  }

  from = from || '2020-01-01'; // default from to a old date if it is not set
  to = to || '2999-12-31';

  var dateFrom = moment(from);
  var dateTo = moment(to);

  $('#RelatorioPorItemTable tr').each(function(i, tr) {
    var val = $(tr).find("td:nth-child(6)").text();
    var dateVal = moment(val, "DD/MM/YYYY");
    var visible = (dateVal.isBetween(dateFrom, dateTo, null, [])) ? "" : "none" ; // [] for inclusive
    $(tr).css('display', visible).addClass(visible);

// setTimeout(CalColumnHistVendas, 1000);

  });

}

$('#datefilterfromRelatorioPorItemTable').on("change", filterRowsRelatorioPorItemTable);
$('#datefiltertoRelatorioPorItemTable').on("change", filterRowsRelatorioPorItemTable);

function myFunction() {
  var input, filter, table, tr, td, i, txtValue;
  input = document.getElementById("PositionfiltertoRelatorioPorItemTable");
  filter = input.value.toUpperCase();
  table = document.getElementById("RelatorioPorItemTable");

  tr = table.querySelectorAll('tr:not(.none)');
  console.log(tr);

  for (i = 0; i
 -1) {
        tr[i].style.display = "";
      } else {
        tr[i].style.display = "none";
      }
    }
  }
}

            INICIAL
            <input type="date"  id="datefilterfromRelatorioPorItemTable" data-date-split-input="true">

            FINAL
          <input type="date"  id="datefiltertoRelatorioPorItemTable" data-date-split-input="true">
             Position
          <input type="text"  id="PositionfiltertoRelatorioPorItemTable" onkeyup="myFunction()">

            Name
            email
            Position
            Phone
            Price
               date

            John Doe
            john.doe@gmail.com
             Manager
            0123456789
            99.80
            15/02/2020

            Jane Vanda
            jane@vanda.org
            Helper
            9876543210
            349.51
            19/02/2020

            Marth Johnson
            Marth@batman.com
            Free lance
            6754328901
            500.50
            18/02/2020

            Alferd Penyworth
            alfred@batman.com
            Helper
            6754328901
            199.00
            25/05/2020

            Segio Smith
            Segio@gmail.com
            Free lance
            6754328901
            300.00
            19/02/2020

Example:

function filterRowsRelatorioPorItemTable() {

  var from = $('#datefilterfromRelatorioPorItemTable').val();
  var to = $('#datefiltertoRelatorioPorItemTable').val();

  if (!from && !to) { // no value for from and to
    return;

  }

  from = from || '2020-01-01'; // default from to a old date if it is not set
  to = to || '2999-12-31';

  var dateFrom = moment(from);
  var dateTo = moment(to);

  $('#RelatorioPorItemTable tr').each(function(i, tr) {
    var val = $(tr).find("td:nth-child(6)").text();
    var dateVal = moment(val, "DD/MM/YYYY");
    var visible = (dateVal.isBetween(dateFrom, dateTo, null, [])) ? "" : "none" ; // [] for inclusive
    $(tr).css('display', visible).addClass(visible);

// setTimeout(CalColumnHistVendas, 1000);

  });

}

$('#datefilterfromRelatorioPorItemTable').on("change", filterRowsRelatorioPorItemTable);
$('#datefiltertoRelatorioPorItemTable').on("change", filterRowsRelatorioPorItemTable);

function myFunction() {
  var input, filter, table, tr, td, i, txtValue;
  input = document.getElementById("PositionfiltertoRelatorioPorItemTable");
  filter = input.value.toUpperCase();
  table = document.getElementById("RelatorioPorItemTable");

  tr = table.querySelectorAll('tr:not(.none)');
  //console.log(tr);

  for (i = 0; i
 -1) {
        tr[i].style.display = "";
      } else {
        tr[i].style.display = "none";
      }
    }
  }
}

            INICIAL
            <input type="date"  id="datefilterfromRelatorioPorItemTable" data-date-split-input="true">

            FINAL
          <input type="date"  id="datefiltertoRelatorioPorItemTable" data-date-split-input="true">
             Position
          <input type="text"  id="PositionfiltertoRelatorioPorItemTable" onkeyup="myFunction()">

            Name
            email
            Position
            Phone
            Price
               date

            John Doe
            john.doe@gmail.com
             Manager
            0123456789
            99.80
            15/02/2020

            Jane Vanda
            jane@vanda.org
            Helper
            9876543210
            349.51
            19/02/2020

            Marth Johnson
            Marth@batman.com
            Free lance
            6754328901
            500.50
            18/02/2020

            Alferd Penyworth
            alfred@batman.com
            Helper
            6754328901
            199.00
            25/05/2020

            Segio Smith
            Segio@gmail.com
            Free lance
            6754328901
            300.00
            19/02/2020

How TO - Filter/Search Table


text:
Q: How to do an authentication with basic htttp pst and xcode? My propose is to do a login into a website to get my profile information
I have this code:
NSString *post = [NSString stringWithFormat:@"username=Mike&passwd=whatever"];
NSData *postData = [post dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES];

NSString *postLength = [NSString stringWithFormat:@"%d", [postData length]];

NSMutableURLRequest *request = [[[NSMutableURLRequest alloc] init] autorelease];
[request setURL:[NSURL URLWithString:@"http://www.myweb.com/profile"]];
[request setHTTPMethod:@"POST"];
[request setValue:postLength forHTTPHeaderField:@"Content-Length"];
[request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"];
[request setHTTPBody:postData];

NSURLResponse *response=nil;
NSData *data;
data= [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:NULL];

NSString *content1 = [[NSString alloc]  initWithBytes:[data bytes]
                                              length:[data length] encoding: NSASCIIStringEncoding];
NSLog(@"Page = %@", content1);`

Questions:

*

*What I get from data is the login
web over and over, what's wrong? the
login doesnt work!

*I have named the post variables username and passwd, because that's the name(tag) they             have in the html code. is that ok?
Thanks!

A: Are you sure it is HTTP shouldn't it be HTTPS?
With the given information it is very difficult to give you an answer. Maybe you clarify a little bit.
1) I assume with the "1-What i get from data is the login web over and over, what's wrong?" meant you get a web page. As a response on a post or get request you get back what the server will send you. The same as in a browser.
2) Yes.

A: I am trying to login to a joomla web: www.ambrosden.biz/administrator yes the response is right, if I try lo login with safari with wrong username/pass I get the login page over and over. BUt why it doesnt login???? Btw, in case is https, what changes i should make? Thanks
I am not allowed to post the log because it has hyperlinks, and I have taken screenshots, but aparently I am not allowed to upload images either.
This is the output deleting some links to avoid this restricton:
Page = <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

  ambrosden - Administration

    function setFocus() {
        document.login.username.select();
        document.login.username.focus();
    }

                ambrosden

Joomla! Administration Login

            <form action="index.php" method="post" name="login" id="form-login" style="clear: both;">

    Username
    <input name="username" id="modlgn_username" type="text" class="inputbox" size="15" />

    Password
    <input name="passwd" id="modlgn_passwd" type="password" class="inputbox" size="15" />

    Language
    <select name="lang" id="lang"  class="inputbox"><option value=""  selected="selected">Default</option><option value="en-GB" >English (United Kingdom)</option></select>

            Login

<input type="submit" style="border: 0; padding: 0; margin: 0; width: 0px; height: 0px;" value="Login" />
<input type="hidden" name="option" value="com_login" />
<input type="hidden" name="task" value="login" />
<input type="hidden" name="672372a5278b2ba6d345ec69f792c547" value="1" /></form>

Use a valid username and password to gain access to the Administrator Back-end.

                    Return to site Home Page

            Warning! JavaScript must be enabled for proper operation of the Administrator back-end.


text:
Q: How can I expand a terminal using the command line? When I start the terminal in my xfce Destop environment a black winodw about a quarter of the screen size appears, if I want to expand it to full screen size I have to click on the "+"-shaped symbol in its upper right corner. Is it possible to do the same without clicking onto it, just by using the command line ?

A: I assume you find the fact that the window starts so small annoying, and do not actually want to programatically change the window size.
The shortcut to maximize any window is alt+F5. If that is too inconvenient you can change it via the system settings, or just drag the window up against the top edge of the screen, after making sure you have that activated in settings -> window manager tweaks -> accessibility -> automatically tile windows when moving to screen edge
You can also change the default size of the terminal, which for xfce4-terminal is done by selecting
edit -> preferences -> "appearance" tab -> Default geometry

This will not maximize your window by default though, just set it to the given size, so you might prefer the above solutions.


text:
Q: POSTMAN gives following Error "The server refused this request because the request entity is in a format not supported by the requested resource" I know the meaning of the error but can't debug it.
My Bean class is :
public class User {

    private String name;
    private int age;
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public int getAge() {
        return age;
    }
    public void setAge(int age) {
        this.age = age;
    }

}

My Controller is:
@RequestMapping(value = "/user/create", method = RequestMethod.POST)
public ResponseEntity<Void> createUser(@RequestBody User user, UriComponentsBuilder ucBuilder) {
    System.out.println("Creating User " + user.getName());
    HttpHeaders headers = new HttpHeaders();
    headers.setLocation(ucBuilder.path("/user/{id}").buildAndExpand(user.getName()).toUri());
    return new ResponseEntity<Void>(headers, HttpStatus.CREATED);
}


text:
Q: jquery use of :last and val() I'm trying to run the code from http://jsfiddle.net/ddole/AC5mP/13/ on my machine and the approach I've use is below or here.
Do you know why that code doesn't work on my machine. Firebug doesn't help me and I can't solve the problem. I think that I need another pair of eyes :(((
In firebug,console tab i don't get any error message. The problem is that I can't get the value of that input from the dialog box, after I press save button. The $('input:last').val() seems to be empty
<!DOCTYPE html>

    <meta charset="utf-8">
    <title>jQuery UI Dialog - Modal form</title>
    <link type="text/css" href="css/ui-lightness/jquery-ui-1.8.21.custom.css" rel="stylesheet" />

    Button

        <input type="text" class="helpText" />

    Button 2

        <input type="text" class="helpText" />

    Button 3

        <input type="text" class="helpText" />

    Button 4

        <input type="text" class="helpText" />

    Button 5

        <input type="text" class="helpText" />

A: Refer LIVE DEMO
To display the text on save, I have modified your line alert($('.helpText:last').val()); to this alert($('.helpText', this).val());
I have added one more dependencies on fiddler,
http://code.jquery.com/ui/1.8.21/jquery-ui.min.js
Now its working as expected.
HTML:
Button

    <input type="text" class="helpText" />

Button 2

    <input type="text" class="helpText" />

Button 3

    <input type="text" class="helpText" />

Button 4

    <input type="text" class="helpText" />

Button 5

    <input type="text" class="helpText" />

JS:
jQuery(function($) {
  $('.helpDialog').hide();
  $('.helpButton').each(function() {
    $.data(this, 'dialog',
      $(this).next('.helpDialog').dialog({
        autoOpen: false,
        modal: true,
        width: 300,
        height: 250,
        buttons: {
            Save: function() {
                alert($('.helpText', this).val());
                $(this).dialog( "close" );
            },
            Cancel: function() {
                $(this).dialog( "close" );
            }
          }
      })
    );
  }).click(function() {
      $.data(this, 'dialog').dialog('open');
      return false;
  });
});


text:
Q: Find expression for p-value of significance test in terms of Φ(f(a)) when the value of a is unknown? What keeps me from solving this question is that the values that a can take are not given, hence we don't know where in the distribution of X it'll be located. It if were, let's say on the left side of µ, then I'd find P(X<a) and times that by two but since I don't know where it's located it might as well be on the right side and then P(X<a) would not give half of alpha...
The answer to this question is 2phi(-(15-a)/1.5)

A: $\alpha$ is not needed. They ask you to find the p-value, that is the area of the two tails of the gaussian
I suppose you know that $a\sim N(\mu;\frac{\sigma^2}{n})$ and thus your p-value is
$$\mathbb{P}[Z >\frac{|a-15|}{\sqrt{\frac{4.5^2}{9}}}]=\mathbb{P}\Bigg[Z >\frac{|a-15|}{1.5}\Bigg]$$
..and this is exaclty what  you solution states (it is just a matter of writing this probability in terms of $\Phi$ but I think you can do it by yourself)
After calculating it, if you  p-value is lower than the fixed $\alpha$ you will reject your null hypothesis, if it will be higher you will not reject it.


text:
Q: Way to use ControlSend to send text in AutoHotKeys I'm simply making a script to automatically update my GitHub repo through the command prompt in Windows.
The first line of code after the command prompt is open won't send, unfortunately. I believe it is because the string includes commas, but I can't find the right syntax for making "pushd D:\Media Lists\Website, Blog, and Wordpress_thefloodplains\thefloodshark.Github.io" send as a string before inputting {Enter} like in the below code:
run cmd.exe
WinWait, ahk_exe cmd.exe ;

ControlSend, , pushd D:\Media Lists\Website, Blog, and Wordpress\_thefloodplains\thefloodshark.Github.io{Enter}, ahk_exe cmd.exe
sleep, 2000
ControlSend, , git add .{Enter}, ahk_exe cmd.exe
sleep, 2000
ControlSend, , git commit -m auto{Enter}, ahk_exe cmd.exe
sleep, 2000
ControlSend, , git push{Enter}, ahk_exe cmd.exe
sleep, 3000

Exit

As it stands, the script runs, but it won't input that first line with my GitHub repo location. The rest of the ControlSend inputs work, though.
Any and all ideas would be deeply appreciated.

A: The problem is indeed about your path having commas and you not escaping them (`,).
You can read about escaping in AHK here.
But really, this is just a problem when specifying legacy strings.
Instead, what I'd say you really want to do is to just use the expression syntax and specify the string explicitly, like so:
ControlSend, , % "pushd D:\Media Lists\Website, Blog, and Wordpress\_thefloodplains\thefloodshark.Github.io{Enter}", % "ahk_exe cmd.exe"
sleep, 2000
ControlSend, , % "git add .{Enter}", % "ahk_exe cmd.exe"
sleep, 2000
ControlSend, , % "git commit -m auto{Enter}", % "ahk_exe cmd.exe"
sleep, 2000
ControlSend, , % "git push{Enter}", % "ahk_exe cmd.exe"
sleep, 3000

And now on a more unrelated note, this implementation is really bad/low tech.
Really you'd just want to create an actual script for your command line and run that script. Since you seem to be using cmd, you could create a simple batch script like:
pushd D:\Media Lists\Website, Blog, and Wordpress\_thefloodplains\thefloodshark.Github.io
git add .
git commit -m auto
git push

And then run it with AHK by using e.g. Run(docs):
Run, % "C:\Users\User\Desktop\my cool scripts\script.bat", % "C:\Users\User\Desktop\my cool project folder"


text:
Q: Symfony -Return json output of Command Class from Controller In my Symfony project I have created a Command class to delete specific user.
I injected required parameter "email" in the Command class constructor.
I have never tried to implement command in the Controller so I have problem there.
I want to trigger the API call in the Controller which will return desired json output if command is successful.
How can I accomplish that?
My Command class:
protected static $defaultName = 'user:delete';

$entityManager;
private $userService;
private $email;

public function __construct(string $email = null, EntityManagerInterface $entityManager, KeycloakApi $keycloakApi)
{
    parent::__construct($email);

    $this->entityManager = $entityManager;
    $this->userService = $userService;
}

protected function configure()
{
    $this
        ->setDescription('Deletion of selected user.')
        ->addArgument('email', InputArgument::REQUIRED, 'User email');
}

protected function execute(InputInterface $input, OutputInterface $output)
{
    $user = $this->userService->getUserByEmail($this->email);
    if (empty($user)) {
        throw new Exception('USER_DOESNT_EXIST');
    }

    $this->userService->deleteUser($user['id']);
    $output->writeln('Done!');
}

And my try in controller to get what I want:
/**
 * @Route("/delete/test", name="delete_test")
 */
public function testDelete(): JsonResponse
{

    $application = new Application($this->kernel);
    $application->setAutoExit(false);

    $input = new ArrayInput(array("user:delete"));
    $output = new BufferedOutput();
    // Run the command
    $retval = $application->run($input, $output);

    dump($retval);die;
}

And the main question is how to pass email parameter in command that is needed to be provided for this endpoint?

A: As the comments said, you shouldn't call a command from a controller, both are a different entry point of your application. Controller are used to access from the web and Command to be executed from a cli.
You should put your domain logic in neither of those files.
Here's an example which is possible :
Controller :
/**
 * @Route("/delete/{email}", name="delete")
 */
public function delete(string $email, DeleteUserHandler $handler): JsonResponse
{
    $handler->handle($email);

    return new JsonReponse(null, 204);
}

DeleteUserHandler :
...
public function handle(string $email): void
{
    $user = $this->userService->getUserByEmail($this->email);
    if (empty($user)) {
        throw new Exception('USER_DOESNT_EXIST');
    }

    $this->userService->deleteUser($user['id']);
}

I kept a bit of you code but IMO you don't even need to find before the delete (just maybe add a security to avoid anyone to delete anyone)
With this kind of code you can reuse the "DeleteUserHandler" in a command (or wherever) if you need it and the code which really delete a user isn't coupled with the entry point anymore


text:
Q: Set client source port to listening port with C sockets Currently, I'm following Beej's Guide to Network Programming to create a stream server and client, both in the same application. Basically, it's a server that also makes connection requests (client). I'm using the codes from client.c and server.c from these examples.
What I'm looking to do is to set the client source port to be same as the server listening port if that is even possible. In other words, listen on port 8888, and make outbound connections with connect() using the same 8888 port. Currently, the default is that connections use different random ports each time.

*

*Is is possible to listen and make connections using the same port and how could it be done.

*I read that using random ports each time is the common practice but it can run out of ports or use a blocked port. How true is this?

How do I go around this if I would like to set a fixed port for all connections?

A: It's possible to set the source port for a client socket by calling bind on the socket in question.   This is a problem however if you already have a server socket bound to that port.
The exact port number used for a TCP client socket is typically unimportant.  Unless you have a very specific requirement, it is better to let the OS choose an available port.


text:
Q: Reverse substring for double extension files How can i add reverse substring for "test.csv.txt" this type of files using javascript?

A: Billy's comment summed up your question quite nicely if I'm honest, but I'll have a go.
By reverse substring, do you mean starting from the start, up to your index?
str.substr(0, length);

Maybe you want to remove it from the last .?
var str = "test.csv.txt";
str.substr(0, str.lastIndexOf('.')); // "test.csv"

"for this type of files"? Perhaps you only want to do this when there are two .s?
if(str.split(/\./g).length > 2) //only executes if there are 2 or more dots
  str.substr(0, str.lastIndexOf('.'));


text:
Q: Install qgis-server-font-loader Plugin on QGIS 3.4.8 (Windows Server 2016) I'm trying to install this plugin: https://github.com/avinet/qgis-server-font-loader.
First I copied the Zip-folder in C:\OSGeo4W64\apps\qgis-ltr\plugins
then I opened QGIS and installed the plugin from Zip.
This is the Error:
Konnte Erweiterung 'qgis-server-font-loader-master' nicht laden aufgrund eines Fehlers beim Aufruf der classFactory() Methode

AttributeError: module 'qgis-server-font-loader-master' has no attribute 'classFactory'
Traceback (most recent call last):
  File "C:/OSGEO4~1/apps/qgis-ltr/./python\qgis\utils.py", line 335, in startPlugin
    plugins[packageName] = package.classFactory(iface)
AttributeError: module 'qgis-server-font-loader-master' has no attribute 'classFactory'

Python-Version: 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)]
QGIS-Version: 3.4.8-Madeira Madeira, 04ee8e0761

What am I doing wrong?

A: Not sure what you want to achieve. If it's using custom fonts within QGIS Desktop, there is no need for a plugin. Add fonts to your system and use them within QGIS (just need to reopen QGIS if you did not stop it before loading the new fonts). If it's for loading custom fonts in QGIS Server, the plugin is a good help.
Your issue is that you try to load a QGIS server plugin within QGIS Desktop. The error message is

AttributeError: module 'qgis-server-font-loader-master' has no attribute 'classFactory'

Within a QGIS server plugin, the entry point is serverClassFactory e.g https://github.com/avinet/qgis-server-font-loader/blob/master/__init__.py#L3
versus
a "classic" plugin where the entry point for QGIS Desktop is classFactory e.g https://github.com/g-sherman/Qgis-Plugin-Builder/blob/master/__init__.py#L28
That's why QGIS send an error message as it does not found an entry classFactory
"Running QGIS Server is not running QGIS Desktop on a server but running a QGIS component for Server". See the official guide about QGIS Server https://docs.qgis.org/3.16/en/docs/server_manual/index.html


text:
Q: HTML input time - open a clock on android I have a android app that displays webpages using webviews. And I have a HTML input of type [time].
Currently touching it opens the old style time selector. How can I force it to open the new Clock style selector for android devices?
Thanks

A: Solution:
I just created a javascript interface to call Android function that opens Timepicker and returns the time. Then callback the js function in the HTML page with the time and elementID to populate.

A: This would do the tick
<input type="time">

I tested it on google chrome on android. Here is the current browser support:
https://caniuse.com/#search=type%3D%22time%22


text:
Q: Failure on build with Gradle on command line with an android studio project : Xlint error When I try to build an android project with gradle with this command :
> gradlew clean build assembleRelease

It gives me this error :
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

I can build this project and make the APK in Studio.
Is there a way to configure Gradle to make a compilation ignoring Xlint notifications ?
OR, can I use other parameters, to make the release from command-line with gradle/gradlew ?

A: It's a nice warning, not an error. To see the complete lint report you can add these lines to build.gradle:
allprojects {
    tasks.withType(JavaCompile) {
        options.compilerArgs << "-Xlint:deprecation"
    }
}

If you really want to get rid of those warnings:

*

*Don't use deprecated API

*Use @SuppressWarnings("deprecation")

A: This is fairly obvious from @shakalaca's answer, but if you have code old enough to get the deprecation warning, you may also have code old enough to use unchecked operations, e.g. a List without the parameterized type as in List<String>. This will get you an additional warning:
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

You can just expand the compiler args block to include that as well:
allprojects {
    tasks.withType(JavaCompile) {
        options.compilerArgs << "-Xlint:deprecation" << "-Xlint:unchecked"
    }
}


text:
Q: Getting Value from NSMutableArray i am developing ios app and working on google map. draw lines on google map and coordinates add on mutableArray and those coordinate save on NSUSERDEFAULT data save perfectly.but when getting the data on nsuserdefault and show coordinate on google maps.but in GMSMutablePath app crash error msg is exc_bad_access (code=1,address=0*4).please help thanks in advance.
for (int i = 0; i < [coordinateArray count]; i++) {
        NSDictionary *dic = [coordinateArray objectAtIndex:i];
        NSString *lat = [dic valueForKey:@"lat"];
        NSString *longitude = [dic valueForKey:@"long"];
        _valuePoints.latitude = [lat doubleValue];
        _valuePoints.longitude = [longitude doubleValue];
        GMSMutablePath *path = [[GMSMutablePath alloc]              initWithPath:self.polyline.path];
        [path addCoordinate:_valuePoints];
        self.polyline.path = path;
    }

A: Save the coordinate to the array directly,
[_arr addObject:coordinate];
NSLog(@"%@",_arr);
NSUserDefaults *defaults=[NSUserDefaults standardUserDefaults];

Instead of saving the value as a string, save the array itself
[defaults setObject:_arr forKey:@"numberArray"];
[defaults synchronize];

When reading data back from NSUserDefaults,
NSArray *coordinateArray = [ud objectForKey:@"numberArray"];

From coordinateArray you can loop through the objects to get the CLLocation objects using the latitude and longitude of the saved coordinate.


text:
Q: Render JS charts in pdf using WKHTMLTOPDF Tool I'm using WKHTMLTOPDF for printing the HTML pages.Every thing is working fine but the JS charts are not rendering. I have tried to render the chart

http://www.amcharts.com/tips/plotting-a-bell-curve-chart/

but the page is coming blank in pdf.
What i Have tried :
I have tried the below command for rendering the HTML:

wkhtmltopdf http://example.com/bell.php --javascript-delay 2000
  bell.pdf

In which the argument --javascript-delay 2000 is used to display the JS charts and give time to HTML page to render the all required JS.
My Question :-

Is it possible to render the JS charts in PDF using WKHTMLTOPDF ? If
  yes than where i'm going wrong ?
Chart Code is :

A: I know this is late, but i just solved this issue, you need to set a specified width for your #chartdiv, try out this new style tag :


text:
Q: How to prevent duplicate user assignment to various record of same custom object I am having one custom object name as club with custom lookup field with contact object.
Let us assume we have 3 records in my club object(club1,club2 and club3).
When I assigned one member to club1 record , I shouldn't assign the same member to another record either in club2 or club3.
If I try to assign the same member to other club records I should be stopped with an error message.
How this can be achieved.
Thanks in advance

A: As a Lookup can not be unique, you will have to create a new text field(e.g:ContactId__c) and make it Unique, that's very important. Then by workflow, you can populate this text field from your custom lookup.
So now that means when you create a new member for the same contact, you will get the following error :
"Duplicate value on record: 'Record_Name' (Related field: ContactId)"


text:
Q: How to use Autofac in seperate areas in mvc3? I am now working on source code regarding ecommerce. In this source code , brnmall.web is the web project, its admin platform is in library brnmall.web.storeadmin which is  registered in web project as area.
below is the brnmall.web:

below is the brnmall.web.storeadmin, registered as area in brnmall.web:

I want to use autofac in brnmall.web.storeadmin, so I add another global.asax in it, in the application_start method, I register all the controllers and components that I need.
but when I use the code below to trigger data
   public ActionResult Index()
    {
        var serviceTypeRepo = unitOfWork.Repository<BrnMall.DAL.Access.cha_servicetype>();
        var result = serviceTypeRepo.Get(x => x.serviceid == 1);
        ViewBag.result = result;
        return View();
    }

exception throw to me: "An error occurred when trying to create a controller of type 'BrnMall.Web.Charging.Controllers.HomeController'. Make sure that the controller has a parameterless public constructor."
Anyone have the same scenario?

A: Is BrnMall.Web.StoreAdmin a seperate Web Application Project or an assembly project that is referenced by BrnMall.Web?
If StoreAdmin is just an Assembly referenced by BrnMall.Web and not a runnable Web Application on its own, then I believe you can remove the Seperate registrations and the global.asax in the StoreAdmin project, but I would replace these registrations with an AutofacModule registration class like below which will then register all your Controllers in that Assembly.
Then to wire it all up, you just need to have BrnMall.Web Autofac registration register your new module which will register Controllers in that assembly and any other components you decide to register there.
eg.
In your BrnMall.Web project....
public class Global : HttpApplication
{
    private void Application_Start(object sender, EventArgs e)
    {
        var builder = new ContainerBuilder();
        builder.RegisterControllers(Assembly.GetExecutingAssembly()); //Register controllers in the Executing Assembly
        builder.RegisterModule<BrnMall.Web.StoreAdmin.AutofacModule>(); //Register the registrations in the StoreAdmin Autofac Module below.
        //Register any other components

        var container = builder.Build();
        DependencyResolver.SetResolver(new AutofacDependencyResolver(container));
    }
}

And in your BrnMall.Web.StoreAdmin ...
using Autofac;

public class AutofacModule : Module
{
    protected override void Load(ContainerBuilder builder)
    {
        builder.RegisterControllers(ThisAssembly); //This will register any Controllers that are in this assembly
        //Register any other components that relate to this particular Project
    }
}

The benefit to registering Autofac Modules and referencing them is that you can specify in each project the registrations that belong to just that assembly which keeps the code a lot neater and all your registrations a lot neater.
I hope this helps?


text:
Q: wordpress array values containing variable im trying to get data from specific category
 $kategori1= get_option('woo_kategori');

which the value is "clothes"
and i wanna put in array
$args = array( 'post_type' => 'product', 'posts_per_page' => 3, 'product_cat' => $kategori11, 'orderby' => 'date' );

which is empty output.
'product_cat' => $kategori11,

im new here, and how to fill the product_cat value to my variable?

A: get_option is not going to work here. get_option only retrieves the values for a defined set of valid WordPress options. The list valid WordPress options can be found here: https://codex.wordpress.org/Option_Reference. If you could explain what you are trying to accomplish in more detail, I may be able to help.


text:
Q: How to display nested objects in a GridPanel in ExtJS (and Sencha architect)? I've got an incoming array of Offering objects that looks like this:
[{
  "id" : 16,
  "price" : 500,
  "quantity" : 2000,
  "denomination" : "case",
  "denominationPlural" : "cases",
  "product" : {
    "id" : 14,
    "description" : "This is the text description for product 14."
  }
}, {
  "id" : 18,
  "price" : 500,
  "quantity" : 1,
  "denomination" : "study",
  "denominationPlural" : "studies",
  "product" : {
    "id" : 17,
    "description" : "This is a text description for product 17."
  }
}]

An Offering is a Product times a quantity for a price.
Now I want to display these Offerings in a GridPanel, but also include the nested product information in those rows. Here's how I was doing it before:
Ext.define('Offering', {
            extend: 'Ext.data.Model',
            fields: [
                {name: 'id', type: 'number'},
                {name: 'price', type: 'number'},
                {name: 'quantity', type: 'number'},
                {name: 'denomination', type: 'string'},
                {name: 'denominationPlural', type: 'string'},
                {name: 'product.description', type: 'string'},
            ]
        });

var offeringStore = Ext.create('Ext.data.Store', {
             autoDestroy: true,
             model: 'Offering',
             proxy: {
                 type: 'ajax',
                 url: '/offerings',
                 reader: {
                     type: 'json',
                     root: 'success'
                 }
             },
             autoLoad:true
         });

var offeringGrid = Ext.create('Ext.grid.Panel', {
            store: offeringStore,
            columns: [{
                    header: 'id',
                    dataIndex: 'id'
                }, {
                    header: 'price',
                    dataIndex: 'price'
                }, {
                    header: 'quantity',
                    dataIndex: 'quantity'
                }, {
                    header: 'denomination',
                    dataIndex: 'denomination'
                }, {
                    header: 'description',
                    dataIndex: 'product.description'
                },
            };

And this worked just fine. Then, somewhere along the way (which included an upgrade to ExtJS 5.1.1 (from ExtJS 4.2.1) and use of Sencha Architect, it broke.
Problem 1: Sencha Architect prevents creating an entry for "product.description" in the Offering Model, complaining about the "." character. But if you create it as "whateveryouwant", you can go into the model field and rename it to "product.description" there.
Problem 2: after working around the "." issue and running the application, the "product.description" column's cells are blank.
Problem 3: the javascript console produces zero errors. The incoming data looks fine.
How should I go about getting this nested data to show up?

A: The way I do it is quite simple. Just add the mapping attribute to the model this way:
{
    name: 'product.description',
    type: 'string',
    mapping : 'product.description'
}

No need for renderer.

A: My current workaround, which may help others in the same situation, uses a "renderer" clause to display the information desired.
{
    xtype: 'gridpanel',
    title: 'Offerings',
    bind: {
        store: '{OfferingsStore}'
    },
    columns: [
            ...
            {
                xtype: 'gridcolumn',
                renderer: function(value, metaData, record, rowIndex, colIndex, store, view) {
                    return record.getData().product.description;
                },
                text: 'Product Description'
            },
            ...
      ]

But I'd still like an answer about using "product.description" in the Offering Model definition rather than this rendering trick.


text:
Q: Error when running R script When I run my R script, it gives me an error:
Error in list.files(lib, pattern = paste0("^", pkg, "$"), full.names = TRUE) :
  invalid 'pattern' regular expression

What does this error mean?
the link to the script is: http://mzmatch.sourceforge.net/metabolomics/Processing_Code.R
But I changed few lines at the beginning:
library ("D:\\java projects\\RScriptRunning\\R\\win-library\\2.15\\mzmatch.R")
mzmatch.init (6000)
setwd ("D:\\R_Script\\raw")

A: Completely rewrote my answer, as the first version missed the relevant point.
When you read an error message like this, a call to traceback() will tell you where the error occurred. In this case it will most likely identify the find.package function, which somehow got called from the library function. It constructs a path name from a package name, and does not escape the package name. So symbols which have a special meaning in regular expressions (likely the backslash) will render this regular expression invalid, thus the error message.
The reason is that you attempt to load a library using the full path name of one of its files. Libraries are loaded by package name only (most likely library(mzmatch) in your case). You can use source("C:\\some\\path") to load and execute R source code from a given path, but I'd not suggest doing so for an installed library.


text:
Q: Could Hawking radiation have a lot of neutrinos and dark matter? Up till now I have thought that Hawking radiation would be mostly photons, since the temperatures are typically small. However, a comment on another question (thanks to John Doty) suggested that we should also consider other species of low rest mass. So my question is: could Hawking radiation have a large contingent of neutrinos? And could there be any other species of low mass?
As I understand it, the $Z$ mass measurement rules out further generations of neutrinos in the standard model, but presumably not further particles which don't interact with $Z$. Again, as I understand it, dark matter is thought to be largely 'cold', which suggests that if it is particles then they have high not low mass. But could there be a significant contingent of low mass particles?
We don't need to consider neutrinos in thermal radiation from ordinary matter, because their interactions are so weak, so they are not produced in anything like the same quantities as photons. But gravity being universal, I wonder whether Hawking neutrino radiation might have similar power to Hawking electromagnetic radiation, at least for small black holes whose temperature is above a few thousand kelvin, if we take neutrino mass as $0.1$ eV. That would be interesting, but perhaps it is ruled out by some argument coming from electroweak theory?

A: Yes.
Hawking radiation is universal: the black hole is a modification of spacetime geometry, and the quantum fields, which manifest particles, are residents of that spacetime. Thus they are all affected by its presence (i.e. it "couples to" all those fields), and hence any and every physically possible particle can appear in the Hawking radiation from the black hole, at least supposing that all existent particles follow the laws of quantum field theory.
That said, that doesn't mean they are all emitted equally easily: for sufficiently massive particles, a suitably-hot black hole is needed or else the emission of the particle species in question is at the very least extraordinarily unlikely. This means that the black hole must be suitably small in mass, because the radiation temperature is inversely related to the black hole mass, and hence very massive particles will only be produced in the very last stages of the black hole's decay.
Hence, indeed dark matter will be emitted, but just when will depend on how massive dark matter particles are, or aren't, which is something we don't know yet as we haven't indisputably seen one. That said, the lightest (still unconfirmed) dark matter candidate is the axion, with projected masses of 10-1000 μeV. However, any present-day black hole we know of is so massive and thus "cold", that even this very light mass is still well above the typical particle energy available to it. All other proposed candidates are much heavier; and so the result is dark matter will with near-certainty not be emitted in significant quantities until the very late stages of the black hole's evolution (And neutrinos, by the way, are even heavier than axions, around $10^5$ μeV).

A: Yes. From this paper (Hooper, Krnjaic, McDermott: Dark Radiation and Superheavy Dark Matter from Black Hole Domination):

Unlike  most  other  mechanisms  for  particle  production,  the  process  of  Hawking  evaporation  generates  particles democratically,  producing  all  particle  species  regardless  of  their  assigned  charges  or  couplings.   If  there  exist  any stable particles without significant couplings to the Standard Model (SM), they would be produced through Hawking evaporation  without  subsequently  thermalizing,  but  still  contributing  to  the  universe's  total  energy  density.   This makes the evaporation of primordial black holes a particularly attractive mechanism for the production of both dark radiation and dark matter [77, 80


text:
Q: High school experiments recommendations I am from India and you know teachers don't show the experiments and they only give the theory but I want to see experiments video at least so I'm satisfied that physics is correct , can you tell me some websites / channels which show high school experiments .

A: Well I think as you are asking for High school course, I believe that you should prefer YT videos by Walter Lewin here.
He was a professor at MIT and has an unique way of teaching the subject with the demonstrations wherever it is required. The videos cover Newtonian Mechanics, Electromagnetism, Vibrations and Waves,Bohr's model and a brief Introduction to Quantum Mechanics. Along with this he has quiz questions as well and he demonstrates them in his own way.

A: I advise you to do some basic experiments on your own. Like when I was a High school student, I really did some easy experiments that teach me a lot! It's true you can not do those experiment which needs expensive apparatus but still, you can do a basic experiment and learn a lot.

My favorite is A Simple Pendulum! We all know the physics behind the time period,
$$T=2\pi \sqrt\frac{l}{g}$$
Now it's time to test it! Try making your own pendulum, Measure the length of the string and take your stopwatch and record the time for several periods and see if You can figure out $g$.

I bought a multimeter so that I can do experiment with electromagnetics origin. Most of them were based on Faraday's law. Like producing the current in the coil by moving the magnet. And many others and it's fun!
I remember I take a small motor which is got from some electronic instrument, take a mobile charger lead make connected it. I take a fan sort of thing which I have fitted to the moving part of the motor, then put the fan facing the a cooler. I take the reading from the multimeter for How much the voltage motor is creating and found it was around  5 to 6 Volt and then I connected my mobile, and It starts charging. Note that It was a button mobile, not an android they take much more power.
There many things you can try!

On resources
You need to be specific here. I think googling the experiment if it's famous will give you hundreds of sites and videos that you can see. But You can watch a free course like the one given by NPTEL. Look for the course on Experimental physics like this one.


text:
Q: EF4: updating a disconnected entity and inserting a related entity I would like to achieve the following:
A service is called with a DTO as parameter. I would like to know the simplest way to save the changes if that DTO consists in an existing entity with a modification (Parent with an update) and a related entity which is new (child with an insert).
Thanks in advance


text:
Q: Common Lisp Programmatic Keyword Is there a function in Common Lisp that takes a string as an argument and returns a keyword?
Example: (keyword "foo") -> :foo

A: The answers given while being roughly correct do not produce a correct solution to the question's example.
Consider:
CL-USER(4): (intern "foo" :keyword)

:|foo|
NIL
CL-USER(5): (eq * :foo)

NIL

Usually you want to apply STRING-UPCASE to the string before interning it, thus:
(defun make-keyword (name) (values (intern (string-upcase name) "KEYWORD")))

A: Here's a make-keyword function which packages up keyword creation process (interning of a name into the KEYWORD package). :-)
(defun make-keyword (name) (values (intern name "KEYWORD")))

A: There is a make-keyword function in the Alexandria library, although it does preserve case so to get exactly what you want you'll have to upcase the string first.

A: In case, you can change the string to start with colon sign :
use read-from-string directly.
Here is another version of make-keyword:
(defun make-keyword (name)
           (read-from-string (concatenate 'string ":" name)))

A: In this example it also deals with strings with spaces (replacing them by dots):
(defun make-keyword (name) (values (intern (substitute #\. #\space (string-upcase name)) :keyword)))

A: (intern "foo" "KEYWORD") -> :foo

See the Strings section of the Common Lisp Cookbook for other string/symbol conversions and a detailed discussion of symbols and packages.


text:
Q: Highcharts chart.events.redraw doesn't work for chart.xAxis[0].update I need to change the xaxis step when the chart was redrawed, e.g. when it was zoomed in. I tried the javascript function for like this:
chart: {
  zoomType: 'xy',
  events: {
    redraw: function(){
     var chart = $("#container").highcharts();
      chart.xAxis[0].update({
        lables: {
          step: 2
        }
      })
   }
  }
}

But, it doesn't work. Is that a buy? Any help will be appreciated!

A: It's not possible because will create infinite loop - update options and redraw them in redraw callback. Instead I advice to use afterSetExtremes and call update without redraw: .update( options, false)


text:
Q: Is ssl CName important for search engine? My site is under cloudflare and of course I am using free ssl from their side.
So, what what can I have sanctions on the site from the search engines while using free ssl?
Or what benefits will I have after dedicated ssl?

A: From a technical perspective some reasons  to use the non-free options:

*

*You may need to support truly ancient SSL/TLS implementations that still require that your domain is in the Common Name of the certificate and which won't support the Subject Alternative Name SSL/TLS extension that allows multiple domain names in a single certificate.

*You might have sites such as store.uk.example.com that aren't matched with a wildcard *.example.com
Otherwise as far as I know what counts is that your site uses correctly configured TLS, not the price of certificate.

A: If you want dedicated SSL/TLS certificates, use Let's Encrypt. Don't waste money on those certificates from Cloudflare or anyone else.
Unless you're a large corporation I don't think there are any benefits to paying for SSL/TLS certificates.


text:
Q: Solving a linear ODE of second order by reducing the order
Solve the equation $ty''-y'+4t^3y=0, t>0$ given that $\sin(t^2)$ is a solution.

(I am aware that this has been asked before but the answers did not help me).
My attempt: I want to use reduction of order, so I assume the second solution is of the form $y_2(t)=u(t)\sin(t^2)$. So:
$$y'=u'(t)\sin(t^{2})+2tu(t)\cos(t^{2})$$
$$y''=2t\cos(t^{2})u'(t)+u''(t)\sin(t^{2})+2t(u'(t)\cos(t^{2})-2t\sin(t^{2})u(t))+2u'(t)\cos(t^{2})$$
Plugging into the equation and rearranging, we get the following equation:
$$u''(t)(t\sin(t^{2}))+u'(t)(4t^{2}\cos(t^{2})-\sin(t^{2}))=0$$  And by a change of variable $v=u'$, we then have the following seperable equation:
$$\frac{v'(t)}{v(t)}=(\frac{1}{t}-4t\frac{\cos(t^2)}{\sin(t^{2})})$$
Integrating both sides and taking exponenets, we have:
$$v(t)=-2t\sin(t^2)$$
And therefore:
$$u(t)=\cos(t^2)$$
So the solution is $y_2(t)=\cos(t^2)\sin(t^2)$. However this is incorrect, and $y_2(t)$ should be just equal to $\cos
(t^2)$ (or some linear combination of $\sin(t^2)$ and $\cos(t^2)$.
What am I missing here? Any help would be appreactied.

A: You have some typos/transcription errors in the derivatives, that however have no follow-on effects.
The integration of the equation for $v$ results in
$$
\ln|v|=c+\ln|t|-2\ln|\sin(t^2)|.
$$
A particular solution for $v$ can be selected so that
$$
u'=v=\frac{-2t}{\sin^2(t^2)} \implies u=\frac{\cos(t^2)}{\sin(t^2)}.
$$


text:
Q: How to use jq when the variable has reserved characters? I'm trying to get the following to work and it's not, help me please:
curl -s 'https://cryptofresh.com/api/asset/markets?asset=MKR' | jq .OPEN.BTC

The variable in question includes a period, I tried just about everything to escape the period && also tried surrounding it in quotes; no go ; this is the variable I'm looking to pull from (I ran jq without any filters, and truncated the output here to show what I need. Thanks in advance future problem solver!
curl -s 'https://cryptofresh.com/api/asset/markets?asset=MKR' | jq
....
 "OPEN.BTC": {
"volume24": 0.932166,
"price": 0.09995,
"updated": "2016-05-04T03:03:29.000Z"
},
....

A: When a key contains characters that are invalid for identifiers, you'll have to quote the name.
."OPEN.BTC"

Or for older versions of jq, use an index.
.["OPEN.BTC"]

Example
... | jq '."OPEN.BTC"'

A: Another answer didn't work for me but the comment written by @jeff-mercado worked for me. So, adding it as an answer here.
If your key has dots like "OPEN.BTC" then your jq command should be
curl -s 'https://cryptofresh.com/api/asset/markets?asset=MKR' | jq '."OPEN.BTC"'

Put the key first in double quotes and then escape the first dot by wrapping it using single quotes.

A: None of these work for me as the field in question is called "end".  The only way to do it was to replace the word "end" with something else e.g. EndIt using sed - and then use EndIt as a field for jq to parse to.


text:
Q: Java remove multiple characters from string I'm playing with string manipulation and I would like to do something like this, when a user types the lesson name: Windows Server, the program should remove Windows plus white space character and display only Server. I managed to do this using this code:
  Scanner in = new Scanner(System.in);

    String lesson;

    System.out.println("Input lesson name: ");

    lesson = in.nextLine();

    String newLesson = lesson.replaceAll("Windows\\s+", "");

    System.out.println("New Lesson is " + newLesson);

But now I want to remove multiple characters like Linux and Unix. How would I include in my regex Linux and Unix?
If the user would type in Linux Administration, the program should display Administration only.

A: To remove only the first word your regex would ^\w+\s
This says:

*

*^ match from the start of the string only

*\w+ Find 1 or more non-whitespace characters, do not be greedy so stop as soon as you find a match for

*\s a whitespace character".

A: If I understood the question, try:
String newLesson = lesson.replaceAll("(Windows|Linux|Unix)\\s+", "");

Output:
Input lesson name:
Linux Administration
Administration

A: You have two options here...

*

*Create a Regex term that encompasses all the terms you want to remove, I think something like the below would do it (but I'm no  Regex expert).
replaceAll("(Windows|Linux|Unix)\\s+", "");

*Store the words you want to remove in a list then cycle through it, removing each term.
List<String> terms = new ArrayList<>(Arrays.asList{"Windows\\s+", "Linux\\s+", "Unix\\s+"});

for(String term : terms) {
    lesson = lesson.replaceAll(term, "");
}

A: Since you just want to remove first word, and assuming that space is the delimiter, you can do it without regex:
String newLesson = lesson.substring(lesson.indexOf(" ") + 1);


text:
Q: I installed VisualBoy Advance to do some classic GBA gaming, but I can't find it anywhere Software Center says it's installed, but searching through my entire computer, I can't seem to find it anywhere. I've tried the which command, find, nothing works. all I can find is the .deb file that I downloaded in my downloads folder. if anyone could help, that'd be great.

A: You can see the contents of an installed deb file like this :
dpkg -L some-GBA-package

Or if it creates a lot of output :
dpkg -L some-GBA-package | less

Or to see the content of your downloaded deb file :
dpkg --contents some-GBA-package.deb

I just installed it (visualboyadvance-gtk), and found it in my menu entry.
Looking at what it launches it is the command :
gvba

Try that command in a terminal.


text:
Q: Gatsby Source Contentful with Variable in Query I'm creating some landing pages on my Gatsby site and want to list nodes from specific content types.  For instance, I have:
allContentfulSongs
allContentfulBlogs

In my landing page template, how can I dynamically query songs or blogs? I tried:
all${landingPage} {
    edges {
      node {
       id
     }
   }
}

but I'm getting a syntax error.  Is there a way to do this in Gatsby or should I just use an
  @include(if: $landingPage)

for each contentType in my query?

A: You cannot use "dynamic" GraphQL queries. So you cannot use a javascript variable as part of your query name in Gatsby.
Queries are treated specially. That's how Gatsby statically compiles your data. Dynamically generated queries would be much harder (or potentially impossible) to cache, so pageQuery does not allow it.


text:
Q: JSF : java.lang.IllegalStateException: Client-id : _idJsp35 is duplicated in the faces tree in Alfresco Web Client I am extending Alfresco Web Client and in one page while expanding panels I get this error. I do not get it always.
JSF : java.lang.IllegalStateException: Client-id : _idJsp35 is duplicated in the faces tree in Alfresco Web Client

I tried to give every component possible unique id, but error still shows up. How can I find source of that error?

A: Whenever I have seen this it has been due to duplicate ids in your JSP.

A: Aren't you better off not specifying ids, and let JSF do the work for you?


text:
Q: Create an auto login for umbraco cms I'm trying to create an auto login for Umbraco cms.
Meaning, I have a website which wraps the cms, and i want users to be able to use it,
Without entering their login details when entering the umbraco cms.
I want to be able to this without sending back the umbraco auth cookie to the user.
Is there anyway I can achieve this?
Thanks.

A: Logically if you create your own maintenance pages and then use Umbraco's Content Servcie you could maintain an Umbraco website from an alternative maintenance system without ever bothering with the Umbraco pipeline.  So you can remove login or the use of cookies as you see fit.  You could use something like Microsoft Dynamic Data to help build the maintenance engine.
If you want to use the Umbraco back-office I believe you are committed to using the Umbraco workflow, which includes login & cookies.


text:
Q: Recovering x-axis value on click - NVD3 LineChart Is there any way to recover the x axis value on click event in the lineChart() of NVD3?
The closest I get is by this answer: nvd3.js : unable to bind onClick event with the data points in the svg
But what I want is to recover the x axis value and redirect to another page, passing it as parameter.
I tried this approach too, similar as one that I use on multiBarChart, but unsuccessful:
$("g.nv-point-paths").on("hover", function (d) {
    $("path").off("click");
    $("path").on("click", function (d) {
        //do something with 'd'
    });
});

A: I have been using the following:
chart.lines.dispatch.on('elementClick', function(e) { ... }

The e variable has everything you need inside of it. Just set a breakpoint and inspect the e var to see how to access whatever you want.
Example:
chart.lines.dispatch.on('elementClick', function(e) {
alert(e.point.label);
}

A: I discovered it by myself, by debugging the javascript of the page:
$("g.nv-point-paths").on("hover", function (d) {
    $("g.nv-point-paths path").off("click");
    $("g.nv-point-paths path").on("click", function (d) {
        var xAxisValue = d.currentTarget.__data__.data.point[4].x;
    });
});

If someone have a better solution to this, please answer here.


text:
Q: PhpStorm give error when run say Built-in web server is only available since PHP 5.4 My Setup:-

*

*Windows Version: Windows 7 Ultimate SP1 64-bit

*XAMPP Version: 5.6.3

*Control Panel Version: 3.2.1  [ Compiled: May 7th 2013 ]

*PhpStorm 7.1.3

I have been working on Netbeans for quite a long time and recently I ditched it because of its limited features. Setting up a local env using Netbeans is fairly simple and I had no problem with it.
So I installed PhpStorm 7.1.3 thinking it would quite easy to run my PHP web page in the same way when I was using Netbeans, but When I try to run my web page in PhpStorm 7.1.3 using its built-in webserver I get Error:

Built-in web server is only available since PHP 5.4

What I did is simply import the Project folder (which is in C:/... directory) in PhpStorm and try to run it on browser, but I couldn't get it to work locally. I believe I have to set up Interpreter under settings, but how do I go ahead and what should I include?
When I run my web page using PhpStorm 7.1.3 the Error looks like

and after that if I click "Fix" then this window is open

Took me over half an hour to get this set up!! Should only have been a few minutes, most of it just telling PhpStorm where it was, not guessing WTF it wants. I read all the pages on their website, so sad that.
So, please, can you help me out here

A: Just download latest version of XAMPP and install that. It will start working fine after reconfiguration.


text:
Q: Microsoft Graph API Select and Filter Owner Address in Calendar I am trying to use Microsoft Graph Api to get and filter the address owner, and the address name of the calendars.
The permissions of my app are:

I try to run this queries:
https://graph.microsoft.com/v1.0/me/calendars?$filter=owner/name eq 'Megan Bowen'

https://graph.microsoft.com/v1.0/me/calendars?$filter=owner/address eq 'noreply@Planner.Office365.com'

But the response is "ErrorInternalServerError"

Why this queries have problems?
How select a property of specific type?
https://graph.microsoft.com/v1.0/me/calendars?$select=owner/name

Thanks,

A: Accessing calendars with Graph requires some configuration in permissions before the Graph call will work. What is required relates to the type of application and that drives the type of permissions – Delegate or Admin.
Below is information to help understand and help setting up the needed permissions.
Starting information:
For Graph to read from a shared mailbox (similar to Outlook delegate access), you need to set permissions in Azure and may also need to set sharing permissions.  If you set Calendars.Read.Shared permissions then the user would need to share their calendar.  If you set Calendars.Read for your application, then it can access all calendars in the org – there is no way to filter the scope.
Microsoft Graph permissions reference
Look under "Microsoft Graph permission names" and "Calendar permissions"
In Azure, set:
Calendars.Read.Shared permissions:  Allows the app to read events in all calendars that the user can access, including delegate and shared calendars. (Delegated permissions)
or
Calendars.Read:  Allows the app to read events of all calendars without a signed-in user.  (Application Permissions)
It's the same for REST:
Outlook Calendar REST API reference
See "Using the Calendar REST API"
Delegate permissions:
For delegate permissions, three things are needed:
Calendar.Read.Shared or Calendar.ReadWrite.Shared in Azure.
The user also needs to grant shared permission to the calendar.
In the scope of requested permissions in your code, ask for the same permissions you granted in Azure.
Here is how a user can share their calendar for an application using Delegate permissions:
Calendar sharing in Office 365
Share an Outlook calendar with other people
Admin permissions:
For Admin permissions (used by Background services or daemons Applications), Admin consent will need to be granted for Calendar.Read or Calendar.ReadWrite. This will allow the application to access all mailboxes in the organization. These permissions cannot be filtered to anything less than all mailboxes.
Get access without a user
Additional:
How to get a list of Shared mailboxes and users with permissions to those mailboxes in Exchange Online?
Be sure to also read the following, which covers how the credentials flow:
Azure Active Directory v2.0 and the OAuth 2.0 client credentials flow
Information on permission scopes:
Scopes, permissions, and consent in the Azure Active Directory v2.0 endpoint
Permission scopes | Graph API concepts
If all permissions are set correctly
Then you should be able to do a rest call with this query:
https://graph.microsoft.com/v1.0/users/upn@domain.tld/calendars

Here upn@domain.tld needs to be the UserPrincipalName of the user you wish to look up.
As a side note, any REST query you make with spaces in it will fail. If you need to call something with spaces, you need the querystring to escape the space with %20


text:
Q: Can't resolve NotificationChannel's isBlockable() method even though it is explicitly mentioned in the docs
Currently writing a flutter plugin, I want to know if a channel is blocked or is blockable, there is a public method that does that but I can't seem to access it.
the docs: https://developer.android.com/reference/android/app/NotificationChannel#isBlockable()

A: Most likely, your compileSdkVersion is set to 32 or lower. Raise it to 33 or higher, as that method is new to API Level 33.


text:
Q: Is there a way to dynamically fetch on the graph? I'd like to write one decoder for both training (should pass gradient down to the encoder) and beam-search mode (single steps from python, sadly, so not linked to the encoder directly).
Ideally, something like this would work:
decoder(beamSearchFlag_boolPlaceholder, initalState_fromEncoder, initialState_placeholder, input):
        initialState = tf.cond(beamSearchFlag_boolPlaceholder,
        lambda: initialState_placeholder,
        lambda: initalState_fromEncoder)

... = cell(input, initialState)

But with cond() TF still needs to resolve the dependencies of both branches. The _fromEncoder branch is executed when beamSearchFlag==False, even without effect, and that's a big part of unnecessary graph. Is there a way around this?


text:
Q: Is It Possible to Have a Cognos Custom Authentication Provider Use JAXWS? I am working on creating a CAM (custom authentication module/provider) for Cognos 10.
Various encrypted information is passed into the provider from the query string.  The Namespace's authentication process is then designed to talk to a web service in order to validate the encrypted information wasn't tampered with and to make sure the user's "session" in the authenticating application hasn't expired.
The authenticating application uses .NET and has the web service exposed for use with SOAP requests (1.1 and 1.2, I believe).  I pointed wsimport at the wsdl and generated a set of classes that works when I build a standard Java console app and pass along debug values.
When I add this code into my Namespace class and attempt the request to the web service I am getting this error from Cognos:

com.sun.xml.internal.ws.spi.ProviderImpl (initialization failure)

I thought Cognos 10 was using JDK 1.6.  I am developing my CAM code in 1.6 (64bit JDK).  I should have 64bit Cognos running but I do not know if it is using a 32bit JDK.  Could a possible disparity in 32bit vs. 64bit be causing the issue?
Any clue as to why the generated classes from wsimport (JAXWS) won't work in Cognos?  Is there a way around this?

A: I'm going to mark this as answered but I'll put the caveat that I haven't tested this.
After dealing with trying to get 3rd party libraries to work with my CAP/CAM I figured that the reason JAXWS was not working correctly because Cognos didn't have that included in its Java distribution.
I got a similar error to the above when trying to use Microsoft's JDBC implementation to talk to a SQL server for namespace searches.  This leads me to believe that the same situation exists with JAXWS.
I looked around for the jar file that should contain the classes that would need to be there.  I didn't see any jar file that was named the same as what I have for 1.6.  Unless it truly isn't supported in Cognos I think including the jar file for JAXWS in the WEB-INF/lib folder will allow webservice communications using JAXWS.


text:
Q: JObject Select Token Null Reference Exception c# Folks, I am having a hard time making this work, I have a asmx webservice which is accessed from android and when I send the json string to the webservice the SelectToken method I call to get the first node throws a NRE, but this issue doesnt happen when I debug the code from within VS using the json string manually. It only happens when its called from outside.
[WebMethod(EnableSession = true)]
[ScriptMethod(UseHttpGet = false, ResponseFormat = ResponseFormat.Json)]
public List<ProductDetail> getAllProductsNearMeJson(String ProductRequest)
{
    JObject obj = new JObject();
    String products = null;

    obj = JObject.Parse(ProductRequest);

    JToken jtk = null;
    jtk = obj.SelectToken("ProductRequest",false);

    products = jtk.ToString();
    var request = JsonConvert.DeserializeObject<ProductMobileRequest>(products);

     //TESTE ONLY
    //var request = new ProductMobileRequest();
    //request.PRODUCT_LAT = "-30.1135";
    //request.PRODUCT_LNG = "-51.2441";
    //TESTE ONLY

    var lat = request.PRODUCT_LAT;
    var lng = request.PRODUCT_LNG;
    List<ProductDetail> pdrList = null;
    ProductMobileResponse response = new ProductMobileResponse();
    try
    {
        response = _productService.ListMobileNearLocation(request, lat, lng);
        if (response.PRODUCTS.Count > 0)
            response.STATUS = true;
        else
            response.STATUS = false;
    }
    catch (Exception ex)
    {
        response.STATUS = false;
        //response.EXCEPTION_MESSAGE = ex.Message;
    }

    if (response.STATUS)
    {
                       return response.PRODUCTS;
    }
    else
    {
        return pdrList;
    }
}

A: I fixed my issue by modifying the signature of my method to take a complex object instead, so there is no need to select tokens in a JObject, however if you are passing a Json over HTTP you need to decorate the complex type in C# as this:
public class myclass
{
    [JsonProperty("name")]
    public string Name {get;set;]
}

[WebMethod(EnableSession = true)]
[ScriptMethod(UseHttpGet = false, ResponseFormat = ResponseFormat.Json)]
public List<ProductDetail> getAllProductsNearMeJson(MyClass ProductRequest)
{
  //do your stuff here and return a List<T>
}

this way .net parses your json string as a valid MyClass type when method is called.


text:
Q: Java STS mechanism exception I am trying to implement web services that use different security mechanisms to do some performance tests and compare them. I am using Java and Netbeans 7 with Glassfish. I managed to implement all the security mechanisms but i have trouble with the STS. I am following this guide in order to create the STS but after i have done all the steps and i try to run the project i get the following exception:
SEVERE: Exception while loading the app : java.lang.IllegalStateException:
 ContainerBase.addChild: start: org.apache.catalina.LifecycleException:
org.apache.catalina.LifecycleException: java.lang.ClassCastException:
org.me.my.sts.MySTS cannot be cast to javax.servlet.Servlet

What is that and any way to overcome it ? Thnx.

A: Apparently its the bug with the STS wizzard:
https://netbeans.org/bugzilla/show_bug.cgi?id=210144
Changing web.xml
<servlet>
<servlet-name>MySTSService</servlet-name>
<servlet-class>MySTSService</servlet-class>
<load-on-startup>0</load-on-startup>
</servlet>

to
<servlet>
<servlet-name>MySTSService</servlet-name>
<servlet-class>com.sun.xml.ws.transport.http.servlet.WSServlet</servlet-class>
<load-on-startup>0</load-on-startup>
</servlet>

should get rid of the problem.