text:
Q: How to launch Firefox browser through GeckoDriver and Selenium I am trying to launch the selenium web browser I am able to open the Firefox browser but unable to open the google help me out with this error which I am facing
package selenium1;

import org.openqa.selenium.WebDriver;
//import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

public class selenium2 {
    public static void main(String[] args) throws Exception {

        System.out.println("hello world ");
        System.setProperty.("webdriver.firefox.marionette","/Users/bindumalini.n/Downloads/geckodriver.exe";
        WebDriver driver = new FirefoxDriver();
        driver.quit();
        driver.get("www.gmail.com");
        System.out.println("hello");
    }
}

output//

hello world
  Exception in thread "main" org.openqa.selenium.WebDriverException: Timed out waiting 45 seconds for Firefox to start.
  Build info: version: '3.14.0', revision: 'aacccce0', time: '2018-08-02T20:05:20.749Z'
  System info: host: 'BLRJPT6861D', ip: 'fe80:0:0:0:148a:bc94:9bd4:8a04%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.13.6', java.version: '1.8.0_141'
  Driver info: driver.version: FirefoxDriver
      at org.openqa.selenium.firefox.XpiDriverService.waitUntilAvailable(XpiDriverService.java:133)
      at org.openqa.selenium.firefox.XpiDriverService.start(XpiDriverService.java:118)
      at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:79)
      at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:548)
      at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:212)
      at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:130)
      at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:125)
      at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:103)
      at selenium1.selenium2.main(selenium2.java:13)
  Caused by: org.openqa.selenium.net.UrlChecker$TimeoutException: Timed out waiting for [http://localhost:48007/hub/status] to be available after 45005 ms
      at org.openqa.selenium.net.UrlChecker.waitUntilAvailable(UrlChecker.java:100)
      at org.openqa.selenium.firefox.XpiDriverService.waitUntilAvailable(XpiDriverService.java:131)
      ... 8 more
  Caused by: java.util.concurrent.TimeoutException
      at java.util.concurrent.FutureTask.get(FutureTask.java:205)
      at com.google.common.util.concurrent.SimpleTimeLimiter.callWithTimeout(SimpleTimeLimiter.java:156)
      at org.openqa.selenium.net.UrlChecker.waitUntilAvailable(UrlChecker.java:75)
      ... 9 more

A: You used driver.quit(); before navigating, this quits this driver and closes the associated window.
Move it to the end of the script (or after the last use)
public static void main(String[] args) throws Exception {
    System.out.println("hello world ");
    System.setProperty.("webdriver.firefox.marionette","/Users/bindumalini.n/Downloads/geckodriver.exe";
    WebDriver driver = new FirefoxDriver();
    driver.get("www.gmail.com");
    driver.quit();
    System.out.println("hello");
}

A: As you are using Selenium v3.14.0 instead of webdriver.firefox.marionette you need to use GeckoDriver manadatorily as webdriver.gecko.driver.
Additionally, as you are on Mac OS X you have to download geckodriver-v0.23.0-macos.tar.gz from mozilla/geckodriver and while specifying the absolute path you need to remove the extension (i.e. .exe)
You can use the following solution:
package selenium1;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

public class selenium2 {
    public static void main(String[] args) throws Exception {

    System.out.println("hello world ");
    System.setProperty.("webdriver.gecko.driver","/Users/bindumalini.n/Downloads/geckodriver");
    WebDriver driver = new FirefoxDriver();
    driver.get("www.gmail.com");
    System.out.println("hello");
    driver.quit();
    }
}

A: Try this one hope it's helping you. This is a BrowserDynamically Selenium Code...
If you still facing any issue please confirm.
package com.selenium;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.edge.EdgeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.ie.InternetExplorerDriver;
import org.openqa.selenium.opera.OperaDriver;
import org.testng.annotations.Test;
/**
 * @author mohitjaiswal
 *
 */
public class BrowserDynamically {
WebDriver driver = null;
String browser = "chrome";

(Pass here browser name like "chrome","firefox","edgeBrowser","opera","IE" as in string: which you want to open browser)
String edgePath = "/Users/mohitjaiswal/Documents/\"\n" +
                    "+ \"My-Data/Selenium Libraries/Drivers/MicrosoftWebDriver.exe";
String chromePath = "/Users/mohitjaiswal/Documents/"
        + "My-Data/Selenium Libraries/Drivers/chromedriver";
String firefoxPath = "/Users/mohitjaiswal/Documents/"
        + "My-Data/Selenium Libraries/Drivers/geckodriver";
String opraPath = "/Users/mohitjaiswal/Documents/"
        + "My-Data/Selenium Libraries/Drivers/operadriver";
String iePath = "/Users/mohitjaiswal/Documents/"
        + "My-Data/Selenium Libraries/Drivers/IEDriverServer.exe";

public void invokeBrowser(String browserName) {

    if(browserName.equalsIgnoreCase("chrome")) {
        System.setProperty("webdriver.chrome.driver", chromePath);
        driver = new ChromeDriver();
    }else if (browserName.equalsIgnoreCase("firefox")) {
        System.setProperty("webdriver.gecko.driver", firefoxPath);
        driver = new FirefoxDriver();
    }else if (browserName.equalsIgnoreCase("edgeBrowser")) {
        System.setProperty("webdriver.edge.driver", edgePath);
        driver = new EdgeDriver();
    }else if (browserName.equalsIgnoreCase("opera")) {
        System.setProperty("webdriver.opera.driver", opraPath);
        driver = new OperaDriver();
    }else if (browserName.equalsIgnoreCase("IE")) {
        System.setProperty("webdriver.ie.driver", iePath);
        driver = new InternetExplorerDriver();
    }
}

@Test
public void invokeApplication() {
    invokeBrowser(browser);
    driver.get("https://www.google.com");
    driver.manage().window().maximize();
    driver.close();
}

}


text:
Q: How to call contract function from other contract in Ethereum I have a deployed contract "greeter" in Ethereum
contract mortal {
    address owner;
    function mortal() { owner = msg.sender; }

    function kill() { if (msg.sender == owner) selfdestruct(owner); }
}

contract greeter is mortal {
    string greeting;

    function greeter(string _greeting) public {
        greeting = _greeting;
    }
    function greet() constant returns (string) {
        return greeting;
    }
}

And I want to create another contract, which will call function "kill" from my first contract. The main idea is that this 2 contracts is different. I publish contract A and then publish contract B, which calls A.
How I can do that?
Something like this, but from contract...
var contract = web3.eth.contract(contractAddress, ABI);
contract.call().kill();

A: Approximately like this, but there's a catch.
pragma solidity ^0.4.6;

contract Mortal {
  address owner;
  function Mortal() { owner = msg.sender; }

  function kill() { if (msg.sender == owner) selfdestruct(owner); }
}

contract Greeter is Mortal {
  string greeting;

  function Greeter(string _greeting) public {
    greeting = _greeting;
  }
  function greet() constant returns (string) {
    return greeting;
  }
}

contract Killer {

  function destroyVictim(address victim) {
    Greeter g = Greeter(victim);
    g.kill();
  }
}

That's a basic syntax. The ABI gets picked up by including Greeter in the source file along with Killer; that is, the compiler can "see it".
So far, so good.
The issue that arises is that Greeter is going to ignore the command, owing to if(msg.sender==owner). It won't be. It will be whatever address Killer got.
A possible solution to this before Greeter is deployed is to anticipate the need for a changeOwner() function, usually reserved for only the current owner.
Hope it helps.

redpajama_set_name: RedPajamaStackExchange


text:
Q: How to get correct response from SOAP in Android? I am beginner in Android, and i am stuck here for quite some time...
MY PROBLEM: that is the response i get,  not the xml file that is expected but this:
## <xs:element name="dsKurs" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">
  <xs:complexType>
    <xs:choice minOccurs="0" maxOccurs="unbounded">
       <xs:element name="KursZbir">
        <xs:complexType>
           <xs:sequence>
             <xs:element name="RBr" type="xs:double" minOccurs="0" />
             <xs:element name="Datum" type="xs:dateTime" minOccurs="0" />
             <xs:element name="Valuta" type="xs:double" minOccurs="0" />
             <xs:element name="Oznaka" type="xs:string" minOccurs="0" />
             <xs:element name="Drzava" type="xs:string" minOccurs="0" />
            <xs:element name="Nomin" type="xs:double" minOccurs="0" />
             <xs:element name="Sreden" type="xs:double" minOccurs="0" />
             <xs:element name="DrzavaAng" type="xs:string" minOccurs="0" />
            <xs:element name="NazivMak" type="xs:string" minOccurs="0" />
             <xs:element name="NazivAng" type="xs:string" minOccurs="0" />
             <xs:element name="Datum_f" type="xs:dateTime" minOccurs="0" />
           </xs:sequence>
         </xs:complexType>
      </xs:element>
    </xs:choice>
   </xs:complexType>
 </xs:element>

</xs:schema>
 </dsKurs>
 ##
Here is some my code:
private static String SOAP_ACTION = "http://www.nbrm.mk/klservice/GetExchangeRateD";
private static String NAMESPACE = "http://www.nbrm.mk/klservice/";
private static String METHOD_NAME_SUM = "GetExchangeRateDResponse";
private static String URL = "http://www.nbrm.mk/klservice/kurs.asmx?WSDL";

public class LoadTaskj extends AsyncTask<Void, Void, String> {

    String StartDate, EndDate = "";

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

        StartDate = sum1.getText().toString();
        EndDate = sum2.getText().toString();

        // TODO Auto-generated method stub

        SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME_SUM);
        request.addProperty("StartDate", StartDate);
        request.addProperty("EndDate", EndDate);
        // Use this to add parameters

        // Declare the version of the SOAP request
        SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
                SoapEnvelope.VER11);

        envelope.setOutputSoapObject(request);

        // Needed to make the internet call
        HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);

        try {

            androidHttpTransport
                    .setXmlVersionTag("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
            androidHttpTransport.debug = true;
            androidHttpTransport.call(SOAP_ACTION, envelope);
            // String ss=androidHttpTransport.requestDump;

            // System.out.println(ss);
            // t.setText(ss);

        } catch (Exception e) {
            e.printStackTrace();
        }

        SoapObject result = null;
        if (envelope.bodyIn instanceof SoapFault) {
            String str = ((SoapFault) envelope.bodyIn).faultstring;
            Log.i("WS 1", str);

            // Another way to travers through the SoapFault object
        } else {

            try {
                Object resi = envelope.getResponse();
                SoapPrimitive resultce = (SoapPrimitive) envelope
                        .getResponse();

                if (resultce != null) {
                    // resultce=(SoapObject)envelope.bodyIn;

                    Log.i("loook at mee", String.valueOf(resultce));

                }

            } catch (SoapFault e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
            // od poc kod
            result = (SoapObject) envelope.bodyIn;
            Log.d("WS", String.valueOf(result));
            // od poc kod

            String requestString = androidHttpTransport.requestDump;
            Log.d("Request in XML", requestString);
            String response1 = androidHttpTransport.responseDump;
            Log.d("Response in XML", response1);

        }

        // Get the SoapResult from the envelope body.

        String resultString = "";
        if (result != null) {
            resultString = result.getProperty(0).toString();

        }
        return resultString;

    }

    @Override
    protected void onPostExecute(String result) {
        // TODO Auto-generated method stub

        // String callService = callService(firstSum, secondSum);
        // t.setText(result);
        super.onPostExecute(result);
    }

}

