text:
Q: How to disable CMD+Q combination? I am using WinOS at the office and MacOS at home. But I am more experienced on WinOS. While i am browsing (via Firefox), I use ⌘ CMD+Q accidentally to write "@" mark because of WinOS and keyboard habits. So, the browser quits and I lose all what I've written.
Is there a way to constrain this key combination on MacOS or do I have to look for it on Firefox? (I know, the best way is adapting MacOS but mostly I am working on WinOS.)

A: Unfortunately, Firefox (at least the 3.6 version I experimented with) does not disable the command shortcut for Quit when you change it in System Preferences.
I think the quick and easy fix for this is to add ⌘Q as a global shortcut to something else innocuous. In my experiments, I found this to work:

*

*Open System Preferences.

*Click on the Keyboard pane.

*Click Keyboard Shortcuts tab.

*Click Exposé & Spaces shortcuts in the left side list.

*Under "Exposé" change the shortcut for "Desktop" to ⌘Q

Now when you accidentally hit ⌘Q, your desktop will magically and amusingly appear reminding you of your folly. Hit ⌘Q again and you're back exactly where you were.
As a sidenote, after a while you may want to change this back after you "unlearn" your behaviour. ⌘Q, the Mac equivalent to "ALT-F4" has been the standard shortcut since the introduction of the Macintosh, and like the other "standard" shortcuts ⌘W,⌘Z,⌘C,⌘V and so on, it's best to learn them to ease use of other Mac computers or when you upgrade.

A: Here's how to change that particular shortcut for Firefox:

*

*Open System Preferences. This is in the Applications folder.

*Go to the Keyboard pane, and click the Keyboard Shortcuts tab.

*Click the [+] button near the bottom.

*Select Firefox from the Application menu. For Menu Title, type 'Quit Firefox' (without the quotes)

*For the Keyboard Shortcut, push a key combination that you're not likely to hit by accident (control-q, for example).

*Open Firefox. Now, cmd-q does nothing (you can quit with ctrl-q, or whatever you set it to).

Hope this helps.

A: I'm on macOS Ventura and I need to remove the "Close Window" shortcut Cmd+W, as I often accidentally close an app.
The way to do it is to find out the exact specific command in the menu bar. In my case, it is called "Close".
Then go to System Preferences > Keyboard > Shortcuts > App Shortcuts then click + to add a new shortcut for the app. Next, reassign an obscure keyboard shortcut (for me Ctrl+Option+Cmd+W).
Reference: How to disable COMMAND+Q for certain applications


text:
Q: Postfix SASL Authentication Failure After I needed to purge and re-install Postfix, I've been manually trying to recreate the main.cf file and adjust some settings in the master.cf files of the Postfix configuration.  The good news is that  I no longer have any errors in the mail.err log file.  I can now receive and send emails on the LAMP (Ubuntu 14.04) server and receive emails at a user's roundcube webmail.  But I am still unable to send emails from the Drupal website or roundcube.   When I send an email from the website, I get the following warnings in the mail.log file:
Nov 19 19:05:29 ts1 postfix/smtpd[32410]: warning: host.example.com[xxx.xxx.xxx.xxx]: SASL LOGIN authentication failed: authentication failure
Nov 19 19:05:29 ts1 postfix/smtpd[32410]: disconnect from host.example.com[xxx.xxx.xxx.xxx]
Nov 19 19:05:29 ts1 postfix/smtpd[32410]: connect from host.example.com[xxx.xxx.xxx.xxx]
Nov 19 19:05:29 ts1 postfix/smtpd[32410]: warning: host.example.com[xxx.xxx.xxx.xxx]]: SASL LOGIN authentication failed: authentication failure
Nov 19 19:05:29 ts1 postfix/smtpd[32410]: disconnect from host.example.com[xxx.xxx.xxx.xxx]]

Here are the main.cf and master.cf files:
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no
readme_directory = no
smtpd_tls_cert_file = /etc/ssl/certs/example_com.crt
smtpd_tls_key_file = /etc/ssl/private/server.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = host.example.com
myorigin = /etc/mailname
mydestination = $myhostname, hostname, localhost.localdomain, localhost
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_command = /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME
mailbox_size_limit = 0
recipient_delimiter = +
inet_protocols = all
virtual_alias_maps = hash:/etc/postfix/virtual
alias_maps = hash:/etc/aliases
sender_bcc_maps = hash:/etc/postfix/bcc
sender_dependent_default_transport_maps = hash:/etc/postfix/dependent
home_mailbox = Maildir/
smtpd_sasl_auth_enable = yes
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination
allow_percent_hack = no
smtpd_sasl_auth_enable = yes
mynetworks_style = subnet
milter_default_action = accept
milter_protocol = 2
relayhost =
relay_domains = $mydestination

# Postfix master process configuration file.  For details on the format
# of the file, see the master(5) manual page (command: "man 5 master" or
# on-line: http://www.postfix.org/master.5.html).
#
# Do not forget to execute "postfix reload" after editing this file.
#
# ==========================================================================
# service type  private unpriv  chroot  wakeup  maxproc command + args
#               (yes)   (yes)   (yes)   (never) (100)
# ==========================================================================
smtp    inet    n   -   y   -   -   smtpd -o smtpd_sasl_auth_enable=yes
#smtp      inet  n       -       -       -       1       postscreen
#smtpd     pass  -       -       -       -       -       smtpd
#dnsblog   unix  -       -       -       -       0       dnsblog
#tlsproxy  unix  -       -       -       -       0       tlsproxy
#submission inet n       -       -       -       -       smtpd
#  -o syslog_name=postfix/submission
#  -o smtpd_tls_security_level=encrypt
#  -o smtpd_sasl_auth_enable=yes
#  -o smtpd_reject_unlisted_recipient=no
#  -o smtpd_client_restrictions=$mua_client_restrictions
#  -o smtpd_helo_restrictions=$mua_helo_restrictions
#  -o smtpd_sender_restrictions=$mua_sender_restrictions
#  -o smtpd_recipient_restrictions=
#  -o smtpd_relay_restrictions=permit_sasl_authenticated,reject
#  -o milter_macro_daemon_name=ORIGINATING
#smtps     inet  n       -       -       -       -       smtpd
#  -o syslog_name=postfix/smtps
#  -o smtpd_tls_wrappermode=yes
#  -o smtpd_sasl_auth_enable=yes
#  -o smtpd_reject_unlisted_recipient=no
#  -o smtpd_client_restrictions=$mua_client_restrictions
#  -o smtpd_helo_restrictions=$mua_helo_restrictions
#  -o smtpd_sender_restrictions=$mua_sender_restrictions
#  -o smtpd_recipient_restrictions=
#  -o smtpd_relay_restrictions=permit_sasl_authenticated,reject
#  -o milter_macro_daemon_name=ORIGINATING
#628       inet  n       -       -       -       -       qmqpd
pickup    unix  n       -       y       60      1       pickup
cleanup   unix  n       -       y       -       0       cleanup
qmgr      unix  n       -       n       300     1       qmgr
#qmgr     unix  n       -       n       300     1       oqmgr
tlsmgr    unix  -       -       y       1000?   1       tlsmgr
rewrite   unix  -       -       y       -       -       trivial-rewrite
bounce    unix  -       -       y       -       0       bounce
defer     unix  -       -       y       -       0       bounce
trace     unix  -       -       y       -       0       bounce
verify    unix  -       -       y       -       1       verify
flush     unix  n       -       y       1000?   0       flush
proxymap  unix  -       -       n       -       -       proxymap
proxywrite unix -       -       n       -       1       proxymap
smtp      unix  -       -       y       -       -       smtp
relay     unix  -       -       y       -       -       smtp
#       -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
showq     unix  n       -       y       -       -       showq
error     unix  -       -       y       -       -       error
retry     unix  -       -       y       -       -       error
discard   unix  -       -       y       -       -       discard
local     unix  -       n       n       -       -       local
virtual   unix  -       n       n       -       -       virtual
lmtp      unix  -       -       y       -       -       lmtp
anvil     unix  -       -       y       -       1       anvil
scache    unix  -       -       y       -       1       scache
#
# ====================================================================
# Interfaces to non-Postfix software. Be sure to examine the manual
# pages of the non-Postfix software to find out what options it wants.
#
# Many of the following services use the Postfix pipe(8) delivery
# agent.  See the pipe(8) man page for information about ${recipient}
# and other message envelope options.
# ====================================================================
#
# maildrop. See the Postfix MAILDROP_README file for details.
# Also specify in main.cf: maildrop_destination_recipient_limit=1
#
maildrop  unix  -       n       n       -       -       pipe
  flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}
#
# ====================================================================
#
# Recent Cyrus versions can use the existing "lmtp" master.cf entry.
#
# Specify in cyrus.conf:
#   lmtp    cmd="lmtpd -a" listen="localhost:lmtp" proto=tcp4
#
# Specify in main.cf one or more of the following:
#  mailbox_transport = lmtp:inet:localhost
#  virtual_transport = lmtp:inet:localhost
#
# ====================================================================
#
# Cyrus 2.1.5 (Amos Gouaux)
# Also specify in main.cf: cyrus_destination_recipient_limit=1
#
#cyrus     unix  -       n       n       -       -       pipe
#  user=cyrus argv=/cyrus/bin/deliver -e -r ${sender} -m ${extension} ${user}
#
# ====================================================================
# Old example of delivery via Cyrus.
#
#old-cyrus unix  -       n       n       -       -       pipe
#  flags=R user=cyrus argv=/cyrus/bin/deliver -e -m ${extension} ${user}
#
# ====================================================================
#
# See the Postfix UUCP_README file for configuration details.
#
uucp      unix  -       n       n       -       -       pipe
  flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
#
# Other external delivery methods.
#
ifmail    unix  -       n       n       -       -       pipe
  flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
bsmtp     unix  -       n       n       -       -       pipe
  flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient
scalemail-backend unix  -   n   n   -   2   pipe
  flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension}
mailman   unix  -       n       n       -       -       pipe
  flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
  ${nexthop} ${user}

submission  inet    n   -   y   -   -   smtpd -o smtpd_sasl_auth_enable=yes

I'm also using Dovecot so if you need that config, I will provide it. I'd really appreciate your help.
Thanks,
Dave

redpajama_set_name: RedPajamaStackExchange


