text:
Q: Error, Eval unbound variable python GIMP, I know its a simple mistake, Any help is much appreciated Getting an Unbound variable while trying this script from the Windows command prompt
Works perfect from the GIMP Menu, but not from command
SET gimpEXE="C:\Program Files\GIMP 2\bin\gimp-2.8.exe"

for %i in ("C:\Users\abeta4\Desktop\ImgTest\*.jpg") do %gimpEXE% -i -b "(python-fu-resize %i TRUE)" -b "(gimp-quit 0)"

Then the script
    #!/usr/bin/python
from gimpfu import *

def plugin_main(timg, tdrawable, savecopy=TRUE):

    newWidth = 768
    newHeight = 1080
    timgsx = "sx"

    pdb.gimp_image_scale(timg, newWidth, newHeight)

    if savecopy:
        pdb.file_png_save2(timg, tdrawable, "C:\\Users\\abeta4\\Downloads\\%s%s.png" % (timgsx, timg.name), timg.name+".jpg", 1,9,1,1,1,1,1,0,1)

register(
    "python_fu_resize",
    "Saves the image at a maximum width and height",
    "Saves the image at a maximum width and height",
    "xxx",
    "xxx",
    "2017",
    "<Image>/Image/Resize For Screens, Now Even Easier :)...",
    "*",
    [
        (PF_BOOL, "copy", "Make a PNG copy", TRUE),

    ],
    [],
    plugin_main)

main()

Python beginner here, so sorry for noob mistakes in script.

A: The way your plugin is defined, it takes an image, a drawable, and a parameter. But

*

*when you call it, you only give an image name and a parameter

*the python code in your plugin_main expects timg to be a gimp.Image object, not just a file name. So something would have to load the image first.

*the registration code only declares the parameter, and omits the image and drawable.
In practice your python script doesn't even need to be declared as a plugin.
See this similar question on StackOverflow for some sample code and explanations and this other one for some more explanations.


text:
Q: Auto import dependecies from my library I created an android library that acts as a wrapper. I use some dependencies in the library notably Volley and Google Play Services. When I try to paste the .aar file in the project and compile it these libraries are not being imported and they throw an error. When I manually add these dependencies in the build.gradle of the new project then they work fine.
Is there way so that whenever my library is added it will auto import all the required dependencies?

A: just a friendly warning: including dependencies is considered a very bad practice at SHOULD BE AVOIDED.
However, if you do still want to do that, I suggest using the "download library from Maven" feature in Android Studio as described here.
This will make sure the library and all of its dependencies are downloaded.

redpajama_set_name: RedPajamaStackExchange


text:
Q: removing white spaces at beginning and end of string I've got a problem with removing whitespaces at the beginning and end of string. For e.g. I've got a string like:

\r\n\t- Someone will come here?\n- I don't know for sure...\r\n\r\n