Here is the link the POST response and request :
http://www.nbrm.mk/klservice/kurs.asmx?op=GetExchangeRateD
Am I missing something or doing something wrong? Please help me.
For more information see: http://www.nbrm.mk/klservice/kurs.asmx

A: Im sure but you might want to change your
private static String METHOD_NAME_SUM = "GetExchangeRateDResponse";

to
private static String METHOD_NAME_SUM = "GetExchangeRate";

and specify a start and end date.


text:
Q: What is the best way to monitor services/applications running on Azure Virtual machines i.e. I'm looking for a way to constantly monitor my virtual machines on Azure and check if specific services (database, application) in the vm are up and running. I also want to be alerted (email) when those services are down. Since the services running on the vm are not publicly available, I am looking for a solution that will monitor their status and report from inside the vms (if that is possible).
I am open to any suggestions.
Thanks in advance

A: You can integrate with Azure Monitor to collect various metrics related to the application as well as database and use alerts to send notifications.


text:
Q: PHP mkdir function returns error when called I am trying to create 3 folders based on the email address of a user. I have one main folder, then the folder named after the email address, and finally a folder named images or tracks or chains.  I am passing the paths to a function which should create them. However, nothing is happening. Can you please tell me what I am doing wrong?
public function createFolder($email){
    $this->email=$email;
    $this->pictureDirectoryPath = "../Uploads/$this->email/images";
    $this->uploadedTracksPath = "../Uploads/$this->email/tracks";
    $this->chainsPath = "../Uploads/$this->email/chains";

    //Calling the function doIt(path) to create the acutal directory.
    //The desired path is passed as a parameter

     doIt($this->pictureDirectoryPath);
     doIt($this->uploadedTracksPath);
     doIt($this->chainsPath);

}

//Function doIt() which is supposed to create a directory
//However, nothing happens when it is called..
public function doIt($path){
    if (!mkdir($path, 0777, true)) {
            die('Failed to create folders...');
        }
}

A: To call functions/methods within a class you need to add $this-> or self:: depending on if it's static or not.
 $this->doIt($this->pictureDirectoryPath);
 $this->doIt($this->uploadedTracksPath);
 $this->doIt($this->chainsPath);


text:
Q: Android - Handling incorrect data returned from API - JSON deserialization using GSON I'm having a problem with some JSON being returned back from an API where the data is not in an expected format.  The documentation for the API states that the element "ShowEpisodes" is an Array[], which is the case in the 2nd element below.  But as you can see in the first instance, if the "ShowEpisodes" element doesn't contain any items, it comes back as an empty string.
Is there some way that I can handle this issue?  I've contacted the API's support staff to find out why this is returning an empty string, but have yet to hear back and in the meantime I'm trying to find a workaround.
Simplified JSON from API:
ShowSeasons: [
    {
        ShowEpisodes: ""
    },
    {
        ShowEpisodes: { … }
    }
]

Class Objects:
public static class ShowSeason implements Serializable {
    private static final long serialVersionUID = 1L;

    public ShowEpisodeInfo ShowEpisodes;
}

public static class ShowEpisodeInfo implements Serializable {
    private static final long serialVersionUID = 2L;

    public List<SeasonProgramDetails> Program;
}

Stack Trace:
com.google.gson.JsonParseException: Expecting object found: ""
    at com.google.gson.JsonObjectDeserializationVisitor.visitFieldUsingCustomHandler(JsonObjectDeserializationVisitor.java:99)
    at com.google.gson.ObjectNavigator.navigateClassFields(ObjectNavigator.java:158)
    at com.google.gson.ObjectNavigator.accept(ObjectNavigator.java:131)
    at com.google.gson.JsonDeserializationVisitor.visitChild(JsonDeserializationVisitor.java:107)
    at com.google.gson.JsonDeserializationVisitor.visitChildAsObject(JsonDeserializationVisitor.java:95)
    at com.google.gson.JsonObjectDeserializationVisitor.visitObjectField(JsonObjectDeserializationVisitor.java:61)
    at com.google.gson.ObjectNavigator.navigateClassFields(ObjectNavigator.java:164)
    at com.google.gson.ObjectNavigator.accept(ObjectNavigator.java:131)
    ........

Does anybody know of a way to handle both an empty string and an array of an object for when the API returns bad data?  Or possibly a way to suppress the exception so that I just drop the bad data


text:
Q: DataContract For Serialization in ASP.NET Web API 2 I have entity model classes generated from the database. I am trying to use annotations on these classes. The moment I update my classes from the database the annotations are wiped out. Remember the annotations are related to serialization.
For example
[DataContract]
public partial class A
{
   [DataMember]
   [Key]
   public int id;
   [DataMember]
   public string name;
}

I have tried using MetaData/Buddy classes but nothing seems like working. Is their a way to preserve these annotations in the model classes?


text:
Q: undefined method `post_id' with post as a join table? Okay, so I am currently working on a commenting system where posts belong to classrooms and posts have comments. So classrooms have comments through posts.
Here are the models
class Classroom < ActiveRecord::Base
  has_many :posts
  has_many :comments, through: :posts
...
end
class Comment < ActiveRecord::Base
    belongs_to :post
...
end
class Post < ActiveRecord::Base
  belongs_to :classroom
  has_many :comments
...
end

I'm trying to save post_ids but it won't let me with a simple hidden field so I tried it with a value and it still doesn't work. it says that post_id is an undefined method.
Here is my classroom controller's show method because it is where the new comment form is being rendered.
def show
    @classroom = Classroom.find(params[:id])
    @posts = @classroom.posts
    @comments =  @classroom.comments
    @comment = Comment.new
  end

Here is the new comment form.
<%= simple_form_for(@comment) do |f| %>
  <%= f.error_notification %>

  <%= f.text_area :content %>

  <%= f.hidden_field :post_id, :value => @classroom.post_id  %>

    <%= f.button :submit %>

<% end %>

Error Message
NoMethodError in Classrooms#show
undefined method `post_id' for Classroom:0x007f52aa646b18
How do I save the post_id?
Thanks!

A:
NoMethodError in Classrooms#show undefined method `post_id' for
  Classroom:0x007f52aa646b18

<%= f.hidden_field :post_id, :value => @classroom.post_id  %>

The error is obvious as you are doing @classroom.post_id as Classroom don't have a field called post_id
Define a @post with the help of @classroom
def show
  @classroom = Classroom.find(params[:id])
  @post = Post.where(classroom_id: @classroom.id).first
  @posts = @classroom.posts
  @comments =  @classroom.comments
  @comment = Comment.new
end

and use that in the hidden_field
<%= f.hidden_field :post_id, :value => @post.id %>


text:
Q: How to set ArcMap to view 12 bit tiff I am trying to view 12-bit tiffs in ArcMap. The problem is ArcMap is forcing the 12 bit images into a 16 bit container. I can set the min/max values to 0-4095 in order to see the 12-bit range. I can do this for each image but that would take forever. Just seeing if there was an easier way to change this. I have found that I can create a layer file with the appropriate min/max symbology, and using ApplySymbologyFromLayer, apply that symbology to every image in the TOC.  However, this is still very time consuming on top of the time required to load my many images.  I have tried running this tool as batch, and through the python window with arcpy.mapping module.
Is there a way to set this type of symbology as default symbology prior to loading rasters into ArcMap?


text:
Q: What alternatives to MS Access exist for database management on the Ubuntu platform (LibreOffice Base isn't cutting it) I have a web-based MySQL database, which is very important. I have used the MySQL Connector to allow me to use an MS Access database to query, and clean up my database, through an ODBC connection.
Having moved my work computer to Ubuntu Linux (finally) I was trying to avoid using a VirtualBox VM to host a Windows installation to continue using MS Access, since there are so many tools available for the Linux Platform.
Yesterday, I installed the MySQL Connector for LibreOffice from the Ubuntu Software Center, and planned to move forward with LibreOffice, just like I did with MS Access - but LibreOffice Base doesn't have any ability to do update queries (unless you are writing our SQL query by hand) - and it's still kinda clunky... IMHO.
What other database management tools exist for a Ubuntu desktop, so I can query, update, and report my web-based MySQL database, (and can completely avoid Windows and MS Access, going forward)?
Thank you in advance!

A: I used MS Access a lot when working. Since retiring I looked for something like Access but did not find anything. Just for info what I have done.
So I decided to learn python. But the learning curve seems pretty steep, maybe oldfred is not so young anymore. But it did not become just learning python, but learning a python editor - geany, learning first gtk and its editor and then I switched to qt4 and its editor-qt4 designer and a separate sql editor -sqliteman to create or test sql code. I am using sqlite, but the connector code is just a little different.
So MS Access is an integrated enviroment and works together. Just about everything else is not. You have to choose a language, a database, a gui, and a sql editor. And there is no report writer, but you can manually create pdf or HTML code for reports. I just export csv files and import to a spreadsheet as that is an easier way to create sub-totals and grand totals.
If a hobby like I am you can experiment, but if this is a business I cannot really recommend trying to roll your own MS Access.
The navicat suggestion looks interesting, but have not tried that. If I was still working I might spend the money to try it. Maybe someone has more info?

A: The following link is a company to that provides a cross platform database management tool.
It is not free but you can try it free for 30 days with no restrictions.
All info such as prices etc are listed on the site.
http://www.navicat.com/products/navicat-for-mysql
PS: I have no connection to this company and have never even used their software; just trying to provide some info.
Best of luck.


text:
Q: Illuminate\Database\QueryException could not find driver using Devilbox and postgresql I'm still new to dockers and trying to boot up a local laravel server using devilbox. I run the docker using this line
docker-compose up -d httpd bind php pgsql --build

I've enabled pdo_pgsql and extension=pgsql by adding custom ini file in cfg/php-ini-8.1/php_extension.ini that I created based on this documentation.
When I'm trying to run php artisan migrate:install, it returns the error below

Illuminate\Database\QueryException
could not find driver (SQL: create table "migrations" ("id" serial
primary key not null, "migration" varchar(255) not null, "batch"
integer not null))
at
vendor/laravel/framework/src/Illuminate/Database/Connection.php:712
708▕         // If an exception occurs when attempting to run a query, we'll format the error
709▕         // message to include the bindings with SQL, which will make this exception a
710▕         // lot more helpful to the developer instead of just the database's errors.
711▕         catch (Exception $e) {   ➜ 712▕             throw new QueryException(
713▕                 $query, $this->prepareBindings($bindings), $e
714▕             );
715▕         }
716▕     }
  +29 vendor frames    30  artisan:37
  Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput),

