Q: Filter with jQuery by input range A few days ago, I asked on this forum about filter with jQuery. Some people helped me but now I need to do filter no by checkboxes, but with input type="range".
Is it possible?
My code looks like:
JSFIDDLE
My code.

$(document).ready(function () {
    $('input.szukajnapraw').on('click', function () {
        var $checked = $('input.szukajnapraw:checked'),
            $trs = $('.results > tr');
        $trs.toggle(!$checked.length);
        if ($checked.length) {
            $checked.each(function () {
                var text = $(this).attr('rel').trim().toLowerCase();
                $trs.find('td:nth-child(1),td:nth-child(4),td:nth-child(7),td:nth-child(13)').filter(function(){
                    return text == $(this).text().trim().toLowerCase();
                }).parent().show();
            })
        }
    }).last().change();
});

            Ilość dysków
            <input type="range" min="1" max="24" />

            Pojemność
            <input type="range" id="range1" min="1" max="96" />

            Wydajność
            <input type="range" min="50" max="2000" />

                Producent
                Produkt
                Foto
                Typ
                Cena netto
                Cena brutto
                Interface
                Ilość dysków
                Pojemność
                RAID
                Wydajność
                Opis
                Specyfikacja
                Zakup

 Tiger Technology	Macierz 123 TEST		NAS Network Attached Storage	69.00	124.00	Thunderbolt2	60	5tb	0 1	Duża	dsadsadasdawderwasfcagfae	1	Specyfikacja producenta	<form action='' method='POST'>
    <input type='hidden' name='id' value='30' />
    <input class='btn btn-primary btn-sm' type='submit' name='koszykAdd' value='Dodaj do koszyka'/></form>

 G-Tech	vcxv		DAS Direct Attached Storage	50.00	70.00	USB 3.0	5	400	5*5*	500	dsadsad	1	Specyfikacja producenta	<form action='' method='POST'>
    <input type='hidden' name='id' value='34' />
    <input class='btn btn-primary btn-sm' type='submit' name='koszykAdd' value='Dodaj do koszyka'/></form>

 Tiger Technology	das sad		SAN Srorage Area Network	50.00	70.00	eSATA	6	400	5/8/8	500	dasdasdsa	2	Specyfikacja producenta	<form action='' method='POST'>
    <input type='hidden' name='id' value='35' />
    <input class='btn btn-primary btn-sm' type='submit' name='koszykAdd' value='Dodaj do koszyka'/></form>

 LaCie	Macierz		SAN Srorage Area Network	98.00	120.00	miniSAS	6	4 TB	5	Duża	Tu powinien być opis, ale testuje i go nie wpisuje! 	2	Specyfikacja producenta	<form action='' method='POST'>
    <input type='hidden' name='id' value='36' />
    <input class='btn btn-primary btn-sm' type='submit' name='koszykAdd' value='Dodaj do koszyka'/></form>

 LaCie	dsad		SAN Srorage Area Network	50.00	70.00	Thunderbolt	8	400	8/8/8	500	fasdf	2	Specyfikacja producenta	<form action='' method='POST'>
    <input type='hidden' name='id' value='37' />
    <input class='btn btn-primary btn-sm' type='submit' name='koszykAdd' value='Dodaj do koszyka'/></form>

 mLogic	test		DAS Direct Attached Storage	80.00	100.00	Thunderbolt	8	900	5/8/8	600	fsdfd	1	Specyfikacja producenta	<form action='' method='POST'>
    <input type='hidden' name='id' value='38' />
    <input class='btn btn-primary btn-sm' type='submit' name='koszykAdd' value='Dodaj do koszyka'/></form>

 Promise	Zdjęcie		DAS Direct Attached Storage	4564.00	999999.99	Thunderbolt	4	5	1	300	SPrawdzam czy działaja fotki .... .... .. .. .. .	1	Specyfikacja producenta	<form action='' method='POST'>
    <input type='hidden' name='id' value='39' />
    <input class='btn btn-primary btn-sm' type='submit' name='koszykAdd' value='Dodaj do koszyka'/></form>

 Promise	g		DAS Direct Attached Storage	45.00	5.00	Thunderbolt	12	1	1	l	l	1	Specyfikacja producenta	<form action='' method='POST'>
    <input type='hidden' name='id' value='40' />
    <input class='btn btn-primary btn-sm' type='submit' name='koszykAdd' value='Dodaj do koszyka'/></form>

 Promise	jj		DAS Direct Attached Storage	1.00	1.00	Thunderbolt	2	j	j	j	n	1	Specyfikacja producenta	<form action='' method='POST'>
    <input type='hidden' name='id' value='43' />
    <input class='btn btn-primary btn-sm' type='submit' name='koszykAdd' value='Dodaj do koszyka'/></form>

 Promise	jj		DAS Direct Attached Storage	1.00	1.00	Thunderbolt	2	j	j	j	n	1	Specyfikacja producenta	<form action='' method='POST'>
    <input type='hidden' name='id' value='44' />
    <input class='btn btn-primary btn-sm' type='submit' name='koszykAdd' value='Dodaj do koszyka'/></form>

A: Try utilizing .each() , where i is index of element within collection , el is element , el.value is value of input type="range" current  element within loop
$("input[type=range]").each(function(i, el) {
  console.log(el.value);
});

https://jsfiddle.net/f3x5jfjg/15/

A: Yes, that can be done. You would have to take advantage of the change event, not the click event though.
As the ranges are wide, and it's hard to find a match I have set a match by default and used addClass() and removeClass() instead of hide() and show() just to demonstrate how to approach this. Pick any other match, if you can find one, and set your ranges to it.
$(document).ready(function () {
    var ranges = $('div.box > input[type=range]'),
        table  = $('table.table'),
        hrow   = $('tr:has(th)', table),
        orow   = $('tr:has(td)', table);

    ranges.on('change', function() {
        //init range object
        var orange = [];

        //determine value setting & index for each range
        ranges.each(function() {
            var thisrange = {};
            thisrange.value = this.value;
            thisrange.label = $(this).prev('label').text().trim();
            thisrange.column  = $.inArray( thisrange.label, $('th',hrow).map(function(i,v) {
                return $(v).text().trim();
            }) );
            $(this).next('label').text( this.value );
            orange.push( thisrange );
        });

        //hide [remove hightlight] all rows but header
        orow.removeClass('highlight');

        //show [hightlight] rows with values
        orow.filter(function() {
            var result = true,that = this;
            $.each( orange, function(i,v) {
                result = result && $('td',that).eq(v.column).text().trim() == v.value;
            });
            return result;
        }).addClass('highlight');
    }).change();
});

DEMO
NOTE: Some values in the filter columns are non-numeric and would never be set on the range! And some numeric values are out of range.
Update
Here is a version that will filter just by the changed range. When the page loads it filters by the value of the first range.
$(document).ready(function () {
    var ranges = $('div.box > input[type=range]'),
        table  = $('table.table'),
        hrow   = $('tr:has(th)', table),
        orow   = $('tr:has(td)', table);

    ranges.on('change', function() {
        var value = this.value,
            label = $(this).prev('label').text().trim(),
            column  = $.inArray( label, $('th',hrow).map(function(i,v) {
                return $(v).text().trim();
            }) );

        //display the new value
        $(this).next('label').text( value );

        //hide [remove hightlight] all rows but header
        orow.removeClass('highlight');

        //show [hightlight] rows with values
        orow.filter(function() {
            return $('td',this).eq(column).text().trim() == value;
        }).addClass('highlight');
    }).eq(0).change();
});

DEMO


Q: When it is said a circle circumscribed about a triangle, is it mean the circle lie in the triangle or vice versa? I see the text in a question:
Find the equation of the circle circumscribed about the triangle formed by the coordinate axes and the line $x+2y=2$!
From the problem, I have two thinkings:
When it is the triangle lies in the circle, it is easy to solve the problem since we can find the desired equation by substituting each of the three intersectional points (the vertices of the triangle) into a circle equation $x^2 + y^2 + Cx + Dy + E = 0$ and solve the equation system.
However, what about if the circle lies in the triangle?

A: The circumcircle lies outside of the triangle - is circumscribed around it - passing through the three vertices.  Its center is located at the intersection of the perpendicular bisectors of the edges.
The incircle lies inside of the triangle - is inscribed within it - tangent to all three edges.  Its center is located at the intersection of the angle bisectors of the three vertices.

I guess that answered only the title of the question.  Let's get to the true question: how do you get the incircle?
For this the easiest path I think is to get the incenter, the center of the incircle.  With $a$ as the length of the segment opposite of vertex $A$, etc, the incenter is located at
$$\frac{aA + bB + cC}{a + b + c}$$
Which is one of the most elegant formulas I've seen all year.
Then, the inradius is equal to
$$\left|\frac{A \times B + B \times C + C \times A}{a + b + c}\right|$$
Which is almost as good as that last one.  (the $\times$ symbol here represents the scalar analogue to cross product: $A \times B = A_xB_y - A_yB_x$)

A: Combine K and $L_1$ to form one quadratic.
Repeat for $L_2$ and $L_3$.
Then we have 3 equations for 3 unknowns.
Remark:- The general equation of a circle, $K : x^2 + y^2 + Dx + Ey + F = 0$ has three unknowns only.

A: There is another way to get the equation for the circumcircle for this problem:
The coordinate axes intersect the line $x+2y=2$ at $(0,1)$ and $(2,0)$.  Since the coordinate axes are perpendicular at $(0,0)$, the line segment connecting $(0,1)$ and $(2,0)$ is a diameter of the circumcircle, so the center is at $(1,{1\over2})$, and thus the equation of the circumcircle is
$$(x-1)^2+\left(y-{1\over2}\right)^2=1^2+\left(1\over2\right)^2$$
which simplifies to
$$x^2+y^2=2x+y$$


Q: Minimal setup a raspi with archlinux I am about to setup my raspi with archlinux, and I would hope to use a minimal method. Ideally, I vision that I can connect the SD card to my laptop, do some burning and setting, and plug that into my raspi. After booting the raspi, it should be listening to SSH connection. I can then connect it from my laptop using SSH.
Is the above possible? I have read through lots of tutorials, but most of them require cable or more steps.. any pointers will be highly appreciated. Thank you very much!


Q: When is the transpose of a square unitary matrix also unitary? If I have a unitary square matrix $U$ ie. $U^{\dagger}U=I$ ( $^\dagger$ stands for complex conjugate and transpose ), then for what cases is
$U^{T}$ also unitary. One simple case I can think of is $U=U^{T}$ ( all entries of $U$ are real, where $^T$ stands for transpose  ). Are there any other cases ?

A: It's going to be true in all cases.
In particular, if $U$ is unitary, then
$$
(U^T)^\dagger U^T = [UU^\dagger]^T = I^T = I
$$

A: $$(U^T)^\dagger = \bar U = (U^\dagger)^T, $$
where $\bar U$ is the complex conjugate of $U$.
Moroever $$(U^T)^\dagger U^T = (U^\dagger)^T U^T = UU^\dagger = I.$$
Therefore, your proposition is always true.


