问:
Formatting chart data labels in openpyxl
I'm using Python 3.6.3 to write some excel sheets with openpyxl (2.4.9). Getting data labels on charted data wasn't obvious, but things start to go badly when I try to format said data labels. What I want to be able to do is change their position and also change their rotation. Anyone any ideas? I'm a bit fresh to python, so any advice would be great.
Here's what I've tried:</p>

```<code>from openpyxl.chart import LineChart, Reference, Series
from openpyxl.chart.label import DataLabelList
from openpyxl.chart.text import RichText
from openpyxl.drawing.text import RichTextProperties

#this is the only way I found to set text properties which didnt give an error
vertical = RichTextProperties(rot = 270)
labelvertical = RichText(bodyPr = vertical)

chart1 = LineChart()

# setup and append the first series
values = Reference(dprsheet, min_col=5, min_row=4, max_row=34)
series = Series(values, title="Series 1")
chart1.append(series)

# setup and append the second series
values = Reference(dprsheet, min_col=8, min_row=4, max_row=34)
series = Series(values, title="Series 2")
chart1.append(series)

dates = Reference(dprsheet, min_col=2, min_row=4, max_row=34)

chart1.set_categories(dates)

s1 = chart1.series[0]
s1.graphicalProperties.line.solidFill = 'FF0000'
s1.graphicalProperties.line.width = 25000
s1.dLbls = DataLabelList()
s1.dLbls.showVal = True

## s1.dLbls.dLblPos = 't'
## if ^this^ line isn't commented then ALL images in the sheet are removed by excel upon opening
## s1.dLbls.txPr = labelvertical
## if ^this^ line isn't commented then ALL images in the sheet are removed by excel upon opening
s2 = chart1.series[1]
s2.graphicalProperties.line.solidFill = '000000'
s2.graphicalProperties.line.width = 25000

essheet.add_chart(chart1, 'B35')
</code>```

答:
I got there in the end, via trying to work out how to change the axis labels... this should be extendable to any changes (using either the paragraph properties for fonts etc, or body properties for alignment etc).

```<code>from openpyxl.chart import LineChart, Reference, Series
from openpyxl.chart.label import DataLabelList
from openpyxl.chart.text import RichText
#additional imports needed for the solution:
from openpyxl.drawing.text import Paragraph, ParagraphProperties, CharacterProperties

chart1 = LineChart()
# setup and append the first series
values = Reference(dprsheet, min_col=5, min_row=4, max_row=34)
series = Series(values, title="Series 1")
chart1.append(series)
# setup and append the second series
values = Reference(dprsheet, min_col=8, min_row=4, max_row=34)
series = Series(values, title="Series 2")
chart1.append(series)

dates = Reference(dprsheet, min_col=2, min_row=4, max_row=34)
chart1.set_categories(dates)

#create label styling
axis = CharacterProperties(sz=800)
rot = openpyxl.drawing.text.RichTextProperties(vert='vert270')

#set axis label styles
chart1.x_axis.txPr = RichText(p=[Paragraph(pPr=ParagraphProperties(defRPr=axis), endParaRPr=axis)], bodyPr=rot)
chart1.y_axis.txPr = RichText(p=[Paragraph(pPr=ParagraphProperties(defRPr=axis), endParaRPr=axis)])

#set data labels and styles
s1 = chart1.series[0]
s1.dLbls = DataLabelList()
s1.dLbls.showVal = True
s1.dLbls.txPr = RichText(p=[Paragraph(pPr=ParagraphProperties(defRPr=axis), endParaRPr=axis)], bodyPr=rot)
</code>```

Note that chart.dataLabels.dLblPos still does not work (txPr can be amended but not position). The obvious work around requires setting position on each series individually.

Body:
I'm using Python 3.6.3 to write some excel sheets with openpyxl (2.4.9). Getting data labels on charted data wasn't obvious, but things start to go badly when I try to format said data labels. What I want to be able to do is change their position and also change their rotation. Anyone any ideas? I'm a bit fresh to python, so any advice would be great.
Here's what I've tried:

from openpyxl.chart import LineChart, Reference, Series
from openpyxl.chart.label import DataLabelList
from openpyxl.chart.text import RichText
from openpyxl.drawing.text import RichTextProperties

#this is the only way I found to set text properties which didnt give an error
vertical = RichTextProperties(rot = 270)
labelvertical = RichText(bodyPr = vertical)

chart1 = LineChart()

# setup and append the first series
values = Reference(dprsheet, min_col=5, min_row=4, max_row=34)
series = Series(values, title="Series 1")
chart1.append(series)

# setup and append the second series
values = Reference(dprsheet, min_col=8, min_row=4, max_row=34)
series = Series(values, title="Series 2")
chart1.append(series)

dates = Reference(dprsheet, min_col=2, min_row=4, max_row=34)

chart1.set_categories(dates)

s1 = chart1.series[0]
s1.graphicalProperties.line.solidFill = 'FF0000'
s1.graphicalProperties.line.width = 25000
s1.dLbls = DataLabelList()
s1.dLbls.showVal = True

## s1.dLbls.dLblPos = 't'
## if ^this^ line isn't commented then ALL images in the sheet are removed by excel upon opening
## s1.dLbls.txPr = labelvertical
## if ^this^ line isn't commented then ALL images in the sheet are removed by excel upon opening
s2 = chart1.series[1]
s2.graphicalProperties.line.solidFill = '000000'
s2.graphicalProperties.line.width = 25000

essheet.add_chart(chart1, 'B35')

Body:
I got there in the end, via trying to work out how to change the axis labels... this should be extendable to any changes (using either the paragraph properties for fonts etc, or body properties for alignment etc).

from openpyxl.chart import LineChart, Reference, Series
from openpyxl.chart.label import DataLabelList
from openpyxl.chart.text import RichText
#additional imports needed for the solution:
from openpyxl.drawing.text import Paragraph, ParagraphProperties, CharacterProperties

chart1 = LineChart()
# setup and append the first series
values = Reference(dprsheet, min_col=5, min_row=4, max_row=34)
series = Series(values, title="Series 1")
chart1.append(series)
# setup and append the second series
values = Reference(dprsheet, min_col=8, min_row=4, max_row=34)
series = Series(values, title="Series 2")
chart1.append(series)

dates = Reference(dprsheet, min_col=2, min_row=4, max_row=34)
chart1.set_categories(dates)

#create label styling
axis = CharacterProperties(sz=800)
rot = openpyxl.drawing.text.RichTextProperties(vert='vert270')

#set axis label styles
chart1.x_axis.txPr = RichText(p=[Paragraph(pPr=ParagraphProperties(defRPr=axis), endParaRPr=axis)], bodyPr=rot)
chart1.y_axis.txPr = RichText(p=[Paragraph(pPr=ParagraphProperties(defRPr=axis), endParaRPr=axis)])

#set data labels and styles
s1 = chart1.series[0]
s1.dLbls = DataLabelList()
s1.dLbls.showVal = True
s1.dLbls.txPr = RichText(p=[Paragraph(pPr=ParagraphProperties(defRPr=axis), endParaRPr=axis)], bodyPr=rot)

Note that chart.dataLabels.dLblPos still does not work (txPr can be amended but not position). The obvious work around requires setting position on each series individually.


来源: stackexchange

问:
only do not select duplicated values mysql?
I am looking for a way to run a simple SELECT statment. I have a table which has two columns: id and email.

I want to run a SELECT statment that won't return duplicate values. For example, take the following data:

```<code>1   example@hotmail.com
2   example12@hotmail.com
3   example@hotmail.com
4   example@hotmail.com
</code>```

I want it to return only the following:

```<code>2   example12@hotmail.com
</code>```

答:
Use aggregation count(*) and check the result of aggregate function using having clause to filter out those records which are not duplicated

```<code>select *
from demo
group by email
having count(*) = 1
</code>```

Demo

ContentLicense: CC BY-SA 3.0

Body:
I am looking for a way to run a simple SELECT statment. I have a table which has two columns: id and email.

I want to run a SELECT statment that won't return duplicate values. For example, take the following data:

1   example@hotmail.com
2   example12@hotmail.com
3   example@hotmail.com
4   example@hotmail.com

I want it to return only the following:

2   example12@hotmail.com

Body:
Use aggregation count(*) and check the result of aggregate function using having clause to filter out those records which are not duplicated

select *
from demo
group by email
having count(*) = 1

Demo


问:
How do I allow a user to pick a background colour of my website with a colour chooser and store it?

<input name="Color Picker" id="picker" onclick="setColor()" type="color" />
```

<pre class="lang-js prettyprint-override"><code>function setColor() {
  getColor();
  if (localStorage.getItem('background') !== null) {
    getColour = localStorage.background;
    $('body').css('background', getColour);
  }
}

function getColor() {
  localStorage.getItem('background') = picker;

}
</code>```

I want to take the user input for the custom colour and update the website background accordingly.

答:
Change your methods to (comments inline)

```<code><input name="Color Picker" id="picker" type="color"/>

document.querySelector( "input[type='color']" ).addEventListener( "click", function(){
      setColor(this);
});
function setColor( ele ){
    getColor();
    if( localStorage.getItem('background') ) { //notice that empty value is also checked
        $('body').css('background-color', ele.value ); //value directly picked from ele
    }
}
function getColor( ele ){
    localStorage.setItem('background', ele.value ); //notice that ele's value is picked up
}
</code>```

And this can be further compressed to

```<code>document.querySelector( "input[type='color']" ).addEventListener( "click", function(){
    if( this.value  ) { //notice that empty value is also checked
        $('body').css('background-color', this.value );
        localStorage.setItem('background', this.value );
    }
});
</code>```

Body:
<input name="Color Picker" id="picker" onclick="setColor()" type="color" />

function setColor() {
  getColor();
  if (localStorage.getItem('background') !== null) {
    getColour = localStorage.background;
    $('body').css('background', getColour);
  }
}

function getColor() {
  localStorage.getItem('background') = picker;

}

I want to take the user input for the custom colour and update the website background accordingly.

Body:
Change your methods to (comments inline)

