text:
Q: Why is "this.Repo" null when invoking methods in SongRepo in Spring Boot Project? The goal of this method is to provide functionality to a service layer method that will find all songs within a PostgreSQL database. I have implemented an interface "SongServiceInterface" in the service layer and in the event I utilize this SongService via instantiation in the main method or even by sending Http Requests via "/songs" endpoint, I receive this error:
Caused by: java.lang.NullPointerException: Cannot invoke "com.techm.react.Wasteland.repository.SongRepo.findAll()" because "this.songRepo" is null.
Please note upon startup the application will persist the objects to database, but using endpoints or methods within this repo/service cause null field error.
I can provide the code below:

Model
package com.techm.react.Wasteland.models;

import lombok.*;
import org.hibernate.annotations.OnDelete;
import org.hibernate.annotations.OnDeleteAction;

import javax.persistence.*;
import java.sql.Time;

@Entity
@Table(name = "song")
@NoArgsConstructor
@AllArgsConstructor
@Getter @Setter
@EqualsAndHashCode
@ToString
public class Song {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private int id;

    @Column(name = "title")
    private String title;

    @JoinColumn(name = "album")
    @ManyToOne
    @OnDelete(action = OnDeleteAction.CASCADE)
    private Album album;

    @Column(name = "artists")
    private String artists;

    @Column(name = "track")
    private int track;

    @Column(name = "track_length")
    private Time length;
}

DTO
package com.techm.react.Wasteland.dto;

import com.techm.react.Wasteland.models.Album;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.sql.Time;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class SongDTO {

    private String title;
    private AlbumDTO album;
    private String artists;
    private int track;
    private Time length;

}

Repo
package com.techm.react.Wasteland.repository;

import com.techm.react.Wasteland.models.Song;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;
@Repository
public interface SongRepo extends JpaRepository<Song, Integer> {

    public abstract List<Song> findAll();

    public abstract List<Song> findByArtist();

    public abstract Song findByTrack();
}

Service
package com.techm.react.Wasteland.service;

import com.techm.react.Wasteland.dto.SongDTO;
import com.techm.react.Wasteland.models.Song;
import com.techm.react.Wasteland.repository.SongRepo;
import org.modelmapper.ModelMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Configurable;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service @Configurable
public class SongService implements SongServiceInterface{
    @Autowired
    SongRepo songRepo;

    @Autowired
    private ModelMapper modelMapper;

    public List<SongDTO> findAllSongs() {

        List<SongDTO> songDTOS = new ArrayList<>();

        List<Song> songs = songRepo.findAll();
        for(Song s: songs) {
            songDTOS.add(modelMapper.map(s, SongDTO.class));
        }

        return songDTOS;
    }

    public SongDTO getSongByTitle(String title) throws NoSuchFieldException {
        SongDTO song = new SongDTO();
        if(title == song.getTitle()){
            return song;
        }
        else throw new NoSuchFieldException("The song by that title does not exist");
    }

    public SongDTO findByTrack(int track) {
        SongDTO song = new SongDTO();
        if(song.getTrack() == track) {
            return song;
        }
        return null;
    }

}

Main
package com.techm.react.Wasteland;

import com.techm.react.Wasteland.controller.AlbumController;
import com.techm.react.Wasteland.controller.SongController;
import com.techm.react.Wasteland.service.SongService;
import org.modelmapper.ModelMapper;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.transaction.annotation.EnableTransactionManagement;

@SpringBootApplication
@ComponentScan({"com.server", "com.server.config"})
@EnableAutoConfiguration(exclude={DataSourceAutoConfiguration.class})
public class WastelandApplication {

    @Bean
    public ModelMapper modelMapper() {
        ModelMapper modelMapper = new ModelMapper();
        return modelMapper;
    }

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

        SongService songService = new SongService();
        System.out.println(songService.findAllSongs());
    }

}

A: When you use new to create an object, it's outside of Spring's context.  It won't have the autowired dependencies.  Also, you won't be able to use autowired beans in your main (nor should you) as it's a static method.  If you want to do this in your app startup, autowire the bean and put the logic in a PostConstruct method.
Here is an example:
public class WastelandApplication {
    @Autowired
    private SongService songService;

    @Bean
    public ModelMapper modelMapper() {
        ModelMapper modelMapper = new ModelMapper();
        return modelMapper;
    }

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

    @PostConstruct
    public void doSomethingIProbablyShouldNotBeDoing() {
        System.out.println(songService.findAllSongs());
    }
}


text:
Q: Flink configurations to avoid uploading extenal jars every time submit job Does Flink has configurations to avoid uploading extenal jars every time submit job, like spark.yarn.archive in spark-submit?
I know ways to deal with external jars like answers in: How to Reference the External Jar in Flink. Such as fat jar, Copying jars to $FLINK/lib, -yt configuration, but they are not flexible or convenient enough.

A: I notice Flink has an issue FLINK-13938 to resolve this, and the improve haved been merged in recent version 1.11.0.
A final submission command could be issued like following.
./bin/flink run -m yarn-cluster -d \
-yD yarn.provided.lib.dirs=hdfs://myhdfs/flink/lib,hdfs://myhdfs/flink/plugins \
examples/streaming/WindowJoin.jar

redpajama_set_name: RedPajamaStackExchange


text:
Q: In AE, is "tin" used instead of "can" to designate an eco friendly BPA free can of sardines? I've always thought that "can" was the typical term to refer to a can of sardines (or the like) in AE, and "tin" the BE equivalent, until I recently stumbled across "tin" used instead of "can" on a US website to designate a can of smoked trout.
And so, I was wondering whether "tin" could have migrated across the Atlantic from the UK to the US, and gained ground into regional or mainstream AE to designate -- along with "can" -- a small airtight flat container adapted for storing a pack of processed fish. Or, does "tin" have a specific meaning to it in AE?
I thought it might designate a can made of special metallic alloy suitable for food products, and also good for the environment.

Consider the Web page in question: source

A: For what it's worth, it may be a regional thing, but in Monterey, California, we had a very big sardine industry not long ago. Sardines were produced in the canneries on a street called Cannery Row. This was made famous in 1945 in the John Steinbeck novel by the same name: Cannery Row, and later in 1982 in the movie by the same name.
Sardines are canned in canneries using a process called canning, and you generally won't find the word tin mentioned anywhere. (source: The little fish that we can: California's sardine industry, now and then)
Online stores in Monterey call the containers cans, as this picture shows (although the single cans seem to be unavailable, they can be bought in a twelve pack).

The American company Walmart describes their sardine products as being sold in a can:

If I look on Amazon.com, the suppliers describe their products both ways, with can being preferred only slightly, if it's mentioned at all. This surprises me, because I can't recall ever having heard anyone refer to a sardine tin in the United States (except maybe my wife's grandmother, but she was from Bermuda).
Update
Since the Ngram Viewer is popular here, I've run one on AE usage, and then BE usage. There is definitely a preference inversion in the corresponding literature. But this distinction is stronger in AE, going for can, not tin:
American English

British English

Update 2
One more thing I forgot to address is your question about BPA-free containers. I think you will still find them called cans, as in this article, 7 Companies You Can Trust to Use BPA-Free Cans, which never mentions tin as what the BPA-free containers use, nor do they call the containers tins. Yet they still achieve BPA-free results for their products.

A: Originally, all cans were 'tin can' because cans were lined with tin.  The Brits took tin, we took can for the short name.
The flat rectangular shaped can, however, is a tin even in the US, and always has been.


text:
Q: In nodejs, NaN is returned when a post request of api using bodyparser is made Version
nodejs v16.15.0
npm 8.10.0
I created an api in nodejs as follows
const express = require("express");
const bodyParser = require("body-parser");

const app = express();

app.use(bodyParser.json());

const sayHi = (req, res) => {
  res.send("Hi!");
};

app.get("/", sayHi);

app.post("/add", (req, res) => {
  const { a, b } = req.body;
  res.send(`The sum is: ${a + b}`);
});

app.listen(5000, () => {
  console.log(`Server is running on port 5000.`);
});

The get request became a response.
NaN is returned in response to post requests.
{
    "a": 5,
    "b": 10
}

The sum is: NaN

A: Try to cast the parameters:
app.post("/add", (req, res) => {
  const a = Number(req.body.a);
  const b = Number(req.body.b);
  res.send(`The sum is: ${a + b}`);
});


text:
Q: Не могу понять почему ответы не сохраняются в файле. Надо ввести имя пользователя неоднократное кол-во раз with open('guest_book', 'w') as file_object:
    while True:
        name = input('')
        if  name == 1:
            break
        file_object.write(name)

A: Предположу, что цикл ввода вы завершаете сами нажатимем Ctrl-C (ваше условие с break не сработает, потому что при сравнение строки и числа ответ всегда False). Из-за этого всё, что вы ввели не записывается в файл (особенность работы буфера записи в файл).
Чтобы исправить эту ошибку достаточно сравнивать ввод со строкой, при которой нужно завершить цикл ввода.
with open('guest_book', 'w') as file_object:
    while True:
        name = input('')
        if  name == '1': # <---
            break
        file_object.write(name)

Однако так все "имена", введенные пользователем, будут записаны в одну строку и без разделителя. Так добавим же разделитель
file_object.write(name + '\n')

Ну и добавлю "современный" код
with open('guest_book', 'w') as file_object:
    while (name:=input('')) != '1':
        file_object.write(name + '\n')


text:
Q: Export php form data to Excel or PDF I have function called "resultAction" where I store all the information in $data to print in div table.
Now I want to export the same form data to excel.
I want to pass the same form data to another function called "reportAction", where i failing to do that, i am returing the $data which fails.
function resultAction()
{
   for ($i = 0; $i < count($result); $i++) {
       $data[$i]['device_type']     = $result[$i]['device_type'];
       $data[$i]['region_name']     = $result[$i]['region_name'];
   }

   echo  Zend_Json::encode($data);
   sleep(2);
   $this->_helper->viewRenderer->setNoRender();
   $this->_helper ->layout()->disableLayout();
   return $data;
}

function reportAction()   {
    $res = $this ->resultAction   // here it fails
}

A: You're looking for the forward function
function reportAction()   {
    $this->_forward('result');   // here it's not supposed to fail
}


text:
Q: Не могу получить файл с сервера NGINX Добрый день, не могу скачать файл с сервера. Скрипт таки возвращает файл, но размер его 0 байт.
$file = 'http://2ch.hk/newtest/resources/images/dvlogo.png';

header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename='.$file);
header('Content-Length: ' . filesize($file));
exit(0);

A: У вас в вопросе описаны только заголовки ответа, в то время как никаких данных сервер не отдает - потому и скачивается документ в ноль байт. В случае, если у вас есть ссылка на конкретный документ, то проще всего отдать ее пользователю с 301/302 редиректом:
header('HTTP/1.1 302 Temporarily Moved');
header('Location: ' . $url);

В случае, если документ валяется на диске исполняющей код машины, его надо прочитать и вывести в теле ответа. Проще всего использовать функцию readfile():
header('Content-Disposition: attachment; filename=' . $filename);
readfile($file);


text:
Q: Validate XML - remove invalid data I want to validate an xml file against it schema. Once the validation is completed I want to remove any invalid data and save this invalid data into a new file. I can perfom the validation, just stuck on the removing and saving invalid data into new file.

A: I take back everything I just wrote. ... :) You can get the node you need using the Current Element Node property at Exception time, it seems.
Element curElement = (Element)validator.getProperty("http://apache.org/xml/properties/dom/current-element-node");

