text:
Q: Growth Rate of the Sequence of Denominators of the Sequence of Principal Convergents of an Irrational Number. Let $\delta >0$. Take $\theta \in [0,1]-\mathbb{Q},$ let $\lbrace \frac{m_k}{n_k}\rbrace$ be the sequence of principal convergents to $\theta$, obtained from the continued fraction representation $\theta =[0; a_1, a_2,...],$ where $\sup a_k <\infty$. How fast do the $n_k$ grow?
I have $$\log n_k =A_k (1+\delta)^k,$$
and I want to know if I can show that $A_k \searrow 0$. Treating $k, n_k$ as real variables, I have $$\lim_{k\rightarrow \infty}A_k=\lim_{k \rightarrow \infty}\frac{\log n_k}{(1+\delta )^k}.$$ I cannot go further since I don't know how fast the sequence $\lbrace n_k \rbrace$ grows. Using L'Hoptial's Rule I get $$\lim_{k \rightarrow \infty}A_k=\lim _{k \rightarrow \infty}\frac{n_k\cdot \frac{\text{d}}{\text{dx}}n_k}{(1+\delta)^k \log(1+\delta)}$$
Are there any insights as to whether $\lim A_k$ exists? Any ideas about how fast $n_k$ grows?

A: They always grow at least as fast as the Fibonacci numbers, as can be seen from the recursive formula $n_0 =0$, $n_1 = 1$, $n_{k+1} = a_k n_k + n_{k-1}$. However, they can grow as fast as any prescribed sequence, by choosing a rapidly increasing sequence of coefficients $(a_k)$, so you will certainly not be able to show $A_k \to 0$, unless you have some additional assumptions.
If the sequence of coefficients $(a_k)$ is bounded by some number $M$, then you easily get by induction $n_k \le (M+1)^{k}$ (which is not best possible, but good enough), so $\log n_k \le k \log (M+1)$, and $\frac{n_k}{(1+\delta)^k} \to 0$ as $k \to \infty$.


text: Q: Ошибки в webview android apk Написал андроид приложение на java языке. Приложение использует webview для отображения страниц. Тестировал на разных устройствах, в основном работает исправно. Проблема в том, что на 9 Андроиде webview выдает различные, не критичные ошибки, то есть страницы загружаются и все работает. Данные ошибки постоянно мелькают. Подскажите, есть ли способ не отображать ошибки/оповещения webview?

redpajama_set_name: RedPajamaStackExchange


text:
Q: Import PostgreSQL dump into SQL Server - data type errors I have some data which was dumped from a PostgreSQL database (allegedly, using pg_dump) which needs to get imported into SQL Server.
While the data types are ok, I am running into an issue where there seems to be a placeholder for a NULL. I see a backslash followed by an uppercase N in many fields. Below is a snippet of the data, as viewed from within Excel. Left column has a Boolean data type, and the right one has an integer as the data type

Some of these are supposed to be of the Boolean datatype, and having two characters in there is most certainly not going to fly.
Here's what I tried so far:

*

*Import via dirty read - keeping whatever datatypes SSIS decided each field had; to no avail. There were error messages about truncation on all of the boolean fields.

*Creating a table for the data based on the correct data types, though this was more fun... I needed to do the same as in the dirty read, as the source would otherwise not load properly. There was also a need to transform the data into the correct data type for insertion into the destination data source; yet, I am getting truncation issues, when it most certainly shouldn't be.
Here is a sample expression in my derived column transformation editor:
(DT_BOOL)REPLACE(observation,"\\N","")
The data type should be Boolean.

Any suggestion would be really helpful!
Thanks!

A: Since I was unable to circumvent the SSIS rules in order to get my data into my tables without an error, I took the quick-and-dirty approach.
The solution which worked for me was to have the source data read each column as if it were a string, and the destination table had all fields be of the datatype VARCHAR. This destination table will be used as a staging table, once in SS, I can manipulate as needed.
Thank you @cha for your input.


text:
Q: Something went wrong: 1452 (23000): Cannot add or update a child row: a foreign key constraint fails I am trying to insert the following information into the tables I created (below):
    try:
        cursor.execute("INSERT INTO organizer (name, contact) VALUES (%s,%s);", (name, contact))
        conn.commit()
        dbMenu.entryconfig("Clear All Data", state=NORMAL)
        printInLogPanel("insertion successfull")
    except mysql.connector.Error as err:
        print("Something went wrong: {}".format(err))

    try:
        cursor.execute("INSERT INTO event (summary, start_time, location, organizer, num_alarms) VALUES (%s,%s,%s,%s,%s);",(e[2], e[5], e[3], e[1], e[4]))
        conn.commit()
        dbMenu.entryconfig("Clear All Data", state=NORMAL)
        print("Events stored")
    except mysql.connector.Error as err:
        print("Something went wrong: {}".format(err))

My Tables :
CREATE TABLE organizer (
org_id int primary key auto_increment,
name varchar(60) not null,
contact varchar(60) not null
)

CREATE TABLE event (
event_id int primary key auto_increment,
summary varchar(60) not null,
start_time datetime not null,
location varchar(60),
organizer int,
num_alarms int,
foreign key(organizer) references organizer(org_id) on delete cascade)

When I try to execute the Insert commands I get the following error:
Something went wrong: 1452 (23000): Cannot add or update a child row: a
foreign key constraint fails (`wqazi`.`event`, CONSTRAINT
`event_ibfk_1` FOREIGN KEY (`organizer`) REFERENCES `organizer`
(`org_id`) ON DELETE CASCADE)

I've noticed that for table 2 event organizer is an int so im guessing we have to pass the org_id into it somehow but I just don't understand how.

A: This is because the value of event.organizer you try to insert into table event doesn't exist in table organizer.org_id


text:
Q: Convert void* to a dynamic type I have a double variable i, that is converted to a void pointer named pointer:
 double i = 3;
 void *pointer = &i;

When I like to convert the void pointer back to double I used:
 double p = *((double*) pointer);

I would like to convert the void pointer to the type I will send as a char*:
 char* myType= typeid(i).name();//get the name of type of "i"
 int p = *((myType*) pointer); // how to implement?

Is it possible?

A: C/C++ does not work well to interchange datatype like for example JavaScript variables
Format of int value will be different than double value format (floating point) in binary
You cannot get original data type using typeid after it has been casted to void*. Also note that typeid will have different output on different OS and compilers
double dValue = 77.7;
void* pValue = &dValue;

//output "pV" / pointer void (depending on compiler and OS)
std::cout << typeid(dValue).name() << std::endl;

To cast from void* using string you can make rules like following. Or you can try to use C++ template functions in specific cases.
int iOutValue = 0;
double dOutValue = 0;

char* name = "double";
if(!strcmp(name, "int"))
{
    iOutValue = *((int*)pValue);
}
else if(!strcmp(name, "double"))
{
    dOutValue = *((double*)pValue);
}

A: instead of
char* myType= typeid(i).name();//get the name of type of "i"
int p = *((myType*) pointer); // how to implement?

use
typedef decltype(i) myType;
myType p = *((myType*) pointer);

or better:
typedef decltype(i) myType;
auto p = *reinterpret_cast<myType*>(pointer);

Works with c++11 or later. If you want to decltype on older c++ compilers, it is emulated in boost.
Edit. This is probably different from what you wanted to do, which I suppose is something like this:
void myFunction(void* unknownParam) {
    typedef (realTypeOf unknownParam) RealType; // <-- this is not real c++
    RealType &a = *reinterpret_cast<RealType*>(unknownParam)
    //do stuff using 'a'
}

This is not possible in C++, but there is a reason: it doesn't make much sense.
And the reason is that for myFunction to be valid the //do stuff using 'a' part should be valid for whatever type RealType ends up being. As such, it cannot rely on any feature the RealType type have: it cannot use any of its methods, it cannot use any operator, it cannot even know whether it is a class or not. Basically, you cannot do anything more with it than what you would already be able to do on a void*, so giving the type a name doesn't really help you much.
A language feature that is similar to what you want (but not quite it) is type reflection, which is not present in C++, but you can find it in language such as Java, Objective-C or C#. Basically, you ask the object itself if it has a certain method, and eventually call it. An example in Objective-C
-(void)myFunction:(id)unknownParam {
    if([unknownParam respondsToSelector:@selector(myMethod)])
        [unknownParam performSelector:@selector(myMethod)]
}

A: If instead of passing around void* you used some kind of variant type, you would be able to convert it back.
If you use a string to indicate the type you will need some kind of map from string to actual type. Although you can go from type to string, there is no conversion back.
Assuming you know your underlying data is always numeric in some way, there are ways to have special discrete variants that only contain numbers. The simplest would be to store a union of a 64-bit int and a double, and some flag indicating which one you have, and then a method to convert to any numeric type, asDouble(), asLong() etc.


text:
Q: Swift UIView size incorrect I've created a ViewController with a custom xib file. Insider I have a carefully placed view named holderView with the appropriate constraints:

In the controller, i have the following code:
override func viewDidAppear(animated: Bool) {
    super.viewDidAppear(animated)
    println(holderView.bounds)
    println(holderView.frame)
}

I get this values, instead of the real ones:
(0.0,0.0,320.0,568.0)
(0.0,0.0,320.0,568.0)

Does anyone have an idea why this is happening? I've tried the exact same code and view inside a normal storyboard and it works ok. The viewController is loaded and attached by a PageViewController.

A: Auto layout delays the time to draw the subview.  See if this works to get the view dimensions:
override func viewDidLayoutSubviews() {
        println(self.holderView.frame.size)
    }

can use height, width, etc.


text:
Q: Wrong examples in numpy indexing documentation? On the numpy indexing page, there is a warning paragraph

The definition of advanced indexing means that x[(1,2,3),] is fundamentally different than x[(1,2,3)]. The latter is equivalent to x[1,2,3] which will trigger basic selection while the former will trigger advanced indexing. Be sure to understand why this occurs.

I tried to run the following code
import numpy as np

x = np.arange(3*4).reshape((3, 4))
y = x[(1, 2)]
z = x[(1, 2),]

print("base:", x.base, y.base, z.base)
print("id:", id(x.base), id(y.base), id(z.base))
print(np.shares_memory(x, y), np.shares_memory(x, z))

and got the results as
base: [ 0  1  2  3  4  5  6  7  8  9 10 11] None None
id: 4299634928 4297628200 4297628200
False False

It seems that y doesn't return a view and thus x[(1, 2)] can't be a basic indexing because

All arrays generated by basic slicing are always views of the original array.

Is it a mistake in the documentation? Or did I misunderstand somewhere?

A: y isn't a view because it's a scalar, not an array. All arrays generated by basic slicing are always views of the original array.