<input name="Color Picker" id="picker" type="color"/>

document.querySelector( "input[type='color']" ).addEventListener( "click", function(){
      setColor(this);
});
function setColor( ele ){
    getColor();
    if( localStorage.getItem('background') ) { //notice that empty value is also checked
        $('body').css('background-color', ele.value ); //value directly picked from ele
    }
}
function getColor( ele ){
    localStorage.setItem('background', ele.value ); //notice that ele's value is picked up
}

And this can be further compressed to

document.querySelector( "input[type='color']" ).addEventListener( "click", function(){
    if( this.value  ) { //notice that empty value is also checked
        $('body').css('background-color', this.value );
        localStorage.setItem('background', this.value );
    }
});


问:
Why isn't this swap program working in C?
I'm completely new to C and I'm trying to create a basic swap program, can someone please explain why the code below isn't working.

```<code>#include <stdio.h>

void swap (int *p1, int *p2);
    int *temp = *p1;
    *p1 = *p2;
    *p2 = temp;

int main ()
{
    int x = 10;
    int y = 20;
    int *p1 = &x, *p2 = &y;
    swap (p1, p2);

    printf ("x: %d, y: %d\n", x, y);
}
</code>```

Thanks in advance.

答:
int *temp = *p1; will not compile (this is a constraint violation and must result in a compiler diagnostic): you are assigning an int (other than 0) to a pointer type. And that's not allowed.

Write int temp = *p1;, fix the obvious typos in the swap function - give it a body! - and all will be well.

Body:
I'm completely new to C and I'm trying to create a basic swap program, can someone please explain why the code below isn't working.

#include <stdio.h>

void swap (int *p1, int *p2);
    int *temp = *p1;
    *p1 = *p2;
    *p2 = temp;

int main ()
{
    int x = 10;
    int y = 20;
    int *p1 = &x, *p2 = &y;
    swap (p1, p2);

    printf ("x: %d, y: %d\n", x, y);
}

Thanks in advance.


问:
How to position fancybox on top
How to position the fancybox 100px from top by default it is center aligned.

I believe there is no api settings for that. Can anyone help me out in doing it on the actual script.

答:
this work fine for me</p>

```<code><script>
    $.fancybox({
       'width'     : 620,
       'height'    : 490,
       'speedIn'    :600,
       'speedOut'   :200,
                'onStart' :function()
                {

                        $("#fancybox-wrap").addClass('my_class');
                },
    });
</script>
    <style>
    .my_class{top:20px !important; }
    </style>
</code>```

ContentLicense: CC BY-SA 2.5

Title: How to position fancybox on top

Body:
this work fine for me

<script>
    $.fancybox({
       'width'     : 620,
       'height'    : 490,
       'speedIn'    :600,
       'speedOut'   :200,
                'onStart' :function()
                {

                        $("#fancybox-wrap").addClass('my_class');
                },
    });
</script>
    <style>
    .my_class{top:20px !important; }
    </style>


问:
How to resolve error: EACCES: permission denied when installing Polymer 2.0
Running into an issue trying to install Polymer 2.0
I have node v 8.9.1 installed as well as bower 1.8.2.

To install polymer 2.0, I used the following statements directly from the Polymer install docs:

```<code>npm install -g polymer-cli
</code>```

However, I keep running into this error and don't know how to get around it.

```<code>npm WARN deprecated bower@1.8.2: ...psst! Your project can stop working at any moment because its dependencies can change. Prevent this by migrating to Yarn: https://bower.io/blog/2017/how-to-migrate-away-from-bower/
npm WARN deprecated babel-preset-es2015@6.24.1:   Thanks for using Babel: we recommend using babel-preset-env now: please read babeljs.io/env to update!
npm WARN deprecated @types/assert@0.0.29: See https://github.com/DefinitelyTyped/DefinitelyTyped/issues/12826
npm ERR! path /usr/local/bin/polymer
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall unlink
npm ERR! Error: EACCES: permission denied, unlink '/usr/local/bin/polymer'
npm ERR!  { Error: EACCES: permission denied, unlink '/usr/local/bin/polymer'
npm ERR!   cause:
npm ERR!    { Error: EACCES: permission denied, unlink '/usr/local/bin/polymer'
npm ERR!      errno: -13,
npm ERR!      code: 'EACCES',
npm ERR!      syscall: 'unlink',
npm ERR!      path: '/usr/local/bin/polymer' },
npm ERR!   stack: 'Error: EACCES: permission denied, unlink \'/usr/local/bin/polymer\'',
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'unlink',
npm ERR!   path: '/usr/local/bin/polymer' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/jdk588/.npm/_logs/2017-12-04T14_51_46_451Z-debug.log
</code>```

I've tried running the command with sudo and still no luck.

答:
I am not sure this is the solution but here below from the Polymer page :

What versions of Node.js do we support?

We support all "Current" and "Active LTS" releases of Node.js according to the Node.js Long Term Support Release Schedule, but not "Maintenance" releases.

This means we will support from two to three semver major versions of Node.js, depending on where we are in the Node LTS schedule. Currently we support 6.x and 7.x.

So, try to downgrade the Node ver. to 6.x or 7.x

Body:
Running into an issue trying to install Polymer 2.0
I have node v 8.9.1 installed as well as bower 1.8.2.

To install polymer 2.0, I used the following statements directly from the Polymer install docs:

npm install -g polymer-cli

However, I keep running into this error and don't know how to get around it.

npm WARN deprecated bower@1.8.2: ...psst! Your project can stop working at any moment because its dependencies can change. Prevent this by migrating to Yarn: https://bower.io/blog/2017/how-to-migrate-away-from-bower/
npm WARN deprecated babel-preset-es2015@6.24.1:   Thanks for using Babel: we recommend using babel-preset-env now: please read babeljs.io/env to update!
npm WARN deprecated @types/assert@0.0.29: See https://github.com/DefinitelyTyped/DefinitelyTyped/issues/12826
npm ERR! path /usr/local/bin/polymer
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall unlink
npm ERR! Error: EACCES: permission denied, unlink '/usr/local/bin/polymer'
npm ERR!  { Error: EACCES: permission denied, unlink '/usr/local/bin/polymer'
npm ERR!   cause:
npm ERR!    { Error: EACCES: permission denied, unlink '/usr/local/bin/polymer'
npm ERR!      errno: -13,
npm ERR!      code: 'EACCES',
npm ERR!      syscall: 'unlink',
npm ERR!      path: '/usr/local/bin/polymer' },
npm ERR!   stack: 'Error: EACCES: permission denied, unlink \'/usr/local/bin/polymer\'',
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'unlink',
npm ERR!   path: '/usr/local/bin/polymer' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/jdk588/.npm/_logs/2017-12-04T14_51_46_451Z-debug.log

I've tried running the command with sudo and still no luck.


答:
Try this:</p>

```<code>select min(id),
       object_id,
       min(status_val)
from table
group by object_id
having count(*) = 1
</code>```

Title: Select Except the duplicate Records from the table in SQL Server

Body:
I have a SQL Server table that has duplicate entries in one of the columns  e.g.:

  +----+-----------+------------+
  | id | object_id | status_val |
  +----+-----------+------------+
  |  1 |         1 |          0 |
  |  2 |         1 |          0 |
  |  3 |         1 |          0 |
  |  4 |         2 |          0 |
  |  5 |         3 |          0 |
  |  6 |         4 |          0 |
  |  7 |         4 |          0 |
  +----+-----------+------------+

I need the output to be like this:

  +----+-----------+------------+
  | id | object_id | status_val |
  +----+-----------+------------+
  |  4 |         2 |          0 |
  |  5 |         3 |          0 |
  +----+-----------+------------+

How to resolve this?

Body:
Try this:

select min(id),
       object_id,
       min(status_val)
from table
group by object_id
having count(*) = 1


问:
Null array of buttons supposed to be set
I don't understand why in my code I get a :

null reference object

when i try to click on my buttons.

```<code>buttonMenuOption = findViewById(R.id.buttonOption);
Button[] buttonsOption = new Button[nbObjects];
buttonsOption[0] = findViewById(R.id.buttonOption0);
buttonsOption[1] = findViewById(R.id.buttonOption1);
buttonMenuOption.setOnClickListener(new View.OnClickListener() {
    public void onClick(View v) {
        setContentView(R.layout.graph_option);
            for (int i = 0; i < nbObjects; i++) {
                final int j = i;
                    buttonsOption[i].setOnClickListener(new View.OnClickListener() {
                        public void onClick(View v) {
                            //Do stuff
                          }
                    });
             }
     });
</code>```

To resume my code, there is an option button in my main activity, when I press it, it changes the layout then there are multiples buttons to activate a color picker.

Why is my buttonsOption[0] a null reference?

Update

```<code>buttonMenuOption = findViewById(R.id.buttonOption)
buttonMenuOption.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
     setContentView(R.layout.graph_option);
     Button[] buttonsOption = new Button[nbObjects];
        for (int i = 0; i < nbObjects; i++) {
            final int j = i;
            buttonsOption[0] = findViewById(R.id.buttonOption0);
            buttonsOption[1] = findViewById(R.id.buttonOption1);
            buttonsOption[i].setOnClickListener(new View.OnClickListener() {
                    public void onClick(View v) {
                        //Do stuff
                      }
                });
         }
 });
</code>```

答:
Is it because you have declared an array of buttons but not declared any button for the index of the array?

If buttonsOption[0] is null, I would declare the array and then the button.

```<code>Button[] buttonsOption = new Button[nbObjects];

for(int i=0; i<nbObjects;i++){
    buttonOption[i] = new Button();
}
</code>```

Body:
I don't understand why in my code I get a :

null reference object

when i try to click on my buttons.

buttonMenuOption = findViewById(R.id.buttonOption);
Button[] buttonsOption = new Button[nbObjects];
buttonsOption[0] = findViewById(R.id.buttonOption0);
buttonsOption[1] = findViewById(R.id.buttonOption1);
buttonMenuOption.setOnClickListener(new View.OnClickListener() {
    public void onClick(View v) {
        setContentView(R.layout.graph_option);
            for (int i = 0; i < nbObjects; i++) {
                final int j = i;
                    buttonsOption[i].setOnClickListener(new View.OnClickListener() {
                        public void onClick(View v) {
                            //Do stuff
                          }
                    });
             }
     });

To resume my code, there is an option button in my main activity, when I press it, it changes the layout then there are multiples buttons to activate a color picker.

Why is my buttonsOption[0] a null reference?

Update

buttonMenuOption = findViewById(R.id.buttonOption)
buttonMenuOption.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
     setContentView(R.layout.graph_option);
     Button[] buttonsOption = new Button[nbObjects];
        for (int i = 0; i < nbObjects; i++) {
            final int j = i;
            buttonsOption[0] = findViewById(R.id.buttonOption0);
            buttonsOption[1] = findViewById(R.id.buttonOption1);
            buttonsOption[i].setOnClickListener(new View.OnClickListener() {
                    public void onClick(View v) {
                        //Do stuff
                      }
                });
         }
 });

