text:
Q: Find scope of clicked element in ng-repeat is it possible to get the clicked row (scope) of a element in ng-repeat without nowing the name?
For example: scope.person works, but when I change persons into another name I can't use my directive global.
I need the data to do a edit like this: http://vitalets.github.io/x-editable/
I will write a directive which changes the text into a input field. To save it I need the name of the field, "lastname" in the example and the ID from the row.
HTML:

    {{person.lastname}}
    {{person.surname}}

Directive:
app.directive('editable', [function () {
    return {
        restrict: 'C',
        link: function (scope, elem, attrs) {
            elem.bind('click', function(event) {
                console.log(scope.person)
            });
        }
    };
}])

A: You can use Angular's tracking ng-repeats by $index and pass it to your directive:
HTML:

    {{person.lastname}}
    {{person.surname}}

Directive:
app.directive('editable', [function () {
    return {
       restrict: 'A',
       link: function (scope, elem, attrs) {
           elem.bind('click', function(event) {
               console.log(attrs.Editable);
           });
       }
    };
}])

A: You are already catching the current scope and it is working fine you just need to manipulate the data and apply scope.$apply();
app.directive('editable', [function () {
    return {
        restrict: 'C',
        link: function (scope, elem, attrs) {
            elem.bind('click', function(event) {
              console.log(scope.person)
              scope.person.surname="hello"
                 console.log(scope.person)
                 scope.$apply();
            });
        }
    };
}])

In the first console output you can see the original clicked element and in second console you can see the maupilated data.
Now why apply is required:- It is required to run the digest cycle of angular to adapt the change happen outside the scope of angular js (bind is jquery event not angular's).
Plunker

A: Add a Scope to your directive so you can pass any Model to be edited.
And display the ID with the Attrs variable.
app.directive('editable', [function () {
return {
    scope: {
        model : '='
    },
    restrict: 'C',
    link: function (scope, elem, attrs) {
        elem.bind('click', function(event) {
            alert(scope.model +" "+ attrs.id )
        });
    }
};}]);

the html:
{{person.lastname}}

The Fiddle

A: Browse how works the custom directives in angular. You can pass like parameter the lastname through 'attrs' in your link. Something like this:
html code:
<my-first-directive lastname="{{person.lastname}}"></my-first-directive>

custom directive code:
link: function (scope, elem, attrs) {
        elem.bind('click', function(event) {
            console.log(attrs['lastname'])
        });
}

This approach not is good in my opinion. But i hope it works you.
If you read about scopes in directives you will can try other approachs.
You can pass the same parameter to directive scope so.
In your directive:
return {
    restrict: 'C',
    scope: {
        lastname: '=' // If you want know more about this, read about scopes in directives
    }
    link: function (scope, elem, attrs) {
        elem.bind('click', function(event) {
            console.log(scope.lastname) // now, scope.lastname is in your directive scope
        });
    }
};

Be careful whit names when you work with directives. If your variable is 'myVar', when you write the directive html code you need write:
<my-first-directive my-var="myVar"></my-first-directive>

For the same reason that you need write 'my-first-directive' when you name directive is 'myFirstDirective'.
Good luck!


text:
Q: How to tell when a UITableView section index letter is tapped? In iOS, is there a delegate method that is called when the section index of a table view is tapped? For instance, if the table's section index lists the letters A-Z and B is tapped, how can I determine what letter the user tapped? I've looked throughout the documentation but am unable to find anything.

A: There is no delegate which allows you do determine when a section index letter is tapped. However, you can still do so fairly easily.
If we use the UIScrollViewDelegate scrollViewDidScroll to set a breakpoint, we can get pretty close to when the user taps the index and see what messaging we might be able to take advantage of. Here's a look at the frames directly after the user taps the index:
frame #1: UIKit`-[UIScrollView(UIScrollViewInternal) _notifyDidScroll] + 56
frame #2: UIKit`-[UIScrollView setContentOffset:] + 645
frame #3: UIKit`-[UITableView setContentOffset:] + 362
frame #4: UIKit`-[UIScrollView(UIScrollViewInternal) _setContentOffset:animated:animationCurve:animationAdjustsForContentOffsetDelta:] + 669
frame #5: UIKit`-[UITableView _sectionIndexChangedToIndex:title:] + 285
frame #6: UIKit`-[UITableView _sectionIndexChanged:] + 189

So, UITableView has a private method _sectionIndexChanged. In addition after the index has changed, the UITableView internals call setContentOffset. Either of these could be used to provide a mechanism to determine when a section index is tapped.
If I were doing this I would likely subclass UITableView to intercept _sectionIndexChanged and extend the UITableViewDelegate protocol to provide the needed messages. Alternately, you could subclass UITableView and intercept setContentOffset, but that would require taking care of corner cases where setContentOffset is called without the index being tapped.

A: I think there are two reasonable solutions which could work for your goal.
First, you could override the delegate method scrollViewDidScroll: to show and update the HUD if the offset has changed. Of course, this will cause it to appear when the user scrolls without the index. You can prevent the majority of these cases by simply disabling the display of the HUD when the scroll views's dragging or decelerating property is YES. There will still be some cases where the HUD will appear (e.g. scrollToTop, resizing) but this might be acceptable to you.
The other option is to just build your own index control. It really wouldn't be a lot of work to lay out a few labels inside a custom view along the right-hand side of your table view with a couple of gesture recognizers. Then you can scroll the table view and display whatever HUD you want.

redpajama_set_name: RedPajamaStackExchange


text:
Q: Send notification from the server to user segment who installed the app In Firebase console, I saw the option to send a notification to User Segement with app "com.example" (where com.example is the app name).
As the image shows:

But how to do it from the server side using the FCM REST API:
https://fcm.googleapis.com/fcm/send

A: Unfortunately, it is not possible to send messages to User Segments using the FCM REST API.
As an alternative, you'll have to make use of the other ways to send messages to multiple devices, like simply using the registration_ids parameter and Topics Messaging (which I think is the most preferable for your use-case).
Here are samples on how to send this using Postman or cURL.

A: i found a solution
u can subscribe your app to a specific topic for example your app package name in your FirebaseInstanceIdService class so u can send data massage like
 {
  "to" : "/topics/your_package_name",
  "data" : {
    "key1" : "value 1",
    "key2": "value 2",
   ...
  }
}

here is the code to subscribe your app to topic in  FirebaseInstanceIdService  class
     public class MyFirebaseInstanceIDService extends FirebaseInstanceIdService
    {
        private final String TAG="your_tag";
        @Override
        public void onTokenRefresh() {

        // Get updated InstanceID token.
        String refreshedToken = FirebaseInstanceId.getInstance().getToken();
        FirebaseMessaging.getInstance().subscribeToTopic("your_app_package_name");
        }
}

its worked for me

A: You actually need to send a message to the topic .. All the members subscribed to a topic will get your message ..
Just check out the link ..
https://developers.google.com/cloud-messaging/topic-messaging

A: Subscribe your users depending on the OS
topic: "android" for android user
topic: "iOS" for iOS user
(or whatever name you want)
and then send to that topic...

A: Make a post call to https://fcm.googleapis.com/fcm/send with  following parameters:-
Headers:-
Content-Type--application/json
Authorization--key={your server key}
Body:-
{
    "data": {
        "my_custom_key" : "my_custom_value",

        "message" : "notification message"
     },
    "registration_ids": ["device_token1,device_token2,.........."]
}

EDIT:-
Basically what you need to do is ,whenever u need to send notification you have to call this POST method from your server side and your app will automatically get a call in OnMessageReceived . You can handle that as:-
 @Override
    public void onMessageReceived(RemoteMessage remoteMessage) {
        super.onMessageReceived(remoteMessage);
        // TODO: Handle FCM messages here.
        // If the application is in the foreground handle both data and notification messages here.
        // Also if you intend on generating your own notifications as a result of a received FCM
        // message, here is where that should be initiated.
        Log.d(TAG, "From: " + remoteMessage.getFrom());

        Map<String, String> data=remoteMessage.getData();
        Log.d(TAG, "From: " + data.toString());
        String value=data.get("my_custom_key");
        Log.d(TAG, "From: " + value);
        String msg=data.get("message");
        Log.d(TAG, "From: " + msg);

        sendNotification(msg,value,remoteMessage.getSentTime());
    }


text:
Q: How do I write an "If/else Statement" to condicionate the answer for the user? I am having trouble writing an if/else statement that conditionate the answer of the user.
I am asking the user to enter a number between 1 and 8, if the user enters a number between that range the answer will be storage on a variable, if the answer it is outside the range the program will say something like: "Invalid position."
Something like this:
System.out.println("Choose a number (Between 1 to 8)");
if(---------------){
ubNum = input.nextInt();
}else{
System.out.println("Enter a valid number please");
}

What do I need to put in the if statement to accomplish it?

A: If you are including 1 and 8 number also in your range, then here is the code
import java.util.Scanner;
public class Main
{
    public static void main(String[] args)
    {
        System.out.println("Choose a number (Between 1 to 8)");
        Scanner sc=new Scanner(System.in);

        int a = sc.nextInt();
        if (a >= 1 && a <= 8)
            System.out.println("No. is valid");
        else
            System.out.println("Enter a valid number please");
    }
}

EDIT 1:
If the value entered by user is in the given range then that value will be stored in the integer variable res and using this you can perform any further calculations on the  value stored in variable res.
If the number entered by user is not in the given range then default value(i.e 0) will be printed along with the message "Enter a valid number please".
int res = 0;
int a = sc.nextInt();
        if (a >= 1 && a <= 8)
          res=a;
 else
            System.out.println("Enter a valid number please");
              System.out.println(res);


text:
Q: AES encryption and decryption data loss When i try to encrypt a MD5 hash of a key using AES ECB,
And afterwards decrypt it i get diffrent results:
Before: >•ly†lrœËGQ2¶ª€
After: 0¦t‹
d)§¥›B?W
The code i use for Encryption and Decryption is:
public class AES {
    private String a= "AES/ECB/NoPadding";
    private byte[] key;
    Cipher c;
    public AES(byte [] key) throws NoSuchAlgorithmException, NoSuchPaddingException{
            this.key = key;
            c = Cipher.getInstance(a);
        }
public String encrypt(byte[] Data) throws Exception{
        Key k = new SecretKeySpec(key, "AES");
        c.init(Cipher.ENCRYPT_MODE, k);
        byte[] encoded = c.doFinal(Data);
        String encrypted= new String(encoded);
        return encrypted;

    }
public String decrypt(byte[] v) throws Exception{
        Key k = new SecretKeySpec(key, "AES");
        if(v.length%16!=0)
            return null;
        c.init(Cipher.DECRYPT_MODE, k);
        byte[] decv = c.doFinal(v);
        String decrypted = new String(decv);
        return decrypted;
    }
}

A: This doesn't work:
String encrypted= new String(encoded);

The cipher text bytes in encoded are pseudo-random gibberish. It's highly unlikely they form a valid text encoding, regardless of your platform default.
If you need a text representation, use base-64 encoding:
String encrypted = Base64.getEncoder().encodeToString(encoded);

This is a common mistake, although it manifests in different ways, so the "questions" are varied and hard to identify as duplicates. Here's another answer with more detail.


text:
Q: Can I Extend a Built-In PHP Function? Long story short I'm working with a legacy codebase that makes heavy use of PHP's built-in call_user_func_array function.  I'm trying to get it to work with PHP 5.3 (upgrading from 5.2), but have run into the issue described here (in the "Passing non-arrays" section):
http://sixohthree.com/1486/migrating-to-php-5-3-call_user_func_array
In a nutshell, the problem is that between PHP versions 5.2 and 5.3 the bevavior of this function was changed so that it basically does nothing and returns NULL if the second parameter is not a proper array/object/associative array.  5.2 did not do this, and as such the codebase I'm working with makes no effort to ensure that it passes a parameter of the correct type.  This causes problems.
To fix it I could follow the instructions in the blog post and hunt down every single call_user_func_array call in the codebase and patch them up, but that would be extremely tedious.  Alternately, I noticed that PHP has a built-in override_function API call that can be used to override the built-in functions.  That's handy, but what I want to do is more like extending the built-in function.
Ideally what I'd like is to be able to replace the implementation of call_user_func_array with something roughly like:
function call_user_func_array($method, $params) {
    $params = is_array($params) ? $params : array($params);
    return old_call_user_func_array($method, $params);
}