Because the Schema is defined via Xerces, I think this will work. See http://xerces.apache.org/xerces2-j/properties.html#dom.current-element-node .
There is more explanation in the answer at How can I get more information on an invalid DOM element through the Validator? .


text:
Q: HIkariCP: connection leaks and usage time I was wondering whether connection leaks and usage time are correlating.
A connection leak is identified if a connection is out of the pool for an amount of time over the configured leakDetectionThreshold.
Is this amount of time the same as the connection usage time?
I am asking because I am seeing some connection leaks with a leakDetectionThreshold of 30s whereas I cannot find any connections with a corresponding connection usage time.
Thanks,
Michail

A: Connection usage time, as reported by Dropwizard metrics, is recorded using a Histogram with an exponentially decaying reservior.  Quoting their doc:

A histogram with an exponentially decaying reservoir produces
  quantiles which are representative of (roughly) the last five minutes
  of data. It does so by using a forward-decaying priority reservoir
  with an exponential weighting towards newer data.

As such, I think it would be very difficult to correlate individual connection leaks with any particular quartile in the histogram.


text:
Q: Vue v-model data is from ajax undefined value I used the vue 2. I had a data from ajax, this is my code example:
<template>

        <input type="input" class="form-control" v-model="siteInfo.siteId">
        <input type="input" class="form-control" v-model="siteInfo.info.name">
        <input type="input" class="form-control" v-model="siteInfo.accountData.name">

</template>

I got a warring message

[Vue warn]: Error in render: "TypeError: Cannot read property 'name'
  of undefined"

*

*I can use computed to fix it, but if I had a lot model, I should
write a lot computed.

*I should create a lot data for those model?

*I should not use an object to bind a lot model?

Does it have another solution for this situation? Thanks your help.

A: Before the data loads siteInfo.info will be undefined, so you can't access name in the v-model:
v-model="siteInfo.info.name"

Likewise for siteInfo.accountData.name.
My suggestion would be to set the initial value of siteInfo to null and then put a v-if="siteInfo" on the main div. Alternatively you could put a v-if on the individual input elements that checks for siteInfo.info and siteInfo.accountData.
You may also want to consider showing alternative content, such as a load mask, while the data is loading.

A: Don't be worried about too many v-models - you can do an iteration on the Object - like with Object.entries().

Vue.component('list-input-element', {
  props: ['siteLabel', 'siteInfo'],
  template: '
{{siteLabel}}<input type="input" class="form-control" v-model="siteInfo">
'
})

new Vue({
  name: 'Site',
  el: '#app',
  data() {
    return {
      siteInfo: {},
    }
  },
  methods: {
    getData() {
      // using mockup data for this example
      fetch('https://jsonplaceholder.typicode.com/todos/1')
        .then(response => response.json())
        .then(json => {
          console.log(json)
          this.siteInfo = json
        })
      // do ajax get data
      /*this.$http.post('URL', {
        POSTDATA
      }).then(response => {
        this.siteInfo = response.body.data;
      })*/
    }
  },
  mounted() {
    this.getData();
  }
})
div {
  display: block;
}

  <list-input-element v-for="siteInfo in Object.entries(siteInfo)" :site-label="siteInfo[0]" :site-info="siteInfo[1]" />

Rounding up
So, when you do the single file template, use a computed value, and return an Object from that.
Base your v-for on that computed, and you'll have no problems.
Something like this:
<template>

        <input type="input" class="form-control" v-for="infoEl in siteInfoComputed" v-model="infoEl">

</template>


text:
Q: NUnit3 couldn't locate assembly "FSharp.Core 4.4.1.0" - Not used in rest of project I use NUnit3 to run all of my tests, and NUnit3TestAdapter within Visual Studio 2017. When running tests in a build on TFS i get the error:

System.IO.FileLoadException : Could not load file or assembly
  'FSharp.Core, Version=4.4.1.0, Culture=neutral,
  PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The
  located assembly's manifest definition does not match the assembly
  reference. (Exception from HRESULT: 0x80131040)

All projects in my solution use FSharp.Core 4.5.2.0.
I've ensured that all projects use version 4.5.2.0, and have set up binding redirects to this version in all projects.
I've tried changing the reference to FSharp.Core in my test-project to use 4.4.1.0 (setting path to 'C:\Program Files (x86)\Reference Assemblies\Microsoft\FSharp\.NETFramework\v4.0\4.4.1.0\FSharp.Core.dll', and set the binding redirect in app.config to 4.4.1.0 - but with no luck.
I had a similar issue that i fixed earlier.

I had an error saying it couldn't load the assembly "nunit.framework,
  Version=3.9.0.0"

At that point i was using version 3.11.0.0, and fixed the issue by downgrading.
I've tried the same approach with FSharp.Core, but with no luck.
I'm using NUnit3TestAdapter 3.12.
I thought maybe NUnit3TestAdapter might just be dependent on "nunit.framework 3.9.0.0" and "FSharp.Core 4.4.1.0", but i haven't found anything about it when looking at documentation for NUnit3TestAdapter.
I've looked at related question and tried solutions by deleting project\bin and project\obj folders and building again.
Tests run fine in VS17 locally.
Is there a dependency for NUnit3TestAdapter that I'm not aware of, or might there be some package versions being inherited by other projects?
EDIT:
The reference to FSharp.Core in .fsproj:

   <Reference Include="FSharp.Core">
     <HintPath>..\packages\FSharp.Core\lib\net45\FSharp.Core.dll</HintPath>
     <Private>True</Private>
     <Paket>True</Paket>
   </Reference>

My references are:
FSharp.Core
FsUnit.NUnit
mscorlib
nunit.framework
Nunit3.TestAdapter
System
System.Core
System.Numerics
Project A
Project B


text:
Q: Unimplemented __init__() I was looking over some code with a misspelled __init__() function (it had a total of 3 underbars instead of 4).  And I realized I didn't really know what happens in a Python when an object cannot find a suitable __init__().
Is there a default initializer that is inserted automatically?  Is there a default __new__ that gets called?  Why does a constructor with arguments fail?
class TestClass(object):
    def do_something(self):
        print("Hello From TestClass!")

# What is called here?
instance = TestClass()
instance.do_something()

# Why does this fail?
argument = 100
instance = TestClass(argument)

A:
Is there a default initializer that is inserted automatically?

Yes. There's a default dummy constructor on every class unless overwritten/inherited.

Is there a default __new__ that gets called?

Yes. Again by default it doesn't do much except for actually creating the object and setting its type.

Why does a constructor with arguments fail?

Because the default constructor takes no arguments and does nothing.

A: Everything inherits from object in Python 3 so if no base classes are supplied, defaults will be used for it.
@freakish answered your questions but I'll add a coded example to complement his explanation.
Let's create a new baseClass for which our new class myclass will inherit:
class baseClass:
    def __init__(self):
        print("Inherited __init__ got called")

    def __new__(self, *args, **kwargs):
        print("Inherited __new__ got called")
        return object.__new__(self, *args, **kwargs)

This class overloads __init__ and __new__ and so any class which subclasses it will get these methods. Let's create a sample class which inherits from baseClass now:
class mycls(baseClass):
    pass

Empty, no dunders defined. When we create an instance of this class though, we can see baseClass's inherited methods get called:
m = mycls()
Inherited __new__ got called
Inherited __init__ got called

So as you can see, we'll get everything our parents in the inheritance tree have defined. But, since classes with no explicit parent always inherit from object:
class f: pass
f.__bases__  # bases gives us the inherited classes

Out[218]: (object,)

We will always have these methods to our disposal with default behaviour defined. For the default __init__ this means no arguments, you need to redefine it in order to customize it!