Body:
Is it because you have declared an array of buttons but not declared any button for the index of the array?

If buttonsOption[0] is null, I would declare the array and then the button.

Button[] buttonsOption = new Button[nbObjects];

for(int i=0; i<nbObjects;i++){
    buttonOption[i] = new Button();
}


问:
Proguard issues with Gradle 3.0.0
I'm trying to create an APK using ProGuard and the new Gradle 3.0.0 version. I'm getting a lot of warnings on classes that I thought I ignored in my ProGuard configuration file. The same configuration works well with Gradle 2.3.3 but seems to break on 3.0.0. The warnings are so many it's almost not reading the ProGuard configuration at all.

My build.gradle

```<code>buildscript {
    repositories {
        mavenCentral()
        jcenter()
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.3'
        classpath 'com.google.gms:google-services:3.0.0'
        classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
        classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.2'

    }

}

allprojects {
    repositories {
        jcenter()
        maven {
            url 'https://jitpack.io'
        }
        maven {
            url 'https://maven.google.com'
        }

    }
}
android{
 buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'),
                    'proguard-rules.pro'
            signingConfig signingConfigs.release
            lintOptions {
                disable 'MissingTranslation'
            }

        }

compileSdkVersion 27
buildToolsVersion "27.0.1"
defaultConfig {
minSdkVersion 16
targetSdkVersion 27
testInstrumentationRunner
"android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true

}
</code>```

Proguard warning below.