text:
Q: Trying to Javascript on Website Clarifying the question:
If I run the Js on the button class, it clicks all the buttons. If I run it on the div class, it returns undefined. I want to click all the buttons user-actions-follow-button js-follow-btn follow-button btn small small-follow-btn that are below a specific div class user-actions btn-group not-following not-muting .
Hey there Stack Overflow! Trying do do a click all via Chrome Console
Why doesn't
javascript:var inputs = document.getElementsByClassName('user-actions btn-group not-following not-muting '); for(var i=0; i<inputs.length;i++) { inputs[i].click(); }
work?
HTML is

          <button type="button" class="js-tooltip unmute-button btn small plain-btn" title="Unmute @DPiperScout" data-placement="top">
            Unmute @DPiperScout
          </button><button type="button" class="first-load js-tooltip mute-button btn small plain-btn" title="Mute @DPiperScout" data-placement="top">
            Mute @DPiperScout
          </button>

  <button type="button" class="user-dropdown dropdown-toggle js-dropdown-toggle js-link js-tooltip btn plain-btn small-user-dropdown" title="More user actions">
    User Actions
  </button>

A: I assume you want to click all the buttons. Your selector should be:
document.querySelectorAll(".user-actions.btn-group.not-following.not-muting button");

Hope that helps.

A: Since you are using jQuery you can simply select all the buttons within the div you want using element.find("button"):
$(".user-actions.btn-group.not-following.not-muting").find("button").each(function(){
    this.click();
})


text:
Q: Is it safe to delete MyBusiness OU after migration away from SBS? Back last year we migrated to a number of Windows Server 2012 servers from SBS.
Is it safe to delete the MyBusiness OU that was part of our old SBS setup?
Example contents of Security Group within MyBusiness OU.

A: It should be BUT I would disable the contents first, be it users and/or security groups. If they are still in use (we would sometimes continue to use the groups post migration) and there are issues you can easily re-enable them.
If there are no adverse affects after a number of weeks then make sure you have a good backup and go ahead and delete them.
Hope that helps,
Marcus


text:
Q: Button selection: Angular Is it possible to make multiple selections for a button, something like a checkbox where you could choose multiple options. In my case, I would want to select two buttons then use the ids from the selected the button and transfer their information over to another page. Any insights or solutions on how to go about doing that is much appreciated. Below is an image I knocked up with  functionality I would want to have. On the next page It would display names of titles selected like "testing and mocking metric" I guess that's not important. I assume the route/url would have both id numbers in it. Something to the effect of http://localhost:4200/compare/1&3. Also below are snippets of my program which includes my html file, .ts file and app-routing.module.ts

import { Component, OnInit } from '@angular/core';
import { Domain } from '../library';
import { DOMAIN } from '../domain-names';

@Component({
  selector: 'app-compare',
  templateUrl: './compare.component.html',
  styleUrls: ['./compare.component.css']
})
export class CompareComponent implements OnInit {

  domain = DOMAIN;

  selectedDomain: Domain;

  onSelect(dom: Domain): void {
    this.selectedDomain = dom;
  }

  constructor( ) {
  }

  ngOnInit() {

  }

}
ul {
   padding: 0;
   width: 1200px;
   margin: 20px auto;
 }

li{
   display: inline;
}

h2{
  text-align: center;
}

.btn-info{
  margin: 6px;
}

.button-row{
  margin: auto;;
}

.btn-outline-light {
    padding: 6px;
    border: 4px solid #eee;
    box-shadow: #555 1px 1px 8px 1px;
    height: 160px;
    width: 200px;
    color: black;
}

 Visualized Metrics By Domain

        <button type="button" class="btn-outline-light">{{dom.catergory}}</button>

import { NgModule }  from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { CompareComponent } from './compare/compare.component';
import {  DomainCompareComponent } from './domaincompare/domaincompare.component';

const routes: Routes = [
  { path: '', redirectTo: '/dashboard', pathMatch: 'full' },

  { path: 'compare', component: CompareComponent },
  { path: 'compare/:id', component: DomainCompareComponent}

];

@NgModule({
  imports: [ RouterModule.forRoot(routes
  ) ],
  exports: [ RouterModule ]
})
export class AppRoutingModule {}

A: Don't use buttons, since you probably don't want any immediate action. And they are harder to style anyway.

And in component:
selectedDomains: Domain[];

toggleDomain(domain: Domain) {
    if(this.selectedDomains.includes(domain)) {
        this.selectedDomains.splice(this.selectedDomains.indexOf(domain), 1);
    } else {
        this.selectedDomains.push(domain);
    }
}

isSelected(domain: Domain) {
    return this.selectedDomains.includes(domain);
}

Then you have an array of selected domains, which you can easily send to the other component.
Next page component will probably need to receive the data as input:
<next-page-selector [domains]="domains"></next-page-selector>

@Input() domains: Domain[];

So you can show selected component names. Next component template:
{{domain.name}}


text:
Q: How to prevent inline-block divs from wrapping?
jsFiddle demo

I want the divs to:

*

*Wrap their content.

*Stay in their originally associated line, essentially without wrapping.

Basically, the tables are stacking below each other, when they can't stay on screen. I would rather they become hidden off screen.
I've tried adding overflow: hidden; to the main layout style. I do not want to fix a width for each div. It needs to fit content in.

.layout {
  -moz-border-radius: 15px;
  border-radius: 15px;
  vertical-align: top;
  display: inline-block;
}

.layoutbacking {
  -moz-border-radius: 15px;
  border-radius: 15px;
  padding: 5px;
  margin: 5px;
  background: #CCCCCC;
}

          header 1
          header 2
          header 3
          header 4

          data 1
          data 2
          data 3
          data 4

          data 1
          data 2
          data 3
          data 4

          data 1
          data 2
          data 3
          data 4

            header 1
            header 2
            header 3
            header 4

            data 1
            data 2
            data 3
            data 4

            header 1
            header 2
            header 3
            header 4

            data 1
            data 2
            data 3
            data 4

          header 1
          header 2
          header 3
          header 4

          data 1
          data 2
          data 3
          data 4

          header 1
          header 2
          header 3
          header 4

          data 1
          data 2
          data 3
          data 4

A: Add white-space: nowrap; to your .layout style declaration.
This will do exactly what you need: preventing the divs from wrapping.
Watch the

jsFiddle demo

or run the following snippet full screen and resize it:

.layout {
       white-space : nowrap; /* this does the trick */
          overflow : hidden; /* this prevents the grey divs from overflowing */
    vertical-align : top;
     border-radius : 15px;
           display : inline-block;
}

.layoutbacking {
    border-radius : 15px;
       background : #CCCCCC;
          padding : 5px;
           margin : 5px;
}

                    header 1
                    header 2
                    header 3
                    header 4

                    data 1
                    data 2
                    data 3
                    data 4

                    data 1
                    data 2
                    data 3
                    data 4

                    data 1
                    data 2
                    data 3
                    data 4

                        header 1
                        header 2
                        header 3
                        header 4

                        data 1
                        data 2
                        data 3
                        data 4

                        header 1
                        header 2
                        header 3
                        header 4

                        data 1
                        data 2
                        data 3
                        data 4

                    header 1
                    header 2
                    header 3
                    header 4

                    data 1
                    data 2
                    data 3
                    data 4

                    header 1
                    header 2
                    header 3
                    header 4

                    data 1
                    data 2
                    data 3
                    data 4

A: This will stop text wrapping, and keep it inline
.leftContent { float: left; }
.rightContent { overflow: hidden; }


text:
Q: Auth0 not redirecting to the assigned URL (React) auth.js
import auth0 from 'auth0-js';

export default class Auth {
    constructor() {
        this.auth0 = new auth0.WebAuth({
            domain: '<properURL>',
            clientID: '<properID>',
            redirectUri: 'http://localhost:3000/',
            audience: '<blahblah>',
            responseType: 'token id_token',
            scope: 'openid'
        });
        this.login = this.login.bind(this);
        this.logout = this.logout.bind(this);
        this.handleAuthentication = this.handleAuthentication.bind(this);
        this.isAuthenticated = this.isAuthenticated.bind(this);
    }

    login() {
        // console.log(this.auth0);
        this.auth0.authorize();
    }
    handleAuthentication() {
        this.auth0.parseHash((err, authResult) => {
        if (authResult && authResult.accessToken && authResult.idToken) {
            this.setSession(authResult);
            // history.replace('/lobby');
        } else if (err) {
            // history.replace('/lobby');
            console.log(err);
        }
        });
    }

    setSession(authResult) {
        // Set the time that the access token will expire at
        let expiresAt = JSON.stringify((authResult.expiresIn * 1000) + new Date().getTime());
        localStorage.setItem('access_token', authResult.accessToken);
        localStorage.setItem('id_token', authResult.idToken);
        localStorage.setItem('expires_at', expiresAt);
        // navigate to the home route
        // history.replace('/lobby');
    }

    logout() {
        // Clear access token and ID token from local storage
        localStorage.removeItem('access_token');
        localStorage.removeItem('id_token');
        localStorage.removeItem('expires_at');
        // navigate to the home route
        // history.replace('/lobby');
    }

    isAuthenticated() {
        // Check whether the current time is past the
        // access token's expiry time

        //return localStorage.length > 0;
        // console.log(localStorage)
        let expiresAt = JSON.parse(localStorage.getItem('expires_at'));
        return new Date().getTime() < expiresAt;
    }
}

Lobby.jsx
import React, { Component } from 'react';
import Auth from '../Auth/Auth.js';
import {
  HashRouter as Router,
  Route,
  Link
} from 'react-router-dom'

export default class Lobby extends Component {
    constructor(props) {
        super(props)
        this.auth = new Auth();
        this.state = {
            meep: 'whooosh'
        }
    }
    render() {
        return (

                {!this.auth.isAuthenticated() ?
                <button onClick={this.auth.login}>Please Login to Play</button>
                :
                <Link to='/room'>

Click here to join game

                </Link>
                }

        );
    }
}

I've been following the Auth0 tutorial for working with React but I can't get it to actually work properly. When clicking on the login button, it goes through the whole authentication process, but fails to redirect to the redirectUri that I specify. It appends all the access token information into the URL and pretty much breaks the react-router. Nothing on the page loads. But, if I console.log the local storage, I see the proper authentication has been completed. If I delete the access token info from the url so it is just the server's home route, it detects that I'm authenticated and allows me to continue.
So it just isn't redirecting properly. Any idea why?

A: As written, you have the history.replace('...') lines commented out. If you're following the Auth0 tutorial then those history lines it what it relies on to do the various redirects when handling the authentication flow. Once you click the Login button, you're most likely being redirected out of your app, to auth0, and then back into your app.
However! Even with those history.replace lines I personally was having issues with their history setup and react router 4. What I ended up using was  a plain old window.location = "/" to handle the redirects and it both worked properly,  and re-rendered the components as needed.
If you're using react router 4, you may also need to make sure you have the callback route setup as well. For example:
<Router>

        <Route exact path="/" component={Lobby}/>
        <Route
            path="/callback"
            render={(props) => {
                this.handleAuthentication(props);
                return <Callback {...props} auth={this.auth}/>
            }}
        />

</Router>

where the handleAuthentication function is the wrapper function from the auth0 example:
handleAuthentication = (props, replace) => {
    if (/access_token|id_token|error/.test(props.location.hash)) {
        this.auth.handleAuthentication();
    }
};