Q: Why doesn't (Style)Application.Current.Resources["FrameBorder"] let me access a resource in my ResourceDirectory I created a resource in the file FrameRes.xaml like this:
<ResourceDictionary xmlns="http://xamarin.com/schemas/2014/forms"
                    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
                    x:Class="Japanese.Resources.FrameRes">
    <Style x:Key="FrameBorder" TargetType="Frame">
        <Setter Property="CornerRadius" Value="2" />
        <Setter Property="HasShadow" Value="false" />
        <Setter Property="Margin" Value="10,0" />
        <Setter Property="BorderColor" Value="{DynamicResource LineColor}" />
        <Setter Property="Padding" Value="0" />
        <Setter Property="VerticalOptions" Value="Start" />
    </Style>
</ResourceDictionary>

and this is contained inside:
<?xml version="1.0" encoding="utf-8"?>
<Application xmlns:converters="clr-namespace:Japanese"
             xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="Japanese.App">
    <Application.Resources>
        <ResourceDictionary Source="/Resources/FooterRes.xaml" />
        <ResourceDictionary Source="/Resources/FrameRes.xaml" />
    </Application.Resources>
</Application>

When I try to access this in C# like this then it fails and says there's no reference to FrameBorder:
var fb2 = (Style)Application.Current.Resources["FrameBorder"];

When I try to access this in C# like this it works:
Application.Current.Resources.TryGetValue("FrameBorder", out object frameBorder);
var fb = (Style)frameBorder;

Does anyone know why the first way doesn't work. It looks the same to me.

A: The way you have it set up, you have a ResourceDictionary inside another ResourceDictionary with no key/name/reference. When you call Application.Current.Resources["FrameBorder"];, you are accessing the upper-most level of the dictionary and looking for "FrameBorder", not its sub-levels. However, calling TryGetValue goes through all levels of the Dictionary.
Read through the Docs to understand how to access values from Dictionaries.

Ok, so I have played around with the ResourceDictionary tags and files, and I can see where you're going wrong.
According to the Xamarin Forms Docs on ResourceDictionary, you can add stand-alone ResourceDictionary XAML files to your App.xaml like so:
<App ...>
    <App.Resources>

            <!-- Add more resources here -->

            <ResourceDictionary Source="MyResourceDictionary.xaml" />

            <!-- Add more resources here -->

    </App.Resources>
    ...
</App>

You can replace App with ContentPage or ContentView, depending on your use.
What does this do?
Simply put, this creates a new ResourceDictionary object and merges other ResourceDictionary files into it. Let's go into a bit more detail.
Let's start by looking at the Application.Current.Resources property, which is of type ResourceDictionary and implements ICollection, IDictionary, and IResourceDictionary. Given the interfaces it implements, you can obtain the values by numeric or string ID (ex: App.Current.Resources[0] or App.Current.Resources["LabelStyle"]). This accesses the top-level contents of the dictionary, so only those that have been created in the <[App/ContentPage/ContentView].Resources> tag.
You also have a property called MergedDictionaries, which implements ICollection. This means that you can only access the list items by numeric ID (ex: MyMergedDictionary[0]).
When you add a ResourceDictionary file like:
<ResourceDictionary Source="MyResourceDictionary.xaml" />

You are actually merging this file with the current ResourceDictionary. To then access the contents of MyResourceDictionary you would call (in C#):
App.Current.Resources.MergedDictionaries[0]["InternalKeyName"]

This is probably better explained like so:
<App ...>
    <App.Resources>

            <!-- Called using App.Current.Resources["PrimaryColor"] -->
            <Color x:Key="PrimaryColor">#2196F3</Color>

            <!-- Called using App.Current.Resources.MergedDictionaries[0]["InternalKeyName"] -->
            <ResourceDictionary Source="MyResourceDictionary.xaml" />

    </App.Resources>
    ...
</App>

Your case
In your case you have two dictionaries merged into your Application Resources: FooterRes and FrameRes.
For better management, I would create an enum like:
public enum MergedResourcesEnum
{
    Footer,
    Frame
}

and use this enum when calling the resources in C# like so:
Application
    .Current
    .Resources
    .MergedDictionaries[(int)MergedResourcesEnum.Frame]["FrameBorder"];

A: You can try to delete the outer ResourceDictionary tag and both of
var fb2 = (Style)Application.Current.Resources["FrameBorder"];

and
Application.Current.Resources.TryGetValue("FrameBorder", out object frameBorder);
var fb = (Style)frameBorder;

work right.
So your xaml code is like this:
(Please ignore the unrelated package name and FooterRes.xaml because I you didnot share your FooterRes.xaml file)
<Application xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="App75.App">
    <Application.Resources>
        <ResourceDictionary Source="/Resources/FooterRes.xaml" />
    </Application.Resources>
</Application>


Q: Can anybody help explain what happens here with Java thread interruption? These are the 3 classes I have:
public class ChildThread extends Thread {
    @Override
    public void run() {
        while (true) {
            System.out.println("Child thread is running.");
            if (Thread.currentThread().isInterrupted()) {
                System.out.println("Child thread is interrupted.");
                return;
            }
        }
    }
}

public class MainThread extends Thread{

    public Thread childThread = new ChildThread();

    @Override
    public void run() {
        childThread.start();
    }
}

public class App {

    public static void main(String[] args) {
        MainThread mainThread = new MainThread();
        mainThread.start();
        mainThread.childThread.interrupt();
    }
}

When I run this, the child thread doesn't seem to be ever interrupted. It keeps printing: "Child thread is running."
However, if I put a debug breakpoint at mainThread.childThread.interrupt();, child thread will get interrupted.
And also, if I change App class like the following:
public class App {

    public static void main(String[] args) throws Exception{
        ChildThread childThread = new ChildThread();
        childThread.start();
        Thread.sleep(3000);
        childThread.interrupt();
    }
}

it works again. Child thread gets interrupted and stopped printing after 3 seconds.
It seems that the behaviors are different interrupting from a thread that directly started a child thread, and from a thread that didn't directly start a child thread. And it's also different depending on whether there's a breakpoint or not. It's so weird to me. How could this work in a complex system? I don't think a complex system can guarantee all interruption signals are from the original starters of threads.
Could anyone help explain this? I can't find anywhere that seem to have an answer.

A: You need the Thread.sleep before interrupting otherwise, you are interrupting before the child thread even before it has gotten a chance to start running. As per the API specs "Interrupting a thread that is not alive need not have any effect.". So, in affect, the interrupt statement is being ignored as at the time the thread is not active. Without the sleep, the thread become active AFTER the interrupt - hence is never interrupted.
public class App {

    public static void main(String[] args) throws InterruptedException {
        MainThread mainThread = new MainThread();
        mainThread.start();
        Thread.sleep(1);    // <== This line is needed as otherwise, the next line will
                            //      interrupt the thread, even before it has started running!
        mainThread.childThread.interrupt();
    }
}


Q: Mutate F# [] Record This code shows how to make a function mutate its input - one of the things we come to F# to avoid.
type Age = { mutable n : int }
let printInside a = printfn "Inside = %d" a.n
let inside a =
    a.n <- a.n + 1
    a.n

let a = {n = 1}

printInside a //a = 1
inside a
printInside a //a = 2

That being said, how do I do the same bad thing with [<Struct>] Records? I suspect that ref or byref may be involved but I just can't seem to get it to work.
type [<Struct>] Age = { mutable n : int }
let printInside a = printfn "Inside = %d" a.n
let inside a =
    a.n <- a.n + 1
    a.n

let a = {n = 1}

printInside a //a = 1
inside a
printInside a //a = 2

A: The fundamental issue is that a mutable field can only be modified if the struct itself is mutable. As you noted, we need to use byref in the declaration of Age. We also need to make sure a is mutable and lastly we need to use the & operator when calling the function inside. The & is the way to call a function with a byref parameter.
type [<Struct>] Age = { mutable n : int }
let printInside a = printfn "Inside = %d" a.n
let inside (a : Age byref) =
    a.n <- a.n + 1
    a.n

let mutable a = {n = 1}

printInside a //a = 1
inside &a
printInside a //a = 2

A: Now that I get the pattern, here is a simple example (just an int instead of a struct record) of how to mutate values passed into a function:
let mutable a = 1
let mutate (a : byref<_>) = a <- a + 1
mutate &a
a //a = 2


Q: Comparação de tabelas usando o título para junção com LIKE e CONCAT? Eu estou criando uma pagina de troca de livros, fiz duas tabelas a de desejos e meus. até a parte do desejo do usuário logado achar os livros dos outros eu consegui fazer, mas gostaria tb quero q os outros usuários tenha como desejo os livros do usuário logado. tipo: eu ter um livro A e desejar um B e um outro usuário ter o B e desejar um A, e aparecer apenas resultados com essas condições.o campo de desejo poder ser titulo,autor e gênero. Meu select q fiz até agora:
   SELECT b.meu,b.autor, b.genero,b.userid, b.foto
      FROM desejos AS a
      INNER JOIN meus AS b ON
        (CONCAT('%', a.desejo,'%') LIKE CONCAT('%', b.meu,'%')or
        CONCAT('%', a.desejo,'%') LIKE CONCAT('%', b.genero,'%')or
        CONCAT('%', a.desejo,'%') LIKE CONCAT('%', b.autor,'%'))
      WHERE
        a.userid = $_SESSION[id]
          AND
        b.userid != $_SESSION[id]
tentei colocar "and

   CONCAT('%', b.meu,'%') LIKE (CONCAT('%', a.desejo,'%') or
   CONCAT('%', b.genero,'%') LIKE CONCAT('%', a.desejo,'%')or
   CONCAT('%', b.autor,'%') LIKE CONCAT('%', a.desejo,'%'))

mas n deu certo. as tabelas


Q: HTML input button with onclick with custom onStart function not working I have created a button with an onclick function which loads particular elements after clicking on the button.
For some reason, suddenly the button cannot be clicked and the function has now become undefined.
After running the same code on js fiddle, the correct output is executed however within the browser through xampp the code does not run

function onStart() {

  //Start Button
  startBtn.style.display = "none";
}
<input type="button" id="startBtn" value="START" onclick="onStart()">


Q: Not able to access model attributes in view through thymeleaf and spring boot I'm having hardtime to access model attribute values in the view using thymeleaf.

Employees per Project

                         FirstName
                         LastName
                        Projects Count

Controller Code:
List<projectEmployee> employeeProjectCount= empRep.employeeProjects();  //.employeeProjects();
    System.out.println("FROM Home Controller :::::::::: "+employeeProjectCount);
    System.out.println("FROM Home Controller :::::::::: "+employeeProjectCount.get(1).getfName());
    System.out.println("FROM Home Controller :::::::::: "+employeeProjectCount.get(1).getlName());
    System.out.println("FROM Home Controller :::::::::: "+employeeProjectCount.get(1).getPc());

    model.addAttribute("employeeProjectCount", employeeProjectCount);

I can access all the attributes in the controller through but not in the view. Let me know where im going wrong.
Error:
There was an unexpected error (type=Internal Server Error, status=500).
An error happened during template parsing (template: "class path resource [templates/main/Home.html]")
org.thymeleaf.exceptions.TemplateInputException: An error happened during template parsing (template: "class path resource [templates/main/Home.html]")
    at org.thymeleaf.templateparser.markup.AbstractMarkupTemplateParser.parse(AbstractMarkupTemplateParser.java:241)
    at org.thymeleaf.templateparser.markup.AbstractMarkupTemplateParser.parseStandalone(AbstractMarkupTemplateParser.java:100)
    at org.thymeleaf.engine.TemplateManager.parseAndProcess(TemplateManager.java:666)
    at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1103)
    at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1077)
    at org.thymeleaf.spring6.view.ThymeleafView.renderFragment(ThymeleafView.java:372)
    at org.thymeleaf.spring6.view.ThymeleafView.render(ThymeleafView.java:192)
    at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1414)
    at org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1158)
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1097)
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:973)
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1003)
    at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:895)
    at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:705)
    at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:880)
    at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:814)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:223)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:158)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:185)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:158)
    at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:185)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:158)
    at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:185)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:158)
    at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:185)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:158)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:197)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:542)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:119)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:357)
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:400)
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:861)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1739)
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52)
    at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
    at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.base/java.lang.Thread.run(Thread.java:833)