A: You're asking about two frequently confused topics: the initializer __init__ and the constructor __new__.  Also, I think you're confusing Python with languages like Java, where the constructor is a Big Deal and Not Like The Others, and where construction and initialization are mixed up in a single process (and thus a common misunderstanding for programmers new to Python).
In Python, both the constructor and the initializer are methods, no different from any other method. There's a naming convention that (some) methods with double underscores on both ends will be called by the interpreter without you having to do it explicitly, but you could call them yourself if you wanted, and you would get the same results.
In short:  If you understand __str__, you understand __init__ and __new__.
(I think the weirdest thing about Python for some experienced programmers is how it doesn't ambush you with special cases at every turn.)
Method Resolution Order
Python 2.3's new-style classes look up method names by starting with the object's class, then working through that class's ancestors, until it either finds the name it's looking for or runs out of classes to search.
You can see the method resolution order of any class by looking at its __mro__ field:
>>> TestClass.__mro__
(<class '__main__.TestClass'>, <class 'object'>)
>>> float.__mro__
(<class 'float'>, <class 'object'>)
>>> object.__mro__
(<class 'object'>,)

(Python constructs the tuple using the C3 Method Resolution Order algorithm, but it's overkill for a simple case like yours.  C3 is mostly concerned with linearizing a complex, multiple-inheritance graph into a tuple of classes that can be searched in a predictable order.)
Any method lookup, even __init__ or __new__, follows the Method Resolution Order.  For each class in the tuple, Python looks for the string (like '__init__') in its class __dict__; if that string present, its associated value --- whatever it is --- will be returned as the result of the method lookup.
In your case, Python looks for TestClass.__new__, which doesn't exist, and then object.__new__, which does.  It then executes object.__new__ (with some parameters filled in automatically) to construct your new TestClass object.  Initialization with __init__ is identical, except that you might provide some additional arguments yourself.
Proof (in Python 3):
>>> class A: pass
...
>>> A.__init__ is object.__init__
True
>>> A.__new__ is object.__new__
True
>>> A.__repr__ is object.__repr__
True
>>> A.__str__ is object.__str__
True

Arguments to __init__
Your attempt to pass an argument to object.__init__ failed because that method doesn't take any parameters (aside from self, which was already filled in for you).  It looks more or less like this:
class Object:
    def __init__(self):
        return

Conclusion
Python does not "create" a default constructor or initializer for your class like (IIRC) Java does.  But it has one of each lying around in the object class, so if you don't write your own, you'll inherit them.


text:
Q: Hide "next" link if json requests returns the next link as "false" $("#wrap .project").append($("previousnext"));

Messy, I know. The path is the main path of course and data.prev and data.next are links to the next project.
Naturally projects get to an end and then when I hover or click on the link it gives me path/false.
I tried this:
        if(data.next == false){$('#wrap .project #prev-project').hide()};
        if(data.prev == false){$('#wrap .project #next-project').hide()};

But it doesn't hide anything. I am alerting the data.next and data.prev and it gives me false. I tried 'false'  as well in the if, nothing, the links are still showing.
What's the problem?

A: How about :
var prev = data.prev ? 'previous ' : 'previous ';
var next = data.next ? 'next' : 'next';
$("#wrap .project").append(prev + next);

Create a .nolink {...} style in your stylesheet to style null prev/next text, eg. .nolink { color:#e0e0e0; }.
You don't need the ids unless they are used elsewhere.


text:
Q: Why is does this error happen? "No value given for one or more required parameters" When I try to click the Button1 ,2 and 3. The error that is stated below happens. This error always occur when I have two tables on my database.

No value given for one or more required parameters

This is my code
Imports System.Data.OleDb
Module MSAccessConnection
    Public Function OpenConnection() As String
        Dim connString As String = "Provider=Microsoft.ACE.OLEDB.12.0; Data Source=G:\MerdoresNew\OrderData.accdb"

        Return connString
    End Function
End Module

Public Class Order
    Public total As Integer
    Public ordered As Integer
    Public ordered2 As Integer

    Public ordered3 As Integer
    Public price As Integer
    Dim myConnection As OleDbConnection = New OleDbConnection

    Private Sub Order_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'TODO: This line of code loads data into the 'OrderDatabaseDataSet.Items' table. You can move, or remove it, as needed.
    End Sub

    Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        myConnection.ConnectionString = OpenConnection()
        myConnection.Open()

        'the query:
        Dim cmd As OleDbCommand = New OleDbCommand("SELECT [Price] FROM [Items] where Item='Cheese Burger'", myConnection)

        Dim dr As OleDbDataReader = cmd.ExecuteReader
        ' the following variable is hold true if user is found, and false if user is not found
        Dim Found As Boolean = False

        While dr.Read
            Found = True
            price = dr("Price")
        End While

        If Found = True Then

            ordered = TextBox1.Text * price

        Else

            MsgBox("Saved!")

            Me.Close()

        End If

        myConnection.Close()

    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        myConnection.ConnectionString = OpenConnection()
        myConnection.Open()

        'the query:
        Dim cmd As OleDbCommand = New OleDbCommand("SELECT [Price] FROM [Items] where Item='Ham Burger'", myConnection)

        Dim dr As OleDbDataReader = cmd.ExecuteReader
        ' the following variable is hold true if user is found, and false if user is not found
        Dim Found As Boolean = False

        While dr.Read
            Found = True
            price = dr("Price")
        End While

        If Found = True Then

            ordered2 = TextBox2.Text * price

        Else

            MsgBox("Saved!")

        End If

        myConnection.Close()
    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click

        total = ordered + ordered2 + ordered3
        Form1.TextBox1.Text = total

    End Sub

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        myConnection.ConnectionString = OpenConnection()
        myConnection.Open()

        'the query:
        Dim cmd As OleDbCommand = New OleDbCommand("SELECT [Price] FROM [Items] where Item='Chicken Sandwich'", myConnection)

        Dim dr As OleDbDataReader = cmd.ExecuteReader
        ' the following variable is hold true if user is found, and false if user is not found
        Dim Found As Boolean = False

        While dr.Read
            Found = True
            price = dr("Price")
        End While

        If Found = True Then

            ordered3 = TextBox3.Text * price

        Else

            MsgBox("Saved!")

        End If

        myConnection.Close()
    End Sub
End Class

A: I don't see where you are passing your connection string to the button click handler. You DIM the connection string as connString, but you never call it in the handler.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    myConnection.ConnectionString = OpenConnection() <----- Change ConnectionString to connString
    myConnection.Open()

I think that's the variable that you're missing. I would have commented but I don't have enough rep to comment yet.


text:
Q: XAML Stop List Box Text Style Changing on Defocus I have an issue with a .NET 4 XAML program which contains a ListBox.
When a the list box looses focus the text turns to grey rather than the set white colour. The background did do this but I resolved that with
    <Style.Resources>
            <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="#376807" />
            <SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="#487918" />
    </Style.Resources>

I have tried several methods of resolving this including
    <Style.Triggers>
            <Trigger Property="IsSelected" Value="True">
                <Setter Property="Foreground" Value="#FFFFFF" />
            </Trigger>
            <Trigger Property="IsSelected" Value="False">
                <Setter Property="Foreground" Value="#444444" />
            </Trigger>
     </Style.Triggers>

But not have been successful...

A: OK I have edited my code. Just check if this satisfies your need, if not then please revert.
The following has been tried with some dummy data in the listbox and it works. I hope this is what you were looking for, if not, then please clarify some more.

    <DataTemplate x:Key="SelectedTemplate">
        <TextBlock Text="{Binding}" Background="Green" Foreground="White" />
    </DataTemplate>

    <Style TargetType="{x:Type ListBoxItem}" x:Key="ContainerStyle">
        <Setter Property="ContentTemplate" Value="{StaticResource ItemTemplate}" />
        <Style.Triggers>
            <Trigger Property="IsSelected" Value="True">
                <Setter Property="Background" Value="Green" />
            </Trigger>
        </Style.Triggers>
    </Style>
</Window.Resources>
<StackPanel>
    <ListBox x:Name="dummyList" ItemContainerStyle="{StaticResource ContainerStyle}" HorizontalContentAlignment="Stretch" >
    <ListBoxItem Content="A" />
    <ListBoxItem Content="B" />
    <ListBoxItem Content="C" />
</ListBox>
<Button Height="31" Width="61" Content="Click"/>
    <ListBox Name="listBox2" Height="100" Width="120" HorizontalContentAlignment="Stretch">
    <ListBoxItem Content="XX" />
        <ListBoxItem Content="YY" />
    </ListBox>
</StackPanel>


text:
Q: Consulta con variable de sesión, ¿no funciona? PHP MYSQL Estoy haciendo algunas consultas con PHP y MySQL. ¿Por qué cuando hago una consulta con una variable de sesión no me arroja nada? Lo que quiero es obtener todos los datos y que coincidan con mi variable de sesión que extraigo desde la base de datos de MySQL es un idaplantel en la base y en sesión es lo mismo sólo que se agrega de esta forma $idaplantel.
Un pequeño ejemplo sería:
select * from dprestamo where idplantel = '$idaplantel' <-- variable que inicializo en la sesión de usuario de mi sistema!

El idplantel es un id que se agrega a la tabla dprestamo desde otra tabla que se llama Cplantel... y según yo de esta forma si el usuario tiene el '$idaplantel' =  1 y el idplantel es 1 de la tabla dprestamo entonces que muestre todo y solo lo que coincida con ese la variable.
Pero no funciona. Tengo una duda sobre el uso de la variable de sesión que estoy usando, ¿qué diferencia tiene esto $_SESSION['idcaplantel'] y esto $idcaplantel? ¿Puede ser eso el problema?

A: Por el código que has puesto parece que tu consulta esté bien, pero falle la forma de añadir el valor de la variable $idaplantel en la consulta.
La forma que tiene PHP de almacenar ciertas variables como las que se almacenan en la sesión o en las peticiones POST y GET es mediante arrays. Puedes ver la documentación sobre el uso del array $_SESSION aquí.
Tendrías que hacer $idaplantel = $_SESSION["idaplantel"] para que funcione la consulta.

A: Tu código SQL es semánticamente correcto (PERO MUY INSEGURO, ¡¡¡OJO CON LA INYECCIÓN SQL!!!, buscá un tutorial en Google sobre cómo prevenirla)
Pero... ¿Por qué estás tratando $idaplantel como una cadena alfanumérica? Si es un valor numérico, las comillas no van:
select * from dprestamo where idplantel = $idaplantel

En todo caso, apuesto a que $idaplantel está mal inicializada. En situaciones como esta hacé un echo() de la sentencia SQL que estás ejecutando, y correla en tu cliente SQL de forma manual. El 99% de las veces el error resulta evidente. Apuesto a que si hacés un echo() de esa sentencia justo antes de correrla, te va a salir algo como:
select * from dprestamo where idplantel = ''


text:
Q: Regex - Issues with using Boundary to excluding words In my authentification web site, I'm using regex to control a blacklist password. (example of blacklisted password : 12345678, 123456789, baseball, football)
I would like to add new regex rule (using boundary), which will exclude words (black listed password). I have read some similar questions on StackOverflow and tried to declare it with something like this:
^(?!\b12345678\b|\b123456789\b|\bbaseball\b|\bfootball\b|\bsuperman\b).*$

this regex doesn't match the words above, it's correct. For exemple "Baseball" with a letter, number or special character (before or after the "baseball") must match.
But "baseball!" doesn't match contrary to "!baseball". Can you give me some advices how to do it?

A:
But "baseball!" doesn't match contrary to "!baseball"…

baseball! doesn't match because your pattern doesn't allow baseball at the beginning (^ followed by a negative lookahead for baseball).
!baseball in contrast matches because ! is placed at the beginning, and the negative lookahead is done only there, not aft.
One could think of putting the .* at different places, but that will lead to nothing.
Just include the anchors ^ $ in the lookahead:
(?!^(12345678|123456789|baseball|football|superman)$)^.*$

(in fact, we could even drop the initial ^).


text:
Q: How to bind up and down arrow key to enable navigating through table rows? I'm displaying search results with a table. Each result has a button for user to click on to show the full detail of it. That's working well.
What I also want is to make it possible to navigat the search results by using keyboard's up and down arrow.
Now, user have to click on the Select button or tab to the button and press space bar.
I suppose I can trap the keyup and down event and then find the previous or next one I need to select and then set it, but it sounds like a lot of work. I wonder if there's a better way to do it?
javascript
var myModel = new function() {
    var self = this;

    self.selectedResult = ko.observable(new MyObj());
    self.searchResults = ko.observableArray();
    self.navUpDown = function (item, evt) {
        if (evt.keyCode == 38) { // up
            var id = item.ID();
            // find previous one and set selectedResult
        }

        if (evt.keyCode == 40) { // down
            var id = item.ID();
            // find next one and set selectedResult
        }
    };
};

html

            table header 1
            table header 2

                <button class="btn btn-small" data-bind="click: $parent.selectResult">Select</button>

A: I think this is what you are looking for.
var myModel = new function () {
        var self = this;
        self.selectResult = function (item) {
            self.selectedResult(item);
        };
        self.selectedResult = ko.observable();
        self.searchResults = ko.observableArray([{
            data1: "1",
            data2: "2"
        }, {
            data1: "2",
            data2: "2"
        }, {
            data1: "3",
            data2: "2"
        }]);

        self.selectPrevious = function () {
            var index = self.searchResults().indexOf(self.selectedResult()) - 1;
            if (index < 0) index = 0;
            self.selectedResult(self.searchResults()[index]);
        };

        self.selectNext = function () {
            var index = self.searchResults().indexOf(self.selectedResult()) + 1;
            if (index >= self.searchResults().length) index = self.searchResults().length - 1;
            self.selectedResult(self.searchResults()[index]);
        };

    };
ko.applyBindings(myModel);

$(window).keyup(function (evt) {
    if (evt.keyCode == 38) {
        myModel.selectPrevious();
    } else if (evt.keyCode == 40) {
        myModel.selectNext();
    }
});

See Fiddle
I hope it helps.

A: It's actually not that hard to find next and prev
For example
$(window).keyup(function (evt) {
    if (evt.keyCode == 38) { // up
       $('tbody tr:not(:first).selected').removeClass('selected').prev().addClass('selected')
    }
    if (evt.keyCode == 40) { // down
       $('tbody tr:not(:last).selected').removeClass('selected').next().addClass('selected')
    }
});

FIDDLE


text:
Q: Ubuntu 18.04 Keyboard Layout Bug My problem is that whichever keyboard layout  I choose as second keyboard layout, it is always english qwerty. How can I solve this bug.

A: I have somehow managed the situtation. I just randomly include and exclude keyboard layouts and after a long time I found the true keyboard layout. It is just too weird and every time I install 18.04 I am encountering with this issue.

A: I had the exact problem. I solved it by adding my second language, then I removed the English(main language) and I could type in the second language. Then I added the English layout again and the problem was fixed.


text:
Q: Backup npm packages registry We are becoming more and more dependent on public open-source repositories – And I was wondering if one of the packages or dependencies is down or no longer online – we'd be screwed if we do not have a plan B.
Is there any project that allows you to scan all you Github project "package.json/yarn.lock" – and backup in your own VM all dependencies that you used for your project. That would be a failover registry in case something goes south.
Any thoughts?

A: You could use a self-hosted caching NPM proxy like https://verdaccio.org/ .
Install from it (forcefully) to make it cache your requested packages.
npm install --force --registry https://your.npm.proxy

Restore is a simple unforced
npm install --registry https://your.npm.proxy


text:
Q: Request rejected if MVC controller action called twice simultaneously I am new to MVC and I have a controller that has the following Actions:

*

*Index

*FileUpload

For FileUpload we upload big files to be filled in the database, in this function many database calls occur (Create and Delete).
I have noticed that when 2 users call FileUpload at the same time, 1 of the requests gets rejected and the user needs to upload the file again.
How can I fix this issue?

A: Your code that fills the database is probably causing dead-locks (locking same tables), and most likely an exception is thrown causing a 500 http status code.
(Your filling code tries to change same db row, causing a dead-lock and the second attempt to fail)


text:
Q: Datatable fixed column width Hi I am using the datatable to display some data in our website but some reason I am not able to fix the column width to a fixed size, its calculating column width automatically.
I have tried specifying the {"sWidth": "30px;"} for the columns but no luck.
Here I am giving my code which renders the table
    jQuery('#dynamic')
        .html('

');

    jQuery('#settingsGrid').dataTable({
//      "bJQueryUI": true,
        "sPaginationType": "full_numbers",
        "aaData":  aDataSet,
        "aoColumns": [
          {"sTitle":"catId", "bVisible": false},
          {"sTitle" : "Name","sWidth": "30px;"},
          {"sTitle" : "Email","sWidth": "30px;"},
          {"sTitle" : "Phone no","sWidth": "30px;"},
          {"sTitle" : "Location","sWidth": "30px;"},
          {"sTitle" : "No of Properties","sWidth": "30px;"},
          {"sTitle" : "Web Site URL","sWidth": "30px;"},
          {"sTitle" : "Created Date","sWidth": "30px;"}
          ],
          "aoColumnDefs": [ {
              "aTargets": [ 0 ],
              "mRender": function ( data, type, row ) {
                    return data +' '+ row[3];
              }
          }
          ],
          "bAutoWidth": false,
          "bDeferRender": true,
          "sScrollY": "350",
          "bScrollCollapse": true,
          "bFilter" : false,
          "bSort" : false,
          "bInfo" : false,
          "bLengthChange": false,
          "iDisplayLength": 10,
          "oLanguage": {
            "sEmptyTable": "No categories available in your name"
          },
          "oLanguage": {
              "sInfoEmpty": "No entries to show"
          },
    });

Can anyone guide me where I am going wrong?
Here is a output what I am getting, basically I need to shrink the website column.

A: Try this piece of code in css:
 #settingsGrid td {
     width: 30px !important;
   }


text:
Q: android asynctask attempt I am trying to implement asynctask in a twitter oauth activity, but I get 2 errors. I would like the asynctask to return a consumer object.
Here's my code:
class getCommonsHttpConsumer extends AsyncTask<Void, Void, Void> {

@Override
protected OAuthConsumer doInBackground() {

    return new CommonsHttpOAuthConsumer(Constants.CONSUMER_KEY, Constants.CONSUMER_SECRET);
}
}

I get two errors

*

*getCommonsHttpConsumer: The type getCommonsHttpConsumer must implement the inherited abstract method AsyncTask.doInBackground(Void...)

*doInBackground(): The method doInBackground() of type getCommonsHttpConsumer must override or implement a supertype method
what am I doing wrong?

A: If you look into the docs of AsyncTask, you'll see this:-
AsyncTask<Params, Progress, Result>

Since, you've given your AsyncTask<Void, Void, Void> as this, your
protected OAuthConsumer doInBackground()

is throwing those errors.
Change the return type of doInBackground() to either Void or the AsyncTask to AsyncTask<Void, Void, OAuthConsumer> to fix it.

A: Read what the compiler is telling you and also get familiar with the documentation. You need to change the parameterization on the class declaration to declare that doInBackground will return a OAuthConsumer Also have doInBackground() accept in Void... (varargs):
class getCommonsHttpConsumer extends AsyncTask<Void, Void, OAuthConsumer> {

@Override
protected OAuthConsumer doInBackground(Void... params) {

Also a good explanation (aside from the docs) can be found here.

A: Here's what to do:
class getCommonsHttpConsumer extends AsyncTask<Void, Void, OAuthConsumer> {

    @Override
    protected OAuthConsumer doInBackground() {

        return new CommonsHttpOAuthConsumer(Constants.CONSUMER_KEY, Constants.CONSUMER_SECRET);
    }

    @Override
    protected void onPostExecute(OAuthConsumer result) {
        // process result
    }
}

Check documentation for more detail.


text:
Q: Getting text from editText after pressing enter I am trying to create an application with android. I use an EditText and want to get the text from it after the user presses the "enter" key on its keyboard. This is the XML code for the editText:
<EditText
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:id="@+id/nameTxt"
    android:ems="8"
    android:layout_below="@+id/textView"
    android:layout_alignParentRight="true"
    android:layout_alignParentEnd="true"
    android:layout_marginTop="45dp"
    android:layout_toRightOf="@+id/textView2" />
<ListView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:id="@+id/listView"
    android:layout_below="@+id/textView2"
    android:layout_alignParentLeft="true"
    android:layout_alignParentStart="true"
    android:layout_marginTop="36dp"
    android:layout_above="@+id/btnClr" />

In my .Java class I have these relevant rows:
ArrayList<String> listItems=new ArrayList<String>();
ArrayAdapter<String> adapter;

And that function:
public void openAddFriend(View view) {
    String txt;
    final EditText editName;
    editName = (EditText)findViewById(R.id.nameTxt);
    ListView lst;

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

    txt = editName.getText().toString();

    listItems.add(txt);
    adapter=new ArrayAdapter<String>(this,
            android.R.layout.simple_list_item_1,listItems);

    lst.setAdapter(adapter);

}

My goal is to get the string from the EditText and inserts it into a listView. I've tried using OnKeyListener but it didn't work. Can someone give me a direction to a solution? Thank you in advance

A: use this
match the actionid with the appropriate IME_ACTION (this depends on the what ime options you have set on the edittext. see).


text:
Q: Understanding alien methods in Java concurrency I'm reading J. Bloch's effective Java and now I'm at the section about alien methods.
I'm trying to understand alien methods in Java concurrency and the harm they could do. As he said, we basically don't know what alien methods could do and we may end up deadlocking. I tried to reproduce such a deadlocking behavior writing the following simple app (The alien method is in the same class for simplicity):
public class App {
    private static StringBuffer lines = new StringBuffer();

    public static void modifyLines(){
        System.out.println("Invocation modifyLines() started by " + Thread.currentThread().getName());
        synchronized (lines) {
            System.out.println("Entering modifyLines() synchronized " + Thread.currentThread().getName());
            lines.append("Modified");
        }
    }

    public static void main(String[] args) throws InterruptedException {
        synchronized (lines) {
            System.out.println("Entering main() synchronized by " + Thread.currentThread().getName());
            alienMethod();
        }
    }

    public static void alienMethod(){
        ExecutorService es = Executors.newSingleThreadExecutor();
        es.submit(new Runnable() {
            @Override
            public void run() {
                modifyLines();
            }
        });
        es.shutdown();
    }
}

I expected a deadlock to take place and that the thread spawned by calling to alienMethod() would never enter the synchronized block within modifyLines(). But the program prints the following:
Entering main() synchronized by main
Invocation modifyLines() started by pool-1-thread-1
Entering modifyLines() synchronized pool-1-thread-1

Which means the deadlock did not happen. Why? What's wrong with the alien method example?

A: This is a very old question and answer is also accepted but I had to took time to dig this old grave because I think answer is not entirely correct and could mislead.
Let me first start by highlighting how accepted answer is broken - if you run with es.awaitTermination(2, TimeUnit.SECONDS); then you will not get deadlock, because there was never a deadlock situation in the given code. Deadlock occurs when you have 2 threads waiting for each other to release a lock, typically for a deadlock to occur you would have at least 2 locks and 2 threads. As per the suggested answer, what was happening was that main thread was held using awaitTermination and since the main thread is holding the lock so the new thread had to "wait" until main thread releases the lock, now with Long.MAX_VALUE this wait period was too huge so it looked like a deadlock, but actually it was "waiting" instead of deadlock, and there is a difference in deadlock and waiting, in order to resolve a deadlock you have to adjust your locking code.
Now coming to alien methods: basically for a class a method would be considered as a "alien method" if it doesn't have any information about it or in other words implementation details of the method, now typically each class would not have any information about other class implementations (and this is what is expected also - "loose coupling") so "as such" every method of class B is "alien" for class A but we don't consider it alien in general context because that's what is expected, we call methods as alien methods only in context of synchronization, so when there is a synchronization and from the synchronized block a method is called for which the object doesn't have any information and object cannot be sure if it could result in deadlock then that method is called as "alient method".
Now, below is an example code to demonstrate (*read code comments marked with "*****"*) alien method, it shows that how depending on what the client method is doing, a deadlock may occur or a deadlock may not occur; here you have deadlock and not waiting, I have not used any waiting code.
SetObserver.java:
public interface SetObserver {
    void added(MyClass mc, SetObserver sc);
}

MyClass.java:
import java.util.concurrent.*;

public class MyClass {

    static Object o1 = new Object();

    public void test1(){
        synchronized(o1){
            System.out.println("test1");
        }
    }

    public void test3(SetObserver sc) throws InterruptedException{
        synchronized(o1){
            for (int i = 0; i < 100; i++) {
                System.out.print("test3 >>" + i);
                sc.added(this, sc);
                synchronized(sc){
                    System.out.println("<<");
                }
            }
        }
    }

    public static void main(String[] args) throws InterruptedException {
        MyClass mc = new MyClass();
        mc.test3(new SetObserver() {

            @Override
            public void added(final MyClass mc, final SetObserver sc) {
                // ***** This will not cause deadlock because it doesn't spawn a new thread, even though it synchronize on same object. *****
                /*synchronized(sc){
                    mc.test1();
                }*/

                // ***** This causes a deadlock because it spawns a new thread, so it will cause lock contention among threads. *****
                ExecutorService xc = Executors.newFixedThreadPool(1);
                xc.execute(new Runnable() {

                    @Override
                    public void run() {
                        synchronized(sc){
                            System.out.println("Calling test1");
                            mc.test1();
                        }
                    }
                });
                xc.shutdown();
            }
        });
    }
}

A: Your alienMethod() does not wait till the submitted task is finished. If you wait for it, you will have a deadlock:
public static void alienMethod() throws InterruptedException{
    ExecutorService es = Executors.newSingleThreadExecutor();
    es.submit(new Runnable() {
        @Override
        public void run() {
            modifyLines();
        }
    });
    es.shutdown();
    es.awaitTermination(Long.MAX_VALUE, TimeUnit.SECONDS);
}


text:
Q: Why my jsp page values are not loaded into my action with a link method I have an JSP page which has multiple buttons and a link all of which call methods in my action java page (code is below).  When I click on a button, the action's prepare method is called, followed by the setters for the JSP page values, followed by the method attached to the button.  But when I click on the link the prepare method is called, followed by the method attached to the link.  The setters aren't called so I can't access any of the JSP page values.  Is there a way around this issue?  Thanks for any help!
<s:form action = "commentAction" validate="true" method="post" id="commentAction" enctype = "multipart/form-data">
    <s:if test="%{showAddButton == true}">
        <s:submit method="add" key="button.add" cssClass="submit" onclick="clearDirtyFlag();" tabindex="15"/>
    </s:if>
    <s:if test="%{showSaveButton == true}">
        <s:submit method="save" key="button.save" cssClass="submit" onclick="clearDirtyFlag();" tabindex="16"/>
    </s:if>
    <s:submit method="reset" key="button.clear" cssClass="submit" onclick="clearDirtyFlag(); document.getElementById('commentAction').reset();"  tabindex="17"/>

    <s:iterator value="commentViewList" >
        <s:url var="commentLink" action="commentAction" method="getCommentDetails">
            <s:param name="commentId"><s:property value="commentInfo.commentId"/></s:param>
        </s:url>

<s:a href="%{commentLink}"  tabindex="18"><s:property value="commentTypeCode"/></s:a>

    </s:iterator>
</s:form>


text:
Q: JRXML Loading exception When I try to load the jrxml file it throws the exceptions below;
    net.sf.jasperreports.engine.JRException: org.xml.sax.SAXException:     http://java.sun.com/xml/jaxp/properties/schemaSource
    at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:300)
    at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:283)
    at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:272)
    at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:246)
    at com.ocs.cwb.view.ControllerCWBHome.generate_report(ControllerCWBHome.java:549)
    at com.ocs.cwb.view.ControllerCWBHome.access$19(ControllerCWBHome.java:529)
    at com.ocs.cwb.view.ControllerCWBHome$3.handle(ControllerCWBHome.java:252)
    at com.ocs.cwb.view.ControllerCWBHome$3.handle(ControllerCWBHome.java:1)
    at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(Unknown Source)
    at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source)
    at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source)
    at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(Unknown Source)
    at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
    at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
    at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
    at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
    at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
    at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
    at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
    at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
    at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
    at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
    at com.sun.javafx.event.EventUtil.fireEventImpl(Unknown Source)
    at com.sun.javafx.event.EventUtil.fireEvent(Unknown Source)
    at javafx.event.Event.fireEvent(Unknown Source)
    at javafx.scene.Node.fireEvent(Unknown Source)
    at javafx.scene.control.Button.fire(Unknown Source)
    at com.sun.javafx.scene.control.behavior.ButtonBehavior.mouseReleased(Unknown Source)
    at com.sun.javafx.scene.control.skin.BehaviorSkinBase$1.handle(Unknown Source)
    at com.sun.javafx.scene.control.skin.BehaviorSkinBase$1.handle(Unknown Source)
    at com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(Unknown Source)
    at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(Unknown Source)
    at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source)
    at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source)
    at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(Unknown Source)
    at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
    at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
    at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
    at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
    at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
    at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
    at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
    at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
    at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
    at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
    at com.sun.javafx.event.EventUtil.fireEventImpl(Unknown Source)
    at com.sun.javafx.event.EventUtil.fireEvent(Unknown Source)
    at javafx.event.Event.fireEvent(Unknown Source)
    at javafx.scene.Scene$MouseHandler.process(Unknown Source)
    at javafx.scene.Scene$MouseHandler.access$1500(Unknown Source)
    at javafx.scene.Scene.impl_processMouseEvent(Unknown Source)
    at javafx.scene.Scene$ScenePeerListener.mouseEvent(Unknown Source)
    at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(Unknown Source)
    at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$350(Unknown Source)
    at com.sun.javafx.tk.quantum.GlassViewEventHandler$$Lambda$154/20031384.get(Unknown Source)
    at com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(Unknown Source)
    at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(Unknown Source)
    at com.sun.glass.ui.View.handleMouseEvent(Unknown Source)
    at com.sun.glass.ui.View.notifyMouse(Unknown Source)
    at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
    at com.sun.glass.ui.win.WinApplication.lambda$null$145(Unknown Source)
    at com.sun.glass.ui.win.WinApplication$$Lambda$36/3326003.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Caused by: org.xml.sax.SAXException: http://java.sun.com/xml/jaxp/properties/schemaSource
    at org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1203)
    at org.apache.commons.digester.Digester.parse(Digester.java:1647)
    at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:296)
    ... 64 more

