text:
Q: Getting Limit error while plotting Contour I entered this
contour(theta0_vals, theta1_vals , J_vals,logspace(-2,3,20));

Octave showed me this error.
error: axis: LIMITS(1) must be less than LIMITS(2)
error: called from
axis>__axis__ at line 313 column 9
axis at line 155 column 7
__contour__ at line 198 column 5
contour at line 74 column 16

A: The contour function calculates contours and then creates a figure to display them.
When it creates the figure, it attempts to set the axis limits automatically from the minimum and maximum values of the grid in each dimension (this happens at line 198 of contour.m, as per the reported error).
If the size of the grid in a particular dimension is singular, then the minimum and maximum are the same number, which results in an error when trying to display this, since you cannot specify an axis width of 0 for a plot or surface.
Observe:
>> [X, Y] = ndgrid(0, -5:5);  % X results in a 1x11 vector
>> contour(X,Y,Y)
error: axis: LIMITS(1) must be less than LIMITS(2)
error: called from
    axis>__axis__ at line 313 column 9
    axis at line 155 column 7
    __contour__ at line 198 column 5
    contour at line 74 column 16

So your theta0_vals or theta1_vals variables are either scalars or singular in one dimension. This makes no sense for use as a grid anyway so either this is the result of a but, or if this was intended behaviour you will probably have to rethink what you're doing here.


text:
Q: C# XML Element Count in XML Node I need to get the count of EmpList Tag in Particular <EmpTypeHeader> and <EID>.
For example:
EID - 9991515720640 with 1st EmpTypeHeader(XML Node) tag Contains 2 EmpList Tag
EID - 4534545454534 with 2nd EmpTypeHeader(XML Node) tag Contains 1 EmpList Tag
EID - 8998653323    with 3rd EmpTypeHeader(XML Node) tag Contains 1 EmpList Tag

But when I select EMPList Tag count it shows a total Count of 4.
My XML:
<Employee>
    <EmployeeHeader>
        <Date>2016-01-07</Date>
        <Time>03:45:39</Time>
    </EmployeeHeader>
    <EmpTypeHeader>
        <EID>9991515720640</EID>
        <AAA>4</AAA>
        <BBB />
        <EmpList>
            <CCC>222</CCC>
            <DDD>3333</DDD>
            <EEE>2050-09-25</EEE>
            <FFF>000</FFF>
        </EmpList>
        <EmpList>
            <CCC>555</CCC>
            <DDD>666</DDD>
            <EEE>2050-09-25</EEE>
            <FFF>000</FFF>
        </EmpList>
    </EmpTypeHeader>
    <EmpTypeHeader>
        <EID>4534545454534</EID>
        <AAA>66</AAA>
        <BBB />
        <EmpList>
            <CCC>999</CCC>
            <DDD>008</DDD>
            <EEE>2050-09-25</EEE>
            <FFF>000</FFF>
        </EmpList>
    </EmpTypeHeader>
    <EmpTypeHeader>
        <EID>8998653323</EID>
        <AAA>9999</AAA>
        <BBB />
        <EmpList>
            <CCC>11333334</CCC>
            <DDD>663312</DDD>
            <EEE>2050-09-25</EEE>
            <FFF>000</FFF>
        </EmpList>
    </EmpTypeHeader>
</Employee>

And my code:
private void ReadXMLEmp()
{
    string eid = "9991515720640";
    string strFileName = @"D:\Raseeth\Test1.xml";
    xmlDocument = new XmlDocument();

    xmlDocument.Load(strFileName);
    xmlNodeListEmpTypeHeader = xmlDocument.SelectNodes("//EmpTypeHeader");
    if (xmlNodeListEmpTypeHeader != null)
    {
        int empListCount = 0;

        foreach (XmlNode xmlNodeEmpTypeHeader in xmlNodeListEmpTypeHeader)
        {
            if (xmlNodeEmpTypeHeader["EID"] != null && xmlNodeEmpTypeHeader["EID"].InnerText.Trim() == eid)
            {
                empListCount = xmlNodeEmpTypeHeader.SelectNodes("//Position").Count;
                Console.WriteLine("EmpList Count : " + empListCount);
                bFlag = true;
                break;
            }
        }
    }
}

A: The issue is your XPath expression.  //Position will find all nodes in the document with that name, whereas you are only interested in descendants from the current node.
Change this to .//Position - the . refers to the current node context.
Having said this, LINQ to XML is a far cleaner solution that XPath and the old XmlDocument API, for example:
var count = XDocument.Load("path/to/file.xml")
    .Descendants("EmpTypeHeader")
    .Where(x => (string) x.Element("EID") == "9991515720640")
    .Descendants("Position")
    .Count();

A: If you can use .Net 3.5
XElement root = XElement.Load(strFileName);
int total = 0;
foreach(var eid in root.Descendants("EID").ToList())
{
   int count = eid.Parent.Elements("EmpList").Count();
   Console.WriteLine(eid.Value + " " + count.ToString());
   total += count;
}
Console.WriteLine("Total EmpList's: " + total.ToString());

I'm not really understanding the question. Did you want a total count of EmpList's or a count of EmpList's by EID? I did both.

redpajama_set_name: RedPajamaStackExchange


text:
Q: Вопрос по циклу for Каким образом производится проверка на истинность j<=(i/j) , ведь по условию выходит, что j всегда будет больше. Например j=2  ; (i/j)=(2/2)=1 --->>>  Выходит 2<=1? Объясните.
int main ()
{
    int i , j ;
    for ( i= 2 ; i<1000 ; i++ )
    {
        for (j =2 ;j<=(i/j) ; j++)
            if (!(i%j)) break ;

        if(j > (i/j)) cout << i<< endl;
    }

A: Ну возьмите 100 и 2 :) Правда, 2 < 100/2?
Это по сути проверка j*j <= i. Зачем ее написали именно в таком виде - с делением - непонятно...


text:
Q: TCP Holepunch implementation I'm working on an idea of mine which is comparable to a home automation system.
The layout of network devices would be like this:

What I want is for my Mobile Phone App to be able to communicate with the home server at all times, but also for the server to be able to reach my phone (Push-notifications).
For this I thought it would be a good idea to implement TCP-Holepunching using my server in the datacenter as the center for traffic.
The problem is though, Since my Java skills aren't good enough yet, I'm forced to write my server in the PHP scripting language, but PHP isn't capable of keeping sockets active.
Is there TCP-holepunching server software (executable in Debian) available which would be able to keep the sockets alive and push any commands from my server towards the correct destination (ie: phone) and vice versa?