Object(Symfony\Component\Console\Output\ConsoleOutput))

I've tried clearing the cache, dump-autoload and nothing seems to solve the problems
config/database.php
<?php

use Illuminate\Support\Str;

return [

    /*
    |--------------------------------------------------------------------------
    | Default Database Connection Name
    |--------------------------------------------------------------------------
    |
    | Here you may specify which of the database connections below you wish
    | to use as your default connection for all database work. Of course
    | you may use many connections at once using the Database library.
    |
    */

    'default' => env('DB_CONNECTION', 'pgsql'),

    /*
    |--------------------------------------------------------------------------
    | Database Connections
    |--------------------------------------------------------------------------
    |
    | Here are each of the database connections setup for your application.
    | Of course, examples of configuring each database platform that is
    | supported by Laravel is shown below to make development simple.
    |
    |
    | All database work in Laravel is done through the PHP PDO facilities
    | so make sure you have the driver for your particular database of
    | choice installed on your machine before you begin development.
    |
    */

    'connections' => [

        'sqlite' => [
            'driver' => 'sqlite',
            'url' => env('DATABASE_URL'),
            'database' => env('DB_DATABASE', database_path('database.sqlite')),
            'prefix' => '',
            'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),
        ],

        'mysql' => [
            'driver' => 'mysql',
            'url' => env('DATABASE_URL'),
            'host' => env('DB_HOST', '127.0.0.1'),
            'port' => env('DB_PORT', '3306'),
            'database' => env('DB_DATABASE', 'forge'),
            'username' => env('DB_USERNAME', 'forge'),
            'password' => env('DB_PASSWORD', ''),
            'unix_socket' => env('DB_SOCKET', ''),
            'charset' => 'utf8mb4',
            'collation' => 'utf8mb4_unicode_ci',
            'prefix' => '',
            'prefix_indexes' => true,
            'strict' => true,
            'engine' => null,
            'options' => extension_loaded('pdo_mysql') ? array_filter([
                PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
            ]) : [],
        ],

        'pgsql' => [
            'driver' => 'pgsql',
            'url' => env('DATABASE_URL'),
            'host' => env('DB_HOST', '127.0.0.1'),
            'port' => env('DB_PORT', '5432'),
            'database' => env('DB_DATABASE', 'forge'),
            'username' => env('DB_USERNAME', 'forge'),
            'password' => env('DB_PASSWORD', ''),
            'charset' => 'utf8',
            'prefix' => '',
            'prefix_indexes' => true,
            'schema' => 'public',
            'sslmode' => 'prefer',
        ],

        'sqlsrv' => [
            'driver' => 'sqlsrv',
            'url' => env('DATABASE_URL'),
            'host' => env('DB_HOST', 'localhost'),
            'port' => env('DB_PORT', '1433'),
            'database' => env('DB_DATABASE', 'forge'),
            'username' => env('DB_USERNAME', 'forge'),
            'password' => env('DB_PASSWORD', ''),
            'charset' => 'utf8',
            'prefix' => '',
            'prefix_indexes' => true,
        ],

    ],

    /*
    |--------------------------------------------------------------------------
    | Migration Repository Table
    |--------------------------------------------------------------------------
    |
    | This table keeps track of all the migrations that have already run for
    | your application. Using this information, we can determine which of
    | the migrations on disk haven't actually been run in the database.
    |
    */

    'migrations' => 'migrations',

    /*
    |--------------------------------------------------------------------------
    | Redis Databases
    |--------------------------------------------------------------------------
    |
    | Redis is an open source, fast, and advanced key-value store that also
    | provides a richer body of commands than a typical key-value system
    | such as APC or Memcached. Laravel makes it easy to dig right in.
    |
    */

    'redis' => [

        'client' => env('REDIS_CLIENT', 'phpredis'),

        'options' => [
            'cluster' => env('REDIS_CLUSTER', 'redis'),
            'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'),
        ],

        'default' => [
            'url' => env('REDIS_URL'),
            'host' => env('REDIS_HOST', '127.0.0.1'),
            'password' => env('REDIS_PASSWORD', null),
            'port' => env('REDIS_PORT', '6379'),
            'database' => env('REDIS_DB', '0'),
        ],

        'cache' => [
            'url' => env('REDIS_URL'),
            'host' => env('REDIS_HOST', '127.0.0.1'),
            'password' => env('REDIS_PASSWORD', null),
            'port' => env('REDIS_PORT', '6379'),
            'database' => env('REDIS_CACHE_DB', '1'),
        ],

    ],

];

.env
DB_CONNECTION=pgsql
DB_HOST=pgsql
DB_PORT=5432
DB_DATABASE=postgres
DB_USERNAME=postgres
DB_PASSWORD=


text:
Q: Discrepancy between Kaplan-Meier curves and Cox Model I have plotted Kaplan-Meier curves of survival times for cancer patients with above and below average levels of Copy Number Variation (CNV), and performed a log-rank test for each cancer type.
I have also fit a univariate Cox Model for each cancer type, with CNV levels as the variable.
There are several cancers which reach statistical significance in the Cox Model and not for the Kaplan-Meier curves. There is one cancer where the situation is vice-versa.
What could be causing this effect and which test should I trust?

A: Differences in "significance" between non-parametric tests (no assumptions about underlying distributions of variables, typically just based on relative ranks) and parametric tests (with assumptions about distributions, for example that they follow a normal distribution) are frequently found in other types of statistical analyses, with non-parametric tests typically having less power (if the assumptions of the parametric test hold). Here, K-M/log-rank tests are non-parametric (just looking at which events occur first), while the Cox model is semi-parametric (unspecified baseline hazard, but hazard ratios among groups assumed to be strictly proportional). My guess is that you are on the borderline of having enough events in your data sets to document a relation of survival to CNV.
Look at the shapes of the K-M curves to see what's going on, and do appropriate tests that the Cox proportional-hazards assumption is being met.
Which to "trust" depends on the use you intend to make of your analyses. If you are simply doing these analyses to determine whether to follow-up with an independent study, use your scientific judgment along with the hints these results provide. If you are intending to publish these results, you should probably trust neither on its own without further analyses. Studies such as this are notorious for finding "significant" results that are very dependent on the peculiarities of a particular data set. This site has many pages on how to overcome these limitations with techniques like cross-validation and bootstrapping; this page and its "Related" pages are good places to start.


text:
Q: About Numpy's structured arrays To define structured arrays,we can use tuple argument.
For example:
>>> x = np.zeros(3, dtype=('i4',[('r','u1'), ('g','u1'), ('b','u1'), ('a','u1')]))
>>> x
array([0, 0, 0])
>>> x['r']
array([0, 0, 0], dtype=uint8)

I can't understand, why is x array([0,0,0])? Why is x['r'] array([0,0,0]) either?

A: This example appears to be copied from the (base_dtype, new_dtype) paragraph of the dtypes documentation page. https://docs.scipy.org/doc/numpy/reference/arrays.dtypes.html
32-bit integer, containing fields r, g, b, a that interpret the 4 bytes in the integer as four unsigned integers:

>>>>>> dt = np.dtype(('i4', [('r','u1'),('g','u1'),('b','u1'),('a','u1')]))

It's creating a rarely seen dual mapping.  Each element can seen as an 4 bypte int, or as a 4 field record.


text:
Q: Xcode: Could not inspect the application package I am running Xcode 6 and iOS 8 GM. Every other time I run my app I get this message from Xcode:

"Could not inspect the application package"

So I can run and build, I will get the message. I run and build again, everything runs as expected (this is to my device). Then it will rinse and repeat, every other time giving me this error.
I have looked at all the other solutions that have been suggested but cannot stop this error. I have cleaned my project, cleaned the build folder, deleted derived data etc with no luck.
How can I see what is causing this in the first place?
Interestingly, this only happens when running on my device. Not on the simulator. Also, it only happens on my device, when building for debug. If I change the scheme to release, I can build and run endlessly without with error. Ideas?

A: In my case, I needed to check the option that says "Copy only when installing" under "Build Phases/Embed Frameworks" in one of the frameworks I was embedding.

A: If you have moved or copied a folder named resources or resource into your project, try renaming it. Then perform a clean.

A: I got this when a custom built .framework was missing its Info.plist.

A: This error seems to happen when you have third party code which isn't signed by you in your bundle. Check this thread, it helped me once.
Also when performing build clean opt for cmd + option + shift + k.

A: This can happen with Xcode 6 and iOS 8 if a product name contains non-latin characters.
In this case changing product name to the one with only latin characters for debug builds fixes this problem.

A: I deleted my Info.plist and I dragged a new info.plist into my project. Xcode did not show me any warning but my app would not launch until i changed the name to Info.plist.

A:
Try to remove some libraries from your Xcode => Click on Target => General tab => Embedded Libraries (Keep only required libraries or Framework)
Here, remove (Use - sign on bottom to delete).
If you require the framework or libraries that you deleted, add this using Xcode => Click on Target => General tab => Linked framework and Libraries (Use - sign on bottom to add this).

This will work.

A: I've seen this error before when there is something in the entitlements file but is not enabled for the app id in the provisioning centre.
Specifically I had HealthKit enabled in the entitlements file but not configured for the application identifier.

A: I had a potentially similar problem, hardware only, when I had an app which was given entitlement to run in the background and had run previously on the phone.  For such apps, I found the Xcode deployment to phone broken and had to change the bundle identifier to unjam the deployment.

A: I think there are third party files in your code, which might include compiled code which is not signed by you. If so, you can use iReSign to resign them using your own certificate. You can also use the command line:
 codesign -f -s "iPhone Developer: Name (XXXXXXXXXX)" nameOfAppToSign.app

Replace the example identity with your own (you can man codesign to read more about this command).