text:
Q: How would I compare a set of strings? i have a username and a password string. How can I compare them in Android? This is somewhat what I'm looking for:
if( user== username && pass == password){ then do this  }
else if(user[does not equal to]username && pass==password{ toast (invaild username.)}
else if(user==username && pass[does not equal] password{toast(invaild password)}
else{ toast [invaild login]}

I know that's not correct coding but the two "else if" statements is what I'm looking for. The rest is just to give a better understanding of what I'm trying to do.
The username is what's entered into a Edittext same with the Password so they are both String when i .getText.toString right?

A: To compare the text in strings use equals() e.g. pass.equals(password) rather than == which checks if two strings are the same object.
For "does not equal" you can negate the statement e.g. !pass.equals(password).

A: You could use pass.equal(password).

A: Use the equals method for comparing strings.
if( user.equals(username) && pass.equals(password))
{
    then do this
}
else if(!user.equals(username) && pass.equals(password)
{
 Toast.makeText(this,"invalid username",Toast.LENGTH_SHORT).show();
}
else if(user.equals(username) && !pass.equals(password))
{
Toast.makeText(this,"invalid password",Toast.LENGTH_SHORT).show();
 }
else{
Toast.makeText(this,"Invalid login",Toast.LENGTH_SHORT).show();
}

A: You want to use .equals(..) to compare Strings.  Also, to do not logically, you can use !.
//define user, username
//define pass, password
if(user.equals(username) && pass.equals(password)){
    //then do this
}
else if(!user.equals(username) && pass.equals(password)){
    //toast (invaild username.)
    Toast.makeText(getApplicationContext(), "invalid username", Toast.LENGTH_SHORT).show();
}
else if(user.equals(username) && !pass.equals(password)){
    //toast(invaild password)
    Toast.makeText(getApplicationContext(), "invalid password", Toast.LENGTH_SHORT).show();
}
else{
    //toast [invaild login]
    Toast.makeText(getApplicationContext(), "invalid login", Toast.LENGTH_SHORT).show();
}

Here are some sources on Toast:
http://www.mkyong.com/android/android-toast-example/
http://developer.android.com/guide/topics/ui/notifiers/toasts.html


text:
Q: Unselect all rows when deleting item from QTreeView I have QTreeView with selection mode: SingleSelection (selection modes).
I want to delete selected item. Then rowsAboutToBeRemoved() function is called and neighbouring item is automatically selected as specified in comment: // Ensure one selected item in single selection mode.
How to avoid selection change?

*

*How to make so that no items will be selected after deletion?

*How to make so that parent of deleted item will be selected?

A: Given:
QTreeView view;

We can access the QItemSelectionModel instance and disable signals temporarily:
QItemSelectionModel *selectModel = view.selectionModel();
selectModel->blockSignals(true);
//set the selection
selectModel->blockSignals(false);

A quick nip into the source shows that Qt connects the QItemSelectionModel::currentChanged() signal to the view's currentChanged() slot, and this appears to be the source of your trouble.

A: Thinking out loud:
QTreeView view;
...
QItemSelection Modem *selectModel = view.selectionModel();
disconnect(selectModel, &QItemSelectionModel::currentChanged,0, 0);

That's really sort of heavy handed, but as long as the QTreeView is tightly controlled by you, it might be worth a try.
I suppose the alternative is to roll your own implementation of the model so you can control the connections at creation time.
(NOTE: Thanks to @Jon Harper so that I could copy/paste source. ;) )


text:
Q: How to run an i386 .so library on an armhf system? I need to implement a system with a third party device using a Raspberry Pi.
The device is connected using USB, and the manufacturer has provided a few software implementation demos, and the driver library includes a C++ header file and a C shared object file compiled for i386.
I need to be able to run this driver library on the RPi. My idea is to build a C++ program I can use to get the data from the device, compile for i386, and run it with qemu-i386. I have tried to execute this idea, but have run into some problems relating to the linking, like the executable looking for ld-linux.so.2, which my RPi doesn't have.
How can I get this to work?

A: It's a bad idea to run it for QEMU, instead install box86, link, it'll automatically take over when it detects a 32bit x86 executable and should work great for your use case


text:
Q: Xml Deserialization - Mapping Xml Attribute to Property? How do I go about deserializing a collection of Xml elements (all with the same element name, but with specific attributes) to an object?
Here's a snippet of the Xml:
<mibscalar name="lotOccupiedPct" link="http://localhost:8080/v1/mib/objs/lotOccupiedPct?type=xml">
<data index="1" value="0" counter="0"/>
</mibscalar>
<mibscalar name="gateStatusCloseThreshold" type="readonly" link="http://localhost:8080/v1/mib/objs/gateStatusCloseThreshold?type=xml">
<data index="1" value="90" counter="0"/>
</mibscalar>
<mibscalar name="gateStatusOpenThreshold" type="readonly" link="http://localhost:8080/v1/mib/objs/gateStatusOpenThreshold?type=xml">
<data index="1" value="70" counter="0"/>
</mibscalar>

And the corresponding properties in my class (in order):
public int CurrentOccupancyPercentage { get; set; }
public int CloseThresholdPercentage { get; set; }
public int OpenThresholdPercentage { get; set; }

I'm assuming there are some attributes I can add to the properties that can handle this scenario?
Thanks in advance.

A: You need to build a class with properties using XmlAttribute and XmlElement. It will allow you to serialize and deserialize to a XML file.
Here is an example Serialize Property as Xml Attribute in Element.


text:
Q: Center label in UIView which has y offset of height of status bar I am quite new to swift and trying to center a label and an image in a UIView which is located at the top of the screen. Currently the label is centered vertically and horizontally since this is the only thing I am able to do right now. As you can see I set autoresizing mask into constraints to false and used centerXAnchor and -YAnchor.
However I actually do not want the label to be in the center of the PostView but rather centered with a y offset of the height of the status bar. So it is centered but with no y offset of the height of the statusbar. Consequently, it looks kind of cramped(?): It is very close to the status bar... It looks like this:

But I would like to have the label (and later also an image) vertically centered in the red box:

This is the code I have right now (PostView class):
override init(frame: CGRect){

    super.init(frame: frame)

    //add subview containing name (and image)
    infosContainerView.frame = frame
    addSubview(infosContainerView)

    //add sub view containing label to former UIView (infosContainerView)
    infosContainerView.addSubview(infoNameView)
    infoNameView.centerXAnchor.constraint(equalTo: centerXAnchor).isActive = true
    infoNameView.centerYAnchor.constraint(equalTo: centerYAnchor).isActive = true

}

//this UIView shall contain the infoNameView and infoImageView
let infosContainerView: UIView = {

    //set properties of controls container view
    let entireInfoView = UIView()
    entireInfoView.backgroundColor = .white

    return entireInfoView

}()

//label and properties of label with name (autoresizingmaskinto constraint set to false)
let infoNameView: UILabel = {

    //set properties of controls container view
    let nameView = UILabel()

    nameView.translatesAutoresizingMaskIntoConstraints = false
    nameView.backgroundColor = .white

    nameView.font = UIFont(name: "HelveticaNeue", size: 20)

    nameView.text = "Name"
    nameView.textColor = .black
    nameView.textAlignment = .center

    return nameView

}()

EDIT:
Jože Ws was close to solving the problem, instead of dividing by 2 one has to divide by 4 although I do not know why...:
let statusBarHeight = UIApplication.shared.statusBarFrame.height

infosContainerView.addSubview(infoNameView)
infoNameView.centerXAnchor.constraint(equalTo: centerXAnchor).isActive = true
infoNameView.centerYAnchor.constraint(equalTo: centerYAnchor, constant: statusBarHeight/4).isActive = true

Screenshot:

A: Replace centerYAnchor constraint init with
// infoNameView.centerYAnchor.constraint(equalTo: centerYAnchor).isActive = true

   let statusBarHeight = UIApplication.shared.statusBarFrame.height
   infoNameView.centerYAnchor.constraint(equalTo: centerYAnchor, constant: statusBarHeight/2).isActive = true

This will add an offset to centerYAnchor equal to the value of the statusBarHeight


text:
Q: Flutter - Strange ListView behavior after refresh Could they help me solve and understand why ListView's strange behavior after a refresh?
In the example below I created a list with 24 elements and I go to the last item in the list and tap the icone refresh that will update the list. Only after the update does the ListView no longer show all elements.
And to ensure each element always has a different Key through the randomString

import 'package:flutter/material.dart';
import 'dart:math';

void main() {
  runApp(new MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      home: new CategoryPage(),
    );
  }
}

class CategoryPage extends StatefulWidget {
  @override
  CategoryPageState createState() => new CategoryPageState();
}

class CategoryPageState extends State<CategoryPage> {
  Color blueAppBar = new Color(0xFF26C6DA);
  List<Widget> listCategories = [];
  List listaDB = [];
  var listaCategory;

  String randomString(int length) {
    var rand = new Random();
    var codeUnits = new List.generate(
        length,
        (index){
          return rand.nextInt(33)+89;
        }
    );
    return new String.fromCharCodes(codeUnits);
  }

  @override
  void initState() {
    this.listaDB =
      [
        [{'category': 'foo01'}],
        [{'category': 'foo02'}],
        [{'category': 'foo03'}],
        [{'category': 'foo04'}],
        [{'category': 'foo05'}],
        [{'category': 'foo06'}],
        [{'category': 'foo07'}],
        [{'category': 'foo08'}],
        [{'category': 'foo09'}],
        [{'category': 'foo10'}],
        [{'category': 'foo11'}],
        [{'category': 'foo12'}],
        [{'category': 'foo13'}],
        [{'category': 'foo14'}],
        [{'category': 'foo15'}],
        [{'category': 'foo16'}],
        [{'category': 'foo17'}],
        [{'category': 'foo18'}],
        [{'category': 'foo19'}],
        [{'category': 'foo20'}],
        [{'category': 'foo21'}],
        [{'category': 'foo22'}],
        [{'category': 'foo23'}],
        [{'category': 'foo24'}]
      ];
  }

  @override
  Widget build(BuildContext context) {

    List<Widget> buildListCategories(List list) {
      this.listCategories = [];

      for(var i in list) {
        var category = i[0]['category'];

        this.listCategories.add(
          new ItemCategory(
            key: new Key(randomString(20)),
            category: category,
          )
        );
      }
      return this.listCategories;
    }

    this.listaCategory = buildListCategories(this.listaDB);

    return new Scaffold(
      appBar: new AppBar(
        title: new Text('Categories'),
        backgroundColor: blueAppBar,
        actions: <Widget>[
          new IconButton(
            icon: new Icon(Icons.refresh),
            onPressed: () {
              setState(() {
                this.listaCategory = buildListCategories(this.listaDB);
              });
            },
          )
        ],
      ),
      body: new ListView(
        padding: new EdgeInsets.only(top: 8.0, right: 0.0, left: 0.0),
        children: this.listaCategory
      ),
    );
  }
}

class ItemCategory extends StatelessWidget {
  final String category;

  ItemCategory({
    Key key,
    this.category}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return new Container(
      decoration: new BoxDecoration(
        border: new Border(
          top: new BorderSide(style: BorderStyle.solid, color: Colors.black26),
        ),
        color: new Color(0xFFFAFAFA),
      ),
      margin: new EdgeInsets.only(top: 0.0, bottom: 0.0),
      child: new Row(
        mainAxisAlignment: MainAxisAlignment.start,
        crossAxisAlignment: CrossAxisAlignment.center,
        children: <Widget>[
          new Expanded(
            child: new Row(
              mainAxisAlignment: MainAxisAlignment.spaceBetween,
              children: <Widget>[
                new Container(
                  margin: new EdgeInsets.only(left: 16.0),
                  padding: new EdgeInsets.only(right: 40.0, top: 4.5, bottom: 4.5),
                  child: new Row(
                    children: <Widget>[
                      new Container(
                        margin: new EdgeInsets.only(right: 16.0),
                        child: new Icon(
                          Icons.brightness_1,
                          color: Colors.black,
                          size: 35.0,
                        ),
                      ),
                      new Text(this.category),
                    ],
                  )
                )
              ],
            ),
          )
        ],
      ),
    );
  }
}

A: Since the problem is in the key, the ListView also needs a key, because when updating to another list, if each list does not have its own key the list is mounted in the wrong way.
The ListView code should look like this:
body: new ListView(
  key: new Key(randomString(20)), //new
  padding: new EdgeInsets.only(top: 8.0, right: 0.0, left: 0.0),
  children: this.listaCategory
),

By making this change the list is mounted correctly.

A: You still call buildListCategories twice if you push the button (in the setState and in the build method), but that is not the problem. Also I would not nest the methods. Apparently something goes wrong with the key. If you don't set the key everything is fine. I am not sure why that breaks the listview, but I also don't think it adds anything.
I made a gist with the fixed code: https://gist.github.com/renefloor/0fed1bbd43567b45ed2605f57ecce29f


text:
Q: Constructor TransportClient in class TransportClient cannot be accessed I wrote the following class for indexing documents in ElasticSearch:
import java.net.InetAddress
import com.typesafe.config.ConfigFactory
import org.elasticsearch.client.transport.TransportClient
import org.elasticsearch.common.settings.Settings
import org.elasticsearch.common.transport.InetSocketTransportAddress
import play.api.libs.json.{JsString, JsValue}

/**
  * Created by liana on 12/07/16.
  */
class ElasticSearchConnector {

  private var transportClient: TransportClient = null
  private val host = "localhost"
  private val port = 9300
  private val cluster = "elasticsearch"
  private val indexName = "tests"
  private val docType = "test"

  def configElasticSearch(): Unit =
  {
    val settings = Settings.settingsBuilder().put("cluster.name", cluster).build()
    transportClient = new TransportClient(settings)
    transportClient.addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName(host), port.toInt))
  }

  def putText(json: String, id: Int): String =
  {
    val response = transportClient.prepareIndex(indexName, docType, id)
                                  .setSource(json)
                                  .get()
    val responseId = response.getId
    responseId
  }
}