And I need to remove whitespaces only at the end and beginning (string should be look like:

- Someone will come here?\n- I don't know for sure...

Also there could be a lot of variants of string end: "\r\n\r\n", "\r\n", "\n\r\n" and so on...
Thanks.

A: String trimming first and last whitespaces and newlines in Swift 4+
"  2 space  ".trimmingCharacters(in: .whitespacesAndNewlines)

result:
"2 space"

A: //here i have used regular expression and replaced white spaces at the start and end
      let stringPassing : NSString? = "hdfjkhsdj hfjksdhf sdf "
      do {
        print("old->\(stringPassing)")
        let pattern : String = "(^\\s+)|(\\s+)$"
        let regex = try NSRegularExpression(pattern: pattern , options: [])
        let newMatched = regex.matchesInString(stringPassing! as String, options: [], range: NSMakeRange(0,stringPassing!.length))
        if(newMatched.count > 0){

          let modifiedString = regex.stringByReplacingMatchesInString(stringPassing! as String, options: [] , range: NSMakeRange(0,stringPassing!.length), withTemplate: "")
              print("new->\(modifiedString)")
        }

    } catch let error as NSError {
        print(error.localizedDescription)
    }

A: Your string contains not only whitespace but also new line characters.
Use stringByTrimmingCharactersInSet with whitespaceAndNewlineCharacterSet.
let string = "\r\n\t- Someone will come here?\n- I don't know for sure...\r\n\r\n"
let trimmedString = string.stringByTrimmingCharactersInSet(NSCharacterSet.whitespaceAndNewlineCharacterSet())

In Swift 3 it's more cleaned up:
let trimmedString = string.trimmingCharacters(in: .whitespacesAndNewlines)

A: You can use this extension and just call "yourString".trim()
extension String
{
    func trim() -> String
    {
        return self.stringByTrimmingCharactersInSet(NSCharacterSet.whitespaceAndNewlineCharacterSet())
    }
}

A: If you want to remove Whitespace from the start of the string Try this Code.
func removeSpace()->String{
    let txt = myString
    var count:Int! = 0
    for i in txt{
        if i  == " "{
            count += 1
        }else{
            if count != 0{
                return String(txt.dropFirst(count))
            }else{
                return txt
            }
        }
    }
    return ""
}

`

A: Remove all whiteSpaces from the start of string
func removeWhiteSpaces(str:String) -> String{
    var newStr = str
    for i in 0..<str.count{
        let index = str.index(str.startIndex, offsetBy: i)
        print(str[index])
        if str[index] != " "{
            return newStr
        }
        else{
            newStr.remove(at: newStr.startIndex)
        }
    }
    return newStr
}

A: You could first remove from the beginning and then from the end like so:
while true {
if sentence.characters.first == "\r\n" || sentence.characters.first == "\n" {
    sentence.removeAtIndex(sentence.startIndex)
} else {
    break
}
}

while true {
if sentence.characters.last == "\r\n" || sentence.characters.last == "\n" {
    sentence.removeAtIndex(sentence.endIndex.predecessor())
} else {
    break
}
}

A: let string = "    exam ple  "
let trimmed = string.replacingOccurrences(of: "(^\s+)|(\s+)$", with: "", options: .regularExpression)
print(">" + trimmed3 + "<")
// prints >exam ple<

A: In this code to restrict Textfield beginning white space
func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool {
        if (textField.text?.count)! == 0 && string == " " {
            return false
        }
        else{
            return true
        }
    }

A: In Swift 4
Use it on any String type variable.
extension String {
    func trimWhiteSpaces() -> String {
        let whiteSpaceSet = NSCharacterSet.whitespaces
        return self.trimmingCharacters(in: whiteSpaceSet)
    }
}

And Call it like this
yourString.trimWhiteSpaces()


text:
Q: xmlHttp.responseText comes empty xmlHttp.responseText comes empty, what is the problem and solution?
default.aspx :
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="xmlHttpOrnek._Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<script type="text/javascript">
var xmlHttp;
function GetXmlHttpObject() {
    var xmlHttp = null;
    try {
        // Firefox, Opera 8.0+, Safari
        xmlHttp = new XMLHttpRequest();
    }
    catch (e) {
        // Internet Explorer
        try {
            xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
        }
        catch (e) {
            xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
        }
    }
    return xmlHttp;
}
//--------------------------
function callAjaxFunc(val) {
        xmlHttp = GetXmlHttpObject();
        if (xmlHttp == null) {
            alert("Browser does not support HTTP Request");
            return;
        }

        //you can provide your page URL
        var url = "Default.aspx";
        url = url + "?kod=" + val;

        //state change event-this will occur ass soon as response comes from the url
        xmlHttp.onreadystatechange = stateChanged;
        xmlHttp.open("GET", url, true);
        xmlHttp.send(null);
}

function stateChanged() {

    if (xmlHttp.readyState == 4)
    { //Display contents
        var xmlResponse = xmlHttp.responseText;

        if (xmlResponse != '') {
            var inputMessage = document.getElementById('txb');
            inputMessage.value = xmlResponse.toString();
            alert(xmlResponse);
        }
    }
}
</script>
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
        <asp:textbox ID="txb" runat="server"></asp:textbox>
        <asp:Button ID="btn" runat="server" Text="bas" OnClientClick="callAjaxFunc('y')" />
    </form>
</body>
</html>

default.aspx.cs:
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

namespace xmlHttpOrnek
{
    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string d = Request.QueryString["kod"];

            if (Request.QueryString["kod"] == "y")
            {
                Response.Write("Başarılı!");
                Response.End();
            }
        }
    }
}

A: I created another project with copy paste of this one; everything is same, but the second one worked. I'm surprised.


text:
Q: How do I sort dictionary keys by value? If I have a Dictionary and a lambda I can use to order the values, how do I get a list or array of the keys sorted by the corresponding value in the dictionary?
For instance, what if I want to sort a Dictionary<String,int> in descending order by the value:
using System.Collections.Generic;
using System;

namespace Program
{

    class Program
    {
        public static void Main()
        {
            let dict = scope Dictionary<String,int>();
            dict.Add("This should be second", 10);
            dict.Add("This should be first", 20);
            dict.Add("This should be fourth", 2);
            dict.Add("This should be third", 7);

            function int(int lhs, int rhs) descendingLambda = (lhs, rhs) => rhs <=> lhs;

            List<String> listOfKeys;

            // sort the keys by value into listOfKeys

            for (let s in listOfKeys)
            {
                Console.WriteLine(s);
            }
        }
    }
}

A: Create the List of keys using the List(IEnumerator<T>) constructor, then use Sort, wrapping the value orderer in another lambda that accesses the dictionary:
using System.Collections.Generic;
using System;

namespace Program
{

    class Program
    {
        public static void Main()
        {
            let dict = scope Dictionary<String,int>();
            dict.Add("This should be second", 10);
            dict.Add("This should be first", 20);
            dict.Add("This should be fourth", 2);
            dict.Add("This should be third", 7);

            function int(int lhs, int rhs) descendingLambda = (lhs, rhs) => rhs <=> lhs;

            let listOfKeys = scope List<String>(dict.Keys);

            listOfKeys.Sort(scope (lhs, rhs) => descendingLambda(dict[lhs], dict[rhs]));

            for (let s in listOfKeys)
            {
                Console.WriteLine(s);
            }
        }
    }
}


text:
Q: Finding kurtosis of signal I have a signal (Y) with 200000 samples. I plotted probability density function (PDF) of the signal and the Gaussian distribution that has the same values of Mean and Standard deviation of original signal. The kurtosis of signal (Y) is 3.12. Looking to the signal shows that Normal distribution using same values of Mean and Standard deviation has higher peak than signal (Y). Can I say this signal has Leptokurtic distribution because it has of 3.12 grater than 3? If yes why PDF plotting shows higher peak for the normal distribution?
I used to find kurtosis
k = kurtosis(Y)

For Normal distribution
Gaussian=(1/sqrt(2*pi*var(Y)))*exp(-(U-mean(Y)).^2/(2*var(Y)));

Should any signal that has kurtosis > 3 will have Leptokurtic distribution

A: It's better to avoid outdated terminology like "leptokurtic distribution". Why is kurtosis of this distribution important to you? Your plot seems quite close to a normal density ... but we don't know your ultimate goal, so cannot judge what is important for you. Look in this few posts about kurtosis to see if you are really interested: Should we teach kurtosis in an applied statistics course? If so, how?,  what is the meaning of 'tail' of kurtosis?  and  How is the kurtosis of a distribution related to the geometry of the density function?
If you want a test of normality you could look into Is normality testing 'essentially useless'?
For testing kurtosis, I would try bootstrapping (with 20000 observations that could work well). A visual version of that is a Cullen and Frey graph, for an example see Is my data gamma distributed?, which can include on the plot bootstrapped values of kurtosis, and can be very informative.

A: Higher kurtosis does not imply a higher peak, as was noted in 1945. But people have ignored this fact for decades and decades, writing in books, articles, and web pages that higher kurtosis means a higher peak. They still make this mistake.
"Peakedness" in general is also incorrect as a descriptor of kurtosis.
With regard to the OP, the differences in kurtosis are so small as to hardly warrant a mention.
References:
Kaplansky, I. (1945), "A Common Error Concerning Kurtosis," Journal of the American Statistical Association, 40, 259. But the "height" misinterpretation also seems to persist.
Westfall, P.H. (2014).  "Kurtosis as Peakedness, 1905 – 2014. R.I.P." The American Statistician, 68, 191–195.


text:
Q: CoreData FetchRequest Increases Compile Time from 3 Seconds to 115 Seconds (Swift 5 with Xcode 14.0 for iOS 16.0). [Edit: Too Many sortDescriptors.] I'm new to iOS development.  If I include the lines
@Environment(\.managedObjectContext) var moc
@FetchRequest(sortDescriptors: [SortDescriptor(\.topic), SortDescriptor(\.id), SortDescriptor(\.tag)]) var facts: FetchedResults<Fact>

then the compile time is 115 seconds, but it is only 3 seconds if I comment them out.  If I include only
@Environment(\.managedObjectContext) var moc

it is 10 seconds.  (I've included images of "build with timing summary" below.)  Any suggestions to improve this?

A: I figured it out.  I had too many sortDescriptors.    I changed
@FetchRequest(sortDescriptors: [SortDescriptor(\.topic), SortDescriptor(\.id), SortDescriptor(\.tag)]) var facts: FetchedResults<Fact>

to
@FetchRequest(sortDescriptors: [SortDescriptor(\.topic), SortDescriptor(\.id)]) var facts: FetchedResults<Fact>

and compile now takes 8 seconds.


text:
Q: How to access UEFI on Sony Vaio if "Operating System Not Found" The hard disk in my old Sony Vaio laptop died and I'm trying to reinstall Windows 10 Pro on an SSD that I bought to replace the dead HDD. I found an official ISO download page, but the problem is the laptop goes straight to the "Operating System Not Found" black screen as soon as I turn it on, even if I have a bootable CD or USB inserted, and I cannot press F2 or any other key to access the UEFI.
Am I royally screwed, or is there a way to salvage this situation? I'm thinking about putting the ISO directly onto the SSD (after formatting it as a bootable drive), connecting the SSD to the laptop, and crossing my fingers. Let's say it boots into Windows 10 setup -- with my old HDD dead, would it still be able to retrieve my license somewhere and activate (it was upgraded from Windows 8 Pro)?

A: Sony VAIO laptops have the ASSIST button that should be pressed whilst the computer is powered off (i.e. press and hold the power button until the computer forcibly turns off or shutdown Windows if you can get to Windows).
This should allow the computer to boot and may give you the ability to enter the BIOS/UEFI interface.


text:
Q: Stop NSXMLParser Instance from Causing _NSAutoreleaseNoPool In my iPhone application, I have an instance of NSXMLParser that is set to a custom delegate to read the XML.  This is then moved into its own thread so it can update the data in the background.  However, ever since I have done this, it has been giving me a lot of _NSAutoreleaseNoPool warnings in the console.  I have tried to add a NSAutoreleasePool to each of my delegate classes, however, this hasn't seemed to solve the problem.  I have included my method of creating the NSXMLParser in case that is at fault.
NSURL *url = [[NSURL alloc] initWithString:@"http://www.mywebsite.com/xmlsource.xml"];
NSXMLParser *xmlParser = [[NSXMLParser alloc] initWithContentsOfURL:url];

CustomXMLParser *parser = [[CustomXMLParser alloc] init];

parser.managedObjectContext = self.managedObjectContext;

parser = [parser initXMLParser];

[xmlParser setDelegate:parser];

[NSThread detachNewThreadSelector:@selector(parse) toTarget:xmlParser withObject:nil];

If anyone has any ideas to get rid of this problem, I would really appreciate it.
Thanks.

A: In objective-c each thread needs its own NSAutorelease pool to handle autoreleased objects. So in your parse method you need to create (and release) NSAutoreleasePool object:
- (void)parse{
   NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
   ...
   // your method implementation
   ...
   [pool release];
}


text:
Q: SSL_accept returns SSL_ERROR_SSL I have a strange error working with openssl in c++ with non blocking sockets.
SSL_accept return SSL_ERROR_SSL.
error string is

"error:140760FC:SSL routines:SSL23_GET_CLIENT_HELLO:unknown protocol"

as obtained from
ERR_error_string(ERR_get_error(), NULL);

ssldump:
New TCP connection #1: localhost(35677) <-> localhost(8084)
1 1  1443513828.4788 (0.0001)  C>SV3.1(153)  Handshake
      ClientHello
        Version 3.3
        random[32]=
          e9 fc d9 2b 25 20 77 9f 5f a4 b1 eb 5d 50 15 f2
          38 7a a9 86 16 49 f8 a3 e9 00 7f 93 11 cd 7b b1
        cipher suites
        Unknown value 0xc02b
        Unknown value 0xc02f
        Unknown value 0xc00a
        Unknown value 0xc009
        Unknown value 0xc013
        Unknown value 0xc014
        Unknown value 0xc012
        Unknown value 0xc007
        Unknown value 0xc011
        TLS_DHE_RSA_WITH_AES_128_CBC_SHA
        TLS_DHE_DSS_WITH_AES_128_CBC_SHA
        Unknown value 0x45
        TLS_DHE_RSA_WITH_AES_256_CBC_SHA
        TLS_DHE_DSS_WITH_AES_256_CBC_SHA
        Unknown value 0x88
        TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA
        TLS_RSA_WITH_AES_128_CBC_SHA
        Unknown value 0x41
        TLS_RSA_WITH_AES_256_CBC_SHA
        Unknown value 0x84
        TLS_RSA_WITH_3DES_EDE_CBC_SHA
        TLS_RSA_WITH_RC4_128_SHA
        TLS_RSA_WITH_RC4_128_MD5
        compression methods
                  NULL
1 2  1443513828.4790 (0.0002)  S>CV3.3(53)  Handshake
      ServerHello
        Version 3.3
        random[32]=
          aa d6 10 d1 eb b5 de b1 ed f8 6b 2f 44 fa 9f 57
          14 1d c0 27 a1 e9 24 3a 20 cb 09 fa 75 33 1c c7
        session_id[0]=
        cipherSuite         TLS_RSA_WITH_AES_128_CBC_SHA
        compressionMethod                   NULL
1 3  1443513828.4790 (0.0000)  S>CV3.3(1003)  Handshake
      Certificate
        certificate[993]=
          30 82 03 dd 30 82 02 c5 a0 03 02 01 02 02 09 00
          bc 6b da c1 c3 f0 3f 14 30 0d 06 09 2a 86 48 86
          f7 0d 01 01 0b 05 00 30 81 84 31 0b 30 09 06 03
          55 04 06 13 02 49 4e 31 0b 30 09 06 03 55 04 08
          0c 02 49 4e 31 10 30 0e 06 03 55 04 07 0c 07 67
          75 72 67 61 6f 6e 31 0e 30 0c 06 03 55 04 0a 0c
          05 69 72 65 78 78 31 0c 30 0a 06 03 55 04 0b 0c
          03 64 65 76 31 12 30 10 06 03 55 04 03 0c 09 6c
          6f 63 61 6c 68 6f 73 74 31 24 30 22 06 09 2a 86
          48 86 f7 0d 01 09 01 16 15 76 69 6b 61 73 73 6f
          6f 64 31 31 40 67 6d 61 69 6c 2e 63 6f 6d 30 1e
          17 0d 31 35 30 39 32 39 30 38 30 32 35 36 5a 17
          0d 31 36 30 39 32 38 30 38 30 32 35 36 5a 30 81
          84 31 0b 30 09 06 03 55 04 06 13 02 49 4e 31 0b
          30 09 06 03 55 04 08 0c 02 49 4e 31 10 30 0e 06
          03 55 04 07 0c 07 67 75 72 67 61 6f 6e 31 0e 30
          0c 06 03 55 04 0a 0c 05 69 72 65 78 78 31 0c 30
          0a 06 03 55 04 0b 0c 03 64 65 76 31 12 30 10 06
          03 55 04 03 0c 09 6c 6f 63 61 6c 68 6f 73 74 31
          24 30 22 06 09 2a 86 48 86 f7 0d 01 09 01 16 15
          76 69 6b 61 73 73 6f 6f 64 31 31 40 67 6d 61 69
          6c 2e 63 6f 6d 30 82 01 22 30 0d 06 09 2a 86 48
          86 f7 0d 01 01 01 05 00 03 82 01 0f 00 30 82 01
          0a 02 82 01 01 00 e2 9e cb 0c 9a c2 a4 0a ff 81
          77 23 ad 74 c6 a0 12 9f f4 a4 86 94 bf 02 57 cc
          ff 13 cf 4f 13 83 6e 70 8b 2d ee 92 93 94 44 d4
          db 20 e1 67 65 3a 67 c1 d5 91 67 ab f9 98 aa 59
          16 b4 38 99 92 66 c2 de e7 88 82 cd a0 10 95 89
          78 f5 64 6a e5 b6 75 a2 e0 d0 76 c3 57 92 03 c7
          d3 7d f3 c5 18 e5 bf 8d f5 71 17 4c dd 18 fa 11
          8c d1 ed 8b 0f b6 5c fb 16 bf 5a 44 23 71 c8 83
          83 5a 4d ca b0 8c 15 96 66 dc cd 9a 06 33 b3 eb
          71 43 25 b1 0f df 1a c6 f1 7a 4c 4d 5e 34 12 b7
          70 76 b6 f9 7e 40 6c 2e 70 df 26 cd f9 c9 0b 90
          57 dd 0b c3 57 b8 55 ad 63 13 16 15 bf 8d 3b 48
          9d 11 cf 15 55 a1 f2 ab ff 8f 43 48 09 e7 c9 b0
          21 66 e7 e4 76 14 aa d4 a9 88 ef bf e1 db 0f b3
          27 95 d0 c9 50 6f 36 c8 5e 47 3f c3 a8 59 9c a6
          8a 75 57 0b db 83 c6 08 13 fa 9c 64 3c 5a 4e d5
          ba 4f 23 39 67 77 02 03 01 00 01 a3 50 30 4e 30
          1d 06 03 55 1d 0e 04 16 04 14 29 86 80 ff 9c 14
          00 5e 2e 89 81 4a 1e 3c 32 82 ec 44 35 7b 30 1f
          06 03 55 1d 23 04 18 30 16 80 14 29 86 80 ff 9c
          14 00 5e 2e 89 81 4a 1e 3c 32 82 ec 44 35 7b 30
          0c 06 03 55 1d 13 04 05 30 03 01 01 ff 30 0d 06
          09 2a 86 48 86 f7 0d 01 01 0b 05 00 03 82 01 01
          00 c9 f4 f7 0f bd a4 f2 81 e4 4e c5 4d 86 9d f3
          30 fe df f6 b1 b5 a3 a6 ef 41 51 fc f3 1b c5 be
          e1 1f 75 fe f1 ee 94 95 54 c7 07 13 d4 b6 89 2b
          a3 86 e3 7b 12 6d 0a 51 66 31 74 d5 83 67 92 79
          45 b3 03 1d 77 6b b0 71 a0 07 c0 06 e6 6b 81 74
          01 8e 6d a6 c1 82 8b 34 b2 6c 52 b9 3e a6 c0 c5
          ce f6 c8 b2 4b 6a 8c 43 4a 20 38 61 8a 09 1f 39
          cd e6 4a 0b 6c 89 b8 88 74 d7 1e fa 86 dc 0a cd
          d4 73 39 5f 53 4b 13 79 f8 cd 62 ee 38 42 61 56
          26 31 44 ac 5b 39 24 2b 3f f9 21 b4 59 25 14 95
          69 e6 33 41 df ef b5 ea 20 7d 38 a9 f4 c3 d1 f7
          c5 37 4a c9 01 cd f4 3a e7 3c a7 16 33 0f 5d 46
          19 bc 50 3d 33 05 63 ee 29 51 d1 79 c4 01 04 0f
          be 27 65 57 ab e5 e8 d3 bf 4d 11 55 bc 52 e4 9f
          d9 0c 87 be a9 62 9d be 65 21 a8 8a 46 63 d1 91
          f9 2b e1 c6 5d 33 fb ae b6 9e a0 36 0b 37 2a fa
          3b
1 4  1443513828.4790 (0.0000)  S>CV3.3(4)  Handshake
      ServerHelloDone
1 5  1443513828.4800 (0.0009)  C>SV3.3(262)  Handshake
      ClientKeyExchange
        EncryptedPreMasterSecret[256]=
          76 58 13 c2 dd ed fb 6e 7b 49 aa 0c 26 40 a1 1f
          8b 87 b0 f6 a5 f8 24 fe 0c 7b a9 e6 b0 51 b1 92
          2c 52 33 ba af 2a d2 52 b8 80 0f ea fd 24 b7 89
          15 2f 0e 90 86 ef 9c 9d 52 02 ca 56 09 b5 81 5f
          e1 05 a8 9a 44 32 7f 4f ec 58 33 4a 97 96 23 15
          7d a8 1d 8c bc 5d 20 13 39 54 2f 61 27 be aa 6a
          ec 49 be 82 cc 2b c7 3d a3 b0 cb 4f 26 cb 14 41
          d4 4b 00 57 6f 52 2b 66 aa 23 97 ed e9 e7 9c d9
          ed 81 28 0c 08 9f dd 9d e4 00 b5 ba aa a4 f6 3b
          23 87 f6 da 64 c0 1e 33 87 bb ef bc c3 fe 28 64
          d1 c8 ff ae f9 3f 5a fe 38 e6 ab 3e 34 2c b5 96
          f7 a8 99 b6 8e b3 46 d3 c9 f8 f8 94 26 97 27 85
          5f 3e ff 85 15 5f c8 1f 10 53 26 e4 88 32 4f 48
          62 87 ac a8 9f 14 f1 e3 f4 c4 1a 71 49 e6 33 15
          16 66 66 ec 68 ee f7 91 0c 4c b3 3a 49 88 e1 31
          a5 fe 4c 31 35 3d dc 01 f6 be f2 e5 65 a0 bb 78
1 6  1443513828.4800 (0.0000)  C>SV3.3(1)  ChangeCipherSpec
1 7  1443513828.4800 (0.0000)  C>SV3.3(64)  Handshake
Unknown SSL content type 72
1    1443513828.4801 (0.0001)  S>C  TCP RST

I am not sure why the server resets the connection.
I am using a self signed certificate to test a websocket connection using scheme wss. Client is Mozilla Firefox and websocket server is what I am trying to implement.
Any pointers on why the server is resetting the connection?
error:140760FC:SSL routines:SSL23_GET_CLIENT_HELLO:unknown protocol
What possible reason could throw unknown protocol?
Thanks
Edited: Adding code. It is not all the code but gives a fair idea of what i did.
Here is how my code looks like:
/*
    this the main method that accepts incoming connection on a listening socket.
*/
SecureServer::Accept()
{
    int ret = 0;
    while(!mFinished) {
    ret = epoll_wait(millis);

    if(ret == -1) {
        continue;
    }

    else if(ret == 0) {
        idle(0);
    }

    else if(ret > 0) {
        //some events are triggered
        for(int i=0; i<ret; i++) {

        //getEvent method is in the base class.
        //SecureServer is derived from this class.
        //Base class is just an epoll wrapper
        epoll_event* ev = getEvent(i);

        //check for error
        if( (ev->events & EPOLLERR) || (ev->events & EPOLLHUP) || !(ev->events & EPOLLIN)) {
            ERROR(Log::eSecureServer, "Error occured on fd = %d", ev->data.fd);
            removeEpollFd(ev->data.fd);
            continue;
        }

        //check if its a new incoming connection on server socket
        else if(ev->data.fd == mServerSocket) {
            //accept the connection
                    struct sockaddr peerAddress;
                    socklen_t socklen = sizeof(peerAddress);

                    int newSocket = accept(mSocket, &peerAddress, &socklen);
                    if(newSocket == -1) {
                        ERROR(Log::eSecureServer, "Error in accept, listen address = %s, port = %d epoll_wait returned = %d", mHost.c_str(), mPort, ret);
                        continue;
                    }

                    rxUShort port = ntohs(*((rxUShort*) &(peerAddress.sa_data[0])));

                    char ipPort[32] = {0};

                    sprintf(ipPort, "%hhu.%hhu.%hhu.%hhu:%hu", peerAddress.sa_data[2],peerAddress.sa_data[3],peerAddress.sa_data[4],
                            peerAddress.sa_data[5],port);

                    INFO(Log::eSecureServer, "SecureTCPServer received incoming client connection from = %s", ipPort);

            //add epoll fd
            // This method also makes the socket NON BLOCKING
                    addEpollFd(newSocket);
        }

        //check the handshake from a previously accepted connection
        else {
            //process the handshake
            processHandshake(ev->data.fd);
        }
        }
    }
    }
}

/*
    This method determines the client and server protocol
*/
int Protocol::processHandshake(int fd)
{
    int length = 0;

    length = recv(fd, handshake, 1024, MSG_PEEK);
    if(length == 0) {
    return UNKNOWN_PROTOCOL;
    }

    else if((bcmp(handshake, "\x16", 1) == 0) ||
               (bcmp(handshake, "\x80", 1) == 0)) {

    //secure connection requested on this fd
    SSL* pSSL = 0;
    int ret = NewSSLSocket(pSSL, fd);
    if(SSL_ERROR_NON == ret) {
        ///success
    }

    else {
            if(SSL_ERROR_WANT_READ == ret || SSL_ERROR_WANT_WRITE == ret) {
            NFO(Log::eProtocol, "Handshake error, in progress.");
            return eProtocolHandshakeInProgress;
            } else if(SSL_ERROR_SSL == ret) {
            INFO(Log::eProtocol, "Handshake error, library error");
            return eProtocolInvalidHeader;
            } else if(SSL_ERROR_SYSCALL == ret) {
            INFO(Log::eProtocol, "Handshake error, possibly syscall error");
            return eProtocolInvalidHeader;
            }
            SSL_free(pSSL);
    }
    }
}

int Protocol::NewSSLSocket(SSL* pSSL, rxUInt fd)
{
    pSSL = SSL_new(mSSLContext);
    SSL_set_fd(pSSL, fd);

    int ret = SSL_accept(pSSL);
    switch(SSL_get_error(pSSL, ret)) {
        case SSL_ERROR_WANT_READ:
        case SSL_ERROR_WANT_WRITE:
        {
            INFO(Log::eNetwork, "SSL Handshake is in progress on fd = %d %s", fd, ERR_error_string(ERR_get_error(), NULL));
            return SSL_ERROR_WANT_READ;
        }
        break;
        case SSL_ERROR_SYSCALL:
        {
            INFO(Log::eNetwork, "SSL syscall error during handshake on fd = %d %s", fd, ERR_error_string(ERR_get_error(), NULL));
            return SSL_ERROR_SYSCALL;
        }
        break;
        case SSL_ERROR_SSL:
        {
            INFO(Log::eNetwork, "SSL library error during handshake on fd = %d %s", fd, ERR_error_string(ERR_get_error(), NULL));
            return SSL_ERROR_SSL;
        }
        case SSL_ERROR_NONE:
        {
            INFO(Log::eNetwork, "SSL handshake on fd = %d complete", fd);
            return SSL_ERROR_NONE;
        }
        break;
        default:
        {
            INFO(Log::eNetwork, "SSL unknown error during handshake on fd = %d %s", fd, ERR_error_string(ERR_get_error(), NULL));
            return -1;
        }
        break;
    }
    return -1;
}

//Protocol Constructor Init the SSL Context
Protocol::Protocol()
{
    const SSL_METHOD* pSSLMethod = SSLv23_server_method();
    char err[1024] = {0};

    mSSLContext = SSL_CTX_new(pSSLMethod);
    if(mSSLContext == NULL) {
        ERROR(Log::eNetwork, "Failed to initialize SLS_CTX. TLS Unavaliable.");
        ERROR(Log::eNetwork, ERR_error_string(ERR_get_error(), err));
    } else
        INFO(Log::eNetwork, "Initialized SSL Context.");

    SSL_CTX_set_cipher_list(mSSLContext, "ALL");

    //Load the SSL Certificates
    rxUInt ret = 0;
    ret = SSL_CTX_use_certificate_file(mSSLContext, mCACertificateFile.c_str(), SSL_FILETYPE_PEM);
    if(ret <=0 ) {
        ERROR(Log::eNetwork, "Failed to read ssl sertificate. We should exit.");
        ERROR(Log::eNetwork, ERR_error_string(ERR_get_error(), err));
    } else
        INFO(Log::eNetwork, "SSL Certificate read complete. OK!");

    //Load the private key file
    ret = SSL_CTX_use_PrivateKey_file(mSSLContext, mPrivateKeyFile.c_str(), SSL_FILETYPE_PEM);
    if(ret <=0 ) {
        ERROR(Log::eNetwork, "Failed to read private key file. We should exit.");
        ERROR(Log::eNetwork, ERR_error_string(ERR_get_error(), err));
    } else
        INFO(Log::eNetwork, "Private Key read complete. OK!");

    if(!SSL_CTX_check_private_key(mSSLContext)) {
        ERROR(Log::eNetwork, "Private key does not match the SSL Certificate. We should exit.");
        ERROR(Log::eNetwork, ERR_error_string(ERR_get_error(), err));
    } else
        INFO(Log::eNetwork, "Private Key and SSL Certificate Matched. OK!");
}

A:
1 7  1443513828.4800 (0.0000)  C>SV3.3(64)  Handshake
  Unknown SSL content type 72

My guess is that you are sending some plain data on the connection, i.e. write to the plain socket instead to the SSL socket. This is just a guess because you did not provide any code but looking for such error one finds issues like this.


text:
Q: Is there a best practice way for calling methods of controller class in handle method of a listener? I am developing a small game and was wondering about a best practice for handle methods in (anonymous) listeners. Although I am developing with libGDX in particular, my question is about java programming standards in general.
Suppose I have a controller controlling screen classes containing a stage each. These stages build up the gui including buttons and so on. I'm adding click listeners as anonymous classes for the buttons in the stage. As I want to call methods of the screen or even the controller class in the handle method I am passing down a reference to them from controller to screen to stage to listener. This passing down the reference appears to me as not being good practice.
Alternatively I could get the buttons in screen class and add the listeners there. I would need to add get-methods for each button then though.
Could you think about any other cleaner way of implementing this?

A: I think towards the end of your question you are on the right path, but let's use some general (not even Java-specific) programming principles to understand why that's the right approach. Here are our principles:

*

*Separation of Concerns (SoC): Make sure your code does one thing and that one thing very well.

*Don't Repeat Yourself (DRY): Code everything once; minimize boilerplate code.

*Keep it Simple (KISS): It'll be easier to read, easier to maintain, and easier to test.

When I create a game screen in libGDX, I typically use the following structure:
Screen
|- Stage
|- ControllerReference
\- ModelReference

The screen has a private stage which only it uses to create the layout for that particular screen. I then inject a controller (used primarily for changing screens) and a model (dynamic game data) into the screen as demonstrated in the sample code below:
StageScreen.java
abstract class StageScreen implements Screen {
    protected Stage stage;
    protected Game controller;

    public StageScreen(Game controller) {
        this.controller = controller;
    }

    @Override
    public void render(float v) {
        stage.act(v);
        stage.draw();
    }

    @Override
    public void dispose() {
        stage.dispose();
    }
    // Snipped other methods like "hide" and "resize" which aren't relevant
}

MenuScreen.java
class MenuScreen extends StageScreen {
    private Array<Demo> demos;

    public MenuScreen(Game controller, Array<Demo> demos) {
        super(controller);
        this.demos = demos;
    }

    @Override
    public void show() {
        stage = new Stage(new ScreenViewport());
        Gdx.input.setInputProcessor(stage);

        VisTable table = new VisTable();
        table.setFillParent(true);

        for(final Demo demo : demos) {
            table.add(new VisTextButton(demo.getName(), new ChangeListener() {
                @Override
                public void changed(ChangeEvent changeEvent, Actor actor) {
                    controller.setScreen(demo);
                }
            }));
            table.row();
        }

        stage.addActor(table);
    }
}

So let's throw some rocks at the example:

*

*Does it separate concerns? Yes. All the screen does is render a button for each demo, and tell the controller the user's intent. All it knows is that Demos have names and that they count as screens. We could make our controller more abstract by passing it an event (i.e. "UserSelectsDemoX") instead of the screen we want to transition to, but I would argue that this would violate the KISS principle.

*Does it make us repeat ourselves? No. The code that is common to all screens (management of the Stage, keeping a reference to the folder) is in our abstract class, and our child class only contains code needed to make that Screen do something other screens don't.

*Is it simple? Yes. Notice that if you are familiar with basic libGDX classes (Game, Stage, Screen), you don't need any comments to understand what this code snippet does. We could make things more general (i.e. make a controller interface and a model interface that only reveal what our screen needs), but adding additional abstraction would just make the code harder to understand.

Hopefully this helps answer your question around the best way to link your listeners to your controller, as well as give you a way of thinking that you can apply to other parts of your codebase.


text:
Q: RabbitMQ messages are not recieved in order by the listener I have a scenario where the order of messages received at the receiving end is some times not in order.
My scenario:
MACHINE A:

*

*I am sending a series of messages(around 12 messages) from machine A to machine B over rabbitMQ shovel.

*The messages are are of different sizes. The over all size of 12 messages is close to 8mb.

*Once the 12 messages are sent, i am also sending "complete message" in the end to MACHINE B.
MACHINE B:

*

*This is the recieving machine. This machine has a single listener. It recieves all the messages sent by MACHINE A. Once it recieves "sending complete", its obvious that this is the last message from MACHINE A and MACHINE B starts processing all the messages that were recieved.
MACHINE B Configiration

    <rabbit:listener-container
        connection-factory="connectionFactory">
        <rabbit:listener ref="onMessageCommand"
            queue-names="CommandQueue" />
    </rabbit:listener-container>
    <bean id="onMessageCommand"
        class="com.mypackage.command.messaging.OnMessageListner">
        <property name="callBackObject" ref="callbackDisEvent" />
        <property name="template" ref="amqpTemplate" />
    </bean>

    <bean id="callbackDisEvent" class="com.mypackage.command.OperationSettingsListener"></bean>

MACHINE A CODE
public void sendMessage(String messageToSend,String machineBID)
{
    Message sendMessage = new Message(messageToSend, new MessageProperties());
    RabbitTemplate rabbitTemplate =
    messagingApplContext.getBean(RabbitTemplate.class);
    rabbitTemplate.send(message, machineBID + ".command");
}
ISSUE:
Some times i am observing that one "sending complete" is recived by the MACHINE B just before some setting. Ideally "sending complete" should always be the last message recived by the MACHINE B.
May i please know what can be the issue here.

A: Make sure you are using message acknowledgements. More info here https://www.rabbitmq.com/confirms.html

A:
Can you please provide some links for sample programs to implement scoped operations in the right manner. or a sample code will also suffice

The link I provided you has this example:
Collection<?> messages = getMessagesToSend();
Boolean result = this.template.invoke(t -> {
    messages.forEach(m -> t.convertAndSend(ROUTE, m));
    t.waitForConfirmsOrDie(10_000);
    return true;
});

You just have to make sure all the sends are performed within the scope of an invoke call...
Boolean result = this.template.invoke(t -> {
    ...
    t.send(...)
    ...
    t.send(...)
    ...
    return true;
}

And they will all go on the same channel. The return doesn't have to be boolean, it can be anything you want, even null.
this.template.invoke(t -> {
    ...
    t.send(...)
    ...
    t.send(...)
    ...
    return null;
}


text:
Q: CSS - HTML How to get the anchor image to a specific side I want all of the anchor images in different corners , eg , top left , top right , bottom right , bottom right , and one in the centre thank you
How do I make all my anchor links / images go to specific sides I want the teams one on top left I want store top right sponsors bottom left and about us bottom right I thought I did all the right code but they don't how up in those specific spots
If anyone can help it will be greatly appreciates
CSS

.icon1.jpg {
      position: absolute;
      top: 0px;
      left: 0px;
      height: auto;
      width: 50%;
    }
    .icon2.jpg {
      position: relative;
      top: 0px;
      right: 0px;
      height: auto;
      width: 50%;
    }
    .icon4.jpg {
      position: relative;
      left: 0px;
      height: auto;
      width: 50%;
    }
    .icon3.jpg {
      position: relative;
      right: 0px;
      height: auto;
      width: 50%;
    }
    .DelUZens {
      display: block;
      margin-left: auto;
      margin-right: auto;
    }
    body {
      background: url("icon6.jpg") repeat;
    }
    #banner {
      position: absolute;
      top: 0px;
      left: 0px;
      right: 0px;
      width: 100%;
      height: 175px;
      z-index: -1;
    }

  <title>DelUZens</title>
  <link href="main.css" rel="stlesheet" type="text/css">

Thank you in advance.

A: I would NEVER personally layout a page this way, however it will fix your problem with the current layout, see fiddle https://jsfiddle.net/5pre17op/1/
Note: this .icon1.jpg is targeting a class called icon and jpg either of these classes do not exist in your page, however you do have classes named top left right and bottom, you need to target them like this:
.top {
  position: absolute;
  top: 0px;
  left: 0px;
  height: auto;
  width: 50%;
}

.right {
  position: absolute;
  top: 0px;
  right: 0px;
  height: auto;
  width: 50%;
}

.left {
  position: absolute;
  left: 0px;
  bottom: 0px;
  height: auto;
  width: 50%;
}

.bottom {
  position: absolute;
  right: 0px;
  bottom: 0px;
  height: auto;
  width: 50%;
}

A: try to refer to each image by using their class name but not src of image, e.g. for the first link:
CSS
 .top {
   position: absolute;
   top: 0px;
   left: 0px;
   height: auto;
   width: 50%;
 }

A: You must have relative wrapper and in this holder put anchors.

See enter link description here

A: .top {
  position: absolute;
  top: 0px;
  left: 0px;
  height: auto;
  width: 50%;
}
.right {
  position: absolute;
  top: 0px;
  right: 0px;
  height: auto;
  width: 50%;
}
.left {
  position: absolute;
  bottom:0px;
  left: 0px;
  height: auto;
  width: 50%;
}
.bottom {
  position: absolute;
  bottom:0px;
  right: 0px;
  height: auto;
  width: 50%;
}
.DelUZens {
  display: block;
  margin-left: auto;
  margin-right: auto;
}
body {
  background: url("icon6.jpg") repeat;
}
#banner {
  position: absolute;
  top: 0px;
  left: 0px;
  right: 0px;
  width: 100%;
  height: 175px;
  z-index: -1;
}

Use position absolute instead of relative.


text:
Q: Retrieve the status of a response from a query to MySQL with no match I am working on the login controller of my web app, especially if a user want to log without an existing mail in the DB. I can't reach the res.status in the frontend in order to handle this specific response.
My backend:
exports.signin = (req, res) => {
        const email = req.body.email;
        const password = req.body.password;
        //Recherche du compte associé au email pour vérifié le mdp
       db.query("SELECT password FROM users WHERE email = ?", email, (err, result) => {
           if(result.length === 0){
                    console.log(err)
                    res.status(401).json({err})
                } else {
                    console.log(result)
                    let encryptedPassword = result[0].password
                    console.log(encryptedPassword)
                    let verifyPassword = bcrypt.compareSync(password, encryptedPassword)
                    //Vérification du MDP
                    if (verifyPassword === true) {
                        //Requete SQL pour assigné un token en fonction de l'id qui correspond à l'utilisateur dans la BDD
                        db.query("SELECT id, prenom FROM users WHERE email = ?" , email, (err, result) => {
                            if(result){
                                let userID = result[0].id
                                let userPrenom = result[0].prenom
                                console.log(userID)
                                console.log('Le mot de passe correspond à celui renseigné dans la DB')
                                res.status(200).json({user_id: userID,
                                                    prenom:  userPrenom,
                                                    token: jwt.sign(
                                                        {user_id: userID},
                                                        'RANDOM_TOKEN_SECRET',
                                                        { expiresIn: '24h'})})
                            }
                        })}
                    else{
                        res.status(208).send({message: 'pbl'})
                        console.log('Le mot de passe ne correspond pas !')
                    }
                }
            }
        )
    }

I used to have if(err){console.log(err)} but my BACKEND kept crashing whenever I try an unknown email.
My frontend:
const login = () => {
    Axios.post('http://localhost:3001/auth/signin', {
      email: MailLog,
      password: userPasswordLog,
    })
    .then((response) => {
    //Récupérartion des informations user
    if (response.status === 200){
        console.log(response)
        setLoginStatus("Bonjour " + response.data.prenom + " !")}
    else if (response.status === 401) {
        console.log(response)
        setLoginStatus("Nous ne trouvons pas de compte associé à cette adresse mail")}
    else {
        console.log(response)
        setLoginStatus('Le mot de passe et l\'adresse mail ne correspondent pas !')}
    })
    }

What would be the best way to fix my problem? Thank you
NB: The status code is changing when I change it in my res.status yet I can't do anything with it


text:
Q: How to run a procedure immediately when 'view report' is clicked in ssrs? I have a ssrs report which has many tables. These tables fetch the data from database tables with the defined datasets. Now before my report fetches the data from the dataset, it is really important to run a procedure based on user input into my report parameter. How can I achieve this?
Note: As of now I wrote a EXEC PROC statement in one of my datasets. I am now clicking the 'View report' twice to see the expected results.

A: By default, SSRS processes all the datasets in parallel. There is an option called "Use single transaction when processing the queries" which makes it evaluate the datasets one at a time. So the first procedure has to finish before it will move on. This setting is in the Data Source properties. The datasets will be processed in the order you added them, so you may have to rearrange them to make your procedure be first.


text:
Q: pass value from html to javascript as array I write a code that gives value from database and saves them in a list and I put list into array and send it to ASP hiddenField.
I want to pass this data to JavaScript var as array. How can I do it?
I want to save values as string in array.
aspx:
<asp:HiddenField ID="hdnCity_BillMonth" runat="server" />
<asp:HiddenField ID="hdnCount_BillMount" runat="server" />

aspx.vb:
 hdnCity_BillMonth.Value = String.Join(",", City)
 hdnCount_BillMount.Value = String.Join(",", Value)

City and Value are List
 var City_BillMounth ;
 var Count_BillMounth;

A: Since you're joining city values with a "," symbol you can easily convert it into a java script array using split like this:

I assume you are getting your hdnCity_BillMonth values like "city1, city2,city3,...cityN"

 var City_BillMounth = [];
 City_BillMounth = hdnCity_BillMonth.split(",");
 console.log("city Array: "+ City_BillMounth );

do the same for the hdnCount_BillMount as well.


text:
Q: Not able to deploy PubSub function in firebase cloud functions I was trying to deploy a PubSub function:
exports.sendReminder
    = functions.pubsub.schedule('0 6 * * *').timeZone('Asia/Kolkata').onRun((context) => {
        console.log('Wake up! It\'s 6AM');
        return null;
    }
);

*

*Cloud schedular API was disabled before I tried to deploy the function for the first time.

*It got enabled automatically.

*PubSub is also enabled.

Expected behavior
Since Cloud Scheduler API and PubSub have enabled for the project. ideally, there should not be any error while deploying the function. The error does mention trying after a few minutes. But it's been 24 hrs since I enabled the PubSub and Cloud Scheduler API.
Actual behavior
> eslint .

+  functions: Finished running predeploy script.
i  functions: ensuring required API cloudfunctions.googleapis.com is enabled...
+  functions: required API cloudfunctions.googleapis.com is enabled
i  functions: preparing functions directory for uploading...
i  functions: packaged functions (41.54 KB) for uploading
+  functions: functions folder uploaded successfully
i  functions: uploading functions in project: sendReminder(us-central1)
i  functions: creating Node.js 8 function sendReminder(us-central1)...
i  scheduler: ensuring required API cloudscheduler.googleapis.com is enabled...
i  pubsub: ensuring required API pubsub.googleapis.com is enabled...
+  scheduler: required API cloudscheduler.googleapis.com is enabled
+  pubsub: required API pubsub.googleapis.com is enabled

Error: HTTP Error: 403, Cloud Scheduler API has not been used in the project before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/cloudscheduler.googleapis.com/overview then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.

Version info
node: v12.10.0
firebase-functions: 8.2.0
firebase-tools: 8.2.0
firebase-admin: 8.2.0

A: It finally worked. It was strange because I have enabled all the APIs necessary. The possible reasons for it were not working is that I initialized deployment during the outage and some permissions failed. So, it was being denied due to the permissions.
I was in touch with the firebase team for the last few days. We tried different things. Steps I followed to solve this issue as instructed by Firebase support:

*

*Disabled already enabled Schedular API and enabled it again in the console: https://console.cloud.google.com/apis/library/cloudscheduler.googleapis.com

*Created a dummy cron job by using the console: https://cloud.google.com/scheduler/docs/quickstart#create_a_job

*Deployed the function using Firebase CLI and it worked.


text:
Q: Magento connect : Connection Error try again later I am trying to install one extension using magento connect but the error I am getting :

Connection Error try again later.

I am using extension key
http://connect20.magentocommerce.com/community/Mageix_ExtensionManager

A: I was just hit with this error - turns out the live server I had just moved the site too didn't have DOMDocument support in PHP. A quick yum install php-xml and restart of Apache fixed it!

A: *

*Check the compatibility of the extension

*Flush the cache in magento connect and check

A: Installing yum install php-xml and restarting nginx worked for me.


text:
Q: XPages @DbLookup returning undefined when looking to another server/database I am trying to perform an @DbLookup to another server/database and continually receive an "undefined" return message.  The database exists, the view name is correct, the key is correct, as well as the column I am trying to return.  I have reader access to the database.
I have tried all these combinations for the server/file path, but none seem to work:
var dbName = new Array(session.getServerName(), "my/folder/thisdb.nsf");
var dbName = session.getServerName() + "!!" + my\\folder\\thisdb.nsf;
var dbName = "CN=Server/OU=Name/O=This" + "!!" + my\\folder\\thisdb.nsf;
var dbName = [@DbName([0]), "my/folder/thisdb.nsf"];

I have found this post and tried most of the combinations:
http://www.c-lutions.com/c-lutions/mcblog.nsf/dx/08242012095124AMJMMJ69.htm
Are there any other combinations I can try?
Thanks!

A: Is your folder's name my folder with a space in it? This could be the challenge. I would suggest to ease your pain....
Create one XPage in your target database, have one computed field on it with @DbName() as formula and see what is coming back. Besides that, your formulas have some issues (comments below the entries):
var dbName = new Array(session.getServerName(), "my/folder/thisdb.nsf");

looks OK unless your folder isn't a subfolder of my. Folders need to be relative to the data directory.
var dbName = session.getServerName() + "!!" + my\\folder\\thisdb.nsf;

dbName must be an array, this one isn't. Also there are no quotes around the file name
var dbName = "CN=Server/OU=Name/O=This" + "!!" + my\\folder\\thisdb.nsf;

same here: must be an array, quote is missing. It is confusing since the data source syntax uses the (CN) format of this: @Name("[CN]";@Subset(@DbName();1)+"!!....
var dbName = [@DbName([0]), "my/folder/thisdb.nsf"];

almost there. @DbName() doesn't take a parameter, so you would write:var dbName = [@DbName()[0], "my/folder/thisdb.nsf"]; or use var dbName = [@Subset(@DbName(),1), "my/folder/thisdb.nsf"];
You also can check great samples to play with.

A: Make sure the second server is in a trusted server group that is trusted by the first server. For security reasons XPages (and LotusScript) running on any server is unable to access the contents of databases if they are  not in the same trusted server group.


text:
Q: Why would you ever set MaxKeepAliveRequests to anything but unlimited? Apache's KeepAliveTimeout exists to close a keep-alive connection if a new request is not issued within a given period of time. Provided the user does not close his browser/tab, this timeout (usually 5-15 seconds) is what eventually closes most keep-alive connections, and prevents server resources from being wasted by holding on to connections indefinitely.
Now the MaxKeepAliveRequests directive puts a limit on the number of HTTP requests that a single TCP connection (left open due to KeepAlive) will serve. Setting this to 0 means an unlimited number of requests are allowed.
Why would you ever set this to anything but "unlimited"?  Provided a client is still actively making requests, what harm is there in letting them happen on the same keep-alive connection? Once the limit is reached, the requests still come in, just on a new connection.
The way I see it, there is no point in ever limiting this. What am I missing?

A: Basically, because Apache wasn't built for it.  The problem is server memory usage.  In many configurations, content generation is done in the same process as content delivery, so each process will grow to the size of the largest thing it handles.  Picture a process expanding to 64mb because of a heavy php script, then that bloated process sitting and serving static files.  Now multiply that by 100.  Also, if there are memory leaks anywhere, processes will grow without limit.
The keepalive settings should be balanced based on the type of your content and your traffic.  Generally, the optimal configuration has MaxKeepAliveRequests high (100-500), and KeepAliveTimeout low (2-5) to free them up quickly.

A: I know this is a old question, but I have been doing some debugging, and it seems as (and this is not only true for Apache) MaxKeepAliveRequests works independently of KeepAliveTimeout.
Meaning, the timeout directive only counts against idling persistent connections (no reads or writes) - if you keep requesting below the timeout you can virtually do an unlimited amount of requests over the same connection.
This might not be good for some reasons including long running tcp connections being randomly killed? In any case, http clients are not that stupid and can handle a "low" MaxKeepAliveRequests setting pretty well, e.g. it is relatively easy in programming language to detect if a tcp connection has been closed by the server and thus re-connecting to it again. Additionally, most of the http-clients are going to have limits in place on their own (e.g. browsers would close a keep-alive connection after 300 seconds or so).

A: One reason would be for load balancing. Once a keep-alive or http 1.1 persistent connection is made the load balancer won't move it to a new host until it closes.   If you have one client making a huge number of requests over their one connection you might not get good balancing between servers.

A: Partly, to keep a single user from hogging all the connection slots.  Without a limit, one malicious or poorly-written client could take over every single connection available and hold onto them forever.  This isn't a great mitigation for that, however, compared to something like a per-IP connection limit.
Mostly load balancing, but specifically with regards to maintenance.  If you want to take a server offline, you drop it to 0 connections but allow existing connections to finish for some amount of time.  Putting a limit on the number of keepalive requests means that eventually users will gracefully create a new connection and be moved to a new back-end server.  Probably some way to signal to the server that it should stop accepting keepalives altogether during the drain process would be even better, but so far as I know such a feature doesn't exist.


text:
Q: Adding localhost as a remote scope to my Bit.dev project returns a permission denied error I'd like to add a local scope server as a remote scope to my project. However, when I run bit remote add "http://localhost:3001" I get a error: permission to scope "" (http://localhost:3001) was denied along with a troubleshoot url that redirects me to the Bit homepage.
I'm running bit version 0.0.779, and work within a company proxy.
Setting up and running my local scope
Following these bare scope directions I do the following:
mkdir my-scope
cd my-scope
bit init --bare

bit start --port localhost:3001

Adding remote scope
In an existing, local react project I do the following:
bit init
bit add /path/to/my/compnent

bit remote add http://localhost:3001

Problem
Running bit remote add http:localhost:3001 returns:
error: permission to scope "" (http://localhost:3001) was denied
see troubleshooting at https://legacy-docs.bit.dev/docs/setup-authentication#authentication-issues

Does anyone know why I might be getting denied from setting localhost as my remote scope?

A: You can use the docker container to simplify the process of hosting scopes.
see details here - https://bit.dev/docs/scope/running-a-scope-server
regardless, it seems that the issue is just a typo, as you forgot to set // in the host url parameter of your command.


text:
Q: Highcharts is not responsive in ajax call In node.js application I am using highcharts api for charts visualisation.The div in which the charts are present are hidden in onload.
When the onclick function is called the charts are appeared in the divs.
The onclick function contains an ajax call where I prepared the charts data from backend.
But the problem is that the charts are not responsive.it expands from the div.
How can i make this charts responsive.
There is the sample code of the onclick function I post for better understanding

function showPanel(Abc_param1){
    var Abc_param2=$('#reportrange').data('daterangepicker').startDate;
    var Abc_param3=$('#reportrange').data('daterangepicker').endDate;

    Abc_param1=parseFloat(Abc_param1)

    var panel = $(this).parents(".panel");
    panel_refresh(panel);

    $("#hide_section10").hide()
    $("#hide_section11").hide()

    $("#hide_section15").hide()
    $("#footer_text").hide()
    var url = '/Abc_url?Abc_param1='+Abc_param1+'&Abc_param2='+Abc_param2+'&Abc_param3='+Abc_param3;
    $.ajax({
        'url': url,
        'async': true,
        'type': 'get',
        'success': function (data) {
            device_chart.series = [{
                name: 'Device',
                data: [
                    { name: 'Mobile', y: data.Mobile },
                    { name: 'Desktop', y: data.Desktop },
                    { name: 'Tab', y: data.Tab }
                ]
            }]
            $("#people_read").highcharts(device_chart);
            $("#hide_section1").show();
            $("#hide_section10").show()
            $("#hide_section11").show()
            $("#hide_section15").show()

        }
    })

}

A: Try setting minPadding and maxPadding to 0.

A: In Js Code in ajax success function add
$("#people_read").highcharts(device_chart);
$('#people_read').highcharts().reflow()

And in html rendering div will be

Edit
More Explanation

reflow ()
  Reflows the chart to its container. By default, the chart reflows automatically to its container following a window.resize event, as per the chart.reflow option. However, there are no reliable events for div resize, so if the container is resized without a window resize event, this must be called explicitly.

Resize div and reflow and pop up and reflow
From Highcharts Option Reference


text:
Q: Trouble wiring back button with django Quite new with django and so having difficulties with trying to wire my pages together.
I have an Applicant page that has a button to go to a Create Application page. I'm passing it like this:

     Create Application

From the Create Application page, how do I wire it back to the Applicant page?
I've tried doing it this way but I get this error "Reverse for 'applicant-update' with arguments '('',)' not found. "

      Back

My urls:
app_name = 'applicant'
urlpatterns = [
    url(r'view/(?P<pk>\d+)/$', views.ApplicantUpdate.as_view(), name='applicant-update'),
    url(r'view/(?P<pk>\d+)/new/$', views.ApplicationCreate.as_view(), name='application-new'),
]

View for Create Application:
@method_decorator(login_required, name='dispatch')
class ApplicationCreate(SuccessMessageMixin, CreateView):
    form_class = ApplicationForm
    template_name = 'applicant_application.html'
    success_message = 'Successfully created application.'

I hope you can help me. Thank you very much.

A: I imagine the issue is what Daniel commented. Your URL to create a new object is expecting a PK, which doesn't exist so the Django URL dispatcher cannot find a match.
You probably want something like this for your URLs:
app_name = 'applicant'
urlpatterns = [
    url(r'view/(?P<pk>\d+)/$', views.ApplicantUpdate.as_view(), name='applicant-update'),
    url(r'view/new/$', views.ApplicationCreate.as_view(), name='application-new'),
]

And something like this for your reverse URL:
{% url 'applicant:application-new' %}


text:
Q: how to create selectmenu "popup" Style with custom icon images? I'm very new to jquery, like 1 day old infant.
I have viewed this jquery_ui_selectmenu, but I couldn't understand how to convert my select menu to the one in in that link that called "popup" Style with custom icon images.
This is my select code.
<select name="fromCurrency" id="fromCurrency">
    <option selected value="EUR">EUR</option>
    <option value="USD">USD</option>
    <option value="GBP">GBP</option>
</select>

I basically want to create a popup/dropdown list with icons next to each option.
After trying to apply the changes as written below, the next code deosn't work.
What am I missing?

A: jsfiddle example

*

*setup class attributes on your <option>s:
<option selected value="EUR" class="eur">EUR</option>

*setup the css for your icon using the <option>'s class then .ui-selectmenu-item-icon:
.eur .ui-selectmenu-item-icon {background: url('your/icon/path') 0 0 no-repeat;}

*finally configure the icons when you call selectmenu:
$('#fromCurrency').selectmenu({
    icons: [
        {find: '.eur'},
        {find: '.usd'},
        {find: '.gbp'}
    ]
});

A: It seems like you just need to include an array of objects specifying the class name that receives the icon and the path to the icon you'd like to use. Here's the demo provided by the website.
$('select#files, select#filesC').selectmenu({
    icons: [
        {find: '.script', icon: 'ui-icon-script'},
        {find: '.image', icon: 'ui-icon-image'}
    ]

});


text:
Q: Eleminating radiation from chargers When I move my EMF radiation meter near a charger it shows me that there is radiation from the charger, and even the device itself radiates when the charger is connected to it.
The chargers emit radiation even if the device is not connected to them.
I understood that the radiation is caused because of the way the modern chargers are working. They are working in a way that they switch on and off very quickly. It is done by a DC/DC converter.
It results in a very high frequency noise (radiation) that travels on the charger's wires and even on the connected device.
But I noticed that when I connect the ground of the output of the power supply to the ground of the wall socket, there is no radiation!

So I have some questions:

*

*Why it eliminates the radiation?

*Is it safe to do that? (I know that the two sides of a transformer need to be isolated from each other, but it is just in principal).

*Will it damage the device, the charger or the socket?

*If it's ok, why the chargers are not designed in the way they will not radiate? (The chargers have only 2 connectors to the wall socket so why they don't have the third connector to the socket's ground?)

Thank you!

A: The coupling capacitance in the isolation transformer causes common mode noise voltage from the primary side switcher not the low voltage side.  So this Common Mode DC pair extends the CM noise to the laptop.  Some have a torridal ferrite to absorb some of the CM signal but when the laptop is floating there is not much attenuation unless RF caps were used to the primary earth ground. This current is limited by the Earth ground leakage test limits often 250uA or 500uA depending on country.  So the winding coupling capacitance often radiates with line frequency modulated 50kHz or whatever switching rate. Then external unbalanced mic's often induce some of this E field into the high CM input impedance and causes nonlinear conversion to differential mode noise.
Earthing gnd shunts and attenuates the CM high impedance Signal to low levels.
That is simply an impedance divider.
This also works with any VGA video cable as this cable has earth ground from the 3 pin power plug.
The only risk is a ground fault to the grid could energize the metal edges of the laptop case momentarily or an open ground elsewhere but to a machine with high ground current may pass to a user touching a good ground.
A better solution would be to have a perfectly balanced high inductive CM choke with RF caps to earth ground to both shunt voltage but at lower CM noise current levels  But this adds great expense it seems so it is not done for the few that might benefit from it.


text:
Q: SwiftUI form section title and rows have incorrect formatting The following SwiftUI form will render the section its header and contents incorrectly. The section header should be capitalized and have a background color. The rows should be marked up like a list, meaning, they should have list separators and padding.
struct ContentView: View {
    var body: some View {
        NavigationView {
            Form {
                Section(header: Text("Test")) {
                    ForEach(0..<5) { index in
                        Text("Row \(index)")
                    }
                }
                .navigationBarItems(trailing: Button(action: {}, label: { Text("Dummy") }))
            }
            .navigationTitle(Text("Navigation title"))
        }
    }
}

Result:

A: The cause of the incorrect formatting is that the .navigationBarItems should not be attached to the Section but instead moved lower, to the Form:
Form {
    Section(header: Text("Test")) {
        ForEach(0..<5) { index in
            Text("Row \(index)")
        }
    }
}
.navigationBarItems(trailing: Button(action: {}, label: { Text("Dummy") }))
.navigationTitle(Text("Navigation title"))

This renders the form correctly:

If you use the newer .toolbar modifier and attach it to the Section, the section will render correctly but the button simply won't show up. However .toolbar is only usable from iOS 14 and up.


text:
Q: shiny app running no problem locally but gets disconnected by server I have tested extensively of my shiny app locally and it's running smoothly without any problem but after I deployed on shiny.io (I tried aws-ec2 server with high memory as well) it shows below problem after initiate running an analysis about 10 seconds.

Due the apps' complexity, I am unable to paste all scrip here but here is some key information. Some suggestions how to debug it?
I deployed by using rsconnect
...
shinyApp(ui, server, options = list(height = 1100))
options(repos=BiocManager::repositories())
getOption("repos")
library(rsconnect)
rsconnect::deployApp("Finishline.Rmd")

The end of the log file:
2020-02-08T14:58:29.968642+00:00 shinyapps[1746000]: label: runapp (with options)
2020-02-08T14:58:29.968122+00:00 shinyapps[1746000]:   ordinary text without R code
2020-02-08T14:58:29.968123+00:00 shinyapps[1746000]:
2020-02-08T14:58:29.968230+00:00 shinyapps[1746000]:
  |
  |......................................................................| 100%
2020-02-08T14:58:29.969255+00:00 shinyapps[1746000]:  $ echo    : logi FALSE
2020-02-08T14:58:29.969620+00:00 shinyapps[1746000]:  $ comments: chr ""
2020-02-08T14:58:29.968778+00:00 shinyapps[1746000]: List of 4
2020-02-08T14:58:29.970454+00:00 shinyapps[1746000]:
2020-02-08T14:58:29.976354+00:00 shinyapps[1746000]:
2020-02-08T14:58:29.977352+00:00 shinyapps[1746000]: output file: /tmp/Rtmprhbx2g/RNASeq-Finishline.knit.md
2020-02-08T14:58:29.970034+00:00 shinyapps[1746000]:  $ warning : logi FALSE
2020-02-08T14:58:29.970434+00:00 shinyapps[1746000]:  $ message : logi FALSE
2020-02-08T14:58:29.977354+00:00 shinyapps[1746000]:
2020-02-08T14:58:29.981749+00:00 shinyapps[1746000]: /opt/connect/ext/pandoc2/pandoc +RTS -K512m -RTS /tmp/Rtmprhbx2g/RNASeq-Finishline.utf8.md --to html4 --from markdown+autolink_bare_uris+tex_math_single_backslash+smart --output /tmp/Rtmprhbx2g/file7542ce72bc.html --email-obfuscation none --standalone --section-divs --template /opt/R/3.6.2/lib/R/library/rmarkdown/rmd/h/default.html --no-highlight --variable highlightjs=1 --css my.css --id-prefix section- --variable 'theme:bootstrap' --mathjax --variable 'mathjax-url:https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML' --lua-filter /opt/R/3.6.2/lib/R/library/rmarkdown/rmd/lua/pagebreak.lua --lua-filter /opt/R/3.6.2/lib/R/library/rmarkdown/rmd/lua/latex-div.lua
2020-02-08T14:58:30.049414+00:00 shinyapps[1746000]:
2020-02-08T14:58:30.049416+00:00 shinyapps[1746000]: Output created: /tmp/Rtmprhbx2g/file7542ce72bc.html


text:
Q: JAXWS: How to change CXF-generated classes names defined in external XSD? I'm trying to change name of a class generated from wsdl (I don't want to modify any wsdl or xsd file directly). The problem is that its definition is in a separate xsd file.
The structrure of wsdl looks like this:
main.wsdl:
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://foo.bar/zee">
<wsdl:import location="typedef.wsdl" namespace="http://foo.bar/wee">
</wsdl:import>
    ...
</wsdl:definitions>

typedef.wsdl:
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="Foo" targetNamespace="http://foo.bar/wee">
    <wsdl:types>
        <xsd:schema>
            <xsd:import namespace="http://foo.bar/wee/schema" schemaLocation="FooBar.xsd"/>
        </xsd:schema>
    </wsdl:types>
    ...
<wsdl:definitions>

FooBar.xsd:
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://foo.bar/wee/schema">
    ...
    <xsd:complexType name="FooType">
    <xsd:sequence>
        ...
    </xsd:complexType>
</xsd:schema>

Now let's say I want to rename the FooType class to Foo. After reading this: JAXB: How to change XJC-generated classes names when attr type is specified in XSD? I've created a following bindings file.
jaxws_bindings.xml:
<?xml version="1.0" encoding="UTF-8"?>
<jxb:bindings
        xmlns:xs="http://www.w3.org/2001/XMLSchema"
        xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
        version="2.1"
        wsdlLocation="http://127.0.0.1:8431/Foo/types.wsdl">

    <jxb:bindings schemaLocation="http://127.0.0.1:8431/Foo/FooBar.xsd">
        <jxb:bindings node="//xs:complexType[@name='FooType']">
            <jxb:class name="Foo"/>
        </jxb:bindings>
    </jxb:bindings>

</jxb:bindings>

But all I get is an error:
[ERROR] Failed to execute goal org.apache.cxf:cxf-codegen-plugin:2.7.0:wsdl2java (generate-sources) on
project foo: Execution generate-sources of goal org.apache.cxf:cxf-codegen-plugin:2.7.0:wsdl2java failed:
file:/E:/sources/.../jaxws_bindings.xml [8,95]: "http://127.0.0.1:8431/Foo/FooBar.xsd" is not a part of
this compilation. Is this a mistake for "http://127.0.0.1:8431/Foo/FooBar.xsd"? -> [Help 1]

I've already tried everything that came to my mind, but still got nothing close to a success.
Anyone happens to know how to do this?
PS: To generate the classes I use maven cxf codegen plugin with a following configuration in pom.xml:
<build>
    <finalName>${project.groupId}.${project.artifactId}</finalName>
    <plugins>
      <plugin>
        <groupId>org.apache.cxf</groupId>
        <artifactId>cxf-codegen-plugin</artifactId>
        <version>2.7.0</version>
        <executions>
          <execution>
            <id>generate-sources</id>
            <phase>generate-sources</phase>
            <configuration>
              <sourceRoot>${project.build.directory}/generated-sources</sourceRoot>
              <wsdlOptions>
                <wsdlOption>
                  <wsdl>http://127.0.0.1:8431/Foo/main.wsdl</wsdl>
                  <extraargs>
                    <extraarg>-client</extraarg>
                  </extraargs>
                  <bindingFiles>
                    <bindingFile>jaxws_bindings.xml</bindingFile>
                  </bindingFiles>
                </wsdlOption>
              </wsdlOptions>
            </configuration>
            <goals>
              <goal>wsdl2java</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
</build>

A: I figured this out based on this gist.
While this works with XJC:
<jaxb:bindings
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
    version="1.0">
  <jaxb:bindings schemaLocation="..."
                 node="/xsd:schema/xsd:element[@name='Bar']">
    <jaxb:class name="Foo"/>
  </jaxb:bindings>
</jaxb:bindings>

you need this with CXF:
<jaxb:bindings
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
    version="1.0">
  <jaxb:bindings schemaLocation="..."
                 node="/xsd:schema/xsd:complexType[@name='Case']">
    <jaxb:class name="Wat" implClass="bar"/>
  </jaxb:bindings>
</jaxb:bindings>

The difference is element vs complexType.


text:
Q: Can JRebel reload Kotlin classes when they are used by kotlin-maven-plugin plugin on maven? Can JRebel reload Kotlin classes when they are used by kotlin-maven-plugin plugin on Maven?
The project runs on an application server.

A: JRebel will reload kotlin classes provided they are compiled either via IDE or manually by invoking maven compile.
Also the classes must either be compiled to the path specified in the rebel.xml or to the classloader's classpath(e.g. when using exploded deployment with target/classes or target/artifact-name/WEB-INF/classes as the root).
Usually achieving this requires no extra steps and it should be just: Enable JRebel -> Start server & deploy application -> Make changes -> make/compile to reload
If you have not done so yet, please try the free trial at https://zeroturnaround.com/software/jrebel/trial/
and report back any issues and suggestions to support@zeroturnaround.com


text:
Q: DNN: Resolve IPortalInfo service I'm trying to use dependency injection in DNN to resolve the IPortalInfo service in my SchedulerClient and in my FeatureController. I want to access the current PortalId somehow. But for the SchedulerClient I receive the following error when trying to use the constructor dependency injection:
Unable to resolve service for type 'DotNetNuke.Abstractions.Portals.IPortalInfo' while attempting to activate 'XXX'.

For the FeatureController class it is not working either since it requires a parameterless constructor. Is there any other way to resolve the IPortalInfo service. Currently I'm using the DotNetNuke.Entities.Portals.PortalInfo class but it is deprecated.
(IPortalInfo)DependencyProvider.GetService(typeof (IPortalInfo)); using the PortalModuleBase is not working for the IPortalInfo.

A: AFAIK there is no way to use dependency injection in DNN in other classes than webforms code-behind at the moment.


text:
Q: Is there a way for linux to display caller id? After switching to linux, one thing i miss is something called phonetray, which displayed caller ID to my screen. I wondered if there is a way for Linux to do something similar.
I found a blog discussing NCID and call blocking here.
Is there a way to use NCID and have the caller ID display for a brief time on screen?

A: Yes.
linux-caller-id listens to what's coming from a modem on the landline receiving the call. It requires the installation of libQtCore4 and libQtGui4, a la sudo apt-get install libQtCore4 libQtGui4 before it can be added to your system.
If you are receiving calls on a cellphone, you can add Pushbullet to numerous browsers (Chrome, Chromium, Firefox, and Opera) to get an onscreen pop-up with the caller ID data. And, if you have an Android phone, you can add an app on it to block identified spammeristas, which has worked well for me.

A: The contents of Raspberry Pi Telephone Number Blocker -- Murphy 101 Blog that you link to is quite old. The software in that article is NCID - Network Caller ID and continues to be updated. It will do what you're looking for.

A: was able to make linux-caller-id function in Mint 19.1 by adding libqtcore4:i386 and libqtgui4:i386 in addition to libqtcore4 and libqtgui4. Don't forget to make the downloaded file executable in properties/permissions

A: I found the below linux-caller-id and if it worked it would be perfect for my needs. But, it doesn't work under Mint 19, and there's no make in the source. Sigh.


text:
Q: React Admin, second input filter based on first value It's my first time there so I hope I'll be clear !
I'm using React-admin for a project and I've got a strange issue. I'm using a modal and in there, there are two fields, one to select a warehouse (for my project) and the second that is parsing location based on the warehouse selected. The problem is that when I select a location once the warehouse is chosen, a second query is called without filter (but just after choosing a warehouse there is the good query).
Example: I choose "WHBOB", the query is filtering WHBOB, and when I click to the location, a second query is passing without filter. I think, the state that I'm using is resetting the filter but I don't know how to fix it ...
Code :
import React, { useState } from 'react'

import { AutocompleteInput, ReferenceInput, SelectInput } from 'react-admin'
import { Box, Typography } from '@material-ui/core'
import { makeStyles } from '@material-ui/core/styles'
import ProductReceptionInputs from 'components/ProductReceptionInputs'

const useSmallBodyStyles = makeStyles(theme => ({
  root: {
    fontWeight: '600',
    color: theme.palette.secondary.contrastText
  }
})
)

const ProductLogisticInputs = (props) => {
  const classes = useSmallBodyStyles()

  const [selectedOption, setSelectedOption] = useState()

  function handleChange (evt) {
    setSelectedOption(evt.target.value)
  }

  return (
    <>
      <Typography variant='body2' color='secondary.contrastText' className={classes.root}>Atelier</Typography>

      <Box display='flex' width='100%'>
        <Box width='320px'>
          <SelectInput
            label='Atelier' source='warehouse'
            choices={[
              { id: 'WHBOB', name: 'Bobigny' },
              { id: 'WHLIL', name: 'Lille' },
              { id: 'WHLYO', name: 'Lyon' }
            ]} alwaysOn emptyText='Atelier' fullWidth
            InputProps={{ disableUnderline: true }}
            onChange={handleChange}
          />
        </Box>

        <Box width='320px' marginLeft='24px'>

          <ReferenceInput
            label='Emplacement'
            reference='location'
            source='location'
            filter={{ ancestor_path: selectedOption }}
            alwaysOn
          >
            <AutocompleteInput
              optionValue='id'
              optionText='name'
              options={{ disabled: !selectedOption }}
              fullWidth
            />
          </ReferenceInput>
        </Box>
      </Box>
      <Typography variant='body2' color='secondary.contrastText' className={classes.root}>Reception</Typography>
      <ProductReceptionInputs />
    </>
  )
}

export default ProductLogisticInputs

If you need more info do not hesitate to ask !
Hope I was clear :)

A: for that case (linking 2 options) you should use FormDataConsumer. Here is the documentation: https://marmelab.com/react-admin/Inputs.html#linking-two-inputs


text:
Q: Need help for a parsing array imageicon into JButton this is the code i am having error with:
pic = new ImageIcon("Koala.jpg");
picArr = ImageUtil.sliceImage(3, 3, pic);
for (int i = 0; i < picArr.length; i++){
   leftbut[i].setIcon(new ImageIcon(picArr[i]));
}

This is the exact line of error:
leftbut[i].setIcon(new ImageIcon(picArr[i]));

This is the error:
no suitable constructor found for ImageIcon(ImageIcon)
constructor ImageIcon.ImageIcon() is not applicable
  (actual and formal argument lists differ in length)
constructor ImageIcon.ImageIcon(byte[]) is not applicable
  (actual argument ImageIcon cannot be converted to byte[] by method invocation conversion)
constructor ImageIcon.ImageIcon(byte[],String) is not applicable
  (actual and formal argument lists differ in length)
constructor ImageIcon.ImageIcon(Image) is not applicable
  (actual argument ImageIcon cannot be converted to Image by method invocation conversion)
constructor ImageIcon.ImageIcon(Image,String) is not applicable
  (actual and formal argument lists differ in length)
constructor ImageIcon.ImageIcon(URL) is not applicable
  (actual argument ImageIcon cannot be converted to URL by method invocation conversion)
constructor ImageIcon.ImageIcon(URL,String) is not applicable
  (actual and formal argument lists differ in length)
constructor ImageIcon.ImageIcon(String) is not applicable
  (actual argument ImageIcon cannot be converted to String by method invocation conversion)
constructor ImageIcon.ImageIcon(String,String) is not applicable
  (actual and formal argument lists differ in length)

Additional info - leftbut.[i] is array of 9 buttons and i want to set imageicon on each one of them by using the above method and slicing the 1 image into 9 peices Please help me. Thanks!

A: this
leftbut[i].setIcon(new ImageIcon(picArr[i]));
should be this
leftbut[i].setIcon(picArr[i]);


text:
Q: afx[...].h missing in Windows 7 When I installed the dreamspark provided VS2013 Professional years ago I hadn't thought I would use c++ so I think I unchecked some things about c++ that I actually don't remember.
I don't have VS2013 Installer right now
Now, I've got a MFC application and when I try to compile it, throws an error saying afxwin.h No such file. And when I search in the files there isn't any file with that name.
I searched in SO and I found only posts saying you can't compile if you use VS Express but that's not my case. What should I do or download?
Anyone can help I'd be thankfull.

A: You have to install the VS2013 tools.


text:
Q: Translating points on the Poincaré disk This is a follow-up to this 2017 question, in which we assume that we have a set of points $x_i$ on the Poincaré disk and a translation $F$ of point $x_0$ to $F(x_0) = x_{0}'$. We want to compute $F(x_i)$ for each point $x_i$ such that it preserves the distance and orientation of each point to another in hyperbolic space.
I understand from this answer that this alone is not enough to determine the function $F$, so we can assume that the line from $x_0$ to $x_0'$ is the axis of rotation for each point. What I don't understand is how to compute this concretely. Therefore I would like to ask how to compute the function F for example values (with no special meaning):
$x_0: (0.4, -0.2)$ and $F(x_0) = (0.35,-0.25)$
$x_1: (-0.2, 0.5)$
$x_2: (-0.6, -0.8$)
In this case, what would $F(x_1)$ and $F(x_2)$ be?
Context: I have been trying to create a write a JavaScript program that does this automatically for any point on the unit disk, but my results are wrong, so there must be something wrong with my computation.

A: As description, I will use complex numbers and their algebra, and also express Mobius transformations by two-by-two complex matrices, acting by
$\pmatrix{a&b\cr c&d}(z)={az+b\over cz+d}$, as usual. All the Mobius transformations stabilizing the open unit disk preserve hyperbolic angles in hyperbolic triangles, and preserve hyperbolic distances between pairs of points. Composition of Mobius transformations is exactly given by multiplication of the corresponding matrices.
First, for $\beta$ in the open unit disk, $g_\beta=\pmatrix{1 & \beta\cr \overline{\beta}&1}$ maps $0$ to $\beta$. Further, this map is the unique such that preserves the geodesic connecting $0$ and $\beta$, namely, the diameter passing through $\beta$. Proving this is not soooo hard, but involves some ideas that are fancier than the mere computation itself.
Any conjugate $hg_\beta h^{-1}$ (matrix multiplication) for $h$ a Mobius transformation stabilizing the disk will have the same property with regard to the points $h(0)$ and $h(\beta)$.
Given $z,w$ in the unit disk, let $h=g_z$, and $\beta=h^{-1}(w)$. Then the matrix product $hg_\beta h^{-1}$ maps $z$ to $w$, and has the stabilizing-the-connecting-geodesic property.
In terms of programming, apart from finding packages to do such stuff, I'd definitely want to "package" the components, rather than have one big ghastly formula.
(In fact, this particular computation is easier on the disk rather than the upper half-plane, because the geodesic-generating elements are easier to write down...)


text:
Q: Spring change Map keys after autowiring I have configuration class where I create Map as Bean like this.
@Bean
public Map<String, Filter> filters() {
    Map<String, Filter> map = new HashMap<>();
    map.put("RECOMMENDATION", new RecommendationFilter());
    map.put("UPCOMING", new UpcomingFilter());
    return map;
}

and Autowire this map in another Service :
@Autowired
private Map<String, Filter> filterMap;

in debug mode I can see that map has another keys, by the class names:

*

*recommendationFilter

*upcomingFilter

but not "RECOMMENDATION" and "UPCOMING", how it was setted in configuration.
And google search doesn't help.

A: This will happen because you might have something like this
@Component
class RecommendationFilter implements Filter{

}

@Component
class UpcomingFilter implements Filter{

}

So when you do
@Autowired
private Map<String, Filter> filterMap;

spring will automagically injects instances of Filter, with bean names as the key, default bean names for the above classes are recommendationFilter and upcomingFilter.
Two solutions.

*

*@Component("RECOMMENDATION")
class RecommendationFilter implements Filter{

}

@Component("UPCOMING")
class UpcomingFilter implements Filter{

}

*Remove @Component from these classes(Just word of caution. This will make them non spring beans, not sure if thats what you want)

Option 1 would be the right way to go about it. Just name the bean whatever you want as indicated above.
By creating a map explicitly you are not levaraging spring's dependency injection magic. :) (why do you want to do something which framework is doing for you, that negates the whole inversion of control (IOC) principle)


text:
Q: Directx vertex rendering: unable to get texture to display correctly for trapetzoids I'm trying to create 3d effect using vertex and index buffers in 2d (z-coord is 0) using DirectX7.
It's easier to explain with a picture:

The problem is that the lines are broken. They should be straight. To render this image it gets break up in triangles and rendered using DrawIndexedPrimitiveVB. Obviously each of the triangle is skewed a little differently and I don't see why.
Am I missing something trivial here?
I'm not sure if this will help, but the source and destination quads are as follow:
    SPoint4:= pBounds4(1, 1, W - 2, H - 2);
    DPoint4:= Point4(ProjTo2dX(i, FlyDist + DeepDist, W), ProjTo2dY(0, FlyDist + DeepDist, H), ProjTo2dX(W - i, FlyDist, W), ProjTo2dY(0, FlyDist, H), ProjTo2dX(W - i, FlyDist, W), ProjTo2dY(H, FlyDist, H), ProjTo2dX(i, FlyDist + DeepDist, W), ProjTo2dY(H, FlyDist + DeepDist, H));

A: One way to map a square/rectangular texture to an arbitrary quad is projective interpolation.  I've written an article showing how to do this (using vertex/pixel shaders).
The short version: you interpolate UVs across the quad in a way analogous to how GPUs do it for perspective-correct rendering (which, as you may have noticed, does not produce a visible seam between the two triangles).  To do this, you need to calculate a false "depth" value for each vertex of the quad, and do the interpolation using homogeneous coordinates based on this "depth".  Full details are in the article linked above.

A: You need to provide some perspective information to have a proper texture coordinates interpolation on a trapezoid, see
Problems with texture deformation in OpenGL ES 1.1 on quad made out of triangle strips

A: I found a solution or at least a workaround. Instead of breaking the image up in 2 triangles, I break it up in many (several horizontal strips, each consisting of 2 triangles). In this case the image looks ok.

in this case the image is split in 10 strips (20 triangles).
I'll be happy for any comments or other solutions. Thank you.


text:
Q: Increase width of filter search on FooTable Plugin I've been looking all over and can't seem to find/figure out how to make the 'data-filter' search box any bigger. I would like to make it wider while still remaining its responsiveness to window resizing, is this possible? I've tried passing
filtering: [{ container: "#footableFilterBox", options: { style: { width: "75%" } } }]
but that either doesn't apply here or my syntax is incorrect?
I've also tried to add css width directly to the input-group that FooTable generates using
$(document).load(function() {
  $('div#footableFilterBox').find('.input-group').css('width','75%');
});

But it doesn't seem to work. I've also tried to .addClass(); and customize my own css but that didn't work either.
Anyone have any ideas? This would be greatly helpful for the layout of my page. Thanks in advance!
Update
Here is the code used to initialize the FooTable plugin. It resides at the bottom of my HTML page. I'm using it in a rails application but that shouldn't make much of a difference, imo.
<script type="text/javascript">

jQuery(function($) {

  $('#propertiesTable').footable({
      filtering: [{
          container: "#footableFilterBox"
      }]
  });

});

</script>

Code that worked
Based off of @gaetanoM's answer I was able to use jQuery Tree Traversal to navigate my way to finding the element that I needed. Code below:
$('#propertiesTable').on('postinit.ft.table', function(e, ft) {
    $(this).closest('.clients-list').siblings('#footableFilterBox').find('.footable-filtering-search, .input-group').css('width','100%');
  }).footable();

Thanks for all answers provided!

A: You may use:

postinit.ft.table: The postinit.ft.table event is raised after any components are initialized but before the table is drawn for the first time. Calling preventDefault on this event will disable the initial drawing of the table.

$('.table').on('postinit.ft.table', function(e, ft) {
  $(this).find('.footable-filtering-search .input-group').css('width','75%')
}).footable();

The fiddle.


text:
Q: How to use mysqlfrm.exe to recover a mysql table I'm trying to recover a DB from a corrupted HD. So far, I was able to get the .frm files of the DB.
I'm trying to get the "CREATE statement" using mysqlfrm.exe, but when I try to lunch it, it closes itself immediately.
Before it closed, I took a print screen to see what was written in the shell.
Does anybody know what's happening?


text:
Q: Component tree is empty for react native app in Android Studio Layout Inspector I want to get resource name of react native app's component in order to do firebase robo testing and I can get through the layout inspector but I'm seeing nothing in the component's tree. Is there something I'm doing wrong or some other alternative to get resource name for android

You can see there's nothing in the component tree...


text:
Q: Attempt to invoke interface method 'java.lang.Object[] java.util.Collection.toArray()' The code gets JSON object from a webpage and makes it to a list..somewhere here an exception is arising..Please help me...
import android.content.Context;
import android.app.Activity;
import android.os.AsyncTask;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.TextView;

import com.squareup.okhttp.OkHttpClient;
import com.squareup.okhttp.Request;
import com.squareup.okhttp.Response;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import java.io.IOException;
import java.util.ArrayList;

public class FeedActivity extends Activity implements OnFeedListener{

ListView listview;
FeedAdapter adapter;
ArrayList<Post> posts;

@Override
protected void onCreate(Bundle savedInstanceState) {

    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_feed);

    listview = (ListView)findViewById(R.id.listView);

    //Data ->adapter -> ListView
    adapter = new FeedAdapter(getApplicationContext(),R.layout.layout_feed_item);

    listview.setAdapter(adapter);

    FeedTask task = new FeedTask(this);
    task.execute("https://public-api.wordpress.com/rest/v1.1/sites/androsiv.wordpress.com/posts/");
}

@Override
public void onFeed(JSONArray array) {
    int length = array.length();
    for(int i = 0; i<length; i++)
    {
        JSONObject object = array.optJSONObject(i);
         Post post = new Post(object.optString("title"),object.optString("excerpt"),object.optString("featured_image"));

        posts = new ArrayList<>();
        posts.add(post);
    }
    adapter.addAll(posts);
    adapter.notifyDataSetChanged();
}

public class FeedTask extends AsyncTask<String, Void, JSONArray>
{
    private OnFeedListener listener;
    public FeedTask(OnFeedListener listener)
    {
        this.listener = listener;
    }

    @Override
    protected JSONArray doInBackground(String... params) {
        String url = params[0];

        OkHttpClient client = new OkHttpClient();
        Request.Builder builder = new Request.Builder();

        Request request = builder.url(url).build();

        try {
            Response response = client.newCall(request).execute();
            String json = response.body().string();
            try {
                JSONObject object = new JSONObject(json);
                JSONArray array = object.optJSONArray("posts");
                return array;
            }
            catch(JSONException e)
                {
                    e.printStackTrace();
                }
         } catch (IOException e) {
            e.printStackTrace();
        }
        return null;
    }

    @Override
    protected void onPostExecute(JSONArray array) {
        super.onPostExecute(array);

        if(null == array)
           return;

        if(null != listener)
            listener.onFeed(array);
    }
}

public class FeedAdapter extends ArrayAdapter<Post>
{
    private int resource;
    public FeedAdapter(Context context, int resource) {
        super(context, resource);
        this.resource = resource;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        if(null == convertView)
        {
            LayoutInflater inflater = LayoutInflater.from(getContext());
            convertView = inflater.inflate(resource,null);
        }
        //Binding data
        Post post = getItem(position);
        TextView title = (TextView) convertView.findViewById(R.id.title);
        TextView desc = (TextView) convertView.findViewById(R.id.description);

        title.setText(post.title);
        desc.setText(post.description);
        return convertView;
    }

}

public class Post
{
    public String title;
    public String description;
    public String thumbnail; //url

    public Post(String title, String desc, String thumbnail)
    {
        this.description=desc;
        this.thumbnail=thumbnail;
        this.title=title;
    }
}
}

The log cat of the above program is given below...nullpointer
exception is encountered in the program...someone please help me.. In the previous similar question,i couldnt find explanation..
Log cat:
By changing the mentioned line i am getting the following EXCEPTION:
 java.lang.RuntimeException: An error occured while executing doInBackground()
        at android.os.AsyncTask$3.done(AsyncTask.java:300)
FATAL EXCEPTION: AbstractCallbackSender
Process: jp.co.translimit.braindots, PID: 7444
java.lang.RuntimeException: An error occured while executing doInBackground()
        at android.os.AsyncTask$3.done(AsyncTask.java:300)
 FATAL EXCEPTION: AsyncTask #5
Process: jp.co.translimit.braindots, PID: 8498
java.lang.RuntimeException: An error occured while executing doInBackground()
        at android.os.AsyncTask$3.done(AsyncTask.java:300)
 java.lang.RuntimeException: An error occured while executing doInBackground()
        at android.os.AsyncTask$3.done(AsyncTask.java:300)

A: The issue is this statement:
adapter.addAll(posts);

At this point in your onCreate method, posts is not yet initialized and contains NULL as value. You should either

*

*initialize posts before using it (posts = new ArrayList<Post>())

*since addAll(posts) probably won't have any effect when posts is empty, skip it alltogether. You're calling addAll(posts) again anway in your onFeed method.

On a side note: I saw what you're re-initializingposts with an empty array within a loop in your onFeed() method. That won't do any good. You should initialize your posts collection before  the loop.

A: adapter.addAll(posts);
Without creating a initializing you are trying to add it adapter. Here posts arraylist is null and you are filling the posts array in asynctask which was started after the above line. Remove the above line will work.


text:
Q: Making SVG inline sprites fluid I have a nice inline svg sprite system that I am using, but it would really be nice to give these percentage dimensions so that they scale based on the container size. Here is one sprite:
<svg class="svg"><use xlink:href="images/sprites/svgsprite.svg#no-1"></use></svg>

When I apply the following css:
.svg {
    width: 20%;
}

This, however, just gives the svg container a width of 20%, but the  element is at a fixed width inside the svg container. Even after applying a width of 100% to the  element, the style won't get applied. I was wondering is there a way to make these sprites responsive? After researching, I can't find many people attempting to make svg sprites responsive, but I don't understand why since they cut down on http requests.