A: I had the same issue, And was unable to install the ipa. It always ended with an error "Could not inspect the application package." and some warnings in device console
Feb 10 17:38:16 iPhone mobile_installation_proxy[356] <Warning>: LaunchServices: Please include the kCFBundleIdentifierKey in the options   dictionary when installing an app.
Feb 10 17:38:16 iPhone mobile_installation_proxy[356] <Warning>: LaunchServices: installing app with unknown bundleID
.
.
Feb 10 17:38:16 iPhone installd[44] <Error>: 0x101bcc000 -[MIBundle _validateWithError:]: 28: Failed to load Info.plist from bundle at path
Feb 10 17:38:16 iPhone installd[44] <Error>: 0x101bcc000 + [MIInstallable installablesAtURL:packageFormat:userOptions:error:]: Failed  to create bundle for …

After spending hours, I got it fixed by adding the "Application requires iPhone environment" in info.plist
<key>LSRequiresIPhoneOS</key>
<true/>

A: Found a solution by adding the Framework to General -> Linked Frameworks And Libraries and setting the status to optional. (Leave the embedded binaries blank)

A: deleting Pods and then calling pod install worked for me

A: Happened to me today. Yesterday everything was working fine and suddenly today I can't deploy because of this error:
Could not inspect the application package.
Domain: com.apple.dt.MobileDeviceErrorDomain
Code: -402653103

on Xcode 13.4.1 and iOS 15.4. Nothing changed from yesterday. Tried to rebuild the project (not helped), relaunch Xcode (not helped), restart the phone (not helped) and rebooted my MacBook (not helped)...
Then I remembered that I merged the .project with another branch and inspecting the changes noticed that GENERATE_INFOPLIST_FILE = YES was removed from our custom .framework settings, so it was missing the Info.plist. Reenabling the flag the app deployed properly.

TLDR: Our custom built .framework was missing its Info.plist.

A: Mine turned out to be something to do with Apple's certificates and such.  I was working between two different computers and I think something went amiss.  So I had to revoke my developer certificate at the Apple iOS dev site, and request a new one with a private key etc.  Once the new certificate was installed, the message went

A: For my case, it was file missing in a newly added *.framework. One *.plist file and "_CodeSignature" folder were missing in that *.framework. Replacing corrupted *.framework file fixed my issue.

A: http://www.developersalley.com/blog/post/2015/11/13/How-To-Fix-App-installation-failed-Could-not-inspect-application-package-Error-When-Installing-App-In-XCode.aspx
This link saved my life, I use the XUPorter plugin, the added folder has a plist file, which is my SDK provided to me

A: Change the Display name in Targets > General > Identity
Build your app and switch back to your old name.
It worked for me

A: In my case, the reason for this error was a corrupted Info.plist file in one of the frameworks. This happened because I used bash scripts to modify a copy of the project. When I started checking the files, I noticed that some Info.plist files are not viewed in Quick look. After packaging in the framework, Info.plist is converted to binary format, but when viewed through Quick look it is displayed as text. Thus it became clear to me what happened and after replacing the corrupted files everything worked like a charm

A: In case someone here is consuming bazel based xcframework in your xcode project, this might solve your issue: https://stackoverflow.com/a/74027282/6709940

A: There are so many answers and each of them addresses a different cause of the error message. Just want to add my solution when it happened to me.
I was using opencv2 framework, once I checked on "Copy only when installing" the error when away, and I was able to install and run my app. The particular setting is in "Build Phases"->Embedded Frameworks section.
Hope this helps!

A: You can try following steps:
 Window->Projects and look for your project and delete 'Derived Data' for all your projects with the same name

A: I had the same issue, and the problem was that I had an alias in the xCode project. I removed it and it works.


text:
Q: how to move files from one system to another system using ASp.net and c#.net Please try to suggest me how to do this.
I need to copy or move files from one system to another system.
I did this  but it saying invalid path..
var fileName = "Text.txt";
var local = Path.Combine(@"C:\\public_html\\TEST\\gr_library\\", fileName );
var remote = Path.Combine(@"XXX.XXX.X.X\\C:\\public_html\\TEST\\gr_library\\", fileName );
File.Move(remote, local );

Please give some code snippet which is executable...

A: You need to put \ in the front of the ip, like \123.456.789.10\folder. Make sure that the user also has access to the remote pc.


text:
Q: Is it possible to use phpDocumentator on Twig templates? I'm currently working on a Symphony project with Twig templates. In order to know what each template does I'm adding extensive comments on the files with descriptions, parameters, returns, etc...
I was hopping to be able to run phpDocumentator (or any other suitable tool) on these files and have an easily accessible documentation for all our developers, however every time I run the following command:
php phpDocumentor.phar -d src/dir1/dir2/CoreBundle/Resources/views/ -t docs/api/ -v

I get a nice Exception as result:
[Exception]
No parsable files were found, did you specify any using the -f or -d parameter?