A: There are ways to get sockets working in PHP. One library that does this can be found here:
http://socketo.me/
Also an easy way of setting a server like this up can be done with NodeJS. You code your server in JavaScript (run on Google Chrome's V8 Engine) and then you can handle persistent connections based on events.
It should be possible (with NodeJS) to code a relay server (relaying from your phone to your home PC and vice versa) with only a few lines of code.


text:
Q: Nested design with pairing I have been asked to help a colleague with analysing the following experimental design.
2 treatments (fixed), 5 time points (fixed) with 4 animals (random) at each time point. The animals within each time point are not the same.
Each animal had two samples taken, one from a treated limb and one from an untreated limb so within each time point the samples from each animal are paired.
I would like to analyse this data as a nested ANOVA in R. The formula I have currently is:
value ~ treatment + time/individual
Testing the measured value for the treatment at each time with individual nested within time. This doesn't account for the paired nature of the samples though. Also this is the first example of a nested design I've been asked to analyse and I wonder if someone could advise me as to whether I'm on the right path.

A: Based on what you have described, I would use the mixed model:
Value = intercept + treatment + time + treatment*time + individal + e
Where treatment, time and their interaction are fixed effects and individual is a random effect.
The way to formulate this model depends on the package you are using.  If you are using lme() in package {nlme} then you can fit this model with:
lme(fixed = value ~ treatment * time, data = my.data ,  random = ~ 1 | individual)

Where my.data is the data.frame containing treatment, time and individual as factor variables and value as a numeric variable.  This formulation is short form; it's actually the same as:
lme(fixed = value ~ 1 + treatment + time + treatment:time, data = my.data, random = ~ 1 | individual)

which corresponds more directly to the model above.  Make sure that your data.frame is ordered correctly and is univariate (vertical).
This model has two variance parameters: one for the variance explained by individual animals and one for the residual error.  If you want to estimate individual animal variance at each time then you could use a model like:
lme(fixed = value ~ treatment * time, data = my.data, random = ~ time | individual)

but this might be over-parameterized for your data set and you might have convergence issues and the final hessian might not be positive definite.


text:
Q: I'm running out of disk space on my Exchange 2007 server, what are my short term options? The volume that has the Exchange 2007 databases on has less than 10GB left out of 250GB. I can't move over to another server just yet and there is no spare capacity in the server for additional disks.
Do I have any short term options I can run without much disruption? Compact the database maybe? Any powershell commands to magically shrink the db? Thanks
PS I've already set some policies to clean up old mail but these don't appear to have made any difference.
Thanks
S

A: It's doubtful that the database is taking up all that much disk space. What's the size of the edb file(s)? It's more likely that you have a large number of transaction logs that haven't been flushed. My recommendation would be to perform a full backup of Exchange using an Exchange aware backup program that can flush the transaction logs after the backup completes.

A: First I would check is that you regurlarly do Exchange backups, as this will flush out your transaction logs, freeing valuable space.
Apart from that, as long as your Exchange database is running database maintenance regularly, it will free up space itself.
You can also use the export-mailbox cmdlet to copy parts of user's mailboxes (say, items older than two years for instance) to pst files. I wouldn't do this without some end user communication first, though.

A: There are no "magical" commands to shrink the database. The database file (EDB) will only shrink if you perform an offline degfragmentation, and even then it won't shrink unless the database had white-space (free space) in the file to begin with.
Assuming you are doing backups with an Exchange-aware backup, your database doesn't have any significant quantity of white space in it, and the database file really is approaching 250GB, there's not a lot that you can do other than add storage or get users to delete a sufficient quantity of items (and perform a backup so that those items are actually flushed from the store) in order to create white space in the database file to arrest the growth of the database file. (You can find your white space by looking for event ID 1221 in your Application Log, from event source "MSExchangeIS Mailbox Store").
My guess lies with the other posters' answers, though. You're probably building up database transaction logs (do you see many, many gigabytes of ".LOG" files in your Exchange database directory-- \Program Files\Microsoft\Exchange Server\Mailbox, by default) and you're not doing proper backups. If you're not using an Exchange aware backup you're likely not going to be able to recover your server in the event of a fault condition, and you're going to have disk space exhaustion like you're seeing.
(It is theoretically possible to enable circular logging for a storage group and stop transaction log growth, as well, but you're sacraficing recovery capabilities if you do that.)

A: Our run after the basics already outlined is to identify the biggest mail users and have them export their old email to a .pst archive...usually there's a small number of users taking up a huge amount of space. Seems to help with buying time.

A: Short term, get an external SCSI enclosure that is 500GB+ with your preferred disk setup and move your databases there.


text:
Q: Javascript recursive data structure definition I need to define a data structure recursively in Javascript. Here is a simple example of a circular linked list:
// List a very simplified example of what the actual (non list) code does.
function List(f, r) {
    return function(){ return [f, r]; };
}

var first = function (l){ return l()[0]; }
var rest = function (l){ return l()[1]; }

var head = List('a', List('b', List('c', head)));

When this is executed, head in List 'c' is resolved to undefined, not List 'a' as I need. List is an example function that returns a function (It is not an Javascript list that I can append to).
I tried to wrap the definition of head is a self executing named function, but that blew the stack when head was resolved.
What is the Javascript style solution that I am overlooking?

Attempt
Fooling around, I came up with some code that may work:
var f = function(){
    var value;
    return function(v){
        if (value === undefined)
            value = v
        return value.apply(undefined, arguments);
    };
};

var tempHead = f();
var head = List('a', List('b', List('c', tempHead)));
tempHead(head);

first(head); // a
first(rest(head)) // b
first(rest(rest(head))) // c
first(rest(rest(rest(head)))) // a
first(rest(rest(rest(rest(head))))) // b
...

But this is really ugly. Any better solutions?

Solution
user1689607 came up with a good solution which I have encapsulated to hide some of the implementation:
var def = function(name, impl) {
    var value;
    return value = impl.apply(Object.defineProperty({}, name, {
       'value': function() { return value.apply(this, arguments); }
    }));
};

function List(f, r) {
    return function(){ return [f, r]; };
}

function first(l){ return l()[0]; }
function rest(l){ return l()[1]; }

var circle = def('head', function() {
    return List('a', List('b', List('c', this.head)));
});

first(circle); // 'a'
first(rest(circle)); // 'b'
first(rest(rest(circle))); // 'c'
first(rest(rest(rest(circle)))); // 'a'
first(rest(rest(rest(rest(circle))))); // 'b'

One more update, I ended up going with passing the self reference explicitly instead of changing the scope:
var def = function(impl) {
    var value;
    return (value = impl(function() { return value.apply(this, arguments); }));
};

var circle = def(function(self) {
    return List('a', List('b', List('c', self)));
});

This code is used in parse.js.

A: This is what you want?
var headCaller = function() { return head.apply(this, arguments); };

var head = List('a', List('b', List('c', headCaller)));

It gives the result you seem to want...
DEMO: http://jsfiddle.net/ruNY3/
var results = [
    first(head), // a
    first(rest(head)), // b
    first(rest(rest(head))), // c
    first(rest(rest(rest(head)))), // a
    first(rest(rest(rest(rest(head))))) // b
];

[
    "a",
    "b",
    "c",
    "a",
    "b"
]

A: When you give head in parameter, it's not yet assigned.
You need to use two steps.
Also, there is no need to use nested functions.
function List(f, r) {
    return { value: f, next: r};
}

var head = List('a', List('b', List('c', null)));
head.next.next.next.next = head;

In Javascript, there are no pointer, but all Array or Object are assigned by reference.

EDIT:
A solution for make it simpler:
function List(f) {
    var list = { value: f, next: null };
    list.next = list;
    return list;
}

function insert(list, elm) {
    list.next = { next: list.next, value: elm };
}

function forward(list, nb) {
    for (var current = list; nb > 0; nb--)
        current = current.next;
    return current;
}

var head = List('a');
insert(head, 'b');
insert(head.next, 'c');

console.log(head.value); //a
console.log(head.next.value); //b
console.log(head.value); //c

console.log(forward(head, 3));//a

A: I am not sure if this is what you want, check it:
function List(f, r) {
    var fr = [f, r];
    var func = function() {
        return fr;
    };
    func.fr = fr; // because that is a reference we can trick it
    return func;
}

var head = List('a', List('b', List('c', null)));
head.fr[1].fr[1].fr[1] = head; // make a loop

Added: a function to do it more easily
// Or this method for lazy people
function createCircularList(f) {
    var head = List(f[f.length - 1], null);
    var firstfr = head.fr;
    for (var i = f.length - 2; i >= 0; i--) {
        head = List(f[i], head);
    }
    firstfr[1] = head;
    return head;
}

var head = createCircularList(['a', 'b', 'c']);

Demo: http://jsfiddle.net/alvinhochun/5nmpR/
In JavaScript, things are interesting. Everything is references, yet the reference itself is a value.
var a = [0, 0];    // `a` is set to the reference of `[0, 0]`
var b = a;         // `b` refers to the same thing as `a`
console.log(b[0]); // shows 0
a[0] = 1;          // it modifies the object that it references to
console.log(b[0]); // shows 1
a = [2, 0];        // a new reference is assigned to `a`
console.log(b[0]); // still shows 1


text:
Q: Default Wordpress widgets always appear I added only 3 Widgets to my sidebar, however when I set their visibility to hidden in post pages they disappear but ALL the default widgets appear. I want to remove the default widgets from appearing because I don't want any widgets on my post page. Here is the code that makes all the default widgets appear.

    <?php get_search_form(); ?>

<?php _e( 'Pages', 'alkane' ); ?>

<?php wp_list_pages('title_li='); ?>

<?php _e( 'Categories', 'alkane' ); ?>

<?php wp_list_categories('title_li='); ?>

<?php _e( 'Archives', 'alkane' ); ?>

<?php wp_get_archives('type=monthly'); ?>

<?php _e( 'Calendar', 'alkane' ); ?>

    <?php get_calendar(); ?>

<?php _e( 'Recent Posts', 'alkane' ); ?>

<?php wp_get_archives('type=postbypost&limit=5'); ?>

<?php _e( 'Tag Cloud', 'alkane' ); ?>

    <?php wp_tag_cloud('smallest=10&largest=20&number=30&unit=px&format=flat&orderby=name'); ?>

<?php _e( 'About Alkane', 'alkane' ); ?>

<?php printf( __( '%s', 'alkane' ), $alkane_theme_data['Description'] ); ?>

<?php _e( 'Blogroll', 'alkane' ); ?>

<?php wp_list_bookmarks('title_li=&categorize=0'); ?>

<?php _e( 'Meta', 'alkane' ); ?>

        <?php wp_register(); ?>

<?php wp_loginout(); ?>

<a href="<?php bloginfo( 'rss2_url' ); ?>" title="Syndicate this site using RSS 2.0">Entries RSS

<a href="<?php bloginfo( 'comments_rss2_url' ); ?>" title="The latest comments to all posts in RSS">Comments RSS

WordPress.org

        <?php wp_meta(); ?>

A: I have deleted the lines of code I mentioned above and only left the remaining code in sidebar.php. The problem was they were hard coded so they appear if visibility is set to hidden to the sidebar widgets.


text:
Q: Is this a valid topology? Let $X$ be any set, and $A \subset X$.
Is
$\tau = \{ X , \emptyset , A,A^{c} \}$, a topology on $X$?
And if so, would it also constitute a $\sigma$-algebra consisting of only open sets?
Edit:
Furthermore, if $\tau = \{X,\emptyset,A_{1},A,_{2},\dots\}$ such that $A_{i} \cap A_{j} = \emptyset$ for all $i \neq j$ and $\cup_{n} A_{n} = X$, would the aboves still hold true?

A: The first topology is indeed a topology, since any intersection of open sets is open and finite unions are again open. It does contain $X$ and $\emptyset$, so it does form a topology.
The second, however, does not necessarily define a topology: as it is stated, finite unions of elements $A_1...A_k$ for some $k$ do not look like they are necessarily open as well. In order to make it a topology you need to define more properties regarding the sets $A_i$.
Yes, the first one is also a $\sigma$-algebra since it is a finite-element topology closed under complement operation; however, for the same reason above, the second may not be.


text:
Q: I can't catch the value of the checkbox input I have a React form where I can't control the value of the checkbox input with the useState hook. I don't have this problem with other inputs.
I can't pass the checkbox input value to the AuthData object. When you click the "Sign in" button, the console should display an AuthData object with the fields { login: '', password: '', isRemember: '' }
import React from 'react'
import { useState } from 'react'

export const AuthForm = ({ handlers }) => {
  const [authData, setAuthData] = useState({ login: '', password: '', isRemember: '' })

  const changeValue = (event) => {
    const { id, value } = event.target
    setAuthData((prevAuthData) => ({ ...prevAuthData, [id]: value }))
  }

  const signIn = () => {
    console.log(authData)
  }

  return (
    <form onSubmit={(e) => e.preventDefault()}>
      <input
        type="text"
        id="login"
        placeholder="Login/E-mail/Phone"
        value={authData.login}
        onChange={changeValue}
      />
      <input
        type="password"
        id="password"
        placeholder="Password"
        value={authData.password}
        onChange={changeValue}
      />
      <input
        type="checkbox"
        id="isRemember"
        value={authData.isRemember}
        onChange={changeValue}
      />
      <button onClick={signIn}>Sign in</button>
    </form>
  )
}

When you change inputs values, their values must be passed to the authValue object.
With "login" and "password" inputs their values go into the authValue object, but with "isRemember" input this does not work. The value of checkbox inputs somehow does not get into the authValue object.

A: You have to use the checked attribute on the checkbox input.
The value attribute is used, but you'll have to modify it to ensure it sends true or false to the state object
I've added a snippet in response to your comment.

const {useState} = React

const AuthForm = ({ handlers }) => {
  const [authData, setAuthData] = useState({ login: '', password: '', isRemember: false })

  const changeValue = (event) => {
    const { id, value } = event.target
    setAuthData((prevAuthData) => ({ ...prevAuthData, [id]: value }))
  }

  const changeCheckbox = () => {
    setAuthData((prevAuthData) => ({ ...prevAuthData, isRemember: !prevAuthData.isRemember }))
  }

  const signIn = () => {
    console.log(authData)
  }

  console.log(authData);

  return (
    <form onSubmit={(e) => e.preventDefault()}>
      <input
        type="text"
        id="login"
        placeholder="Login/E-mail/Phone"
        value={authData.login}
        onChange={changeValue}
      />
      <input
        type="password"
        id="password"
        placeholder="Password"
        value={authData.password}
        onChange={changeValue}
      />
      <input
        type="checkbox"
        id="isRemember"
        checked={authData.isRemember}
        onChange={changeCheckbox}
      />
      <button onClick={signIn}>Sign in</button>
    </form>
  )
}

// Render it
ReactDOM.createRoot(
    document.getElementById("root")
).render(
    <AuthForm />
);

A: you can check the input type and get the checked value for checkbox from the event object as below
const changeValue = (event) => {
  let { id, value, type, checked="" } = event.target;
  if (type === "checkbox") {
    value = checked;
  }
  setAuthData((prevAuthData) => ({ ...prevAuthData, [id]: value }));
};


text:
Q: Call WebApi method using Ajax I wrote a WebApi project that get firstname and lastname as a input parameter and return all the info. I use RestShop to call the webApi and return data. This is working and is returning but for some reason I have to use Ajax call to call the api. I can't get the Ajax call working. I have used different links in this website but it return me empty data and error. it retuen empty for both alerts:  alert(FirstName); and at the end retues [object][object] error.
This is the RestShop that is working:
 public List<Data> GetData(string FirstName, string LastName)
    {
        RestClient _client = new RestClient();
        string _url = "http://localhost:51142";
        _client = new RestClient(_url);

        //DocGen/Documents/GetByFLName/TERRI/TIMMERMAN
        var request = new RestRequest("Gen/Doc/GetByFLName/{FirstName}/{LastName}", Method.GET) { RequestFormat = DataFormat.Json };
        request.AddParameter("FirstName", FirstName, ParameterType.UrlSegment);
        request.AddParameter("LastName", LastName, ParameterType.UrlSegment);

        var response = _client.Execute<List<Data>>(request);
        if (response.Data == null)
            throw new Exception(response.ErrorMessage);

        return response.Data;

    }

This is Ajax code to call same method ans it returns , [object][object] error.
function GetEmployee() {
    jQuery.support.cors = true;
    var FirstName = $('#FirstName').val();
    alert(FirstName);
    var LastName = $('#LastName').val();
    alert(LastName);
    $.ajax({
        url: 'http://localhost:51142/Gen/Doc/GetByFLName/'+ '/' + FirstName + LastName,
        type: 'GET',
        dataType: 'json',
        success: function (data) {
                            alert(data);
        },
        error: function (x, y, z) {
            alert(x + '\n' + y + '\n' + z);
        }
    });
}

and this is textboxes:
First Name:
   @Html.TextBox("FirstName")

  Last Name:
  @Html.TextBox("LastName")

and this is my method in webApi:
    public IHttpActionResult GetByFLName(string id1, string id2)
    {

        DAL.DataManager dal = new DAL.DataManager();
        CMSIGateway gateway = new CMSIGateway();
        gateway = dal.Get_CM_BY_FLName(id1, id2);

        if (gateway == null)
        {
            return NotFound();
        }

        return Ok(gateway);
    }

A: ur putting incorrect parameter to the url it should be like this
 url: 'http://localhost:51142/Gen/Doc/GetByFLName?id1=' + FirstName + "&id2=" +LastName


text:
Q: Android Studio, Google Maps Search Button is not working i worte an Android Application with google Maps integration.
I found a tutorial in youtube and did it in that way like in the video to search a location with button click.
I have just simple plaintext and a button for search. The Button is set to the onclick method onSearch() you can find code bellow.
When i press on that button, the app is crashing. What is wrong in the Code??
Thank you in advance:
public void onSearch(View v){

        //Textfield in google maps activity
        EditText location_tf=(EditText) findViewById(R.id.TFadress);
        //Put the written input into a string to work with
        String location = location_tf.getText().toString();

        //List for Geocoder
        List<Address> addressList= null;

        if(location!= null || !location.equals("")){
            Geocoder geocoder = new Geocoder(this);
            try {
                addressList=geocoder.getFromLocationName(location,1);
            } catch (IOException e) {
                e.printStackTrace();
            }
            Address address = addressList.get(0);
            LatLng latLng= new LatLng(address.getLatitude(), address.getLongitude());
            mMap.addMarker(new MarkerOptions().position(latLng).title("Searched Location"));

            //MovetheCamera to the searched location with 18 zoom
            mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(latLng, 18));
        }

}

Error Log:
08-18 13:25:36.182 2619-2619/com.group6.travlhoe E/AndroidRuntime: FATAL EXCEPTION: main
                                                                   Process: com.group6.travlhoe, PID: 2619
                                                                   java.lang.IllegalStateException: Could not execute method for android:onClick
                                                                       at android.view.View$DeclaredOnClickListener.onClick(View.java:5336)
                                                                       at android.view.View.performClick(View.java:6256)
                                                                       at android.view.View$PerformClick.run(View.java:24697)
                                                                       at android.os.Handler.handleCallback(Handler.java:789)
                                                                       at android.os.Handler.dispatchMessage(Handler.java:98)
                                                                       at android.os.Looper.loop(Looper.java:164)
                                                                       at android.app.ActivityThread.main(ActivityThread.java:6541)
                                                                       at java.lang.reflect.Method.invoke(Native Method)
                                                                       at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
                                                                       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
                                                                    Caused by: java.lang.reflect.InvocationTargetException
                                                                       at java.lang.reflect.Method.invoke(Native Method)
                                                                       at android.view.View$DeclaredOnClickListener.onClick(View.java:5331)
                                                                       at android.view.View.performClick(View.java:6256)
                                                                       at android.view.View$PerformClick.run(View.java:24697)
                                                                       at android.os.Handler.handleCallback(Handler.java:789)
                                                                       at android.os.Handler.dispatchMessage(Handler.java:98)
                                                                       at android.os.Looper.loop(Looper.java:164)
                                                                       at android.app.ActivityThread.main(ActivityThread.java:6541)
                                                                       at java.lang.reflect.Method.invoke(Native Method)
                                                                       at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
                                                                       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
                                                                    Caused by: java.lang.NullPointerException: Attempt to invoke interface method 'java.lang.Object java.util.List.get(int)' on a null object reference
                                                                       at com.group6.TakeOff.MapsActivity.onMapSearch(MapsActivity.java:84)
                                                                       at java.lang.reflect.Method.invoke(Native Method)
                                                                       at android.view.View$DeclaredOnClickListener.onClick(View.java:5331)
                                                                       at android.view.View.performClick(View.java:6256)
                                                                       at android.view.View$PerformClick.run(View.java:24697)
                                                                       at android.os.Handler.handleCallback(Handler.java:789)
                                                                       at android.os.Handler.dispatchMessage(Handler.java:98)
                                                                       at android.os.Looper.loop(Looper.java:164)
                                                                       at android.app.ActivityThread.main(ActivityThread.java:6541)
                                                                       at java.lang.reflect.Method.invoke(Native Method)
                                                                       at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
                                                                       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)