```<code>    Warning: library class android.animation.FloatArrayEvaluator extends or implements program class android.animation.TypeEvaluator
    Warning: library class android.animation.IntArrayEvaluator extends or implements program class android.animation.TypeEvaluator
    Warning: library class android.animation.PointFEvaluator extends or implements program class android.animation.TypeEvaluator
    Warning: library class android.animation.RectEvaluator extends or implements program class android.animation.TypeEvaluator
    Warning: library class android.app.ActivityManager$TaskDescription extends or implements program class android.os.Parcelable
    Warning: library class android.app.AlarmManager$AlarmClockInfo extends or implements program class android.os.Parcelable
    Warning: library class android.app.AuthenticationRequiredException extends or implements program class android.os.Parcelable
    Warning: library class android.app.AutomaticZenRule extends or implements program class android.os.Parcelable
    Warning: library class android.app.Notification$Action extends or implements program class android.os.Parcelable
    Warning: library class android.app.Notification$DecoratedCustomViewStyle extends or implements program class android.app.Notification$Style
    Warning: library class android.app.Notification$MediaStyle extends or implements program class android.app.Notification$Style
    Warning: library class android.app.Notification$MessagingStyle extends or implements program class android.app.Notification$Style
    Warning: library class android.app.NotificationChannel extends or implements program class android.os.Parcelable
    Warning: library class android.app.NotificationChannelGroup extends or implements program class android.os.Parcelable
    Warning: library class android.app.NotificationManager$Policy extends or implements program class android.os.Parcelable
    Warning: library class android.app.PictureInPictureParams extends or implements program class android.os.Parcelable
    Warning: library class android.app.Presentation extends or implements program class android.app.Dialog
    Warning: library class android.app.RemoteAction extends or implements program class android.os.Parcelable
    Warning: library class android.app.RemoteInput extends or implements program class android.os.Parcelable
    Warning: library class android.app.VoiceInteractor$PickOptionRequest$Option extends or implements program class android.os.Parcelable
    Warning: library class android.app.VoiceInteractor$Prompt extends or implements program class android.os.Parcelable
    Warning: library class android.app.WallpaperColors extends or implements program class android.os.Parcelable
    Warning: library class android.app.admin.ConnectEvent extends or implements program class android.os.Parcelable
    Warning: library class android.app.admin.DeviceAdminService extends or implements program class android.app.Service
    Warning: library class android.app.admin.DnsEvent extends or implements program class android.os.Parcelable
    Warning: library class android.app.admin.NetworkEvent extends or implements program class android.os.Parcelable
    Warning: library class android.app.admin.SecurityLog$SecurityEvent extends or implements program class android.os.Parcelable
    Warning: library class android.app.admin.SystemUpdateInfo extends or implements program class android.os.Parcelable
    Warning: library class android.app.admin.SystemUpdatePolicy extends or implements program class android.os.Parcelable
    Warning: library class android.app.assist.AssistContent extends or implements program class android.os.Parcelable
    Warning: library class android.app.assist.AssistStructure extends or implements program class android.os.Parcelable
    Warning: library class android.app.job.JobInfo extends or implements program class android.os.Parcelable

    Warning: library class android.util.FloatProperty extends or implements program class android.util.Property
    Warning: library class android.util.IntProperty extends or implements program class android.util.Property
    Warning: library class android.view.ActionMode$Callback2 extends or implements program class android.view.ActionMode$Callback
    Warning: library class android.view.Display$HdrCapabilities extends or implements program class android.os.Parcelable
    Warning: library class android.view.Display$Mode extends or implements program class android.os.Parcelable
    Warning: library class android.view.DragAndDropPermissions extends or implements program class android.os.Parcelable
    Warning: library class android.view.KeyboardShortcutGroup extends or implements program class android.os.Parcelable
    Warning: library class android.view.KeyboardShortcutInfo extends or implements program class android.os.Parcelable
    Warning: library class android.view.PointerIcon extends or implements program class android.os.Parcelable
    Warning: library class android.view.WindowAnimationFrameStats extends or implements program class android.os.Parcelable
    Warning: library class android.view.WindowContentFrameStats extends or implements program class android.os.Parcelable
    Warning: library class android.view.WindowId extends or implements program class android.os.Parcelable
    Warning: library class android.view.accessibility.AccessibilityWindowInfo extends or implements program class android.os.Parcelable
    Warning: library class android.view.animation.BaseInterpolator extends or implements program class android.view.animation.Interpolator
    Warning: library class android.view.autofill.AutofillId extends or implements program class android.os.Parcelable
    Warning: library class android.view.autofill.AutofillValue extends or implements program class android.os.Parcelable
    Warning: library class android.view.inputmethod.CursorAnchorInfo extends or implements program class android.os.Parcelable
    Warning: library class android.view.inputmethod.InputContentInfo extends or implements program class android.os.Parcelable
    Warning: library class android.widget.ActionMenuView extends or implements program class android.widget.LinearLayout
    Warning: library class android.widget.ActionMenuView$LayoutParams extends or implements program class android.widget.LinearLayout$LayoutParams

    Warning: library class android.app.RemoteInput depends on program class android.content.Intent
    Warning: library class android.app.RemoteInput depends on program class android.os.Bundle
    Warning: library class android.app.RemoteInput depends on program class android.content.Intent
    Warning: library class android.app.RemoteInput depends on program class android.os.Parcel
    Warning: library class android.app.RemoteInput$Builder depends on program class android.os.Bundle
    Warning: library class android.app.RemoteInput$Builder depends on program class android.os.Bundle
    Warning: library class android.app.SharedElementCallback depends on program class android.view.View
    Warning: library class android.app.SharedElementCallback depends on program class android.graphics.Matrix
    Warning: library class android.app.SharedElementCallback depends on program class android.graphics.RectF
    Warning: library class android.app.SharedElementCallback depends on program class android.os.Parcelable
    Warning: library class android.app.SharedElementCallback depends on program class android.content.Context

    Warning: library class android.media.session.MediaController$TransportControls depends on program class android.net.Uri
    Warning: library class android.media.session.MediaController$TransportControls depends on program class android.os.Bundle
    Warning: library class android.media.session.MediaController$TransportControls depends on program class android.os.Bundle
    Warning: library class android.media.session.MediaController$TransportControls depends on program class android.os.Bundle
    Warning: library class android.media.session.MediaSession depends on program class android.content.Context
    Warning: library class android.media.session.MediaSession depends on program class android.os.Handler
    Warning: library class android.media.session.MediaSession depends on program class android.app.PendingIntent
    Warning: library class android.media.session.MediaSession depends on program class android.app.PendingIntent
    Warning: library class android.media.session.MediaSession depends on program class android.os.Bundle
    Warning: library class android.media.session.MediaSession depends on program class android.os.Bundle
    Warning: library class android.media.session.MediaSession$Callback depends on program class android.os.Bundle
    Warning: library class android.media.session.MediaSession$Callback depends on program class android.os.ResultReceiver
    Warning: library class android.media.session.MediaSession$Callback depends on program class android.content.Intent
    Warning: library class android.media.session.MediaSession$Callback depends on program class android.os.Bundle
    Warning: library class android.media.session.MediaSession$Callback depends on program class android.os.Bundle
    Warning: library class android.media.session.MediaSession$Callback depends on program class android.net.Uri
    Warning: library class android.media.session.MediaSession$Callback depends on program class android.os.Bundle
    Warning: library class android.media.session.MediaSession$Callback depends on program class android.os.Bundle
    Warning: library class android.media.session.MediaSession$Callback depends on program class android.os.Bundle
    Warning: library class android.media.session.MediaSession$Callback depends on program class android.net.Uri
    Warning: library class android.media.session.MediaSession$Callback depends on program class android.os.Bundle
    Warning: library class android.media.session.MediaSession$Callback depends on program class android.os.Bundle
    Warning: library class android.media.session.MediaSession$QueueItem depends on program class android.os.Parcelable$Creator
    Warning: library class android.media.session.MediaSession$QueueItem depends on program class android.os.Parcel
    Warning: library class android.media.session.MediaSession$Token depends on program class android.os.Parcelable$Creator
    Warning: library class android.media.session.MediaSession$Token depends on program class android.os.Parcel
    Warning: library class android.media.session.PlaybackState depends on program class android.os.Parcelable$Creator
    Warning: library class android.media.session.PlaybackState depends on program class android.os.Parcel
    Warning: library class android.media.session.PlaybackState depends on program class android.os.Bundle
    Warning: library class android.media.session.PlaybackState$Builder depends on program class android.os.Bundle
    Warning: library class android.media.session.PlaybackState$CustomAction depends on program class android.os.Parcelable$Creator
    Warning: library class android.media.session.PlaybackState$CustomAction depends on program class android.os.Parcel
    Warning: library class android.media.session.PlaybackState$CustomAction depends on program class android.os.Bundle
    Warning: library class android.media.session.PlaybackState$CustomAction$Builder depends on program class android.os.Bundle
    Warning: library class android.net.Network depends on program class android.os.Parcelable$Creator
    Warning: library class android.net.Network depends on program class android.os.Parcel
    Warning: library class android.os.LocaleList depends on program class android.os.Parcelable$Creator
    Warning: library class android.os.LocaleList depends on program class android.os.Parcel
    Warning: library class android.os.PersistableBundle depends on program class android.os.Parcelable$Creator
    Warning: library class android.os.PersistableBundle depends on program class android.os.Parcel
    Warning: library class android.os.UserManager depends on program class android.os.Bundle
    Warning: library class android.os.UserManager depends on program class android.os.Bundle
    Warning: library class android.provider.DocumentsContract depends on program class android.net.Uri

    Warning: library class android.provider.DocumentsContract depends on program class android.net.Uri
    Warning: library class android.provider.DocumentsContract depends on program class android.net.Uri
    Warning: library class android.provider.DocumentsContract depends on program class android.content.Context
    Warning: library class android.provider.DocumentsContract depends on program class android.net.Uri
    Warning: library class android.provider.DocumentsContract depends on program class android.net.Uri
    Warning: library class android.provider.DocumentsContract depends on program class android.net.Uri
    Warning: library class android.provider.DocumentsContract depends on program class android.net.Uri
    Warning: library class android.provider.DocumentsContract depends on program class android.net.Uri
    Warning: library class android.provider.DocumentsContract depends on program class android.net.Uri
    Warning: library class android.provider.DocumentsContract depends on program class android.content.ContentResolver
    Warning: library class android.provider.DocumentsContract depends on program class android.net.Uri
    Warning: library class android.provider.DocumentsContract depends on program class android.graphics.Point
    Warning: library class android.provider.DocumentsContract depends on program class android.os.CancellationSignal
    Warning: library class android.provider.DocumentsContract depends on program class android.graphics.Bitmap
    Warning: library class android.provider.DocumentsContract depends on program class android.content.ContentResolver
    Warning: library class android.provider.DocumentsContract depends on program class android.net.Uri
    Warning: library class android.provider.DocumentsContract depends on program class android.net.Uri
    Warning: library class android.provider.DocumentsContract depends on program class android.content.ContentResolver
    Warning: library class android.provider.DocumentsContract depends on program class android.net.Uri
    Warning: library class android.provider.DocumentsContract depends on program class android.net.Uri
    Warning: library class android.provider.DocumentsContract depends on program class android.content.ContentResolver
    Warning: library class android.provider.DocumentsContract depends on program class android.net.Uri
    Warning: library class android.provider.DocumentsContract depends on program class android.content.ContentResolver

    Warning: library class android.security.KeyPairGeneratorSpec depends on program class android.content.Context
    Warning: library class android.security.KeyPairGeneratorSpec$Builder depends on program class android.content.Context
    Warning: library class android.service.media.MediaBrowserService depends on program class android.content.Intent
    Warning: library class android.service.media.MediaBrowserService depends on program class android.os.IBinder
    Warning: library class android.service.media.MediaBrowserService depends on program class android.os.Bundle
    Warning: library class android.service.media.MediaBrowserService depends on program class android.os.Bundle
    Warning: library class android.service.media.MediaBrowserService depends on program class android.os.Bundle
    Warning: library class android.service.media.MediaBrowserService depends on program class android.os.Bundle
    Warning: library class android.service.media.MediaBrowserService$BrowserRoot depends on program class android.os.Bundle
    Warning: library class android.service.media.MediaBrowserService$BrowserRoot depends on program class android.os.Bundle

    Warning: library class android.widget.Toolbar depends on program class android.util.AttributeSet
    Warning: library class android.widget.Toolbar depends on program class android.graphics.drawable.Drawable
    Warning: library class android.widget.Toolbar depends on program class android.graphics.drawable.Drawable
    Warning: library class android.widget.Toolbar depends on program class android.content.Context
    Warning: library class android.widget.Toolbar depends on program class android.content.Context
    Warning: library class android.widget.Toolbar depends on program class android.graphics.drawable.Drawable
    Warning: library class android.widget.Toolbar depends on program class android.graphics.drawable.Drawable
    Warning: library class android.widget.Toolbar depends on program class android.view.View$OnClickListener
    Warning: library class android.widget.Toolbar depends on program class android.view.Menu
    Warning: library class android.widget.Toolbar depends on program class android.graphics.drawable.Drawable
    Warning: library class android.widget.Toolbar depends on program class android.graphics.drawable.Drawable
    Warning: library class android.widget.Toolbar depends on program class android.os.Parcelable
    Warning: library class android.widget.Toolbar depends on program class android.os.Parcelable
    Warning: library class android.widget.Toolbar depends on program class android.view.MotionEvent
    Warning: library class android.widget.Toolbar depends on program class android.util.AttributeSet
    Warning: library class android.widget.Toolbar depends on program class android.view.ViewGroup$LayoutParams
    Warning: library class android.widget.Toolbar depends on program class android.view.ViewGroup$LayoutParams
    Warning: library class android.widget.Toolbar depends on program class android.view.ViewGroup$LayoutParams
    Warning: library class android.widget.Toolbar depends on program class android.view.ViewGroup$LayoutParams
    Warning: library class android.widget.Toolbar depends on program class android.view.ViewGroup$LayoutParams
    Warning: library class android.widget.Toolbar depends on program class android.util.AttributeSet
    Warning: library class android.widget.Toolbar depends on program class android.view.ViewGroup$LayoutParams

    Note: there were 15 references to unknown classes.
          You should check your configuration for typos.
          (http://proguard.sourceforge.net/manual/troubleshooting.html#unknownclass)
    Note: there were 21 unresolved dynamic references to classes or interfaces.
          You should check if you need to specify additional program jars.
          (http://proguard.sourceforge.net/manual/troubleshooting.html#dynamicalclass)

    Warning: there were 928 instances of library classes depending on program classes.
             You must avoid such dependencies since the program classes will be processed, while the library classes will remain unchanged.
             (http://proguard.sourceforge.net/manual/troubleshooting.html#dependency)
    Warning: there were 53 unresolved references to program class members.
             Your input classes appear to be inconsistent.
             You may need to recompile the code.
             (http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedprogramclassmember)

    Warning: Exception while processing task java.io.IOException: Please correct the above warnings first.
    :transformClassesAndResourcesWithProguardForCouchdbRelease FAILED

    FAILURE: Build failed with an exception.

    * What went wrong:
    Execution failed for task ':transformClassesAndResourcesWithProguardForCouchdbRelease'.
    > Job failed, see logs for details
</code>```

答:
I've upgraded to gradle 3.0.1 and most of the warnings are gone. If you're still on 3.0.0 then use this in your proguard file

```<code>-dontwarn android.**
</code>```

Not ideal but gets it working.

Title: Proguard issues with Gradle 3.0.0

Body:
I'm trying to create an APK using ProGuard and the new Gradle 3.0.0 version. I'm getting a lot of warnings on classes that I thought I ignored in my ProGuard configuration file. The same configuration works well with Gradle 2.3.3 but seems to break on 3.0.0. The warnings are so many it's almost not reading the ProGuard configuration at all.

My build.gradle

buildscript {
    repositories {
        mavenCentral()
        jcenter()
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.3'
        classpath 'com.google.gms:google-services:3.0.0'
        classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
        classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.2'

    }

}

allprojects {
    repositories {
        jcenter()
        maven {
            url 'https://jitpack.io'
        }
        maven {
            url 'https://maven.google.com'
        }

    }
}
android{
 buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'),
                    'proguard-rules.pro'
            signingConfig signingConfigs.release
            lintOptions {
                disable 'MissingTranslation'
            }

        }

compileSdkVersion 27
buildToolsVersion "27.0.1"
defaultConfig {
minSdkVersion 16
targetSdkVersion 27
testInstrumentationRunner
"android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true

}