text:
Q: Kerberos service authentication I have installed Kerberos on my Cloudera manager server and I want to control which components each user can use through Kerberos. Currently, once you create a principal for the user, he immediately can use every service/component.
So is it possible to control which services (Impala, hive, etc.) a user can use through Kerberos? Or not?


text:
Q: selenium ajax dynamic pagination base spider I am trying to run my Base spider for dynamic pagination but I am not getting success in crawling. I have used selenium ajax dynamic pagination. the url I am using is: http://www.demo.com. Here is my code:
# -*- coding: utf-8 -*-
import scrapy

import re

from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor

from scrapy.selector import Selector

from scrapy.spider import BaseSpider

from demo.items import demoItem

from selenium import webdriver

def removeUnicodes(strData):

        if(strData):

            #strData = strData.decode('unicode_escape').encode('ascii','ignore')

            strData = strData.encode('utf-8').strip()

            strData = re.sub(r'[\n\r\t]',r' ',strData.strip())

            #print 'Output:',strData

        return strData

class demoSpider(scrapy.Spider):
    name = "demourls"

    allowed_domains = ["demo.com"]

    start_urls = ['http://www.demo.com']

     def __init__(self):
        self.driver = webdriver.Firefox()

    def parse(self, response):
        print "*****************************************************"
        self.driver.get(response.url)
        print response.url
        print "______________________________"

        hxs = Selector(response)
        item = sumItem()
        finalurls = []
        while True:
            next = self.driver.find_element_by_xpath('//div[@class="showMoreCars hide"]/a')

            try:
                next.click()
                # get the data and write it to scrapy items
                item['pageurl'] = response.url
                item['title'] =  removeUnicodes(hxs.xpath('.//h1[@class="page-heading"]/text()').extract()[0])
                urls = hxs.xpath('.//a[@id="linkToDetails"]/@href').extract()
                print '**********************************************2***url*****************************************',urls

                for url in urls:
                    print '---------url-------',url
                finalurls.append(url)

                item['urls'] = finalurls

            except:
                break

        self.driver.close()

        return item

my items.py is
from scrapy.item import Item, Field

class demoItem(Item):

    page = Field()
    urls = Field()

    pageurl = Field()
    title = Field()

when I am trying to crawl it and convert it in json I am getting my json file as:
[{"pageurl": "http://www.demo.com", "urls": [], "title": "demo"}]

I am not able to crawl all urls  as it is dynamically loading.

A: First of all, you don't need to press showMoreCars button as it will be dynamically pressed after page load. Instead, waiting for some second will be enough.
Apart from you scrapy code, selenium is able to capture all hrefs for you. Here is an example of what you need to do in selenium.
from selenium import webdriver

driver = webdriver.Firefox()

driver.get("http://www.carwale.com/used/cars-in-trichy/#city=194&kms=0-&year=0-&budget=0-&pn=2")
driver.implicitly_wait(5)
urls = driver.find_elements_by_xpath('.//a[@id="linkToDetails"]')
for url in urls:
    print url.get_attribute("href")
driver.close()

all you need is to merge this with your scrapy part.
Output:
http://www.carwale.com/used/cars-in-trichy/renault-pulse-s586981/
http://www.carwale.com/used/cars-in-trichy/marutisuzuki-ritz-2009-2012-s598266/
http://www.carwale.com/used/cars-in-trichy/mahindrarenault-logan-2007-2009-s607757/
http://www.carwale.com/used/cars-in-trichy/marutisuzuki-ritz-2009-2012-s589835/
http://www.carwale.com/used/cars-in-trichy/hyundai-santro-xing-2003-2008-s605866/
http://www.carwale.com/used/cars-in-trichy/chevrolet-captiva-s599023/
http://www.carwale.com/used/cars-in-trichy/chevrolet-enjoy-s595824/
http://www.carwale.com/used/cars-in-trichy/tata-indicav2-s606823/
http://www.carwale.com/used/cars-in-trichy/tata-indicav2-s606617/
http://www.carwale.com/used/cars-in-trichy/marutisuzuki-estilo-2009-2014-s592745/
http://www.carwale.com/used/cars-in-trichy/toyota-etios-2013-2014-s605950/
http://www.carwale.com/used/cars-in-trichy/tata-indica-vista-2008-2011-s599001/
http://www.carwale.com/used/cars-in-trichy/opel-corsa-s591616/
http://www.carwale.com/used/cars-in-trichy/hyundai-i20-2008-2010-s596173/
http://www.carwale.com/used/cars-in-trichy/tata-indica-vista-2012-2014-s600753/
http://www.carwale.com/used/cars-in-trichy/fiat-punto-2009-2011-s606934/
http://www.carwale.com/used/cars-in-trichy/mitsubishi-pajero-s597849/
http://www.carwale.com/used/cars-in-trichy/fiat-linea20082014-s596079/
http://www.carwale.com/used/cars-in-trichy/tata-indicav2-s597390/
http://www.carwale.com/used/cars-in-trichy/mahindra-xylo-2009-2012-s603434/

A: I hope the below code will help.
somespider.py
# -*- coding: utf-8 -*-
import scrapy
import re
from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor
from scrapy.selector import Selector
from scrapy.spider import BaseSpider
from demo.items import DemoItem
from selenium import webdriver

def removeUnicodes(strData):
        if(strData):
            strData = strData.encode('utf-8').strip()
            strData = re.sub(r'[\n\r\t]',r' ',strData.strip())
        return strData

class demoSpider(scrapy.Spider):
    name = "domainurls"
    allowed_domains = ["domain.com"]
    start_urls = ['http://www.domain.com/used/cars-in-trichy/']

    def __init__(self):
        self.driver = webdriver.Remote("http://127.0.0.1:4444/wd/hub", webdriver.DesiredCapabilities.HTMLUNITWITHJS)

    def parse(self, response):
        self.driver.get(response.url)
        self.driver.implicitly_wait(5)
        hxs = Selector(response)
        item = DemoItem()
        finalurls = []
        while True:
            next = self.driver.find_element_by_xpath('//div[@class="showMoreCars hide"]/a')

            try:
                next.click()
                # get the data and write it to scrapy items
                item['pageurl'] = response.url
                item['title'] =  removeUnicodes(hxs.xpath('.//h1[@class="page-heading"]/text()').extract()[0])
                urls = self.driver.find_elements_by_xpath('.//a[@id="linkToDetails"]')

                for url in urls:
                    url = url.get_attribute("href")
                    finalurls.append(removeUnicodes(url))

                item['urls'] = finalurls

            except:
                break

        self.driver.close()
        return item

items.py
from scrapy.item import Item, Field

class DemoItem(Item):
    page = Field()
    urls = Field()
    pageurl = Field()
    title = Field()

Note:
You need to have selenium rc server running because HTMLUNITWITHJS works with selenium rc only using Python.
Run your selenium rc server issuing the command :
java -jar selenium-server-standalone-2.44.0.jar

Run your spider using command:
spider crawl domainurls -o someoutput.json


text:
Q: How to store a huge hash table in RAM and share it between different applications? The data contains information like billions of ID-scores pairs. To quickly access these paired information, I plan to use the hash-table container since its time complexity of search is O(1). Considering the the raw data is around 80G, I don't want to load the data into RAM every time when I need to run search application. What I want to do is to generate the hash-table once and then store it in RAM with persistence of filesystem lifetime (the expense of RAM is not a criteria), and search it with different applications.
Based on my limited understanding, I could use "Memory Mapped Files" (boost C++ libraries). But I have questions:
1) Is it possible to keep the hash-table data structure when write it to the mapped file?
2) How much time it will cost to map the existed file to RAM?
Any answers/comments/suggestions are most welcomed!
Thanks,

A: 1) Yes. The file is just bytes, just like memory.
2) Creating the mapping will be effectively instantaneous. Node that you won't be able to map all of it contiguously at once except on a 64-bit OS. Of course, if the file cache can't hold the portion of the map you're using, it will have to be read from disk.
How big are IDs? How big are pairs? How much locality of reference do you have? (Are there heavily-used pair and lightly used pairs?) How often will you be searching for pairs that aren't present? Is the data read-mostly? There may be better ways to do it. I'd strongly suggest starting with a broader question to make sure you're not stuck on a sub-optimal path.


text:
Q: Can not update existing points on chart in Windows Forms In my WinForms C# program, while increasing and decreasing X axis values using a trackbar I need to update the existing Y axis values that were already drawn on a chart System.Windows.Forms.DataVisualization.Charting.Chart but for some reason for most of the X points the chart still displays both the old and the new Y values. Originally I thought that the following should act properly:
    private void UpdatePoint(int aIndex, float aX, float aY)
    {
        DataPoint found = null;
        if (_chart.Series[aIndex].Points.Count > 0 &&
            (found = _chart.Series[aIndex].Points.FindByValue(aX, "X")) != null)
        {
            if (found.YValues[0] != aY)
                found.SetValueXY(aX, aY);
        }
        else
        {
            _chart.Series[aIndex].Points.AddXY(aX, aY);
        }
    }

First I thought that I am doing the update not the right way and tried deleting the point and adding a new point with the new Y value but although debugger said there was only one point with one Y value for each X I still see two Y values and it means that the chart is not refreshed properly.   Trying invalidating or refreshing the chart did not help. How can I achieve the proper points update. Am I missing something?
Thanks!

A: _chart.Series[yourSeriesIndex].Points.Clear();

As i get the problem; this partial example should help you to clear the old values which series points you want.

A: The best I can offer to you is to delete it and switch over to WPF. Winforms is just a too big pain in the ass


text:
Q: Wordpress a:2:{s:13:"administrator";b:1;} vs a:1:{s:13:"administrator";b:1;} causing "You do not have sufficient permissions to access this page" I have "You do not have sufficient permissions to access this page." issue when trying to access Wordpress wp-admin login as an administrator. The login page appears, but when the user details are entered the "You do not have sufficient permissions to access this page." appears.
The strange part is that I have another administrator account that accesses with no error.
I tried to create a new administrator account, but that also cannot access giving the above error message.
I have looked into the database and the users that don't work have wp_capabilities of a:1:{s:13:"administrator";b:1;}
The user that does work has: a:2:{s:13:"administrator";b:1;s:13:"bbp_keymaster";b:1;}
I am also running S2 Member plugin.
The only difference I can see between the account is this beginning section of a:1 and a:2. All of the sites I see say the account should be a:1
I don't think it is a plugin issue, as I assume then I would not be able to access either. I think perhaps something to do with s" Member plugin, but I'm now at a bi of a loss.
All plugins are updated and running Wordpress 4.0 (however this was an issue even before upgrade to 4.0)
All help gratefully received!

A:
The only difference I can see between the account is this beginning section of a:1 and a:2.