text:
Q: Microsoft Visual Studio Professional 2015 Setup Blocked This shows up when i run setup http://i.imgur.com/9NjtusJ.jpg i've tried running it as administrator but same error appears. Any help?

A: Have you tried following what the error says and installing KB 2919355 from the link? Looks like you need to install that before it will allow the installation further.


text:
Q: Testing Boolean in Actionscript for null I have a Boolean variable in Actionscript 3.
How can I check if it's undefined (not by being false) because false is a value or Boolean in Actionscript is FALSE by default >

A: In ActionScript, Boolean can have either true or false value only. If you don't specify any value, it is initialized to false by default.
Edit: This behavior is different from Java's Boolean object type which is a wrapper over primitive boolean. See @Victor's comments below

A: If you want a Boolean that can be undefined (essentially a tri-state flag), you can use an Object reference, but just assign the Boolean values true and false to it. Downside is that you lose the type safety.
var isSet:Object = null;
// Later...
isSet = true;


text:
Q: Compiling pascal programs with FPC and then running them, all in Notepad++ Here's my problem
I've been searching for a while now on how to compile a pascal program in notepad, then immediately running it after a successful compile.
So far, I've managed just to find a compile script for NppExec, which goes like this :
PATH_TO_FPC\ppc386.exe "$(FULL_CURRENT_PATH)"

I've tried combining this script with another script for compiling and running C/C++ programs in notepad++

cmd /K DPATH-TO-FPC\ppc386.exe
  "$(FULL_CURRENT_PATH)" -o
  "$(CURRENT_DIRECTORY)\$(NAME_PART).exe"

but I always get a message, when I try to run it.

"Error: Illegal parameter: -o"

So I was wondering if anyone can help me with this, or post a complete solution if they know on a topic.
Thank You in advance.

A: Try to append -o with your output executable file. Which will be like this:
-o"$(CURRENT_DIRECTORY)\$(NAME_PART).exe"


text:
Q: Does $\tan\left(\frac{5\pi}{4}-\alpha\right)=\tan\left(\frac{\pi}{4}-\alpha\right)$ hold for any angle, or only when $\pi/4-\alpha$ is acute? I often find this in math problems, but authors don't make it clear if $\alpha$ needs to be an acute angle or not, so I am confused a little bit. I thought we can only do this kind of transformation if we know that $\frac{\pi}{4}-\alpha$ is less than $\frac{\pi}{2}$. So, my question is why is this true for any angle (if it is)?
$$\tan\left(\frac{5\pi}{4}-\alpha\right)=\tan\left(\frac{\pi}{4}-\alpha\right)$$

A: You can write $\dfrac{5\pi}{4}$ as $\pi+\dfrac\pi4$.
Thus, $\tan(\dfrac{5\pi}{4}-\alpha) = \tan(\pi+\dfrac\pi4-\alpha) = \tan(\dfrac\pi4-\alpha)$
Because for any $\alpha$
 ; $\quad$$\tan(\pi+\alpha ) = \tan(\alpha)$ .
This is also true for $\cot(\pi+\alpha)$ as both.
EDIT :
When you have $\frac\pi2\pm\alpha $ or $\frac{3\pi}2\pm \alpha$
$\cos \to \sin$
$\tan \to \cot$
$\sec \to \csc$
and vice versa.ie if you have $\cos(\frac\pi2- \frac\pi4) $ it becomes $\sin(\frac\pi4)$
You might find it useful to learn this.

Depending on where your angle lies you should change the sign.
Edit: A full list of this type of identity for the non-hyperbolic trigonometric functions can be found here.

A: The formula for tangent of sum is
$$ \tan(x+y)= \frac {\tan x + \tan y}{1- \tan x \tan y}$$
We know that $\tan \pi =0$
Let $x=\pi$ and $y=\pi /4 - \alpha $
You get $$ \tan(\dfrac{5\pi}{4}-\alpha) = \tan(\dfrac\pi4-\alpha)$$


text:
Q: How to utilize Xcode project & target to manage products? At first, hopefully following terms project and product won't be confused.
Traditionally, we used to have a code base, which usually was a main project. For our products, we created one project for each product, and these projects surly depended on main project (code base). When product was released, we created release branch for archive and maintenance.
Now I'm developing iOS applications, and I noticed there were specific terms for Xcode, project and target, which were similar to project and product. At first look, it's more easier to share configuration between products, to simplify product releases by taking advantage of target and target dependencies. Compared with traditional way, on the other hand, it's more difficult to manage source code, to branch, etc, if number of products goes really large.
In practice, is anyone efficiently using this Xcode built-in structure to manage code and products?
I'm quite new at iOS & Xcode and looking for good advice, thanks.

A: It sounds like you're talking about using Xcode to build a Software Product Line kind of a configuration. I've done something like this before with respect to white-labelling a product - so there were no code changes between products, just different resources.
My approach would be to define a different target for each product - whether they're in the same project or not is up to you. Xcode handles dependencies across different projects quite well, so you could easily define multiple projects that state their dependencies, and use xcconfig files[*] to maintain configuration details that must be the same across all targets. It's easiest to do that from a version control perspective, to reduce the chance that people working on different products will need to edit the same project file.
Put the code that goes into all products into its own (static library) target, and include that target as a dependency of the other targets. Similarly if there are resources that are shared across all projects, create a "bundle" target that includes those shared resources.
[*] An xcconfig file is a plain text file containing Xcode build settings. If more than one of your projects contains targets that should use the same build settings, you can base those targets all on the same .xcconfig file so the settings are defined in the same place.