Caused by: org.attoparser.ParseException: Exception evaluating SpringEL expression: "EmpPrjCnt.fName" (template: "main/Home" - line 70, col 12)
    at org.attoparser.MarkupParser.parseDocument(MarkupParser.java:393)
    at org.attoparser.MarkupParser.parse(MarkupParser.java:257)
    at org.thymeleaf.templateparser.markup.AbstractMarkupTemplateParser.parse(AbstractMarkupTemplateParser.java:230)
    ... 48 more

Caused by: org.thymeleaf.exceptions.TemplateProcessingException: Exception evaluating SpringEL expression: "EmpPrjCnt.fName" (template: "main/Home" - line 70, col 12)
    at org.thymeleaf.spring6.expression.SPELVariableExpressionEvaluator.evaluate(SPELVariableExpressionEvaluator.java:292)
    at org.thymeleaf.standard.expression.VariableExpression.executeVariableExpression(VariableExpression.java:166)
    at org.thymeleaf.standard.expression.SimpleExpression.executeSimple(SimpleExpression.java:66)
    at org.thymeleaf.standard.expression.Expression.execute(Expression.java:109)
    at org.thymeleaf.standard.expression.Expression.execute(Expression.java:138)
    at org.thymeleaf.standard.processor.AbstractStandardExpressionAttributeTagProcessor.doProcess(AbstractStandardExpressionAttributeTagProcessor.java:144)
    at org.thymeleaf.processor.element.AbstractAttributeTagProcessor.doProcess(AbstractAttributeTagProcessor.java:74)
    at org.thymeleaf.processor.element.AbstractElementTagProcessor.process(AbstractElementTagProcessor.java:95)
    at org.thymeleaf.util.ProcessorConfigurationUtils$ElementTagProcessorWrapper.process(ProcessorConfigurationUtils.java:633)
    at org.thymeleaf.engine.ProcessorTemplateHandler.handleOpenElement(ProcessorTemplateHandler.java:1314)
    at org.thymeleaf.engine.OpenElementTag.beHandled(OpenElementTag.java:205)
    at org.thymeleaf.engine.Model.process(Model.java:282)
    at org.thymeleaf.engine.Model.process(Model.java:290)
    at org.thymeleaf.engine.IteratedGatheringModelProcessable.processIterationModel(IteratedGatheringModelProcessable.java:368)
    at org.thymeleaf.engine.IteratedGatheringModelProcessable.process(IteratedGatheringModelProcessable.java:222)
    at org.thymeleaf.engine.ProcessorTemplateHandler.handleCloseElement(ProcessorTemplateHandler.java:1640)
    at org.thymeleaf.engine.TemplateHandlerAdapterMarkupHandler.handleCloseElementEnd(TemplateHandlerAdapterMarkupHandler.java:388)
    at org.thymeleaf.templateparser.markup.InlinedOutputExpressionMarkupHandler$InlineMarkupAdapterPreProcessorHandler.handleCloseElementEnd(InlinedOutputExpressionMarkupHandler.java:322)
    at org.thymeleaf.standard.inline.OutputExpressionInlinePreProcessorHandler.handleCloseElementEnd(OutputExpressionInlinePreProcessorHandler.java:220)
    at org.thymeleaf.templateparser.markup.InlinedOutputExpressionMarkupHandler.handleCloseElementEnd(InlinedOutputExpressionMarkupHandler.java:164)
    at org.attoparser.HtmlElement.handleCloseElementEnd(HtmlElement.java:169)
    at org.attoparser.HtmlMarkupHandler.handleCloseElementEnd(HtmlMarkupHandler.java:412)
    at org.attoparser.MarkupEventProcessorHandler.handleCloseElementEnd(MarkupEventProcessorHandler.java:473)
    at org.attoparser.ParsingElementMarkupUtil.parseCloseElement(ParsingElementMarkupUtil.java:201)
    at org.attoparser.MarkupParser.parseBuffer(MarkupParser.java:725)
    at org.attoparser.MarkupParser.parseDocument(MarkupParser.java:301)
    ... 50 more

Caused by: org.springframework.expression.spel.SpelEvaluationException: EL1021E: A problem occurred whilst attempting to access the property 'fName': 'Accessing member 'fName' is forbidden for type 'class jdk.proxy5.$Proxy124' in Thymeleaf expressions. Blocked classes are: [com.sun.*, jakarta.*, java.*, javax.*, jdk.*, org.ietf.jgss.*, org.omg.*, org.w3c.dom.*, org.xml.sax.*, sun.*]. Allowed classes are: [java.lang.Boolean, java.lang.Byte, java.lang.Character, java.lang.Double, java.lang.Enum, java.lang.Float, java.lang.Integer, java.lang.Iterable, java.lang.Long, java.lang.Math, java.lang.Number, java.lang.Short, java.lang.String, java.math.BigDecimal, java.math.BigInteger, java.math.RoundingMode, java.time.*, java.util.ArrayList, java.util.Calendar, java.util.Calendar, java.util.Collection, java.util.Date, java.util.Enumeration, java.util.HashMap, java.util.HashSet, java.util.Iterator, java.util.LinkedHashMap, java.util.LinkedHashSet, java.util.LinkedList, java.util.List, java.util.Locale, java.util.Map, java.util.Map$Entry, java.util.Optional, java.util.Properties, java.util.Set, java.util.stream.Stream].'
    at org.springframework.expression.spel.ast.PropertyOrFieldReference.readProperty(PropertyOrFieldReference.java:209)
    at org.springframework.expression.spel.ast.PropertyOrFieldReference.getValueInternal(PropertyOrFieldReference.java:104)
    at org.springframework.expression.spel.ast.PropertyOrFieldReference$AccessorLValue.getValue(PropertyOrFieldReference.java:405)
    at org.springframework.expression.spel.ast.CompoundExpression.getValueInternal(CompoundExpression.java:92)
    at org.springframework.expression.spel.ast.SpelNodeImpl.getValue(SpelNodeImpl.java:112)
    at org.springframework.expression.spel.standard.SpelExpression.getValue(SpelExpression.java:338)
    at org.thymeleaf.spring6.expression.SPELVariableExpressionEvaluator.evaluate(SPELVariableExpressionEvaluator.java:265)
    ... 75 more

Caused by: org.springframework.expression.EvaluationException: Accessing member 'fName' is forbidden for type 'class jdk.proxy5.$Proxy124' in Thymeleaf expressions. Blocked classes are: [com.sun.*, jakarta.*, java.*, javax.*, jdk.*, org.ietf.jgss.*, org.omg.*, org.w3c.dom.*, org.xml.sax.*, sun.*]. Allowed classes are: [java.lang.Boolean, java.lang.Byte, java.lang.Character, java.lang.Double, java.lang.Enum, java.lang.Float, java.lang.Integer, java.lang.Iterable, java.lang.Long, java.lang.Math, java.lang.Number, java.lang.Short, java.lang.String, java.math.BigDecimal, java.math.BigInteger, java.math.RoundingMode, java.time.*, java.util.ArrayList, java.util.Calendar, java.util.Calendar, java.util.Collection, java.util.Date, java.util.Enumeration, java.util.HashMap, java.util.HashSet, java.util.Iterator, java.util.LinkedHashMap, java.util.LinkedHashSet, java.util.LinkedList, java.util.List, java.util.Locale, java.util.Map, java.util.Map$Entry, java.util.Optional, java.util.Properties, java.util.Set, java.util.stream.Stream].
    at org.thymeleaf.spring6.expression.ThymeleafEvaluationContext$ThymeleafEvaluationContextACLPropertyAccessor.canRead(ThymeleafEvaluationContext.java:237)
    at org.springframework.expression.spel.ast.PropertyOrFieldReference.readProperty(PropertyOrFieldReference.java:198)
    ... 81 more


Q: How to call LostFocus event of another control from the other control Calling the LostFocus event of control from other control
Example. : I want to call LostFocus event of Button1 button from the Gotfocus event of Button2 button.
code is :-
private void button2_GotFocus(object sender, RoutedEventArgs e)
        {
          button1.gotFocus // this line giving error.
       }

A: Use following code:
private void button2_GotFocus(object sender, RoutedEventArgs e)
{
    button1.RaiseEvent(new RoutedEventArgs(LostFocusEvent, button1));
}

private void button1_LostFocus(object sender, RoutedEventArgs e)
{

}

If this doesn't solve your problem, post your code and state your problem and purpose clearly so that you can get better solution.

A: you can just call event handler method of Button1's LostFocus event in button2_GotFocus :
private void button2_GotFocus(object sender, RoutedEventArgs e)
{
    button1_LostFocus(this.button1, null);
}

A: Try this
     private void button2_GotFocus(object sender, RoutedEventArgs e)
       {
         button1_LostFocus(sender,e)

       }


Q: Nav Bar not showing after camera image capture I have been updating an app that I had some else build for me. In the updating, I am instituting storyboard segues, among other things, and have got the app almost complete. One little niggling issue is when I take an picture with the camera and the image is presented in the TakenImageView, the NavBar is not visible. Yet, if I go from the gallery to the TakenImageView, the NavBar shows! Ugh.
The image picker is presented from the HomeView, then moves to TakenImage after the user chooses camera or gallery.
I have tried to change to a prepare and perform Segue, but the segue doesn't fire from the gallery when selecting an image or from the camera's UsePhoto. The only way I can get the image to the TakenImageView is to manually segue via instantiating the view in code. See below...
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info;
{
    UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
    TakenImageVC *takenVC = [storyboard instantiateViewControllerWithIdentifier:@"TakenImageVC"];
    takenVC.takenimage = [info objectForKey:UIImagePickerControllerOriginalImage];
    [picker pushViewController:takenVC animated:YES];
    //_pickerImage = [info objectForKey:UIImagePickerControllerOriginalImage];
    //[self performSegueWithIdentifier:@"TakenSegue" sender:self];
}

The prepare for segue has only these three. The top two are modal and are linking from the buttons. The TakenSegue is linking from the controller. Of course, I have the destinationController commented out, as the segue doesn't fire when using perform as noted earlier.
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    if ([segue.identifier isEqualToString:@"InfoSegue"])
    {
        NSLog(@"Info Modal view");
    }
    if ([segue.identifier isEqualToString:@"HelpSegue"])
    {
        NSLog(@"Help Modal view");
    }
    if ([segue.identifier isEqualToString:@"TakenSegue"])
    {
        NSLog(@"Taken Segue");
        //TakenImageVC *takenVC = segue.destinationViewController;
        //takenVC.takenimage = _pickerImage;
    }
}

In trying different methods, I have added a NavigationController between the HomeView and TakenImageView and have changed the class to UIImagePickerController in the attributes.
Still, the NavBar doesn't show... but only after taking a photo with the camera!
And, yes, I have the navigation bar set to not hide... in both the HomeView and TakenView. This is in the viewWillAppear of both controllers.
Target is iOS7.1 and up. Running Xcode 7.
I'd appreciate some help from anyone with a hint as to what is causing the nav bar to not show from the camera and, of course, a way to fix it! Thanks!