...where old_call_user_func_array is the built-in call_user_func_array function.
Is this possible, and if so, how?

A: You can use rename_function which is also in the APD extension so you should already have it if you have override_function installed:
rename_function('call_user_func_array', 'old_user_func_array');

function call_user_func_array($method, $params) {
    $params = is_array($params) ? $params : array($params);
    old_call_user_func_array($method, $params);
}

A: Hi your question is actually answered in the third or fourth comment posting in the online PHP documentation.  There is often very useful information and examples in the comments section (mind you there is also somtimes stuff that is patently incorrect!)  I've copied the relevant portion here for your convenience:
... if you use rename_function to rename the original function to a third name, then call the third name in the OVERRIDING function, you will get the desired effect:
rename_function('strlen', 'new_strlen');
override_function('strlen', '$string', 'return override_strlen($string);');
function override_strlen($string){
        return new_strlen($string);}

A: or you can put your code in a namespace:
namespace Phpoverride
{
    function call_user_func_array($method, $params) {
        return \call_user_func_array($method, $params);
    }
}

http://php.net/namespaces


text:
Q: how to add multiple nodes in Firebase cloud Firestore using flutter I am adding some information in firebase cloud firestore using flutter.Now i need to add some more detail against nodes. like here is i am adding data to cloud firestore.
void _addData(){
    Firestore.instance.runTransaction((Transaction transaction) async{
      CollectionReference reference = Firestore.instance.collection('task');
      await reference.add({
        "email"   : widget.email.toLowerCase(),
        "title"   : newtask,
        "members" : members,
        "note"    : note,
      });
    });
    Navigator.pop(context);
  }

in this example i want to add some extra detail against the node Member.
 i want list of members against this. i am confused how to do that.
i want to add node against node like this using FirebaseDatabase here is the code.... Firestore dose not allow collection against collection like firebaseDatabase  child against child.
   return FirebaseDatabase.instance
              .reference()
              .child(USERS)
              .child(user.uid)
              .update(update

);

A: Use this:
DocumentReference messageRef = db
    .collection("rooms").document("roomA")
    .collection("messages").document("message1");


text:
Q: Language Scheme: find the sum of proper divisors I am wondering how to write a function calculating the sum of proper divisors of a integer greater than 1.
(define (sum-of-proper-divisors n)
          (cond
           [(= n 1) 1]
           [(= 0 (remainder n (sub1 n)))
            (+ (remainder n (sub1 n)) (sum-of-proper-divisors (sub1 (sub1 n))))]
           [else (sum-of-proper-divisors (sub1 n))]))

This is the code that I wrote, however, it does not work. It will never stop evaluating because it will always do n-1. And I don't know how to fix this. Also, there might be other problems. How to put the restriction that makes the function stop evaluating when the divisor becomes 1?

A: You're confusing the number n whose divisors you want to find, with said divisors. Notice that n never changes, what must be modified at each step is the current integer being tested (a possible divisor). For that you'll need to pass around two parameters:
(define (sum-of-proper-divisors n i)
  (cond
    [(= i 1) 1]
    [(= (remainder n i) 0)
     (+ i (sum-of-proper-divisors n (sub1 i)))]
    [else (sum-of-proper-divisors n (sub1 i))]))

Call it like this, at the beginning i must be one unit less than n:
(sum-of-proper-divisors 10 9)
=> 8

If having two parameters bothers you there are several ways to pass a single parameter, for instance using a named let:
(define (sum-of-proper-divisors n)
  (let loop ((i (sub1 n)))
    (cond
      [(= i 1) 1]
      [(= (remainder n i) 0)
       (+ i (loop (sub1 i)))]
      [else (loop (sub1 i))])))


text:
Q: WPF icon doesn't show I want to use pathGeometry from my icon.xaml file  my project but WPF does not show how can i use my icons?
Please find my codes and screenshot below.

<StackPanel Grid.Row="1" Margin="-1 40 0 20">
    <Button x:Name="btnHome" Style="{DynamicResource PopupButtonStyle}"  MouseEnter="btnHome_MouseEnter" MouseLeave="btnHome_MouseLeave" Click="btnHome_Click">
        <ctls:MenuItem GroupName="MenuItem" IndicatorBrush="{DynamicResource PrimaryBlueColor}" Icon="{DynamicResource home}" IconWidth="16" Text="Factory Method" VerticalAlignment="Center"/>
    </Button>
    <Button x:Name="btnDashboard" Style="{DynamicResource PopupButtonStyle}"  MouseEnter="btnDashboard_MouseEnter" MouseLeave="btnDashboard_MouseLeave" Click="btnDashboard_Click">
        <ctls:MenuItem GroupName="MenuItem" IndicatorBrush="{DynamicResource PrimaryBlueColor}" Icon="{DynamicResource dashboard}" IconWidth="16" Text="Dashboard" VerticalAlignment="Center"/>
    </Button>
    <Button x:Name="btnProducts" Style="{DynamicResource PopupButtonStyle}"  MouseEnter="btnProducts_MouseEnter" MouseLeave="btnProducts_MouseLeave">
        <ctls:MenuItem GroupName="MenuItem" IndicatorBrush="{DynamicResource PrimaryBlueColor}" Icon="{DynamicResource products}" IconWidth="16" Text="Products" VerticalAlignment="Center"/>
    </Button>
    <Button x:Name="btnProductStock" Style="{DynamicResource PopupButtonStyle}"  MouseEnter="btnProductStock_MouseEnter" MouseLeave="btnProductStock_MouseLeave">
        <ctls:MenuItem GroupName="MenuItem" IndicatorBrush="{DynamicResource PrimaryBlueColor}" Icon="{DynamicResource car}" IconWidth="16" Text="Product Stock" VerticalAlignment="Center"/>
    </Button>
    <Button x:Name="btnOrderList" Style="{DynamicResource PopupButtonStyle}"  MouseEnter="btnOrderList_MouseEnter" MouseLeave="btnOrderList_MouseLeave">
        <ctls:MenuItem GroupName="MenuItem" IndicatorBrush="{DynamicResource PrimaryBlueColor}" Icon="{DynamicResource email}" IconWidth="16" Text="Order List" VerticalAlignment="Center"/>
    </Button>
    <Button x:Name="btnBilling" Style="{DynamicResource PopupButtonStyle}"  MouseEnter="btnBilling_MouseEnter" MouseLeave="btnBilling_MouseLeave">
        <ctls:MenuItem GroupName="MenuItem" IndicatorBrush="{DynamicResource PrimaryBlueColor}" Icon="{DynamicResource billing}" IconWidth="16" Text="Billing" VerticalAlignment="Center"/>
    </Button>
    <Button x:Name="btnPointOfSale" Style="{DynamicResource PopupButtonStyle}"  MouseEnter="btnPointOfSale_MouseEnter" MouseLeave="btnPointOfSale_MouseLeave">
        <ctls:MenuItem GroupName="MenuItem" IndicatorBrush="{DynamicResource PrimaryBlueColor}" Icon="{DynamicResource car}" IconWidth="16" Text="Point Of Sale" VerticalAlignment="Center"/>
    </Button>
    <Button x:Name="btnSecurity" Style="{DynamicResource PopupButtonStyle}"  MouseEnter="btnSecurity_MouseEnter" MouseLeave="btnSecurity_MouseLeave">
        <ctls:MenuItem GroupName="MenuItem" IndicatorBrush="{DynamicResource PrimaryBlueColor}" Icon="{DynamicResource lock}" IconWidth="16" Text="Security" VerticalAlignment="Center"/>
    </Button>
    <Button x:Name="btnSetting" Style="{DynamicResource PopupButtonStyle}"  MouseEnter="btnSetting_MouseEnter" MouseLeave="btnSetting_MouseLeave">
        <ctls:MenuItem GroupName="MenuItem" IndicatorBrush="{DynamicResource PrimaryBlueColor}" Icon="{DynamicResource settings}" IconWidth="16" Text="Setting" VerticalAlignment="Center"/>
    </Button>
</StackPanel>

A: Have you loaded you icon.xaml in Application Resources?
Like this:
<Application.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="icon.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
</Application.Resources>


text:
Q: Syntax error near the "INNER" keyword I am building a Windows form app using a SQL server. The problem I am having is that I am getting an unhandled exception error when I call the .Fill function. Under additional info, it says that there is a syntax error near the INNER keyword. I have written the following code thus far:
Imports System.Data
Imports System.Data.SqlClient
Public Class Form1
    Dim cn As New SqlConnection("Data Source=(LocalDB)\v11.0;AttachDbFilename='C:\Users\Sean\Documents\Visual Studio 2013\Projects\Baseball\Baseball\Baseball.mdf';Integrated Security=True")
    Dim da As New SqlDataAdapter
    Dim ds As New DataSet

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load
        Dim sql As String

        sql = "SELECT teammates.PlayerName, teammates.Number, teammates.BirthDate, Position.Position, teammates.Salary"
        sql += "From teammates INNER JOIN Position ON teammates.PositionID = Position.PositionID"

        With da
            .SelectCommand = New SqlCommand
            .SelectCommand.Connection = cn
            .SelectCommand.CommandText = sql
            .SelectCommand.CommandType = CommandType.Text

            cn.Open()
            .Fill(ds, "teammates")
            cn.Close()
        End With

        With grdPlayers
            .AutoGenerateColumns = True
            .AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.DisplayedCells
            .DataSource = ds
            .DataMember = "teammates"

        End With

        Call FormatGrid()

        cn = Nothing
        da = Nothing

    End Sub

    Private Sub FormatGrid()
        Dim rightStyle As New DataGridViewCellStyle
        rightStyle.Alignment = DataGridViewContentAlignment.MiddleRight

        Dim altStyles As New DataGridViewCellStyle
        altStyles.BackColor = Color.WhiteSmoke
        grdPlayers.AlternatingRowsDefaultCellStyle = altStyles

        Dim curStyle As New DataGridViewCellStyle
        curStyle.Format = "c"
        curStyle.Alignment = DataGridViewContentAlignment.MiddleRight

        With grdPlayers
            .Columns(0).HeaderText = "Name"
            .Columns(1).HeaderText = "Number"
            .Columns(2).HeaderText = "Born"
            .Columns(4).HeaderText = "Position"
            With .Columns(4)
                .HeaderCell.Value = "Salary"
                .HeaderCell.Style = rightStyle
                .DefaultCellStyle = curStyle
            End With
            .Columns(0).HeaderText = "Name"
        End With
    End Sub

End Class

A: You need a space between the last selected column and FROM. Right now, you query ends up as:
SELECT ..., teammates.SalaryFROM

Notice the lack of a space. So just add a space to the start of the next string:
sql += " From teammates INNER
'       ^ notice the space

Which will result in:
SELECT ..., teammates.Salary FROM
--                          ^^ space

A: Just make it one string, like this:
sql = "SELECT teammates.PlayerName, teammates.Number, teammates.BirthDate, Position.Position, teammates.Salary From teammates INNER JOIN Position ON teammates.PositionID = Position.PositionID"


text:
Q: XSLT choose to apply the filter I have the following question:
This i want to use in choose:
<xsl:variable name="Rows" select="/dsQueryResponse/Table/Rows/Row" />

I tried:
<xsl:variable name="Rows">
    <xsl:choose>
        <xsl:when test="$paramId">
            <xsl:copy-of select="/dsQueryResponse/Rows/Row" />
        </xsl:when>
        <xsl:otherwise>
            <xsl:copy-of select="/dsQueryResponse/Rows/Row[@ID=$paramId]" />
        </xsl:otherwise>
    </xsl:choose>
</xsl:variable>

But it didnt work, anyone has any idea?
Just to clarify, based on the paramId if it is empty then i should get all the rows, but if the paramId is not empty i would like to apply filter ID=paramId, how can i do this?

A: It all depends on how you declare and initialize the parameter or variable you have, and you don't show that part of your code.
Assuming you have
<xsl:param name="paramId" select="/.."/>

I would then simply do
<xsl:variable name="Rows" select="/dsQueryResponse/Rows/Row[not($paramId) or @ID = $paramId]"/>

A: Supposing you have paramId declared as
<xsl:param name="paramId" select="''" />

I would use it in test attribute of xsl:when in this way
<xsl:when test="$paramId = ''">