Then I use it as follows:
val json = """val jsonString =
{
"title": "Elastic",
"price": 2000,
"author":{
"first": "Zachary",
"last": "Tong";
}
}"""

val ec = new ElasticSearchConnector()
ec.configElasticSearch()
val id = ec.putText(json)
System.out.println(id)

This is the error message I got:

Error:(28, 23) constructor TransportClient in class TransportClient
  cannot be accessed in class ElasticSearchConnector
      transportClient = new TransportClient(settings)

What is wrong here?

A: In the Elasticsearch Connector API the TransportClient class has no public constructor, but one declared private constructor. Thus you cannot "new" up an instance of the TransportClient directly. The API utilizes the Builder Pattern fairly heavily so in order to create an instance of the TransportClient you will need to do something like:
val settings = Settings.settingsBuilder().put("cluster.name", cluster).build()
val transportClient = TransportClient.builder().settings(settings).build()
transportClient.addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName(host), port.toInt))


text:
Q: ASP.NET MVC email registration confirmation enters spam folder I am using the default ASP.NET AccountController any idea why the confirmation mail is entering spam folder in my gmail? the app is configured to send from gmail account
//
// POST: /Account/Register
[HttpPost]
[AllowAnonymous]
[ValidateAntiForgeryToken]
public async Task<ActionResult> Register(RegisterViewModel model)
{
    if (ModelState.IsValid)
    {
        var user = new ApplicationUser { UserName = model.Email, Email = model.Email };
        var result = await UserManager.CreateAsync(user, model.Password);
        if (result.Succeeded)
        {
            //  Comment the following line to prevent log in until the user is confirmed.
            //  await SignInManager.SignInAsync(user, isPersistent:false, rememberBrowser:false);

            string code = await UserManager.GenerateEmailConfirmationTokenAsync(user.Id);
            var callbackUrl = Url.Action("ConfirmEmail", "Account", new { userId = user.Id, code = code }, protocol: Request.Url.Scheme);
            await UserManager.SendEmailAsync(user.Id, "Currency Protector - Confirm your account", "Please confirm your account by clicking here");

            ViewBag.Message = "Check your email and confirm your account, you must be confirmed "
                                    + "before you can log in.";

            return View("Info");
       }
       AddErrors(result);
   }

   // If we got this far, something failed, redisplay form
       return View(model);
   }

EDIT
Here is my mail class
public class EmailService : IIdentityMessageService
{
    public Task SendAsync(IdentityMessage message)
    {
        MailMessage mail = new MailMessage();
        mail.From = new MailAddress("XXX@gmail.com");
        mail.To.Add(message.Destination);
        mail.Subject = message.Subject;
        mail.Body = message.Body;

        mail.IsBodyHtml = true;

        SmtpClient smtp = new SmtpClient("smtp.gmail.com", 587);
        smtp.EnableSsl = true;
        smtp.Credentials = new NetworkCredential("XXX@gmail.com", "PASS");

        return smtp.SendMailAsync(mail);
  }


text:
Q: Basic Symmetric Group Question Let $$σ =
\begin{pmatrix}1 &2 &3 &4 &5 &6 &7 &8 &9 &10\\
3 &4 &2 &8 &5 &7 &6 &10 &1& 9 \end{pmatrix}
$$
Find $σ^{2345}$ and express it as $σ^k$, with $k$ minimal.

A: By straightforward calculation, we see that
\begin{align*}
1&\rightarrow 3\rightarrow 2\rightarrow 4\rightarrow
8\rightarrow 10\rightarrow 9\rightarrow1&&(7\mbox{-cycle)}\\
5&\rightarrow 5&&(1\mbox{-cycle)}\\
6&\rightarrow 7\rightarrow 6&&(2\mbox{-cycle)}
\end{align*}
and thus $\sigma^{14}=\begin{pmatrix}1&2&3&4&5&6&7&8&9&10\\
1&2&3&4&5&6&7&8&9&10\end{pmatrix}=\iota$ (identity symbol). Hence we conclude that
$$\sigma^{2345}=\sigma^7\circ(\sigma^{14})^{167}
=\sigma^7\circ\iota^{167}
=\sigma^7
=\begin{pmatrix}1&2&3&4&5&6&7&8&9&10\\
1&2&3&4&5&7&6&8&9&10\end{pmatrix}$$
and $k=7$.


text:
Q: How can I create a "forEach" that returns an object that is a receiver to the consuming function? I'm trying to do something like this in a long chain of "stream" operations.
fun main(args: Array<String>) {
    "test1, test2, test3".split(", ")
            .toCustomString(StringBuilder(), StringBuilder::append)
}

fun <T, R>Iterable<T>.toCustomString(obj: R, thing: R.(T) -> Unit): R {
    this.forEach {
        obj.thing(it)
    }
    return obj
}

But this doesn't work it says none of the functions found for StringBuilder::append can't be applied here. Is there a way I can make something like this work?

A: You are trying to use a method reference with a different signature for a receiver function. You can make it work with supplying a lambda instead. Or as other answers point out, changing the signature of your receiver function.
fun main(args: Array<String>) {
    "test1, test2, test3".split(", ")
            .toCustomString(StringBuilder(), { item -> append(item) })
}

A: There's no problem to use a method reference in that case and it should work perfectly.
Just ensure you use kotlin class StringBuilder an change this:
fun <T, R>Iterable<T>.toCustomString(obj: R, thing: R.(T) -> Unit)
by this one:
fun <T, R>Iterable<T>.toCustomString(obj: R, thing: R.(T) -> R)

A: In order to use StringBuilder::append as a function reference, thing should have type R.(T) -> R instead of R.(T) -> Unit because  StringBuilder.append(String) will return StringBuilder. However, since toCustomString does not handle the return value from StringBuilder.append, what @Marko suggested is more appropriate.
FYR, here is an alternative way to do it without an extra extension function:
val customString = StringBuilder().apply {
    "test1, test2, test3"
            .split(", ")
            .forEach { this.append(it) }
}


text:
Q: Can't run my app on device anymore I'm trying to run my QML/C++ app on my Nexus 5 running Ubuntu 14.10 (r14) (ubuntu-rtm-devel) but it doesn't seem to work. I used to be able to do this without problems.
Here is an image of the devices tab in the SDK:
I have an ubuntu-sdk-14.10 armhf click chroot configured but it still says there are no kits configured for this device. When I try to click "Autocreate" I get an error dialog with the title "Unknown device architecture" and description "Kit autocreation for error is not supported!".
Although it seems it does recognize the phone's architecture as being armhf, because in the log it says:
Check device image version..
Nexus 5
aosp_hammerhead
hammerhead
14
armhf

Also at the end of the log it says:
Are developer tools installed..
0

..developer tools are not installed.

Which might be the problem. I just don't know what developer tools it is talking about.
I'm running Utopic on the desktop.
Any help is appreciated! =)

A: I followed the instructions in this answer: https://askubuntu.com/a/547905
It fixed the problem =)


text:
Q: AWS: execute script when deploying Application? I would like to use EB CLI to deploy my PHP Application to AWS ElasticBeanstalk but I am wondering if there is a way to execute additional commands, for example download dependencies and compile files, etc.
Do I need to create a script? If yes how can I do it?
Any documentation is very appreciated.
Thank you

A: In general, the idea of beanstalk is that you do all the downloading of dependencies etc yourself (ideally in a CI pipeline), create a deployable package and then hand it over to beanstalk for deployment and execution.
You may want to look into AWS CodePipeline for running scripts, building and packaging before deploying to beanstalk.


text:
Q: Why does JSON.Serialize return null when passed a value of type System.Address? Background
I'm working on a project where I'm communicating with an external billing system to create a new Account in our external billing system when a new Account is created in Salesforce.
Being a billing system, I must include both the Billing and Shipping Addresses (among other information) in the message that I send to the black box, under control of a colleague, that sits between my company's Salesforce org, and our billing system.
Me and my colleague have agreed on using a JSON formatted message for this purpose.
In exploring different methods for constructing my JSON message, I ran across an oddity.
If I query for a composite address field from the Account, either BillingAddress or ShippingAddress, and pass the resulting sObject into JSON.serialize(), the resulting JSON string will contain the expected key/value pair (with the composite address field itself getting serialized).
If I assign the composite address field to a variable of type System.Address and pass that to JSON.serialize(), or if I JSON.serialize(account.BillingAddress), the resulting JSON string is null.
Further, if I have an Apex class which contains a member variable of type System.Address, JSON serialization will work as expected until I populate the System.Address member variable.
Some code to reproduce this behavior
public class ExternalAccount{
    public String name;
    public Address billing_address;