A: I was unable to get the next view to show with a nav bar after the camera, even after trying numerous scenarios.
So, after seeing a hint in a different post, I removed the nav controller between the home and taken view, changed the attributes to none for Simulated Metrics/Top Bar and inserted a toolbar in it's place in the TakenView and two following views. Yes, it required more work in Storyboard and I had to add a label where the title should go, but it is all functioning. And, I didn't have to add any more code, except for changing the back or cancel buttons into unwindSegues.


Q: Parsing Soap XML I have a XML like this:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <soap:Body>
        <SampleResponse xmlns="http://tempuri.org/">
            <SampleResult>
                <diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
                                 xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">
                    <NewDataSet xmlns="">
                        <Table diffgr:id="Table1" msdata:rowOrder="0">
                            <tag1>tag1 text</tag1>
                            <tag2>tag2 text</tag2>
                        </Table>
                        <Table diffgr:id="Table2" msdata:rowOrder="1">
                            <tag1>tag1 text</tag1>
                            <tag2>tag2 text</tag2>
                        </Table>
                    </NewDataSet>
                </diffgr:diffgram>
            </SampleResult>
        </SampleResponse>
    </soap:Body>
</soap:Envelope>

So i parsed above XML using Below Code:
string XMLresponse = e.response;
var XResult = XElement.Parse(XMLresponse);

var result = XResult.Descendants("Table")
    .Select(t => new
    {
        tag1 = t.Descendants("tag1").First().Value,
        tag2 = t.Descendants("tag2").First().Value,
    });

foreach (var res in result)
{
   string str = res.tag1; // here i am able get the response
}

listbox.ItemsSource = result;

But i am not able bind it to ListBox. i have a ListBox like below:
<ListBox x:Name="listbox">
    <ListBox.ItemTemplate>
        <DataTemplate>
            <StackPanel Orientation="Vertical">
                <TextBlock Text="Sample" ></TextBlock>
                <TextBlock Text="{Binding tag1}" ></TextBlock>
                <TextBlock Text="{Binding tag2}" ></TextBlock>
            </StackPanel>
        </DataTemplate>
    </ListBox.ItemTemplate>
</ListBox>

In the ListBox i have added a TextBlock, which is repeated twice. But the dynamical text blocks are not binding with data.

A: The two dynamic values are represented as fields, not properties. And since you can only bind to properties in XAML, you'll need to create a strong-typed data structure with your two properties, and select the values into that.
Something like:
class V
{
    public string tag1 { get; set; }
    public string tag2 { get; set; }
}

var result = XResult.Descendants("Table").Select(t => new V
             {
                 tag1 = t.Descendants("tag1").First().Value,
                 tag2 = t.Descendants("tag2").First().Value,
             });


Q: jQuery : XMLHttp Requests : Is this use of synchronous ajax bad? I know that in general the goal should be to avoid async: false.  However, in this situation, I want to understand whether it's worth tying things together to make it work, or if it is okay:
On my site's registration page, I have a JS/jQuery validation function on submission.  It has two AJAX queries, one for the username (to make sure it hasn't already been taken), and one for the email (to make sure they didn't submit an email already claimed by another user). In the validation function, I check each of these, along with lots of other things (passwords matching, check not blank, etc.), and when either of these pop up, a warning message states the issue.
Both of these ajax queries use async: false in order to ensure that the form doesn't submit before they are checked.
My question is,
how bad is this?  And if it's bad bad, then why?  I could put the work in to make a single function that checks both and has 4 return values for each of the different options, but that seems like a lot...  I know this may not be a solid coding question, but I'm new to coding and want to make sure I understand what the difference here means.
Thanks so much in advance.

A: Synchronous HTTP requests halt execution of subsequent code while they are en route. While browsers may no longer block the UI during this time, we're relying on the user's available bandwidth, network reliability, and the server's current load for the performance of our code. This is generally not good practice.
as i have found from this link may this will help you please look at this
https://softwareengineering.stackexchange.com/questions/112551/should-we-still-consider-a-synced-xmlhttprequest-bad-practice
you should also reffer to https://webtide.com/xmlhttprequest-bad-messaging-good/


Q: Crystal Reports Record Selection and Summary Field conflict I am really new to Crystal Reports and I am looking for any suggestions on how to approach the following issue:
I currently have a report that uses a record selection to limit the results by date. I would like to include in this same report a summary a total count of all the records (ignoring the record restriction). Unfortunately (although somewhat expected), the summary calculates the total after the record restriction is applied. Is there any way to get around this? In case my question is a bit unclear I've included a generic example below:

*

*I have a report that pulls info from a database with a total of 10 records.

*I select a specific date range, and it only returns 3 records

*I would like to include in the report footer that 3/10 records are getting returned.

A: This is bit tricky to perform in crystal reports as record selection is compulsory applied. However you can overcome this by using sub report.
Calculate the report footer using report.
This will surely work


Q: Logical constraints in CPLEX I am a beginner at using CPLEX and I have come across a problem with creating logical constraints (if ... then ...). I use IBM ILOG CPLEX Optimization Studio version 12.7. According to the the manual, it should be able to handle logical constraints by using "=>" (e.g., "if x>0 then y>=2" should become x>0 => y>=2).
The problem consists of assigning a start and end of a shift to employees (or a 0 if they are not working today). I am trying to create a variable that functions like an indicator for whether they are working in order to use it for assigning costs later.
I have boiled my code down to the following:
using CP;

tuple TimeSlot {
    key int day;
    key int slotNo;
}
{TimeSlot} TimeSlots = ...;
{int} mondays = {t.slotNo|t in TimeSlots:t.day==1};
int monMax = max(t in mondays) t;
range monRange = 0..monMax;

range allEmployees = 1..10;

dvar int monStart[allEmployees] in monRange;    //Start of monday shift
dvar int monEnd[allEmployees] in monRange;      //End of monday shift
dvar int monAtWork[allEmployees] in 0..1;       //Binary

//minimize ...

subject to{
    forall(t in allEmployees)
        {monStart[t] > 0 && monEnd[t]>0} => monAtWork[t] = 1; //Get error here
}

The error I get is syntax error, unexpected =. I have tried both splitting and flipping the constraint (e.g., monStart[t] == 0 => monAtWork[t] = 0;) to no avail. Am I missing something?

A: Looking at the provided OPL examples (e.g. BasketballScheduling\acc.mod) I think that the 'then' part defining the constraint should have '==' rather than '='. It is not an assignment, but declaring that the two must be equal.

A:  using CP;

tuple TimeSlot {
    key int day;
    key int slotNo;
}
{TimeSlot} TimeSlots = {<1,1>,<2,2>};;
{int} mondays = {t.slotNo|t in TimeSlots:t.day==1};
int monMax = max(t in mondays) t;
range monRange = 0..monMax;

range allEmployees = 1..10;

dvar int monStart[allEmployees] in monRange;    //Start of monday shift
dvar int monEnd[allEmployees] in monRange;      //End of monday shift
dvar int monAtWork[allEmployees] in 0..1;       //Binary

//minimize ...

subject to{
    forall(t in allEmployees)
        (monStart[t] > 0 && monEnd[t]>0) => monAtWork[t] == 1; //Get error here
}

works fine


Q: How to create a Flash Movieclip via a web interface? Forgive me if this is not the correct place to ask such a question.
Basically, I am looking for a way to allow someone to easily (at least, easier then diving into Flash) create a basic Flash animation (movieclip) with some placed image assets and text, all via a web interface.
I was thinking along the lines of using jQuery to allow drag and drop assets, of which you'd "record" the co-ordinates and relay that to Flash somehow to create the SWF file.
Or would it be better to create a tool in Flash (surely making operations easier) and then have some kind of "save" button to render out the SWF?
I'm totally open to suggestions.
Thank you

A: If you really need to produce a stand-alone SWF file (and not just a config file for you own "player"), I would probably do it like this;
1) Create your editor in whatever system you feel like (flash, jquery etc).
2) Build a config file in the client. This is used, together with all the resources the user added, to play back the animation.
3) Upload said assets and config file to your web server.
4) Use the flex compiler (on the server) to produce the resulting SWF, combining your player with generated AS3 which embeds the uploaded resources as needed, to make it available to the player.
5) Give the user a download link for the newly generated SWF file.

A: I don't think there is any swf compiler available for Flash (actionescript). You may create a swf that allows users to create an animation, save it as a home-made vector format, and then replay it. But I don't believe you can create and independant swf file with only the created animation in it.
Just think about a player in Flash, and a format that the player will read (xml, json, name it...). You can either generate the input with jQuery or Flash, and then feed it into your player to display it. You will eventually need two files.

A: Apparently this library allows you to compile SWFs at runtime. I haven't used it myself (yet) and don't know how stable or flexible it is, but it appears to be what you're looking for. I'd recommend giving it a spin and seeing if it's sufficient.
I'm not exactly sure how it saves the file, so you might run into security problems since it's a web application. Hopefully it should be OK though.


Q: FCM messages are not delivered when the device is started and it has a password On android, the messages do not arrive after I restart my device and have a password, if he has no password he receives the message
I would like to understand this situation, whether it is for security or really is a sdk failure


Q: need to add a col conditionally I have one table which I want to join with another. I would create a commmand in Crystal reports to get this output and change the names in the formulas easily.
I need something like this: only I need the sum from the second tbl.
Select
    *
from
    rapklib.shpfrt a
    left outer join ralib.shpfrtc b

where idord# a = idord# b

the first is created as
CREATE VIEW
    Ralib.shpfrt