Here is my sample code;
try {
        JasperDesign jasperDesign = JRXmlLoader
                .load(new FileInputStream(
                        "I:/Projects/Sample/src/com/sam/cwp/report/sapmle.jrxml"));

        String sqlString = "SELECT*FROM Sample WHERE CNO= '156801'";
        JRDesignQuery designQuery = new JRDesignQuery();
        designQuery.setText(sqlString);
        jasperDesign.setQuery(designQuery);

        JasperReport jasperReport = JasperCompileManager
                .compileReport(jasperDesign);
        JasperPrint jasperPrint = JasperFillManager.fillReport(
                jasperReport, null, conn);

        JasperViewer.viewReport(jasperPrint);

    } catch (JRException e) {
        e.printStackTrace();
        System.out.println(e);
    } catch (FileNotFoundException e) {
        e.printStackTrace();
    }

Also I am using the JasperReport 6.0.3 latest version
commons-beanutils-1.4.jar
commons-digester-1.7.jar
commons-logging-1.0.3.jar
commons-collections-3.2.jar
itext-2.1.7.jar
I am unable to move to this line JasperDesign jasperDesign= JRXmlLoader.load(path);
Here is my XML;
    <?xml version="1.0" encoding="UTF-8"?>

<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="Sample" pageWidth="720" pageHeight="360" orientation="Landscape" columnWidth="300" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" uuid="f4d80783-e43a-4696-8470-2175aa6d0130">
    <property name="com.jaspersoft.studio.data.defaultdataadapter" value="MSSQL"/>
    <queryString>
        <![CDATA[SELECT * FROM sample]]>
    </queryString>
    <field name="ID" class="java.math.BigDecimal"/>
    <field name="OID" class="java.lang.String"/>
    <field name="CNO" class="java.lang.String"/>
    <field name="CUST_NO" class="java.lang.String"/>
    <field name="PAYMENT" class="java.lang.String"/>
    <field name="SHIPPHONENO" class="java.lang.String"/>
    <field name="SHIPCNA" class="java.lang.String"/>
    <field name="SHIPADDR1" class="java.lang.String"/>
    <field name="SHIPADDR2" class="java.lang.String"/>
    <field name="SHIPADDR3" class="java.lang.String"/>
    <field name="SHIPADDR4" class="java.lang.String"/>
    <field name="SHIPCOUNTRYID" class="java.lang.String"/>
    <field name="SHIPPOSTALCODE" class="java.lang.String"/>
    <field name="CONCNA" class="java.lang.String"/>
    <field name="CONPHONENO" class="java.lang.String"/>
    <field name="CONADDR1" class="java.lang.String"/>
    <field name="CONADDR2" class="java.lang.String"/>
    <field name="CONADDR3" class="java.lang.String"/>
    <field name="CONADDR4" class="java.lang.String"/>
    <field name="CONCOUNTRYID" class="java.lang.String"/>
    <field name="CONPOSTALCODE" class="java.lang.String"/>
    <field name="COPIES" class="java.lang.String"/>
    <field name="ATTN" class="java.lang.String"/>
    <field name="CONTENTS" class="java.lang.String"/>
    <field name="BFLYERS" class="java.lang.String"/>
    <field name="SFLYERS" class="java.lang.String"/>
    <field name="RUSER" class="java.lang.String"/>
    <field name="RDATE" class="java.lang.String"/>
    <field name="RTIME" class="java.lang.String"/>
    <field name="REMARKS" class="java.lang.String"/>
    <field name="PSTATUS" class="java.lang.String"/>
    <background>
        <band splitType="Stretch"/>
    </background>
    <title>
        <band height="127" splitType="Stretch">
            <textField>
                <reportElement x="81" y="44" width="79" height="20" uuid="48454381-ce78-46c8-a445-ffe05c226610">
                    <property name="local_mesure_unitheight" value="pixel"/>
                    <property name="com.jaspersoft.studio.unit.height" value="px"/>
                </reportElement>
                <textElement textAlignment="Center" verticalAlignment="Middle">

                </textElement>
                <textFieldExpression><![CDATA[$F{CNO}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="161" y="44" width="79" height="20" uuid="bc98f264-765e-4dd4-b32b-3571eb12e0cb">
                    <property name="local_mesure_unitheight" value="pixel"/>
                    <property name="com.jaspersoft.studio.unit.height" value="px"/>
                </reportElement>
                <textElement textAlignment="Center" verticalAlignment="Middle">

                </textElement>
                <textFieldExpression><![CDATA[$F{CUST_NO}]]></textFieldExpression>
            </textField>
            <staticText>
                <reportElement x="240" y="44" width="59" height="20" uuid="f82b9de0-aaed-45aa-bc2a-e3d960f829b4">
                    <property name="local_mesure_unitx" value="pixel"/>
                    <property name="local_mesure_unitheight" value="pixel"/>
                    <property name="com.jaspersoft.studio.unit.height" value="px"/>
                </reportElement>
                <textElement textAlignment="Center" verticalAlignment="Middle">

                </textElement>
                <text><![CDATA[SIN]]></text>
            </staticText>
            <textField>
                <reportElement x="180" y="87" width="160" height="20" uuid="e09f0461-c93c-4efb-a7a5-e1178b882fe5">
                    <property name="local_mesure_unitheight" value="pixel"/>
                    <property name="com.jaspersoft.studio.unit.height" value="px"/>
                </reportElement>
                <textElement textAlignment="Center" verticalAlignment="Middle">

                </textElement>
                <textFieldExpression><![CDATA[$F{SHIPPHONENO}]]></textFieldExpression>
            </textField>
            <componentElement>
                <reportElement x="580" y="1" width="120" height="88" uuid="8c3a74c7-a14f-494d-92cc-0f4c8064a72e"/>
                <jr:QRCode xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd">
                    <jr:codeExpression><![CDATA["123456789"]]></jr:codeExpression>
                </jr:QRCode>
            </componentElement>
            <textField>
                <reportElement x="525" y="89" width="79" height="20" uuid="c1f28961-fe50-4c90-a9d7-9475edfa6fe9">
                    <property name="local_mesure_unitheight" value="pixel"/>
                    <property name="com.jaspersoft.studio.unit.height" value="px"/>
                </reportElement>
                <textElement textAlignment="Center" verticalAlignment="Middle">

                </textElement>
                <textFieldExpression><![CDATA[$F{CONPHONENO}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="342" y="108" width="262" height="18" uuid="cdb21b18-d208-421e-9841-776825e9b167">
                    <property name="local_mesure_unitheight" value="pixel"/>
                    <property name="com.jaspersoft.studio.unit.height" value="px"/>
                </reportElement>
                <box leftPadding="15"/>
                <textElement verticalAlignment="Middle">

                </textElement>
                <textFieldExpression><![CDATA[$F{CONCNA}]]></textFieldExpression>
            </textField>
        </band>
    </title>
    <pageHeader>
        <band height="81" splitType="Stretch">
            <property name="local_mesure_unitheight" value="pixel"/>
            <property name="com.jaspersoft.studio.unit.height" value="px"/>
            <textField>
                <reportElement x="82" y="-18" width="258" height="18" uuid="0b9f5c28-9144-4e67-a491-a5ac4c1dce57">
                    <property name="local_mesure_unitheight" value="pixel"/>
                    <property name="com.jaspersoft.studio.unit.height" value="px"/>
                </reportElement>
                <box leftPadding="15"/>
                <textElement verticalAlignment="Middle">

                </textElement>
                <textFieldExpression><![CDATA[$F{SHIPCNA}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="82" y="0" width="258" height="18" uuid="6e1c4175-44fe-44aa-ad1d-9d5301387e1d">
                    <property name="local_mesure_unitheight" value="pixel"/>
                    <property name="com.jaspersoft.studio.unit.height" value="px"/>
                </reportElement>
                <box leftPadding="15"/>
                <textElement verticalAlignment="Middle">

                </textElement>
                <textFieldExpression><![CDATA[$F{SHIPADDR1}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="82" y="16" width="258" height="18" uuid="2165d829-3d8e-46e2-b7e5-315a711da4a2">
                    <property name="local_mesure_unitheight" value="pixel"/>
                    <property name="com.jaspersoft.studio.unit.height" value="px"/>
                </reportElement>
                <box leftPadding="15"/>
                <textElement verticalAlignment="Middle">

                </textElement>
                <textFieldExpression><![CDATA[$F{SHIPADDR2}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="82" y="32" width="258" height="18" uuid="a473cae7-27cb-406b-a2ac-211534511e52">
                    <property name="local_mesure_unitheight" value="pixel"/>
                    <property name="com.jaspersoft.studio.unit.height" value="px"/>
                </reportElement>
                <box leftPadding="15"/>
                <textElement>

                </textElement>
                <textFieldExpression><![CDATA[$F{SHIPADDR3}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="341" y="1" width="263" height="18" uuid="8374ca3f-dd60-43fa-9d94-5db5f47c0710">
                    <property name="local_mesure_unitheight" value="pixel"/>
                    <property name="com.jaspersoft.studio.unit.height" value="px"/>
                </reportElement>
                <box leftPadding="15"/>
                <textElement verticalAlignment="Middle">

                </textElement>
                <textFieldExpression><![CDATA[$F{CONADDR1}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="341" y="19" width="263" height="18" uuid="c88adb09-5661-4de4-90d0-f4af13b0ecca">
                    <property name="local_mesure_unitheight" value="pixel"/>
                    <property name="com.jaspersoft.studio.unit.height" value="px"/>
                </reportElement>
                <box leftPadding="15"/>
                <textElement verticalAlignment="Middle">

                </textElement>
                <textFieldExpression><![CDATA[$F{CONADDR2}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="341" y="38" width="263" height="18" uuid="a2ff1dc4-0ebd-4cce-9628-593579ad6151"/>
                <box leftPadding="15"/>
                <textElement verticalAlignment="Middle">

                </textElement>
                <textFieldExpression><![CDATA[$F{CONADDR3}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="281" y="56" width="59" height="20" uuid="2c56986c-d177-4836-8eee-ab4fd1280ea2">
                    <property name="local_mesure_unitheight" value="pixel"/>
                    <property name="com.jaspersoft.studio.unit.height" value="px"/>
                </reportElement>
                <textElement textAlignment="Center" verticalAlignment="Middle">

                </textElement>
                <textFieldExpression><![CDATA[$F{SHIPPOSTALCODE}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="388" y="56" width="107" height="20" uuid="996aca66-df72-4dac-be6e-125941c8fa12">
                    <property name="local_mesure_unitheight" value="pixel"/>
                    <property name="com.jaspersoft.studio.unit.height" value="px"/>
                </reportElement>
                <textElement textAlignment="Center" verticalAlignment="Middle">

                </textElement>
                <textFieldExpression><![CDATA[$F{CONCOUNTRYID}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="548" y="56" width="57" height="20" uuid="628b380b-5972-41af-8917-8cd8a20e162c"/>
                <textElement textAlignment="Center" verticalAlignment="Middle">

                </textElement>
                <textFieldExpression><![CDATA[$F{CONPOSTALCODE}]]></textFieldExpression>
            </textField>
        </band>
    </pageHeader>
    <columnHeader>
        <band height="151" splitType="Stretch">
            <textField>
                <reportElement x="128" y="-25" width="100" height="20" uuid="bab39829-f073-4973-9d70-9b0afa8c2e14">
                    <property name="local_mesure_unitheight" value="pixel"/>
                    <property name="com.jaspersoft.studio.unit.height" value="px"/>
                </reportElement>
                <textElement textAlignment="Center" verticalAlignment="Middle">

                </textElement>
                <textFieldExpression><![CDATA[$F{SHIPCOUNTRYID}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="351" y="110" width="174" height="-5" uuid="165a74a0-c477-4df0-8796-2f35f513eecb">
                    <property name="local_mesure_unitheight" value="pixel"/>
                    <property name="com.jaspersoft.studio.unit.height" value="px"/>
                </reportElement>
                <box leftPadding="10"/>
                <textElement verticalAlignment="Middle">

                </textElement>
                <textFieldExpression><![CDATA[$F{CONADDR3}]]></textFieldExpression>
            </textField>
        </band>
    </columnHeader>
</jasperReport>

A: I hope this is caused because of </jr:QRCode> in jasper source file. I am also facing this issue. Whenever I tried to insert QR codes to the report, if the Jasper version is below 6.0, Jasper is throwing SAX exception. And even with Jasper Studio v 6.0.4, it is generating blank report.
I hope this is a open issue with jasper and I found it on Jasper Community.
http://community.jaspersoft.com/jasperreports-server/issues/4681


text:
Q: How to avoid clearing the previously drawn points in Qt? I want to draw an image, pixel by pixel at run time. I use QPainter and paintEvent to draw. But when paintEvent is called each time, the previously drawn image is cleared and the new point has been drawn.
How to avoid clearing the previously drawn parts? I just want to append the new pixel point to the previously drawn points.
Lines::Lines(QWidget *parent)
    : QWidget(parent)
{
    m_timer = new QTimer(this);
    connect(m_timer, SIGNAL(timeout()), this, SLOT(updateStatus()));
    m_timer->start();
    m_x = 0;
    m_y = 0;
}

void Lines::paintEvent(QPaintEvent *event)
{
    QPen pen(Qt::black, 2, Qt::SolidLine);
    QPainter painter(this);
    painter.setPen(pen);
    painter.drawPoint(m_x, m_y);
}

void Lines::updateStatus()
{
    m_x++;
    m_y++;
    update();
}

A: paintEvent is supposed to do a complete redraw of the widget region specified in the event.
So you are responsible for buffering previous results.
It doesn't really make sense to change the desired output in paintEvent, as it may be randomly called and when it is called is out of your control.
If you want to avoid that you can use a QGraphicsView.
Buffering could be done using a QPixmap, which would be part of the Lines class. You draw the pixel in the pixmap (not in the paint event, in updateStatus), and draw the pixmap in the paint event.

A: QWidget::setAttribute( WA_OpaquePaintEvent, true );
prevents clearing the widget. However, this is just for optimization in case the widget does a complete repaint anyway.
You should follow Dr. Hirsch's advice.


text:
Q: Multiple applications to access the same DeckLink device (openCV and rtmp pushing)? What options do I have? Description:
I have a requirement that I must do two things to a single camera stream from a DeckLink device - OpenCV processing and RTMP live streaming. If it is relevant, the device is DeckLink 8K Pro.
The DeckLink device (one particular port) does not allow more than one application to access the video stream. My two applications are:

*

*C++ OpenCV application which must run image processing algorithms on the video stream.

*Unreal Media Server which must RTMP push the stream to a remote endpoint, which should redistribute the stream to clients.

Both applications must be running on the same Windows workstation.
Problem:
If either application is running, it has exclusive access to the video stream and the other application cannot read the stream, and there seems to be no solution to this problem.
So, I am really looking for a smart solution some of you may have implemented before or have an idea which might work for me.
My solution so far:
In this solution, Unreal Media Server is replaced with FFMPEG.
Since OP's effort must be put into the solution before posting here, I have been browsing through possible solutions the past week. I came up with an FFMPEG-based solution which is the only application which reads the DeckLink video stream and does exactly two things in a single command - pushes video packets via RTMP and creates a local UDP stream. And, OpenCV's VideoCapture class is able to pick up UDP stream. For testing, I have used Twitch as RTMP server and VLC as UDP tester. It works and it seems like a good solution except for the delay introduced in UDP streaming which is about 0.4 seconds. Unfortunately, I am not able to evaluate RTMP delay because Twitch introduces its own >5s delay on its own. But that is not a problem for now.
Here's the FFMPEG solution (Note I am using computer webcam here but same goes for DeckLink).
Steram via:
ffmpeg -threads:v 2 -threads:a 8 -filter_threads 2 -thread_queue_size 512 -y -f dshow -video_size 640x480 -pixel_format yuyv422 -framerate 30 -rtbufsize 100M -i video="HD WebCam" -f dshow -rtbufsize 100M -i audio="Microphone Array (Realtek High Definition Audio(SST))" -preset ultrafast -vcodec libx264 -tune zerolatency -b 900k -map 0:v:0 -f mpegts udp://127.0.0.1:5555 -pix_fmt yuv420p -c:v libx264 -qp:v 19 -profile:v high -rc:v cbr_ld_hq -level:v 4.2 -r:v 60 -g:v 120 -bf:v 3 -refs:v 16 -f flv rtmp://live-fra05.twitch.tv/app/stream_key

Play via:
ffplay -probesize 32 -sync ext udp://127.0.0.1:5555

I want to hear how you would improve my own solution to better fit the problem (e.g. less latency) or if you have a better solution than mine.
Thanks in advance.

A: Once the stream arrives to Unreal Media Server, you could start MPEG2-TS broadcasting that stream, using Unreal Media Server Configurator. Then your OpenCV's VideoCapture class will be able to pick up that MPEG2-TS UDP stream as well.


text:
Q: VerifyError: Error #1053: Illegal override of (Constructor) in (Class) I'm using Flash Builder 4.7 and I've come across a bizarre issue, without any changes to the class this is occurring in I get:
VerifyError: Error #1053: Illegal override of HUDScreen in mobile_ui.screens.HUDScreen.

This class extends Sprite, and implements an interface.  As far as I know, all methods in the interface have the proper prototypes.  There are no overridden properties or functions in this class.  We are using robotlegs for dependency injection as well, if that is relevant.
Class Definition
public class HUDScreen extends Sprite implements IHUDScreen
{
}

Constructor
public function HUDScreen()
{

}

Interface Definition
public interface IHUDScreen extends IEventDispatcher
{

}

I've tried cleaning the project, I've deleted and re-imported the project, I've changed the package from ui.screens.HUDScreen to mobile_ui.screens.HUDScreen.  Nothing changed the error.
Any other suggestions would be greatly appreciated at this point!
Thank you for your time.
Edit: I've added the class definition, interface definition, and constructor.
UPDATE: I've been able to move past this problem, I've outlined what I did in my answer below.  I'm still interested in anyone's thoughts or ideas on how this could have happened, or perhaps a more concrete solution.
Thanks again to everyone who took the time to view this question!

A: It seems this is caused by an incorrect implementation of an interface that the compiler doesn't detect. The following code snipped causes the error:
public class Foo implements IFoo
{
    public function bar():String { return ""; }
}

public interface IFoo
{
    function get bar():String;
}

The problem is caused by the fact that IFoo.bar is a getter, but Foo.bar() is a normal method. This is a kind of error that could be easily missed when looking through your code, and that would be fixed if you delete and rewrite everything.

A: I still have no idea why this happened or how.  However, I was able to get it working again.
My idea was to remove all the methods from the class, and add stubs for all the methods in the interface.  Then, add the actual methods back one-by-one until I could see possibly where the issue was occurring.
Bizarrely, after restoring the methods one at a time, and testing each time, it now works.
The class is (essentially, code is probably laid out slightly differently) the same, and now it works.
I'm still boggled, but at the very least I can move on for now.
Hopefully, this can help somebody somewhere.


text:
Q: How to connect Postgresql Docker Container with another Docker Container I want to connect mysoft docker container to postgresql docker container.
But i have some errors:
ERROR: for mysoft_db_1  Cannot start service db: driver failed programming external connectivity on endpoint mysoft_db_1 (XXX):
Error starting userland proxy: listen tcp 0.0.0.0:5432: bind: address already in use

ERROR: for db  Cannot start service db: driver failed programming external connectivity on endpoint mysoft_db_1 (XXX):
Error starting userland proxy: listen tcp 0.0.0.0:5432: bind: address already in use

here is my docker-compose.yml
version: '2'
services:
  mysoft:
    image: mysoft/mysoft:1.2.3
    ports:
      - "80:8080"
    environment:
      - DATABASE_URL=postgres://mysoft:PASSWORD@db/mysoft?sslmode=disable
  db:
    image: postgresql
    environment:
      - POSTGRES_USER=mysoft
      - POSTGRES_PASSWORD=PASSWORD
      - POSTGRES_DB=mysoft
    ports:
      - 5432:5432

I want use another, already running docker pg server to connect new soft, also one pg docker server, for more projects
Is it possible?

A: You should add links to the definition of mysoft service in docker-compose.yml. Then your db service will be accessible from mysoft container.
After that your service definition will look like this.
mysoft:
  image: mysoft/mysoft:1.2.3
  ports:
    - "80:8080"
  environment:
    - DATABASE_URL=postgres://mysoft:PASSWORD@db/mysoft?sslmode=disable
  links:
    - db

Now about error of binding. Probably, you receive it, because you have a local postgresql running on port 5432 or you already have a running docker container with 5432 port mapped to local machine.
ports:
  - 5432:5432

It is used for mapping ports to your local machine. And if you don't need to access container's db from it, just remove it.

I want use another, already running docker pg server to connect new
  soft, also one pg docker server, for more projects Is it possible?

Yes, it's possible. Use external_links.
If you choose this option:

*

*Remove the db service and links in mysoft service definition from your docker-compose.yml

*Add external_links with correct container name to mysoft service definition.

*Update host and port in DATABASE_URL according to the container name and postgresql port in it.

A: You might want to check of you already have a local postgres running on port 5432? If you do you can not do the ports 5432:5432 but have to expose the inner port to an other outer port e.g. 5555:5432
at least if you are using native docker (running on localhost)...


text:
Q: binary search tree impelemntation in python I am trying to implement binary search tree but facing some problem
in node insertion.
can any one help me to point out what is wrong in my python program?
addChild() function is not adding left child (4, "hans") correctly?
is there problem in my recursive function ?
thanks in advance.
class Node:
    def __init__(self, key = None, value = None, leftChild = None, rightChild = None, parent = None):
        self.key = key
        self.value = value
        self.leftChild = leftChild
        self.rightChild = rightChild
        self.parent = parent

    def get_key(self):
        return self.key

    def get_value(self):
        return self.value

    def get_leftChild(self):
        return self.leftChild

    def get_rightChild(self):
        return self.rightChild

    def set_leftChild(self, key, value):
        node = Node(key, value, None, None, self)
        self.leftChild = node

    def set_rightChild(self, key, value):
        node = Node(key, value, None, None, self)
        self.rightChild = node

    def isLeaf(self):
        if self.leftChild is None and self.rightChild is None:
           return True
        else:
           return False

class BinaryTree:
    def __init__(self, key = None, value = None, leftChild = None, rightChild = None, parent = None):
        self.root = Node(key, value, leftChild = None, rightChild = None, parent = None)

    def addChild(self, key, value):
        current = self.root
        if current is None:
           current = Node(key, value, leftChild = None, rightChild = None, parent = None)
        else:
           self._addChild(current, key, value)

    def _addChild(self, current, key, value):
        if current is None:
           current = Node(key, value, leftChild = None, rightChild = None, parent = current)
           return

        if current.isLeaf() is True:
            if current.get_key() > key:
               current.set_leftChild(key, value)
            else:
               current.set_rightChild(key, value)
            return
        elif current.get_key() > key:
                return self._addChild(current.get_leftChild(), key, value)
        elif current.get_key() <= key:
                return self._addChild(current.get_rightChild(), key, value)

    def traversalInOrder(self):
        if self.root is None:
            return None
        else:
            self._traversalInOrder(self.root)

obj = BinaryTree(10, "ram")
obj.addChild(12, "hari")
obj.addChild(4, "hans")

A: When current is None, you don't actually store the value in the tree but only in a local variable.
This way it should work:
class BinaryTree:
    def __init__(self):
        self.root = None

    def addChild(self, key, value):
        current = self.root
        if current is None:
          self.root = Node(key, value, leftChild = None, rightChild = None, parent = None)
        else:
          self._addChild(current, key, value)

    def _addChild(self, current, key, value):
        if current.get_key() > key:
          child = current.get_leftChild()
          if child is None:
            current.set_leftChild(key, value)
          else:
            self._addChild(child, key, value)
        else:
          child = current.get_rightChild()
          if child is None:
            current.set_rightChild(key, value)
          else:
            self._addChild(child, key, value)

obj = BinaryTree()
obj.addChild(10, "ram")
obj.addChild(12, "hari")
obj.addChild(4, "hans")


text:
Q: how to open playstore app with update page programmatically from my app I am comparing version of my app on google play store and version of app in play store. So whenever new version of app get uploaded it shows dialog to user to update the app, but when i click on "Update Button" in dialog, it opens play store with "Open" and "Uninstall" button instead of "Update" and "Uninstall" button.
So please tell me how to open play store app with "Update" and "Uninstall" button when new version is uploaded on play store.
here's my code to open play store.
AlertDialog.Builder  dialogUpdate= new AlertDialog.Builder(Main_list_Activity.this,AlertDialog.THEME_TRADITIONAL).setTitle("New Version Available")
                .setIcon(getResources()

                .getDrawable(android.R.drawable.stat_sys_download))
                .setMessage("New version of app is available. Update your app")
                .setCancelable(false)
                .setNeutralButton("UPDATE", new DialogInterface.OnClickListener() {

                    @Override
                    public void onClick(DialogInterface dialog, int which) {
                        // TODO Auto-generated method stub

                        try {
                            startActivity(new Intent(Intent.ACTION_VIEW,Uri.parse("market://details?id="+getPackageName())));
                        } catch (ActivityNotFoundException e) {
                            // TODO: handle exception

                            startActivity(new Intent(Intent.ACTION_VIEW,Uri.parse("https://play.google.com/store/apps/details?id=" + getPackageName())));

                        }

                    }
                });

    AlertDialog updatedialog = dialogUpdate.create();

        updatedialog.show();

A: Google does not provide any api to get the lattest version of application code.
Google does not provide any API for that.
Nevertheless , you can make an http request on the web version of the playstore (https://play.google.com/store/apps/details?id=your.namespace)
To make the request you can use DefaultHttpClient
Once you get the page content you should parse it (jsoup is a good solution) and search for :
<div class="content" itemprop="softwareVersion"> 2.2.0  </div>

Once you find this part of the page , you can extract the version number and compare it with the one available in your app :
try
{
    String version = this.getPackageManager().getPackageInfo(this.getPackageName(), 0).versionName;
    if( ! version.equals(versionFromHTML))
    {
        Toast.makeText(this, "New version available on play store", Toast.LENGTH_SHORT);
    }

}
catch (NameNotFoundException e)
{
    //No version do something
}

For the HTML parsing part , have a look here
Keep in mind that everybody won't see the new version in the same time. It could take time to be propagated (probably because of cache).

A: Visit this link https://developer.android.com/guide/playcore/in-app-updates which might help you for what you are looking for. If its matches with your need / requirement kindly up vote this thread.


text:
Q: Send Image to .PHP directly without using Base64 In the project I'm currently working for a company I need to send an image to a .php on a server which will save it on a folder and then send back the url so I can save it on a table from a DB.The company wants me to send the raw image instead of converting it to base64, send it and decode it on the .php file
My question is, Is this possible? and if so, how can I do it?
Thanks for the help.

A: Yes, it is possible.
Check your php.ini and make sure this line is like this:
file_uploads = On

Create html form:
<!DOCTYPE html>
<html>
<body>

<form action="upload.php" method="post" enctype="multipart/form-data">
    Select image to upload:
    <input type="file" name="fileToUpload" id="fileToUpload">
    <input type="submit" value="Upload Image" name="submit">
</form>

</body>
</html>

And creat upload.php file:
<?php
$target_dir = "uploads/";
$target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]);
$uploadOk = 1;
$imageFileType = pathinfo($target_file,PATHINFO_EXTENSION);
// Check if image file is a actual image or fake image
if(isset($_POST["submit"])) {
    $check = getimagesize($_FILES["fileToUpload"]["tmp_name"]);
    if($check !== false) {
        echo "File is an image - " . $check["mime"] . ".";
        $uploadOk = 1;
    } else {
        echo "File is not an image.";
        $uploadOk = 0;
    }
}
// Check if file already exists
if (file_exists($target_file)) {
    echo "Sorry, file already exists.";
    $uploadOk = 0;
}
// Check file size
if ($_FILES["fileToUpload"]["size"] > 500000) {
    echo "Sorry, your file is too large.";
    $uploadOk = 0;
}
// Allow certain file formats
if($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg"
&& $imageFileType != "gif" ) {
    echo "Sorry, only JPG, JPEG, PNG & GIF files are allowed.";
    $uploadOk = 0;
}
// Check if $uploadOk is set to 0 by an error
if ($uploadOk == 0) {
    echo "Sorry, your file was not uploaded.";
// if everything is ok, try to upload file
} else {
    if (move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], $target_file)) {
    echo "The file ". basename( $_FILES["fileToUpload"]["name"]). " has been     uploaded.";
    } else {
        echo "Sorry, there was an error uploading your file.";
    }
}
?>

To assure it all works, create a folder named uploads, and make sure file permissions and ownership are ok.
Hope it helps you.


text:
Q: I can't get my ubuntu server VirtualBox guest with bridged adapter seen outside of my lan, although port forwarded to 80 I have installed Ubuntu Server 14.04.1 on VirtualBox. With LAMP all configured.
The box has static ip 192.168.1.104 and bridged to my host's Wireless adapter. I can successfully access Apache's index page from my home's local network.
Setup port forwarding on my router to port 80 of this server. However, it gives me timeout error when I browse using my public ip or Dynamic DNS name.
Note: Port forwarding on my router succeeded to connect my Windows PC's Apache, as well as Arduino server.
Here is nmap localhost results:
Starting Nmap 6.40 ( http://nmap.org ) at 2014-09-25 23:04 EEST
Nmap scan report for localhost (127.0.0.1)
Host is up (0.00044s latency).
Other addresses for localhost (not scanned): 127.0.0.1
rDNS record for 127.0.0.1: userver
Not shown: 986 closed ports
PORT      STATE SERVICE
21/tcp    open  ftp
22/tcp    open  ssh
25/tcp    open  smtp
53/tcp    open  domain
80/tcp    open  http
110/tcp   open  pop3
139/tcp   open  netbios-ssn
143/tcp   open  imap
443/tcp   open  https
445/tcp   open  microsoft-ds
993/tcp   open  imaps
995/tcp   open  pop3s
3306/tcp  open  mysql
10000/tcp open  snet-sensor-mgmt

Nmap done: 1 IP address (1 host up) scanned in 0.12 seconds

Any help to get my ubuntu reachable to internet is appreciated!

A: I ran into this same exact problem a while ago. After spending way too much time troubleshooting and trying to figure out why it wouldn't work, I found out it was not a problem with my configuration.
Most of the time, your ISP (internet service provider) blocks calls to port 80. (Example: List of ports blocked by Cox)
This means that although you are redirecting calls to port 80 to your machine, they are never actually receiving those calls to begin with.
Try to google your ISP and see if they block any ports. Then try forwarding to a port they don't block, and append that port to the url. (Example: forward to port 1234, do http:// your ip:1234). If that works, but port 80 doesn't then that is the problem.