Look more carefully. The working example has a whole extra section: s:13:"bbp_keymaster";b:1;
To understand why that matters, it helps to know that that is the format produced by by PHP's serialize() function.
If you unserialize each of those strings, you will find that the first is an array with 1 entry (hence a:1), with the key 'administrator' and a value of true. The longer string is an array with that entry plus another one, with the key 'bbp_keymaster', also set to true.
From this, it's easy to surmise that 'administrator' and 'bbp_keymaster' are the internal names for permissions which can be granted to a user, and the page in question is only available to users with the 'bbp_keymaster' permission.


text:
Q: Read php file without opening and closing php tags I have a question regarding rendering php files without php tags. Is there away to ignore the  tags?
On a clients hosted environment our php script ran fine without the the opening and closing tags, however it died on our server. Just curious if there is a setting in the php.ini for this.
Thanks

A: It's considered good practice to omit the ending PHP tag in files that contain only PHP code. The beginning PHP tag is always required, however, as it is the only indication the interpreter has about what it needs to parse.
There are likely several ways to "cheat" this, such as running the tag-less code inside of an eval() statement, but there is arguably little reason to ever do this.


text:
Q: Comma before who What's the difference between the following two sentences?

*

*He is a boy who can speak English.

*He is a boy, who can speak English.

A: A comma before "who" is used in parenthetical expressions. For example

My youngest son, who has just turned twelve, is a real genius.

As you can see, the "who" clause here adds some information but can be removed without making the sentence incorrect or incomplete. For clarity, the "who" clause must be separated from the other parts of the sentence; you can either use commas, dashes or parentheses.
Similar example with "which":

I am planning to sail across the Pacific ocean, which is the largest body of water in the world.

Your sentence above is not parenthetical; "who can read English" is an essential part of it. Therefore you should not use a comma.


text:
Q: Where should I post my Office 365 SharePoint related questions? What are the good forums to post Office 365 SharePoint developer related questions?
Thank you,

A: Either here or stackexchange.com I would say.

A: apart from the Stackexchange, you can visit the MSFT own technet forum.
https://social.technet.microsoft.com/Forums/msonline/en-US/home?forum=sharepointdevelopment
or 365 community. https://community.office365.com/en-us/f/154

A: One more to the list.
Yammer Office 365 network. Better to post the question on StackExchange and share it there for more audience if no response from here.


text:
Q: Cannot publish dynamic web project in Eclipse I unzipped a fresh copy of Tomcat 9 in my user directory and configured the server under eclipse. I created a dynamic web project and an index.html file in my web content directory. When I run the project I cannot access my it at http://localhost:8080/project/index.html.

A: My eclipse project name consisted of two words. Once I renamed the project to a single word, I was able to deploy and access the website.


text:
Q: Average value of vector in C using mpi Hello friends i am currently working on a C project for my university class. What i am trying to do is find the average value of a vector, however i need to do that by using mpi.
I written some code but vor some reason the average value that i get is zero
consider the following code:
#include <stdio.h>
#include "mpi.h"

int main(int argc, char** argv)
{
    int my_rank;
    int plithos_dierg, k, res, finres, num;
    int source, target;
    int tag1 = 50, tag2 = 60, tag3 = 70;
    int plithos;
    float data[100], mesi_timh = 0, m, f1;
    float data_loc[100];
    MPI_Status status;

    MPI_Init(&argc, &argv);
    MPI_Comm_rank(MPI_COMM_WORLD, &my_rank);
    MPI_Comm_size(MPI_COMM_WORLD, &plithos_dierg);

    if (my_rank == 0) {

        printf("Dwse to PLITHOS twn stoixeiwn tou dianhsmatos \n");
        scanf("%d", &plithos);
        printf("Dwse ta stoixeia tou dianhsmatos \n");

        for (int i = 0; i < plithos; i++) {
            printf("Dwse to %d noumero \n", i);
            scanf("%f", &data[i]);
            //mesi_timh=mesi_timh + data[i];
        }
        for (target = 1; target < plithos_dierg; target++) {
            MPI_Send(&plithos, 1, MPI_INT, target, tag1, MPI_COMM_WORLD);

            num = plithos / plithos_dierg; //posous arithmous h kathe diergasia.
            k = num;
        }

        for (target = 1; target < plithos_dierg; target++) {
            MPI_Send(&data[k], num, MPI_FLOAT, target, tag2, MPI_COMM_WORLD);
            k += num;
        }
        for (k = 0; k < num; k++)
            data_loc[k] = data[k];
    }
    else {
        MPI_Recv(&plithos, 1, MPI_INT, 0, tag1, MPI_COMM_WORLD, &status);
        num = plithos / plithos_dierg;
        MPI_Recv(&data_loc[0], num, MPI_INT, 0, tag2, MPI_COMM_WORLD, &status);
    }
    res = 0;
    for (k = 0; k < num; k++) {
        res = res + (data_loc[k]);
        printf(" mesa sto for %d \n", res);
    }
    // f1=res/plithos;
    //printf("mesi timi m %f",f1);

    if (my_rank != 0) {
        printf("prin to mpi send %d \n", res);
        MPI_Send(&res, 1, MPI_INT, 0, tag3, MPI_COMM_WORLD);
    }
    else {

        printf("\n Apotelesma of process %d: %d\n", my_rank, res);
        finres = res;
        for (source = 1; source < plithos_dierg; source++) {
            MPI_Recv(&res, 1, MPI_INT, source, tag3, MPI_COMM_WORLD, &status);

            printf("\n Apotelesma of process %d: %d\n", source, res);
            finres = finres + res;
        }
        /*
     printf("\n DIANHSMA:[ ");
    for(int i=0;i<plithos;i++) {
      printf("%f",data[i]);
      printf(", ");
      }
     printf("] ");*/
        printf("to plithos einai %d \n", plithos);
        printf("to final result einai %f \n", finres);
        printf("\n\n\n H MESH TIMH TOY DIANHSMATOS EINAI: %f\n", finres / plithos);
    }
    printf("\n\n\n H MESH TIMH TOY DIANHSMATOS EINAI: %f\n", finres / plithos);
    MPI_Finalize();
    // printf("\n\n\n H MESH TIMH TOY DIANHSMATOS EINAI: %f\n", finres/plithos);
}

At some point i noticed that when i try to print the vector instead of zero i get the last number of the vector as my final result. I am a newbie in mpi programming so please forgive my mistakes
thanks in advance!


text:
Q: Why does apscheduler not work in uwsgi mode? I have a flask application. This application mimics routing of vehicles in a city and when a vehicle reaches a designated point, I have to wait for 30-180 seconds before starting it again. I am trying to use apscheduler for this.
When the vehicle arrives I start an apscheduler job (with the 'date' trigger for X seconds). When the job fires, I do my processing.
This works well on my dev machine when I am running the flask app standalone. But when I try to run it on my production server (where the app is running in uwsgi mode) the job never fires. I have already set --enable-threads=true for the app, so that doesn't seem to be the problem.
My relevant code is like this.
At my app initialization.
   scheduler = BackgroundScheduler()
   scheduler.start()

Whenever the trigger happens.
scheduler.add_job(func=myfunc, trigger='date', run_date=datetime.datetime.now() + datetime.timedelta(seconds=value)).

Anything I am missing in using apscheduler in uwsgi mode? Or any other options in flask to achieve what I want to?


text:
Q: moving uploaded file to a dynamic table in php I'm trying to move the file that I uploaded using move_uploaded_file. Here are my variables:
    $filename = $_FILES['File_file']['name'];
    $folder_id = $_POST['File']['folder_id'];
    $folder_name_result = $this->filemanager_model->getfoldername($folder_id);
    $fileloc = $_FILES['File_file']['tmp_name'];
    $folder_name = "";
    foreach ($folder_name_result->result_array() as $row)
    {$folder_name = $row['title'];}
    $pathAndName = "filemanager/".$folder_name."/".$filename;

And the outputs of the variables:
$folder_name = Grrr
$pathAndName = filemanager/Grrr/cis.png
$fileloc = C:\xampp1.8\tmp\phpE21E.tmp
When I run the move_uploaded_file function, it generates an error where:
move_uploaded_file(filemanager/Grrr/cis.png): failed to open stream: No such file or directory
move_uploaded_file(): Unable to move 'C:\xampp1.8\tmp\php2565.tmp' to 'filemanager/Grrr/cis.png'
My filepaths:
/admin - base_url
/admin/filemanager/Grr - The folder I want it to save
/admin/application/controllers/- the path of my controllers
Is there something wrong with my code as to why it's not working?

A: I just had something wrong with the formatting of my file path. I had to include the exact path since I'm on localhost, so once I put this on the server I've got to change path to the one on my server.
$pathAndName = "C:\\xampp1.8/htdocs/cicubecms/admin/filemanager/".$cat_name."/".$folder_name."/".$filename;


text:
Q: Is every finite Borel measure on a locally compact Hausdorff, $\sigma$-compact and separable space automatically regular? The conditions stated in the question seem mouthful and a bit arbitrary, so let me provide some backgrounds.

Definition
Let $\mu$ be a Borel measure on a topological space. We say:

*

*$\mu$ is outer regular on a Borel set $E$ if $\mu(E) = \inf\{\mu(U) : E\subseteq U \text{ is open}\}$,

*$\mu$ is inner regular on a Borel set $E$ if $\mu(E) = \sup\{\mu(K) : E\supseteq K \text{ is compact}\}$ (Some authors call this tight),

*$\mu$ is a Radon measure if $\mu$ is finite on all compact sets, outer regular on all Borel sets and inner regular on all open sets,

*$\mu$ is a regular measure if $\mu$ is finite on all compact sets and both outer regular and inner regular on all Borel sets.

The subtle difference between a Radon measure and a regular measure is annoying. Fortunately, every $\sigma$-finite Radon measure on a locally compact Hausdorff space is automatically regular:

Theorem 1
Let $X$ be a locally compact Hausdorff space. Then every Radon measure on $X$ is inner regular on all of its $\sigma$-finite sets. In particular, every $\sigma$-finite Radon measure on $X$ is regular.
Corollary 1
Let $X$ be a locally compact Hausdorff space. A finite Borel measure on $X$ is regular if and only if it is outer regular on all Borel sets and inner regular on all open sets.

Next, by using Riesz representation theorem on locally compact Hausdorff spaces, one can prove the following:

Theorem 2
Let $X$ be a locally compact Hausdorff space. If every open set in $X$ is $\sigma$-compact, then every Borel measure on $X$ that is finite on compact sets is regular.

A special case is a separable metric space:

Corollary 2
Let $X$ be a locally compact, separable metric space. Then every finite Borel measure on $X$ is regular.

The proof of this corollary relies on the following general topological result:

Lemma
A locally compact metric space is $\sigma$-compact if and only if it is separable, in which case every open set is $\sigma$-compact.

In case local compactness is not given, one still has the following result:

Theorem 3
Let $X$ be a separable complete metric space. Then every finite Borel measure on $X$ is regular.

Note that a locally compact metric space can be given a compatible complete metric, so Theorem 3 also implies Corollary 2.

Another special case of Theorem 2 is a second-countable space:

Corollary 3
Let $X$ be a second-countable and locally compact Hausdorff space. Then every finite Borel measure on $X$ is regular.