AS
    SELECT
        T01.IDORD#,
        T01.IDDOCD,
        T01.IDPRT#,
        T01.IDSFX#,
        T01.IDSHP#,
        T01.IDNTU$,
        T01.IDENT# ,
        ( T01.IDNTU$ * T01.IDSHP# ) AS LINTOT ,
        T02.IARCC3,
        T02.IAPRLC ,
        T01.IDORDT,
        T01.IDHCD3
 FROM
    STDTA.OEINDLID  T01
    INNER JOIN STDTA.ICPRTMIA T02 ON T01.IDPRT# = T02.IAPRT#

WHERE t01.iddocd > 20131231

the second is the same as the first but only will contain rows when there is a value in idprt# = 'FRTCRDM' then the sum we get there means there was a credit given for shipping charge (freight).
So I want to join them for use in a crystal report that will give me all the rows of the first but bring in the FRTCRDM amounts as well. Currently I am joining them when order# are = and thus only getting orders which have a FRTCRDM.


Q: Disqus Comment System [Wordpress] - Change the word "Comment" i have installed Disqus comment system on one of my wordpress blogs, but i want the comment numbers to show as 0 instead of 0 Comments or 12 instead of 12 Comments. Previously there used to be an Appearance section in Disqus admin that used to have an option to change this output as was suggested in answer to this question. But seems like the Appearance section has been taken off by Disqus. Is there any other way to achieve this (without messing with the plugin code, ofcourse.) ??
UPDATE:
Well, looked into the plugin source as well but no use, seems like they are updating it using javascript. After enabling Reactions now it returns 0 comments and 0 Reactions.
UPDATE#2:
okie so i at last found where it is coming from ... the plugin basically includes a count.js files from yoursite.disqus.com\count.js?some wierd parameters, and the js file looks something like this:
var DISQUSWIDGETS;

if (typeof DISQUSWIDGETS != 'undefined') {
    DISQUSWIDGETS.displayCount({"showReactions": true, "text": {"and": "and", "reactions": {"zero": "0 Reactions", "multiple": "{num} Reactions", "one": "1 Reaction"}, "comments": {"zero": "0 Comments", "multiple": "{num} Comments", "one": "1 Comment"}}, "counts": [{"reactions": 0, "uid": 1, "comments": 0}, {"reactions": 0, "uid": 0, "comments": 0}, {"reactions": 0, "uid": 3, "comments": 0}, {"reactions": 0, "uid": 2, "comments": 0}, {"reactions": 0, "uid": 4, "comments": 0}]});
}

the worst part is we can't even change the code in the js file as it is hosted on disqus itself.

A: Alternatively you can "hack" the code of Disqus. I'll try to explain what I did step-by-step:

*

*Get the newest file of the main disqus function. It should be something similar to this:
http://disqus.com/forums/(your-site-id)/count.js

*Copy that script somewhere, you can "beautify it" to make it more readable. Than find and change the displayCount function to whatever you want to like this:
c.displayCount = function (a)
{
  for (var b, c, e, g, f = 0; f < a.counts.length; f++)
  if (b = a.counts[f], c = h[b.uid]) e = b.comments === 0 ? "0 drivels" : b.comments == 1 ? "1 drivel" : "{num} drivels",
  g = e.replace("{num}", b.comments),
  a.showReactions && (e = b.reactions === 0 ? a.text.reactions.zero : b.reactions == 1 ? a.text.reactions.one : a.text.reactions.multiple, e !== "" && (g += " " + a.text.and + " " + e.replace("{num}", b.reactions))),
  c.element.innerHTML = g
};

(note the drivels ;)

*Save (upload) the whole file somewhere on your server and remember the path

*Use Wordpress administration to edit the Disqus plugin - file disqus-comment-system/disqus.php and find line that contains concatenated url withthe word count.js. It is in about 3/4 of the file. As of now the line looks like this but it might change in the future:
s.src = '//' + '<?php echo DISQUS_DOMAIN; ?>/forums/' + disqus_shortname + '/count.js';

*Make this link point to your newly-uploaded file like this (I used relative URL):
s.src = '/wp-include/custom/disqus-count.js';

*Save it and profit! It took me more than an hour to figure this out so I hope this actually helps someone (I needed to translate these messages into my native language). A great benefit of this approach is the fact that if your language uses different word forms for different numbers (other than 0, 1 and more), you can script it in.

A: You should be able to hide it via JavaScript.
Something along these lines:
node = document.getElementsByClassName("dsq-comment-count")[0].childNodes[0]
node.nodeValue = node.nodeValue.replace("Comments", "")

A: The official answer is here: http://help.disqus.com/customer/portal/articles/565624#customizing-link-text

*

*Go to http://YOUR-SITE.disqus.com/admin/settings/?p=general

*Edit Comment Count Link section as you need.

*That's all!


Q: Trouble with for loops in Python 3: getting the index in string2 of an element from string1 I am trying to write a program that will take a file and encode it using the Viginère cipher.  I've run into a little bump with indices.  I've defined my strings text and alphabet like this:
import string

alphabet = string.ascii_lowercase
ciphertext = open("black_hole.txt","r")
ciphertext = ciphertext.read()
text = ""

for i in range(len(ciphertext)):
    if ciphertext[i].isalpha() == True:
        text = text + ciphertext[i]

My trouble starts when I try to write this for loop:
for i in range(len(text)):
    print(alphabet.index(text[i]))

I get the ValueError "substring not found".  I find this strange since text[i] is always a letter as well as a string.
Please let me know if I haven't posed this question clearly enough!

A: for i in range(len(text)):
    print(alphabet.index(text.lower()[i]))

just add lower() and it will work

A: As stated by Kevin in comments, you are probably missing uppercase.
You can use alphabet[ord(text[i].lower()) - ord('a')] instead of index.


Q: How is a Lichtenberg figure created? Related: Breakdown voltage of a dielectric
When I think of the dielectric breakdown of air, an electric field of $3×10^6$ V/m is enough to accelerate initially ionized electrons created primarily from muons via cosmic radiation. These ionized electrons then collide with neutral air molecules, which in turn generate an avalanche of charge that produces lightning. Using Wikipedia’s language, lightning is a three-dimensional Lichtenberg figure.
Reading Wikipedia’s section on Modern 3D Lichtenberg figures, a piece of acrylic (or glass) is impregnated with electrons from a linear accelerator. When this acrylic is made to discharge, a “beam tree” is formed that is absolutely beautiful.

What is the role of the pointed conductive object (or nail) that initiates the dielectric breakdown of the acrylic?  The electrons trapped inside the acrylic create a charged dielectric and create some potential.  I assume that the nail grounds out this acrylic so that electrons burn a path towards the nail to form the beam tree. However, I want to know what is happening at the atomic level?

A: From plasma physics perspective, those branches are called streamers. What happens here is that the pointed conductive object creates a high electric field because of it is pointy geometry. Of course it is connected to external power supply so it is biased at a certain voltage. The high electric field at the edge of the nail causes the loosely confined electrons in glass slab to get energized to a level where they can escape from their confining atoms and
a.Either  release another electron from an atom when they collide with it (ionization process)
b.Or excite an electron in the atom when they collide with it, making the excited electron easy to ionize by another energetic electron.
Since free electrons can carry current, those free electrons practically create some conducting channels within the dielectric. The conducting channels represent the easiest (the least resistant path) of electrons to move from the electrode (nail) to the ground. Determining the path of those channels is difficult because it depends on a lot of factors such as the intensity of ionization reaction in the dielectric, the energizing rate of electrons (to prevent them from recombination) and so.
It is similar to lightning during storms. The dielectric in the case you presented is glass while in lightening it is air. The channels are the paths in air where lightning strikes the ground. The only difference is that if you wanted to generate streamers in the lab you need to ensure you have a strong enough electric field to initiate the process. And that is what you do when you use a pointed conductive object.
Generating streamers and their characteristics highly depend on the material used. For example the required voltage to initiate this process in glass is different than air.

A: Breakdown processes within solids are considerably more complex than those in gases. The properties of PMMA that has been injected by electrons via a particle accelerator have been studied by a number of researchers. If a PMMA specimen is bombarded by electrons that do not have sufficient energy to fully penetrate it, a layer of internal negative space charge is developed within. The depth of the layer depends on the electron beam's initial energy. During injection, a layer of positive image charges also develops on the exterior surfaces of the acrylic. Positive ions (created by the collision of the high-energy electrons with air molecules) are strongly attracted by the growing internal negative space charge layer and these ions attach themselves to the PMMA. They form a matching layer of positive space charge on all the external surfaces of the PMMA. The fields from the inner and outer space charge layers virtually cancel, leaving only a slight net external electrical field around the PMMA specimen. You can think of the specimen as being a "plateless" capacitor with opposite charges residing on the surfaces and deep inside the dielectric. When fully charged, the static electrical field between the inside space charge layer and the outer surfaces can reach 1-2 MV/cm across the intervening acrylic.
If we then penetrate the surface of a charged specimen using a sharp metal point, the E-field in the PMMA at the tip is significantly enhanced. Once the local E-field exceeds the impulse breakdown strength of the acrylic (typically 5-6 MV/cm), avalanche breakdown begins, and the excess charges in the negative space charge layer begin flowing through the newly-created streamer channels that originate from the metal point. Since the discharges actually originate from a more positive point and propagate into a more negative region, the resulting Lichtenberg figure is a highly-branched positive Lichtenberg figure. The metal point can be grounded (for safety reasons when discharging large specimens) or left floating for small specimens. In either case dielectric breakdown will occur with no external voltage source being necessary, since we have well over a million volts of potential available between the internal charge layer and external surfaces of the specimen itself.
The actual breakdown mechanisms occur extremely quickly. Members of our group have measured discharge propagation through PMMA at between 8.5e5 to 1.3e6 m/s using both electrical and optical techniques. Through field enhancement, the E-field at streamer tips may exceed 20 MV/cm - sufficient to cause dielectric breakdown and conduction through a variety of avalanche and field emission mechanisms. Energy to drive streamers further into virgin material is provided by the stored electrostatic energy residing within the space charge of undischarged material ahead of advancing streamers, and the process continues, almost explosively, until (most of) the space charge energy has been depleted. This energy can be quite significant. For example, the electrostatic energy associated with the space charge within a fully-charged one foot square by one inch thick piece of acrylic can be almost 1 kJ!
An excellent discussion of the breakdown mechanisms of solids going down to the molecular level can be found in the following PhD thesis (and many other subsequent papers) by P. P. Budenstein:
Effects of excess charge density on dielectric breakdown in solids" at http://www.dtic.mil/cgi-bin/GetTRDoc?AD=ADA048267
A layman's description about how we create 3D acrylic Lichtenberg Figures and some theories regarding their formation can also be found on our web site at:
http://www.capturedlightning.com/frames/lichtenbergs.html


Q: Count by ratio and then group by MSQL I have a table like
ID Name

1 ABC
1 DEF
1 VVV
1 BBB
1 BCD
2 ZZZ
2 BAA
3 AAA
3 BBB
3 BBC

I want to get the ratio of all the names that start with A to All the names that start with B group by ID.
So the output should be
ID Ratio

1  0.5
2  0
3  0.33

.
SELECT (ID, (SELECT COUNT(*) FROM `table` WHERE name LIKE 'A%') /
            (SELECT COUNT(*) FROM `table` WHERE name LIKE 'B%')) AS `ratio` from table Group by ID

does not give me the right answer. It takes the total ratio of A/B across all ID's into account and writes that number for all the ID's.

A: I'd try:
SELECT ID, CASE WHEN B = 0 THEN 0 ELSE A/B END AS Ratio FROM
    ( SELECT ID,
         SUM(CASE WHEN Name LIKE 'A%' THEN 1 ELSE 0 END) AS A,
         SUM(CASE WHEN Name LIKE 'B%' THEN 1 ELSE 0 END) AS B
      FROM my_table GROUP BY ID ) AS grouped;

The inner SELECT gets the group IDs, and for every ID, the number of items beginning with A and those beginning with B.
The outer SELECT (you can omit it if you're sure that there'll always be at least one B-row) checks that the ratio makes sense before attempting to calculate it.
Or else:
SELECT ID, COALESCE(SUM(CASE WHEN Name LIKE 'A%' THEN 1 ELSE 0 END)
        /  SUM(CASE WHEN Name LIKE 'B%' THEN 1 ELSE 0 END), 0)
FROM my_table GROUP BY ID;

This takes advantage of the fact that, if the number of B-rows is zero, the division will yield NULL. The COALESCE transforms that NULL in a 0.

A: This will do it:
SELECT
    id,
    SUM(IF(name LIKE 'A%',1,0))/SUM(IF(name like 'B%',1,0))
FROM `table`
GROUP BY ID


Q: Drawer is not opening in react-native I am using drawer navigation in material top navigation.
This is my drawer navigation code
import { createDrawerNavigator, createStackNavigator } from "react-navigation";
import { UserProfileComponent } from "../components/standalone/userProfile/userProfile.component";
import { RecordMeetingComponent } from "../components/standalone/recordMeeting/recordMeeting.component";
import { ChatBotComponent } from "../components/standalone/chatBot/chatBot.component";
import DrawerScreen from "../components/shared/drawerToggler/drawerToggle.component";
import userDashBoardTabsStack from "./userDashBoardTabs";

const userDrawerNavigator = createDrawerNavigator({
    Home:{
        screen: userDashBoardTabsStack,
        navigationOptions:{
            drawerLabel: "Home"
        }
    },
    Record: {
        screen: RecordMeetingComponent,
        navigationOptions:{
            drawerLabel: "Record"
        }
    },
    Profile: {
        screen: UserProfileComponent,
        navigationOptions: {
            drawerLabel: "My Profile"
        }
    },
    ChatBot: {
        screen: ChatBotComponent,
        navigationOptions: {
            drawerLabel: "Chat Bot"
        }
    },
    },{
        initialRouteName: "Record",
        contentComponent: DrawerScreen,
        drawerWidth: 300
    }
)
export default userDrawerNavigator;

This is my tab navigation
import { createMaterialTopTabNavigator } from "react-navigation";
import { UserDashboardTodayTab } from "../components/standalone/usersTabs/today/today.component";
import { UserDashboardWeekTab } from "../components/standalone/usersTabs/week/week.component";
import { UserDashboardMonthTab } from "../components/standalone/usersTabs/month/month.component";

const userDashBoardTabsStack = createMaterialTopTabNavigator({
        today:{
            screen: UserDashboardTodayTab,
            navigationOptions: (navigation)=>({
                title: "TODAY"
            }),
        },
        week: {
            screen: UserDashboardWeekTab,
            navigationOptions: (navigation)=>({
                title: "WEEK"
            }),
        },
        month:{
            screen: UserDashboardMonthTab,
            navigationOptions: (navigation)=>({
                title: "MONTH",
                headerTitle: "#000000"
            })
        }
    },{
        order: ["today", "week", "month"],
        tabBarOptions : {
            activeTintColor: "#000000",
            inactiveTintColor: "#ADB2BF",
            pressColor: "#25B7AF",
            indicatorStyle: {
                backgroundColor: "#25B7AF",
            },
            activeBackgroundColor: "#25B7AF",
            style: {
                fontFamily: "nunito_regular",
                backgroundColor: "#ffffff"
            }
        },
    swipeEnabled: true,
    animationEnabled: true,
    lazy: true,
    backBehavior: "initialRoute"
})

export default userDashBoardTabsStack;

I am calling these two in a createStacknavigator
import { createStackNavigator } from "react-navigation";
import userDrawerNavigator from "./userDrawer";
import React from "react";
import { TouchableOpacity } from "react-native";
import Icon from "react-native-vector-icons/Feather";

const OnboardingStack = createStackNavigator({

    userDrawerNavigator: {
            screen: userDrawerNavigator
        },
    },{
        navigationOptions: ({ navigation }) => ({
            title: 'ReactNavigation',  // Title to appear in status bar
            headerLeft:
            <TouchableOpacity  onPress={ () => { navigation.dispatch(DrawerActions.toggleDrawer())} }>
                <MenuImage navigation={ navigation }/>
            </TouchableOpacity>,
            headerStyle: {
                backgroundColor: '#333',
            },
            headerTintColor: '#fff',
            headerTitleStyle: {
              fontWeight: 'bold',
            },
        })
    },
    {
        initialRouteName: "userDrawerNavigator",
        headerLayoutPreset: "center",
    }
)

const MenuImage = ({navigation}) => {
    if(!navigation.state.isDrawerOpen){
        return <Icon name="menu" color="#000000"/>
    }else{
        return <Icon name="arrow-left" color="#000000"/>
    }
}

export default OnboardingStack;

And iterating these components in a switch navigator
import { createSwitchNavigator, createAppContainer } from "react-navigation";
import { SplashComponent } from "../components/standalone/splash/splash.component";
import AuthStack from "./loggedOut";
import UserStack from "./loggedIn";
import OnboardingStack from "./freshInstall";

export const AppStack = createAppContainer(createSwitchNavigator(
    {
        Splash: SplashComponent,
        LoggedIn: UserStack,
        LoggedOut: AuthStack,
        Onboarding: OnboardingStack
    },
    {
        initialRouteName: "Splash"
    }
))

This is my custom component for drawer
class DrawerScreen extends React.Component {

  navigateToScreen = (route) => () => {
    const navigateAction = NavigationActions.navigate({
      routeName: route
    });
    this.props.navigation.dispatch(navigateAction);
    this.props.navigation.dispatch(DrawerActions.closeDrawer())
  }

  render () {
    return (
      <View>
        <ScrollView>
          <View>
            <View >
              <Text onPress={this.navigateToScreen('RecordMeetingComponent')}>
                Record
              </Text>
            </View>
            <View>
              <Text onPress={this.navigateToScreen('UserProfileComponent')}>
               My Profile
              </Text>
            </View>
            <View >
              <Text onPress={this.navigateToScreen('ChatBotComponent')}>
              Chat Bot
              </Text>
            </View>
          </View>
        </ScrollView>
      </View>
    );
  }
}

DrawerScreen.propTypes = {
  navigation: PropTypes.object
};

export default DrawerScreen;

But the drawer navigation is not appearing in the screen. What am I doing wrong here?


Q: How to show a given function satisfies the Cauchy Riemann equation at a point, but is not differentiable at that point. This is my question:

Prove that the function $f(z) = u+iv$, where
$$ f(z) = \begin{cases} \frac{x^3(1+i) - y^3(1-i)}{x^2+y^2}, &\text{ if }z\neq 0,\\ 0 &\text{if }z=0.\end{cases}$$
satisfies the Cauchy-Riemann equation at the origin, but the derivative of $f$ at $z=0$ does not exists.

I solved the second part about the derivative but was not able to prove the first part, that is, $u_x=v_y$ at $z=0$. Please kindly direct me how to solve it: I got
\begin{align*}
u_x&=\frac{x^4 +3x^2x^2 + 2xy^3}{(x^2 + y^2)^2}, \\
u_y&=\frac{ -y^4 -2x^3y -3x^2y^2}{(x^2 + y^2)^2}, \\
v_x&= \frac{x^4 - 2xy^3 + 3x^2y^2}{(x^2 + y^2)^2}, \\
v_y&=\frac{y^4+2x^2y^2-2x^3y}{(x^2 + y^2)^2}.
\end{align*}
and there remains the question of how to prove $u_x=v_y$ at $(x,y)=(0,0)$.


Q: Launch PowerShell as administrator in current directory New to PowerShell.
I need to launch PowerShell as Administrator in the current directory.
From what I have heard about the amazing abilities of PowerShell, I expect I should be able to do this without a registry hack?


Q: Dual of $\ell_\infty(X)$ Given a Banach space $X$. Consider the space $\ell_\infty(X)$ which is the $\ell_\infty$-sum of countably many copies of $X$. Is there any accessible respresentation of the dual space $\ell_\infty(X)^*$? In particular, is this dual space isomorphic to the space of finitely additive $X^*$-valued measures on the powerset of $\mathbb N$ equipped with the semivariation norm?
Any references will be appreciated.

A: There is no good description of the dual of $\ell_\infty(X)$ as far as I know.
If $X$ is finite dimensional, then the answer to your second question is yes.
Otherwise, it is no, for there is no way to define an action of a finitely additive $X^*$-valued measure on $\ell_\infty(X)$ if the ball of $X$ is not compact.


Q: How to create a US map in R with separation between states and clear labels? I was trying to figure out how to create a map like down below in R on the Stack Exchange but maybe that's the wrong community and the GIS side is a better spot. Currently, I'm able to add the colours. I'm sort of able to get the labeling in place but some of the labels on the east coast are not readable.
I would like to be able to:

*

*I would like to fix the labeling.

*Split the states into groups

The Data:
PADDS<- structure(list(STATE = structure(c(1L, 2L, 3L, 4L, 5L, 6L, 7L,
8L, 9L, 10L, 11L, 12L, 13L, 14L, 15L, 16L, 17L, 18L, 19L, 20L,
21L, 22L, 22L, 23L, 24L, 25L, 26L, 27L, 28L, 29L, 30L, 31L, 32L,
32L, 33L, 34L, 35L, 36L, 37L, 38L, 39L, 40L, 41L, 42L, 43L, 44L,
45L, 46L, 47L, 48L, 49L, 50L), .Label = c("ALABAMA", "ALASKA",
"ARIZONA", "ARKANSAS", "CALIFORNIA", "COLORADO", "CONNECTICUT",
"DELAWARE", "FLORIDA", "GEORGIA", "HAWAII", "IDAHO", "ILLINOIS",
"INDIANA", "IOWA", "KANSAS", "KENTUCKY", "LOUISIANA", "MAINE",
"MARYLAND", "MASSACHUSETTS", "MICHIGAN", "MINNESOTA", "MISSISSIPPI",
"MISSOURI", "MONTANA", "NEBRASKA", "NEVADA", "NEW HAMPSHIRE",
"NEW JERSEY", "NEW MEXICO", "NEW YORK", "NORTH CAROLINA", "NORTH DAKOTA",
"OHIO", "OKLAHOMA", "OREGON", "PENNSYLVANIA", "RHODE ISLAND",
"SOUTH CAROLINA", "SOUTH DAKOTA", "TENNESSEE", "TEXAS", "UTAH",
"VERMONT", "VIRGINIA", "WASHINGTON", "WEST VIRGINIA", "WISCONSIN",
"WYOMING"), class = "factor"), State = structure(c(1L, 2L, 3L,
4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L, 15L, 16L, 17L,
18L, 19L, 20L, 21L, 22L, 22L, 23L, 24L, 25L, 26L, 27L, 28L, 29L,
30L, 31L, 32L, 32L, 33L, 34L, 35L, 36L, 37L, 38L, 39L, 40L, 41L,
42L, 43L, 44L, 45L, 46L, 47L, 48L, 49L, 50L), .Label = c("Alabama",
"Alaska", "Arizona", "Arkansas", "California", "Colorado", "Connecticut",
"Delaware", "Florida", "Georgia", "Hawaii", "Idaho", "Illinois",
"Indiana", "Iowa", "Kansas", "Kentucky", "Louisiana", "Maine",
"Maryland", "Massachusetts", "Michigan", "Minnesota", "Mississippi",
"Missouri", "Montana", "Nebraska", "Nevada", "New Hampshire",
"New Jersey", "New Mexico", "New York", "North Carolina", "North Dakota",
"Ohio", "Oklahoma", "Oregon", "Pennsylvania", "Rhode Island",
"South Carolina", "South Dakota", "Tennessee", "Texas", "Utah",
"Vermont", "Virginia", "Washington", "West Virginia", "Wisconsin",
"Wyoming"), class = "factor"), StateAbbreviation = structure(c(2L,
1L, 4L, 3L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 13L, 14L, 15L, 12L,
16L, 17L, 18L, 21L, 20L, 19L, 22L, 22L, 23L, 25L, 24L, 26L, 29L,
33L, 30L, 31L, 32L, 34L, 34L, 27L, 28L, 35L, 36L, 37L, 38L, 39L,
40L, 41L, 42L, 43L, 44L, 46L, 45L, 47L, 49L, 48L, 50L), .Label = c("AK",
"AL", "AR", "AZ", "CA", "CO", "CT", "DE", "FL", "GA", "HI", "IA",
"ID", "IL", "IN", "KS", "KY", "LA", "MA", "MD", "ME", "MI", "MN",
"MO", "MS", "MT", "NC", "ND", "NE", "NH", "NJ", "NM", "NV", "NY",
"OH", "OK", "OR", "PA", "RI", "SC", "SD", "TN", "TX", "UT", "VA",
"VT", "WA", "WI", "WV", "WY"), class = "factor"), PADD = structure(c(3L,
5L, 5L, 3L, 5L, 4L, 1L, 1L, 1L, 1L, 5L, 4L, 2L, 2L, 2L, 2L, 2L,
3L, 1L, 1L, 1L, 2L, 2L, 2L, 3L, 2L, 4L, 2L, 5L, 1L, 1L, 3L, 1L,
1L, 1L, 2L, 2L, 2L, 5L, 1L, 1L, 1L, 2L, 2L, 3L, 4L, 1L, 1L, 5L,
1L, 2L, 4L), .Label = c("PADD I", "PADD II", "PADD III", "PADD IV",
"PADD V"), class = "factor"), SubAreaInPADD = structure(c(1L,
1L, 1L, 1L, 1L, 1L, 2L, 3L, 4L, 4L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 2L, 3L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 3L, 1L, 3L,
3L, 4L, 1L, 1L, 1L, 1L, 3L, 2L, 4L, 1L, 1L, 1L, 1L, 2L, 4L, 1L,
4L, 1L, 1L), .Label = c("", "Sub A", "Sub B", "Sub C"), class = "factor"),
SubAreaInPADDName = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 4L,
2L, 3L, 3L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 4L, 2L, 4L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 4L, 2L, 1L, 2L, 2L, 3L, 1L, 1L,
1L, 1L, 2L, 4L, 3L, 1L, 1L, 1L, 1L, 4L, 3L, 1L, 3L, 1L, 1L
), .Label = c("", "Central Atlantic", "Lower Atlantic", "New England"
), class = "factor"), PADDName = structure(c(2L, 5L, 5L,
2L, 5L, 4L, 1L, 1L, 1L, 1L, 5L, 4L, 3L, 3L, 3L, 3L, 3L, 2L,
1L, 1L, 1L, 3L, 3L, 3L, 2L, 3L, 4L, 3L, 5L, 1L, 1L, 2L, 1L,
1L, 1L, 3L, 3L, 3L, 5L, 1L, 1L, 1L, 3L, 3L, 2L, 4L, 1L, 1L,
5L, 1L, 3L, 4L), .Label = c("East Coast", "Gulf Coast", "MidWest",
"Rocky Mountain", "West Coast"), class = "factor"), RMapClassName = structure(c(2L,
1L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 1L, 11L, 12L, 13L, 14L,
15L, 16L, 17L, 18L, 19L, 20L, 21L, 22L, 23L, 24L, 25L, 26L,
27L, 28L, 29L, 30L, 31L, 33L, 32L, 34L, 35L, 36L, 37L, 38L,
39L, 40L, 41L, 42L, 43L, 44L, 45L, 46L, 47L, 48L, 49L, 50L,
51L), .Label = c("", "alabama", "arizona", "arkansas", "california",
"colorado", "connecticut", "delaware", "florida", "georgia",
"idaho", "illinois", "indiana", "iowa", "kansas", "kentucky",
"louisiana", "maine", "maryland", "massachusetts:main", "michigan:north",
"michigan:south", "minnesota", "mississippi", "missouri",
"montana", "nebraska", "nevada", "new hampshire", "new jersey",
"new mexico", "new york:long island", "new york:main", "north carolina:main",
"north dakota", "ohio", "oklahoma", "oregon", "pennsylvania",
"rhode island", "south carolina", "south dakota", "tennessee",
"texas", "utah", "vermont", "virginia:main", "washington:main",
"west virginia", "wisconsin", "wyoming"), class = "factor")), .Names = c("STATE",
"State", "StateAbbreviation", "PADD", "SubAreaInPADD", "SubAreaInPADDName",
"PADDName", "RMapClassName"), class = "data.frame", row.names = c(NA, -52L))