A: The targets within a single project file are usually strongly related. For example, if you have a product that collects data and which has several related components, DataCollector, DataCollectorAdministrator, and DataCollectorLibrary, those components might all be targets in the same project. Furthermore, you might also have targets in that project for things like unit tests and even documentation.
You probably wouldn't have a target for a mostly unrelated product, BaseballStatsGuru, in your DataCollector project. You'd use a different project file for that, because it's really a whole different product, even though it uses DataCollectorLib as one of it's components. Even though it's a different project, you still want BaseballStatsGuru to be rebuilt whenever DataCollectorLib changes, so it always uses the latest code. That's fine -- you can add the DataCollector project to the BaseballStatsGuru project as a dependency.
There's even a special type of target called 'Aggregate':

Aggregate takes this a step further: an aggregate target doesn't have a product of it's own -- it only exists so that it can be dependent on other build targets. When you build an aggregate target, it causes all the targets that it depends on to be built (if they're not already up to date). So, you could create a single uber-project that includes all your other projects as sub projects and depends on them. The target of that project would simply be an aggregate target that depends on the targets of all its sub projects. Using a system like this gives you the ability to build a whole series of products with a single command.
Note that this isn't exactly novel -- you can do the same thing with makefiles if you want to.

In practice, is anyone efficiently using this Xcode built-in structure
  to manage code and products?

Sure. Both the ability to have different targets and to create dependencies between targets are very important. I'm not sure how to characterize the level of "efficiency," but you can bet that having Xcode manage the dependencies is a lot easier and more reliable than trying to do it by hand.


text:
Q: SVN SSL handshake failed: SSL error: bad packet length We are getting the following error with SVN and Maven. We use maven release plugin to create a tag in svn
svn: OPTIONS of 'https://XXXXXXXXX/trunk': SSL handshake failed: SSL error: bad packet length
maven command use is buildnumber:create build-helper:parse-version  release:prepare release:perform
Any thoughts on this SSL issue?

A: Since the Apache Maven will use the svn client which is installed in our OS.
We should ensure that our svn client is worked properly.
1.Firstly we should ensure that we have a svn client installed.
2.We can use the following command for storing the accepted root certificate.
svn list https://your_host/path/to/repo

The system will prompt you to accept it temporary or permanent.
Please choose/type 'p' for permanent.

If the above command is not completed or there are some error, please follow this as an alternative.
Copy the root certificate and choose to store at one of the following folder
Global
Unix:
   /etc/subversion/auth/svn.ssl.server
Windows:
   %ALLUSERSPROFILE%\Application Data\Subversion\auth\svn.ssl.server

Per user
Unix:
   ~/.subversion/auth/svn.ssl.server
Windows:
   %APPDATA%\Subversion\auth\svn.ssl.server

Regarding to the chosen root folder, /what/ever/subversion, We will see the file named "servers". Please open and put the following line.
ssl-authority-files =/what/ever/subversion/auth/svn.ssl.server/your_root.cer

3.We can verify the completion by using the same command as the following: -
svn list https://your_host/path/to/repo

The system will print the files inside your repository.
I hope this may help to achieve the requirement.
Regards,
Charlee Ch.

A: Are you using an old Subversion client/server? If it's a 1.4.6, you might be hitting a bug in Subversion (as describer here). You might want to try upgrading both the client and the server, if you're using a version that old.
If not, the other option would probably be that you might have to add the server's key to your keystore.


text:
Q: Emoji usage in a UILabel and appstore rules Does anyone know if I use emoji unicode in an app's view if Apple considers this out of bounds? I'm not asking about enabling emoji or selling an app that is meant to enable emoji.
And example of the code - which is placing an NSString into a tableViewCell NSLabel:
if([combatCurrentHp intValue] <= [combatMaxHp intValue] / 2) {
    characterStats = [characterStats stringByAppendingString:@" \uE022"];
}

This makes an emoji heart appear in the string. Do you guys know if there is a hard and fast rule on if that would get kicked back out of the app store?

A: I've seen applications that use the Emoji codepoints in the App Store, but I'm not sure if it's permitted or those apps just snuck through. I don't think there is a strict policy on this.
Enabling the emoji keyboard however is forbidden.

A: 2 years late, but just in case anyone else is interested in this question, the official answer is that there's no problem using emoji in your UILabels.
My email to App Review team a year ago:

Hi,
I'd like to seek clarification with regard to the usage of emoji
  within an app.
Although emoji input is not enabled for non-Japanese users, all iPhone
  can view emoji whether or not emoji input is enabled.
User interface elements such as UILabel can thus display emoji if they
  used the appropriate unicode in the text string.
I'm currently working on the next update of my app where I'd like to
  display some icons within my text labels, and I couldn't find any
  guidelines with regard to the usage of emoji in this manner.
I've attached a screenshot for your reference. I would like to check
  if this usage is appropriate for the App Store. Much thanks!

Their response:

Hello,
We see no issues with the use of emoji within the app. Please let us
  know if you have additional questions.
Best Regards,
App Review Team iOS Developer Program

Also, my app has been using the emoji for the past one year with no issue.

A: I don't believe that enabling the Emoji keyboard is forbidden as it is enabled as standard in all Asian countries and there are dozens of apps available in the app store for unlocking it in other countries.  Why would Apple incorporate the keyboard in the system if they intended to forbid anyone from ever using it?!


text:
Q: In sass what does the = mean For example in the following from sass. Is the = just a shorthand for @mixin? I can't seem to find any info for this on google
=multi-line-button($base-color)
  +background-clip('padding-box')
  border-width: 1px
  +border-radius(6px)
  border-style: solid
  color: white
  display: block
  margin: 0.2em auto
  padding: 12px 15px
  text-align: center
  text-decoration: none

A: yes, this is the way to define mixins in Sass
dunno if this article will help at all
EDIT:
The following are identical
@mixin red-text
  color: #ff0000

=red-text
  color: #ff0000

Just add +red-text to your selectors

A: "@mixin foobar" is the newer SCSS syntax (more CSS-like) and "=foobar" is the older SASS syntax (more HAML-like). I'm fairly new to SASS and started with SCSS, but both are supported (probably not in the same stylesheet) and both will continue to be supported.


text:
Q: how to open a new fragment using RecyclerView I am trying to make an app that which is like a place picker, meaning you write down a product like pizza or burger, and u get all the places around you that have pizza or burger.
now I'm using RecyclerView in my fragment and i also have Map fragment
when you click on an item in the RV, it will show its location on the map using the map fragment.
my problem is when I'm clicking on an item in the recyclerview i get nullpointerexception
here is my code of the first fragment
public class PlacesFragment extends Fragment implements LoaderManager.LoaderCallbacks<Cursor> , AdapterView.OnItemClickListener{

ClickListener listener;
static Places places;
PlacesAdapter adapter;
public FragmentManager fm;
MyMapFragment mapFragment;
Cursor cursor;

public PlacesFragment() {
    // Required empty public constructor
}

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    // Inflate the layout for this fragment
    View myFragView= inflater.inflate(R.layout.fragment_places, container, false);

    RecyclerView rv= (RecyclerView)myFragView.findViewById(R.id.placesRecyclerView);
    //this create the line beetween every list to do so i have import to the build gradle a flexible divider
    rv.addItemDecoration(new HorizontalDividerItemDecoration.Builder(getActivity()).color(Color.BLACK).build());

    cursor = getActivity().getContentResolver().query(CONTENT_URI, null, null, null, null);

    adapter= new PlacesAdapter(cursor, getActivity());
    rv.setAdapter(adapter);
    adapter.notifyItemRangeChanged(cursor.getPosition(), cursor.getCount());
    adapter.notifyDataSetChanged();

    rv.setLayoutManager(new LinearLayoutManager(getActivity()));
    rv.addOnItemTouchListener(new RecyclerTouchListener(getActivity(), rv, new ClickListener() {

                @Override
                public void onPlaceClick(String  latlng) {
                    //when i click on a place it will go to the map fragment
                 //   Toast.makeText(getActivity(), "on click" + position, Toast.LENGTH_LONG).show();
                /*    FragmentManager fm = getFragmentManager();

                    // get the map object from the fragment:
                    mapFragment = MyMapFragment.newInstance(places);

                    FragmentTransaction ft = fm.beginTransaction();

                    ft.replace(R.id.fragmantContainer, mapFragment, "map");
                    ft.addToBackStack(null);

                    ft.commit();*/

                }
            })
    );

 //   getLoaderManager().initLoader(1, null,);

    return myFragView;
}

@Override
public void onAttach(Context context) {
    super.onAttach(context);

    try {
        listener =  (ClickListener)context;
    } catch (ClassCastException e) {
        throw new ClassCastException("context " + context.toString()
                + "must implement PlacesFragmantListener!");
    }
}

@Override
public Loader<Cursor> onCreateLoader(int id, Bundle args) {
    //  CursorLoader c=getContext().getContentResolver().query(PlacesContract.Places.CONTENT_URI, null, null,null, null);

    return new CursorLoader(getActivity(),CONTENT_URI,  null, null,null, null );
}
@Override
public void onLoadFinished(Loader<Cursor> loader, Cursor cursor) {

}

@Override
public void onLoaderReset(Loader<Cursor> loader) {
 }

@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {

}

public static interface PlacesFragmantListener {
   public  void onLocationSelected(Places places);
}

 class RecyclerTouchListener implements RecyclerView.OnItemTouchListener{

    private GestureDetector gestureDetector;
    private ClickListener clickListener;
    MyMapFragment mapFragment;

    public RecyclerTouchListener(Context context, RecyclerView recyclerView, ClickListener clickListener){
        gestureDetector = new GestureDetector(context, new GestureDetector.SimpleOnGestureListener(){
            @Override
            public boolean onSingleTapUp(MotionEvent e) {
                return true;
            }

            @Override
            public void onLongPress(MotionEvent e) {
                super.onLongPress(e);
            }
        });
        this.clickListener = clickListener;
    }

    @Override
    public boolean onInterceptTouchEvent(RecyclerView rv, MotionEvent e) {

        View child = rv.findChildViewUnder(e.getX(),e.getY());

        return false;
    }

    @Override
    public void onTouchEvent(RecyclerView rv, MotionEvent e) {
        Log.d("PlaceAdapter", "onTouchEvent"+e);
    }

    @Override
    public void onRequestDisallowInterceptTouchEvent(boolean disallowIntercept) {

    }
   }

 }

here is my map fragment
public class MyMapFragment extends Fragment {

public MyMapFragment(){

}
public static MyMapFragment newInstance(Places places) {}

    if (places == null) {
        places = new Places(0,"no Location selected","","", "");
    }

    // the arguments to pass
    Bundle args = new Bundle();
    args.putString("location", places.getLocation());

    args.putDouble("lat", location.getLat());
    args.putDouble("lon", location.getLon());

    MyMapFragment mapFragmant = new MyMapFragment();

    mapFragmant.setArguments(args);

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

    View view = inflater.inflate(R.layout.mapfragment, container, false);