    public ExternalAccount(String inputName, Address inputAddress){
        name = inputName;
        billing_address = inputAddress;
    }
}

Account acct = [SELECT Id, Name, BillingAddress FROM Account WHERE BillingStreet != null LIMIT 1][0];
ExternalAccount eaWorks = new ExternalAccount(acct.Name, null);
ExternalAccount eaFails = new ExternalAccount(acct.Name, acct.BillingAddress);

system.debug('Serializing sObject directly: ' + JSON.serialize(acct));
system.debug('Serializing BillingAddress directly: ' + JSON.serialize(acct.BillingAddress));
system.debug('Serializing Apex class, null address: ' + JSON.serialize(eaWorks));
system.debug('Serializing Apex class, populated address: ' + JSON.serialize(eaFails));

My question
Why does the JSON class completely croak on being handed System.Address outside of an sObject?

A: If you have access to support, I'd try raising this as a support case to see if it can be handled as a bug.
Failing that, or an official answer from Salesforce, I'd say it is an oversight based on how System.Address was intended to be used. From the Address Compound Fields documentation (my emphasis):

Standard addresses—addresses built into standard objects in Salesforce—are accessible in the SOAP and REST APIs as an Address, a structured compound data type, as well as individual address elements.

I interpret this to mean the System.Address compound type was never intended to be used outside the read only context on an sObject. You can't use it to perform DML, so there wasn't any reason to support it outside of SOQL queries against an sObject.
It appears that you've found an area where that assumption doesn't hold true with JSON serialization. So, try raising it with Salesforce as a bug.
In the short term you could also create your own Address class to hold the required fields. Then use that for serialization. It could include a constructor for the standard System.Address type.


text:
Q: Sensitivity, Specificity and Misclassification rate I stumble upon a problem that I'm sure someone else already had.
Assume you have:

*

*A cohort, composed of 10 healthy subjects and 100 diseased subjects.

*A model M such that M(patient) = diseased. In other words, each patient is classified as diseased.

At this point we can compute:

*

*Specificity = (TN=100) / (N=100) = 1

*Sensitivity = (TP=0) / (P=10) = 0

Till here everything looks fine: the model poorly represents the reality, and the sensitivity captures this fact.
However, the misclassification rate is 0.09, which usually is not that bad.
This bias comes from the small healthy control sample size.
Is there a way to correct this bias, so that the misclassification rate can represent how inaccurate this model actually is?

A: There is no bias concerning the misclassification rate, it just measures what it's supposed to measure. As you indicate, misclassification rate or accuracy can be a very misleading measure, especially if the distribution of the classes are unbalanced.
Here are some links about common measures to assess prediction quality:
http://webdocs.cs.ualberta.ca/~eisner/measures.html
http://en.wikipedia.org/wiki/Receiver_operating_characteristic

A: Most of your problem comes from the fact that these measures are discontinuous improper accuracy scoring rules.  If you stick with assessing the continuous calibration curve of continuous risk predictions these problems diminish.


text:
Q: How to assign a user friendly email address to a document library I have a document library which is configured for inbound emails. The current email address assigned is List@SharepointServername.
I need to somehow map a generic email ID (say abcd@mycompany.com) to this list so that when I send out a mail to abcd@mycompany.com it goes in the document library.
Any help/pointers will be appreciated.

A: I am not the email expert, and this might sound like a dummy solution, but I would configure a rule in your email server to forward every email from abcd@mycompany.com to abcd@sharepoint.
SharePoint can also read emails from Dump folder, so if you can "dump" your emails from your email server to a folder on SharePoint server in EML format that would could also work.
UPDATE: For both approaches the email (To) must be the same as specified in Document Library settings. Otherwise it will not be imported to Document Library. (by Alex)


text:
Q: Database sql count wins and loses I have table like this:
home  | away  | home_round_1 | away_round_1 | home_round_2 | away_round_2
team1   team2       20              10             5             -2
team3   team1        1               2             -11            4
team2   team3       20              -1             -1            10

I'm trying to figure out how to calculate wins, loses, evens and average game result group by teams. Game result sit counted as home round 1 + round 2 or away round 1 + round 2 and winner is team that has less points in the end. I have made counter that count certain teams average in mysql with cases but is it possible to count all this inside mysql, that it will count values by team.
So far I have manage to count team avrage with this:
SELECT
      AVG(
          CASE
              WHEN home = "team1" THEN home_round_1 + home_round_2
              WHEN away = "team1" THEN away_round_1 + away_round_2
              ELSE NULL
         END
        ) AS 'Avrage_points'
    FROM
      `Game_results`


text:
Q: Why is creating a MSSQL(Express) database with Entity Framework so slow? We are developing a WPF application which can manage multiple clients. For each client we need a separate database (within the same SQL Server instance). So we need a "create database" more than once. All individual client-databases will have all the same database structure.
We use Entity Framework Version 6.1.3, code-first and a local installation of SQL Server 2014 Express. In our "real" business-application a new database with about 60 tables is created properly, but the performance is not so good.
Trying to isolate the problem I wrote a small sample program which creates 5 databases in a loop, 1 table per database. On my Dev-PC (Windows 10, i7-6700 3.40GHz, 16 GB RAM) the executiontime for those 5 databases is about 1 minute  (11-12 secs for each database). When I debug the application, I see that there is a long wait on the line
dbContext.Database.CreateIfNotExists();

In SQL Server Profiler I see that it takes about 10 seconds per loop until the first entry arrives.
Any idea's where the time is lost? Or other suggestions for creating many databases (> 20) with the same DbContext in Entity Framework?
Here the source-code of my sample application:.
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
using System;

namespace TestEnityFramework01.Model
{
    [Table("Table01")]
    public class Table01        {
        [Key]
        [Column("ID", Order = 0, TypeName = "int")]
        public int ID { get; set; }

        [Column("Number01", TypeName = "int")]
        public int Number01 { get; set; }

        [Column("Date01")]
        public DateTime? Date01 { get; set; }

        [StringLength(50)]
        [Column("Text01", TypeName = "nvarchar")]
        public string Text01 { get; set; }

        [Column("Amount01")]
        public decimal Amount01 { get; set; }

        [Column("Doule01")]
        public double Doule01 { get; set; }

        [Column("Bool01")]
        public bool Bool01 { get; set; }
    }
}

And the context:
using TestEnityFramework01.Model;
using System.Data.Entity;

namespace TestEnityFramework01.Context
{
    class ContextA : DbContext
    {
    public DbSet<Table01> Tabel01 { get; set; }

    public ContextA()
        : base("ContextA")
    {
        // Don't create database automatically
        Database.SetInitializer<ContextA>(null);
    }

    public ContextA(string pConnectionString)
            : base(pConnectionString)
        {
            // Don't create database automatically
            Database.SetInitializer<ContextA>(null);

            this.Configuration.AutoDetectChangesEnabled = false;
            this.Configuration.LazyLoadingEnabled = false;
            this.Configuration.ValidateOnSaveEnabled = false;
        }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            base.OnModelCreating(modelBuilder);
        }
    }
}

The test program produces in a loop five databases:
private void button_Click(object sender, RoutedEventArgs e)
{
    int _randomNumber = 0;

    for (int i = 1; i <= 5; i++)
    {
        // create random number between 1 and 100'000
        _randomNumber = new Random().Next(1, 100000);

        // concat the random number to the database name
        string _databaseName = "DatabaseCustomer" + _randomNumber.ToString();

           // the connection-string look like this:
           // "Data Source=MyPC\SQLEXPRESS;Initial Catalog=MyDatabaseName;User ID=MyUser;Password=MyPassword;Integrated Security=False;MultipleActiveResultSets=True;"
        string  _connectionString = GetConnectionString(_databaseName);

        using (var dbContext = new ContextA(_connectionString))
        {
            // create the database
            dbContext.Database.CreateIfNotExists();
        }
    }
}

**** UPDATE 16.06.2016****
When I switch the DB connection from SQL-Server 2014 Express to "SQL Server Compact Edition", the creationtime for all 5 databases is about 1 or 2 seconds. Could it be that i use a wrong connectionstring to connect with the sql-server or my SQL-Server 2014 Express is not configured properly?

A: This is because the code first Approach creates a new database and establishes connection with it.
I Think you should use sql query for Creating Database.
If You Want I can help you how will you do it with better UI and Functionality design
Please reply for my answer.


text:
Q: C# console application - Unhandled exception while finding the Available and free Ram space.Getting exact answer in windows forms application Unhandled exception while finding the Available and free Ram space.Getting exact answer in windows forms application while displaying details in a textbox but getting exception in console application.I've added all possible references..Not showing any error during compile time...
     using System;
     using System.Collections.Generic;
     using System.ComponentModel;
     using System.Data;
     using System.Drawing;
     using System.Linq;
     using System.Text;
     using System.Threading.Tasks;
     using System.Diagnostics;
     using System.Management;
     using Microsoft.VisualBasic.Devices;
     using System.Runtime.Caching;
     using System.Net.Mail;
     using System.Net;
     using System.Runtime.InteropServices;
     using Outlook = Microsoft.Office.Interop.Outlook;
     using Office = Microsoft.Office.Core;
     using System.Reflection;
namespace Monitoring_Application
  {
class Program
{
    static void Main(string[] args)
    {
        sysmem();
        ram();

    }

    //SYSTEM MEMORY DETAILS
    static void sysmem()
    {

        System.IO.DriveInfo sysmem1 = new System.IO.DriveInfo("c");
        System.IO.DriveInfo sysmem2 = new System.IO.DriveInfo("d");
        System.IO.DriveInfo sysmem3 = new System.IO.DriveInfo("e");
        string drivename = "Drive name : " + (sysmem1.Name).ToString();
        string drivetype = "Drive type : " + (sysmem1.DriveType).ToString();
        string driveformat ="Drive format : " + (sysmem1.DriveFormat).ToString();
        string max_space = "Maximum space (in GB) : " + ((sysmem1.TotalSize) / (float)1073741824).ToString("0.00");    //Calculates the max possible space in system
        string Available_space = "Available space (in GB) : " + ((sysmem1.AvailableFreeSpace) / (float)1073741824).ToString("0.00");  //calculates the total available free space in the system
        Console.WriteLine("{0}\n{1}\n{2}\n{3}\n{4}\n{5}\n",drivename,drivetype,driveformat,max_space,Available_space);
    }
    //SYSTEM RAM DETAILS
    static void ram()
    {
        PerformanceCounter cpuCounter;
        PerformanceCounter ramCounter;
        cpuCounter = new PerformanceCounter();
        cpuCounter.CategoryName = "Processor";
        cpuCounter.CounterName = "% Processor Time";
        cpuCounter.InstanceName = "_Total";
        ramCounter = new PerformanceCounter("Memory", "Available MBytes");
        float temp = ramCounter.NextValue() / (1024);
        string max_space = "Maximum space (GB) : " + ((new Microsoft.VisualBasic.Devices.ComputerInfo().TotalPhysicalMemory) / (float)1073741824).ToString();
        string Available_space =  "Available space (GB) : " + temp.ToString();
        Console.WriteLine("{0}\n{1}", max_space, Available_space);
    }
}

}