I know the docBlock should looks like /** comment */ but comments on Twig looks like {# comment #}.
Is there a way/tool to be able to produce these documentation? If so, how do I do it?
Thanks

A: There is no "proper" way, but you could apply a pretty rotten hack:

*

*you copy files to a temporary location …

*… and replace the twig comments with PHP tags and comments.

*then you run phpDocumentor on those files.

Example:
#!/bin/bash

targetpath="/tmp/phpdoc"
[ -d "$targetpath" ] && rm -r $targetpath
mkdir -p $targetpath

for twigfile in $(find src/ -name '*.html.twig'); do
    newtwigfile="$targetpath/${twigfile//\//_}.php"
    perl -pe 's|{#|<?php /*|g' $twigfile | perl -pe 's|#}|*/ ?>|g' > $newtwigfile
done

php phpDocumentor.phar -d $targetpath -t docs/api/ -v

This may need some tweaking in regard to what phpDocumentor accepts as valid comment blocks.
Before:

    {#
        This is the glorious lorem ipsum.
    #}

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy
    eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.

After:

    <?php /*
        This is the glorious lorem ipsum.
    */ ?>

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy
    eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.

The downside of this, like of any hack, is that you need to know about this "processing" when you write your Twig comments.


text:
Q: How to define dependencies for lib-files? How to determine dependencies for lib-file in C++ programmatically or with a tool (like depends.exe aka Dependency Walrer for DLL)? In particular I am interested in the defining of C-runtime version. My problem is that my DLL, compiled in MSVC2010 depends on CRT 8.0. I assume that this dependency inherited from some include lib-file. I want to verify this hypothesis and find the lib-file.
This code included in auto-generated manifest:
<dependency>
  <dependentAssembly>
    <assemblyIdentity type="win32" name="Microsoft.VC80.DebugCRT"
    version="8.0.50727.762" processorArchitecture="x86"
    publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
  </dependentAssembly>
</dependency>

A: You can use dumpbin.exe which is installed with Visual Studio inside its /vc/bin/ directory.
You can have a look at :
http://msdn.microsoft.com/en-us/library/c1h23y6c(v=VS.100).aspx


text:
Q: How to find out IP address of a website, When it is hosted on cloudflare (Using Linux script or any other way) I want to find out the IP address of a website, which is using cloudflare for delivery. Using Linux shell script or some method in Linux.
Already one question was asked and it was closed with out answer. https://webmasters.stackexchange.com/questions/55961/how-to-find-out-the-hosting-provider-of-a-website-protected-with-cloudflare
I hope to get answer here.

A: Short answer: you cannot find the IP address(es) of host(s) behind Cloudflare addresses.
Long answer: some misconfigurations or web site vulnerabilities my expose the true IP address(es) of (some) websites behind Cloudfare.
See for instance, an automated tool to find some common misconfigurations, CFire
From Rhino Security Labs - CFire page

To summarize:

*

*CloudFlare is a great cloud security tool, offering WAF/DDoS
  protection by hosting your DNS and protecting the true IP of your
  domains

*CloudFlare requires proper configuration and maintenance to be its
  most effective

*Server IPs may still be exposed if moved to CloudFlare from "direct
  IP" DNS provider

*Subdomains bypassing CloudFlare often exposes all DNS records to
  bypass attacks


text:
Q: Plotting two datasets across same x-axis in R using ggplot2 (or equivalent) EDIT: This has been solved and I have posted my learning and the code used at the bottom of the question
I  would like to plot to datasets across the same x-axis with the second dataset being mirrored below the x-axis. I have attached the data set below.
So far I have tried:
#first two give me simple enough graphs
ggplot(data = plot_case) + geom_bar(mapping = aes(x= Exon, fill = Variant_Classification))
ggplot(data = plot_control) + geom_bar(mapping = aes(x= Exon, fill = Variant_Classification))

I tried to then create a negative set in the control group
plot_control$Exon <- as.numeric(plot_control$Exon) * -1
plot_all <- rbind(plot_case, plot_control)
#plotting it gives me this
ggplot(data = plot_all) + geom_col(mapping = aes(x= Exon, y=stat_count(Exon), fill = Variant_Classification))

When I actually want the second dataset below the first one like this picture:

Your help would be much appreciated, full data set below
head(plot_case)

   Variant_Classification Exon
1:      Nonsense_Mutation   22
2:        Frame_Shift_Del   28
3:      Nonsense_Mutation    7
4:      Missense_Mutation   27
5:      Missense_Mutation   28
6:      Missense_Mutation   18

full:
dput(plot_case)
    structure(list(Variant_Classification = structure(c(5L, 1L, 5L,
    4L, 4L, 4L, 5L, 2L, 5L, 2L, 5L, 4L, 1L, 2L, 1L, 4L, 5L, 5L, 5L,
    5L, 6L, 5L, 3L, 2L, 3L, 4L, 4L), .Label = c("Frame_Shift_Del",
    "Frame_Shift_Ins", "In_Frame_Del", "Missense_Mutation", "Nonsense_Mutation",
    "Splice_Site"), class = "factor"), Exon = structure(c(22L, 28L,
    7L, 27L, 28L, 18L, 12L, 18L, 20L, 26L, 21L, 11L, 12L, 7L, 14L,
    13L, 22L, 20L, 15L, 20L, 20L, 21L, 19L, 7L, 3L, 11L, 4L), .Label = c("1",
    "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13",
    "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24",
    "25", "26", "27", "28", "29", "30"), class = "factor")), row.names = c(NA,
    -27L), class = c("data.table", "data.frame"), .internal.selfref = <pointer: 0x5642b661b980>)

   head(plot_control)
   Variant_Classification Exon
1:      Missense_Mutation   1
2:      Missense_Mutation   1
3:      Missense_Mutation   1
4:      Missense_Mutation   1
5:      Missense_Mutation   1
6:      Missense_Mutation   1

dput(plot_control)
structure(list(Variant_Classification = structure(c(4L, 4L, 4L,
4L, 4L, 4L, 4L, 2L, 2L, 2L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L,
4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 2L, 3L, 3L, 3L, 3L,
3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L,
3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L,
3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L,
3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L,
3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 4L,
4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L,
4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L,
4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L,
4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L,
4L, 4L, 4L, 7L, 4L, 4L, 1L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L,
2L, 2L, 4L, 5L, 4L, 4L, 4L, 4L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L,
4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L,
4L, 4L, 4L, 4L, 4L, 7L, 7L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L,
5L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L,
4L, 4L, 4L, 4L, 4L, 4L, 2L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L,
4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 6L, 4L, 4L, 4L, 4L,
4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L,
4L, 4L, 3L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 1L, 4L, 4L, 4L,
4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L,
4L, 3L, 3L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 5L, 4L, 4L, 7L, 7L,
5L, 4L, 4L, 4L, 4L, 4L, 5L, 4L, 1L, 4L, 4L, 4L, 4L, 4L, 1L, 4L,
4L, 4L, 4L, 4L, 4L, 4L, 7L, 7L, 4L, 4L, 4L, 4L, 5L, 4L, 4L, 4L,
4L, 3L, 3L, 3L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 3L, 4L,
4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L,
4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L,
4L, 4L, 4L, 4L, 5L), .Label = c("Frame_Shift_Del", "Frame_Shift_Ins",
"In_Frame_Del", "Missense_Mutation", "Nonsense_Mutation", "Nonstop_Mutation",
"Splice_Site"), class = "factor"), Exon = c(1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8,
8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11,
11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12,
12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14,
14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 17, 17, 17, 17, 17, 17,
17, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 19,
20, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23,
23, 23, 23, 23, 23, 24, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27,
28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29,
29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29)), row.names = c(NA,
-456L), class = c("data.table", "data.frame"), .internal.selfref = <pointer: 0x56115dc87e30>)

Thanks to further help I ran the code suggested below and got the following image:

I now need to get the axis to be more informative so as not to lose all the data
With further help from @__S I used:
plot_control %>%
  mutate(type = 'control') %>%
  bind_rows(plot_case %>% mutate(type ='case')) %>%
  group_by(Variant_Classification, Exon, type) %>%
  summarise(freq = n()) %>%
  mutate(freq = ifelse(type == 'control', -log(freq), freq)) %>%
  ggplot(aes(x= Exon, y = freq, fill = Variant_Classification)) +
  geom_col() +
  geom_hline(yintercept = 0)

Which looks awesome!
Looking at the accepted answerthe problem was my dataset needed tidying up before putting it through ggplot. I needed to turn it into a frequency based table which is what the group_by and summarise dplyr functions helped to do.

A: What about something like this:
library(dplyr)

   plot_control %>%
  mutate(type = 'control') %>%
  bind_rows(plot_case %>% mutate(type ='case')) %>%
  group_by(Variant_Classification, Exon, type) %>%
  summarise(freq = n()) %>%
  #Edit2: here you join with a data.frame with all the Exon
  right_join(data.frame(Exon = c(min(.$Exon):max(.$Exon)))) %>%
  # Edit1: here you can add the log()
  mutate(freq = ifelse(type == 'control', -log(freq), freq)) %>%
  ggplot(aes(x= as.factor(Exon), y = freq, fill = Variant_Classification)) +
  geom_col() +
  geom_hline(yintercept = 0) +
  xlab("Exon")

With data:
plot_case <- read.table(text = '   Variant_Classification Exon
1:      Nonsense_Mutation   22
2:        Frame_Shift_Del   28
3:      Nonsense_Mutation    7
4:      Missense_Mutation   27
5:      Missense_Mutation   28
6:      Missense_Mutation   18
7:      Missense_Mutation   1', header = T)

plot_control <- read.table(text = '     Variant_Classification Exon
1:      Missense_Mutation   1
2:      Missense_Mutation   1
3:      Missense_Mutation   1
', header = T)


text:
Q: Generating JAR on IntelliJ I have some problems while creating a jar of my intelliJ project. First of all I just do the usual procedure:

*

*Go to project structure

*Select artifacts

*Create a new one with modules and dependecies

*Go to build artifact, build it

*Execute it at console with java -jar "ddddd.jar"

So when I execute the project (not the jar) all runs ok, libreries and all works, but not in the JAR.
Terminal of IntelliJ:

My libraries are located in the project like: project>lib>"some jars here">otherjars>"here some jars and respective dll
This is because the "other jars" need the dll to work. I already tried to run them without the .dll but doesn't work without it.
Also I have them in the project on Modules>Dependencies I have the folder selected as a library.
Any help would be appreciated.
Edit 1:
Here I add some pictures about how I have my libraries structured.


text:
Q: What does "ninny-pinny" mean? I found this sentence in Surely You're Joking Mr. Feynman:
There are all kinds of ninny-pinny, dopey things, like "it might be a good idea to try a date for the combination, because lots of people like to use dates."
What does ninny-pinny mean? I googled it but I only got the definition of ninny: a foolish or stupid person.

A: I'm not familiar with the term, and I can find no obvious definition online. But one can find a few uses of the term, and enough cases where "Ninny-Pinny" is used as a user ID to suggest that it's familiar to some group of people.
Some of the uses:
1 Ah, to be able to bring a pause to this whole mess, to the ninny-pinny men giving useless advice, to the bad news (to the endless briefings on the state of the economy and the ever-worstening crime in the streets).
2 "O Jo! how can you be such a ninny-pinny?"
(It should be noted that the above appears to be a quote from Alcott's Little Women, though I cannot locate the corresponding passage in the Google Books copy.)
3 At times, I feel a desperate need to write, but I fear that what I want to write most is from personal experience.  Things that may scrape so close to the bone as to be painful to those I know and love and have no desire to wound.  (And YES, I know that last sentence was a fragment, brain.  Stop being a ninny pinny.)  (Oh, for goodness' sake, now I'm looking up ninny pinny.  I give up on me.)
The evidence suggests that the term is basically a sort of "rhyming slang" version of "ninny", which has already been defined above as a "foolish or stupid person".  Very likely the appearance in Alcott's book (if indeed it did) gave what would have been a nonce term "legs" among the audience of Alcott's admirers.


text:
Q: Even selected, no windows content refresh, I have to change the windows size Linux MATE 19.1, Nvidia graphics.
Not at all times, but even selected, no windows content refresh, I have to change the windows size.
Happens only in browsers window (Firefow, Chrome, Chromium).
By example, it is only when resizing that the previous active tab jump to the real active tab, a conversation tab show the new messages, tab refresh, ..
I was unable to see any parameters triggering this behaviour.


text:
Q: I can't find partititions while installing Xubuntu 12.10
Possible Duplicate:
Ubiquity doesn't see any partitions on the Disk

I'm running LiveCD Xubuntu on Windows 7. Once the installation begin, it shows:

this computer currently has no detected operating system

When I click on Something else it shows me just one partition /dev/sda/ which own the whole space 320GB. When I try to modify it, this will erase all the data in the HDD and I really need it.
When I enter in the terminal sudo fdisk -l it shows the following message:
xubuntu@xubuntu:~$ sudo fdisk -l

Disk /dev/sda: 320.1 GB, 320071851520 bytes 255 heads, 63
sectors/track, 38913 cylinders, total 625140335 sectors Units =
sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512
bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000d87ad

   Device Boot      Start         End      Blocks   Id  System
 /dev/sda1   *          63    97643069    48821503+   7
 HPFS/NTFS/exFAT /dev/sda2        97656830   625141759   263742465    5
 Extended /dev/sda5        97656832   195309567    48826368    b  W95
 FAT32 /dev/sda6       195311616   292964351    48826368    b  W95
 FAT32 /dev/sda7       292966400   390619135    48826368    b  W95
 FAT32 /dev/sda8       390621184   488273919    48826368    b  W95
 FAT32 /dev/sda9       488275968   585928703    48826368    b  W95
 FAT32 /dev/sda10      585938808   625121279    19591236    7
 HPFS/NTFS/exFAT /dev/sda11      585930752   585938744        3996+  83
 Linux

 Partition table entries are not in disk order


text:
Q: Positive coefficients after the substitution? Let $n>1$ be an integer and $\Phi_n(x)$ be the $n$ th cyclotomic polynomial.

If we subsititute $x$ by $x+1$ , do we always get a polynomial with positive coefficients ? If yes, how can this be proven ? I also want to prove that no
coeffcient upto the $\varphi(n)$ th is missing.

Examples :

*

*$\Phi(6)=x^2-x+1$ transforms into $x^2+x+1$

*$\Phi(24)=x^8-x^4+1$ transforms into $x^8+8x^7+28x^6+56x^5+69x^4+52x^3+22x^2+4x+1$
Upto $n=3\ 200$ , this is the case. Some special cases can be easily proven, for example that $n$ is a power of $2$ or that $n$ is a prime. But I have no idea for a general proof.

A: Deal with the case $n=1,$ $ n = 2$ separately.
Notice that $ \Phi_1(x+1) = (x+1) - 1 = x$, which has a non-positive constant term.
This will be the only coefficient of $ \Phi_n (x+1)$ which is non-positive.

For $ n > 2$,
Let $A_n$ denote the set of integers $ 0 < k < n$ such that $ \gcd( n,k) = 1$.
Let $A_n^*$ denote the set of integers $ 0 < k < n/2$ such that $ \gcd( n,k) = 1$.
$$\Phi_n(x)  = \prod_{j \in A_n } (x - e^{2k\pi/n}) =  \prod_{j \in A_n^*} \left( x^2 - 2 \cos \frac{ 2\pi j}{n} \cdot x + 1 \right) .$$
Let $ f_m (x)  =  x^2 - 2mx + 1 $.
Since $f_m(x+1) = x^2 + 2(1-m)x + 2 (1-m)$, so the coefficients of $f_m(x+1)$ are positive for $ m < 1$.
Thus, for $n > 2$, since $ \cos \frac{2 \pi j } { n} < 1$ for $ j \in A_n^*$
$$\Phi_n(x+1) = \prod_{j \in A_n^*} f_{\cos \frac{2\pi j  }{n}}(x+1) ,$$
where the latter is a product of polynomials with positive coefficients, hence $\Phi_n(x+1)$ has positive coefficients for up to the degree $ \phi(n)$.


text:
Q: Как заставить логировать python скрипт в режиме демона? Есть программа, написанная на Python, которая логирует исключения в файл, с помощью стандартного модуля logging. Запускаю в Ubuntu 18. Всё замечательно работает, логи записываются в файл. Но. Как только я запускаю скрипт как сервис, с использованием systemctl, логирование отваливается. При этом, во всём остальном скрипт стабильно работает в режиме демона(кроме работы с электронной почтой, но это уже тема отдельного вопроса)
Подскажите пожалуйста как сделать так, чтобы логирование работало так же, как и в случае обычного запуска?

A: Ведь логи можно писать в журнал:
import logging
from systemd.journal import JournalHandler
level = logging.INFO
handlers=[JournalHandler()]
logging.basicConfig(level=level, handlers=handlers)

И смотреть их journalctl -u yourproject.service или journalctl --user -u yourproject.service


text:
Q: ASP.NET MVC OutputCache vary by * and vary by user cookie I have an asp.net mvc 3 project and I have a home controller. I have tagged my Index action with this attribute:
[OutputCache(Location = System.Web.UI.OutputCacheLocation.Any, Duration = 120, VaryByParam = "*", VaryByCustom = "user")]
public ActionResult Index()
{
    return View();
}

The vary by custom with user is handled in Global.asax.cs to check the user cookie value so that caching changes based on whether the user is logged in or not and what user they are.
When I go to this page on my web server, I get these headers in the response:
Cache-Control   public, max-age=120
Content-Type    text/html; charset=utf-8
Content-Encoding    gzip
Expires Sun, 20 Mar 2011 21:50:09 GMT
Last-Modified   Sun, 20 Mar 2011 21:48:09 GMT
Vary    Accept-Encoding
Date    Sun, 20 Mar 2011 21:48:09 GMT
Content-Length  3105

Right off the bat, the Vary - Accept-Encoding value looks wrong, shouldn't it have sent a Vary - * instead?
I am rendering the User.Identity.Name property to this view as well and I am noticing that even when I log out it will still render the user name, until the 120 seconds expires.
public override string GetVaryByCustomString(HttpContext context, string custom)
{
    if (custom.Equals("user", StringComparison.OrdinalIgnoreCase))
    {
        HttpCookie cookie = context.Request.Cookies["user"];
        if (cookie != null)
        {
            return cookie.Value;
        }
    }
    return base.GetVaryByCustomString(context, custom);
}

Been playing with this for several hours, and am completely stuck, hopefully someone has an idea...

A: The problem was IIS dynamic compression. It fouls up the http headers. I solved it by rolling my own dynamic compression using an actionfilter.

A: You can have IIS compress the response before it gets cached by setting dynamicCompressionBeforeCache="true" on the urlCompression element in your web.config.  This will result in the expected Vary:* header being returned.
Excerpt, from the IIS Configuration Reference, about the dynamicCompressionBeforeCache attribute:

The dynamicCompressionBeforeCache attribute specifies whether IIS will dynamically compress content that has not been cached. When the dynamicCompressionBeforeCache attribute is true, IIS dynamically compresses the response the first time a request is made and queues the content for compression. Subsequent requests are served dynamically until the compressed response has been added to the cache directory. Once the compressed response is added to the cache directory, the cached response is sent to clients for subsequent requests. When dynamicCompressionBeforeCache is false, IIS returns the uncompressed response until the compressed response has been added to the cache directory.

A: There is a Microsoft HotFix for this but they won't let you just download the hotfix.
You have to fill in your email for them to send it to you and it says :

*

*"Do not deploy a hotfix in a production environment without first testing the hotfix."

*"Back up the system or the computer that will receive the hotfix before you install the hotfix."

From what I can see it creates the following issues

*

*There is no uninstall

*Requires a restart

*The last modified date is updated for every request even if it returns the cached version

More info:
http://support2.microsoft.com/kb/2877816/en-gb
http://blogs.iis.net/erez/archive/2013/08/02/iis-compression-overrides-the-vary-header.aspx
https://51degrees.com/support/documentation/net/iis-modification
So think carefully before you install this!


text:
Q: How do I set a breakpoint for when a vector increases in length? I have a vector that is empty, something is filling it somewhere and I cant find it.  I want to set a memory breakpoint so that when the push_back occurs the program will break.
I'm using Visual Studio 2008, and the problem is that the vector doesnt display its internal members in the watch window (it seems to have a custom formatting).  It just looks like this:
myVector[0]()          std::vector< int,std::allocator< int > >
Indicating size 0.  Any tips?

A: This answer is for VS 2010 - details might differ in other versions.
Since the debugger uses a data visualizer (or whatever it's called) to display the state of a std::vector, you have to look in the <vector> header to determine the names of the actual members of the class and which one(s) might be responsible for tracking the number of elements. An easy way to do this is to step through a call to vector::push_back().
In VC++ 2010 this is a member pointer named _Mylast.
So all you have to do is set a data breakpoint on writes to &v._Mylast (where v is the vector you are interested in debugging).
The next time an element is added, the debugger will break with a call stack showing exactly where.

A: It shows 0 in VC2010, [0] indicates the size of the vector and the items will be displayed in ().
and you can use memory output windows to find out the memory address.


text:
Q: Is there a way to nest a loop in JavaScript until a condition is met? Like a while loop but nested? I'm trying to code an algorithm that tests to see if a game is possible to be won, given a randomly shuffled deck. I came up with a super simplified solitaire-esque game with like 15 cards, because I'm just messing around and I don't want to try a game with too many options until I've figured out a way to do it. My goal is to test every possible combination of moves, so I wrote a function that returns an array of possible moves when given the state of the board. What I need help with is calling that function every time I change the board. Right now my code calling the function looks like this:
let moves = possibleMoves(piles);
if (moves.length >= 1){
  for (let move of moves) {
    let nB = piles.slice(0);
    nB[move.from].pop();
    nB[move.to].push({card: move.card, x: move.to, y: nB[move.to].length});
    let m0s = possibleMoves(nB);
    if (m0s.length >= 1) {
      for (let m0 of m0s){
        let nB0 = nB.slice(0);
        nB0[m0.from].pop();
        nB0[m0.to].push({card: m0.card, x: m0.to, y: nB0[m0.to].length})
      }
    }
  }
}

But obviously I can't just nest that loop infinitely until there are no possible moves (note, I still haven't written code for when there are no possible moves but I'll get to it). The reason I can't just do a while loop is because I want to check every possible move after every possible move, without actually changing the board. Is there a better way to do this?

A: A recursive function maybe what you are looking for
function recursive(piles){
let moves = possibleMoves(piles);
if (moves.length >= 1){
  for (let move of moves) {
    let nB = piles.slice(0);
    nB[move.from].pop();
    nB[move.to].push({card: move.card, x: move.to, y: nB[move.to].length});
    recursive(nB)
  }
}else{
return;
}}


text:
Q: What are oaidl.idl and ocidl.idl for? A default ATL Simple Object has the following at the top of its IDL file:
import "oaidl.idl";
import "ocidl.idl";

What are these files for, and how do I know when I need to import them? Is there any documentation which describes what is defined in these two files? I have no idea what "oa" and "oc" stand for, and there are no helpful comments in the files themselves.

A: oaidl.idl and ocidl.idl are shipped with Platform SDK/Windows SDK. They are used to generate oaidl.h and ocidl.h
ocidl is for OLE container (e.g. ActiveX) while oaidl is for OLE automation. search oaidl.h and ocidl.h in MSDN or Windows SDK documentation for information on interfaces defined in these two files.
You may not find enough comments in the files, but the interfaces that are defined there are documented in MSDN.


text:
Q: Django: URL Reverse custom parameter to match? I'm trying to figure out if I can build a url which would match objects in my model with other field instead of pk. I have a model which has many fields, and I was happy while using simple <int:id> while building url paths, so in this case:
path("<int:pk>/", ProductDetailView.as_view(), name="product_detail")

But things changed, and we decided to use our old url regex, so instead this we changed to:
path("<slug:url>/", ProductDetailView.as_view(), name="product_detail"),

Our model have this field:
url = models.TextField(null=True)

and I can easily filter out by url, like this:
model.filter(url='/nesiojami-kompiuteriai/nesiojami-kompiuteriai.html') for example.
I have a problem while trying to reverse and url for the model instance:
prod = Product.objects.filter(is_deleted=False, category_id=64, url__isnull=False).first()
return reverse("product:product_detail", kwargs={"url": prod.url})

NoReverseMatch at /nesiojami-kompiuteriai/nesiojami-kompiuteriai/
Reverse for 'product_detail' with keyword arguments '{'url': '/nesiojami-kompiuteriai/nesiojami-kompiuteriai/nesiojamas-kompiuteris-acer-sf314-14-i5-8265-8256gb--9618707.html'}' not found. 1 pattern(s) tried: ['product/(?P<url>[-a-zA-Z0-9_]+)/$']

A: Your url field contains as value:
/nesiojami-kompiuteriai/nesiojami-kompiuteriai/nesiojamas-kompiuteris-acer-sf314-14-i5-8265-8256gb--9618707.html

This is not a slug. A slug is a sequence of alphanumerical characters, hyphens and underscores. But it is not allowed to contain slashes (/), or dots (.).
If you want to include this, then you can work with a <path:…> path converter [Django-doc], which will accept a sequence of characters including the slash and dot:
path('<path:url>/', ProductDetailView.as_view(), name='product_detail'),
but perhaps your url field contains the wrong data. Typically a slug is made by transforming the title of something into a slug with slugify(…) [Django-doc] this will replace all spacing characters with hyphens and remove all characters that are not valid slug characters.


text:
Q: Null pointer exception error in android I am getting the following exception when I run the texter application in android.
STACK_TRACE :

java.lang.NullPointerException    at
  com.texter.messenger.SmsReceiverService$ServiceHandler.handleMessage(SmsReceiverService.java:116)
    at android.os.Handler.dispatchMessage(Handler.java:99)  at
  android.os.Looper.loop(Looper.java:123)   at
  android.os.HandlerThread.run(HandlerThread.java:60)  , PHONE_MODEL :
  GT-I9000 , ANDROID_VERSION : 2.2 , APP_VERSION_CODE : 10
  30.Nov.2011 00:33:50 AM , CUSTOM_DATA :  , STACK_TRACE : java.lang.IllegalArgumentException: Receiver not registered:
  android.widget.ViewFlipper$1@40597cc0     at
  android.app.LoadedApk.forgetReceiverDispatcher(LoadedApk.java:634)    at
  android.app.ContextImpl.unregisterReceiver(ContextImpl.java:881)  at
  android.content.ContextWrapper.unregisterReceiver(ContextWrapper.java:331)
    at
  android.widget.ViewFlipper.onDetachedFromWindow(ViewFlipper.java:104)
    at android.view.View.dispatchDetachedFromWindow(View.java:6235)     at
  android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:1250)
    at
  android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:1248)
    at
  android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:1248)
    at
  android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:1248)
    at
  android.view.ViewRoot.dispatchDetachedFromWindow(ViewRoot.java:1838)
    at android.view.ViewRoot.doDie(ViewRoot.java:2916)  at
  android.view.ViewRoot.die(ViewRoot.java:2886)     at
  android.view.WindowManagerImpl.removeViewImmediate(WindowManagerImpl.java:254)
    at
  android.view.Window$LocalWindowManager.removeViewImmediate(Window.java:445)
    at
  android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:3182)
    at
  android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:3287)
    at android.app.ActivityThread.access$1600(ActivityThread.java:132)
    at
  android.app.ActivityThread$H.handleMessage(ActivityThread.java:1042)
    at android.os.Handler.dispatchMessage(Handler.java:99)  at
  android.os.Looper.loop(Looper.java:150)   at
  android.app.ActivityThread.main(ActivityThread.java:4293)     at
  java.lang.reflect.Method.invokeNative(Native Method)  at
  java.lang.reflect.Method.invoke(Method.java:507)  at
  com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)     at
  dalvik.system.NativeStart.main(Native Method).