    Bundle b=getArguments();
    String latlng=   b.getString("location");
    Log.d("fragment...", latlng);

    String[] latlongarr= latlng.split(",");

    double lat= Double.parseDouble(latlongarr[0]);
    double lon= Double.parseDouble(latlongarr[1]);

    FragmentManager fm = getFragmentManager();
    MapFragment mapFragment = (MapFragment) fm.findFragmentById(R.id.map);
    // get the map object from the fragment:

    GoogleMap map = mapFragment.getMap();

    if(map!= null) {
        // setup the map type:
        map.setMapType(GoogleMap.MAP_TYPE_HYBRID);

        // setup map position and zoom
        LatLng position = new LatLng(b.getDouble("lat"), b.getDouble("lon"));
        CameraUpdate update = CameraUpdateFactory.newLatLngZoom(position, 15);
        map.moveCamera(update);
    }
    return view;
}
}

here is my adapter
public class PlacesAdapter extends    RecyclerView.Adapter<PlacesAdapter.PlaceHolder> {

private Cursor cursor;
private Context context;
private static TextView placeName, address, distance, url;
public  static ImageView imgplace;
public  static PlaceHolder.ClickListener clickListener;
private  static Places place;
private DataSetObserver mDataSetObserver;
MyMapFragment mapFragment;
private boolean mDataValid;
ClickListener listener;

public PlacesAdapter(Cursor cursor, Context context) {
    this.context = context;
    this.cursor = cursor;
    mDataSetObserver = new NotifyingDataSetObserver();
    if (cursor != null) {
        cursor.registerDataSetObserver(mDataSetObserver);
    }

}

 @Override
 public PlaceHolder onCreateViewHolder(ViewGroup parent, int viewType) {
    //   cursor.setNotificationUri(context.getContentResolver(), CONTENT_URI);
    LayoutInflater inflater = LayoutInflater.from(context);
    View myView = inflater.inflate(R.layout.single_place, parent, false);

    PlaceHolder placeHolder = new PlaceHolder(myView, new PlaceHolder.PlacesFragmantListener() {
        @Override
        public void onLocationSelected(Places places) {

        }
    });

    return placeHolder;
}

@Override
public void setHasStableIds(boolean hasStableIds) {
    super.setHasStableIds(true);
}

@Override
public void onBindViewHolder(PlacesAdapter.PlaceHolder holder, final int position) {

    if (cursor.moveToPosition(position)) {

        int column_number = cursor.getColumnIndex(PLACES_NAME);
        String name = cursor.getString(column_number);
        placeName.setText(name);

        int column_number2 = cursor.getColumnIndex(PLACES_ADDRESS);
        String adr = cursor.getString(column_number2);
        address.setText(adr);

        int column_number3 = cursor.getColumnIndex(PLACES_DISTANEC);
        String dis = cursor.getString(column_number3);
        distance.setText(dis);

        int column_number4 = cursor.getColumnIndex(PLACE_PHOTO);
        String photo = cursor.getString(column_number4);

        if(!photo.equals(""))
        {
            GoogleAccess.myImageDownloader loader= new GoogleAccess.myImageDownloader(imgplace);
            loader.execute(photo);
        }

    }
    holder.itemView.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            Toast.makeText(context, "Item click at " + position, Toast.LENGTH_LONG).show();
            if(cursor.moveToPosition(position))
            {
                String latlong= cursor.getString(cursor.getColumnIndex(PlacesDbconstanst.CurrentPlaces.PLACES_DISTANEC));

                listener.onPlaceClick(latlong);
            }

        }
    });

}

public void setClickListener(PlaceHolder.ClickListener clickListener){
         this.clickListener = clickListener;
}

@Override
public int getItemCount() {
    return cursor.getCount();
}

public static class PlaceHolder extends RecyclerView.ViewHolder implements View.OnClickListener {

    PlacesFragmantListener listener;

    public PlaceHolder(View itemView, PlacesFragmantListener placesFragmantListener) {
        super(itemView);
        listener = placesFragmantListener;
        placeName = (TextView) itemView.findViewById(R.id.placeNametextView);
        address = (TextView) itemView.findViewById(R.id.addressTextView);
        distance = (TextView) itemView.findViewById(R.id.distanceTextView);
        imgplace = (ImageView) itemView.findViewById(R.id.placesImageViewId);
        imgplace.setOnClickListener(this);
        itemView.setOnClickListener(this);

    }
    RecyclerView rv;
    @Override
    public void onClick(View v) {

        if(clickListener!=null){
            clickListener.itemClicked(v, getPosition());
        }

    }
    public static interface PlacesFragmantListener {
        void onLocationSelected(Places places);
    }

    public interface ClickListener{
        public void itemClicked (View view, int position);
    }
}
private class NotifyingDataSetObserver extends DataSetObserver {
    @Override
    public void onChanged() {
        super.onChanged();
        mDataValid = true;
        notifyDataSetChanged();
    }

    @Override
    public void onInvalidated() {
        super.onInvalidated();
        mDataValid = false;
        notifyDataSetChanged();

    }
}
}

can you tell me what i did wrong
here is the log comment
03-30 04:55:28.042 2318-2318/com.myapps.pinkas.placesofintrest W/dalvikvm: threadid=1: thread exiting with uncaught exception (group=0xa4c8cb20)
03-30 04:55:28.042 2318-2318/com.myapps.pinkas.placesofintrest E/AndroidRuntime: FATAL EXCEPTION: main
                                                                                Process: com.myapps.pinkas.placesofintrest, PID: 2318
                                                                                java.lang.NullPointerException
                                                                                at com.myapps.pinkas.placesofintrest.PlacesAdapter$2.onClick(PlacesAdapter.java:112)
                                                                                at android.view.View.performClick(View.java:4438)
                                                                                at android.view.View$PerformClick.run(View.java:18422)
                                                                                at android.os.Handler.handleCallback(Handler.java:733)
                                                                                at android.os.Handler.dispatchMessage(Handler.java:95)
                                                                                at android.os.Looper.loop(Looper.java:136)
                                                                                at android.app.ActivityThread.main(ActivityThread.java:5001)
                                                                                at java.lang.reflect.Method.invokeNative(Native Method)
                                                                                at java.lang.reflect.Method.invoke(Method.java:515)
                                                                                at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
                                                                                at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
                                                                                at dalvik.system.NativeStart.main(Native Method)

A: distance = (TextView) itemView.findViewById(R.id.distanceTextView);
is this line come in 112 in your class file, it's seems like, you have not defined view id or view in XML, please check line number 112 in PlacesAdapter.class

A: Problem 1: Setting onclick listener twice. In onbindviewholder you have put holder.itemView.setOnclicklistener and then again in static class viewholder, you have put itemview.setOnclickListener. When you assign setOnclicklistener inside the static viewholder class, it means it will behave in a particular way uninfluenced by values present in any other views (like textview, imageview) or any such factors which depend on some 'value' property of the views. For most purposes you should have setOnClicklistener onto the itemview/textview/etc inside the static viewholder class which in your case is called placeholder.
Problem 2: Here is the reason why I believe you  are getting NullPointerException. onbindviewholder has access to only the views declared in static viewholder class. If you want itemview to be accessible to onbindviewholder then make the following changes:
public static class PlaceHolder extends RecyclerView.ViewHolder implements View.OnClickListener {

PlacesFragmantListener listener;
View iv;
public PlaceHolder(View itemView, PlacesFragmantListener placesFragmantListener) {
    super(itemView);
    iv = (View)itemView;
    //then rest of the code

Now in your onbindviewholder write the following instead of holder.itemview.setonclicklistener
holder.iv.setonclicklistener...

Problem 3: in your static viewholder, you have put:
 imgplace.setOnClickListener(this);
 itemView.setOnClickListener(this);

itemview is the layout in which imgplace exists. And you have setonclicklistener on both of them. This is like putting a button on a button. It makes no sense. I think this will lead you into lot of mess. For some reason you want both to perform the same function on being clicked (you have put 'this' inside setOnClickListener). This is completely illogical. So set the clicklistener to either imgplace or itemview but not both


text:
Q: Override body style for content in an iframe How can I control the background image and colour of a body element within an iframe? Note, the embedded body element has a class, and the iframe is of a page that is part of my site.
The reason I need this is that my site has a black background assigned to the body, and then a white background assigned to divs that contain text. A WYSIWYG editor uses an iframe to embed content when editing, but it doesn't include the div, so the text is very hard to read.
The body of the iframe when in the editor has a class that isn't used anywhere else, so I'm assuming this was put there so problems like this could be solved. However, when I apply styles to class.body they don't override the styles applied to body. The weird thing is that the styles do appear in Firebug, so I've no idea what's going on!
Thanks
UPDATE - I've tried @mikeq's solution of adding a style to the class that is the body's class. This doesn't work when added to the main page's stylesheet, but it does work when added with Firebug. I'm assuming this is because Firebug is applied to all elements on the page whereas the CSS is not applied within iframes. Does this mean that adding the css after window load with JavaScript would work?

A: You cannot change the style of a page displayed in an iframe unless you have direct access and therefore ownership of the source html and/or css files.
This is to stop XSS (Cross Site Scripting)

A: The below only works if the iframe content is from the same parent domain.
The following code works for me.  Tested on Chrome and IE8.  The inner iframe references a page that is on the same domain as the parent page.
In this particular case, I am hiding an element with a specific class in the inner iframe.
Basically, you just append a style element to the head section of the document loaded in a frame:
frame.addEventListener("load", ev => {
    const new_style_element = document.createElement("style");
    new_style_element.textContent = ".my-class { display: none; }"
    ev.target.contentDocument.head.appendChild(new_style_element);
});

You can also instead of style use a link element, for referencing a stylesheet resource.

A: This code uses vanilla JavaScript. It creates a new ")
   );
};

I do not own any Tawk's domain and this worked for me, thus you may do this even if it's not from the same parent domain (despite Jeremy Becker's comment on Sam's answer).

A: An iframe has another scope, so you can't access it to style or to change its content with javascript.
It's basically "another page".
The only thing you can do is to edit its own CSS, because with your global CSS you can't do anything.

A: This should work with cross domain if you're the owner of the both
The trick here is to assign a global css variable to your body, to listen message with the new color, and then to change the global css variable once receive a message.
I'm using angular, but it should work with pure javascript
My use case was to show to the user what he how the color change would impact his website in the iframe before saving it
Domain A
@ViewChildren('iframeContainer') iframeContainer: QueryList<ElementRef>

sendDataToIframe(
  data = {
      type: 'colorChange',
      colors: {primary: '#000', secondary: '#fff'},
  },
): void {
  if (this.targetUrl)
    this.iframeContainer.first.nativeElement.contentWindow.postMessage(data) // You may use document.getElementById('iframeContainer') instead
}

Domain B
acceptedEditOrigins = [
  'https://my.origine.ccom', // Be sur to have a correct origin, to avoid xss injecto: https://en.wikipedia.org/wiki/Cross-site_scripting
]

constructor() {
// Listen to message
window.addEventListener('message', (event) => this.receiveMessage(event), false)
}