code to create the map so far:
PADDS<-subset(PADDS, State != "Alaska")
PADDS<-subset(PADDS, State != "Hawaii")

PADD_Names<-unique(PADDS$PADDName)

map("state", interior = FALSE)
PADD1<-subset(PADDS, PADD=="PADD I")
PADD2<-subset(PADDS, PADD=="PADD II")
PADD3<-subset(PADDS, PADD=="PADD III")
PADD4<-subset(PADDS, PADD=="PADD IV")
PADD5<-subset(PADDS, PADD=="PADD V")

map('state', region = PADD1$RMapClassName, fill=TRUE, col="red", add=TRUE, names=TRUE)    # map of four states
map('state', region = PADD2$RMapClassName, fill=TRUE, col="green", add=TRUE, names=TRUE)    # map of four states
map('state', region = PADD3$RMapClassName, fill=TRUE, col="blue", add=TRUE, names=TRUE)    # map of four states
map('state', region = PADD4$RMapClassName, fill=TRUE, col="yellow", add=TRUE, names=TRUE)    # map of four states
map('state', region = PADD5$RMapClassName, fill=TRUE, col="purple", add=TRUE, names=TRUE)    # map of four states

map.text("state", regions=PADDS$RMapClassName, labels=as.character(PADDS$StateAbbreviation), add=TRUE) #add labels