I am new to these errors. How to solve these errors.
package com.texter.messenger;

import java.util.List;

import android.app.Activity;
import android.app.PendingIntent;
import android.app.PendingIntent.CanceledException;
import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.os.HandlerThread;
import android.os.IBinder;
import android.os.Looper;
import android.os.Message;
import android.os.PowerManager;
import android.os.Process;
import android.telephony.SmsManager;
import android.telephony.SmsMessage;
import android.telephony.SmsMessage.MessageClass;
import android.telephony.TelephonyManager;
import android.util.Log;

import com.texter.common.TexterConstants;
import com.texter.common.TexterNotification;
import com.texter.common.Utils;
import com.texter.data.TexterDB;
import com.texter.data.TexterDB.Schedule;
import com.texter.preferences.TexterPreferenceManager;
import com.texterpro.app.ConversationList;
import com.texterpro.app.R;
import com.texterpro.app.SmsPopupView;

public class SmsReceiverService extends Service {

        private static final String LOG_TAG = TexterConstants.COMMON_TAG;

        private static final String ACTION_SMS_RECEIVED = "android.provider.Telephony.SMS_RECEIVED";
        private static final String ACTION_MMS_RECEIVED = "android.provider.Telephony.WAP_PUSH_RECEIVED";
        private static final String ACTION_MESSAGE_RECEIVED = "net.everythingandroid.smspopup.MESSAGE_RECEIVED";
        private static final String MMS_DATA_TYPE = "application/vnd.wap.mms-message";