Proguard warning below.

    Warning: library class android.animation.FloatArrayEvaluator extends or implements program class android.animation.TypeEvaluator
    Warning: library class android.animation.IntArrayEvaluator extends or implements program class android.animation.TypeEvaluator
    Warning: library class android.animation.PointFEvaluator extends or implements program class android.animation.TypeEvaluator
    Warning: library class android.animation.RectEvaluator extends or implements program class android.animation.TypeEvaluator
    Warning: library class android.app.ActivityManager$TaskDescription extends or implements program class android.os.Parcelable
    Warning: library class android.app.AlarmManager$AlarmClockInfo extends or implements program class android.os.Parcelable
    Warning: library class android.app.AuthenticationRequiredException extends or implements program class android.os.Parcelable
    Warning: library class android.app.AutomaticZenRule extends or implements program class android.os.Parcelable
    Warning: library class android.app.Notification$Action extends or implements program class android.os.Parcelable
    Warning: library class android.app.Notification$DecoratedCustomViewStyle extends or implements program class android.app.Notification$Style
    Warning: library class android.app.Notification$MediaStyle extends or implements program class android.app.Notification$Style
    Warning: library class android.app.Notification$MessagingStyle extends or implements program class android.app.Notification$Style
    Warning: library class android.app.NotificationChannel extends or implements program class android.os.Parcelable
    Warning: library class android.app.NotificationChannelGroup extends or implements program class android.os.Parcelable
    Warning: library class android.app.NotificationManager$Policy extends or implements program class android.os.Parcelable
    Warning: library class android.app.PictureInPictureParams extends or implements program class android.os.Parcelable
    Warning: library class android.app.Presentation extends or implements program class android.app.Dialog
    Warning: library class android.app.RemoteAction extends or implements program class android.os.Parcelable
    Warning: library class android.app.RemoteInput extends or implements program class android.os.Parcelable
    Warning: library class android.app.VoiceInteractor$PickOptionRequest$Option extends or implements program class android.os.Parcelable
    Warning: library class android.app.VoiceInteractor$Prompt extends or implements program class android.os.Parcelable
    Warning: library class android.app.WallpaperColors extends or implements program class android.os.Parcelable
    Warning: library class android.app.admin.ConnectEvent extends or implements program class android.os.Parcelable
    Warning: library class android.app.admin.DeviceAdminService extends or implements program class android.app.Service
    Warning: library class android.app.admin.DnsEvent extends or implements program class android.os.Parcelable
    Warning: library class android.app.admin.NetworkEvent extends or implements program class android.os.Parcelable
    Warning: library class android.app.admin.SecurityLog$SecurityEvent extends or implements program class android.os.Parcelable
    Warning: library class android.app.admin.SystemUpdateInfo extends or implements program class android.os.Parcelable
    Warning: library class android.app.admin.SystemUpdatePolicy extends or implements program class android.os.Parcelable
    Warning: library class android.app.assist.AssistContent extends or implements program class android.os.Parcelable
    Warning: library class android.app.assist.AssistStructure extends or implements program class android.os.Parcelable
    Warning: library class android.app.job.JobInfo extends or implements program class android.os.Parcelable

    Warning: library class android.util.FloatProperty extends or implements program class android.util.Property
    Warning: library class android.util.IntProperty extends or implements program class android.util.Property
    Warning: library class android.view.ActionMode$Callback2 extends or implements program class android.view.ActionMode$Callback
    Warning: library class android.view.Display$HdrCapabilities extends or implements program class android.os.Parcelable
    Warning: library class android.view.Display$Mode extends or implements program class android.os.Parcelable
    Warning: library class android.view.DragAndDropPermissions extends or implements program class android.os.Parcelable
    Warning: library class android.view.KeyboardShortcutGroup extends or implements program class android.os.Parcelable
    Warning: library class android.view.KeyboardShortcutInfo extends or implements program class android.os.Parcelable
    Warning: library class android.view.PointerIcon extends or implements program class android.os.Parcelable
    Warning: library class android.view.WindowAnimationFrameStats extends or implements program class android.os.Parcelable
    Warning: library class android.view.WindowContentFrameStats extends or implements program class android.os.Parcelable
    Warning: library class android.view.WindowId extends or implements program class android.os.Parcelable
    Warning: library class android.view.accessibility.AccessibilityWindowInfo extends or implements program class android.os.Parcelable
    Warning: library class android.view.animation.BaseInterpolator extends or implements program class android.view.animation.Interpolator
    Warning: library class android.view.autofill.AutofillId extends or implements program class android.os.Parcelable
    Warning: library class android.view.autofill.AutofillValue extends or implements program class android.os.Parcelable
    Warning: library class android.view.inputmethod.CursorAnchorInfo extends or implements program class android.os.Parcelable
    Warning: library class android.view.inputmethod.InputContentInfo extends or implements program class android.os.Parcelable
    Warning: library class android.widget.ActionMenuView extends or implements program class android.widget.LinearLayout
    Warning: library class android.widget.ActionMenuView$LayoutParams extends or implements program class android.widget.LinearLayout$LayoutParams

    Warning: library class android.app.RemoteInput depends on program class android.content.Intent
    Warning: library class android.app.RemoteInput depends on program class android.os.Bundle
    Warning: library class android.app.RemoteInput depends on program class android.content.Intent
    Warning: library class android.app.RemoteInput depends on program class android.os.Parcel
    Warning: library class android.app.RemoteInput$Builder depends on program class android.os.Bundle
    Warning: library class android.app.RemoteInput$Builder depends on program class android.os.Bundle
    Warning: library class android.app.SharedElementCallback depends on program class android.view.View
    Warning: library class android.app.SharedElementCallback depends on program class android.graphics.Matrix
    Warning: library class android.app.SharedElementCallback depends on program class android.graphics.RectF
    Warning: library class android.app.SharedElementCallback depends on program class android.os.Parcelable
    Warning: library class android.app.SharedElementCallback depends on program class android.content.Context

    Warning: library class android.media.session.MediaController$TransportControls depends on program class android.net.Uri
    Warning: library class android.media.session.MediaController$TransportControls depends on program class android.os.Bundle
    Warning: library class android.media.session.MediaController$TransportControls depends on program class android.os.Bundle
    Warning: library class android.media.session.MediaController$TransportControls depends on program class android.os.Bundle
    Warning: library class android.media.session.MediaSession depends on program class android.content.Context
    Warning: library class android.media.session.MediaSession depends on program class android.os.Handler
    Warning: library class android.media.session.MediaSession depends on program class android.app.PendingIntent
    Warning: library class android.media.session.MediaSession depends on program class android.app.PendingIntent
    Warning: library class android.media.session.MediaSession depends on program class android.os.Bundle
    Warning: library class android.media.session.MediaSession depends on program class android.os.Bundle
    Warning: library class android.media.session.MediaSession$Callback depends on program class android.os.Bundle
    Warning: library class android.media.session.MediaSession$Callback depends on program class android.os.ResultReceiver
    Warning: library class android.media.session.MediaSession$Callback depends on program class android.content.Intent
    Warning: library class android.media.session.MediaSession$Callback depends on program class android.os.Bundle
    Warning: library class android.media.session.MediaSession$Callback depends on program class android.os.Bundle
    Warning: library class android.media.session.MediaSession$Callback depends on program class android.net.Uri
    Warning: library class android.media.session.MediaSession$Callback depends on program class android.os.Bundle
    Warning: library class android.media.session.MediaSession$Callback depends on program class android.os.Bundle
    Warning: library class android.media.session.MediaSession$Callback depends on program class android.os.Bundle
    Warning: library class android.media.session.MediaSession$Callback depends on program class android.net.Uri
    Warning: library class android.media.session.MediaSession$Callback depends on program class android.os.Bundle
    Warning: library class android.media.session.MediaSession$Callback depends on program class android.os.Bundle
    Warning: library class android.media.session.MediaSession$QueueItem depends on program class android.os.Parcelable$Creator
    Warning: library class android.media.session.MediaSession$QueueItem depends on program class android.os.Parcel
    Warning: library class android.media.session.MediaSession$Token depends on program class android.os.Parcelable$Creator
    Warning: library class android.media.session.MediaSession$Token depends on program class android.os.Parcel
    Warning: library class android.media.session.PlaybackState depends on program class android.os.Parcelable$Creator
    Warning: library class android.media.session.PlaybackState depends on program class android.os.Parcel
    Warning: library class android.media.session.PlaybackState depends on program class android.os.Bundle
    Warning: library class android.media.session.PlaybackState$Builder depends on program class android.os.Bundle
    Warning: library class android.media.session.PlaybackState$CustomAction depends on program class android.os.Parcelable$Creator
    Warning: library class android.media.session.PlaybackState$CustomAction depends on program class android.os.Parcel
    Warning: library class android.media.session.PlaybackState$CustomAction depends on program class android.os.Bundle
    Warning: library class android.media.session.PlaybackState$CustomAction$Builder depends on program class android.os.Bundle
    Warning: library class android.net.Network depends on program class android.os.Parcelable$Creator
    Warning: library class android.net.Network depends on program class android.os.Parcel
    Warning: library class android.os.LocaleList depends on program class android.os.Parcelable$Creator
    Warning: library class android.os.LocaleList depends on program class android.os.Parcel
    Warning: library class android.os.PersistableBundle depends on program class android.os.Parcelable$Creator
    Warning: library class android.os.PersistableBundle depends on program class android.os.Parcel
    Warning: library class android.os.UserManager depends on program class android.os.Bundle
    Warning: library class android.os.UserManager depends on program class android.os.Bundle
    Warning: library class android.provider.DocumentsContract depends on program class android.net.Uri

    Warning: library class android.provider.DocumentsContract depends on program class android.net.Uri
    Warning: library class android.provider.DocumentsContract depends on program class android.net.Uri
    Warning: library class android.provider.DocumentsContract depends on program class android.content.Context
    Warning: library class android.provider.DocumentsContract depends on program class android.net.Uri
    Warning: library class android.provider.DocumentsContract depends on program class android.net.Uri
    Warning: library class android.provider.DocumentsContract depends on program class android.net.Uri
    Warning: library class android.provider.DocumentsContract depends on program class android.net.Uri
    Warning: library class android.provider.DocumentsContract depends on program class android.net.Uri
    Warning: library class android.provider.DocumentsContract depends on program class android.net.Uri
    Warning: library class android.provider.DocumentsContract depends on program class android.content.ContentResolver
    Warning: library class android.provider.DocumentsContract depends on program class android.net.Uri
    Warning: library class android.provider.DocumentsContract depends on program class android.graphics.Point
    Warning: library class android.provider.DocumentsContract depends on program class android.os.CancellationSignal
    Warning: library class android.provider.DocumentsContract depends on program class android.graphics.Bitmap
    Warning: library class android.provider.DocumentsContract depends on program class android.content.ContentResolver
    Warning: library class android.provider.DocumentsContract depends on program class android.net.Uri
    Warning: library class android.provider.DocumentsContract depends on program class android.net.Uri
    Warning: library class android.provider.DocumentsContract depends on program class android.content.ContentResolver
    Warning: library class android.provider.DocumentsContract depends on program class android.net.Uri
    Warning: library class android.provider.DocumentsContract depends on program class android.net.Uri
    Warning: library class android.provider.DocumentsContract depends on program class android.content.ContentResolver
    Warning: library class android.provider.DocumentsContract depends on program class android.net.Uri
    Warning: library class android.provider.DocumentsContract depends on program class android.content.ContentResolver

    Warning: library class android.security.KeyPairGeneratorSpec depends on program class android.content.Context
    Warning: library class android.security.KeyPairGeneratorSpec$Builder depends on program class android.content.Context
    Warning: library class android.service.media.MediaBrowserService depends on program class android.content.Intent
    Warning: library class android.service.media.MediaBrowserService depends on program class android.os.IBinder
    Warning: library class android.service.media.MediaBrowserService depends on program class android.os.Bundle
    Warning: library class android.service.media.MediaBrowserService depends on program class android.os.Bundle
    Warning: library class android.service.media.MediaBrowserService depends on program class android.os.Bundle
    Warning: library class android.service.media.MediaBrowserService depends on program class android.os.Bundle
    Warning: library class android.service.media.MediaBrowserService$BrowserRoot depends on program class android.os.Bundle
    Warning: library class android.service.media.MediaBrowserService$BrowserRoot depends on program class android.os.Bundle

    Warning: library class android.widget.Toolbar depends on program class android.util.AttributeSet
    Warning: library class android.widget.Toolbar depends on program class android.graphics.drawable.Drawable
    Warning: library class android.widget.Toolbar depends on program class android.graphics.drawable.Drawable
    Warning: library class android.widget.Toolbar depends on program class android.content.Context
    Warning: library class android.widget.Toolbar depends on program class android.content.Context
    Warning: library class android.widget.Toolbar depends on program class android.graphics.drawable.Drawable
    Warning: library class android.widget.Toolbar depends on program class android.graphics.drawable.Drawable
    Warning: library class android.widget.Toolbar depends on program class android.view.View$OnClickListener
    Warning: library class android.widget.Toolbar depends on program class android.view.Menu
    Warning: library class android.widget.Toolbar depends on program class android.graphics.drawable.Drawable
    Warning: library class android.widget.Toolbar depends on program class android.graphics.drawable.Drawable
    Warning: library class android.widget.Toolbar depends on program class android.os.Parcelable
    Warning: library class android.widget.Toolbar depends on program class android.os.Parcelable
    Warning: library class android.widget.Toolbar depends on program class android.view.MotionEvent
    Warning: library class android.widget.Toolbar depends on program class android.util.AttributeSet
    Warning: library class android.widget.Toolbar depends on program class android.view.ViewGroup$LayoutParams
    Warning: library class android.widget.Toolbar depends on program class android.view.ViewGroup$LayoutParams
    Warning: library class android.widget.Toolbar depends on program class android.view.ViewGroup$LayoutParams
    Warning: library class android.widget.Toolbar depends on program class android.view.ViewGroup$LayoutParams
    Warning: library class android.widget.Toolbar depends on program class android.view.ViewGroup$LayoutParams
    Warning: library class android.widget.Toolbar depends on program class android.util.AttributeSet
    Warning: library class android.widget.Toolbar depends on program class android.view.ViewGroup$LayoutParams

    Note: there were 15 references to unknown classes.
          You should check your configuration for typos.
          (http://proguard.sourceforge.net/manual/troubleshooting.html#unknownclass)
    Note: there were 21 unresolved dynamic references to classes or interfaces.
          You should check if you need to specify additional program jars.
          (http://proguard.sourceforge.net/manual/troubleshooting.html#dynamicalclass)

    Warning: there were 928 instances of library classes depending on program classes.
             You must avoid such dependencies since the program classes will be processed, while the library classes will remain unchanged.
             (http://proguard.sourceforge.net/manual/troubleshooting.html#dependency)
    Warning: there were 53 unresolved references to program class members.
             Your input classes appear to be inconsistent.
             You may need to recompile the code.
             (http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedprogramclassmember)

    Warning: Exception while processing task java.io.IOException: Please correct the above warnings first.
    :transformClassesAndResourcesWithProguardForCouchdbRelease FAILED

    FAILURE: Build failed with an exception.

    * What went wrong:
    Execution failed for task ':transformClassesAndResourcesWithProguardForCouchdbRelease'.
    > Job failed, see logs for details

Body:
I've upgraded to gradle 3.0.1 and most of the warnings are gone. If you're still on 3.0.0 then use this in your proguard file

-dontwarn android.**

Not ideal but gets it working.


问:
Shuffle string c#
I want to know shuffle string

Example string

```<code>string word;

//I want to shuffle it
word = "hello"
</code>```

I would be able to get:

```<code>rand == "ohlel"
rand == "lleho"
etc.
</code>```

答:
I tried the old school way of doing it, this one works fine.</p>

```<code>    static void Main()
    {
        string input = "hello";
        string output = "";
        int ranIndex = 0;
        List<int> indexes = new List<int>();
        char[] split = input.ToCharArray();
        Random ran = new Random();

        for (int i = 0; i < input.Length; i++)
        {
            ranIndex = ran.Next(0, input.Length);

            if (!indexes.Contains(ranIndex))
            {
                indexes.Add(ranIndex);
            }
            else
            {
                i--;
            }
        }

        foreach (int value in indexes)
        {
            output += split[value];
        }

            Console.WriteLine(output);
            Console.ReadLine();
    }
</code>```

Title: Shuffle string c#

Body:
I want to know shuffle string

Example string

string word;

//I want to shuffle it
word = "hello"

I would be able to get:

rand == "ohlel"
rand == "lleho"
etc.

Body:
I tried the old school way of doing it, this one works fine.

    static void Main()
    {
        string input = "hello";
        string output = "";
        int ranIndex = 0;
        List<int> indexes = new List<int>();
        char[] split = input.ToCharArray();
        Random ran = new Random();

        for (int i = 0; i < input.Length; i++)
        {
            ranIndex = ran.Next(0, input.Length);

            if (!indexes.Contains(ranIndex))
            {
                indexes.Add(ranIndex);
            }
            else
            {
                i--;
            }
        }

        foreach (int value in indexes)
        {
            output += split[value];
        }

            Console.WriteLine(output);
            Console.ReadLine();
    }


问:
google drive fetch users installed apps in version v3
I am migrating google drive v2 to version v3.Even thought Google wrote this documentation, there are many gaps in it.

Also there is doc for same migration at stackoverflow,but this is not helping in my case.

In version v2 I was getting users installed apps like this-

```<code>AppList apps = service.apps().list().execute();
apps.getItems();
</code>```

How can I get users installed apps in version v3.Suggestions would be highly appreciate.

答:
A number of methods are not available in v3  If you check
Migrate to Google Drive API v3

You will notice there is no new method for these calls

apps.get   n/a

  apps.list   n/a

Answer: There is no method for getting a list of users installed application in google Drive v3

Body:
I am migrating google drive v2 to version v3.Even thought Google wrote this documentation, there are many gaps in it.

Also there is doc for same migration at stackoverflow,but this is not helping in my case.

In version v2 I was getting users installed apps like this-

AppList apps = service.apps().list().execute();
apps.getItems();

How can I get users installed apps in version v3.Suggestions would be highly appreciate.


问:
New field in rewards points Magento 1.9
I want to add new field "Point Description" in Rewards points, I am using Magento 1.9.

I have check all the files and trying to debug the code but i am not getting that file from where its generate the form and save the data in to database.

if anyone have idea, please guide me how can i add new field in rewards points

Thanks

答:
By default Reward Points (Module Enterprise_Reward) are only available in Magento EE (Enterprise Edition). Magento 1.9 is a version of Magento CE not Enterprise.

Specify if you are using Magento EE or a custom Extension/Setup

http://docs.magento.com/m1/ee/user_guide/marketing/reward-point-configuration.html

Title: New field in rewards points Magento 1.9


问:
Rendering data in php from three different tables using mysql
I am having three tables.

base_income_tble:

```<code>id      base_income
------------------------
 1        Grants from government
 2        other grants
 3        Taxes
</code>```

sub_income_tble:

```<code> id      base_id      sub_income
 ---------------------------------------
 1         1          Special Grants
 2         1          General Grants
 3         2          Local authorities
 4         2          private
 5         3          Professional tax
 6         3          garbage tax
 7         3          light tax
</code>```

inner_subincome_tble:

```<code>id    sub_id      inner_subincome
-------------------------------------
 1       1        matching grant
 2       1        XIIIth finance commission
 3       1        GIA members salary Grant
 4       2        Grants
 5       2        Grants in Lieu
</code>```

I want to get the values from three tables regarding the id's related with each table.

I tried the below query:

```<code>select base_income, sub_income,inner_subincome from base_income_tble left join
sub_income_tble ON base_income_tble.id = sub_income_tble.base_id left join
inner_subincome_tble
on sub_income_tble.id = inner_subincome_tble.sub_id OR sub_income_tble.id =
inner_subincome_tble.sub_id;
</code>```

And getting values:

I want to display the data as below format in html:

```<code>Grants from Government
     special Grants
        Matching grant
        XIIIth finance commission
        GIA members salary Grant
     General Grants
        Grants
        Grants in Lieu
other grants
     Local authorities
     private
</code>```

It is possible to use nested foreach to render the data as above format, if possible what are the conditions.

答:
First method that comes to mind -

1) Get a list of all the data from the database, including the id numbers

```<code>select b.id as base_id, s.id as sub_id, i.id as inner_id, b.base_income, s.sub_income, i.inner_subincome from base_income_tble b left join sub_income_tble s on b.id = s.base_id left join inner_subincome_tble i on s.id = i.sub_id

+---------+--------+----------+------------------------+-------------------+--------------------------+
| base_id | sub_id | inner_id | base_income            | sub_income        | inner_subincome          |
+---------+--------+----------+------------------------+-------------------+--------------------------+
|       1 |      1 |        1 | Grants from government | Special Grants    | Matching grant           |
|       1 |      1 |        2 | Grants from government | Special Grants    | XIIIth finance comission |
|       1 |      1 |        3 | Grants from government | Special Grants    | GIA members              |
|       1 |      2 |        4 | Grants from government | General Grants    | Grants                   |
|       1 |      2 |        5 | Grants from government | General Grants    | Grants in Lieu           |
|       2 |      3 |     NULL | Other grants           | Local authorities | NULL                     |
|       2 |      4 |     NULL | Other grants           | Private           | NULL                     |
|       3 |      5 |     NULL | Taxes                  | Professional tax  | NULL                     |
|       3 |      6 |     NULL | Taxes                  | Garbage tax       | NULL                     |
|       3 |      7 |     NULL | Taxes                  | Light tax         | NULL                     |
+---------+--------+----------+------------------------+-------------------+--------------------------+
</code>```

2) Build that into a recursive array

```<code>$data = array();

while($r = mysqli_fetch_assoc($rows)){

    $bId = 'id' . $r['base_id'];
    $sId = 'id' . $r['sub_id'];
    $iId = 'id' . $r['inner_id'];

    if( !array_key_exists($bId, $data) )
        $data[$bId] = array('title' => $r['base_income'], 'values' => array());

    if( $r['sub_id'] && !array_key_exists($sId, $data[$bId]['values']) )
        $data[$bId]['values'][$sId] = array('title' => $r['sub_income'], 'values' => array());

    if( $r['sub_id'] && $r['inner_id'] )
        $data[$bId]['values'][$sId]['values'][$iId] = array('title' => $r['inner_subincome']);
}
</code>```

Contents of the $data array after this -

```<code>Array
(
    [id1] => Array
        (
            [title] => Grants from government
            [values] => Array
                (
                    [id1] => Array
                        (
                            [title] => Special Grants
                            [values] => Array
                                (
                                    [id1] => Array
                                        (
                                            [title] => Matching grant
                                        )

                                    [id2] => Array
                                        (
                                            [title] => XIIIth finance comission
                                        )

                                    [id3] => Array
                                        (
                                            [title] => GIA members
                                        )

                                )

                        )

                    [id2] => Array
                        (
                            [title] => General Grants
                            [values] => Array
                                (
                                    [id4] => Array
                                        (
                                            [title] => Grants
                                        )

                                    [id5] => Array
                                        (
                                            [title] => Grants in Lieu
                                        )

                                )

                        )

                )

        )

    [id2] => Array
        (
            [title] => Other grants
            [values] => Array
                (
                    [id3] => Array
                        (
                            [title] => Local authorities
                            [values] => Array
                                (
                                )

                        )

                    [id4] => Array
                        (
                            [title] => Private
                            [values] => Array
                                (
                                )

                        )

                )

        )

    [id3] => Array
        (
            [title] => Taxes
            [values] => Array
                (
                    [id5] => Array
                        (
                            [title] => Professional tax
                            [values] => Array
                                (
                                )

                        )

                    [id6] => Array
                        (
                            [title] => Garbage tax
                            [values] => Array
                                (
                                )

                        )

                    [id7] => Array
                        (
                            [title] => Light tax
                            [values] => Array
                                (
                                )

                        )

                )

        )

)
</code>```

The title element stores the name of the income, and values stores the entries that should be displayed underneath that. You just need a recursive function now that takes an array, outputs the title and loops through the values, calling itself for each one. (You could probably also do this with nested foreach)

An alternative approach would be to store all the data in a single table. Just have id, parent_id and income fields, with the parent_id field being NULL for the top level entries, and the relevant id it should come under for everything else. The code to display this efficiently would be quite different to the above though.

Body:
I am having three tables.

base_income_tble:

id      base_income
------------------------
 1        Grants from government
 2        other grants
 3        Taxes

sub_income_tble:

 id      base_id      sub_income
 ---------------------------------------
 1         1          Special Grants
 2         1          General Grants
 3         2          Local authorities
 4         2          private
 5         3          Professional tax
 6         3          garbage tax
 7         3          light tax

inner_subincome_tble:

id    sub_id      inner_subincome
-------------------------------------
 1       1        matching grant
 2       1        XIIIth finance commission
 3       1        GIA members salary Grant
 4       2        Grants
 5       2        Grants in Lieu

I want to get the values from three tables regarding the id's related with each table.

I tried the below query:

select base_income, sub_income,inner_subincome from base_income_tble left join
sub_income_tble ON base_income_tble.id = sub_income_tble.base_id left join
inner_subincome_tble
on sub_income_tble.id = inner_subincome_tble.sub_id OR sub_income_tble.id =
inner_subincome_tble.sub_id;

And getting values:

I want to display the data as below format in html:

Grants from Government
     special Grants
        Matching grant
        XIIIth finance commission
        GIA members salary Grant
     General Grants
        Grants
        Grants in Lieu
other grants
     Local authorities
     private

It is possible to use nested foreach to render the data as above format, if possible what are the conditions.

Body:
First method that comes to mind -

1) Get a list of all the data from the database, including the id numbers