A: Now that you've added all your code, your error is in this line:
Console.WriteLine("{0}\n{1}\n{2}\n{3}\n{4}\n{5}\n",drivename,drivetype,driveformat,max_space,Available_space);

You have 6 parameters, and only fill 5 of them. Each parameter must have a corresponding value(0-based index for 5 values is 0-4).
See String.format and Console.WriteLine in MSDN for more info.
So that line should be:
Console.WriteLine("{0}\n{1}\n{2}\n{3}\n{4}",drivename,drivetype,driveformat,max_space,Available_space);


text:
Q: Google App Script: getActiveSheet() not working. So, first of all, this used to work perfectly, up until about a week or so ago. However, now it has stopped working and gives the following error.
Error encountered: Unknown sheet name
Any ideas. Here is the fragment of code being called.
var activeSheet = SpreadsheetApp.getActiveSheet();

Many thanks in advance for your help!

A: There is an issue on this on the issue tracker, please star it to keep track of its evolution. If your case is different (not related to Ui), then you can start a new one.


text:
Q: consulta desde java a mysql Primero hago un registro a la base de datos desde un Frame y sin salir de la aplicacion ingreso a otro Frame donde hago la consulta de los datos pero el dato que recien ingrese desde el Frame anterior no aparece, si cierro el programa y lo vuelvo a ejecutar e ingreso directo a el Frame de las consultas si me aparece el registro, este es el codigo que utilizo para hacer la consulta.
 try {
    DefaultTableModel modelo = new DefaultTableModel();
    final JTable table = new JTable(modelo);
    TableColumnModel columnModel = table.getColumnModel();

    for(int i=0;i<4;i++) {
        modelo.addColumn(columnas[i]);
    }
    columnModel.getColumn(0).setPreferredWidth(70);
    columnModel.getColumn(1).setPreferredWidth(120);
    columnModel.getColumn(2).setPreferredWidth(30);
    columnModel.getColumn(3).setPreferredWidth(30);

    DefaultTableCellRenderer tcr = new DefaultTableCellRenderer();
    tcr.setHorizontalAlignment(SwingConstants.CENTER);
    table.getColumnModel().getColumn(0).setCellRenderer(tcr);
    table.getColumnModel().getColumn(1).setCellRenderer(tcr);
    table.getColumnModel().getColumn(2).setCellRenderer(tcr);
    table.getColumnModel().getColumn(3).setCellRenderer(tcr);

    table.setPreferredScrollableViewportSize(new Dimension(400,300));
    JScrollPane scrollpane = new JScrollPane(table);

    Connection con = getConection();
    String sql = "SELECT num_control,Nombre,fecha_inicio,fecha_termino FROM alumno";
    ps = con.prepareStatement(sql);
    rs = ps.executeQuery();

    ResultSetMetaData rsMd = rs.getMetaData();
    int cantidadColumnas = rsMd.getColumnCount();

    while(rs.next()) {
        Object[] filas = new Object[cantidadColumnas];
        for(int i=0; i<cantidadColumnas;i++) {
            filas[i]=rs.getObject(i+1);
        }
        modelo.addRow(filas);
    }


text:
Q: HTTPS outbound connector in Mule with .pfx file I have a password protected .pfx file which contains a certificate & private key. I can't open that because my Client can not provide the password for it.
This certificate is needed at the destination endpoint for OAuth validation.
I have to use this in my mule HTTPS outbound connector.
I tried adding the .pfx file to Java Key Store (.jks) using Keystore Explorer, but this doesn't work because it's asking for the password, which I don't have.
So, How can I proceed with this?


text:
Q: Running Flutter on IOS Issue Below is the issue I am facing whenever I try to run my Flutter Application on IOS simulator:

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, v0.11.13, on Mac OS X 10.14 18A391, locale en-IN)
[✓] Android toolchain - develop for Android devices (Android SDK 28.0.3)
[✓] iOS toolchain - develop for iOS devices (Xcode 10.1)
[✓] Android Studio (version 3.2)
[✓] IntelliJ IDEA Community Edition (version 2018.1)
[✓] Connected device (1 available)

• No issues found!
Process finished with exit code 0

Still facing the same errors. If anyone can help with the fix.
Launching lib/main.dart on iPhone XR in debug mode...

Starting Xcode build...

Xcode build done.                                            2.7s

Failed to build iOS app

Error output from Xcode build:

↳

    ** BUILD FAILED **

Xcode's output:

↳

    /Users/kamal369/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.6.6/ios/Classes/FirebaseAuthPlugin.m:76:41: error: incompatible block pointer types sending 'void (^)(FIRAuthDataResult *__strong, NSError *__strong)' to parameter of type 'FIRAuthResultCallback _Nullable' (aka 'void (^)(FIRUser * _Nullable __strong, NSError * _Nullable __strong)')

            signInAnonymouslyWithCompletion:^(FIRAuthDataResult *dataResult, NSError *error) {

                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    In module 'FirebaseAuth' imported from /Users/kamal369/AndroidStudioProjects/tester_flutter/ios/Pods/Headers/Public/Firebase/Firebase.h:13:

    /Users/kamal369/AndroidStudioProjects/tester_flutter/ios/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRAuth.h:493:73: note: passing argument to parameter 'completion' here

    - (void)signInAnonymouslyWithCompletion:(nullable FIRAuthResultCallback)completion;

                                                                            ^

    /Users/kamal369/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.6.6/ios/Classes/FirebaseAuthPlugin.m:117:29: error: incompatible block pointer types sending 'void (^)(FIRAuthDataResult *__strong, NSError *__strong)' to parameter of type 'FIRAuthResultCallback _Nullable' (aka 'void (^)(FIRUser * _Nullable __strong, NSError * _Nullable __strong)')

                     completion:^(FIRAuthDataResult *dataResult, NSError *error) {

                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    In module 'FirebaseAuth' imported from /Users/kamal369/AndroidStudioProjects/tester_flutter/ios/Pods/Headers/Public/Firebase/Firebase.h:13:

    /Users/kamal369/AndroidStudioProjects/tester_flutter/ios/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRAuth.h:590:61: note: passing argument to parameter 'completion' here

                     completion:(nullable FIRAuthResultCallback)completion;

                                                                ^

    /Users/kamal369/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.6.6/ios/Classes/FirebaseAuthPlugin.m:154:25: error: incompatible block pointer types sending 'void (^)(FIRAuthDataResult *__strong, NSError *__strong)' to parameter of type 'FIRAuthResultCallback _Nullable' (aka 'void (^)(FIRUser * _Nullable __strong, NSError * _Nullable __strong)')

                 completion:^(FIRAuthDataResult *dataResult, NSError *error) {

                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    In module 'FirebaseAuth' imported from /Users/kamal369/AndroidStudioProjects/tester_flutter/ios/Pods/Headers/Public/Firebase/Firebase.h:13:

    /Users/kamal369/AndroidStudioProjects/tester_flutter/ios/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRAuth.h:372:57: note: passing argument to parameter 'completion' here

                 completion:(nullable FIRAuthResultCallback)completion;

                                                            ^

    /Users/kamal369/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.6.6/ios/Classes/FirebaseAuthPlugin.m:305:31: error: incompatible block pointer types sending 'void (^)(FIRAuthDataResult *__strong, NSError *__strong)' to parameter of type 'FIRAuthResultCallback _Nullable' (aka 'void (^)(FIRUser * _Nullable __strong, NSError * _Nullable __strong)')

                       completion:^(FIRAuthDataResult *dataResult, NSError *error) {

                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    In module 'FirebaseAuth' imported from /Users/kamal369/AndroidStudioProjects/tester_flutter/ios/Pods/Headers/Public/Firebase/Firebase.h:13:

    /Users/kamal369/AndroidStudioProjects/tester_flutter/ios/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRAuth.h:537:63: note: passing argument to parameter 'completion' here

                       completion:(nullable FIRAuthResultCallback)completion;

                                                                  ^

    /Users/kamal369/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.6.6/ios/Classes/FirebaseAuthPlugin.m:392:62: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]

      userData[@"lastSignInTimestamp"] = [NSNumber numberWithInt:lastSignInDate];

                                         ~                       ^~~~~~~~~~~~~~

    1 warning and 4 errors generated.

Could not build the application for the simulator.

Error launching application on iPhone XR.

A: It seems there might some kind of "out of date" problem with the Firebase pods.
For me, the solution proposed by Günter Zöchbauer worked fine: flutter clean in your project directory and pod install in ios/
There is another answer at https://github.com/flutter/flutter/issues/17721 that works for other developers, running the following commands in your project directory:
- pod repo update
- sudo gem install cocoapods

A: This could be an issue related to your flutter channel. You can try this,

*

*cd to your project location from the terminal

*Execute flutter channel. Make sure master is selected (* indicates which one is selected)

*If master is not selected, execute flutter channel master to select master

*Execute flutter clean

*Execute flutter run
This should fix the issue (at least it did for me).
Good luck!


text:
Q: Searching for unique values in dataframe and creating a table with them Since I started using R< not long ago, I've found this site very useful in helping me build my scripts. I have yet again came across a challenge for which I can't seem to find an answer anywhere. Here is my problem: In my data I have a column which contains a different URL in each row. In each of those URL's there is a particular piece of information I want to extract. Currently I do it in excel because I've been told it's impossible to do in R and that no function exists to do it.
The URL will look like this example format and it will be found in the "source" column
http://www.googleclick.com?utm_source=ADX&ID56789
http://www.googleclick.com?utm_source=ADW&ID56009
http://www.googleclick.com?utm_source=ADWords&ID53389
The part of the URL that is of importance to me is the "utm_source=ADX" bit .My data looks something like this:
User / Source
1   / http://www.googleclick.com?utm_source=ADX&ID56789
2 / http://www.googleclick.com?utm_source=ADW&ID56009
3 / http://www.googleclick.com?utm_source=ADWords&ID53389
What I need to do is to capture the utm_source from the URL and transpose the information into a different column, example below:
User / Source / utm_source
1  /  googleclick / ADX&ID56789
2 /  googleclick / ADW&ID56009
3 / googleclick / ADWords&ID53389
So in essence I need R to search in the entire dataframe for the value "utm_source=" and once it has found them, I want it to transpose the "utm_source=" value into a column name and to copy all the information that comes after "=" in a that column for each individual row. I know that "grep" is a function that locates a specific piece of information in the datafreme , for example data <- total[grepl("utm_source", total$Source), ]. This will give me all the rows that contain the word "utm_source" but what I need is the information that comes after " utm_source". Usually my data can have as many as 500.000 rows. At the moment I use the excel function "text to columns" for this, and I basically split the URL's into little bits and keep the columns that I need, but this can be a very messy and lengthy process.
Is there a way to modify the grepl function to meet the criteria I need?

A: Nothing is impossible.
x <- read.csv(text="
User, Source
1, http://www.googleclick.com?utm_source=ADX&ID56789
2, http://www.googleclick.com?utm_source=ADW&ID56009
3, http://www.googleclick.com?utm_source=ADWords&ID53389
", header=TRUE, stringsAsFactors=FALSE)

First, use strsplit
strsplit(x$Source, split="\\?utm_source=")
[[1]]
[1] " http://www.googleclick.com" "ADX&ID56789"

[[2]]
[1] " http://www.googleclick.com" "ADW&ID56009"

[[3]]
[1] " http://www.googleclick.com" "ADWords&ID53389"

Then find a red-hot poker and stick in the eye of your so-called advisor.

EDIT:
As suggested by Paul Hiemstra, you can also use a regular expression directly:
gsub(".*\\?utm_source=", "", x$Source)
[1] "ADX&ID56789"     "ADW&ID56009"     "ADWords&ID53389"

A: @Andrie's answer does the trick. Here's another way using using regmatches and gregexpr that might be useful.
d <- read.table(text="User URL
1 http://www.googleclick.com?utm_source=ADX&ID56789
2 http://www.googleclick.com?utm_source=ADW&ID56009
3 http://www.googleclick.com?utm_source=ADWords&ID53389", header=TRUE)

domain.pat <- '((?<=www.)([[:alnum:]_]+))'
source.pat <- '((?<=utm_source=)([[:alnum:]&]+))' # exclude the '&' here to only grab up to the '&'
all.matches <- gregexpr(paste(domain.pat, source.pat, sep='|'), d$URL, perl=TRUE)
all.substrings <- regmatches(d$URL, all.matches)
do.call(rbind, all.substrings)

#      [,1]          [,2]
# [1,] "googleclick" "ADX&ID56789"
# [2,] "googleclick" "ADW&ID56009"
# [3,] "googleclick" "ADWords&ID53389"


text:
Q: Get checkbox value of datagrid column? I have a datagrid in my web application with a checkbox in it using itemrenderer. How can i get the value of checkbox?

A: Since itemRenderers can be recycled when a DataGrid is scrolled, you should tie the value of the checkbox to a value in your dataProvider. Then you can loop through the ArrayCollection and get all of the rows where Selected==true
My data object:
package
{
  [Bindable]
  public class MyData
  {
    private var _name:String;
    private var _selected:Boolean;

    public function get Name():String { return _name; }
    public function set Name(value:String):void { _name = value; }

    public function get Selected():Boolean { return _selected; }
    public function set Selected(value:Boolean):void { _selected = value; }

  }
}

My DataGrid:
<mx:DataGrid dataProvider="{myArrayCollectionOfMyDataObjects}">
  <mx:columns>
    <mx:DataGridColumn headerText="Name" dataField="Name"/>
    <mx:DataGridColumn headerText="Selected" dataField="Selected">
      <mx:itemRenderer>
        <fx:Component>
          <mx:VBox width="100%" height="100%" paddingLeft="2" verticalAlign="middle" horizontalAlign="center" horizontalScrollPolicy="off">
            <mx:CheckBox id="chkSelected" change="{data.Selected = chkSelected.selected}" selected="{data.Selected}" />
          </mx:VBox>
        </fx:Component>
      </mx:itemRenderer>
    </mx:DataGridColumn>
  </mx:columns>
</mx:DataGrid>

A: This is an example:
If (CType(row.FindControl("chkEmailAlert"), CheckBox).Checked = True) Then
    Arr_EmailAlert(i) = "True"
Else
    Arr_EmailAlert(i) = "False"
End If

like this one more Class, called DirectCast will be there and by using the FindControl method we can find the id of the Control checkBox and the value also to use it.


text:
Q: jQuery auto expanding textareas acting strange I have tried various different jQuery autogrow/expand text area plugins, and they all work good and well on the demo page but for some reason whenever I implement them into my existing site, they act very strange, this is what is happening:
It works great, if you're manually typing in text and hitting enter after every line, however, if I copy and paste a large block of text in, for some reason it consistently chops about 30% off the end, and it's simply cut off, no scroll bar, just cut off.
Even if i refresh the page (with the text staying in there) it still cuts it off.  I'm guessing some JS/CSS is conflicting but I have no clue what it could be!

A: *

*Which plugins have you tried so far?

*If you use Firebug, try and monitor the textarea for changes. See what it does to the value and the height of the textarea

*Set the height of the textarea to 1000px and see if it can handle the 'copy/paste' and show you the whole thing.


text:
Q: What's the point in making a .jar out of everything? I recently ran over a bootstrap.jar. For me bootstrap is only a css / js library and I include it as such. Now following questions came up:

*

*What is the point of a .jar file there?

*Aren't .jar just for Java files?

*Why would I want a .jar of a JavaScript library?

I've also seen other examples of .jar files where I wouldn't expect them.  I'm most likely to see them in some artifactory.

Edit: Looking into the .jar with WinZip: It is the bootstrap css / js framework. inside a folder called webjars.

A: See http://www.webjars.org/
The advantages of these jars containing client-side javascript and css code include:

*

*Explicitly and easily manage the client-side dependencies in    JVM-based web applications

*Use JVM-based build tools (e.g. Maven, Gradle, sbt, ...) to download    your client-side dependencies

*Know which client-side dependencies you are using

*Transitive dependencies are automatically resolved and optionally    loaded via RequireJS


text:
Q: Error in jquery.js file in chrome extension project I have this strange error.
I am developing a chrome extension using 'chrome dev editor'. The project is using jQuery. It was working fine but after I open the jquery.js file it shows errors like

missing semicolon
  missing () invoking a constructor

The project cannot be loaded because of this.
I have not done any modification in the jquery.js file. It was dowloaded from 'http://jquery.com/download/'.
Here is my manifest.json
{
  "manifest_version": 2,
  "name": "TextExtn",
  "short_name": "TextExtn",
  "description": "",
  "version": "0.0.1",
  "minimum_chrome_version": "38",

  "browser_action": {
   "default_icon": "images/icon.png",
   "default_popup": "html/popup.html"
  },

  "permissions": [
   "activeTab"
   ],

  "content_scripts": [
    {
      "matches": ["<all_urls>"],
      "js": [ "scripts/jquery-1.12.0.js","scripts/welcome.js"
        ]
    }
]

}


text:
Q: json parsing in javascript with dynamic key in loop Here is my json format
dropdownvalues":[{"ddv0":"57###Cool White###0###","ddv1":"59###Warm White###0###"}]}]

i want to parse ddv0,ddv1,ddv2...so on.
alert(dropdownvalues[j].ddv0);// That is working fine
But I want to parse like
for( var i=0;i<=obj.length;i++)
{
   var key="ddv"+i;
   alert(dropdownvalues[].key); // That is giving undefined
}

A: for( var i=0;i<=obj.length;i++)
{
   var key="ddv"+i;
   alert(dropdownvalues[i].key); // include index in array to choose object
}

Adding explanation from my comment below:
An array is an indexed list of items (in this case objects). In order to access the item at index i you need to pass the index into the array - dropdownvalues[i].

A: Use the associative array notation:
var key = 'ddv' + j;
alert(dropdownvalues[j][key]);


text:
Q: HomeKit simulator: Adding human readable description to custom service characteristic I have added a custom characteristic to a service using the HomeKit Simulator. However when I add it, despite I include the manufactorer description, a UUID is shown instead of the description.
How can I display the description instead?
The first characteristic is a standard one ("On/Off": boolean). The other ones are custom.

A: Until now the HomeKit Accessory Simulator (1.1) cannot be configured to show manufacturer description, as you want to.
At least in version 1.1 custom services can be attached and achieve a corresponding name, that the developer is able to distinguish. Characteristics can still not be named and remains a UUID mess. But as far as I know, this version (1.1) is only rolled out to MFi participants.

A: You can add a manufacturer description to the characteristic.

Then after you add it will show like this

In your app, you can check first if there is a manufacturer description like this
let manufacturerDescription = characteristic.metadata?.manufacturerDescription


text:
Q: I want to make href tag dynamic and value will be populated and i have ejs template Sample code snippet:
index.ejs

<a href="<%=link%>" class="btn btn-primary" role="button">Download

app.js
var express = require('express'); var router = express.Router();

router.get('/', function(req, res, next) {
    res.render('index', {link:'http://download1588.mediafireuserdownload.com/**c5cq****rb2a/***.jpg'});
});

how to get this link as href tag value so that i can download from this link.

A: Here is the way you would do that with ejs:
index.ejs

<a href="<%= link %>" class="btn btn-primary" role="button">Download

app.js
res.render('index.ejs', { link: "<your link here>" });

Hope this helps!

A: Here is a way it worked for me.
General example:
<a href="somepath/<%= someVariable %>">Read More

Example from my project:
<a href="/post/<%= post.titleTxt %>">


text:
Q: Программа не видит validation.properties Вместо того что бы выводилось значение свойства, выводится просто текст, который я вписываю. Я пытался обойти эту проблему, вписывая значение ошибки напрямую (без properties файла), но после этого значения еще указывается имя переменной, к которой крепится ошибка

@Component
public class UserValidator implements Validator {
@Autowired
private UserService userService;

@Override
public boolean supports(Class<?> aClass) {
    return User.class.equals(aClass);
}

@Override
public void validate(Object o, Errors errors) {
    User user = (User) o;

    ValidationUtils.rejectIfEmptyOrWhitespace(errors, "login", "NotEmpty");
    if (user.getLogin().length() < 6 || user.getLogin().length() > 32) {
        errors.rejectValue("login", "Size.userForm.login");
    }
    if (userService.findByUsername(user.getLogin()) != null) {
        errors.rejectValue("login", "Duplicate.userForm.login");
    }

    ValidationUtils.rejectIfEmptyOrWhitespace(errors, "password",
"NotEmpty");
    if (user.getPassword().length() < 8 || user.getPassword().length() > 32)
{
        errors.rejectValue("password", "Size.userForm.password");
    }

    if (!user.getPasswordConfirm().equals(user.getPassword())) {
        errors.rejectValue("passwordConfirm",
"Diff.userForm.passwordConfirm");

    }
}
}

application.properties:
NotEmpty=This field is required.
Size.userForm.login=Please use between 6 and 32 characters.
Duplicate.userForm.login=Someone already has that username.
Size.userForm.password=Try one with at least 8 characters.
Diff.userForm.passwordConfirm=These passwords don't match.

jsp:
<form:form method="POST" modelAttribute="userForm" class="form-signin">

Create your account

    <spring:bind path="login">

            <form:input type="text" path="login" class="form-control"
placeholder="Login"
                        autofocus="true"></form:input>
            <form:errors path="login"></form:errors>

    </spring:bind>

    <spring:bind path="password">

            <form:input type="password" path="password" class="form-control"
placeholder="Password"></form:input>
            <form:errors path="password"></form:errors>

    </spring:bind>

    <spring:bind path="passwordConfirm">

            <form:input type="password" path="passwordConfirm" class="form-
control"
                        placeholder="Confirm your password"></form:input>
            <form:errors path="passwordConfirm"></form:errors>

    </spring:bind>

    <button class="btn btn-lg btn-primary btn-block"
type="submit">Submit</button>
</form:form>

A: файл application.properties должен находиться \src\main\resources\application.properties


text:
Q: Installing requirements.txt using pip returns "numpy" module error I was setting up a program using python. I think some modules are missing. Can someone help me correct the dependencies? I'm currently using python3.11 on Windows 10.
I tried to run pip install -r requirements.txt but it returns this error:
I used (...) to shorten the error.
Collecting websockets==8.1
  Using cached websockets-8.1.tar.gz (58 kB)
  Preparing metadata (setup.py) ... done
Collecting tqdm==4.31.1
  Using cached tqdm-4.31.1-py2.py3-none-any.whl (48 kB)
Collecting pandas==1.1.2
  Using cached pandas-1.1.2.tar.gz (5.2 MB)
  Installing build dependencies ... error
  error: subprocess-exited-with-error

  × pip subprocess to install build dependencies did not run successfully.
  │ exit code: 1
  ╰─> [315 lines of output]
      Ignoring numpy: markers 'python_version == "3.6" and platform_system != "AIX"' don't match your environment
      Ignoring numpy: markers 'python_version == "3.7" and platform_system != "AIX"' don't match your environment
      Ignoring numpy: markers 'python_version == "3.6" and platform_system == "AIX"' don't match your environment
      Ignoring numpy: markers 'python_version == "3.7" and platform_system == "AIX"' don't match your environment
      Ignoring numpy: markers 'python_version >= "3.8" and platform_system == "AIX"' don't match your environment
      Collecting setuptools
        Using cached setuptools-65.5.1-py3-none-any.whl (1.2 MB)
      Collecting wheel
        Using cached wheel-0.38.2-py3-none-any.whl (36 kB)
      Collecting Cython<3,>=0.29.16
        Using cached Cython-0.29.32-py2.py3-none-any.whl (986 kB)
      Collecting numpy==1.17.3
        Using cached numpy-1.17.3.zip (6.4 MB)
        Preparing metadata (setup.py): started
        Preparing metadata (setup.py): finished with status 'done'
      Installing collected packages: wheel, setuptools, numpy, Cython
        DEPRECATION: numpy is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559
        Running setup.py install for numpy: started
        Running setup.py install for numpy: finished with status 'error'
        error: subprocess-exited-with-error

        Running setup.py install for numpy did not run successfully.
        exit code: 1

        [279 lines of output]
        Running from numpy source directory.

        Note: if you need reliable uninstall behavior, then install
        with pip instead of using `setup.py install`:

          - `pip install .`       (from a git repo or downloaded source
                                   release)
          - `pip install numpy`   (last NumPy release on PyPi)

        blas_opt_info:
        blas_mkl_info:
        No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
        customize MSVCCompiler
          libraries mkl_rt not found in ['C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python311\\lib', 'C:\\', 'C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python311\\libs']
          NOT AVAILABLE

        blis_info:
        No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
        customize MSVCCompiler
          libraries blis not found in ['C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python311\\lib', 'C:\\', 'C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python311\\libs']
          NOT AVAILABLE

        openblas_info:
        No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
        customize MSVCCompiler
        No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
        customize MSVCCompiler
          libraries openblas not found in ['C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python311\\lib', 'C:\\', 'C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python311\\libs']
        get_default_fcompiler: matching types: '['gnu', 'intelv', 'absoft', 'compaqv', 'intelev', 'gnu95', 'g95', 'intelvem', 'intelem', 'flang']'
        customize GnuFCompiler
        Could not locate executable g77
        Could not locate executable f77
        customize IntelVisualFCompiler
(...)
        atlas_3_10_blas_threads_info:
        Setting PTATLAS=ATLAS
        No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
        customize MSVCCompiler
          libraries tatlas not found in ['C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python311\\lib', 'C:\\', 'C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python311\\libs']
          NOT AVAILABLE
(...)

  × pip subprocess to install build dependencies did not run successfully.
  │ exit code: 1
  ╰─> [315 lines of output]
      Ignoring numpy: markers 'python_version == "3.6" and platform_system != "AIX"' don't match your environment
      Ignoring numpy: markers 'python_version == "3.7" and platform_system != "AIX"' don't match your environment
      Ignoring numpy: markers 'python_version == "3.6" and platform_system == "AIX"' don't match your environment
      Ignoring numpy: markers 'python_version == "3.7" and platform_system == "AIX"' don't match your environment
      Ignoring numpy: markers 'python_version >= "3.8" and platform_system == "AIX"' don't match your environment
      Collecting setuptools
        Using cached setuptools-65.5.1-py3-none-any.whl (1.2 MB)
      Collecting wheel
        Using cached wheel-0.38.2-py3-none-any.whl (36 kB)
      Collecting Cython<3,>=0.29.16
        Using cached Cython-0.29.32-py2.py3-none-any.whl (986 kB)
      Collecting numpy==1.17.3
        Using cached numpy-1.17.3.zip (6.4 MB)
        Preparing metadata (setup.py): started
        Preparing metadata (setup.py): finished with status 'done'
      Installing collected packages: wheel, setuptools, numpy, Cython
        DEPRECATION: numpy is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559
        Running setup.py install for numpy: started
        Running setup.py install for numpy: finished with status 'error'
        error: subprocess-exited-with-error

        Running setup.py install for numpy did not run successfully.
        exit code: 1

        [279 lines of output]
        Running from numpy source directory.

        Note: if you need reliable uninstall behavior, then install
        with pip instead of using `setup.py install`:

          - `pip install .`       (from a git repo or downloaded source
                                   release)
          - `pip install numpy`   (last NumPy release on PyPi)

        blas_opt_info:
        blas_mkl_info:
        No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
        customize MSVCCompiler
          libraries mkl_rt not found in ['C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python311\\lib', 'C:\\', 'C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python311\\libs']
          NOT AVAILABLE

        blis_info:
        No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
        customize MSVCCompiler
          libraries blis not found in ['C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python311\\lib', 'C:\\', 'C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python311\\libs']
          NOT AVAILABLE

        openblas_info:
        No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
        customize MSVCCompiler
        No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
        customize MSVCCompiler
          libraries openblas not found in ['C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python311\\lib', 'C:\\', 'C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python311\\libs']
        get_default_fcompiler: matching types: '['gnu', 'intelv', 'absoft', 'compaqv', 'intelev', 'gnu95', 'g95', 'intelvem', 'intelem', 'flang']'
        customize GnuFCompiler
        Could not locate executable g77
        Could not locate executable f77
        customize IntelVisualFCompiler
(...)
        C:\Users\user\AppData\Local\Temp\pip-install-q6qg404u\numpy_4eb1db888ba3499b83b89bb3bed687e2\numpy\distutils\system_info.py:690: UserWarning:
            Blas (http://www.netlib.org/blas/) libraries not found.
            Directories to search for the libraries can be specified in the
            numpy/distutils/site.cfg file (section [blas]) or by setting
            the BLAS environment variable.
          self.calc_info()
        blas_src_info:
          NOT AVAILABLE

        openblas_lapack_info:
        No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
        customize MSVCCompiler
        No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
        customize MSVCCompiler
          libraries openblas not found in ['C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python311\\lib', 'C:\\', 'C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python311\\libs']
          NOT AVAILABLE

(...)

        C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\site-packages\setuptools\_distutils\dist.py:264: UserWarning: Unknown distribution option: 'define_macros'
          warnings.warn(msg)
        running install
        C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
          warnings.warn(
        running build
        running config_cc
        unifing config_cc, config, build_clib, build_ext, build commands --compiler options
        running config_fc
        unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
        running build_src
        build_src
        building py_modules sources
        creating build
        creating build\src.win-amd64-3.1
        creating build\src.win-amd64-3.1\numpy
        creating build\src.win-amd64-3.1\numpy\distutils
        building library "npymath" sources
        No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
        error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
        [end of output]

        note: This error originates from a subprocess, and is likely not a problem with pip.
      error: legacy-install-failure

      Encountered error while trying to install package.

      numpy

      note: This is an issue with the package mentioned above, not pip.
      hint: See above for output from the failure.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.


text:
Q: How to pass multiple data from fragment to Activity I am trying to make a listView onItemClickItem to detail view.  The list comes up by using a custom adapter
Here is my Fragment for list
    import android.app.Fragment;
    import android.content.Intent;
    import android.os.Bundle;
    import android.view.LayoutInflater;
    import android.view.View;
    import android.view.ViewGroup;
    import android.widget.AdapterView;
    import android.widget.ListView;
    import android.widget.Toast;

    import com.rupomkhondaker.sonalibank.adapter.PhoneListAdapter;
    import com.rupomkhondaker.sonalibank.model.ContactItem;
    import java.io.Serializable;
    import java.util.ArrayList;

    public class GMOFragment extends Fragment {
        public GMOFragment(){}

        private ArrayList<ContactItem> phoneItems;
        private PhoneListAdapter adapters;

        @Override
        public View onCreateView(LayoutInflater inflater, ViewGroup container,
                                 Bundle savedInstanceState) {

     View rootView = inflater.inflate(R.layout.fragment_gmo, container, false);

            final ArrayList<ContactItem> listData = getListData();

            final ListView listView = (ListView) rootView.findViewById(R.id.gmolistView);
            listView.setAdapter(new PhoneListAdapter(getActivity(), listData));

            listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {

                @Override
                public void onItemClick(AdapterView<?> a, View v, int position, long id) {
                    ContactItem newsData = (ContactItem) listView.getItemAtPosition(position);

   String names = (String) listView.getItemAtPosition(position);
   String phones = (String) listView.getItemAtPosition(position);
   String mobiles = (String) listView.getItemAtPosition(position);
   String emails = (String) listView.getItemAtPosition(position);

   Intent intent = new Intent(getActivity(), ContactDetail.class);

intent.putExtra("key", names);
intent.putExtra("key2", phones);
intent.putExtra("key3", mobiles);
intent.putExtra("key4", emails);

Toast.makeText(getActivity(), "Selected :" + " " + newsData, Toast.LENGTH_LONG).show();

  startActivity(intent);
 }

});

            return rootView;
        }

      private ArrayList<ContactItem> getListData() {
            ArrayList<ContactItem> listMockData = new ArrayList<ContactItem>();
            String[] names = getResources().getStringArray(R.array.gmo_name_list);
            String[] phones = getResources().getStringArray(R.array.gmo_ph_list);
            String[] mobiles = getResources().getStringArray(R.array.gmo_mob_list);
            String[] emails = getResources().getStringArray(R.array.gmo_email_list);

            for (int i = 0; i < names.length; i++) {
                ContactItem newsData = new ContactItem();
                newsData.setName(names[i]);
                newsData.setPhone(phones[i]);
                newsData.setMobile(mobiles[i]);
                newsData.setEmail(emails[i]);
                listMockData.add(newsData);
            }
            return listMockData;
        }

    }

If I try only the Toast it show a Toast with data same like Image
but when I am trying to show/pass those data to a new activity it show error

ContactDetail.java
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.widget.TextView;

public class ContactDetail extends FragmentActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);
        this.setContentView(R.layout.view_contact);

        TextView txtName = (TextView) findViewById(R.id.conName);
        TextView txtPhone = (TextView) findViewById(R.id.conPhone);
        TextView txtMobile = (TextView) findViewById(R.id.conMobile);
        TextView txtEmail = (TextView) findViewById(R.id.conEmail);

        Intent i = getIntent();
        // getting attached intent data

        // getting attached intent data
        String name =i.getStringExtra("key");
        String phone = i.getStringExtra("key2");
        String mobile = i.getStringExtra("key3");
        String email = i.getStringExtra("key4");

        // displaying selected contact name
        txtName.setText(name);
        txtPhone.setText(phone);
        txtMobile.setText(mobile);
        txtEmail.setText(email);

    }

}

Here is the log
09-27 19:05:21.762      629-629/? E/AndroidRuntime﹕ FATAL EXCEPTION: main
    java.lang.ClassCastException: com.rupomkhondaker.sonalibank.model.ContactItem cannot be cast to java.lang.String
            at com.rupomkhondaker.sonalibank.GMOFragment$1.onItemClick(GMOFragment.java:49)
            at android.widget.AdapterView.performItemClick(AdapterView.java:298)
            at android.widget.AbsListView.performItemClick(AbsListView.java:1086)
            at android.widget.AbsListView$PerformClick.run(AbsListView.java:2859)
            at android.widget.AbsListView$1.run(AbsListView.java:3533)
            at android.os.Handler.handleCallback(Handler.java:615)
            at android.os.Handler.dispatchMessage(Handler.java:92)
            at android.os.Looper.loop(Looper.java:137)
            at android.app.ActivityThread.main(ActivityThread.java:4745)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:511)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
            at dalvik.system.NativeStart.main(Native Method)
09-27 19:05:21.782      150-517/? W/ActivityManager﹕ Force finishing activity com.rupomkhondaker.sonalibank/.MainActivity
09-27 19:05:21.892      150-517/? D/dalvikvm﹕ GC_FOR_ALLOC freed 93K, 10% free 11568K/12807K, paused 58ms, total 63ms

A: The problem occurs here:
String names = (String) listView.getItemAtPosition(position);

The method getItemAtPosition() returns an Object, namely the object that was stored at the position in the adapter. In your case, the dynamic type of this object is ContactItem. To retrieve the name, you can use something like this (assuming you have implemented a getter for the name field):
String names = (String) listView.getItemAtPosition(position).getName();

It would be better, however, to just put the whole ContactItem in the intent. That requires that ContactItem is serializable. Then your code would become:
@Override
public void onItemClick(AdapterView<?> a, View v, int position, long id) {
    ContactItem newsData = (ContactItem) listView.getItemAtPosition(position);

    Intent intent = new Intent(getActivity(), ContactDetail.class);

    intent.putExtra("key", newsData);

    Toast.makeText(getActivity(), "Selected :" + " " + newsData, Toast.LENGTH_LONG).show();

    startActivity(intent);
}

And in the ContactDetail class you can retrieve all the fields of the ContactItem:
@Override
protected void onCreate(Bundle savedInstanceState) {

    super.onCreate(savedInstanceState);
    this.setContentView(R.layout.view_contact);

    TextView txtName = (TextView) findViewById(R.id.conName);
    TextView txtPhone = (TextView) findViewById(R.id.conPhone);
    TextView txtMobile = (TextView) findViewById(R.id.conMobile);
    TextView txtEmail = (TextView) findViewById(R.id.conEmail);

    Intent i = getIntent();
    Bundle b = i.getExtras();

    // getting attached intent data
    ContactItem contact = (ContactItem) b.getSerializable("key");

    // displaying selected contact name
    txtName.setText(contact.getName());
    txtPhone.setText(contact.getPhone());
    txtMobile.setText(contact.getMobile());
    txtEmail.setText(contact.getEmail());

}


text:
Q: Git cannot push folder part of another git project I just updated elephant.io in my project with composer, and I am trying to push it to remote, but when I do that git seems to see elephant.io directory as a file and it does not push it?
is this a bug? I am using git 1.7.11 on bitbucket.
EDIT
Probably is not the dot the problem but something else. Doing :
git ls-files --stage | grep 160000

I get
160000 8e151a58e931c87ef1b7d2d2124f5b8d79637d1e 0   vendor/wisembly/elephant.io

**EDIT 2: Solution **
The final problem was that I was including the vendor folder in the git, and the error comes from the packagest that comes with their .git configuration. Ignoring vendor folder solves the problem.
Thank you both to Sven and Vonc

A: Since elephant.io is a submodule with a special entry 160000 8e151a58e931c87ef1b7d2d2124f5b8d79637d1e, you need to make sure that:

*

*you have added, committed and push any modification done in elephant.io
  cd vendor/wisembly/elephant.io
  git add .
  git commit -m "my modifs to elephant.io"
  git push

*then you would go back to the parent repo, add and commit the new special entry SHA1:
 cd ..
 git add .
 git commit -m "new revision of elephant.io"
 git push

But that only works if you have the right to push back to elephant.io (or you shouldn't make any modification in it, or at least your submodule should reference a fork of elephant.io that you own).
In any case, to be clear, elephant.io being "not" pushed has nothing to do with the fact it has a dot in its name.
As suggested by Sven, since composer takes care of the dependencies, you could simply ignore the vendor folder. That will make those submodules invisible from the parent repo.

A: If you are using Composer, and there is no special requirement for you to include the dependencies in your own repository, I'd think it is a good idea to follow the suggestion of the Composer developers to NOT include the vendor folder in your own repository, but only add and commit the composer.lock file.
Add the line vendor/ to your .gitignore file in the topmost directory, and you are basically done.
More info: https://getcomposer.org/doc/faqs/should-i-commit-the-dependencies-in-my-vendor-directory.md


text:
Q: How to add the onfocus event to custom created control in jquery? I have a custom created combobox control created using jquery library, where I have textbox wrapped over dropdown control, so that everytime when I use want to use this combobox control, I actually call its object. Now I want to hook the onfocus function of the usual textbox to this custom control. So how could I do this? Relevant answers are appreciated & welcome from my bottom heart!

A: Please check the demo
http://jsfiddle.net/z2y6T/

<input type="text" /> focus fire

<input type="password" /> focus fire

jQuery Focus

Bind an event handler to the "focus" JavaScript event, or trigger that
  event on an element

More Info :http://api.jquery.com/focus/


text:
Q: SQL Select rows and delete/update from dynamic multiple tables I need some help with an sql statemen.
I have different schemas and same table names.
With the following select i can get all the tables:
select name from sys.tables where QUOTENAME(name) = '[Table_1]'

Now i want to loop through all the tables, and have some similar query to this:
delete from tablename where condition1 > condition2

How can i achieve this?

A: Try this
declare @count int, @i  int = 1, @sql nvarchar(max), @tablename varchar(1000)

select @count = count(*) from sys.tables where QUOTENAME(name) = '[Table_1]'

create table #temp(id int identity(1,1), table varchar(1000))
insert into #temp
select name from sys.tables where QUOTENAME(name) = '[Table_1]'

while(@i<=@count)
begin
   select @tablename = (select table from #temp where id = @i)
   set @sql = 'delete from '+@tablename+' where condition1>condition2'
   execute sp_executesql @sql
   set @i = @i+1
end


text:
Q: Unterminated String error moving JSON object from server to client (VB.NET) I'm attempting to use NewtonSoft.JSON for .NET to serialize an object so I can pass that data to the client, I have the following classes that store the data on the server side:
Public Class BankAccountPaymentProfile
    Public Property BankAccountProfileID As String
    Public Property AccountNumber As String
    Public Property AccountType As String
    Public Property RoutingNumber As String
    Public Property BankName As String
    Public Property NameOnAccount As String
    Public Property BillTo As New BillToProfile
End Class

Public Class BillToProfile
    Public Property billTofirstName As String = ""
    Public Property billTolastName As String = ""
    Public Property BillToaddress As String = ""
    Public Property billTocity As String = ""
    Public Property billTostate As String = ""
    Public Property billTozip As String = ""
    Public Property billTophoneNumber As String = ""
    Public Property billToemail As String = ""
End Class

In the code behind I instanciate the classes and populate the data and then serialize it with this line of code:
Profiles = JsonConvert.SerializeObject(BankAccountProfile, Formatting.Indented)

On the client side I have this jQuery Function which I call in (document).ready to get the data to the client side:
    function GetProfileList() {
        $.ajax({
            type: "POST",
            contentType: "application/json",
            data: '{object:[<%=Profiles%>]}',
            url: "Subscription.aspx/MyProfiles",
            dataType: "json",
            success: function (data) {
                alert("Success");
            },
            error: function (XMLHttpRequest, textStatus, errorThrown) {
                alert("Failed");
                debugger;
            }
        });
    };

I get an error "Unterminated String" in the client browser, the data showing on the client side in the debugger is:
'{object:[{
  "BankAccountProfileID": "1503460396",
  "AccountNumber": "XXXX7620",
  "AccountType": "0",
  "RoutingNumber": "XXXX0010",
  "BankName": "Bank Of AHoles",
  "NameOnAccount": "Firstname Lastname",
  "BillTo": {
    "billTofirstName": "",
    "billTolastName": "",
    "BillToaddress": "",
    "billTocity": "",
    "billTostate": "",
    "billTozip": "",
    "billTophoneNumber": "",
    "billToemail": ""
  }
}]}'

I thought maybe it was because I had an object nested in a object so I removed the BillTo object, same error.  The data is obviously getting to the client, but for the error, I see nothing wrong with the string.  What am I missing?

A: Seems like I over complicated things, all I needed to do was get the serialized string back to the client, an ajax call was unnecessary.
In (document).ready:
// Creates an object of profiles contained in the JSON string
var = var Profiles = $(<%=Profiles%>);
var = accountprofileid = Profiles.accountprofileid;

... etc ...
Done ....