        // https://android.googlesource.com/platform/packages/apps/Mms/+/master/src/com/android/mms/transaction/SmsReceiverService.java
        public static final String MESSAGE_SENT_ACTION = "com.android.mms.transaction.MESSAGE_SENT";

        /*
         * This is the number of retries and pause between retries that we will keep
         * checking the system message database for the latest incoming message
         */
        private static final int MESSAGE_RETRY = 8;
        private static final int MESSAGE_RETRY_PAUSE = 1000;

        private Context context;
        private ServiceHandler mServiceHandler;
        private Looper mServiceLooper;
        private int mResultCode;

        private static final Object mStartingServiceSync = new Object();
        private static PowerManager.WakeLock mStartingService;

        private static final int TOAST_HANDLER_MESSAGE_SENT = 0;
        private static final int TOAST_HANDLER_MESSAGE_SEND_LATER = 1;
        private static final int TOAST_HANDLER_MESSAGE_FAILED = 2;

        @Override
        public void onCreate() {
                HandlerThread thread = new HandlerThread("Log.LOGTAG",
                                Process.THREAD_PRIORITY_BACKGROUND);
                thread.start();
                context = getApplicationContext();
                mServiceLooper = thread.getLooper();
                mServiceHandler = new ServiceHandler(mServiceLooper);
                Log.v(LOG_TAG, "Oncreate");
        }

        @Override
        public void onStart(Intent intent, int startId) {
                Log.v(LOG_TAG, "OnStart");
                mResultCode = intent != null ? intent.getIntExtra("result", 0) : 0;

                Message msg = mServiceHandler.obtainMessage();
                msg.arg1 = startId;
                msg.obj = intent;
                mServiceHandler.sendMessage(msg);
        }

        @Override
        public void onDestroy() {
                mServiceLooper.quit();
        }

        @Override
        public IBinder onBind(Intent intent) {
                return null;
        }

        private final class ServiceHandler extends Handler {
                public ServiceHandler(Looper looper) {
                        super(looper);
                }

                @Override
                public void handleMessage(Message msg) {
                        Log.v(LOG_TAG, "handlemessage:");
                        Log.v(LOG_TAG, msg.toString());
                        int serviceId = msg.arg1;
                        Intent intent = (Intent) msg.obj;
                        String action = intent.getAction();
                        String dataType = intent.getType();

                        if (ACTION_SMS_RECEIVED.equals(action)) {
                                handleSmsReceived(intent);
                        } else if (ACTION_MMS_RECEIVED.equals(action)
                                        && MMS_DATA_TYPE.equals(dataType)) {
                                handleMmsReceived(intent);
                        } else if (MESSAGE_SENT_ACTION.equals(action)) {
                                handleSmsSent(intent);
                        } else if (ACTION_MESSAGE_RECEIVED.equals(action)) {
                                handleMessageReceived(intent);
                        }

                        // NOTE: We MUST not call stopSelf() directly, since we need to
                        // make sure the wake lock acquired by AlertReceiver is released.
                        finishStartingService(SmsReceiverService.this, serviceId);
                }
        }

        /**
         * Handle receiving a SMS message
         */
        private void handleSmsReceived(Intent intent) {

                Bundle bundle = intent.getExtras();
                if (bundle != null) {
                        SmsMessage[] messages = Utils.getMessagesFromIntent(intent);
                        if (messages != null) {
                                notifyMessageReceived(new SmsMmsMessage(context, messages,
                                                System.currentTimeMillis()));
                        }
                }
        }

        private void notifyMessageReceived(SmsMmsMessage message) {

                // Class 0 SMS, let the system handle this
                if (message.getMessageType() == SmsMmsMessage.MESSAGE_TYPE_SMS
                                && message.getMessageClass() == MessageClass.CLASS_0) {
                        return;
                }

                TelephonyManager mTM = (TelephonyManager) context
                                .getSystemService(Context.TELEPHONY_SERVICE);
                boolean callStateIdle = mTM.getCallState() == TelephonyManager.CALL_STATE_IDLE;

                /*
                 * If popup is enabled for this user -AND- the user is not in a call
                 * -AND- -AND- phone is not docked -AND- (screen is locked -OR- (setting
                 * is OFF to only show on keyguard -AND- user is not in messaging app:
                 * then show the popup activity, otherwise check if notifications are on
                 * and just use the standard notification))
                 */

                boolean isApp = TexterPreferenceManager.getInstance(this)
                                .isAppEnabled();
                boolean showPop = TexterPreferenceManager.getInstance(this)
                                .isPopupEnabled();
                boolean showNotify = TexterPreferenceManager.getInstance(this)
                                .isNotifyEnabled();

                // Log.v(LOG_TAG," App = "+ isApp );
                // Log.v(LOG_TAG," pop = "+showPop );
                // Log.v(LOG_TAG," notify = "+showNotify );

                // if conversationList is visible then do not show pop
                if (!ConversationList.isVisible()) {
                        if (isApp && callStateIdle && showPop) {
                                // Log.v(LOG_TAG," showing popup = " );
                                if (!SmsPopupView.isPopupVisible())
                                        context.startActivity(message.getPopupIntent());
                        }
                }

                if (isApp && showNotify) {
                        TexterNotification.ShowMessageNotification(this, message);
                }

        }

        /**
         * Handle receiving a MMS message
         */
        private void handleMmsReceived(Intent intent) {

        }

        /**
         * Handle receiving an arbitrary message (potentially coming from a 3rd
         * party app)
         */
        private void handleMessageReceived(Intent intent) {

                Bundle bundle = intent.getExtras();
                if (bundle != null) {
                }
        }

        /*
         * Handler to deal with showing Toast messages for message sent status
         */
        public Handler mToastHandler = new Handler() {
                @Override
                public void handleMessage(Message msg) {

                        if (msg != null) {
                                switch (msg.what) {
                                case TOAST_HANDLER_MESSAGE_SENT:
                                        // TexterNotification.showToast(SmsReceiverService.this,R.string.quickreply_sent_toast);
                                        break;
                                case TOAST_HANDLER_MESSAGE_SEND_LATER:
                                        TexterNotification.showToast(SmsReceiverService.this,
                                                        R.string.quickreply_failed_send_later);
                                        break;
                                case TOAST_HANDLER_MESSAGE_FAILED:
                                        TexterNotification.showToast(SmsReceiverService.this,
                                                        R.string.quickreply_failed);
                                        break;
                                }
                        }
                }
        };