text:
Q: i have a list of images and images shape is (50,50,3) . how to convert into numpy.ndarray of shape (19929,50,50,3) train_x=[]
val_x=[]
test_x=[]
for image in train_list:
    train_x.append(skimage.data.imread(image))
for image in val_list:
    val_x.append(skimage.data.imread(image))
for image in test_list:
    test_x.append(skimage.data.imread(image))

how to convert train_x list to ndarray of shape (len(train_x),50,50,3).

A: You can use numpy.stack():
import numpy as np
arrs = [np.random.randn(10, 11, 3) for i in range(5)]
arr = np.stack(arrs, axis=0)
print(arr.shape)

A:     import numpy as np
    import skimage
    train_x=[]
    val_x=[]
    test_x=[]
    for image in train_list:
        train_x.append(skimage.data.imread(image))

    for image in val_list:
        val_x.append(skimage.data.imread(image))

    for image in test_list:
        test_x.append(skimage.data.imread(image))

    train_x=np.array(train_x)
    val_x=np.array(val_x)
    test_x=np.array(text_x)

A: You can preallocate an empty array and fill it with train_x elements (I suppose numpy.stack() function does the same behind the scene):
import numpy as np

train_x = [np.random.randn(50, 50, 3) for _ in range(1000)] #dummy x_train

big_arr = np.empty([len(train_x), 50, 50, 3])
big_arr[:,...] = train_x[:]

In this case, the reason I pick this way against stack is its flexibility. It may be impossible to have both train_x and big_arr in memory (may cause memory overflow). So if you are obliged to have a array shaped (19929,50,50,3) in memory for processing, try to do so:
big_arr = np.empty([len(train_list), 50, 50, 3])
for i, image in enumerate(train_list):
    big_arr[i,:,:,:] = skimage.data.imread(image)  # read directly from hard disc and fill the array


text:
Q: How to convert android.graphics.Color to androidx.compose.ui.graphics.Color I'm drawing a JetpackCompose Canvas
    Canvas(modifier = modifier.clipToBounds()) {
        val colorEvaluator = ArgbEvaluator()
        colorEvaluator.evaluate(t, Color.Red, Color.Blue)
        drawCircle(
            style = Stroke(8.dp.toPx()),
            color = AndroidColor.valueOf(colorEvaluator.evaluate(t, Color.Red, Color.Blue) as Int),
            center = Offset(size.minDimension/2 , size.minDimension/2),
            radius = size.minDimension * t)
        drawRect(
            color = darkColor,
            style = Stroke(16.dp.toPx()),
        )
    }

Where
import androidx.compose.ui.graphics.Color
import android.graphics.Color as AndroidColor

I got this error on color = AndroidColor.valueOf(colorEvaluator.evaluate(t, Color.Red, Color.Blue) as Int), where the error message is
Type mismatch.
Required:
androidx.compose.ui.graphics.Color
Found:
android.graphics.Color

A: Looks like I should supply AndroidColor.RED and AndroidColor.BLUE to the ArgbEvaluator instead of accidentally use the Color of Compose
Where AndroidColor is import android.graphics.Color as AndroidColor
    Canvas(modifier = modifier.clipToBounds()) {
        drawCircle(
            style = Stroke(8.dp.toPx()),
            color = Color(ArgbEvaluator().evaluate(t, AndroidColor.RED, AndroidColor.BLUE) as Int),
            center = Offset(size.minDimension / 2, size.minDimension / 2),
            radius = size.minDimension * t
        )
        drawRect(
            color = darkColor,
            style = Stroke(16.dp.toPx()),
        )
    }

Updated
Found an even better approach, that is to use lerp in compose as per the below code. Using this approach, we no longer need to use the old ArgbEvaluator.
    Canvas(modifier = modifier.clipToBounds()) {
        drawCircle(
            style = Stroke(8.dp.toPx()),
            color = lerp(Color.Red, Color.Blue, t),
            center = Offset(size.minDimension / 2, size.minDimension / 2),
            radius = size.minDimension * t
        )
        drawRect(
            color = darkColor,
            style = Stroke(16.dp.toPx()),
        )
    }


text:
Q: Free 1d proton in magnetic field Question Statement

Consider a proton which has spin $1/2$ that is free to move throughout all locations $-\infty<x<\infty$. A magnetic field of constant magnitude $B_{\circ}$ is applied perpendicular to the $x$ axis. Let the Hamiltonian be given by:
  $$
\mathcal{H}=\frac{\hat{p}^2_{x}}{2m_{p}} - \mu_{p}\hat{S}_{z}B_{\circ}
$$
  What are the stationary states of this system, the energies of these states and the degeneracy of the states?

I'm not 100% clear on how to deal with Hamiltonians that operate on position space and spin space. From what I can tell, operators act on one or another, but not both. If that's true, then I would say that the spatial component of the wavefunction is just a plane wave $e^{ikx}$ since there's no potential energy. From there you could impose box normalization, which would make the energies just the energies of an infinite square well of length $L$ but it doesn't seem right to have to introduce the parameter $L$ like that. Is this approach correct?
The spin component is the vector $(\chi_{+}(t),\chi_{-}(t))^{T}$, which solves $- \mu_{p}\hat{S}_{z}B_{\circ}|\chi\rangle=i\hbar\frac{\partial}{\partial t}|\chi\rangle$. It seems like this would contribute some energy to the system, but I'm not sure how to find it. Is there any energy associated with this part?

A: One way to think about this is that the particle has two completely separate degrees of freedom, one associated to translations (i.e. position, momentum) and one associated to spin. You are right that in this case the two parts of the Hamiltonian act only on one or the other of these degrees of freedom. The operator $\hat{p}_x \equiv \hat{p}_x \otimes \hat{1}$ acts as the identity (it does nothing) on the spin degrees of freedom. Likewise, the operator $\hat{S}_z$ should technically be written as $\hat{1}\otimes \hat{S}_z$, because it is the identity on the translational degrees of freedom.
The state of the system is a direct product of translational and spin states:
$$|\Psi\rangle = |\psi\rangle \otimes |\chi\rangle $$
where $$\langle x |\psi \rangle = \psi(x)$$ is the wavefunction in the position representation, while $$|\chi\rangle = a |\uparrow\rangle + b|\downarrow\rangle$$ is the spin state, with $a$ and $b$ some complex numbers satisfying $|a|^2 +|b|^2 = 1$.
If you want to normalise the position wavefunction, you need to introduce a length scale. The usual procedure in this situation is to introduce periodic boundary conditions, i.e. $\psi(x) = \psi(x+L)$. This choice has the advantage of preserving the translation invariance so that the eigenstates look the same, unlike box boundary conditions. Then one takes $L\rightarrow \infty$ at the end of the calculation, if desired.
The spin surely gives a contribution to the energy. You know that it wants to align its magnetic moment with the magnetic field, so states where the spin is aligned (say $|\downarrow\rangle$) must have lower energy than anti-aligned states (say $|\uparrow\rangle$). The Hamiltonian is a sum of terms that act on the spin and translation Hilbert spaces separately, i.e. you can write
$$ \hat{H} = \hat{H}_x \otimes \hat{1} + \hat{1} \otimes \hat{H}_{spin}. $$
A general eigenstate is just a product of translational and spin eigenstates, and you can see that the eigenvalues just add:
$$ (\hat{H}_x \otimes \hat{1} + \hat{1} \otimes \hat{H}_{spin}) |\Psi\rangle = \hat{H}_x|\psi\rangle \otimes \hat{1}|\chi\rangle + \hat{1}|\psi\rangle  \otimes \hat{H}_{spin}|\chi\rangle = (E_x + E_{spin}) |\psi\rangle\otimes |\chi\rangle,$$
where $E_{spin}$ is proportional to an eigenvalue of the operator $\hat{S}_z$.


text:
Q: Server-side processing UTF-8 search in DataTables I use DataTables with server-side processing
$('#usersTable').DataTable(
            {
                responsive: true,
                "pageLength": 20,
                "processing": true,
                "serverSide": true,
                "bLengthChange": true,
                "bSort" : false,
                "bInfo" : false,
                "aLengthMenu": [[20, 50, 75, -1], [20, 50, 75, "ყველა"]],
                "ajax": "helpers/server_processing.php"
            }
        );