Proof: A locally compact Hausdorff space is topologically regular, so by Urysohn's metrization theorem, $X$ is metrizable. On the other hand, a second-countable space is separable. Thus, $X$ is locally compact, separable and metrizable, so Corollary 2 applies.

Finally, in view of the above results, my question is:

Question
Let $X$ be a locally compact Hausdorff, $\sigma$-compact and separable space, which may or may not be metrizable. Is every finite Borel measure on $X$ regular? If not, please give a counter-example.

A: No.  Counterexamples include $X = \{0,1\}^\kappa$ or $[0,1]^\kappa$ for any $\aleph_0 < \kappa \le \mathfrak{c}$.  These spaces are compact Hausdorff (Tikhonov's theorem) and are separable (Hewitt-Marczewski-Pondiczery).
(This special case of H-M-P can also be proved directly. For example, with $X =[0,1]^\kappa$, identify $\kappa$ with a subset of $[0,1]$, so that $X$ is a space of functions from $[0,1]$ to itself; then it is easy to show that the set of polynomials with rational coefficients is dense in $X$.)
Now the uncountable successor ordinal $\omega_1 + 1$, with its order topology, can be embedded in $X = \{0,1\}^\kappa$ or $X = [0,1]^\kappa$.  See Fremlin, Measure Theory, 434K(d) (thanks to Robert Furber for the reference). One can also follow a construction similar to the Stone-Čech compactification and embed $\omega_1 + 1$ into $[0,1]^{C(\omega_1+1, [0,1])}$, noting that $|C(\omega_1 + 1, [0,1])| = \mathfrak{c}$.  Either way, call the embedding $\phi$.
Let $\nu$ be the famous Dieudonné measure on $\omega_1 + 1$, where $\nu(B) = 1$ if $B$ contains a closed unbounded subset of $\omega_1$ and $\nu(B) = 0$ otherwise.  (See Fremlin 411Q  and 4A3J for details.)  Then the pushforward $\mu = \nu \circ \phi^{-1}$ is a finite Borel measure on $X$ which is not regular.
Specifically, since $\phi$ is an embedding and $\omega_1$ is open in $\omega_1 + 1$, then the image $A = \phi(\omega_1)$ is a relatively open subset of the compact set $\phi(\omega_1 + 1)$, so that $A$ is the intersection of an open set and a closed set in $X$, and in particular is Borel.  Moreover $\mu(A) = \nu(\omega_1) = 1$.  But if $K$ is any compact subset of $A$, then $\phi^{-1}(K)$ is a compact subset of $\omega_1$, hence $\mu(K) = \nu(\phi^{-1}(K)) = 0$.  Thus inner regularity fails.
This example is also Exercise 7.14.130 of Bogachev's Measure Theory.


text:
Q: history.push('/dashboard') is updating the url but not navigating to it? There are any questions like this in stackoverflow. But I am not able to find a solution.
Here is part of my my index.js
ReactDOM.render(
<BrowserRouter>
 <Provider store={store}>
   <Login />
 </Provider>
</BrowserRouter>,
document.getElementById('root')
);

This is part of my Login component
export default function BasicExample() {
 return (
 <Router>
  <Switch>
    <Route exact path="/dashboard" component={Dashboard}>
      <Dashboard />
    </Route>
    ........
  </Switch>
  </Router>
 )
}

const Login = () => {
  function handleLogin (e) {
     .....
     history.push("/dashboard");
     .....
  }
}

I don't know what is wrong. I am using react-admin template. Can anyone help?

A: from the doc

that uses the HTML5 history API (pushState, replaceState and the
popstate event) to keep your UI in sync with the URL.

I'm not seeing where you are passing/declaring the history object
in your login
You can use this:
import { useHistory } from "react-router-dom";
let history = useHistory();

or just use the normal router
import { Router } from "react-router";
import { createBrowserHistory } from "history";

const history = createBrowserHistory();
ReactDOM.render(
  <Router history={history}>
    <Provider store={store}>
      <Login />
    </Provider>
  </Router>,
)


text:
Q: List only numerical directory names in linux How to list only numerical directory names in Linux.
Only directories, that has only numeric characters?

A: In bash, you can benefit from extended globbing:
shopt -s extglob
ls -d +([0-9])/

Where

+(pattern-list)

Matches one or more occurrences of the given patterns

The / at the end limits the list to directories, and -d prevents ls from listing their contents.

A: There are multiple solutions to do it.
1.You can List just dirs and then remove . and / from the names and then Grep just numerical ones:
ls -d ./*/ | sed 's/\.\///g' | sed 's/\///g' | grep -E '^[0-9]+$'

2.By "ls" & "grep" & then "awk". Just list with details, Grep dirs and then Print 9th column:
ls -llh | grep '^d' | awk '{print $9}'

Good luck In Arbaeen.


text:
Q: Maximum request length exceeded - no file upload I have googled this exception extensively, and all the discussions I've found (including those on this forum) seem to be related to file uploading and exceeding the allowed file size limit. In my case however, I am not uploading anything, it is a simple postback.
I have a gridview displaying the results of an SQL query. This works correctly and displays the data as expected. Also, on the page are a couple dropdowns used to filter the data via control parameters on the SQL data source. However, any postback created on the page cause the above exception.
I have tested the query and all the filter parameters work as expected. I have tested removing various controls and cannot determine a single cause or point of failure, as the error occurs regardless of how the postback is triggered.
Any suggestions appreciated.

A: Possible duplicate of Maximum request length exceeded exception on postback ?
Most likely you have ViewState enabled for the GridView, and a large amount of data in the GridView. If you do not need to maintain view state on the grid between postbacks, then you can disable it for that control by setting EnableViewState="false" on the control.
When ViewState is enabled for an ASP.NET webpage, a hidden field is added to the page that contains an encoded string that details the state of each control on the page (except those that have ViewState disabled). When the page is posted to the server, that field goes with it. Unfortunately, some controls like the GridView can contain a very large amount of state information, and this can result in a very large amount of post data, which can be enough to exceed the limits set for your application. As mentioned below, the default limit is 4MB.
ViewState can be disabled for your entire application, or for specific controls. Alternatively, you can increase the maximum request size. Please refer to the referenced question for details on this.

A: maxRequestLength does not specifically mean file upload, but refers to the overall size of the complete request, including headers and request body.
This is a server-side setting that defaults to 4 Mb, but may have been set differently in the configuration of your server.
Have you tried a network capture to see just how large your postback request is on the wire?


text:
Q: Problems using BigCommerce API to generate an order on the store I am attempting to generate orders on my BigCommerce store using the BigCommerce API. I am using the code below to accomplish this. I am able to ping BigCommerce just fine and I get no errors in the php code. The problem is that it doesn't ever generate the order on my Bigcommerce store.
require('vendor/autoload.php');

use Bigcommerce\Api\Client as Bigcommerce;

Bigcommerce::configure(array(
'store_url' => 'https://my-store.bigcommerce.com/',
'username'  => 'admin',
'api_key'   => 'XXXXXX'
));

$ping = Bigcommerce::getTime();
if ($ping){ echo $ping->format('H:i:s');}

$createFields = array(
"customer_id" => 0,
"date_created" => $today,
"status_id" => 1,
"billing_address" => array(
        "first_name" => "Trisha",
        "last_name" => "McLaughlin",
        "company" => "",
        "street_1" => "12345 W Anderson Ln",
        "street_2" => "",
        "city" => "Austin",
        "state" => "Texas",
        "zip" => "78757",
        "country" => "United States",
        "country_iso2" => "US",
        "phone" => "",
        "email" => "elsie@example.com"),
"shipping_addresses" => array(
        "first_name" => "Trisha",
        "last_name" => "McLaughlin",
        "company" => "",
        "street_1" => "12345 W Anderson Ln",
        "street_2" => "",
        "city" => "Austin",
        "state" => "Texas",
        "zip" => "78757",
        "country" => "United States",
        "country_iso2" => "US",
        "phone" => "",
        "email" => "elsie@example.com"),
"external_source" => "POS",
"products" => array(
        "product_id" => "90",
        "quantity" => "1"));

print_r(Bigcommerce::createOrder($createFields));

What am I missing?
Am I using the BigCommerce API incorrectly?
Any help on figuring out why my code isn't generating orders on my Bigcommerce store would be awesome!

A: The products property needs to be a nested array, where each individual product within the parent products array must exist as its own array:
"products" => array(
  0 => array(
    "product_id" => int,
    "quantity"   => int
  ),
  1 => array(
    "product_id" => int,
    "quantity"   => int,
  )
),

A: Try removing the quotes from the "quantity" parameter in the products array. It's expecting an int instead of a string.

A: products'=>array(
'product'=>array(
'product_id'=>90
'quantity'=>1

*

*product_id and quantity are type int and should not have quotes ""

*You need a product array in your Products array

A: Set Your Array Like This:
$createFields=Array(
                   "customer_id" => 0,
                   "status_id"=> 10,
                   "billing_address"=> [
                        "first_name"=> "Trisha",
                        "last_name"=> "McLaughlin",
                        "company"=> "",
                        "street_1"=> "12345 W Anderson Ln",
                        "street_2"=> "",
                        "city"=> "Austin",
                        "state"=> "Texas",
                        "zip"=> "78757",
                        "country"=> "United States",
                        "country_iso2"=> "US",
                        "phone"=> "",
                        "email"=> "a@example.com"
                    ],
                    "shipping_addresses"=>[
                        [

                            "first_name"=> "Trisha",
                            "last_name"=> "McLaughlin",
                            "company"=> "Acme Pty Ltd",
                            "street_1"=> "566 Sussex St",
                            "street_2"=> "",
                            "city"=> "Austin",
                            "state"=> "Texas",
                            "zip"=> "78757",
                            "country"=> "United States",
                            "country_iso2"=> "US",
                            "phone"=> "",
                            "email"=> "a@example.com"
                        ]],
                    "products"=>[
                        [
                            "product_id"=> 90,
                            "quantity"=>1,
                              // "name"=> "data",
                        ],
                        ],

                    "external_source"=> "POS"
                );


text:
Q: Creating new user in Azure AD b2c error: Another object with the same value for property proxyAddresses already exists I have a program which I create users through Microsoft graph in my Azure AD b2c
for normal users the code runs and creates AD b2c account
In the B2C I have admin users which are the Tenant administrators
When I try to create programatically accounts for the same user as b2c user I get error
Creating new user in Azure AD b2c error: Another object with the same value for property proxyAddresses already exists

but when I perform the same operation through GUI I can add 2 accounts with the same email.
the first is the user which is invited as admin and the second is the B2C normal user
                            var user = new User
                            {
                                AccountEnabled = true,

                                GivenName = "MJX",
                                Surname = MJX,
                                Mail = theEmail,
                                DisplayName = "Someting",
                                UserType = "Member",
                                CreationType = "LocalAccount",
                                PasswordProfile = new PasswordProfile
                                {
                                    ForceChangePasswordNextSignIn = true,
                                    Password = GeneratedPassword,
                                },
                                PasswordPolicies = "DisablePasswordExpiration",
                                Identities = new List<ObjectIdentity>
                            {
                                new ObjectIdentity()
                                {
                                    SignInType = "emailAddress",
                                    Issuer = tenantName,
                                    IssuerAssignedId = theEmail
                                }
                            }
                            };

                            //insert into AD
                            var createdUser = graphServiceClient.Users
                                .Request()
                                .AddAsync(user).GetAwaiter().GetResult();

A: Removed the Mail property it worked for me
 //Mail = theEmail


text:
Q: linking dropdown list option from tkinter into my webbrowser so the general idea behind this program is simply an app that i can search in diffrent type of website via replacing it in drop down list:
import webbrowser
import tkinter as tk
optionlist=["youtube",
"google",
"amazon",
"ebay"]
root=tk.Tk()
root.title("WEB BROWSER")
root.geometry("600x200")
x=tk.StringVar()
variable = tk.StringVar(root)
variable.set(optionlist[0])

def fb():
    webbrowser.open_new("https://www.facebook.com/")

def yt():
    webbrowser.open_new("https://www.youtube.com/")

def ig():
    webbrowser.open_new("https://www.instagram.com/")

def tw():
    webbrowser.open_new("https://twitter.com/")

def search():
    word=x.get()
    search="https://www.google.com/search?q="+word
    webbrowser.open_new(search)

x=tk.StringVar()
b1=tk.Button(root,text="Facebook",fg="white",bg="#3343BA",command=fb)
b2=tk.Button(root,text="Youtube",fg="white",bg="#FF0422",command=yt)
b3=tk.Button(root,text="Instagram",fg="white",bg="#F7378C",command=ig)
b4=tk.Button(root,text="Twitter",fg="white",bg="#12AED8",command=tw)
b6=tk.Button(root,text="Search",fg="white",bg="#121011",command=search)
b7=tk.OptionMenu(root,variable,*optionlist)
b7.config(width=90, font=('Helvetica', 12))
b7.pack(side="top")
b1.place(x=10,y=70,width=80,height=30)
b2.place(x=100,y=70,width=80,height=30)
b3.place(x=190,y=70,width=80,height=30)
b4.place(x=280,y=70,width=70,height=30)
b6.place(x=307,y=10,width=90,height=50)
b7.place(x=360,y=70,width=200,height=30)
el=tk.Entry(root,textvariable=x)
el.place(x=10,y=10,width=300,height=50)

labelTest = tk.Label(text="", font=('Helvetica', 12), fg='black')
labelTest.pack(side="top")
labelTest.place(x=360,y=105)

def callback(*args):
    labelTest.configure(text="You chose to search in: {}".format(variable.get()))

variable.trace("w", callback)
root.mainloop()

so, as you see i have a working searching app, and i made a dropdown list with the following (ebay amazon google and youtube)
i got the url for searching in each of them thats not the case,
the problem im facing is how do i bind the choice in tkinter to the platform i want to search in

A: Check if this is what you want:
def search():
    word = x.get()
    if variable.get() == 'youtube':
        search="https://www.youtube.com/results?search_query="+word
        webbrowser.open_new(search)
    elif variable.get() == 'google':
        search="https://www.google.com/search?q="+word
        webbrowser.open_new(search)
    elif variable.get() == 'amazon':
        search="https://www.amazon.com/s?k="+word
        webbrowser.open_new(search)
    else:
        search="https://www.ebay.com/sch/"+word
        webbrowser.open_new(search)

Just make this change to your function, thanks to the "search technique" used by most sites, even multiple words will work correctly, here.
Hope this helped, do let me know if any errors or doubts.
Cheers


text:
Q: Split a string you've entered with scanner I have a problem. I want to type in a string (with Java.util.scanner) with two words. Then I want the program to split my entered string at the whitespace, save both substrings in a seperate variable and make a output in the end.
I know that you can split strings with
String s = "Hello World";
String[] = s.split(" ");

But it doesnt seem to work when your String is
Scanner sc = new Scanner(System.in);
String s = sc.nextLine();

Any help?
Thank you very much

A: s.split("\\s+"); will split your string, even if you have multiple whitespace characters (also tab, newline..)
You can also use from java.util package
    StringTokenizer tokens = new StringTokenizer(s.trim());
    String word;
    while (tokens.hasMoreTokens()) {
        word = tokens.nextToken();

    }

Or from Apache Commons Lang
StringUtils.split(s)

A: Your code works for me:
String s;
s=sc.nextLine();

String[] words=s.split(" ");
for(String w:words){
System.out.print(w+" ");
}

input: "Hello world"
output: "Hello world"

A: You may also want to try this way of splitting String that you get from user input:
Scanner sc = new Scanner(System.in);
String[] strings = sc.nextLine().split("\\s+");

If you simply want to print array containing these  separated strings, you can do it without using any loop, simply by using:
Arrays.toString(strings);

If you want to have your printed strings to look other way, you can use for it simple loop printing each element or by using StringBuilder class and its append() method - this way may be faster than looping over longer arrays of strings.


text:
Q: sudo: run zoom as another user I block all Internet traffic for my kids' Linux accounts using iptables. Sometimes I want to allow them to use one program or another. In such cases I enable them to run that programs as another(unlimited) user via sudoers. This time I tried to enable them to use zoom, as follows:
kiddy   ALL= (daddy) NOPASSWD: /usr/bin/zoom
However running sudo -u daddy /usr/bin/zoom produces no output (also no errors), but zoom doesn't start. Running zoom from command line launches GUI client, but it obviously is unable to connect (which is expected). What's wrong here?
If I try to do the same with gnome-terminal instead of zoom by adding to the visudo following line: kiddy   ALL= (daddy) NOPASSWD: /usr/bin/gnome-terminal and then running: sudo -u daddy /usr/bin/gnome-terminal I get this error:
No protocol specified
Unable to init server: Could not connect: Connection refused
# Failed to parse arguments: Cannot open display:

I face all the above once logged in into Gnome as user kiddy, however if I log into Gnome as daddy and then in terminal run su kiddy followed by sudo -u daddy gnome-terminal or sudo -u daddy zoom - everything works.
Should I add some additional variables to the sudoers file? If yes - how do I determine which variables are needed and what are their values?
Here is the output of env for a typical Debian 10 user (named guest in this case):
SHELL=/bin/bash
SESSION_MANAGER=local/debox:@/tmp/.ICE-unix/2055,unix/debox:/tmp/.ICE-unix/2055
QT_ACCESSIBILITY=1
COLORTERM=truecolor
XDG_MENU_PREFIX=gnome-
GNOME_DESKTOP_SESSION_ID=this-is-deprecated
LANGUAGE=en_IL:en
SSH_AUTH_SOCK=/run/user/1001/keyring/ssh
DESKTOP_SESSION=gnome
GTK_MODULES=gail:atk-bridge
XDG_SEAT=seat0
PWD=/home/guest
XDG_SESSION_DESKTOP=gnome
LOGNAME=guest
XDG_SESSION_TYPE=wayland
GJS_DEBUG_TOPICS=JS ERROR;JS LOG
GDM_LANG=en_IL
HOME=/home/guest
USERNAME=guest
LANG=en_IL
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:
XDG_CURRENT_DESKTOP=GNOME
VTE_VERSION=5402
WAYLAND_DISPLAY=wayland-0
GNOME_TERMINAL_SCREEN=/org/gnome/Terminal/screen/a2088f04_0308_4c60_9882_a758f7d883b8
GJS_DEBUG_OUTPUT=stderr
XDG_SESSION_CLASS=user
TERM=xterm-256color
USER=guest
GNOME_TERMINAL_SERVICE=:1.59
DISPLAY=:0
SHLVL=1
XDG_VTNR=2
XDG_SESSION_ID=4
XDG_RUNTIME_DIR=/run/user/1001
PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
GDMSESSION=gnome
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1001/bus
_=/usr/bin/env

A: Possibly it doesn't know what display to use.  When you start it with sudo, it's creating a new shell. If that shell is unaware of the display, it won't be able to open a window.
To test this, try to sudo an xterm (/usr/bin/xterm) in the same way.  Does it open?  If not, we may be on to something here.
It may be as simple as adding VAR=DISPLAY to the sudo line.  See sudo man page for specific details.

A: If the initial GUI session is running as user kiddy, then the session key file (either at ~/.Xauthority or in a custom location pointed to by the XAUTHORITY environment variable) is owned by that user and not readable by anyone else by default.
If you're sudoing to root, this is not a problem as root can normally read everything (unless e.g. the user's home directory is on a NFS share that is exported with root_squash option set).  You can just export XAUTHORITY=/home/$SUDO_USER/.Xauthority and make sure the DISPLAY variable is preserved from the original session.
But when you use sudo -u daddy to switch onto another non-root account and want to use GUI programs, you'll need to either use GUI versions of the user switching tool (e.g. gksu for Gnome or kdesudo for KDE) which can handle this automatically, or give the second user account access to the session key (or a copy of it) yourself.
The GUI user switching tools would be the recommended way, as they can appropriately handle additional things beyond the basic GUI session access, like the environment variables required for the accessibility features and/or more elaborate character input methods, like the ones required for Chinese/Japanese/Korean character input for example.
Some distributions may also have PAM modules or other pre-configuration to make this more automatic.
But if you need to do it manually, there are three things you must do to for a basic ability to run GUI programs as an user that did not perform the GUI login:

*

*the destination user must have an accessible copy of the X session key file (~/.Xauthority, or pointed to by the XAUTHORITY variable in the original session). If security is a concern, this file should be accessible only by the original and the destination user.

*the destination user will probably need to have a XAUTHORITY variable pointing to the accessible copy of the X session key file (unless the copy is placed at ~/.Xauthority of the destination user)

*the destination user must have the same DISPLAY variable value as the original session

Apparently gksu has been removed. To allow sudo preserve the necessary environment variables, you might write an /etc/sudoers.d/zoomforkiddy file with the following contents (it is recommended to use visudo -f /etc/sudoers.d/zoomforkiddy to create/edit it):
Defaults:kiddy env_keep += "DISPLAY XAUTHORITY"
kiddy ALL = (daddy) NOPASSWD: /usr/bin/zoom

This allows the necessary environment variables to pass through sudo, and grants kiddy passwordless access to /usr/bin/zoom only.
Then add daddy to kiddy's user group:
sudo usermod -a -G kiddy daddy

This will allow daddy to access kiddy's files if they have group access permissions set. So now kiddy will be able to copy his Xauthority file to some location that can be accessed by daddy and set permissions so that (only) daddy can access it.
Now create a script, e.g. /usr/local/bin/zoom_for_kiddy and set it executable (chmod a+rx /usr/local/bin/zoom_for_kiddy):
#!/bin/sh
if [ "$XAUTHORITY" = "" ]
then
    XAUTHORITY="$HOME/.Xauthority"
fi
if [ -f "$XAUTHORITY" ]
then
    cp "$XAUTHORITY" /tmp/zoom_for_kiddy_xauth
    trap "rm -f /tmp/zoom_for_kiddy_xauth" EXIT
    chmod 640 /tmp/zoom_for_kiddy_xauth

    export XAUTHORITY=/tmp/zoom_for_kiddy_xauth
    sudo -u daddy /usr/bin/zoom "$@"
else
    echo "ERROR: cannot find the Xauthority file" >&2
fi

This script will make a copy of kiddy's Xauthority file for daddy, set the permissions, set the XAUTHORITY environment variable to a value that's usable for daddy, and then start /usr/bin/zoom through sudo. When zoom exits, the copy of the Xauthority file will be automatically deleted as the shell executing the script exits.
Now you can adjust kiddy's desktop environment to use /usr/local/bin/zoom_for_kiddy instead of the real /usr/bin/zoom. Any command arguments will be passed through the script to the real zoom as-is.

A: I wrote ego (Alter Ego) for a similar use case. Using ego, you can launch programs under another local user. Besides X11 setup, it also handles Wayland and PulseAudio socket sharing: https://github.com/intgr/ego
So you would just run ego --sudo -u daddy app or ego -u daddy zoom (some applications have glitches with the --sudo mode).
If you run into problems, please open an issue on GitHub.


text:
Q: SQLproducts filter I have two tables:

*

*sklep_produkty: id | name

*sklep_atr_prod: id | id_prod | atr | value

In url i use ?fq=color('Czerwony'), to get value i use code:
$fq = $this->getRequest()->getParam('fq');
$fq = explode(',', $fq);

$myArray = array();
foreach($fq as $param){
    $literal_pattern = "/('[^']*')/";
    $fq = preg_match($literal_pattern, $param, $token);
    $myArray[] = str_replace("'", "", $token[0]);
}

Then i get id_prod like this:
$filterActionQuery = $db->select()->from('sklep_atr_prod', array('id_prod', 'wartosc'));

foreach($myArray as $parames){
    $filterActionQuery->where('wartosc = ?', $parames);
}
$filterActionresult = $db->fetchAll($filterActionQuery);

SQL query:
SELECT `sklep_atr_prod`.`id_prod`,
`sklep_atr_prod`.`wartosc`
FROM `sklep_atr_prod`
WHERE (wartosc = 'Czerwony')

Result:
Array
(
    [0] => stdClass Object
        (
            [id_prod] => 1
            [wartosc] => Czerwony
        )

    [1] => stdClass Object
        (
            [id_prod] => 3
            [wartosc] => Czerwony
        )

)

And this is ok, but when want to use antother filtr "size" i make URL like this: ?fq=color('Czerwony'),size('XL')
SQL Result:
SELECT
`sklep_atr_prod`.`id_prod`,
`sklep_atr_prod`.`wartosc`
FROM `sklep_atr_prod`
WHERE (wartosc = 'Czerwony') AND (wartosc = 'XL')

And this give me empty result. How make SQL query using two parametrs 'Czerwony' and 'XL' to get id_prod = 3.

A: You can do this using GROUP BY and HAVING:
SELECT sap.id_prod
FROM `sklep_atr_prod` sap
WHERE sap.wartosc IN ('Czerwony', 'XL')
GROUP BY sap.id_prod
HAVING COUNT(DISTINCT sap.wartosc) = 2;


text:
Q: In survival mode, does tending to needs before they reach critical levels make any difference? I've been playing survival mode and it frustrates me to no end that I can't keep an eye on how thirsty, hungry, or tired I am. There is no way to know just how bad off my needs are until I am so deficient in one of those areas that I start taking penalties.
There's nothing like running a long way with intent to clear out a point of interest for a quest only to arrive and suddenly get drowsy because I haven't slept in a real bed for an arbitrary number of hours (and then there's no way to fix the problem because the only thing available nearby is a dirty mattress on the floor).
So, I wonder: Will drinking before you get parched, eating before you get peckish, and sleeping before you get tired stave off the negative effects before they can occur? Will performing these actions reset the timer in the game code that counts down until the negative effects happen, or will performing these actions before they are "necessary" just waste the effort?

A: (this answer assumes that Bethesda didn't try and reinvent the wheel: that F4 survival mode is built off of what existed in NV, and my own personal experience)
The only thing tending to needs before they reach critical level does is keep your health bar at full utilization.
Yes, doing the other thing that keeps the first thing from happening, will keep that thing from happening.
There isn't a timer in the game code that counts down until the negative effects happen, it's a cumulative stat, specific numbers at which negative effects happen. The only timers involved are whatever the script says for e.g., every X minutes add Y to HUNGER.
And then e.g., at Z HUNGER, minus 1 from [stat] and so on.
You can test it yourself by having just a bit of [radiation poisoning] thirst, but before you're dehydrated, and then drink some water (dehydration doesn't cause incremental HP loss; radiation does). You'll see a gap between the green in the health bar and the red. That amount of HP is what you're missing out on while under an unnotified negative effect.


text:
Q: Blogger page title format Consider the following format for page title in blogger:[blog Name].[page Name].
I used to place the following code in the title tags and without the title tags as cited in some programming site:
<b:if cond='data:blog.pageType == "index"'>
<title><data:blog.title/></title>
<b:else/>
<title><data:blog.pageName/></title>
</b:if>

The problem is that I get only [page Name] without the [blog Name]. Any help is greatly appreciated.

A: You don't include the blog name in the else part of the conditional. Looking at your sample you probably want this:
<b:if cond='data:blog.pageType == "index"'>
    <title><data:blog.title/></title>
<b:else/>
    <title><data:blog.title/><data:blog.pageName/></title>
</b:if>


text:
Q: Export CUBE IDE's SFR tab registers to text file to compare driver implementation using HAL and directly by register I'm doing memory optimization and replacing the HAL implementation with commands that directly change bits in registers. To validate these changes, I'm changing the functions, debugging and putting the breakpoint after the function is executed, then taking snapshots of the peripheral registers through the SFR (Special Function Registers) feature of the CUBE IDE.
These snapshots are made with printscreen, my intention would be to snapshot with a log file, export all registers in a text file to use a difference program analyse. I do this for both the code using HAL and my version, then I can validate if it is stable, assuming that if the registers are equally configured, everything will work as expected.
See some sample:
implementation direct in register
implementation using HAL lib
I discovered a software (winIDEA Community Edition) that has this functionality to export to text file, it needs a little maintenance, last release was made in 06/2020. Using the examples themselves I had some problems, including one of them the software breaks and closes.
winIDEA Community Edition exporting SFR option
Does anyone have an alternative? Eclipse plugin or even a third-party tool that debugs with stlink and captures register values.


text:
Q: The WP home page corrupted after switching to new theme We are an office in The university business incubator as one company and in site of the university, our parts have had some problem after switching to new theme.
one of Employee of this  university business incubator asked me to help her to fix the site which have had restricted access to site setting so, i have tied to fix it but i see that the new theme don't show some of widgets like search and meta don't shown at sidebars you could see here:

but it could be shown in new widget like this:

the main site before changing them is like this:

so i like to know what information is needed like logs and ... to find out why this happened?(i thinks i must have access to the root folder of site to check the them folders and logs maybe like this site instruction but i have not so it could be effective to try fix it, what do you think?)
َUpdate:
According @udit_sharma answer, I have try to deactivate the plugins but i have don't access and get this feedback :

Your admin is protected. Light wordpress plugin - CipherCoin |Settings
  | Hide Notice

So i thinks why the supervisor of the university site don't fix this problem and i don't like to try by restricted access to fix the site problem. (i this situation what proverb peoples say at this situation?)
Thanks for your attention.

A: You should check by checking deactivating the plugins. Which will tell you which will the for corruption of wordpress


text:
Q: C programming to calculate using modular exponentiation I just had a quick question to verify if my programming and math are correct. Sorry in advance if this is off topic, I don't where else to ask to get quality answers ;) How can I double check that the answer is correct? Thanks
This is my problem:
If a cryptosystem has 2^48 possible keys, and you have 1000 computers, each of which can test 500,000 encryption keys per second, in how many days would you be able to recover the correct key in the worst case, assuming a brute force search and that you can immediately recognize the correct key when you have tried decrypting with it? (Recall, there are 86,400 seconds in a day.)
Here is my program output to solve the problem:
Number of keys: 2^48
Number of computers: 1000
Number of keys/persecond: 500000
Number of days: 647168000

My code is as follows:
#include <stdio.h>
#include <stdlib.h>
#include <math.h>

int max_power(int base,int exp,int mod);
int main(void)
{
    int num_computers=1000;
    int keys_per_second= 500000;
    int seconds_in_day=86400;
    printf("Number of keys: 2^48\n");
    printf("Number of computers: %d\n",num_computers);
    printf("Number of keys/persecond: %d\n",keys_per_second);
    printf("Number of days: %d\n",max_power(2,48,seconds_in_day)*num_computers*keys_per_second);

    return 0;
}

int max_power(int base,int exp,int mod)
{
    if (exp == 0)
        return 1;
else if (exp%2 == 0) {
        int mysqrt = max_power(base, exp/2, mod);
        return (mysqrt*mysqrt)%mod;
    }
    else
        return (base*max_power(base, exp-1, mod))%mod;
}

Final code (still not completely satisfied but I will ask my professor if this would be acceptable on a test):
int main(void)
{
    double num_computers=1000;
    double keys_per_second= 500000;
    double seconds_in_day=86400;
    long double keys=pow(2.0,48);
    printf("Number of keys: %.0lf\n",keys);
    printf("Number of computers: %.0f\n",num_computers);
    printf("Number of keys/persecond: %.0f\n",keys_per_second);
    printf("============================================\n");
    printf("Time to decrypt all keys: %.2f days\n",keys/(num_computers*keys_per_second*seconds_in_day));

    return 0;
}

A: The correct calculation was pointed out in the comments. However, you are still not sure how you went wrong.
Your application of modular exponentiation here is not quite correct. Modular exponentiation only gives you the remainder of x to the y over z, you also need the quotient.


text:
Q: What utilities do you use and how do you use them when benchmarking your harddrive subsystem for a SAN replacement? So, I have a series of questions into ServerFault about LeftHand SAN's (Questions 1441 and 4478).  One of the responses I received questioned the throughput of the iSCSI data returning from the SAN being restricted to the 1GB network card.
I think it is a very good point to look at.
Now to see if this would be an actual bottleneck for my purpose I should perform some benchmarks on the current production server.
What utilities should I use for profiling?
If there are special metrics I should be reading, what are they?  IOPS?, Disk Read/Write B/sec?, etc...
Thank you,
Keith

A: Iometer appears to be the overwhelming recommendation for testing and benchmarking iSCSI SAN performance. Because it is widely used by vendors, its numbers offer a fairly reliable comparison metric across storage systems.
If you plan on running SQL Server off your SAN, you should also look at doing some testing and tuning with SQLIO. Brent Ozar has a great SAN performance tuning guide at SQLServerPedia using the SQLIO tool that's worth checking out.

A: IOMeter is the tool I normally use for this type of thing...

A: Bonnie++ is a nice unix benchmarking tool for hard disks.  It'll complete a wide variety of tests.


text:
Q: CQWP ItemStyle: how to display background of description with conditional formatting I have 3 elements in a field and I would like the CQWP to display red as a bg colour of the field or amber or green.
I guess the starting point is
<xsl:if test="RAG = 'Red'">background-color: #FFFF00;</xsl:if>

or something similar, please correct,
but I am not sure where to place it.
Consider I am using the standard one

            <xsl:value-of select="@Description" />

A: If you do not wish to add style sheet as explain by @JJD then just update your item style sheet as below :

<xsl:attribute name="style">
    <xsl:choose>
        <xsl:when test="(@RAG = 'red')">background-color: red;</xsl:when>
        <xsl:when test="(@RAG = 'amber')">background-color: amber;</xsl:when>
        <xsl:when test="(@RAG = 'green')">background-color: green;</xsl:when>
    </xsl:choose>
</xsl:attribute>
<xsl:value-of select="@Description" />

A: Are you using an xsl file? In that case it would be something like

<xsl:attribute name="class">
    <xsl:choose>
        <xsl:when test="(@RAG = 'red')">Descriptionred</xsl:when>
        <xsl:when test="(@RAG = 'amber')">Descriptionamber</xsl:when>
        <xsl:when test="(@RAG = 'green')">Descriptiongreen</xsl:when>
    </xsl:choose>
</xsl:attribute>
<xsl:value-of select="@Description" />

assuming 'red', 'green' and 'amber' are values from a 'RAG' column
basic styling

Descriptionred ,Descriptionamber and Descriptiongreen are classes which gets applied to div which renders description. Stylesheet for these columns needs to added on the page where you will add content query webpart.


text:
Q: In which cases runAction on SKNode does not complete? Are there any known cases where running an SKAction using runAction does not complete?
I launch several 'runAction' on different SKNode. In order to synchronize all these actions, I use a counter that is incremented inside the completion block of each SKAction. When the counter reach the exact number of launched SKAction then the animations is completed.
From time to time one SKAction does not complete then the animation never complete.
// Several actions are launched...
myNode.runAction(myActions,completion:{

    checkCompletion()

})

// Check if all actions completed
//
// numberOfLaunchedActions: number of actions launched
// logDebug: some log helper
func checkCompletion() {

    // This counter is initialized earlier
    numberOfCompletedActions++

    logDebug(">> Actions completed: \(numberOfCompletedActions)/\(numberOfLaunchedActions)")

    if numberOfCompletedActions == numberOfLaunchedActions {
        /// some statements
         logDebug("Animation Completed!")
    }

}

Actions are dynamically generated and are composed of sequence of following actions:

*

*waitForDuration

*scaleTo

*moveBy

*hide

*unhide
No removeFromParent nor runAction nor runBlock.
The action I focus my attention on is the following:
let waitAction = SKAction.waitForDuration(0.4)

let scaleAction = SKAction.scaleTo(0.1, duration: 2.0)
scaleAction.timingMode = .EaseOut

let myAction = SKAction.sequence([
    waitAction,
    scaleAction,
])

A: There is one known case: adding action after Remove from parent in a sequence: SKAction runAction does not execute completion block
As explained in comment:

Remove from parent is causing the rest of the actions in the
  sequence not to be called, since the involved node is no longer in
  the scene. The sequence didn't complete, therefore the completion
  block shouldn't be called.


text:
Q: Kafka Streams: Can I subscribe my processor to multiple topics with different number of partitions I'm trying to create a Kafka Stream Topology with multiple processors that subscribe to a regex pattern and multiple topics as a result.
For example, pattern topic_(?:a|b|c) will connect to topic_a, topic_b, and topic_c. I have a different number of partitions for each topic, since they have different loads. When running my topology, though, I see:
org.apache.kafka.streams.errors.TopologyException
...
Topics not co-partitioned

The difference between them are:
topic_a: 3 partitions
topic_b: 3 partitions
topic_c: 30 partitions

Am I allowed to do this, or when subscribing to multiple topics I need to maintain the same number of partitions?
Into further context, each of the topics listed above are actually two, like topic_a1 and topic_a2, topic_b1 and topic_b2. They all got the same partition number and I'm trying to join, and later aggregate them using the streams API

A: If an application is subscribed to multiple topics using a pattern, all of the topics need to have the same number of partitions.


text:
Q: Manual Colours in scale_colour_manual are not rendering properly Could not figured out why manual colours are not rendering properly. Any hints!!
library(tidyverse)

tb1 <-
  tibble(
    X = seq(1:50)
  , A = rnorm(n = 50, mean = 100, sd = 8)
  , B = rnorm(n = 50, mean = 150, sd = 6)
  , C = rnorm(n = 50, mean = 175, sd = 5)
  , D = rnorm(n = 50, mean = 200, sd = 5)
  )

tb1

Plot1 <-
  ggplot(tb1, aes(x = X)) +
  geom_point(aes(y = A, colour = "orange")) +
  geom_line(aes(y = B, colour = "black")) +
  geom_line(aes(y = C, colour = "green")) +
  geom_line(aes(y = D, colour = "red")) +
  scale_colour_manual(
      name   = ''
    , values = c("orange" = "orange", "black" = "black", "green" = "green", "red" = "red")
    , labels = c("Obs", "Fit1", "Fit2", "Fit3")
  )

Plot1

A: If you don't add the labels, you see that they are ordered alphabetically:
ggplot(tb1, aes(x = X)) +
  geom_point(aes(y = A, colour = "orange")) +
  geom_line(aes(y = B, colour = "black")) +
  geom_line(aes(y = C, colour = "green")) +
  geom_line(aes(y = D, colour = "red")) +
  scale_colour_manual(
      name   = ''
    , values = c("orange" = "orange", "black" = "black", "green" = "green", "red" = "red")

So you needa arrange the order using breaks:
ggplot(tb1, aes(x = X)) +
  geom_point(aes(y = A, colour = "orange")) +
  geom_line(aes(y = B, colour = "black")) +
  geom_line(aes(y = C, colour = "green")) +
  geom_line(aes(y = D, colour = "red")) +
  scale_colour_manual(
      name   = ''
    , values = c("orange" = "orange", "black" = "black", "green" = "green", "red" = "red"),
      breaks = c("orange","black","green","red"),
    , labels = c("Obs", "Fit1", "Fit2", "Fit3")
  )


text:
Q: Can't use custom getter with delegated property I am new to kotlin and can't figure out this issue.
I have a property that is not nullable and may or may not be used.
Hence I have delegated it in a lazy way so that it is initialized when required.
private val labelAnimator: ObjectAnimator by lazy {
    ObjectAnimator.ofFloat(this, "floatingLabelFraction", 0f, 1f)
}

However, I also need to set some property of that object every time it is accessed.
fun getLabelAnimator(): ObjectAnimator {
    labelAnimator.duration = (if (isFloatingLabelAnimating) 300 else 0).toLong()
    return labelAnimator
}

But I cannot use a custom getter since the property is delegated.
How do I achieve this in best possible way?

A: You could for example use your original property as Backing Property and actually define the property as a delegation to it.
private val _labelAnimator by lazy {
    ObjectAnimator.ofFloat(this, "floatingLabelFraction", 0f, 1f)
}

val labelAnimator: ObjectAnimator
    get() {
        _labelAnimator.duration = if (isFloatingLabelAnimating) 300L else 0L
        return _labelAnimator
    }

This gives you a getLabelAnimator() method in Java and direct property access in Kotlin.
But like it was stated several times before, it might not be the best way to implement such behavior. A simple factory could do the same with little overhead.

A: I am not a Kotlin expert, but it sounds wrong to me.
By delegating to lazy you want to init object on its first getter call. And then, you are trying to write custom getter.
I see a conflict there.
Maybe:
private val labelAnimator: ObjectAnimator by lazy {
    val labelAnimator = ObjectAnimator.ofFloat(this, "floatingLabelFraction", 0f, 1f)
    labelAnimator.duration = (if (isFloatingLabelAnimating) 300 else 0).toLong()
    labelAnimator
}

A: The shortest version
private val labelAnimator: ObjectAnimator by lazy {
    ObjectAnimator.ofFloat(this, "floatingLabelFraction", 0f, 1f).apply {
        duration = if (isFloatingLabelAnimating) 300L else 0L
    }
}


text:
Q: Convert any date format to system date format i want give a date from user to string Such as "2011-10-11" and for example my system date format is : dd/mm/YYYY
How can i convert 2011-10-11 To Default System Date Format ( In My Example : 11/10/2011 )
Thanks

A: Dim result = DateTime.Parse("2011-10-11").ToShortDateString()


text:
Q: Logistic Regression -- Question about inverse of a features probability I'm working on a customer churn model. Currently i have a variable for increased returns (1/0). After i run the model and convert the coefficient to and odds ratio, then convert that to probability; I wind up with 70%. (Churn =1, Not Churn = 0)
My question is can i use the inverse of this probability to say that a customer with decreased or flat returns has a 30% probability to "not churn". If i actually flip this relationship in the data and feed it to the model, it starts to generate a lot more false positives, and accuracy falls drastically.
Any help would be extremely appreciated. Thanks!

A: If
$$P(churn = 1 \mid increasedReturns = 1) = 0.70$$
then
$$P(churn = 0 \mid increasedReturns = 1) = 0.30$$
70% is the probability of churn given that the customer has increased returns.
So, 30% is the probability of "no churn" given that the customer has increased returns.
To find the probability of a churn for a customer with decreased of flat return, you need calculate the probability of churn when increasedReturn = 0.
$$P(churn = 1 \mid increasedReturns = 0)$$


text:
Q: Interior Points Confusion I am confused about interior points. Basically, I think that if the set we are not working in doesn't contain irrational numbers, then the interior of the set is $\emptyset$.
$\left [ 0, \; 5\right ]$ has a non-empty interior because we are working the Reals.
However, for $\left \{ r \in Z \; | \; r > 1 \right \}$ has an interior = empty set. This is because in any neighborhood of an $r$ in the set, it will contain an irrational number. Since irrational numbers aren't in the set, the interior is the empty set.
So, if we aren't working the Reals, our interior is always going to be the empty set??

A: I think you need an answer that has to do with the set of real numbers $\mathbb R$
provided with what is called "Euclidean Topology".
A point $x$ of a subset $A$ of $\mathbb R$ is internal if and only if there is an open interval $(a,b)$ such that $x\in (a,b)$ and $(a,b)\subseteq A$. The interior of $A$, $int(A)$, is the set of all its internal points. Thus $int([0,5])=(0,5)$, because neither for $0$ nor for $5$ you can find an open interval $(a,b)$ with the required property, but for all the other points of $[0,5]$ you can.
On the other end $int(\mathbb Z)=\emptyset$ because for any $z\in\mathbb Z $, any $(a,b)$ such that $z \in (a,b)$ contains real numbers other than $z$.
I hope this is clarifying enough.