receiveMessage(event: MessageEvent) {
  if (this.acceptedEditOrigins.includes(event.origin))
    switch (event.data.type) {
      case 'colorChange': {
        this.setWebsiteConfigColor(event.data.colors)
      }
    }
}

setWebsiteConfigColor(colors: WebsiteConfigColors) {
  if (colors) {
    const root = document.documentElement
    for (const [key, value] of Object.entries(colors)) {
       root.style.setProperty(`--${key}`, value) // --primary: #000, --secondary: #fff
    }
  }
}

body {
  background-color: var(--primary);
}

A: If you have control of the page hosting the iframe and the page of the iframe, you can pass a query parameter to the iframe...
Here's an example to add a class to the iframe based on whether or not the hosting site is mobile...
Adding iFrame:
var isMobile=$("mobile").length; //detect if page is mobile
var iFrameUrl ="https://myiframesite/?isMobile=" + isMobile;

$(body).append("

");
$("#wrapper iframe").attr("src", iFrameUrl );

Inside iFrame:
//add mobile class if needed
var url = new URL(window.location.href);
var isMobile = url.searchParams.get("isMobile");
if(isMobile == "1") {
    $("body").addClass("mobile");
}

A: For juste one iframe, you can do something like this:
document.querySelector('iframe').contentDocument.body.style.backgroundColor = '#1e1e2d';

In case you have multiple iframe you're dealing with:
document.querySelectorAll('iframe').forEach((iframe) => {
    iframe.contentDocument.body.style.backgroundColor = '#1e1e2d';
});

A: Perhaps it's changed now, but I have used a separate stylesheet with this element:
.feedEkList iframe
{
max-width: 435px!important;
width: 435px!important;
height: 320px!important;
}

to successfully style embedded youtube iframes...see the blog posts on this page.

A: give the body of your iframe page an ID (or class if you wish)

then, also within the iframe's page, assign a background to that in CSS
#myId {
    background-color: white;
}


text:
Q: Mercurial Merge of Two Named Branches: Working Directory Has No Ancestor I have two named branches, SPRINT_009 and SPRINT_010.  Some changesets have been committed to SPRINT_009 that I would like to merge into SPRINT_010.  I was able to merge the changesets from branch_one back into default without any trouble.  I am having problems merging the changesets from branch_one into branch_two.
default       A -- B -- C -- G -- H -- I -- J -- K -- L -- N -- O -- P
                         \                             \            /
SPRINT_009     D -- E -- F -----------------  ---------- ----------
                                                         \
SPRINT_010                                                M

Here are the commands I am using:
hg update branch_two
hg merge branch_one

However I get the following message:
abort: merging with a working directory ancestor has no effect

Does anyone know what exactly I am doing wrong?
**EDIT: I've added a picture of the graph.  The drawing is conceptual **

A: The problem was that I hadn't performed an hg pull before attempting the merge.  Normally we do our development on a Windows machine using TortoiseHg.  We modified the name of one of our resources on the support branch, from fooBAR to fooBar and ran into the mercurial case folding problem.  We were trying to get around this by merging the branches on a Linux box.  I am so used to using TortoiseHg that I forgot the most basic of commands!


text:
Q: trying to get an integer variable out from an array list I have a string Array List called casesArrayList. I have a few words and some numbers in the Array List ... I am trying to get the numbers out of the array List and make the integers so I could make some calculations with these numbers. Here is my code that does not work :
My array list looks like this : Opened Opened Opened Opened Opened Opened My Case 300000 100 25000 0 500 400000 100000 75000 1 5 500000 75 25 750000 1000 10 200000 400 750 , if I use System.out.print(casesArrayList.get(j) + " ") in a for loop.
    for (int j = 0; j < casesArrayList.size(); j++)
       {
        if (!casesArrayList.get(j).equals("My Case") &&  !casesArrayList.get(j).equals("Opened")) {
          System.out.print(casesArrayList.get(j) + " ");
       }

// at this point the output is : 300000 100 25000 0 500 400000 100000 75000 1 5 500000 75 25 750000 1000 10 200000 400 750
// the error is in the next line :
       int c = (int) casesArrayList.get(j);
       System.out.print(c + " ");
    }

How could I get the numbers out of the array list and make the variables, because parseInt, valueOf or (int) does not work .
I edited the code :
for ( int j = 0; j < casesArrayList.size(); j++) {
        if (!casesArrayList.get(j).equals("My Case") &&  !casesArrayList.get(j).equals("Opened")) {
          System.out.print(casesArrayList.get(j) + " ");
       }

        try {
            int c = Integer.parseInt(casesArrayList.get(j));
            System.out.print(casesArrayList.get(j) + " ");
        } catch (Exception e) {
            System.out.println(e);
       }
          System.out.print(c + " ");
    }

The error message still :
no suitable method found for parseInt(java.lang.Object)
method java.lang.Integer.parseInt(java.lang.String) is no applicable ;
http://i.stack.imgur.com/fxl0o.png
Thank you guys so much, I am not a Java expert, I made some pretty obvious mistakes, but I finally made it work ... @ Suresh was right, the perfectly working code is :
 for (int j = 0; j < casesArrayList.size(); j++) {

         if (!casesArrayList.get(j).equals("My Case") &&  !casesArrayList.get(j).equals("Opened")) {
             total = total + (Integer.parseInt((String)casesArrayList.get(j)));
             n = n + 1;
         }
         average = total / n;
    }
    System.out.println();
    System.out.println("The total is "+ total);
    System.out.println("The average is "+ average);

A: Since casesArrayList is a String ArrayList each value of it is a String, you need to parse that string. Not a direct cast
try {
     System.out.println(Integer.parseInt(casesArrayList.get(j)));
} catch(NumberFormatException ex){
   // do something here if it is not a number
}

see Integer.parseInt()
As I see the screenshot you mentioned, It's not a String ArrayList and you are getting a type as Object (not sure). Try to cast it to String and then try.
  System.out.println(Integer.parseInt((String)casesArrayList.get(j)));

A: Try looping through your list and doing this.
boolean isNum = false;
try {
   Integer.parseInt(str);
   isNum = true;
}catch(Exception ex){
   isNum = false;
}

This will tell you which elements are ints and which are not.
Then take just those which are ints and process them as you wish.

A: Let's casesArrayList be defined like:
List<String> casesArrayList = new ArrayList<String>();
casesArrayList.add("Opened");
casesArrayList.add("Opened");
casesArrayList.add("My Case");
casesArrayList.add("200s0");
casesArrayList.add("1000");

your code should look like:
for (int j = 0; j < casesArrayList.size(); j++) {
    if (!casesArrayList.get(j).equals("My Case") && !casesArrayList.get(j).equals("Opened")) {
        try {
            int c = Integer.parseInt(casesArrayList.get(j));
            System.out.print(casesArrayList.get(j) + " ");
        } catch (Exception e) {
            System.out.println(e);
        }

    }
}

A: It's not very elegant to parse the String to Integer, plus, it potentially throws exceptions.
You can use regular expression matching instead:
List<String> list = Arrays.asList("Word", "12321");
List<String> strings = new ArrayList<String>();
for (String e : list) {
    if (!e.matches("\\s*-?\\d+\\s*")) {
        strings.add(e);
    }
}


text:
Q: "This PC" empty when opening files from a Windows 8 store app I've been having this issue where the Windows 8 modern file open screen won't show me the contents of my PC. When I use an "open file" button in any store app, I am shown the file open screen in some default folder, such as This PC > Music. From there, I can navigate to any file in this folder. However, when I choose parent folder, the This PC folder indicates This view contains no files or folders. This means that I cannot access files on my desktop or anywhere else on my local drive.
I've been having this problem on my Surface, both before and after upgrading to Windows 8.1. However, that same dialog works fine on my laptop (I see my local drives and user folders). Any ideas about ways to address this?


text:
Q: Nesting filename in composer without file extension I just want to supress the file extension (.qgs) on my file name: srv1245_d005.qgs.
[% substr(@project_filename ,1,12)%] works although sometimes our filename will be 13 characters long or more so to supress the extension only would be the ideal solution.

A: For QGIS 2.x:
[%replace( @project_filename , '.qgs', '')%]

For QGIS 3.x
[% @project_basename %]


text:
Q: How to print a list of Magento 1 product urls in a table I want to query the database for all products with urls starting "afr-" and print them on a cms page in a table. For example, the final printed table would look like:

  753954329
  https://example.com/afr-753954329

  498563241
  https://example.com/afr-498563241

  392736177
  https://example.com/afr-392736177

A: You can try this code to get the url of all products in magento
<?php
$_productCollection = Mage::getModel('catalog/product')
                        ->getCollection()
                        ->addAttributeToSort('created_at', 'DESC')
                        ->addAttributeToSelect('*')
                        ->load();
$base_url = Mage::getBaseUrl();

foreach ($_productCollection as $_product){
   $product_url = $_product->getProductUrl();
   echo $base_url.$product_url.'
';
}
?>

A: Try below code
<?php $product = Mage::getModel('catalog/product')->getCollection()->addAttributeToSelect('*')->addAttributeToFilter('product_url',array('like' =>"afr-"."%"));?>

<?php foreach($product as $_product):?>

     <a href="<?php echo $_product->getProductUrl();?>">753954329

<?php endforeach;?>

A: Try this code to print all the product URLs starting with "-afr", please try below code:
<?php
$_productCollection = Mage::getModel('catalog/product')
        ->getCollection()
        ->addAttributeToSort('created_at', 'DESC')
        ->addAttributeToSelect('*')
        ->load();
if (count($_productCollection)) {
    ?>

        <?php
        }

        foreach ($_productCollection as $_product) {
            $product_url = $_product->getProductUrl();
            if (stripos($product_url, 'afr-')) {
                ?>

                    <a href="<?php echo $product_url; ?>"><?php echo $_product->getSku(); ?>
                    <a href="<?php echo $product_url; ?>"><?php echo $product_url; ?>

                <?php
            }
        }
        if (count($_productCollection)) {
            ?>

    <?php
}
?>


text:
Q: Jquery Dialog Not coming On Top Other dialog box I have Two Dialog box one upon another,
on Clicking Ok of One dialog box,
on invalid entry other box will appear ,
but some time outer dialog box getting in of First dialog box.please suggest me the way so that it come one upon anather every time.
.dialog({
    , title: $title
    , modal: true
    , width: width
    , height: height
    , resizable: resizable
    , pos: top,
 });

first time it is coming on top form next time its is getting in of first one
can any one explain on this:
Use the dialogClass option on the higher dialog to assign a class that has z-index = 2.


text:
Q: Occasional Internal Server Errors using Django with mod_wsgi and Apache We are set up using Django + mod_wsgi + Apache.
Cccasionally, whilst we are doing site updates/changing the back-end Python code, site users run into Internal Server Error pages that appear to be served by Apache, not by Django (at least they are the horribly ugly ones, not the nice ones). They do seem to generate error reports though (via email) I think, they just don't seem to land on our 500 server error template.
I'd like to get to the bottom of why this is happening. Normally errors result in the Django-served (and nicely-styled) 500 error page, but just occasionally we see the ugly Internal Server Error page instead.
Does anyone have any idea why this is happening and what I can check/test/post here to stop this happening? Help really appreciated, thank you!