select b.id as base_id, s.id as sub_id, i.id as inner_id, b.base_income, s.sub_income, i.inner_subincome from base_income_tble b left join sub_income_tble s on b.id = s.base_id left join inner_subincome_tble i on s.id = i.sub_id

+---------+--------+----------+------------------------+-------------------+--------------------------+
| base_id | sub_id | inner_id | base_income            | sub_income        | inner_subincome          |
+---------+--------+----------+------------------------+-------------------+--------------------------+
|       1 |      1 |        1 | Grants from government | Special Grants    | Matching grant           |
|       1 |      1 |        2 | Grants from government | Special Grants    | XIIIth finance comission |
|       1 |      1 |        3 | Grants from government | Special Grants    | GIA members              |
|       1 |      2 |        4 | Grants from government | General Grants    | Grants                   |
|       1 |      2 |        5 | Grants from government | General Grants    | Grants in Lieu           |
|       2 |      3 |     NULL | Other grants           | Local authorities | NULL                     |
|       2 |      4 |     NULL | Other grants           | Private           | NULL                     |
|       3 |      5 |     NULL | Taxes                  | Professional tax  | NULL                     |
|       3 |      6 |     NULL | Taxes                  | Garbage tax       | NULL                     |
|       3 |      7 |     NULL | Taxes                  | Light tax         | NULL                     |
+---------+--------+----------+------------------------+-------------------+--------------------------+