        /*
         * Handle the result of a sms being sent
         */
        private void handleSmsSent(Intent intent) {

                Log.v(LOG_TAG, "HandleSMSSent called");
                PackageManager pm = getPackageManager();
                Intent sysIntent = null;
                Intent tempIntent;
                List<ResolveInfo> receiverList;
                boolean forwardToSystemApp = true;

                // Search for system messaging app that will receive our
                // "message sent complete" type intent
                tempIntent = intent.setClassName(
                                SmsMessageSender.MESSAGING_PACKAGE_NAME,
                                SmsMessageSender.MESSAGING_RECEIVER_CLASS_NAME);

                tempIntent.setAction(SmsReceiverService.MESSAGE_SENT_ACTION);

                receiverList = pm.queryBroadcastReceivers(tempIntent, 0);

                if (receiverList.size() > 0) {
                        sysIntent = tempIntent;
                }

                Bundle b = intent.getExtras();
                long rowid = 0;

                rowid = b == null ? 0 : b.getLong("ROWID");

                /*
                 * No system messaging app was found to forward this intent to,
                 * therefore we will need to do the final piece of this ourselves which
                 * is basically moving the message to the correct folder depending on
                 * the result.
                 */
                // TexterNotification.showToast(SmsReceiverService.this,
                // "before moving folder");
                if (sysIntent == null) {

                        forwardToSystemApp = false;
                        Uri uri = intent.getData();
                        Log.v(LOG_TAG, "id = " + rowid);
                        if (mResultCode == Activity.RESULT_OK) {
                                SmsMessageSender.moveMessageToFolder(this, uri,
                                                SmsMessageSender.MESSAGE_TYPE_SENT);
                        } else if ((mResultCode == SmsManager.RESULT_ERROR_RADIO_OFF)
                                        || (mResultCode == SmsManager.RESULT_ERROR_NO_SERVICE)) {
                                SmsMessageSender.moveMessageToFolder(this, uri,
                                                SmsMessageSender.MESSAGE_TYPE_QUEUED);
                        } else {
                                SmsMessageSender.moveMessageToFolder(this, uri,
                                                SmsMessageSender.MESSAGE_TYPE_FAILED);
                        }
                }

                // Check the result and notify the user using a toast
                if (mResultCode == Activity.RESULT_OK) {
                        mToastHandler.sendEmptyMessage(TOAST_HANDLER_MESSAGE_SENT);
                        TexterDB.getInstance().updateStatus(rowid,
                                        Schedule.STATUS_SCHEDULED_SENT, 0);
                } else if ((mResultCode == SmsManager.RESULT_ERROR_RADIO_OFF)
                                || (mResultCode == SmsManager.RESULT_ERROR_NO_SERVICE)) {
                        TexterDB.getInstance().updateStatus(rowid,
                                        Schedule.STATUS_NOT_SENT, -1);
                } else {
                        mToastHandler.sendEmptyMessage(TOAST_HANDLER_MESSAGE_FAILED);
                        TexterDB.getInstance().updateStatus(rowid,
                                        Schedule.STATUS_NOT_SENT, mResultCode);
                }

                if (forwardToSystemApp) {
                        try {
                                PendingIntent.getBroadcast(this, 0, sysIntent, 0).send(
                                                mResultCode);
                        } catch (CanceledException e) {
                                e.printStackTrace();
                        }
                }
        }

        /**
         * Start the service to process the current event notifications, acquiring
         * the wake lock before returning to ensure that the service will run.
         */
        public static void beginStartingService(Context context, Intent intent) {
                synchronized (mStartingServiceSync) {
                        if (mStartingService == null) {
                                PowerManager pm = (PowerManager) context
                                                .getSystemService(Context.POWER_SERVICE);
                                mStartingService = pm.newWakeLock(
                                                PowerManager.PARTIAL_WAKE_LOCK,
                                                "Texter.SmsReceiverService");
                                mStartingService.setReferenceCounted(false);
                        }
                        mStartingService.acquire();
                        context.startService(intent);
                        Log.v(LOG_TAG, "service started");
                }
        }

        /**
         * Called back by the service when it has finished processing notifications,
         * releasing the wake lock if the service is now stopping.
         */
        public static void finishStartingService(Service service, int startId) {
                synchronized (mStartingServiceSync) {
                        if (mStartingService != null) {
                                if (service.stopSelfResult(startId)) {
                                        mStartingService.release();
                                }
                        }
                }
        }

}

A: Look at the top of the trace... look at the code at:
com.texter.messenger.SmsReceiverService$ServiceHandler.handleMessage(SmsReceiverService.java:116)

Looking at the code... check that the variable intent is not null before you call handleSmsReceived

A: I had the same bug, still looking for the correct solution but temporarily I just comment out the onDetachFromWindow() method. In my case it was for testing purpose so commenting it out didn't affect me but not sure what's in your case but give it a try.

A: In general, this question/answer gives an introduction to reading these errors:
What is a stack trace, and how can I use it to debug my application errors?
Looking at the code, intent should not be null, after all intent.getAction() executes without error.
It seems more likely that you have a problem with ViewFlipper, getting some "Receiver not registered" exception in the nested stack trace:
java.lang.IllegalArgumentException: Receiver not registered: android.widget.ViewFlipper$1@40597cc0
Maybe this question can point you in the right direction:
ViewFlipper : Receiver not registered


text:
Q: Properly highlighting the selected item in a RecyclerView by simple coding i would like to have highlight selected item on RecyclerView like with this code:
in that only first position of RecyclerView item is highlighted and onClick on my code dont work
private int selected_position = 0; //globally in the Adapter class

@Override
public void onBindViewHolder(final ViewHolder holder, int position) {
    holder.mItem = mValues.get(position);
    holder.mCoverView.setImageResource(holder.mItem.getCover());
    holder.mTitleView.setText(holder.mItem.getTitle());

    ...

    holder.itemView.setBackgroundColor(selected_position == position ? Color.GREEN : Color.TRANSPARENT);
}

public class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
    public final View mView;
    public final ImageView mCoverView;
    public final TextView mTitleView;
    public final TextView mDurationView;
    public MusicContent mItem;
    public FrameLayout itemsRoot;

    public ViewHolder(View itemView) {
        super(itemView);
        mView = itemView;
        mCoverView = (ImageView) itemView.findViewById(R.id.cover);

        ...

        itemView.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        if (getAdapterPosition() == RecyclerView.NO_POSITION) return;
        notifyItemChanged(selected_position);
        selected_position = getAdapterPosition();
        notifyItemChanged(selected_position);
    }
}

RecyclerView item xml:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/itemsRoot"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:foreground="?attr/selectableItemBackground"
    android:minHeight="?attr/listPreferredItemHeight"

    android:background="@drawable/selectable_item"

    android:transitionGroup="true">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center_vertical"
        android:gravity="center_vertical"
        android:paddingStart="@dimen/activity_horizontal_margin"
        android:paddingEnd="@dimen/activity_horizontal_margin">

        <TextView
            android:id="@+id/duration"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginStart="@dimen/inner_padding"
            android:textAppearance="@style/TextAppearance.AppCompat.Caption" />

    </LinearLayout>

</FrameLayout>

and then selectable_item xml content
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:drawable="@color/colorPrimary" android:state_pressed="true"/>
    <item android:drawable="@color/colorPrimaryLite" android:state_selected="true"/>
    <item android:drawable="@color/colorPrimaryDark" android:state_focused="true"/>
</selector>

A: I will tell you a simple way to highlight the selected position item in recyclerView
this method does not use and any selector property, I will simply change the background of selected item onclick and when you click again I will be reset to its initial state.
public class ModelItem {
private String name;

public void setName(String name) {
    this.name = name;
}

public String getName() {
    return this.name;
}

public boolean isClicked = false;

}
I am assuming that you know how to inflate a recycler view with items dummy or with actual data, so I will straight directly show you how to set the listener and change the background of LinearLayout or RelativeLayout.
You can set your listener on any view like ImageView or TextView
The model class I have created above will play the key role here the boolean value isClicked will initially set the background to normal and we will change its value on click like this,
below code goes inside your onBindViewHolder()
YOUR_ITEM_ON_WHICH_YOU_WANT_CLICK.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            ModelClass m = yourList.get(position);
            if (m.isClicked) {
                m.isClicked = false;
                yourList.set(position, m);
            } else {
                m.isClicked = true;
                yourList.set(position, m);
            }
        }
    });

    if (yourList.get(position).isClicked) {
     // If it is clicked   YOUR_LINEAR_OR_RELATIVELAYOUT.setBackgroundColor(context.getResources().getColor(R.color.white));
    } else {
    // If clicked again change the color to its original state
        YOUR_LINEAR_OR_RELATIVELAYOUT.setBackgroundColor(context.getResources().getColor(R.color.black));
    }

Let me know if it helps you or I will try to post another example.

A: From the code you've posted, your solution works perfectly. I've recreated it myself with a tiny app, and everything does exactly what it should.
public class MainActivity extends AppCompatActivity {

    private int selectedPosition = 0;
    private MyAdapter adapter = new MyAdapter();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        RecyclerView rv = findViewById(R.id.recycler);
        rv.setAdapter(adapter);
    }

    private class MyAdapter extends RecyclerView.Adapter<MyViewHolder> {

        @NonNull
        @Override
        public MyViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
            LayoutInflater inflater = LayoutInflater.from(parent.getContext());
            View itemView = inflater.inflate(R.layout.itemview, parent, false);
            return new MyViewHolder(itemView);
        }

        @Override
        public void onBindViewHolder(@NonNull MyViewHolder holder, int position) {
            holder.itemView.setBackgroundColor((position == selectedPosition) ? Color.GREEN : Color.WHITE);
        }

        @Override
        public int getItemCount() {
            return 1000;
        }
    }

    private class MyViewHolder extends RecyclerView.ViewHolder {

        public MyViewHolder(View itemView) {
            super(itemView);

            itemView.setOnClickListener(v -> {
                int position = getAdapterPosition();
                if (position != -1) {
                    adapter.notifyItemChanged(selectedPosition);
                    selectedPosition = position;
                    adapter.notifyItemChanged(selectedPosition);
                }
            });
        }
    }
}

That means that something else in your app is causing your code to not work. My best guess is that your adapter's data is changing over time in a way that's causing selectedPosition to become out of sync. For example:

*

*selectedPosition is 10

*a new item is inserted into the list at position 0

*the adapter is notified notifyItemInserted(0)
At this point, selectedPosition is still 10, but the logically "selected" item is at position 11. When your onClick() method runs, you'll notify the item at position 10 that it has been changed, but that won't change the background of the item at position 11, so now you'll have two green rows.


text:
Q: Chaining multiple include with thenInclude throws System.InvalidOperationException Consider this simplified model:
public class Field
{
   public string Name { get; set; }
   public MultilingualString Label { get; set; }
   public MultilingualString Placeholder { get; set; }
}

public class MultilingualString
{
   public string DefaultText { get; set; }
   public IList<Globalization> Globalizations { get; set; }
}

public class Globalization
{
   public string Text { get; set; }
   public Language Language { get; set; }
}

public class Language
{
   public string Name { get; set; }
   public string CultureString { get; set; }
}

Using my context, I am trying to get all my fields and include their Label and Placeholder along with the globalizations and language (the whole thing) by using the following command:
var field = context.Fields
   .Include(x => x.Label.Globalizations)
   .ThenInclude(x => x.Language)
   .Include(x => x.Placeholder.Globalizations)
   .ThenInclude(x => x.Language)
   .ToList();

I get the following exception thrown:

System.InvalidOperationException
  Invalid attempt to read when no data is present.

However, using only the first include/theninclude, I do get the expected results.
What gives? Is this a known bug, or did I misunderstand the Include/ThenInclude syntax?
This is using ef7 beta4 with VS2015 RC

A: This is a bug in EF 7. Should be fixed with aspnet/EntityFramework#2474, which will not be in the public EF build until beta 6. Of course, you can also try nightly builds