A: Here is a suggestion using ggplot. It can be improved, but it gives you the basic idea.
library(maps)
library(ggplot2)

us.map <-  map_data('state')

# add PADD zones
us.map$PADD[us.map$region %in%
          c("maine", "vermont", "new hampshire", "massachusetts", "connecticut", "rhode island",
            "new york", "pennsylvania", "new jersey", "delaware", "district of columbia", "maryland",
            "west virginia", "virginia", "north carolina", "south carolina", "georgia", "florida")] <- "PADD 1: East Coast"
us.map$PADD[us.map$region %in%
          c("south dakota", "north dakota","nebraska", "kansas", "oklahoma",
            "minnesota", "iowa", "missouri", "wisconsin", "illinois", "indiana",
            "michigan", "ohio", "kentucky", "tennessee")] <- "PADD 2: Midwest"
us.map$PADD[us.map$region %in%
          c("new mexico", "texas", "arkansas", "louisiana", "alabama", "mississippi")] <- "PADD 3: Gulf Coast"
us.map$PADD[us.map$region %in%
          c("montana", "idaho", "wyoming", "utah", "colorado")] <- "PADD 4: Rocky Mountain"
us.map$PADD[us.map$region %in%
          c("washington", "oregon", "nevada", "arizona", "california")] <- "PADD 5: West Coast"

# subset the dataframe by padd zones and move lat/lon accordingly
us.map$lat.transp[us.map$PADD == "PADD 1: East Coast"] <- us.map$lat[us.map$PADD == "PADD 1: East Coast"]
us.map$long.transp[us.map$PADD == "PADD 1: East Coast"] <- us.map$long[us.map$PADD == "PADD 1: East Coast"] + 5

us.map$lat.transp[us.map$PADD == "PADD 2: Midwest"] <- us.map$lat[us.map$PADD == "PADD 2: Midwest"]
us.map$long.transp[us.map$PADD == "PADD 2: Midwest"] <- us.map$long[us.map$PADD == "PADD 2: Midwest"]

us.map$lat.transp[us.map$PADD == "PADD 3: Gulf Coast"] <- us.map$lat[us.map$PADD == "PADD 3: Gulf Coast"] - 3
us.map$long.transp[us.map$PADD == "PADD 3: Gulf Coast"] <- us.map$long[us.map$PADD == "PADD 3: Gulf Coast"]

us.map$lat.transp[us.map$PADD == "PADD 4: Rocky Mountain"] <- us.map$lat[us.map$PADD == "PADD 4: Rocky Mountain"]
us.map$long.transp[us.map$PADD == "PADD 4: Rocky Mountain"] <- us.map$long[us.map$PADD == "PADD 4: Rocky Mountain"] - 5

us.map$lat.transp[us.map$PADD == "PADD 5: West Coast"] <- us.map$lat[us.map$PADD == "PADD 5: West Coast"] - 2
us.map$long.transp[us.map$PADD == "PADD 5: West Coast"] <- us.map$long[us.map$PADD == "PADD 5: West Coast"] - 10

# add labels
states <- aggregate(cbind(long.transp, lat.transp) ~ region, data=us.map,
                FUN=function(x)mean(range(x)))
states$labels <- c("AL", "AR", "AZ", "CA", "CO", "CT", "DE", "DC", "FL", "GA", "IA",
              "ID", "IL", "IN", "KS", "KY", "LA", "MA", "MD", "ME", "MI", "MN",
              "MO", "MS", "MT", "NC", "ND", "NE", "NH", "NJ", "NM", "NV", "NY",
              "OH", "OK", "OR", "PA", "RI", "SC", "SD", "TN", "TX", "UT", "VA",
              "VT", "WA", "WI", "WV", "WY")

# plot and use padd zone as fill
ggplot(us.map,  aes(x=long.transp, y=lat.transp), colour="white") +
  geom_polygon(aes(group = group, fill=PADD)) +
  geom_text(data=states, aes(long.transp, lat.transp, label=labels), size=3) +
  theme(panel.background = element_blank(),  # remove background
    panel.grid = element_blank(),
    axis.line = element_blank(),
    axis.title = element_blank(),
    axis.ticks = element_blank(),
    axis.text = element_blank()) +
  coord_equal()


Q: Glide for Android: How to include GIFs from Google Drive? I am trying to include GIFs in my android application. My GIFs are shared as a document on Google Drive with public access enabled. Currently, I'm trying to use Glide to include the GIFs.
 Glide.with(parent.getContext())
            .asGif()
            .load("https://drive.google.com/uc?id=1-QKgZ76K3EZQlbXyY3wI57FA8k31JmrA")
            .into(imageView);