A: If Apache is showing you the 500 page, that suggests that Django threw an error while rendering the 500 page. For example, there could be a template tag on the 500.html template that Django was unable to render.
Have you looked in your Apache error logs? For Apache2 On Debian they are stored in /var/log/apache2/ by default. Your operating system may vary.

A: I know this behavior, had the same problem on Centos 5.3 with Python 2.5.
After I installed Python 2.7.2 and compiled the latest mod_wsgi (I think it was version 3.3) against it, those errors vanished. The problem is a bug in Python 2.5 as far as I remember in regards to memory allocation.
Be careful when using CentOS, as you can not update Python 2.4, youll have to install versions parallel. Updating Python will break CentOS system features like "yum".


text:
Q: What are the Corine Land Cover Codes? I'm working with Corine Land Cover Map 2012 in QGIS. I can't find any information about the color code. Values range from 0 to 255 but there's no indication which value stands for which land cover type.

A: There is a spreadsheet available here with the land cover codes and their corresponding RGB color codes as defined by the EEA and a CSV version
here. For completeness, the clc codes and RGB color codes are included below.
You'll also find useful information about using CLC data in QGIS here.
CLC_CODE    R-G-B

111         230-000-077
112         255-000-000
121         204-077-242
122         204-000-000
123         230-204-204
124         230-204-230
131         166-000-204
132         166-077-000
133         255-077-255
141         255-166-255
142         255-230-255
211         255-255-168
212         255-255-000
213         230-230-000
221         230-128-000
222         242-166-077
223         230-166-000
231         230-230-077
241         255-230-166
242         255-230-077
243         230-204-077
244         242-204-166
311         128-255-000
312         000-166-000
313         077-255-000
321         204-242-077
322         166-255-128
323         166-230-077
324         166-242-000
331         230-230-230
332         204-204-204
333         204-255-204
334         000-000-000
335         166-230-204
411         166-166-255
412         077-077-255
421         204-204-255
422         230-230-255
423         166-166-230
511         000-204-242
512         128-242-230
521         000-255-166
522         166-255-230
523         230-242-255
999
990
995         230-242-255

A: I've created a color map for QGIS. In the raster properties use the render type "Singleband pseudocolor" and load the following color map from a text file:
# CORINE Land Cover Classes
INTERPOLATION:EXACT
111,230,0,77,255,Continuous urban fabric
112,255,0,0,255,Discontinuous urban fabric
121,204,77,242,255,Industrial or commercial units
122,204,0,0,255,Road and rail networks and associated land
123,230,204,204,255,Port areas
124,230,204,230,255,Airports
131,166,0,204,255,Mineral extraction sites
132,166,77,0,255,Dump sites
133,255,77,255,255,Construction sites
141,255,166,255,255,Green urban areas
142,255,230,255,255,Sport and leisure facilities
211,255,255,168,255,Non-irrigated arable land
212,255,255,0,255,Permanently irrigated land
213,230,230,0,255,Rice fields
221,230,128,0,255,Vineyards
222,242,166,77,255,Fruit trees and berry plantations
223,230,166,0,255,Olive groves
231,230,230,77,255,Pastures
241,255,230,166,255,Annual crops associated with permanent crops
242,255,230,77,255,Complex cultivation patterns
243,230,204,77,255,Land principally occupied by agriculture with significant areas of natural vegetation
244,242,204,166,255,Agro-forestry areas
311,128,255,0,255,Broad-leaved forest
312,0,166,0,255,Coniferous forest
313,77,255,0,255,Mixed forest
321,204,242,77,255,Natural grasslands
322,166,255,128,255,Moors and heathland
323,166,230,77,255,Sclerophyllous vegetation
324,166,242,0,255,Transitional woodland-shrub
331,230,230,230,255,Beaches dunes sands
332,204,204,204,255,Bare rocks
333,204,255,204,255,Sparsely vegetated areas
334,0,0,0,255,Burnt areas
335,166,230,204,255,Glaciers and perpetual snow
411,166,166,255,255,Inland marshes
412,77,77,255,255,Peat bogs
421,204,204,255,255,Salt marshes
422,230,230,255,255,Salines
423,166,166,230,255,Intertidal flats
511,0,204,242,255,Water courses
512,128,242,230,255,Water bodies
521,0,255,166,255,Coastal lagoons
522,166,255,230,255,Estuaries
523,230,242,255,255,Sea and ocean


text:
Q: How can i use TextInput & Dropdown by using Nativebase on react-native am new react-native & nativebase. I try to use nativebase to build Textinput and Dropdown(Picker) in the same page but I cannot. I want to use both of them in the same page. Can u tell me how to. Thank you so much
//I want this to be Textinput
<CardItem style={{bottom: 60}}>
  <Text style={{fontSize: 20, fontWeight: 'bold' }}>Text Input</Text>
</CardItem>
<CardItem style={{bottom: 75}}>
  <Item rounded style={{borderColor: '#708090' }}>
    <Input placeholder="" />
  </Item>
</CardItem>

//I want this to be Dropdown
<CardItem style={{bottom: 75}}>
  <Text style={{fontSize: 20, fontWeight: 'bold' }}>Dropdown</Text>
</CardItem>
<CardItem style={{bottom: 90}}>
  <Item rounded style={{borderColor: '#708090' }}>
    <Input placeholder="" />
  </Item>
</CardItem>

A: try this
import React from "react";
import {
  Container,
  Header,
  Content,
  Card,
  CardItem,
  Body,
  Text,
  Form,
  Item,
  Input,
  Picker,
} from "native-base";

export default class App extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      selected1: "key1",
    };
  }
  onValueChange(value) {
    this.setState({
      selected1: value,
    });
  }

  render() {
    return (
      <Container>
        <Header />
        <Content>
          <Card>
            <CardItem>
              <Body>
                <Text>Text Input</Text>
              </Body>
            </CardItem>
            <CardItem>
              <Body>
                <Item rounded style={{ borderColor: "#708090" }}>
                  <Input placeholder="" />
                </Item>
              </Body>
            </CardItem>
            <CardItem>
              <Body />
            </CardItem>
          </Card>

          <Card>
            <Text style={{ margin: 15 }}>Drop Down</Text>
            <Form style={{ marginLeft: 10, marginRight: 15 }}>
              <Picker
                iosHeader="Select one"
                mode="dropdown"
                selectedValue={this.state.selected1}
                onValueChange={this.onValueChange.bind(this)}
              >
                <Item label="Wallet" value="key0" />
                <Item label="ATM Card" value="key1" />
                <Item label="Debit Card" value="key2" />
                <Item label="Credit Card" value="key3" />
                <Item label="Net Banking" value="key4" />
              </Picker>
            </Form>
          </Card>
        </Content>
      </Container>
    );
  }
}

see this link


text:
Q: Sysroot is incorrect in Ninja when trying to build library I'm trying to build Google's Skia library on Mac, but when I try running
ninja -C out/Static/

in order to build the library, it gives me this error (after many, many similar errors):
[14/1073] compile ../../src/gpu/GrBackendTextureImageGenerator.cpp
FAILED: obj/src/gpu/gpu.GrBackendTextureImageGenerator.o
c++ -MD -MF obj/src/gpu/gpu.GrBackendTextureImageGenerator.o.d -DNDEBUG -DSK_ASSUME_GL=1 -DSK_ENABLE_API_AVAILABLE -DSK_GAMMA_APPLY_TO_A8 -DSKIA_IMPLEMENTATION=1 -DSK_GL -I../.. -Wno-attributes -fstrict-aliasing -fPIC -fvisibility=hidden -isysroot b\'/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk\\n\' -O3 -Wno-sign-conversion -Wno-unused-parameter -std=c++17 -fvisibility-inlines-hidden -fno-exceptions -fno-rtti -c ../../src/gpu/GrBackendTextureImageGenerator.cpp -o obj/src/gpu/gpu.GrBackendTextureImageGenerator.o
clang: warning: no such sysroot directory: 'b'/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk\n'' [-Wmissing-sysroot]
In file included from ../../src/gpu/GrBackendTextureImageGenerator.cpp:8:
In file included from ../../include/gpu/GrContext.h:11:
In file included from ../../include/core/SkMatrix.h:11:
In file included from ../../include/core/SkRect.h:11:
In file included from ../../include/core/SkPoint.h:11:
In file included from ../../include/core/SkMath.h:11:
../../include/core/SkTypes.h:26:18: fatal error: 'TargetConditionals.h' file not found
        #include "TargetConditionals.h"
                 ^~~~~~~~~~~~~~~~~~~~~~
1 error generated.
ninja: build stopped: subcommand failed.

It seems like the sysroot directory b'/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk\n' is wrong, however "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk" does exist and "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/" has the file TargetConditionals.h.
I haven't used ninja before, but I tried looking in toolchain.ninja but could find no way to change the sysroot variable. I also reinstalled Xcode and Xcode command line tools, to no avail. Any help would be greatly appreciated!

A: I too struggled a lot. The solutions that I tried:

*

*xcode-select --install for installing command line tools. But it used to say that command line tools are already installed.

*Tried re-installing xcode to fix some linkage issue.

*Tried a could of other solutions found on web.

Finally, what worked for me is by switching to python2. I had python2 and python3 installed. My path environment variable in .zshrc was giving precedence to python3. So, all internal scripts generated by ninja had python3 in precedence.
I temporarily removed python3, you can keep both but its precedence should be changed. Then regenerate build directory using gn. Then use ninja to build.
Note:
clang: warning: no such sysroot directory: 'b'/Applications/ : Here 'b' use to represent that string literal should be treated as byte literal in python3. So that could be the cause.


text:
Q: PHPMyAdmin 4.0.5 - Grid edit, checkbox, Edit, Copy and Delete features are not available I see this warning in PHPMyAdmin 4.0.5
"does not contain a unique column. Grid edit, checkbox, Edit, Copy and Delete features are not available."
In PHPMyAdmin 3.5.1 these options appear correctly using the same database.
Can fix this? How?
thanks in advance
Fabián.

A: You should be able to assign a primary key to the table. Just click on the 'Structure' tab when viewing the table you are trying to edit, choose a field you want to be the primary key and there is a button to assign it as the primary key in one of the columns. Go back to the browse tab and you should now be able to edit the table.

A: To fix this, pick a suitable column(s) in your table and create a unique index on it (or on them). Version 4.0 added this verification to avoid other problems when not the intended row is modified or deleted.
See http://en.wikipedia.org/wiki/Unique_key.
[EDIT] However, version 4.5.0 contains an improvement in this regard, see https://github.com/phpmyadmin/phpmyadmin/issues/11061


text:
Q: Blazor Server: Read Response information in Callback I am working on a Hobby application in Blazor Server. The first stage in this application involves directing the user to an external site to have them authorize my app (OAuth2) to access their information from the external site. Part of this process involves a return authorization code. I have a Webforms version of this application where the Start page redirects the user to a URL and then a callback page completes the task of capturing a token. I cannot figure out how to capture the "Code" from the response in the Callback from the external server. Any help?
Start Page:
        public void Btn_UM_CreateNew_click(object sender, EventArgs e)
        {
            RegisterAsyncTask(new PageAsyncTask(TestNew));
        }
        private async Task TestNew()
        {
            using (var eveAuth = new EveAuth())
            {
                var url = await eveAuth.EveAuthGet();

                Response.Redirect(url);

            }
        }