I also changed db connection in ssp.class.php to
$db = @new PDO(
"mysql:host={$sql_details['host']};dbname={$sql_details['db']}",
$sql_details['user'],
$sql_details['pass'],
array( PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES 'utf8'" )
);

Still I'm having problems while trying to search UTF-8 characters in search bar

can anybody help?
The queries (copied from a comment)
SELECT  COUNT(`id`)
    FROM  `users`
    WHERE  (`id` LIKE :binding_0
              OR  `mac` LIKE :binding_1
              OR  `ip` LIKE :binding_2
              OR  `sname` LIKE :binding_3
              OR  `login` LIKE :binding_4
              OR  `tariff_plan_id` LIKE :binding_5
              OR  `now_playing_type` LIKE :binding_6
              OR  `now_playing_content` LIKE :binding_7
              OR  `now_playing_start` LIKE :binding_8
              OR  `keep_alive` LIKE :binding_9
              OR  `id` LIKE :binding_10
              OR  `status` LIKE :binding_11
           )
SELECT  COUNT(`id`)
    FROM  `users`
SELECT  `id`, `mac`, `ip`, `sname`, `login`, `tariff_plan_id`,
        `now_playing_type`, `now_playing_content`, `now_playing_start`,
        `keep_alive`, `id`, `status`
    FROM  `users`
    WHERE  (`id` LIKE :binding_0
              OR  `mac` LIKE :binding_1
              OR  `ip` LIKE :binding_2
              OR  `sname` LIKE :binding_3
              OR  `login` LIKE :binding_4
              OR  `tariff_plan_id` LIKE :binding_5
              OR  `now_playing_type` LIKE :binding_6
              OR  `now_playing_content` LIKE :binding_7
              OR  `now_playing_start` LIKE :binding_8
              OR  `keep_alive` LIKE :binding_9
              OR  `id` LIKE :binding_10
              OR  `status` LIKE :binding_11
           )
    ORDER BY  id ASC
    LIMIT  0, 20

EDIT: additional information
I discovered that LIKE queries with utf-8 values doesn't work with DateTime field in mysql

but DataTables compare every field to search string automatically. Is there an easy way I can tell DataTables not to search DateTime type columns if string contains utf-8 characters?

A: Use new PDO('dblib:host=host;dbname=db;charset=UTF8', $user, $pwd); instead of ATTR_INIT_COMMAND.
->set_charset is for mysqli interface, not PDO.
According to the image, the columns are CHARACTER SET utf8 COLLATION utf8_general_ci, which is sufficient for Georgian.
Show us the query with the LIKE that is complaining.
The problem has to do with a LIKE statement.  If it is in a Stored Routine, let's see SHOW CREATE ...; probably the wrong charset/collation was in effect when it was created.
As it says in the "Best Practice" section of this , "HTML forms should start like ".  Check the other items there.

A: Try this:
$db_link = new PDO($dsn, $username, $password) // DB-connection

// CHARSET: utf8
$db_link->query('SET NAMES utf8');

A: I fixed the issue by altering filter function of ssp.class.php to exlude DateTime columns from search if search string is utf-8
static function filter ( $request, $columns, &$bindings )
{
    $globalSearch = array();
    $columnSearch = array();
    $dtColumns = self::pluck( $columns, 'dt' );

    if ( isset($request['search']) && $request['search']['value'] != '' ) {
        $str = $request['search']['value'];

        for ( $i=0, $ien=count($request['columns']) ; $i<$ien ; $i++ ) {
            $requestColumn = $request['columns'][$i];
            $columnIdx = array_search( $requestColumn['data'], $dtColumns );
            $column = $columns[ $columnIdx ];

            //**ADDED THIS**
            if(mb_detect_encoding($request["search"]["value"])=="UTF-8"){
                if($column['db']=="keep_alive" || $column['db']=="now_playing_start"){
                    continue;
                }
            }

            if ( $requestColumn['searchable'] == 'true' ) {
                $binding = self::bind( $bindings, '%'.$str.'%', PDO::PARAM_STR );
                $globalSearch[] = "`".$column['db']."` LIKE ".$binding;
            }
        }
    }

    // Individual column filtering
    if ( isset( $request['columns'] ) ) {
        for ( $i=0, $ien=count($request['columns']) ; $i<$ien ; $i++ ) {
            $requestColumn = $request['columns'][$i];
            $columnIdx = array_search( $requestColumn['data'], $dtColumns );
            $column = $columns[ $columnIdx ];

            $str = $requestColumn['search']['value'];

            if ( $requestColumn['searchable'] == 'true' &&
                $str != '' ) {
                $binding = self::bind( $bindings, '%'.$str.'%', PDO::PARAM_STR );
                $columnSearch[] = "`".$column['db']."` LIKE ".$binding;
            }
        }
    }

    // Combine the filters into a single string
    $where = '';

    if ( count( $globalSearch ) ) {
        $where = '('.implode(' OR ', $globalSearch).')';
    }

    if ( count( $columnSearch ) ) {
        $where = $where === '' ?
            implode(' AND ', $columnSearch) :
            $where .' AND '. implode(' AND ', $columnSearch);
    }

    if ( $where !== '' ) {
        $where = 'WHERE '.$where;
    }

    return $where;
}


text:
Q: Cannot read property 'length' of undefined, upon click event I'm a totally new to Javascript/jQuery and I am creating two objects named mapMTK and keyAndDatatye as given in below:
HTML

    Module Template Name

        <select id="formModuleName" name="DSname" class="input-large">
            <option>TitleImageModule</option>
            <option>SearchBoxModule</option>
            <option>CategoryLinksModule</option>
            <option>BannerSlidesModule</option>
            <option>StoreNavigationModule</option>
        </select>

<button id="clickme">click me</button>

Javascript
function keyAndDatatype(key, datatype) {
    this.key = key;
    this.datatype = datatype;
}

var mapMTK = {};

mapMTK["TitleImageModule"] = [
    new keyAndDatatype("title", "ImageObj")
];

mapMTK["SearchBoxModule"] = [
    new keyAndDatatype("searchBox", "LinkObj")
];

mapMTK["CategoryLinksModule"] = [
    new keyAndDatatype("subStores", "LinkObj"),
    new keyAndDatatype("title", "TextObj")
];

mapMTK["StoreNavigationModule"] = [
    new keyAndDatatype("anchorTags", "ImageLinkObj"),
    new keyAndDatatype("titleImage", "ImageObj"),
    new keyAndDatatype("title", "TextObj")
];

var inputModuleName;

$('#formModuleName').change(function () {
    inputModuleName = this.value;
});

$('#clickme').click(function () {
    alert(mapMTK[inputModuleName].length);
});

On jsFiddle
I'm using the mapMTK[inputModuleName].length with a jQuery click event it gives me:
Uncaught TypeError: Cannot read property 'length' of undefined

While using same mapMTK[inputModuleName].length in Javascript works fine.
<missing example>

How I can use it in my jQuery code?

A: Consider this:
var inputModuleName;

$('#clickme').click(function () {
    alert(mapMTK[inputModuleName].length);
});

now it's obvious, that inputModuleName is undefined and thus will be mapMTK[inputModuleName].
as long as this function
$('#formModuleName').change(function () {
    inputModuleName = this.value;
});

has not been executed, inputModuleName and mapMTK[inputModuleName] are undefind.

A: Change your:
var inputModuleName;

$('#formModuleName').change(function () {
    inputModuleName = this.value;
});

$('#clickme').click(function () {
    alert(mapMTK[inputModuleName].length);
});

to
$('#clickme').click(function () {
    var inputModuleName = $('#formModuleName').val();
    alert(mapMTK[inputModuleName].length);
});

A: It looks like you're trying to find the length of an object, which won't work unless its an array object:
var obj = {a:1, b:2, c:3};  //undefined
var arr = ['a', 'b', 'c']; // 3

alert(obj.length);
alert(arr.length);


text:
Q: Custom Cell from Nib UITableView I have been trying various methods with no success to alter the following code...
I have a nib file that works fine if I set all cells to this but I only want one of the switch statements to have the custom cell nib file.  Any ideas?
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

    NSUInteger row = [indexPath row];
    NSInteger section = [indexPath section];
    UITableViewCell *cell;

    switch (section)
    {
        case 0:

            cell = [tableView dequeueReusableCellWithIdentifier:@"any-cell"];
            cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:@"any-cell"] autorelease];
            cell.text =  [showTimes objectAtIndex:row];
            break;
        case 1:

            cell = [tableView dequeueReusableCellWithIdentifier:@"any-cell"];
            cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:@"any-cell"] autorelease];
            cell.text =  [showTimes objectAtIndex:row];
            break;
        default:
            cell = [tableView dequeueReusableCellWithIdentifier:@"any-cell"];
            cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:@"any-cell"] autorelease];
            cell.text =  [showTimes objectAtIndex:row];
            break;
    }

    return cell;

}

A: You're going to need to do two things:

*

*Make a separate cell identifier for the cell that you want to use from the nib. Using "any-cell" will result in your cell being reused for different rows.

*Instead of UITableViewCell's initWithFrame:reuseIdentifier: method, you need to initialize the cell from your nib. Check Apple's Table View Programming Guide's section on using nibs.

Also, though this isn't technically required, UITableViewCell's initWithFrame:reuseIdentifier: method has been deprecated in favor of initWithStyle:reuseIdentifier:.


text:
Q: Scale background image to fit area above tag Given a div (or other tag) is it possible to add a large "responsive" image above the tag (think site banner) that has a max width and height and then scales to stay at 100% of the browser width while the height adjusts automatically using only css?
I have tried 3 different method each with have a major downside. On all the methods here is the html used. and the #nav is where I am trying to add the picture above.

link

Method 1
using :before and content:url(img);
CSS:
#nav:before {
    content:url('http://lorempixel.com/output/nature-q-c-780-480-5.jpg');
    width:100%;
    display:block;
    overflow:hidden;
}

This method will keep the height correct but will hide the right side of the image if I reduce the size of the screen. I could not find a way to properly scale the content image.
JSFiddle of method 1
Method 2
using :before and background:url() I was able to get the image to scale properly but I am unable to change the value of the height, which gives the huge area below the image.
#nav:before {
    background:url('http://lorempixel.com/output/nature-q-c-780-480-5.jpg') no-repeat top;
    background-size:contain;
    width:100%;
    display:block;
    content:"";
    height:400px;
    max-height:480px;
}

JSFiddle of method 2
Method 3
I was somewhat able to achieve the desired effect but the padding-top is dependent on knowing the ration of the height to width for the image. (I fail to understand in css terms how this is working and why this calculation is needed). So for a square image its X/X = 1 or 100% height. And for the 480x780 image it is 61.53%
#nav {
    background:url('http://lorempixel.com/output/nature-q-c-780-480-5.jpg') no-repeat top center;
    background-size:contain;
    padding-top:61.53%;
    width:100%;
    display:block;
    height:100px;
    overflow:hidden;
}

This method does produce the desired result but I cannot always know the height and width of the image. So I am looking for a better solution.
I also realize that I could create a media query for each different size and an extra image, but that is way to much work.
JSFiddle of method 3
Any ideas on how to improve one of these methods?

A: Hm, I hope I got you right. This one is an image above your navigation and it's always 100% wide (same as browser size). It scales up and down on resize and the height is calculated automatically so that the aspect ratio is not affected:
HTML

link

CSS
img.banner {
    width: 100%;
}

Fiddle
http://jsfiddle.net/7HgU8/


text:
Q: Spinx search normalized words I am test keywords with sphinxQL
call keywords ('azori', 'test', 1);

And get results
+------+-----------+------------+------+------+
| qpos | tokenized | normalized | docs | hits |
+------+-----------+------------+------+------+
| 1    | azori     | a260       | 1550 | 1551 |
+------+-----------+------------+------+------+
1 row in set (0.00 sec)

What means a260?

A: That looks like a soundex representation
https://en.wikipedia.org/wiki/Soundex
seems like you have morphology=soundex enabled on the particular index
http://sphinxsearch.com/docs/current.html#conf-morphology


text:
Q: What is the corresponding of structured classifier in Programming Language like Java? Structured Classifier is a concept related to Modeling Language like UML(Unified Modeling Language) which contains Parts or Roles that form its data Structure and realize its behavior.
What is the corresponding of structured classifier in Programming Language like Java?

A: Structured Classifier is an abstract concept, with no direct counterpart in JAVA. However, you can create a JAVA class structure that mimics its organization and concepts.
Here is the example of Structured Classifier, taken from the formal UML spec:

What makes the class Car a Structured Classifier is its internal structure made up of a network of connected object in a strictly defined way (roles).
To implement this in Java, you first need to:

*

*Create 3 Java classes, corresponding to Car, Wheel and Engine

*Add some kind of interfaces to Engine, that permit to connect it to 2 Weels. It can also be done with 2 data members of a type Wheel

*Add 3 private data members to Car - "rear" (array of 2 instances of Wheel) and "e" (an instance of Engine)

*Ensure that Wheels and Engine are correctly connected within a Car (in a class constructor for example)

*Eventually add methods with additional logic performed by these elements

A: Your description is not really clear, and browsing over the web I got a slightly more structured definition:

A structured classifier is an abstract metaclass that represents any
  classifier whose behavior can be fully or partly described by the
  collaboration of owned or referenced instances.

If that is the case, I guess you can have an organised structure of interfaces or abstract classes to reach some thing similar...
Hope this helps.


text:
Q: Writing into Oracle database via Java leading to ORA-00604 and ORA-01000 I've got problems at trying to write data into my oracle table.
So, what I'm trying to do is to receive data from TMDB (tmdb.org) and write those into an Oracle table.
Here's my class where all the magic is happening:
public class Movies3 {

    public void execute_to_db() throws SQLException, ClassNotFoundException, RuntimeException {

        final String url = "jdbc:oracle:thin:@192.168.XXX.XXX:XXX:XXX";
        final String user = "TEST2";
        final String password = "XXX";
        final String table = "TMDB_TEST";

        DatabaseConnect db = new DatabaseConnect();
        QueryCreateTable_Movies createtable = new QueryCreateTable_Movies();

        try {
            db.connect(user, password, url);

            ResultSet tablelike = db.processQuery(
                    "SELECT COUNT(table_name) " + "FROM all_tables " + "WHERE table_name = '" + table + "' ");

            PreparedStatement insert_ps = db.prepareStatement("INSERT INTO " + table + " "
                    + "(TMDB_ID, IMDB_ID, ORIGINAL_TITLE, TITLE_DE, BUDGET, REVENUE, RELEASE_DATE) "
                    + "VALUES (?,?,?,?,?,?,?)");

            int tablelike_int = 0;
            while (tablelike.next())
                tablelike_int = tablelike.getInt(1);

            if (tablelike_int == 0)
                db.processInsert(createtable.create);

            else {

                TmdbMovies movies = new TmdbApi("XXX").getMovies();

                MovieDb latest_movie = movies.getLatestMovie();
                int tmdb_max_id = latest_movie.getId();

                try {

                    int id_exist = 0;

                    for (int i = 1; i < tmdb_max_id; i++) {

                        ResultSet id_existq = db
                                .processQuery("SELECT (tmdb_id) FROM " + table + " WHERE tmdb_id = " + i);
                        while (id_existq.next())
                            id_exist = id_existq.getInt(1);

                        if (id_exist == 0) {

                            try {

                                MovieDb movie_name_en = movies.getMovie(i, "en");
                                MovieDb movie_name_de = movies.getMovie(i, "de");
                                String original_title = movie_name_en.getOriginalTitle();
                                String title_de = movie_name_de.getTitle();
                                String imdb_id = movie_name_en.getImdbID();
                                int budget_en = (int) movie_name_en.getBudget();
                                int revenue_en = (int) movie_name_en.getRevenue();
                                String release_date_en = movie_name_en.getReleaseDate();

                                insert_ps.setInt(1, i);
                                insert_ps.setString(2, imdb_id);
                                insert_ps.setString(3, original_title);
                                insert_ps.setString(4, title_de);
                                insert_ps.setInt(5, budget_en);
                                insert_ps.setInt(6, revenue_en);
                                insert_ps.setString(7, release_date_en);

                                insert_ps.executeUpdate();

                                /** Start Output **/

                                double percent = (i * 100) / tmdb_max_id;

                                StringBuilder string = new StringBuilder(140);
                                int percent_int = (int) percent;
                                long total = (long) tmdb_max_id;
                                long current = (long) i;
                                string.append('\r').append(String.join("",
                                        Collections.nCopies(percent_int == 0 ? 2 : 2 - (int) (Math.log10(percent_int)),
                                                " ")))
                                        .append(String.format(" %d%% [", percent_int))
                                        .append(String.join("", Collections.nCopies((percent_int / 2), "=")))
                                        .append('>')
                                        .append(String.join("",
                                                Collections.nCopies((100 / 2) - (percent_int / 2), " ")))
                                        .append(']')
                                        .append(String.join("",
                                                Collections.nCopies(
                                                        (int) (Math.log10(total)) - (int) (Math.log10(current)), " ")))
                                        .append(String.format(" %d/%d | TMDB_ID: %d | Movie: %s", current, total, i,
                                                original_title));

                                System.out.flush();
                                System.out.print(string);

                                /** End Output **/

                                i++;

                                tmdb_max_id = latest_movie.getId();

                            } catch (RuntimeException e) {

                                continue;
                            } catch (SQLException sqle) {
                                System.err.println(sqle + " SQL ERROR at movie with ID" + i);
                                throw sqle;
                            } finally {
                                id_existq.close();
                                insert_ps.close();
                                tablelike.close();
                            }

                        } else
                            i++;

                    }

                } catch (SQLException sqle2) {
                    throw sqle2;
                } catch (RuntimeException e2) {
                    throw e2;
                } finally {

                    insert_ps.close();
                    tablelike.close();
                }
            }

            db.disconnect();
        } catch (SQLException sqle_con) {
            throw sqle_con;

        }

        catch (ClassNotFoundException clnf) {
            throw clnf;

        } finally {

        }
    }

}