2) Build that into a recursive array

$data = array();

while($r = mysqli_fetch_assoc($rows)){

    $bId = 'id' . $r['base_id'];
    $sId = 'id' . $r['sub_id'];
    $iId = 'id' . $r['inner_id'];

    if( !array_key_exists($bId, $data) )
        $data[$bId] = array('title' => $r['base_income'], 'values' => array());

    if( $r['sub_id'] && !array_key_exists($sId, $data[$bId]['values']) )
        $data[$bId]['values'][$sId] = array('title' => $r['sub_income'], 'values' => array());

    if( $r['sub_id'] && $r['inner_id'] )
        $data[$bId]['values'][$sId]['values'][$iId] = array('title' => $r['inner_subincome']);
}

Contents of the $data array after this -

Array
(
    [id1] => Array
        (
            [title] => Grants from government
            [values] => Array
                (
                    [id1] => Array
                        (
                            [title] => Special Grants
                            [values] => Array
                                (
                                    [id1] => Array
                                        (
                                            [title] => Matching grant
                                        )

                                    [id2] => Array
                                        (
                                            [title] => XIIIth finance comission
                                        )

                                    [id3] => Array
                                        (
                                            [title] => GIA members
                                        )

                                )

                        )

                    [id2] => Array
                        (
                            [title] => General Grants
                            [values] => Array
                                (
                                    [id4] => Array
                                        (
                                            [title] => Grants
                                        )

                                    [id5] => Array
                                        (
                                            [title] => Grants in Lieu
                                        )

                                )

                        )

                )

        )

    [id2] => Array
        (
            [title] => Other grants
            [values] => Array
                (
                    [id3] => Array
                        (
                            [title] => Local authorities
                            [values] => Array
                                (
                                )

                        )

                    [id4] => Array
                        (
                            [title] => Private
                            [values] => Array
                                (
                                )

                        )

                )

        )

    [id3] => Array
        (
            [title] => Taxes
            [values] => Array
                (
                    [id5] => Array
                        (
                            [title] => Professional tax
                            [values] => Array
                                (
                                )

                        )

                    [id6] => Array
                        (
                            [title] => Garbage tax
                            [values] => Array
                                (
                                )

                        )

                    [id7] => Array
                        (
                            [title] => Light tax
                            [values] => Array
                                (
                                )

                        )

                )

        )

)

The title element stores the name of the income, and values stores the entries that should be displayed underneath that. You just need a recursive function now that takes an array, outputs the title and loops through the values, calling itself for each one. (You could probably also do this with nested foreach)

An alternative approach would be to store all the data in a single table. Just have id, parent_id and income fields, with the parent_id field being NULL for the top level entries, and the relevant id it should come under for everything else. The code to display this efficiently would be quite different to the above though.


问:
How do I convert this for loop into enhanced for loop?
I´m struggling with making enhanced for loop from this regular for loop. I want each element of my String ArrayList to be equal to its value + " done"

```<code>for (int i = 0; i < stringList.size(); i ++)
{
    stringList.set(i, stringList.get(i) + " done");
}
</code>```

Thank you for helping me.

答:
You can replace it with an enhanced for, but it's not really a good use of it:

```<code>int i = 0;
for (String s : stringList)
{
    stringList.set(i++, s + " done");
}
</code>```

Body:
I´m struggling with making enhanced for loop from this regular for loop. I want each element of my String ArrayList to be equal to its value + " done"

for (int i = 0; i < stringList.size(); i ++)
{
    stringList.set(i, stringList.get(i) + " done");
}

Thank you for helping me.