Callback page (where I extract the "Code" value:
        protected async void Page_Load(object sender, EventArgs e)
        {
            var resp = Request["code"];
            using (EveAuth eveCallback = new EveAuth())
            {
                await eveCallback.EveTokenGet(resp);
            }

A: Is the "Code" passed to the Callback page via a query string?
If so you can refer to the below article
https://chrissainty.com/working-with-query-strings-in-blazor/


text:
Q: SwiftyJson and firestore timestamp swift I have my dictionary [String:Any] without timestamp object which I am sending it to firestore.
Everything works good sending and retrieving the object.
When I add a timestamp element on the dictionary with the following way
data["timestamp"] = FieldValue.serverTimestamp()

it commits successfully.But when I retrieve it. if I do
 let data = document.data()
 print(data)

I can see the debug message then I parse it to SwiftyJson (https://github.com/SwiftyJSON/SwiftyJSON)
let json = JSON(data)
print(json)

the message that I receive from this debug is "unknown" and fails on
let createdAtTimestamp: Timestamp = data["timestamp"] as! Timestamp

any idea why?

A: Are you modifying the initial configuration for areTimestampsInSnapshotsEnabled when you retrieve it the data?
Firestore returns timestamps fields as NSDate as default, so maybe this is the issue.
If you set this property to true, you can now handle it as FIRTimestamp:
let createdAtTimestamp: FIRTimestamp = data["timestamp"] as! FIRTimestamp


text:
Q: laravel adding amount in loop if the rank does not exists I have a rank for every user that will tell how much the amount they will receive. But the if the user with that rank does not exist, it will go through the next user, because the rank are in order.
Rank (in order):
Basic - 50
Junior - 100
Premium - 150
Advanced - 200
Senior - 250

each of those ranks does have a corresponding value, and that value will be added to the next user if it does not exist. I just want to ask if my code is ok or it can be refactored.
My code:
$ranks = collect([
    (object) ['name' => 'Basic', 'amount' => 50],
    (object) ['name' => 'Junior',  'amount' => 100],
    (object) ['name' => 'Premium',  'amount' => 150],
    (object) ['name' => 'Advanced',  'amount' => 200],
    (object) ['name' => 'Senior',  'amount' => 250],
]);

$users = collect([
    (object) ['rank' => 'Basic', 'amount' => 0],
    (object) ['rank' => 'Junior', 'amount' => 0],
    (object) ['rank' => 'Premium', 'amount' => 0],
    (object) ['rank' => 'Senior', 'amount' => 0],
]);

$amount_to_transfer = 0;
$available_ranks = $users->pluck('rank');

foreach($ranks as $rank){
    if(!in_array($rank->name, $available_ranks->toArray()))
    {
        $amount_to_transfer += $rank->amount;
    } else {
        $usersOfThisRank = $users->filter(function($usr, $key) use($rank){
            return $usr->rank == $rank->name;
        });
            $usersOfThisRank->map(function($usr, $key) use($rank, $amount_to_transfer){
            $usr->amount += $rank->amount + $amount_to_transfer;
        });
    }
}

dd($amount_to_transfer);

A: Assuming you'll keep using (object), here's how I'd do it. This way we don't need as many variables and it's shorter.
I'm assuming you only have one user for each rank.
$accumulated = 0;
$ranks->each(function ($rank) use (&$accumulated, $users) {
    if ( !$users->contains('rank', $rank->name) ) {
        $accumulated += $rank->amount;
    } else {
        $user = $users->firstWhere('rank', $rank->name);
        $user->amount = $accumulated + $rank->amount;
        $accumulated = 0;
    }
});

This question is more suited for  https://codereview.stackexchange.com/


text:
Q: ArcGIS Viewer for Flex providing login I have ArcGIS server and ArcGIS Viewer for Flex installed up and running. I use ArcMap 10.2 to publish my shapefiles. There is a lot of users who is using my maps. How can I provide login for them in the web page for map? Should I use it as a widget or there is another way?

A: Are you saying you want to password-protect the map so that only people who have a login can access it? If so, you will need to turn on map service security on ArcGIS Server, create users in ArcGIS Server's user store, and then use the ArcGIS token capability in your viewer to provide access to the map. It's not trivial, but not brain surgery, somewhere in between.


text:
Q: How to pass Control.ClientID in function in repeater ItemDataBound in aspx page? I want to call a JavaScript function to collapse/expand.
I am using this code in asp:repeater ItemTemplate on span
onclick="javascript:funCollExp(this,'<%= P1.ClientID %>');"

How do I pass Control.ClientID?
It replaces P1.ClientID as a string on the page.

A: You just need to do like this
"onclick="javascript:funCollExp(this,'" + P1.ClinetID + "');"

full code for you make use of itemdatabound event like this
markup
<asp:Repeater id="myRepeater"
       OnItemDataBound="myRepeater_ItemDataBound" runat="server">
    <ItemTemplate>
        <asp:button id="myDiv" runat="server">......</asp:button>
    </ItemTemplate>
</asp:Repeater>

codebehind
protected void myRepeater_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
    if(e.Item.ItemType == ListItemType.Item
           || e.Item.ItemType == ListItemType.AlternatingItem)
    {
      Button mybtn = e.Item.FindControl("mybtn") as bUTTON;

      mybtn.Attributes.Add("ONCLICK", "MYFUNCTION(this,'" + P1.ClientID + "');");
    }
}

A: All you need to do is, use it this way
"onclick="javascript:funCollExp(this,'" + P1.ClinetID + "');"


text:
Q: Alarm BroadcastReceiver doesn't work on real devices I have an alarm in my Android app that work in AVD correct. But it doesn't work in real devices.
What's wrong here?
And that's my BroadcastReceiver:
package com.junglesofts.maraudersmap;

import android.app.AlarmManager;
import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.PowerManager;
import android.widget.Toast;

public class Alarm extends BroadcastReceiver
{
     @Override
     public void onReceive(Context context, Intent intent)
     {
         PowerManager pm = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
         PowerManager.WakeLock wl = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "");
         wl.acquire();

         // Put here YOUR code.
         Toast.makeText(context, "Alarm!!!!!!!!!!", Toast.LENGTH_LONG).show(); // For example

         wl.release();
     }

 public void SetAlarm(Context context)
 {
     AlarmManager am=(AlarmManager)context.getSystemService(Context.ALARM_SERVICE);
     Intent i = new Intent(context, Alarm.class);
     PendingIntent pi = PendingIntent.getBroadcast(context, 0, i, 0);
     am.setRepeating(AlarmManager.RTC_WAKEUP, System.currentTimeMillis(), 1000 * 10 * 1, pi); // Millisec * Second * Minute
 }

 public void CancelAlarm(Context context)
 {
     Intent intent = new Intent(context, Alarm.class);
     PendingIntent sender = PendingIntent.getBroadcast(context, 0, intent, 0);
     AlarmManager alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
     alarmManager.cancel(sender);
 }
}

I comment my Androidmanifest too.


text:
Q: Excel VBA: How to access data in all the cells of a column using a loop and assign that data to a string variable? I would like to learn:
I have a column (column 'F') of flags('1' for Yes and '0' for No). I would like to loop through each cell in the column and if the flag in that cell is a '1', I would like to use a string variable to hold the data in the other cells on that row adjacent to the cell containing the '1' Flag.
This is so I can take these string to customize the email with these string and send many emails to different users using the email Id's in column 'C'.
Img
Here is my code so Far:
Sub Sendmail()
    Dim answer As String
    Dim SubmitLink_BorrowerName As String
    Dim SubmitLink_BookName As String
    Dim SubmitLink_CheckoutDate As String
    Dim KeyCells As Range
    Dim i As Long

    Set KeyCells = Range("F2:F10") 'Range of 'Y/N' for whole column
    SubmitLink_BorrowerName = Range("A2").Value  'SubmitLink contains content of cell B1
    SubmitLink_BookName = Range("B2").Value  'SubmitLink contains content of cell B1
    SubmitLink_CheckoutDate = Range("D2").Value  'SubmitLink contains content of cell B1
    answer = MsgBox("Do you wish to save this change. An Email will be sent to the User", vbYesNo, "Save the change")

    If answer = vbNo Then Cancel = True
    If answer = vbYes Then
        For i = 2 To 20
        If Cells(i, 6).Value = 1 And Not IsEmpty(Cells(i, 6).Value) Then
            Cells(i, 6).Font.Color = vbBlue

        'Open Outlook
        Set OutlookApp = CreateObject("Outlook.Application")
        Set OlObjects = OutlookApp.GetNamespace("MAPI")
        Set newmsg = OutlookApp.CreateItem(olMailItem)
        'Add recipient
        newmsg.Recipients.Add Worksheets("Sheet1").Range("C2").Value
        'Add subject
        newmsg.Subject = "Book: " & SubmitLink_BookName & " overdue" 'Worksheets("Sheet1").Range("F1").Value
        'Add body
        newmsg.Body = "Dear " & SubmitLink_BorrowerName & "," & vbLf & vbLf & "This is a friendly reminder that Book: " & SubmitLink_BookName & " borrowed on " & SubmitLink_CheckoutDate & " has not yet been returned to the PC team." & vbLf & vbLf & "Kindly return this book to the Book shelf" & vbLf & "Regards, " & vbLf & vbLf & "Admin"

        'Display
        newmsg.Display
        newmsg.Send
        MsgBox "Modification confirmd", , "Confirmation"

        End If
    End If

End Sub

Thanks in advance!

A: You forgot to add Next i.strong text
If answer = vbYes Then
    For i = 2 To 20
    If Cells(i, 6).Value = 1 And Not IsEmpty(Cells(i, 6).Value) Then
        Cells(i, 6).Font.Color = vbBlue

    'Open Outlook
    Set OutlookApp = CreateObject("Outlook.Application")
    Set OlObjects = OutlookApp.GetNamespace("MAPI")
    Set newmsg = OutlookApp.CreateItem(olMailItem)
    'Add recipient
    newmsg.Recipients.Add Worksheets("Sheet1").Range("C2").Value
    'Add subject
    newmsg.Subject = "Book: " & SubmitLink_BookName & " overdue" 'Worksheets("Sheet1").Range("F1").Value
    'Add body
    newmsg.Body = "Dear " & SubmitLink_BorrowerName & "," & vbLf & vbLf & "This is a friendly reminder that Book: " & SubmitLink_BookName & " borrowed on " & SubmitLink_CheckoutDate & " has not yet been returned to the PC team." & vbLf & vbLf & "Kindly return this book to the Book shelf" & vbLf & "Regards, " & vbLf & vbLf & "Admin"

    'Display
    newmsg.Display
    newmsg.Send
    MsgBox "Modification confirmd", , "Confirmation"

    End If
 Next i

End If