When executing, I receive ORA-00604 and ORA-01000.
Exception in thread "main" java.sql.SQLException: ORA-00604: Fehler auf rekursiver SQL-Ebene 1
ORA-01000: Maximale Anzahl offener Cursor überschritten
ORA-00604: Fehler auf rekursiver SQL-Ebene 1
ORA-01000: Maximale Anzahl offener Cursor überschritten
ORA-01000: Maximale Anzahl offener Cursor überschritten

    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:447)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396)
    at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:951)
    at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:513)
    at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:227)
    at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:531)
    at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:195)
    at oracle.jdbc.driver.T4CStatement.executeForDescribe(T4CStatement.java:876)
    at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1175)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1296)
    at oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:1498)
    at oracle.jdbc.driver.OracleStatementWrapper.executeQuery(OracleStatementWrapper.java:406)
    at database.DatabaseConnect.processQuery(DatabaseConnect.java:31)
    at tmdb_api_to_db.Movies3.execute_to_db(Movies3.java:75)
    at tmdb_api_to_db.Main.main(Main.java:22)

I'm pretty sure, that the problem occurs because I got a fallacy with those try-catch-finally constructions - especially when closing my statements - but can't find my mistake and I simply feeling like a dog chasing its tail...
I'm using Eclipse Neon2 on Java 8 and Oracle 11g.
If there is further information needed, I'd be happy to provide.
Please consider that I'm not very experienced and thus be forgiving, if my question hurts any feelings... :)

A: The error message tranlated into English says
Maximum number of open cursors exceeded