Body:
You can replace it with an enhanced for, but it's not really a good use of it:

int i = 0;
for (String s : stringList)
{
    stringList.set(i++, s + " done");
}


答:
Is this what you are looking for?</p>

```<code>SELECT * FROM <yourTable> t1
WHERE t1.object_id NOT IN
(
    SELECT t2.object_id
    FROM <yourTable> t2
    GROUP BY t2.object_id
    HAVING COUNT(object_id) > 1
)
</code>```

Body:
Is this what you are looking for?

SELECT * FROM <yourTable> t1
WHERE t1.object_id NOT IN
(
    SELECT t2.object_id
    FROM <yourTable> t2
    GROUP BY t2.object_id
    HAVING COUNT(object_id) > 1
)


问:
How to pass in my meat, rice and beans value, from my Burrito class to the meat class, rice class, and beans class respectively?
I have four classes, I am trying to pass in my meat value, rice value and beans value to their respective classes, and return their value through the Burrito class. I have battled with this for two days but no visible progress, any idea on what to do, apologies for any grammatical error. Below is the first three classes, According to the instructions given am not suppose to touch any line in the first three classes, all my code modifications should be in the Burrito class.

```<code>class Meat:
    def __init__(self, value=False):
        self.set_value(value)

    def get_value(self):
        return self.value

    def set_value(self, value):
        if value in ["chicken", "pork", "steak", "tofu"]:
            self.value = value
        else:
            self.value = False

class Rice:
    def __init__(self, value=False):
        self.set_value(value)

    def get_value(self):
        return self.value

    def set_value(self, value):
        if value in ["brown", "white"]:
            self.value = value
        else:
            self.value = False

class Beans:
    def __init__(self, value=False):
        self.set_value(value)

    def get_value(self):
        return self.value

    def set_value(self, value):
        if value in ["black", "pinto"]:
            self.value = value
        else:
            self.value = False
</code>```

Here is the class were am suppose to pass in value from and return value from as well.

```<code>class Burrito:
    def __init__ (self, meat, to_go, rice, beans):
        self.meat = Meat(meat)
        self.set_to_go(to_go)
        self.rice = Rice(rice)
        self.beans = Beans(beans)

    def set_meat(self, meat):
        self.set_value(meat)

    def set_to_go(self, to_go):
        to_go_list = [True, False]
        if to_go in to_go_list:
            self.to_go = to_go
        else:
            self.to_go = False

    def set_rice(self, rice):
        self.set_value(rice)

    def set_beans(self, beans):
        self.set_value(beans)

    def get_meat(self):
        self.meat_v = Meat()
        return self.meat_v.value

    def get_to_go(self):
        return self.to_go

    def get_rice(self):
        self.rice_v = Rice()
        return self.rice_v.value

    def get_beans(self):
        self.beans_v = Beans()
        return self.beans_v.value
</code>```

Here is the line am using to test my code:

```<code>newburrito = Burrito("pork", True, "brown", "pinto")
print (newburrito.meat)
</code>```

This is the error line am getting:

```<code><__main__.Meat object at 0x7fa5ad8bccf8>
</code>```

Am expecting it to print

```<code>pork
</code>```

答:
First, your are not getting an error. You called print on the object meat and that is what happened, the print show that the object is of the class Meat and it also show the address of this instance in memory.

If you want to print the value stored on the attribute value inside the Meat class instance, you have to do print(newburrito.meat.get_value()), as it was already pointed in the comments.

Body:
I have four classes, I am trying to pass in my meat value, rice value and beans value to their respective classes, and return their value through the Burrito class. I have battled with this for two days but no visible progress, any idea on what to do, apologies for any grammatical error. Below is the first three classes, According to the instructions given am not suppose to touch any line in the first three classes, all my code modifications should be in the Burrito class.

class Meat:
    def __init__(self, value=False):
        self.set_value(value)

    def get_value(self):
        return self.value

    def set_value(self, value):
        if value in ["chicken", "pork", "steak", "tofu"]:
            self.value = value
        else:
            self.value = False

class Rice:
    def __init__(self, value=False):
        self.set_value(value)

    def get_value(self):
        return self.value

    def set_value(self, value):
        if value in ["brown", "white"]:
            self.value = value
        else:
            self.value = False

class Beans:
    def __init__(self, value=False):
        self.set_value(value)

    def get_value(self):
        return self.value

    def set_value(self, value):
        if value in ["black", "pinto"]:
            self.value = value
        else:
            self.value = False

Here is the class were am suppose to pass in value from and return value from as well.

class Burrito:
    def __init__ (self, meat, to_go, rice, beans):
        self.meat = Meat(meat)
        self.set_to_go(to_go)
        self.rice = Rice(rice)
        self.beans = Beans(beans)

    def set_meat(self, meat):
        self.set_value(meat)

    def set_to_go(self, to_go):
        to_go_list = [True, False]
        if to_go in to_go_list:
            self.to_go = to_go
        else:
            self.to_go = False

    def set_rice(self, rice):
        self.set_value(rice)

    def set_beans(self, beans):
        self.set_value(beans)

    def get_meat(self):
        self.meat_v = Meat()
        return self.meat_v.value

    def get_to_go(self):
        return self.to_go

    def get_rice(self):
        self.rice_v = Rice()
        return self.rice_v.value

    def get_beans(self):
        self.beans_v = Beans()
        return self.beans_v.value

Here is the line am using to test my code:

newburrito = Burrito("pork", True, "brown", "pinto")
print (newburrito.meat)

This is the error line am getting:

<__main__.Meat object at 0x7fa5ad8bccf8>

Am expecting it to print

pork


问:
How can I access a list that is created in a static object that is part of another class?
What I would like to do is to have a list that is in an object counts that is defined in the App class as a static when my application starts:

Here's the object:

```<code>public class Counts
{
    public Counts()
    {
       public static List<CntQty> CardClicks2m;
    }
}
</code>```

In my application I declare this

am using the following code:

```<code>public partial class App : Application
{
    public static Counts counts = new Counts();

    public App()
    {
    }
}
</code>```

Now I try to use load some data into the list but it gives me the error below. Note that this function is in another class.

```<code>public void GetClickHistory()
{
   App.counts.CardClicks2m = db2.Query<CntQty>(sql);
</code>```

The last line of the code is giving me an error saying

counts.CardClicks2m cannot be accessed with an instance reference;
  qualify it with a type name instead.

I have tried a few different ways to make this work. One by removing the static and creating the object in the app constructor. This also didn't seem to work so I am hoping someone can point me in the right direction or at least suggest something.

答:
i guess scope of variable is not right , you need to do like this </p>

```<code>public class Counts
{
    public static List<CntQty> CardClicks2m;
    public Counts()
    {
    }
}
</code>```

Body:
What I would like to do is to have a list that is in an object counts that is defined in the App class as a static when my application starts:

Here's the object:

public class Counts
{
    public Counts()
    {
       public static List<CntQty> CardClicks2m;
    }
}

In my application I declare this

am using the following code:

public partial class App : Application
{
    public static Counts counts = new Counts();

    public App()
    {
    }
}

Now I try to use load some data into the list but it gives me the error below. Note that this function is in another class.

public void GetClickHistory()
{
   App.counts.CardClicks2m = db2.Query<CntQty>(sql);

The last line of the code is giving me an error saying

counts.CardClicks2m cannot be accessed with an instance reference;
  qualify it with a type name instead.

I have tried a few different ways to make this work. One by removing the static and creating the object in the app constructor. This also didn't seem to work so I am hoping someone can point me in the right direction or at least suggest something.

Body:
i guess scope of variable is not right , you need to do like this

public class Counts
{
    public static List<CntQty> CardClicks2m;
    public Counts()
    {
    }
}


问:
Case sensitive duplicate values in oracle
I have a table with the below sample records

```<code>Name    Profession      University
-----   --------------  ---------------
Ram     Student         xxxUniversity
Ravi    Professor       xyzUniversity
Reshma  Professor       abcUniversity
Ram     StudenT         xxxUniversity
</code>```

As seen above "Ram" has case sensitive duplicate records. My Oracle query should return distinct records and one record for "Ram", which has the maximum number of uppercase character in Profession column.

Expected result

```<code>    Name    Profession      University
    -----   --------------  ---------------
    Ravi    Professor       xyzUniversity
    Reshma  Professor       abcUniversity
    Ram     StudenT         xxxUniversity
</code>```

答:
Get the row number partitioned over the unique values for each column converted to upper (or lower) case:</p>

```<code>SELECT name, profession, university
FROM   (
  SELECT name, profession, university,
         ROW_NUMBER()
           OVER (
             PARTITION BY
               UPPER( name ),
               UPPER( profession ),
               UPPER( university )
             ORDER BY
               LENGTH( TRANSLATE( profession, ' abcdefghijklmnopqrstuvwxyz', ' ' ) ) DESC
           )
           AS rn
  FROM   your_table
)
WHERE  rn = 1;
</code>```

Body:
I have a table with the below sample records

Name    Profession      University
-----   --------------  ---------------
Ram     Student         xxxUniversity
Ravi    Professor       xyzUniversity
Reshma  Professor       abcUniversity
Ram     StudenT         xxxUniversity

As seen above "Ram" has case sensitive duplicate records. My Oracle query should return distinct records and one record for "Ram", which has the maximum number of uppercase character in Profession column.

Expected result

    Name    Profession      University
    -----   --------------  ---------------
    Ravi    Professor       xyzUniversity
    Reshma  Professor       abcUniversity
    Ram     StudenT         xxxUniversity

Body:
Get the row number partitioned over the unique values for each column converted to upper (or lower) case:

SELECT name, profession, university
FROM   (
  SELECT name, profession, university,
         ROW_NUMBER()
           OVER (
             PARTITION BY
               UPPER( name ),
               UPPER( profession ),
               UPPER( university )
             ORDER BY
               LENGTH( TRANSLATE( profession, ' abcdefghijklmnopqrstuvwxyz', ' ' ) ) DESC
           )
           AS rn
  FROM   your_table
)
WHERE  rn = 1;