However, although there is no error, the GIF does not display on my phone, even after a long time(internet issues shouldn't be the problem).
It appears that this is only a problem for GIFs on google drive. Trying to show an internet GIF such as this one works on my Android phone.
How can I show GIF files on Google Drive with Glide on my Android device?

A: It should work. Because Glide trying to fetch image which type you specified. I just tried it and its work. it loads too late. If you wait a bit, you will see that it can be loaded. You can test it more easily if you upload a lower resolution gif file to Drive.


Q: Hadoop Name node recovery in CDH3 cluster I am using CDH3 Cloudera Pseudo distributed mode cluster.It was working fine before. but currently i am   not able to do any hadoop commands,hive queries,pig scripts.
Looks like the  namenode gets corrupted.
I tried sudo jps and found that namenode daemon is not running.
It only shows
    DataNode
Jps
RunJar
HMaster
SecondaryNamenode

What is the root cause here? How do i recover my name node?


Q: Recover simulated affine transformation for matched asift features (Morel's implementation) Has anyone tried to recover the simulated affine transformation for the ASIFT feature detector? (From the author's implementation). In the original paper the simulated affine is clearly recovered by the equation 2.2 but I cannot seem to find a clear point where this is performed. Has anyone tried before? The function compensate_affine_coor1 in compute_asift_keypoints.cpp seems to be what I'm looking for but the scale seems to be normalized plus, the center of coordinates to perform the transformation is not clear to me.

A: It is performed in function you mentioned. Center coordinates are shifted because when you rotate image, top-left corner(origin) is moved, so they have to compensate it. And scale doesn`t change at all.


Q: Best way to endian swap many structures in C++ I have a lot of C++ struct that look kind of like this:
typedef struct {
    UINT32 foo    : 5;
    UINT32 spare0 : 27;
    double bar;
}  data;

or this
typedef struct {
    double foo;
    double bar;
} data2;

I'm currently endian swapping all structures by each field individually in a single function call, but I was wondering if there was some more efficient way of doing this without manually swapping each individual field for each struct.
Would the only way to do this is to create a function that requires the size for each field so the function would know how many bits to swap? Other methods are welcome as well.
Thank you!


Q: Where/how to install intermediate certificates on CentOS 7 Directions for installing CA's are straight forward:

*

*Copy cert with .crt extension to /etc/pki/ca-trust/source/anchors

*then run the command update-ca-trust extract
However, I haven't been able to find any instructions on how to install intermediate certs. Is it the same procedure as the CA certs?

A: Intermediate certs are usually sent by the server, rather than installed on clients.
(NOTE Just read the comments to the question, so i'm posting @MichaelHamptons comment as initial answer.)


Q: Mysql: Counting occurences in a table, return as a single row I have a table listing some organizations, and some details, as the country they are in.
I need to count the number of organizations in each country, and I managed that with this query:
SELECT COUNTRY, COUNT(*) AS ORGANIZATIONS FROM ORGANIZATION GROUP BY COUNTRY

This gives me a result set like this:
COUNTRY | ORGANIZATION
--------+-------------
UK      | 12
FR      | 7
NL      | 9

This is good, but a better result I'm looking for is a single row result, like this:
UK | FR | NL
---+----+---
12 | 7  | 9

Any ideas on how to do that in MySQL alone?

A: This can't really be done with a single SQL statement as it would require an unknown number of columns.
I would be inclined to say that this is just formatting of the returned data, and hence probably better places in the calling script.
However it is easy to do if you have a fixed number of countries that you are interested in. But with several sub queries it is not likely to be that efficient.
What can be done is to dynamically build up the SQL, but that is messy.
Alternative would to GROUP_CONCAT the countries details into a single row:-
SELECT GROUP_CONCAT(CONCAT_WS('##', COUNTRY, ORGANIZATIONS ))
FROM
(
    SELECT COUNTRY, COUNT(*) AS ORGANIZATIONS
    FROM ORGANIZATION
    GROUP BY COUNTRY
) sub0


Q: Deleting file from internal storage in Android I was saving file to internal storage now I want to delete it. The problem is, I don't remember the name of that file so I can't use this myContext.deleteFile(fileName); approach. How to get the name of that file and delete it?

A: When you use file methods from Context, Android saves that file into app's directory (and encrypt it, compared to File.()) method). So, you can just clear app data and that file will be removed


Q: Python 3 not rendering html on browser If I run this script on terminal, it outputs the html template. But on browser after serving it using python3 -m http.server 8000, it just display the exact script (not rendering). I've installed packages on requirements.txt and interpreter set to Python 3.x, am I missing something here?
home.py
#!/usr/bin/env python3

import os
import sys
from jinja2 import Environment, FileSystemLoader

# Get current url
try:
    url = os.environ['SCRIPT_NAME']
except KeyError:
    url = ''

print('Content-type: text/html\n')
env = Environment(loader=FileSystemLoader('templates'))

template = env.get_template('home.html')
print(template.render(url=url))

A: Your script could work as a CGI script, since it outputs a HTTP header, followed by the HTML content.
python -m http.server, by default, does not run CGI scripts for security, but if you add the --cgi switch, it will, provided that the scripts are in the cgi-bin directory relative to the directory you start it from.
In other words:

*

*create a cgi-bin directory

*move home.py to cgi-bin/home.py

*run python3 -m http.server --cgi 8000

*navigate to http://127.0.0.1:8000/cgi-bin/home.py
When working with CGI scripts, you might want to enable the (soon-to-be-deprecated) cgitb handler too.
Anything more intricate than that, and I would recommend looking at the Flask application framework instead, though.


Q: Register to GCM in background what I'm trying to do is run some scripts let say "in background" and display external page.
I have my activity
public class MyApp extends DroidGap
{
   @Override
   public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        super.loadUrl(Config.getStartUrl());
        //super.loadUrl("http://external.com/");
    }
}

I'm able now only to load my internal page where scripts are included or load external url.
What I want to do is
public class MyApp extends DroidGap
{
   @Override
   public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        // run my gcm script to register
        super.loadUrl("http://external.com/"); //load prepared page
    }
}

but I don't know if script should/can be run from java code. Or maybe this is wrong solution and I should load my external page from js? I'm using cordova 2.5

A: If you planning to support IOS (APNS) and Android (GCM), you can use PushPlugin https://github.com/bobeast/PushPlugin
It is easy to setup, where you can register for GCM using javascript and having the same interface for Android and IOS.


Q: Cannot import python package installed with apt-get On ubuntu (specifically the python:3.7.3-stretch base dockerimage), I run:
$ pip install pandas
$ python -c 'import pandas'
$

And that works fine.
Then, I try to install the package pygrib (which isn't installable with pip), via apt-get, python3-grib. I try:
$ apt-get update
$ apt-get install python3-grib
$ python -c 'import pygrib'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'pygrib'

(Omitting the output of the installs for brevity).
Why can't I import pygrib? I am not inside a virtual environment.

A: The first thing I would try, would be to double check that the python you're calling is the same that you've installed pygrib into

*

*$ which python

*$ python -c "help("modules")"

*$ python -c "help("modules pygrip")"
(to inspect which python you're calling, and which packages are installed there).
If that's not working, then there's something off with the ubuntu package - so I'd then try installing from source instead;
From https://github.com/jswhit/pygrib
Clone the github repository, or download a source release from https://pypi.python.org/pypi/pygrib.

Copy setup.cfg.template to setup.cfg, open in text editor, follow instructions in comments for editing. If you are using the old grib_api library instead of the new eccodes library, be sure to uncomment the last line setup.cfg.

Run 'python setup.py build'

Run 'python setup.py install' (with sudo if necessary)

Run 'python test.py' to test your pygrib installation.


Q: Delete contents of textbox and automatically deleting another I have 2 input box fields, one linked to an autocomplete and the other is hidden
I have an action on select that takes the id of the selected item into the hidden field.
code:
    $('#id_emp_name').autocomplete({
    source: '/mycompany/employees.json',
    minLength: 1,
    dataType: 'json',
    max: 12,
    select: function(event, ui) {
        $('#id_emp_id').val(ui.item.id);

    }
});

I want to change it so that whenever I delete contents (even a single character) on the autcomplete textbox it would set the hidden textbox's to ''

A: Would this work for you?
$('#id_emp_name').autocomplete({
    source: '/mycompany/employees.json',
    minLength: 1,
    dataType: 'json',
    max: 12,
    select: function(event, ui) {
        $('#id_emp_id').val(ui.item.id);

    }
}).keyup(function(){
    $('#id_emp_id').val('');
});

You may need to put some conditions on it of course.


Q: How to load configurations at Vue JS app start I want to load some configuration from an API call before any page load happens. For this I added my api call function in main.js but it returns promise and page get loaded before my global api completes. I want to load the global configuration first as my backend services URLs will keep on changing.
my main.js

import globalConfigLogic from '../appStarter/globalConfig-logic';
import globalConfigDetails from '../appStarter/app-starter.js';

// API Wrapper - Global Mixin
Vue.mixin(apiWrapper)
Vue.use(VeeValidate);
Vue.config.productionTip = false;

 globalConfigLogic.getGlobalConfiguration(
   globalConfigDetails.globalConfigHost,
   globalConfigDetails.globalConfigHostPort,
   globalConfigDetails.globalConfigKeys
 );
new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')

The functions is just making an API call and converting the result in hashmap and giving it back.

A: If loading your configuration returns a promise, simply put the creation of the Vue instance in the .then() {} code.


Q: How can I set up gulp to run identically in Visual Studio 2017 and msbuild without having to change my build scripts? I'm struggling to get set up with gulp in Visual Studio 2017. I'm not sure where I'm going wrong but there are a few things I'm confused about and I can't really find any online resources that are of any use.
The build system I'm using is CruiseControl.NET and I would like gulp to work with it.
This is what I've done so far:

*

*Installed Visual Studio 2017 with .NET Core cross-platform development and Node.js development selected (amongst other options).

*Created a new project

*Added a gulpfile.js file to the project

*Right-click on the file and choose Task Runner Explorer
In the Task Runner Explorer I get the error Failed to load. See output window (Ctl+Alt+O) for more information..
Then if I do the following:

*

*Open the Node.js Interactive Window

*Run the command .npm install --global gulp-cli

*Close Visual Studio and open it back up again
In the Task Runner Explorer, I then get the message (No tasks found).
First off, is this the correct way to set up Gulp in Visual Studio 2017?
The reason I'm asking this is because I'm not sure why I need to prefix commands with a period character (ie .npm as opposed to npm).
I'm also not sure where gulp was installed because I can't find it in the path C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Web\External\node_modules.
Because of this I can't really set up CruiseControl.NET.

A: The way I'm handling this is to first use the Web Essentials 2017 extension. This installs the Bundler & Minifier tool, which then adds a bundleconfig.json file to your project. Right-click on this file, go to the Bundler & Minifier menu item and you will see an option in there to Convert To Gulp.
Selecting convert to gulp will create the necessary gulpfile.js and also install the npm packages required for using Gulp. Wait for all of the npm packages to install and you can then right click on gulpfile.js, select Task Runner Explorer and you should be ready to set up Gulp-based tasks. If you see gulpfile.js failed to load message, npm packages may still be installing (check the progress bar on the VS 2017 status bar). Hit the Refresh icon in Task Runner Explorer when all packages are installed and the error should vanish.
There's probably a more manual way to add Gulp support but I find this more automated method ensures all the tooling is wired up to work properly and I don't miss anything.
I gleaned all this information from the awesome Microsoft Docs site, specifically this page on Bundling & Minification. There's also a Using Gulp section in there that may provide additional details for your situation.
https://learn.microsoft.com/en-us/aspnet/core/client-side/bundling-and-minification

A: Microsoft have now added documentation on how to get gulp running:
https://learn.microsoft.com/en-us/aspnet/core/client-side/using-gulp
Make sure you update Visual Studio 2017 to the latest version as it now comes shipped with Node.js, NPM and Gulp (you don't need to pick "Node.js support" when installing Visual Studio for this to work).
Create an npm Configuration File (package.json) in your project folder and edit it to reference gulp:
{
  "version": "1.0.0",
  "name": "example",
  "private": true,
  "devDependencies": {
    "gulp": "3.9.1"
  },
  "scripts": {
    "gulp": "gulp"
  }
}

In the project folder, create a Gulp Configuration File (gulpfile.js) to define the automated process.
Add the following to the post-build event command line for each project requiring gulp support:
cd $(ProjectDir)
call dotnet restore
npm run gulp

To run the tasks in Visual Studio 2017, open the Task Runner Explorer (View > Other Windows > Task Runner Explorer).
Then on the build server just install Node.js and ensure the path to node is added to the environmental path variable then when the build server builds the project gulp will run too!

A: I found the solution here. More information on that part of VS from Mads himself.
You have to force Visual Studio run with your Node.js version:
Go to Tools > Options in Visual Studio 2017
Go to Projects and Solutions > External Web Tools
Add the following path: C:\Program Files\nodejs