The problem is that you are leaking cursors.  One place where this could happen is in the inner for loop.
When the body of
if (id_exist == 0) {

is not executed, the try / finally where you should be closing the ResultSet is never executed.  That will leak a cursor.  Eventually, Oracle won't let you open any more ...
I'm going to recommend that you read up on the "try with resources" constructed that has been supported by Java since Java 7.
It allows you to write resource cleanup code that is easier to read AND less error prone.

Also, if you find that you have a method where the majority of the code is indented 9 levels deep.  That should be a sign to you that you need to refactor it.  Seriously, you don't need to do all of that in a single monolithic method.  For a start, refactoring your code will make it easier for you (and everyone else) to understand.


text:
Q: inserting values from 2 mysql tables to single jtable row I'm new to java. currently trying to make a program which manipulates with data from mysql. I have several tables in mysql and I need to add data to a single jtable row from 2 mysql tables. Now I'm getting data in different rows. Below my code for one table. Any suggestions how to change it?
public void fill_rs_table_test(){
DefaultTableModel model = new DefaultTableModel();

model.setColumnIdentifiers(new String[] {"rs_name","rs_number","firm_id"});

try{
String sql = "select * from inf_rs";
theView.pst = theView.conn.prepareStatement(sql);
theView.rs = theView.pst.executeQuery();

while(theView.rs.next()){

String rs_name = theView.rs.getString ("rs_name");
String rs_number = theView.rs.getString ("rs_number");
String firm_id = theView.rs.getString ("firm_id");

model.addRow(new Object[] {rs_name, rs_number,firm_id});

}
}
catch (Exception e){
}

this.theView.rs_table.setModel(model);
for (int i = 0, x = 0; i < theView.rs_table.getColumnModel().getColumnCount(); i++)
this.theView.rs_table.getColumnModel().getColumn(i).setCellEditor(new javax.swing.table.TableCellEditor(){

@Override
public boolean isCellEditable(java.util.EventObject anEvent) {
    return false;
}

});


text:
Q: Product of Transpositions - reflection elements of $D_5$. In dihedral group $D_5$, there are five reflections:
$s, sr, sr^2, sr^3, sr^4.$
Q 1. The reflections are shown at:
https://math.stackexchange.com/a/490089 to occur around the vertex labelled $1$ only, though had read some alternative way elsewhere.
It further correctly states:
$s_0 : (25)(34)$
$$s_0=\begin{pmatrix} 1 & 2 & 3 &4 &5\\ 1 & 5 & 4 & 3&2\end{pmatrix}$$
Q.2. A bigger issue is that it shows the product of transpositions to be:
$s_1= TR : (12)(53)= $
$$\begin{pmatrix} 1 & 2 & 3 &4 &5\\ 2 & 1 & 5 & 4&3\end{pmatrix}$$
But, when try to compose $s_1= TR$ find:
$R =(51234)=(12345)=$
$$\begin{pmatrix} 1 & 2 & 3 &4 &5\\ 2 & 3 & 4 & 5&1\end{pmatrix}$$
$T =(25)(34)=$
$$\begin{pmatrix} 1 & 2 & 3 &4 &5\\ 1 & 5 & 4 & 3&2\end{pmatrix}$$
$TR =(15)(24)=$
$$\begin{pmatrix} 1 & 2 & 3 &4 &5\\ 5 & 4 & 3 & 2 &1\end{pmatrix}$$
====================================
Similarly, have issues with all other reflections' transpositions :
$s_2= TR^2 : (13)(45)$
$$s_2=\begin{pmatrix} 1 & 2 & 3 &4 &5\\ 3 & 2 & 1& 5&4\end{pmatrix}$$
$R^2 =(13524)=$
$$\begin{pmatrix} 1 & 2 & 3 &4 &5\\ 3 & 4 & 5 & 1&2\end{pmatrix}$$
$T =(25)(34)=$
$$\begin{pmatrix} 1 & 2 & 3 &4 &5\\ 1 & 5 & 4 & 3&2\end{pmatrix}$$
$TR^2 =(14)(23)=$
$$\begin{pmatrix} 1 & 2 & 3 &4 &5\\ 4 & 3 & 2 & 1 &5\end{pmatrix}$$

$s_3= TR^3 : (14)(23)$
$$s_3 =\begin{pmatrix} 1 & 2 & 3 &4 &5\\ 4 & 3 & 2 & 1&5\end{pmatrix}$$
$R^3 =(14253)$
$$\begin{pmatrix} 1 & 2 & 3 &4 &5\\ 4 &5 & 1&2&3 \end{pmatrix} $$
$T =(25)(34)=$
$$\begin{pmatrix} 1 & 2 & 3 &4 &5\\ 1 & 5 & 4 & 3&2\end{pmatrix}$$
$TR^3 =(13)(45)=$
$$\begin{pmatrix} 1 & 2 & 3 &4 &5\\ 3 & 2& 1 & 5 &4 \end{pmatrix}$$

$s_4 = TR^4: (15)(24)$
$$s_4 =\begin{pmatrix} 1 & 2 & 3 &4 &5\\ 5 & 4 & 3 & 2&1\end{pmatrix}$$
$R^4 =(15432)=$
$$\begin{pmatrix} 1 & 2 & 3 &4 &5\\ 5 & 1 & 2 & 3&4 \end{pmatrix}$$
$T =(25)(34)=$
$$\begin{pmatrix} 1 & 2 & 3 &4 &5\\ 1 & 5 & 4 & 3&2 \end{pmatrix}$$
$TR^4 =(12)(35)=$
$$\begin{pmatrix} 1 & 2 & 3 &4 &5\\ 2 & 1 & 5 & 4 &3 \end{pmatrix}$$
==============
Edit:
My $s_1$ equals link's $s_4,$ and vice-versa.
My $s_2$ equals link's $s_3,$ and vice-versa.

A: The reflections in the link are all there, as you can see.   The list $s,sr,sr^2,sr^3,sr^4$ just happens to give them in a different order.
The key is that if you rotate one more time,  and then do that same reflection, $s$, the result is a reflection in a different axis.   And you can see that in the picture.
It's actually quite a trivial situation.   Because the axis gets rotated.
(Remember the pentagon always lands on itself. They're called symmetries.  So, if you will,  the original pentagon stays fixed underneath. )


text:
Q: knockout virtual elements and using "with" without a container element Can someone tell me why this works:

        //contents of a jquery ui modal

But trying to do the same with KO virtual elements does not work:

        //contents of a jquery ui modal

I get the following error:
Error: Unable to parse bindings.
Message: ReferenceError: drugName is not defined;
Bindings value: jqDialog: {title: drugName}

I'd like to get rid of that div wrapper which just holds the data-bind attribute.  I figured the virtual elements would make this a breeze.
Edit: Here's kind of the core to the page (though it won't run in the fiddle), http://jsfiddle.net/B8g5J/

A: I'm not sure if you have sorted this out, but is it possible that your server is configured to remove comments?
See: Knockout.js Virtual Elements Work Locally But Not Remotely


text:
Q: How to make a notched matrix? I have a little problem, I don't quite understand how to make a toothed (a notched?) matrix in C++.
The matrix should be like this (with 4 columns and 6 rows):

But I keep getting a matrix in the form of a triangle, i.e. no repeating rows are displayed. How can I fix it?
I'm attaching a piece of code, but I don't think it will help much.
(N are rows, M are columns)
for (int i = 0; i < N; i++) {
   matrix[i] = new double[M];
   for (int p = 0; p <= i; p++) {
      matrix[i][p] = rand() % 101 - 50;
   cout << setw(5) << matrix[i][p];
}

A: I'm assuming that the first row has 1 column, second has 2 columns, etc., up to a maximum of M columns. In which case, the below will work.
size_t N = 6;
size_t M = 4;
double **matrix = new double*[N];

for (size_t i = 0; i < N; i++) {
   size_t cols = std::min( i + 1, M ); // determine the correct number of cols for the row
   matrix[i] = new double[cols];
   for (size_t p = 0; p < cols; p++) {
      matrix[i][p] = rand() % 101 - 50;
      cout << setw(5) << matrix[i][p];
   }
}

Btw, I'd suggest using something more modern than rand().
Would also generally recommend not using new, and instead preferring std::unique_ptr or std::shared_ptr, or in this case using std::vector.
Don't forget to delete as well.


text:
Q: Assembly Language bug with space character Having a bit of difficulty getting my input to print once a white space character is inputted. So far, i have it to display the uppercase/lowercase of the input but once i enter a string it doesnt read whats after the white space character. any suggestions?
EDIT: intel x86 processor and im using EMU8086
org 100h

include 'emu8086.inc'
printn "Enter string to convert"
mov dx,20
call get_string

printn
mov bx,di
mov ah,0eh

mov al,[ds+bx]
cmp al, 41h

cmp al, 5Ah
jle ToLower1
cmp al, 61h
cmp al, 7ah
jle ToUpper1

ToLower1:
add al, 20h
int 10h
jmp stop1
ToUpper1:
sub al, 20h
int 10h
stop1:

inc bx
mov al,[ds+bx]
cmp al, 41h

cmp al, 5Ah
jle ToLower2
cmp al, 61h

cmp al, 7ah
jle ToUpper2

ToLower2:
add al, 20h
int 10h
jmp stop2
ToUpper2:
sub al, 20h
int 10h
stop2:

inc bx
mov al,[ds+bx]
cmp al, 41h

cmp al, 5Ah
jle ToLower3
cmp al, 61h

cmp al, 7ah
jle ToUpper3

ToLower3:
add al, 20h
int 10h
jmp stop3
ToUpper3:
sub al, 20h
int 10h
stop3:

inc bx
mov al,[ds+bx]
cmp al, 41h

cmp al, 5Ah
jle ToLower4
cmp al, 61h

cmp al, 7ah
jle ToUpper4

ToLower4:
add al, 20h
int 10h
jmp stop4
ToUpper4:
sub al, 20h
int 10h
stop4:

inc bx
mov al,[ds+bx]
cmp al, 41h

cmp al, 5Ah
jle ToLower5
cmp al, 61h
cmp al, 7ah
jle ToUpper5

ToLower5:
add al, 20h
int 10h
jmp stop5
ToUpper5:
sub al, 20h
int 10h
stop5:

printn
hlt
define_get_string
define_print_string
end

A: @Oded, those registers are x86 and emu8086 would imply an emulator for the 8086 CPU.
@OP:
Well your adding 32 to a character code to make it lower right?  The ASCII code for space is 32 and the ASCII code for the @ symbol is 64 right?  That should tell you your compares are wrong somewhere.
cmp al, 41h ;A
; WHAT ARE YOU MISSING HERE?
cmp al, 5Ah ;Z
jle ToLower1

cmp al, 61h ;a
; WHAT ARE YOU MISSING HERE?
cmp al, 7ah ;z
jle ToUpper1

Do you see the error?  This is basically telling the CPU if the current character is equal to or less than Z to make lower.  Also, if the character is equal to or less than z to make upper.
So what you have is:
You need a conditional jump after cmp al, 41H and a conditional jump after cmp al, 61H
But that still won't work, this should work:
cmp     al, 41H
jb      CheckForLower
cmp     al, 5AH
ja     CheckForLower
; convert to lowercase here
; Process next char

cmp     al, 61H
jb      NotValid
cmp     al, 7AH
ja      NotValid
; convert to uppercase here
; Process next char

* Edit *
We can condense all that code into 1 loop:
org 100h

include 'emu8086.inc'
printn "Enter string to convert"
    mov     dx,20
    call    get_string

printn
    mov     bx, di
    mov     ah,0eh

    jmp     Start

NextChar:
    inc     bx

Start:
    mov     al, [ds+bx]
    test    al, al
    jz      stop5

    cmp     al, 20H
    je      PrintChar

    cmp     al, 41H
    jb      CheckLower
    cmp     al, 5AH
    ja      CheckLower
    add     al, 20H
    int     10H
    jmp     NextChar

CheckLower:
    cmp     al, 61H
    jb      NextChar
    cmp     al, 7AH
    ja      NextChar
    sub     al, 20H

PrintChar:
    int     10H
    jmp     NextChar

stop5:
    printn
    hlt
    define_get_string
    define_print_string
end


text:
Q: App not running in the background In my background mode enabled blue tooth app when app enters the background. After sometime didfinishlaunching is called and app starts again. But some times the saved info in key-chain is not found and app starts from the very beginning not from the from the screen if info in the key-chain was present. Below are the logs in different circumstances:
1. When key-chain info is not found
   New Line  Time: 2018-02-03 17:15:50 +0000, applicationDidEnterBackground -----
New Line  Time: 2018-02-03 17:15:50 +0000, stop tracking in background
New Line  Time: 2018-02-03 17:30:07 +0000, didfinishlaunching
New Line  Time: 2018-02-03 17:30:07 +0000, start is added as no auth is available
New Line  Time: 2018-02-03 17:30:08 +0000, Start View did load
2.When key-chain info is found
New Line  Time: 2018-02-02 12:37:39 +0000, applicationDidEnterBackground -----
New Line  Time: 2018-02-02 12:37:39 +0000, stop tracking in background
New Line  Time: 2018-02-02 12:45:50 +0000, didfinishlaunching
New Line  Time: 2018-02-02 12:45:51 +0000, home is added as auth is available
But my main concern why didfinidhlaunching is called at all?


text:
Q: How get ID and value in JComboBox within JTable JFrame in my Program

How to get value "item" and "ID" from JComboBox in JTable by specific row the table?
Code inside JComboBox
public class ProductItem {
    private int id;
    private String Name;

    public ProductItem() {
    }

    public ProductItem(int id, String Name) {
        this.id = id;
        this.Name = Name;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return Name;
    }

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

    @Override
    public String toString() {
        return getName();
    }

}

and
import java.sql.ResultSet;
import java.sql.SQLException;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JOptionPane;

public class LoadItem {
    static ResultSet rs = null;
    public static DefaultComboBoxModel LoadProduct(){
        DefaultComboBoxModel ProDuctmodel = new DefaultComboBoxModel();
        try {
            rs = BarungCls.BarungSelect("select ID, Name from test_data ");
            while(rs.next()){
                ProDuctmodel.addElement(new ProductItem(Integer.parseInt(rs.getString(1)),rs.getString(2)));
            }
            return ProDuctmodel;
        } catch (SQLException e) {
                JOptionPane.showMessageDialog(null, e);
        }
        return null;
    }
}

Add combo box to table at row 1.
Add JCombobox into JTable

A: The combobox in the table is the table's editor component. Unless you want to customize the editor, you do not need to get the item of the combo box (the JTable framework will handle the editing for you). Instead, query the table's model for the values you need. Use JTable.getModel() to retrieve the table's model and use the model's getValue(int, int) method to retrieve the actual values.


text:
Q: Rails how to censor some parameters from logs I'm doing some custom logging in my Rails application and I want to automatically sensor some parameters. I know that we have fitler_parameter_logging.rb which does this for the params object. How can I achieve something like this for my custom hash.
Let's say I'm logging something like this:
Rails.logger.info {name: 'me', secret: '1231234'}.inspect

So my secret key should be sensored in the logs.
I know I can personally delete the key before logging, but it adds noise to my application.

A: The question title talks about removing the parameters, but your question refers to censoring the parameters similar to how Rails.application.config.filter_parameters works. If it's the latter, it looks like that's already been answered in Manually filter parameters in Rails. If it's the former, assuming a filter list, and a hash:
FILTER_LIST = [:password, :secret]
hash = {'password' => 123, :secret => 321, :ok => "this isn't going anywhere"}

then you could do this:
hash.reject { |k,v| FILTER_LIST.include?(k.to_sym) }

That'll cope with both string and symbol key matching, assuming the filter list is always symbols. Additionally, you could always use the same list as config.filter_parameters if they are going to be the same and you don't need a separate filter list:
hash.reject { |k,v| Rails.application.config.filter_parameters.include?(k.to_sym) }

And if you wanted to make this easier to use within your own logging, you could consider monkey patching the Hash class:
class Hash
  def filter_like_parameters
    self.reject { |k,v| Rails.application.config.filter_parameters.include?(k.to_sym) }
  end
end

Then your logging code would become:
Rails.logger.info {name: 'me', secret: '1231234'}.filter_like_parameters.inspect

If you do monkey patch custom functionality to core classes like that though for calls you're going to be making a lot, it's always best to use a quite obtuse method name to reduce the likelihood of a clash with any other library that might share the same method names.
Hope that helps!


text:
Q: In Hopscotch, how do you find the senders of a message? In Newspeak's IDE, Hopscotch, what is the equivalent to Smalltalk's alt-n, which shows you all senders of a message?

A: Nevermind, I just found out:

Alt-m and Alt-n are residual Squeak/Morphic behavior and doesn't work in Windows native mode. Instead you can use the little icon which looks like a speech bubble.


text:
Q: WSGI request and response wrappers for Python 3 Are there WSGI request and response wrappers for Python 3?
WebOb looks nice (although there is some critique), but it seems to be written in Python <3. Werkzeug seems also to be written in Python <3.
Should I write my own request and response wrappers for Python 3? Maybe this would be impossible, since WSGI seems to be somewhat broken in Python 3. So what to do? Give up Python 3 and go back to Python 2?

A: My recommendation: right now, Python 2.x should be used for production quality stuff. I know, Python 3 is technically very interesting, but right now sticking with Python 2 is MUCH easier and MUCH more productive.

A: No, there are not WSGI for Python3. It occurs because of new string types.


text:
Q: Is there any way to change 'Status Bar' color (Mobile View) in React Js Web App? How can I change the status bar color when React JS web app is viewed on Mobile Device?
I know its possible in Mobile APP Development but I am not sure how can I achieve this in web app


text:
Q: Prove closed expression for $\int_0^1 \log(x) \log(1+x) \log(2+x)\,dx$ In Closed form of $\int_{0}^{1} \frac{\log(1+x)\log(2+x) \log(3+x)}{1+x}\,dx$ I have proposed an integral which I could not solve, and though there were some upvotes on the question no solution was provided. Hence I looked for simplifications which still are not trivial.
Here's an example where I found a closed expression with the help of Mathematica which can be verified numerically but I'm lacking a proof.
Hence my question is
Prove that
$$\int_0^1 \log(x)\log(x+1)\log(x+2)\,dx \\
= -6+3 \log ^3(2)-\frac{\log ^3(3)}{3}+\frac{\log ^2(2)}{2}-3 \log (3) \log (2)+6 \log (3)\\+\zeta(2) (1-2 \log (2))-\frac{13 \zeta (3)}{8}\\-\operatorname{Li}_2\left(-\frac{1}{2}\right)-6 \operatorname{Li}_2\left(-\frac{1}{2}\right) \log (2)+4 \operatorname{Li}_2\left(\frac{1}{4}\right) \log (2)\\-2 \operatorname{Li}_2\left(\frac{1}{3}\right) \log (3)+\operatorname{Li}_2\left(-\frac{1}{3}\right) \log (3)\\
-4 \operatorname{Li}_3\left(-\frac{1}{2}\right)-2 \operatorname{Li}_3\left(\frac{1}{3}\right)+\operatorname{Li}_3\left(-\frac{1}{3}\right)+2 \operatorname{Li}_3\left(\frac{1}{4}\right)\\\simeq -0.18403235664237885896 $$
Notice that the expression is composed of $\pi$, $\log(s)$, $\zeta(s)$, and $\operatorname{Li}_{s}(t)$.
Remark 1: Mathematica was able to find the antiderivative but it turned out to contain complex valued summands. These cancelled out numerically but I could not prove mathematically that their contribution vanishes.
Remark 2: I have not found the present class of integrals (product of logs with successively shifted arguments) in the 60 problems the of the book "(Almost) Impossible Integrals, Sums, and Series" by
Cornel Ioan Valean (https://it.b-ok2.org/book/4996918/0df734) which is famous and frequently quoted in this forum. So this type of problem seems to be new.

A:
By the variable change $1/(1+x)=t$ and then integration by parts, it's easy to observe the main integral reduces easily to
  $$\int_0^1\log(x)\log(1+x)\log(2+x)\textrm{d}x=\int_{1/2}^1\frac{\displaystyle \log\left(\frac{t}{1-t}\right)\log(t)\log\left(\frac{1+t}{t}\right)}{t^2}\textrm{d}t$$
$$=7 \log ^2(2)-\log ^3(2)-3 \log (2)\log (3)+\log ^2(2)\log (3)$$
$$+2\underbrace{\int_{1/2}^1 \frac{\log \left(1-t^2\right)}{t^2}\textrm{d}t}_{\text{Trivial}}-3\underbrace{\int_{1/2}^1\frac{\log ^2(t)}{t^2}\textrm{d}t}_{\text{Trivial}}-4\underbrace{\int_{1/2}^1 \frac{\log (t)}{1-t^2}\textrm{d}t}_{\text{Trivial}}-\underbrace{2\int_{1/2}^1 \frac{ \log ^2(t)}{1-t^2}\textrm{d}t}_{\text{Trivial}}$$
$$+\underbrace{\int_{1/2}^1\frac{\displaystyle \log \left(\frac{1-t}{2}\right)}{1+t}\textrm{d}t}_{\text{Trivial}}+\underbrace{\int_{1/2}^1\frac{\displaystyle \log \left(\frac{1+t}{2}\right)}{1-t}\textrm{d}t}_{\text{Trivial}}+\underbrace{\int_{1/2}^1\frac{\log (1+t)}{t}\textrm{d}t}_{\text{Trivial}}-\underbrace{\int_{1/2}^1\frac{\log (1-t)}{t}\textrm{d}t}_{\text{Trivial}} $$
$$+\underbrace{\int_{1/2}^1\frac{\log (1+t) \log (t)}{t}\textrm{d}t}_{\text{Trivial}}-\underbrace{\int_{1/2}^1\frac{\log (1-t) \log (t)}{t}\textrm{d}t}_{\text{Trivial}}$$
$$+\underbrace{\int_{1/2}^1\frac{\log (1-t) \log (1+t)}{t}\textrm{d}t}_{\displaystyle \mathcal{I}}+2\underbrace{\int_{1/2}^1\frac{ \log (1-t) \log (t)}{1+t}\textrm{d}t}_{\displaystyle \mathcal{J}}.$$
  The integral $\mathcal{I}$ is straightforward if we use that $$\log(1-t)\log(1+t)=\frac{1}{2} \left(\log ^2(1-t)+\log ^2(1+t)-\log ^2\left(\frac{1-t}{1+t}\right)\right),$$
  and when expanding the right-hand side and then taking the integral, it's clear that for the last integral we might like to make the change of variable $\displaystyle t\mapsto\frac{1-t}{1+t}$. The rest is known and easy.
With respect to the integral $\mathcal{J}$ we may use the same idea and use the algebraic identity above, but first we might want to make some rearrangements. Well, we see that
  $$\int_{1/2}^1 \frac{\log (1-t) \log (t)}{1+t} \textrm{d}t=\underbrace{\int_0^1 \frac{\log (1-t) \log (t)}{1+t} \textrm{d}t}_{\displaystyle 13/8\zeta (3)- \pi ^2 \log (2)/4}-\underbrace{\int_0^{1/2} \frac{\log (1-t) \log (t)}{1+t} \textrm{d}t}_{\displaystyle \mathcal{K}},$$
  and for the last integral, which is $\mathcal{K}$, we make the change of variable $t\mapsto 1/2-t$ (that is in a way the magical part that soon allows us to connect things to the algebraic identity above), and then we have
  $$\mathcal{K}=\int_0^{1/2} \frac{\log (1-t) \log (t)}{1+t} \textrm{d}t=\int_0^{1/2} \frac{\log (1/2-t) \log (1/2+t)}{3/2-t} \textrm{d}t$$
  and then let $t\mapsto t/2$ to arrive at
  $$\mathcal{K}=\frac{1}{3} \int_0^1 \frac{(\log (1-t)-\log (2)) (\log (1+t)-\log (2))}{1-t/3} \textrm{d}t.$$
  What now? When expanding the integral, all the resulting integrals are easy to calculate except the integral
  $$\int_0^1 \frac{\log (1-t)\log (1+t)}{1-t/3} \textrm{d}t.$$
  At this point we use again that  $$\log(1-t)\log(1+t)=\frac{1}{2} \left(\log ^2(1-t)+\log ^2(1+t)-\log ^2\left(\frac{1-t}{1+t}\right)\right),$$
  and the first two integrals are extracted with simple integration by parts or by using geometric series after arranging properly the argument of log in the numerator with the proper variable change, and for the last integral we use again the variable change $\displaystyle t\mapsto\frac{1-t}{1+t}$, and we are finally done.

End of story.
A first note: Here is the generalization of one of the integrals I used above (the case $n=1$),

Let $n\ge1$ be a positive integer. Then
  $$\int_0^1 \frac{\log ^{2n-1}(x) \log(1-x)}{1+x} \textrm{d}x$$
$$=\frac{1}{2}(2n)!\zeta (2n+1)-2\log(2)(1 -2^{-2n})(2n-1)!\zeta (2n)$$
$$-2^{-1-2n} (2n+1-2^{1+2n})(2n-1)!\zeta(2n+1)$$
$$-(2n-1)!\sum_{k=1}^{n-1}\zeta (2k)\zeta (2n-2k+1)+2^{-2n}(2n-1)!\sum_{k=1}^{n-1}2^{2k}\zeta (2k)\zeta (2n-2k+1),$$
  where $\zeta$ represents the Riemann zeta function.

The generalization is presented and proved in the paper, A note presenting the generalization of a special logarithmic integral by C.I. Valean.
A second note: The calculation of the integral $\mathcal{K}$ is even simpler if we consider writing that

$$\int_0^{1/2}\frac{\log(1-t)\log(t)}{1+t} \textrm{d}t$$
$$=\frac{1}{2}\int_0^{1/2}\frac{\log^2(1-t)}{1+t} \textrm{d}t+\frac{1}{2}\int_0^{1/2}\frac{\log^2(t)}{1+t} \textrm{d}t-\frac{1}{2}\int_0^{1/2}\frac{\displaystyle \log^2\left(\frac{t}{1-t}\right)}{1+t} \textrm{d}t,$$
  where in the last integral let $\displaystyle t\mapsto \frac{t}{1-t}$. This integral over the unit interval is also met in the book, (Almost) Impossible Integrals, Sums, and Series (and, of course, in the paper above which uses a very simple strategy for this particular case).

A: We have to calculate the integral
$$i = \int_0^1 \log(x)\log(1+x)\log(2+x)\,dx\tag{1}$$
1. My derivation of the closed expression
First I tried to find the indefinite integral (the antiderivative of the integrand)
$$a(x)=\int \log(x)\log(1+x)\log(2+x)\,dx\tag{2}$$
I was lucky, Mathematica quickly returned an expression the drivative of which gave back the integrand.
It turned out that $a(0)=0$ so that $i = a(1)$. The result is also numerically correct to a good approximation.
The expression $a(1)$ formally still contained an imaginary part.
But this imaginary part turns out to be numerically zero, i.e.
$$a_i = -2 \operatorname{Li}_2\left(\frac{1}{3}\right)+\text{Li}_2\left(-\frac{1}{3}\right)+\frac{\pi ^2}{6}-\frac{1}{2} \log ^2(3)= 0\tag{3}$$
I'm sure that $(3)$ holds exactly but I haven't yet found the dilog relation to prove it.
Notice that this derivation is a valid proof: we have used a heuristic tool to find a solution which could be verified.
2. attempt using parametric derivatives, double series
My first solution attempt starts with generating the logs by differentiating the function
$$f=x^a (x+1)^b (x+2)^c$$
with respect to the parameters $a$, $b$, and $c$, and then letting the parameters go to $0$.
Let us expand $f$ into a double binomial series
$$f_s = 2^c x^a \sum _{n=0}^{\infty } \sum _{m=0}^{\infty } \frac{x^m x^n \binom{b}{m} \binom{c}{n}}{2^n}$$
performing the integral gives for the summand
$$s(n,m)=\frac{2^{c-n} \binom{b}{m} \binom{c}{n}}{a+m+n+1}$$
The drivatives and the respective limits are
$$s_a=\frac{\partial s(n,m)}{\partial a}|_{a\to 0} = -\frac{2^{c-n} \binom{b}{m} \binom{c}{n}}{(m+n+1)^2}$$
$$s_b = \frac{\partial s_a}{\partial b}|_{b\to 0} = -\frac{\binom{0}{m} 2^{c-n} (-\psi ^{(0)}(1-m)-\gamma ) \binom{c}{n}}{(m+n+1)^2}$$
$$s_c = \frac{\partial s_b}{\partial c}|_{c\to 0} =-\frac{2^{-n} \binom{0}{m} \binom{0}{n} H_{-m} \left(H_{-n}-\log (2)\right)}{(m+n+1)^2}$$
We observe that harmonicnumbers have een generated but in a peculiar combination with the binomial coefficient.
We know that $H_{z}$ has simple poles at negatives integer $z$. On the other hand $\binom{0}{k}=0$ at natural $k$. In fact there is cancellation described by the formula
$$\lim_{m\to 0} \, \binom{0}{m} H_{-m}= 0$$
$$\lim_{m\to 1} \, \binom{0}{m} H_{-m}=\frac{(-1)^m}{m}$$
For $n=0$ the summand becomes
$$\lim_{n\to 0} \, -\frac{2^{-n} \binom{0}{m} \binom{0}{n} H_{-m} \left(H_{-n}-\log (2)\right)}{(m+n+1)^2}=\frac{\log (2) \binom{0}{m} H_{-m}}{(m+1)^2}$$
So that the remaining $m$-sum starts at $m=1$ and gives
$$\sum _{m=1}^{\infty } \frac{(-1)^m \log (2)}{m (m+1)^2}=\left(-\frac{\pi ^2}{12}+2-2 \log (2)\right) \log (2) $$
Now the true double sum has $n\ge1$, $m\ge1$ so that $\log (2) \binom{0}{n}=0$ and the sum becomes
$$-\sum _{n=1}^{\infty } \sum _{m=1}^{\infty } \frac{2^{-n} (-1)^{m+n}}{m n (m+n+1)^2}$$
I'm just seeing that I have made a simple thing compilcated. We better expand the two logs with the shift into a power series ...
(to be continued).

A: Incomplete solution
First write $\ln(2+x)=\ln2+\ln(1+x/2)$
$$\Longrightarrow I=\ln2\int_0^1 \ln x\ln(1+x)\ dx+\int_0^1\ln x\ln(1+x)\ln(1+x/2)\ dx$$
$$=\ln2 I_1+I_2$$
Apply integration by parts for $I_1$
$$I_1=(x\ln x-x)\ln(1+x)|_0^1-\int_0^1\frac{x\ln x-x}{1+x}\ dx=\boxed{2-2\ln2-\frac12\zeta(2)}$$
For $I_2$, write $\displaystyle\ln(1+x/2)=-\sum_{n=1}^\infty\frac{(-1)^n}{2^nn}x^n=\frac12\sum_{n=2}^\infty\frac{(-1)^n}{2^n(n-1)}x^{n-1}$
$$\Longrightarrow I_2=\frac12\sum_{n=2}^\infty\frac{(-1)^n}{2^n(n-1)}\int_0^1 x^{n-1}\ln x\ln(1+x)\ dx$$
Now use the identity
$$\int_0^1\frac{x^{2n}}{1+x}dx=\ln2+H_n-H_{2n}$$
By integration by parts we have
$$\int_0^1 x^{2n-1}\ln(1+x)\ dx=\frac{H_{2n}-H_n}{2n}$$
replace $2n$ with $n$ then differentiate with respect to $n$
$$\int_0^1 x^{n-1}\ln x\ln(1+x)\ dx=\frac{H_{n/2}}{n^2}+\frac{H_{n/2}^{(2)}}{2n}-\frac{H_n}{n^2}-\frac{H_n^{(2)}}{n}+\frac{\zeta(2)}{2n}$$
Therefore
$$I_2=\frac12\sum_{n=2}^\infty\frac{(-1)^nH_{n/2}}{2^n(n-1)n^2}+\frac14\sum_{n=2}^\infty\frac{(-1)^nH_{n/2}^{(2)}}{2^n(n-1)n}-\frac12\sum_{n=2}^\infty\frac{(-1)^nH_{n}}{2^n(n-1)n^2}-\frac12\sum_{n=2}^\infty\frac{(-1)^nH_n^{(2)}}{2^n(n-1)n}\\
+\frac{\zeta(2)}{4}\sum_{n=2}^\infty\frac{(-1)^n}{2^n(n-1)n}$$
For the first and second sum, we can use
$$\sum_{n=2}^\infty f(n)=\sum_{n=1}^\infty f(2n)+\sum_{n=1}^\infty f(2n+1)$$


text:
Q: The RSpec Book - 'require': cannot load such file -- codebreaker (LoadError) The exercise in the Pragmatic Programmers' RSpec Book is to write a problem solving game called Codebreakers. The purpose is to get exposure to BDD using Cucumber and Rspec in Ruby.
Here's an overview of my directory tree for codebreaker:
-features
  -step_definitions
  -codebreaker_steps
  -support
    -env.rb
  -codebreaker_starts_game.feature
  -codebreaker_submits_guess.feature
-lib
  -codebreaker
    -codebreaker.rb
    -game.rb
-spec
  -codebreaker
    -game_spec
  -spec_helper.rb

The LoadError Message for codebreaker:
rspec spec/codebreaker/game_spec.rb
/Documents/rubyProjects/codebreaker/spec/spec_helper.rb:1:in `require': cannot load such file -- codebreaker (LoadError)
    from /Documents/rubyProjects/codebreaker/spec/spec_helper.rb:1:in `<top (required)>'
    from /Documents/rubyProjects/codebreaker/spec/codebreaker/game_spec.rb:1:in `require'
    from /Documents/rubyProjects/codebreaker/spec/codebreaker/game_spec.rb:1:in `<top (required)>'

spec/codebreaker/game_spec.rb requires 'spec_helper':
require 'spec_helper'

  module Codebreaker
    describe Game do
      describe "#start" do
        it "sends a welcome message"
        it "prompts for the first guess"
      end
    end
  end

spec/spec_helper.rb requires 'codebreaker', which is not loading as per the error:
require 'codebreaker'

And lib/codebreaker/codebreaker.rb requires codebreaker/game
require 'codebreaker/game'

lib/codebreaker/game.rb:
module Codebreaker
  class Game
    def initialize(output)
    end

    def start
    end
  end
end

Suggestions and insight is appreciated!
Thank you.

A: I believe you need to change your require in your spec_helper.rb to be this
require 'codebreaker/codebreaker'

since you your lib directory tree looks like this
-lib
  -codebreaker
    -codebreaker.rb
    -game.rb


text:
Q: unable to persist MEDIUMTEXT type field in spring boot I have a field named 'value' which is of type MEDIUMTEXT in the MySQL db. When I try to persist or fetch the model, it shows
Could not commit JPA transaction; nested exception is javax.persistence.RollbackException: Error while committing the transaction
Model
@Entity
@Table(name = "xyz_something")
@JsonIgnoreProperties(ignoreUnknown = true)
public class Xyz {

 @Id
 @GeneratedValue(strategy = GenerationType.IDENTITY)
 private int id;

 @NotBlank(message = "key is mandatory")
 @Column(columnDefinition = "CHAR")
 @Type(type = "org.hibernate.type.CharArrayType")
 private char[] key;

 @Column(columnDefinition = "MEDIUMTEXT")
 @Type(type = "org.hibernate.type.TextType")
 private String value;
 // Getters and Setters

Repository
public interface XyzRepository extends JpaRepository<Xyz, Integer> {
}

Controller
@RestController()
@RequestMapping("api/v1")
public class XyzController {
    private static Logger logger = LogManager.getLogger();

    @Autowired
    XyzRepository xyzRepository;

    @PutMapping("/xyz")
    public HttpStatus insertValue(@RequestHeader(value="id") int id, @NotBlank @RequestBody String value) {
        return upsert(value,id);
       return HttpStatus.BAD_REQUEST;
    }

 private HttpStatus upsert(String value, int id) {
        return xyzRepository.findById(id)
                .map(xyz -> {
                    xyz
                    .setKey("key")
                    .setValue(value);
                    xyzRepository.save(xyz);
                    return HttpStatus.CREATED;
                }).orElseGet(() -> {
                    Xyz xyz = new Xyz();
                    xyz
                    .setId(id)
                    .setKey("key")
                    .setValue(value)
                    xyzRepository.save(xyz);
                    return HttpStatus.CREATED;
                });
    }
}

If I comment out the 'setValue(value)' line, it works, else I get an error mentioned above. I have tried using @Lob with columnDefinition = "MEDIUMTEXT". Also, I have tried putting length in the @Column, that doesn't work as well. What is it that I am doing wrong? Thanks in advance.

A: It is because you are using a reserved keyword of MySQL i.e. "key". You need to map it using @Column(name = "\"key\"") above your declaration of the field 'key'. You can refer here for more information about reserved keywords.


text:
Q: Convertir JSON que contiene barra invertida utilizando C# Les comento que estoy consumiendo un servicio REST de un tercero, cuando realizo el llamado este me devuelve un json, el problema es que el json viene de la siguiente forma:
(Aqui un fragmento del JSON)
"GetBookingResult": "{\"reserva\":{\"fecha_creacion\":{\"#text\":\"15FEB17\"},\"hora_creacion\":{\"#text\":\"2133\"},\"responsable\":{\"tipo_reserva\":\"WEBPAS\",\"cod_cia\":\"OB\",\"off_resp\":\"OBW101\"},\"localizador_resiber\":{\"#text\":\"P7S44\"}

Este es el codigo que estoy utilizando para consumir el servicio
public static Reserva getBooking(GetBookingRequest requestParams)
        {
            try
            {
                StreamWriter requestWriter;

                string postData = new JavaScriptSerializer().Serialize(requestParams);

                var webRequest = System.Net.WebRequest.Create("http://miUrl.svc/metodo") as HttpWebRequest;
                if (webRequest != null)
                {
                    webRequest.Method = "POST";
                    webRequest.ServicePoint.Expect100Continue = false;
                    webRequest.Timeout = 20000;
                    webRequest.ContentType = "application/json; charset=utf-8";
                    //POST the data.
                    using (requestWriter = new StreamWriter(webRequest.GetRequestStream()))
                    {
                        requestWriter.Write(postData);
                    }
                }

                using (HttpWebResponse resp = webRequest.GetResponse() as HttpWebResponse)
                {
                    if (resp.StatusCode != HttpStatusCode.OK)
                        throw new Exception(String.Format(
                        "Server error (HTTP {0}: {1}).",
                        resp.StatusCode,
                        resp.StatusDescription));

                    Stream resStream = resp.GetResponseStream();
                    StreamReader reader = new StreamReader(resStream);
                    var resultado = reader.ReadToEnd();
                    Console.WriteLine(resultado);

                    var str = resultado.Replace(@"\", string.Empty);

                    JToken token = JToken.Parse(str);
                    JObject o = JObject.Parse((string)token);

                    JObject response = o["reserva"] as JObject;
                    GetBookingResponse respuesta = response.ToObject<GetBookingResponse>();

                    return respuesta.reserva;
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("Ocurrio un error obteniendo los datos de la reserva");
                return null;
            }
        }

al final lo que estoy intentando es obtener el elemento reserva del json que me devuelve el servicio y convertirlo a a un objeto de tipo Reserva que yo he creado en .NET

A: Como te comentan, no es el problema del codigo de parseo, sino mas bien del string que es un supuesto JSON. Es invalido, por lo menos el que colocas de ejemplo.
Antes que nada, en C# en cadenas el caracter \ es un caracter de escape, mas info aqui

*

*String/Cadenas > Secuencias de escape de cadena
Este json que proporcionas si le quitamos los caracteres de escape \" reemplazando por " y probando online en un parseador de json
"GetBookingResult": "{\"reserva\":{\"fecha_creacion\":{\"#text\":\"15FEB17\"},\"hora_creacion\":{\"#text\":\"2133\"},\"responsable\":{\"tipo_reserva\":\"WEBPAS\",\"cod_cia\":\"OB\",\"off_resp\":\"OBW101\"},\"localizador_resiber\":{\"#text\":\"P7S44\"}

Esta mal armado, puedes probar

*

*https://jsoneditoronline.org/

*http://jsonparseronline.com/
Si ves queda algo asi
 - No comienza por un caracter {} o [] objeto u array de objetos en json
De comienzo ya podemos decir que esta mal armado el conjunto debe comenzar como un array o un objeto {}, Seria algo asi simple, para darle un vistazo
{"GetBookingResult":1}

Si es completo como deberia ser (sin el caracter escape para probar online)
 {"GetBookingResult": {"reserva":{"fecha_creacion":{"#text":"15FEB17"}, "hora_creacion":{"#text":"2133"}, "responsable":{"tipo_reserva":"WEBPAS","cod_cia":"OB","off_resp":"OBW101"},"localizador_resiber":{"#text":"P7S44"}}}}

Pero por  eso no se si lo que te envia es un GetBookingResult completo, o es un variable de Request GetBookingResult que dentro tiene un string que es un json, Ya que esta luego de GetBookingResult: .... si parece un objeto JSON (aunque falta cerrar unas llaves al final)
Pero suponiendo que le puedes indicar al que te envia que lo envie correctamente con todo lo que te vamos proponiendo, aqui el codigo para parsear en un dymamic y leer cada parte del objeto json
 var jsonData =         "{\"GetBookingResult\": {\"reserva\":{\"fecha_creacion\":{\"#text\":\"15FEB17\"}, \"hora_creacion\":{\"#text\":\"2133\"}, \"responsable\":{\"tipo_reserva\":\"WEBPAS\",\"cod_cia\":\"OB\",\"off_resp\":\"OBW101\"},\"localizador_resiber\":{\"#text\":\"P7S44\"}}}}";

        dynamic demo = Newtonsoft.Json.Linq.JObject.Parse(jsonData);

        Console.WriteLine(demo.GetBookingResult);
        Console.WriteLine(demo.GetBookingResult.reserva);
        Console.WriteLine(demo.GetBookingResult.reserva.fecha_creacion);
        Console.WriteLine(demo.GetBookingResult.reserva.hora_creacion);
        Console.WriteLine(demo.GetBookingResult.reserva.responsable);

       Console.WriteLine(demo.GetBookingResult.reserva.localizador_resiber);

A: ¿en qué línea específica es que obtienes el error? supongo que no llegues a convertir al JObject.
En estos casos no necesitas hacer el Replace, lo que hago normalmente es lo siguiente:
JObject obj = JObject.Parse(resultado);
Donde resultado tiene el string devuelto por el servicio incluyendo los \.
Ya después conviertes a tu entidad de la manera que prefieras.

A: He estado viendo tu Json y lo primero decirte que esta bastante raramente formado. Para que te hagas una idea ese json para que pase un parseo de validacion debería ser así:
{"GetBookingResult": {"reserva":{"fecha_creacion":{"#text":"15FEB17"},"hora_creacion":{"#text":"2133"},"responsable":{"tipo_reserva":"WEBPAS","cod_cia":"OB","off_resp":"OBW101"},"localizador_resiber":{"#text":"P7S44"}}}}

Te sobran las \ eso ya lo tienes resuelto, pero ademas te falta un { al principio de todo, te faltan tres } al final de todo y te sobran unas " justo antes de {"reserva"}.
Cambiando eso ya deberias poder parsearlo a clase sin problema con Newtonsoft o con el propio de .Net y de ahi sacar los datos.
Adaptandolo a c# me sale esta estructura de clases
    public class Rootobject
    {
        public Getbookingresult GetBookingResult { get; set; }
    }

    public class Getbookingresult
    {
        public Reserva reserva { get; set; }
    }

    public class Reserva
    {
        public Fecha_Creacion fecha_creacion { get; set; }
        public Hora_Creacion hora_creacion { get; set; }
        public Responsable responsable { get; set; }
        public Localizador_Resiber localizador_resiber { get; set; }
    }

    public class Fecha_Creacion
    {
        public string text { get; set; }
    }

    public class Hora_Creacion
    {
        public string text { get; set; }
    }

    public class Responsable
    {
        public string tipo_reserva { get; set; }
        public string cod_cia { get; set; }
        public string off_resp { get; set; }
    }

    public class Localizador_Resiber
    {
        public string text { get; set; }
    }

¿Ese Json lo formas tu o te viene de algún lado ya hecho?


text:
Q: Store response from the random text/color generator, compare them and store in array I am doing a javascript webpage to demonstrate stroop effect, which is to show that it takes longer for a person to choose the right color if the color of the word does not match with its semantic meaning. For example, click "blue" button if the word RED in blue color.
However, since the color and the word are randomly generated, I dont know how to store them into a new array and compare them.
At the end of the experiment, I want to have an alert. If the question is "RED in blue color", then it will show "DIFF", if the question is "RED in red color", then it will show "SAME" for the 10 questions. Thanks for help! I have the code as below

<title> random text </title>

Using Computer Science to Demonstrate the Stroop Effect

 Introduction

 Instructions

<textarea id="txtbox" style="width:600px;"></textarea>

<button onClick='compare("red");display()'>Red </button>

<button onClick='compare("yellow");display()'>Yellow</button>

<button onClick='compare("green");display()'>Green</button>

<button onClick='compare("blue");display()'>Blue</button>

A:

<title> random text </title>

Using Computer Science to Demonstrate the Stroop Effect

 Introduction

 Instructions

<textarea id="txtbox" style="width:600px;"></textarea>

<button onClick="compare(this.id);display()" id="red">Red </button>

<button onClick="compare(this.id);display()" id="yellow">Yellow</button>

<button onClick="compare(this.id);display()" id="green">Green</button>

<button onClick="compare(this.id);display()" id="blue">Blue</button>