text:
Q: target blank with php I would like if you're on a submit button, click the page goes to another page and a new window opens with another page.
this is my html code

<form action="" method="post">
    <input target="blank" class="bal" type="submit" name="bal" value="">
</form>

and this is my php code
if(isset($_POST['bal'])){
header("Location: ping_pong_uitleg.php");//gaat naar de uitleg}

in the html put a link is not an option because it must be done with the submit button more things
I hope you can help me

A: Don't Use target="_blank" in submit button or any button. It's of no use. target="_blank" is used for anchor  tag
For submit button, use formtarget="_blank"

<form action="" method="post">
    <input class="bal" type="submit" formtarget="_blank" name="bal" value="">
</form>

For more info, Check my answer Hyperlink not working on input type=button
For User's Requirement.
Create one id for submit button i.e. SubmitId , use this id on .click.
Basically, what it will do is : It will go to next page and meanwhile, it will change the current Page (Ist Page) URL too.
<form method='post' action="">
    <input type='text'>
    <input type='submit' id='SubmitId' formtarget="_blank">
</form>

A: Firstly, the target attribute can't be used on input elements.
What you are tying to do won't work the way you want it to, because the data is being sent to the server and then the page in redirecting (within the same window). To do what you want you will have to use JavaScript.
To open a window in a new tab with JavaScript you can do the following.
window.open('https://www.google.com/', '_blank');

This will submit your form and in the same instance open a new window with the URL you pass to the window.open method.
Here is a JSFiddle of the form submitting and opening in a new window.

A: Here's your solution:
<form action="" method="post" target="_blank">
  <input class="bal" type="submit" name="bal" value="">
</form>

A: It seems you want 2 things:

*

*
click the page goes to another page

Submit the form in a new window. Add formtarget="_blank" to the input
<input class="bal" type="submit" formtarget="_blank" name="bal" value="">

*
new window opens with another page

Put the url to your PHP file in the action attribute
<form action="/filename.php" method="post">


text:
Q: Excel 365 - Search table return true for each row TRUE & FALSE Table

Hey All,
I need to return ALL the rows where TRUE is found so I can put it through a FILTER function.
E.g
S2:Z2 does not contain TRUE value return FALSE for Row 2
S3:Z3 contains a TRUE value return TRUE for Row 3
Thanks!
EDIT: Example of returned data
DATA Returned in AB

Returned Pending

A: You could use:

Formula in H1:
=FILTER(A1:E5,MMULT(--A1:E5,SEQUENCE(COLUMNS(A1:E5))))

NOTE: WAAR is the Dutch equivalent of TRUE and ONWAAR the equivalent to FALSE.

Or, if it's "Pending" you are looking for:

Formula in H1:
=INDEX({"","Pending"},1+(MMULT(--(A1:E5="Pending"),SEQUENCE(COLUMNS(A1:E5)))>0))

A: Try below formula-
=IF(SUM(--S2:Z2)=0,FALSE,TRUE)

EDIT: Try below formula. Here P represents Pending.

=FILTER(S2:Z6,(S2:S6="P")+(T2:T6="P")+(U2:U6="P")+(V2:V6="P")+(W2:W6="P")+(X2:X6="P")+(Y2:Y6="P")+(Z2:Z6="P"))

A: This is the only solution I could come up with but it seems like an awful way around it.
=IFERROR(IFS(S2:S5000="Pending", TRUE,T2:T5000="Pending", TRUE,U2:U5000="Pending", TRUE,V2:V5000="Pending", TRUE,W2:W5000="Pending", TRUE,X2:X5000="Pending", TRUE,Y2:Y5000="Pending", TRUE,Z2:Z5000="Pending", TRUE),FALSE)
Up to row 5000 being an arbitrary number that I know the data will never exceed.

redpajama_set_name: RedPajamaStackExchange


text:
Q: Porting Android SurfaceView Game to Unity Engine on Android I have a published 2D puzzle game (require drawing 400 small images in each frame) on Android developed using SurfaceView. Due to performance issues on some tablets and phones, I am forced to look at other alternatives. It looks like Unity is the best option. Before I do this, I have several questions.

*

*Can unity provide faster and consistent performance on most of Android devices? (like drawing 400 items every frame)

*Can I mix Android Layouts and activities with Unity
Activity. (What I mean here is can I just replace the game play part
with unity keeping the existing implementation of the game using
android layouts/fragments/activities)

*Can I call google play in-app purchases from Unity
Game canvas?

A: 1.If the images are very small then it might be able to. Use the the Image or RawImage component to display each image. If performance is still bad, you can use GPU instancing which has been made more easier to use in Unity lately.
2.You can write a Java plugin and load it from Unity or you can even write your Activity in Java with layouts and then control your Unity program from it. See this post for more information on that.
Even though it is possible, don't do it. Only write a Java code when you have to otherwise, you will end up with a game that works on Android only. The point of using Unity is to make a Game that works on most devices. Port all your code to C#. That's what I would do.
3.Yes, you can use google play in-app purchases in Unity with the Prime31 plugin or you can use Unity IAP that's easy to use and requires no plugin at-all.


text:
Q: Flutter TextField Hint Text Not Align Center                                       Container(
                                        alignment: Alignment.center,
                                        decoration: BoxDecoration(
                                          borderRadius: BorderRadius.only(
                                              topLeft: Radius.circular(5.0),
                                              bottomLeft: Radius.circular(5.0)
                                          ),
                                          color: Colors.white,
                                        ),
                                        padding: EdgeInsets.only(left: 15.w, right: 15.w),
                                        child: TextField(
                                          maxLines: 1,
                                          style: TextStyle(
                                            fontSize: 12, //This line!!!!!!!!!
                                            textBaseline: TextBaseline.alphabetic,
                                          ),
                                          decoration: InputDecoration(
                                            border: InputBorder.none,
                                            hintText: configNotifier.translationObject["SearchOrder"],
                                            hintStyle: TextStyle(
                                              color: fromCSSColor("#808080"),
                                              textBaseline: TextBaseline.alphabetic
                                            ),
                                          ),
                                        ),
                                      )

Before I add "fontSize: 12"

After I add "fontSize: 12"

How to apply font size to textfield with vertical center alignment?
Remark: I've tried "textAlignVertical: TextAlignVertical.center" and hint->textstyle "height:1.0" which is not working
========Edit 1===========
IOS Device is work fine but not on Samsung Galaxy Tab A (8.0", 2019) which model is SM-T295C).
========Edit 2===========
With Parent Widget
Container(
    margin: EdgeInsets.only(left: 70, right: 70),
    height: 50.h,
    child: Row(
      crossAxisAlignment: CrossAxisAlignment.center,
      children: [
        Expanded(
          child: Container(
            alignment: Alignment.center,
            decoration: BoxDecoration(
              borderRadius: BorderRadius.only(
                  topLeft: Radius.circular(5.0),
                  bottomLeft: Radius.circular(5.0)
              ),
              color: Colors.white,
            ),
            padding: EdgeInsets.only(left: 15.w, right: 15.w),
            child: TextField(
              maxLines: 1,
              style: TextStyle(
                fontSize: 12, //This line!!!!!!!!!
                textBaseline: TextBaseline.alphabetic,
              ),
              decoration: InputDecoration(
                border: InputBorder.none,
                hintText: configNotifier.translationObject["SearchOrder"],
                hintStyle: TextStyle(
                    color: fromCSSColor("#808080"),
                    textBaseline: TextBaseline.alphabetic
                ),
              ),
            ),
          ),
        ),
        GestureDetector(
            onTap: (){
              //...
            },
            child: Container(
                width: 100.w,
                height: 50.h,
                margin: EdgeInsets.only(right: 10),
                decoration: BoxDecoration(
                  borderRadius: BorderRadius.circular(5.0),
                  color: fromCSSColor("#000000"),
                ),
                child: Center(
                  child: Text(
                    "Submit",
                    style: TextStyle(
                      color: fromCSSColor("#000000"),
                      fontSize: 12
                    ),
                    textAlign: TextAlign.center,
                  ),
                )
            )
        ),
        GestureDetector(
            onTap: (){
              //...
            },
            child: Container(
              width: 65.w,
              height: 50.h,
              decoration: BoxDecoration(
                borderRadius: BorderRadius.circular(5.0),
                color: fromCSSColor("#000000"),
              ),
              child: Center(
                child: Container(
                  width: 41.w,
                  height: 41.h,
                  alignment: Alignment.center,
                  child: Image.asset('assets/images/icon_scan_white.png', fit: BoxFit.contain),
                ),
              ),
            )
        )
      ],
    )
)

A: Try to textalign.center in TextField like below
TextField(
   textAlign : TextAlign.center,
),

your screen look like this-

A: try  contentPadding inside decoration. and dont need to use padding on Expanded Container.

import 'package:flutter/material.dart';

class CounterList extends StatefulWidget {
  @override
  _CounterListState createState() => _CounterListState();
}

class _CounterListState extends State<CounterList> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
        backgroundColor: Colors.red,
        body: Padding(
          padding: const EdgeInsets.all(8.0),
          child: ListView(
            children: [
              CustomField(
                fontSize: 17,
              ),
              SizedBox(
                height: 22,
              ),
              CustomField(
                fontSize: 37,
              ),
              SizedBox(
                height: 20,
              ),
              CustomField(
                fontSize: 11,
              ),
              SizedBox(
                height: 20,
              ),
              CustomField(
                fontSize: 22,
              ),
            ],
          ),
        ));
  }
}

class CustomField extends StatelessWidget {
  final double fontSize;
  CustomField({
    Key? key,
    required this.fontSize,
  }) : super(key: key);
  @override
  Widget build(BuildContext context) {
    return Container(
        margin: EdgeInsets.only(left: 70, right: 70),
        height: 50,
        child: Row(
          crossAxisAlignment: CrossAxisAlignment.center,
          children: [
            Expanded(
              child: Container(
                alignment: Alignment.center,
                decoration: BoxDecoration(
                  borderRadius: BorderRadius.only(
                      topLeft: Radius.circular(5.0),
                      bottomLeft: Radius.circular(5.0)),
                  color: Colors.white,
                ),
                // padding: EdgeInsets.only(left: 15.w, right: 15.w),

                child: TextField(
                  maxLines: 1,
                  style: TextStyle(
                    fontSize: fontSize, //This line!!!!!!!!!
                    textBaseline: TextBaseline.alphabetic,
                  ),
                  decoration: InputDecoration(
                    contentPadding: EdgeInsets.only(left: 15, right: 15),
                    border: InputBorder.none,
                    hintText: "search",
                    // hintText: configNotifier.translationObject["SearchOrder"],
                    hintStyle: TextStyle(
                      // color: fromCSSColor("#808080"),
                      color: Colors.grey,
                      textBaseline: TextBaseline.alphabetic,
                    ),
                  ),
                ),
              ),
            ),
            GestureDetector(
                onTap: () {
                  //...
                },
                child: Container(
                    width: 100,
                    height: 50,
                    margin: EdgeInsets.only(right: 10),
                    decoration: BoxDecoration(
                      borderRadius: BorderRadius.circular(5.0),
                      // color: fromCSSColor("#000000"),
                      color: Colors.black,
                    ),
                    child: Center(
                      child: Text(
                        "Submit",
                        style: TextStyle(
                          // color: fromCSSColor("#000000"),
                          color: Colors.black,
                          fontSize: 12,
                        ),
                        textAlign: TextAlign.center,
                      ),
                    ))),
            GestureDetector(
                onTap: () {
                  //...
                },
                child: Container(
                  width: 65,
                  height: 50,
                  decoration: BoxDecoration(
                    borderRadius: BorderRadius.circular(5.0),
                    // color: fromCSSColor("#000000"),
                    color: Colors.black,
                  ),
                  child: Center(
                    child: Container(
                      width: 41,
                      height: 41,
                      alignment: Alignment.center,
                      child: Image.asset(
                        // 'assets/images/icon_scan_white.png',
                        "assets/me.jpg",
                        fit: BoxFit.contain,
                      ),
                    ),
                  ),
                ))
          ],
        ));
  }
}

A: Try it:
TextField(
  textAlign : TextAlign.center,
  textAlignVertical: TextAlignVertical.center,
),


text:
Q: Possible to add custom metrics to Back testing? Is it possible to display your own calculated metrics to the back testing result in Trading View? Or write to file while executing? I would like to extract number of days Close > Open after a Buy signal for each run of a set of parameter.
I am thinking of manipulating the existing metrics (initial Capital, number of trades) as a work around but it feels like the wrong way.

A: I don't think you can display your metric to the back testing result.
You can try to use comment from your entry order.
You can use table to display data on the chart :
var table controle = table.new(position=position.top_right, columns=2, rows=9)
table.cell(controle, 0, 7, "candle", text_color=color.white)
table.cell(controle, 1, 7, str.tostring(math.round(bar_index,0)), text_color=color.white)

You will get this type of display :


text:
Q: It lags when i am using android studio my laptop is i7 4510U , 4GB ram , Intel HD graphics 2gb , Nvidia GeForce 840m 4GB
why it's so laggy when Iam using android studio?

A: Your 4GB of ram is to blame,
to use well Android Studio, you need at least 8GB of RAM (more if intend to use emulators), just note that the GPU have no use here, and even the processor you just need a mid range processor to work well, but when compiling the more powerful processor you have the better.

A: I also had problems but then i disabled some plugins and tried to build gradle offline, you can find detailed answer here :
http://stackoverflow.com/questions/30817871/android-studio-is-slow-how-to-speed-up


text:
Q: Character creating xml in php from mysql My php file create XML using data from mysql database, I have some special characters in my database, that aren't showing up properly.s
PHP Code:

http://sandbox.onlinephpfunctions.com/code/8faec4b8da5f2edc76e23ec4a40ac6e35e03f2bc

SQL Table Structure,  Data & Proof:

Link: https://dl-web.dropbox.com/get/Stack.png?_subject_uid=303112722&w=AADui4zBLmvS_ng879Kh5lPdveOE6dDIWC_obpzEZpUNRQ

Please help me fixing this, I have gone through stackoverflow and tried several things, no one worked.
Thanks,

A: XMLWriter is a standard XML API for result lists - just like a database result. It works in a linear way, keeping the memory usage low.
The XMLWriter takes care of the escaping as needed. Make sure that you have set the encoding of your database connection to utf-8.
$records = [
  [
    'questionid' => '1',
    'item' => 'one'
  ],
  [
    'questionid' => '2',
    'item' => 'two'
  ]
];

header('Content-type: text/xml; charset: utf-8');
$out = new XMLWriter();
$out->openURI('php://output');
$out->setIndent(true);
$out->startDocument('1.0', 'UTF-8');
$out->startElement('quiz');

while (list($key, $record) = each($records)) {
  $out->startElement('question');
  $out->writeAttribute('id', $record['questionid']);
  $out->writeElement('item', $record['item']);
  $out->endElement();
}

$out->endElement();

Output:
<?xml version="1.0" encoding="UTF-8"?>
<quiz>
 <question id="1">
  <item>one</item>
 </question>
 <question id="2">
  <item>two</item>
 </question>
</quiz>


text:
Q: jQuery - returned value using json skips the first object I have the following piece of code:
var url = "/MyURL";
$.get(url, function (dataUrl) {
    jQuery.ajax({
        type: "GET",
        url: "MyURL?PrjID="+ prjid +" ",
        data: dataUrl,
        headers: {
            "Content-Type": "application/json"
        },
        dataType: "json",
        crossDomain: true,
        async: true
    }).success(function (data, textStatus) {
        console.log(data)
       })
});

Following is the result retrieved from the webservice (MyURL) which is a valid JSON string
[{"ProteinID":"O15247","GeneName":"CLIC2"},
{"ProteinID":"O95833","GeneName":"CLIC3"},
{"ProteinID":"Q9Y696","GeneName":"CLIC4"},
{"ProteinID":"O15516","GeneName":"CLOCK"}]

But, the actual objects that are retrieved from the JSON request have always one less element than the actual data and more precisely the first record of the result-set is always skipped. For the above example the result I get (the log from the console) is the following:
0: Object { ProteinID: "O95833", GeneName: "CLIC3" }
1: Object { ProteinID: "Q9Y696", GeneName: "CLIC4" }
2: Object { ProteinID: "O15516", GeneName: "CLOCK" }

Any idea what's going wrong here? Thanks in advance.


text:
Q: Gupshup Save response labels of the users in whatsapp I have an array declared at the beginning and inside my MessageHandler function I capture the responses with if(event.message) and push the message in the array but when it comes to displaying them in a variable called "datos" in a whatsapp message it doesn't work . In the development environment by gupshup it works but when deploying it in whatsapp it doesn't.

var botScriptExecutor = require('bot-script').executor;
var scr_config = require('./scr_config.json');
var arr = [];

function MessageHandler(context, event) {
  if (event.message == "Evento" || event.message == "Construccion" || event.message == "Servicio" || event.message == "Evento 1" || event.message == "Construccion 2" || event.message == "Servicio 3") {
      json.categ = event.message;
    }
    if (event.message == "Saltillo" || event.message == "Monterrey" || event.message == "Otro" || event.message == "Saltillo 2" || event.message == "Monterrey 2" || event.message == "Otro 3") {
      json.zona = event.message;
    }
}
exports.array = json;

in my script defalt.js I work with the label of the "datos" variable

module.exports.datos = {
    label_baas: datosSoli
}

var message = require('./index.js');

function datosSoli(options, event, context, callback) {
    console.log("---------------------label datosSoli---------------------");
    var info = "";
    info = "categoria: " + message.array.categ + "zona: " + message.array.zona;

    options.next_state = 'label_baaj';
    options.data.datos = info;

    console.log("-----------options.data.datos-------------", options.data.datos);
    callback(options, event, context);
}

This is the flow of my conversation where the "datos" variable module is shown
enter image description here


text:
Q: Passing props to React Router which contains multiple components React Router v2.5.1
React v15.1.0
Route config:
<Router history={hashHistory}>
  <Route path="auth" component={AuthLayout}>
    <Route path="login" components={{main:LoginForm, footer: LoginFooter}} />
    <Route path="register" components={{main:RegisterForm, footer: RegisterFooter}} />
  </Route>
</Router>

AuthLayout Component
class AuthLayout extends React.Component {
    render() {
        const { main, footer} = this.props;
        return (

                        {main}

                {footer}

        );
    }
}

export default AuthLayout;

Question - how do you pass props to the AuthLayout component from React Router where there are multiple components i.e. dependent on the component for {main} a different props should be passed.
I am fairly new to react so if I am approaching this incorrectly please advise.
I have researched this topic but many of the solutions seemed out of date and did not take into account when multiple components can be loaded.

A: I've written a JsFiddle that demonstrates passing props to the AuthLayout component. It uses the Navigation router instead of the React Router but I hope you're open to that. You can see that I'm passing a title prop to the AuthLayout. I set the title to either 'Login' or 'Register' depending on the main content. The Navigation router doesn't render components for you so you can pass whatever props you want.
var {StateNavigator} = Navigation;
var {NavigationLink} = NavigationReact;

var AuthLayout = ({title, stateNavigator}) => (

{title}

)

var Login = ({stateNavigator}) => (
  <NavigationLink
    stateKey="register"
    stateNavigator={stateNavigator}>
    Register
  </NavigationLink>
)

var Register = ({stateNavigator}) => (
  <NavigationLink
    stateKey="login"
    stateNavigator={stateNavigator}>
    Login
  </NavigationLink>
)

var LoginFooter = () =>
Login Footer

var RegisterFooter = () =>
Register Footer

var stateNavigator = new StateNavigator([
  {key: 'login', route: ''},
  {key: 'register', route: 'register'}
]);

stateNavigator.states.login.navigated = () => {
  ReactDOM.render(<AuthLayout title="Login" />,
    document.getElementById('container'));
  ReactDOM.render(<Login stateNavigator={stateNavigator} />,
    document.getElementById('content'));
  ReactDOM.render(<LoginFooter />,
    document.getElementById('footer'));
}

stateNavigator.states.register.navigated = () => {
  ReactDOM.render(<AuthLayout title="Register" />,
    document.getElementById('container'));
  ReactDOM.render(<Register stateNavigator={stateNavigator} />,
    document.getElementById('content'));
  ReactDOM.render(<RegisterFooter />,
    document.getElementById('footer'));
}

stateNavigator.start();

A: hey @markyph I'd prefer going with AuthLayout to look like:

    const AuthLayout = props =>

                        {props.children}

with footer and auth layout being essentially "containers". you can access props from react-router anywhere by using withRouter(Component) in v3.0.0-alpha.1 it provides props.params and location to your component.
this is much nicer than having to pass props at every level.
This feature will make its way into the main branch hopefully very soon.
If thats not an option I'd have something like:
  const AuthLayout = props =>

                    {props.children}

to pass router props to props.children you can do something the answer shown here: How to pass props to {this.props.children}
for either method you would have the following in your router config.
<Route path={'/auth'} component={AuthLayout}>
   <Route path={'forgot'} component={Forgot}/>
   <Route path={'login'} component={Login}/>
</Route>


text:
Q: Yii 2 Filter many-to-many relation on a value in the junction table How can I use a many to many relation in Yii 2.0 where I filter the results on values that are in the connection/junction table?
I have the following tables
Member (id INT, name, ...)
Event (id INT, name, date, ...)
EventMemberConnection (id INT, event_id INT, member_id INT, accepted TINYINT(1) DEFAULT 0, foreign keys....)

Where members are connected to events through EventMemberConnection, with an integer telling if they are accepted or declined
From model file Event.php:
/**
 * @return \yii\db\ActiveQuery
 */
public function getAcceptedMembers() {
    return $this->hasMany(Member::className(), ['id' => 'member_id'])->viaTable('EventMemberConnection acceptedConnection', ['event_id' => 'id'])->onCondition(['acceptedConnection.accepted' => 1]);
}

/**
 * @return \yii\db\ActiveQuery
 */
public function getDeclinedMembers() {
    return $this->hasMany(Member::className(), ['id' => 'member_id'])->viaTable('EventMemberConnection declinedConnection', ['event_id' => 'id'])->onCondition(['declinedConnection.accepted' => 0]);
}

And the query, inside a rest controller:
public function prepareDataProvider() {
    $query = Event::find();

    $query->joinWith('acceptedMembers acceptedMember');
    $query->joinWith('declinedMembers declinedMember');

    $query->groupBy(['Event.id']);

    return new ActiveDataProvider([
        'query' => $query
    ]);
}

I am using the REST API to fetch event objects extended with both acceptedMembers and declinedMembers. I get the following database error from the call:
Column not found: 1054 Unknown column 'acceptedConnection.accepted' in 'where clause'
The SQL being executed was: SELECT * FROM `Member` `acceptedMember` WHERE (`id` IN ('5', '9')) AND (`acceptedConnection`.`accepted`=1)

I guess that the main query went fine, but the extra call where Yii fetches the related members it adds the condition used in the onConnection function.
I read in the documentation that it is only supposed to be used to filter on the related table and not the junction table. So I don't believe that onCondition is the way to go.
Is there a way to filter the relation on values set in the junction table?

A: I found in the documentation that you can add a callback to the viaTable() function that can be used to customize the join query. You can use it like this:
public function getAcceptedMembers() {
    return $this->hasMany(Member::className(), ['id' => 'member_id'])->viaTable('EventMemberConnection acceptedConnection', ['event_id' => 'id'], function($query){
        $query->where(['acceptedConnection.accepted' => 1]);
    });
}


text:
Q: Good resources for learning "Close to the Metal" Web Development I must apologize if this is a duplicate question, but I can't seem to find one close enough to what I'm asking. I'll happily close this one if someone can point me to the duplicate.
Just for some background. I'm a developer that started in the .NET space with WinForms. While I did do some WebForms work, most of that work was spent very much in the classic Postback style of WebForms development and firmly routed in that particular abstraction. I very quickly found myself in the XAML world (primarily Silverlight). All of that is to say that all of my web development work has been primarily in a particular abstraction, with little or no "Close to the Metal" type work. I have very briefly looked at the Microsoft ASP.NET MVC stuff and found it very interesting, but it had to be put on the "back burner", while I focused on the things I worked with day-to-day.
I finally find myself in a place where I have enough time and determination to work with technologies (like MVC) that allow me to reach outside of those pre-made abstractions. The challenge is, that with all the time spent there, I don't know what I don't know. So, to the true question.
Can anyone recommend some good resources as a starting point for learning the technologies involved. I understand that I'll nee to brush up more on good HTML markup, JQuery, maybe an MVC framework or two. But also, where do I go to learn, what I as as a developer should understand about the HTTP Protocol, headers, etc...? Where can I go to learn what other base level technologies I should understand (as in what they even are) if I want to work in this more granular fashion? I cut my teeth in a Microsoft-centric space, and while working from that perspective may speed things up for me, I don't feel like using JUST those tools is a requirement by any stretch.
I truly hope that the question makes sense and is able to properly explain what I'm asking for. I have had difficulty articulating what I'm trying to understand. I very much feel that there are holes in my knowledge, that I'd like to fill. I'm just not certain I understand what and where those holes are.
Thanks in advance for your anticipated support.
Cheers,
Steve

A: You are definitely on the right track... but a couple points..

*

*Don't work with jQuery until you learn the javascript language, it has many nuances that can easily trip up experienced classical programmers like yourself.  I recommend Javscript: The Good Parts.  Not to mention to stay true to you're commitment to learn "Close to the metal" Web Development...

*Understanding that the HTTP model is stateless is BIG...  ASP.NET WinForms tries to give the developer a state-full experience, which is going directly against the grain of the web.  Request > Response... no persistent state is retained.

*With the rise of RESTful web services really learning the HTTP model is a big help going forward.

*MVC is essentially the industry standard and Microsoft has finally came on board.  MVC3 is good and is leaps and bounds an improvement over WinForms, but still has that bloated feel.  I would recommend PHP's Codeigniter as a good starting point... they don't do a lot of magic for you and you really learn a lot while using it.  The PHP syntax is a bit verbose for my taste, but it should be fairly similar for you coming from a C based lang background.
I actually found myself in the exact opposite recently, going from a more "close to the metal" approach to (through work) moving to the ASP.NET Winforms model... really frustrating experience...

A: Maybe Opa, Ocsigen, FastCgi could interest you?
But I don't find web technologies close to the metal in general (for me, a Linux kernel driver is much closer to the metal than any web related software).

A: Here's a big list of places that I find/found useful:

*

*W3Schools - One stop shop for learning web technologies.

*PHP's Documentation

*jQuery Documentation

*Wikipedia page for Ajax - A wonderful description of Ajax and some interesting points about it.

*jsFiddle - A great sandbox for testing HTML, CSS and JS code snippets.

*CSS2 Specification - A little dry (official spec) but useful when you need clarification on a behaviour.

*HTTP Protocol Specification (RFC2616) - Useful for understanding how HTTP works behind the scenes.

*CSS Hacks - Big list of CSS hacks for browsers, useful for when IE doesn't play nice.

Tools I find useful:

*

*Web Developer Toolbar (Firefox) - Awesome toolbar for debugging your DOM stuff.

*Notepad++ - Great text editor with syntax highlighting.

*Firebug - JavaScript debugging for Firefox.

*Tamper Data - HTTP header editor for Firefox.

A: http://www.pluralsight.com to add to the already accepted answer. This will get you going very well.


text:
Q: Plone: Redirecting Generic Views on AJAX call I have an AJAX call to the edit view of a content element "bar"
http://foo/bar/edit

that is rendered in an overlay. After editing the overlay closes
and redirects to
http://foo/bar

How do I tell the edit view (by the request or the form data) to redirect to
http://foo

after successful editing?
Any help appreciated
Volker

A: I see two possible solutions.

*

*Add a "redirect_to_parent" default view to the content type you edit.

from Products.Five.browser import BrowserView
from Acquisition import aq_inner
class RedirectToParent(BrowserView):

    def __call__(self):
        context = aq_inner(self.context).aq_explicit
        return self.context.REQUEST.RESPONSE.redirect(
            context.aq_parent.absolute_url())

So you're going to redirect automatically to it's parent after editing.
Disadvantage: You cannot longer access the view of this content directly, you have to register a second detail_view, which does not redirect you.

*Handle the redirect with js (not working example):

$(...).prepOverlay({
    subtype: 'ajax',
    filter: "#content",
            formselector: 'form',
            closeselector: '[name="form.button.cancel"]',
            config: {
                onClose: function(e, overlay) {
            // Implement redirect / reload
        }
    }
});

imho you should open the overlay already from it's parent, so it should be enough to just close the overlay an reload the necessary parts in the onClose event.


text:
Q: Angular validation message for irequired input after touched I am using Angular reactive forms and I found here validation idea. It's pretty great but there is one problem. When the form is empty and I click on input, then it is going to get invalid class (red color) but no error message is display. Only after I put some text and delete it, the message will arrive. I am wondering how can I change this 'if steatment' to work as it shoud
if (control && control.dirty && !control.valid)

I just want to add error message which will occur after I click on input and then leave it (still) empty. Do You have any idea how to achive it?

A: If you set name control to following:
...name: ["", [Validators.required],....

then should be able to do the following:
Error on username

or, if you mind about the layout change (as *ngIf will remove it from the DOM), you can apply [hidden] property with the reverse logic:

Plunker

A: Hi can you look at this example,Here implement the form validation
Angular2 form validation
Hope it help you.

A: Its tough to answer without a working example, but in general, I use the opposite logic to what you're doing. Basically, specify the conditions when you wouldn't show the error, and always show it otherwise. For me that's usually
 (!password.touched || (password.touched && password.valid))

For example. Also, don't forget about 'pristine'.


text:
Q: Meteor deploy to myapp.meteor.com not displaying changes seen on localhost Using Telescope app and everything is running great on my localhost. I was able to play with the settings, create an account and get the app started.
I deployed it to appname.meteor.com, but it's only showing the original Telescope app, without my changes I can see on localhost.
Deploys look fine, but the changes aren't reflected on appname.meteor.com
$ meteor deploy appname.meteor.com
$ Deploying to appname.meteor.com. Bundling...
$ Uploading...
$ Now serving at appname.meteor.com

New to all this - any help is appreciated!

A: Looks like you want to deploy your development mongodb to meteor.com.
You can achieve this by using the following script:
# How to upload local db to meteor:

# -h = host, -d = database name, -o = dump folder name
mongodump -h 127.0.0.1:3002 -d meteor -o meteor

# get meteor db url, username, and password
meteor mongo --url myapp.meteor.com

# -h = host, -d = database name (app domain), -p = password, folder = the path to the  dumped db
mongorestore -u client -h c0.meteor.m0.mongolayer.com:27017 -d myapp_meteor_com -p 'password' folder/

Make sure your application is running or the mongodump will fail
Source for script

A: Dump files should be located in /dump/meteor instead of simply /dump.


text:
Q: Why is list.remove(value) not working at all? I have this code:
def game():
    for i in range(0, 10):
        questions = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
        randomInt = choice(questions)
        print(formatIt(songs[randomInt], artists[randomInt]))
        questions.remove(randomInt)

(formatIt is one of my own functions and choice is random.choice)
Everything works as it should until the questions.remove at the bottom, which does nothing (with no error message). I have tried changing the list items to strings; using a set rather than a list, but this isn't compatible with the random.choiceand changing the variable to an actual value, but the list stays unchanged.

A: Two things, firstly:
questions.remove(questions[randint(0,9)])   # otherwise it can try removing like 65 or something

Secondly: I don't know if it's intended, but in every step inside loop you are bringing questions back to its original state. If you dont want that, put this line before for:
def game():
    questions = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
    for i in range(0, 10):
        # rest of code


text:
Q: Mutex or not to Mutex? I have an array A of length 1024 and I have 4 threads, the first will work on indexes 0 to 255, the second on 256 to 511, the third on 512 to 767, the last will work on indexes 768 to 1023.
Do I need a Mutex for that ?

A:
Do I need a Mutex for that?

Assuming something like:
int A[1024];

Short answer (for C): No.


text:
Q: Android Broadcast receiver doesn't work I can not seem to figure out why my broadcast receiver does not work. I am looking to receive incoming text messages.
I dont declare the broadcast receiver in the manifest. I register them programatically.
    public static final String SMS_RECEIVED_ACTION = "android.provider.Telephony.SMS_RECEIVED";

    IntentFilter filter = new IntentFilter(SMS_RECEIVED_ACTION);
    filter.setPriority(999);
    this.registerReceiver(smsListener, filter);

My broadcast receiver is a defined in the activity as such
public BroadcastReceiver smsListener = new BroadcastReceiver() {
    @Override
    public void onReceive(Context context, Intent intent) {
        if(intent.getAction().equals(SMS_RECEIVED_ACTION)) {
            System.out.println("In broadcast receiver");
            Bundle bundle = intent.getExtras();
            SmsMessage[] msgs = null;
            String msg_from;
            if (bundle != null){
                try{
                    Object[] pdus = (Object[]) bundle.get("pdus");
                    msgs = new SmsMessage[pdus.length];
                    for(int i=0; i<msgs.length; i++){
                        msgs[i] = SmsMessage.createFromPdu((byte[])pdus[i]);
                        msg_from = msgs[i].getOriginatingAddress();
                        System.out.println("SMS Message from: " + msg_from);
                    }
                }catch(Exception e){
                    System.out.println("Error when receiving a message");
                }
            }
        }
    }
};

Any thoughts is greatly appreciated.


text:
Q: Not able to access the child control with in user control using javascript I have a user control "SettingsControl" containing an ajax:CollapsiblePanelExtender which in turn has a GridView (gridView) and checkBoxes. On top of GridView we have two LinkButtons "Select All" and "Clear All". I have written to enable select all and clear all functionality. Select All should select all the rows in the grid by calling the following JavaScript written on the Client .aspx file.
function SelectAll(chk)
{
    //get reference of GridView control
    var grid = document.getElementById('<%= SettingsControl1.FindControl("gridView").ClientID %>');
    //variable to contain the cell of the grid
    var cell;

    if (grid.rows.length > 0)
    {
        //loop starts from 1. rows[0] points to the header.
        for (i=1; i<grid.rows.length; i++)
        {
            //get the reference of first column
            cell = grid.rows[i].cells[0];

            //loop according to the number of childNodes in the cell
            for (j=0; j<cell.childNodes.length; j++)
            {
                //if childNode type is CheckBox
                if (cell.childNodes[j].type =="checkbox" && cell.childNodes[j].id.indexOf('chkSel')!=-1)
                {
                //assign the status of the Select All checkbox to the cell checkbox within the grid
                    cell.childNodes[j].checked = chk;
                }
            }
        }
    }
}

I am not able to access the usercontrol or any element of user control on client side. I am not sure how to achive this functionality.
The .aspx page cal the user control as:
<uc1:SettingsControl ID="SettingsControl1" runat="server" />

PLEASE HELP!!!!

A: var grid = document.getElementById('SettingsControl1_gridView');

does the trick for me.
If you're executing a script INSIDE a user control you have to use 'SettingsControl1$gridView'.
Hope this will help anyone... anytime... ;-)


text:
Q: Example of sets that are not measurable? This question is a mixture of several related problems.

*

*Is there any concrete examples (the examples that are easy to construct and think about, and of which the construction doesn't include heavy language of set theory) for sets that are not Lebesgue measurable?

*Without Axiom of Choice, is the existence of sets that are not Lebesgue measurable unprovable? If so, how to prove this unprovability?

*Is there concrete, simple examples of sets that are Lebesgue measurable and are not Borel measurable?

*Is the class of all Lebesgue Measurable sets a maximal collection of subsets of $\mathbb{R}$ on which we can define a nonzero measure?


text:
Q: Anime where a kid has a small humanoid magical companion who has a round shape and wings Over 10 years ago, I saw this anime, so there are some things that I don't remember anymore, only that there was this teenage kid that had a small magical companion in a green suit and small wings. There was also a girl that went to the same school as the protagonist and she had another magical companion, but this one had a black suit.
The humanoids from the anime I'm talking about had almost an entirely round shape, they looked like flying balls with a head and wings. And their suits were entirely of the color I mentioned before —the protagonist's had one color blue and the girl had one color black—.

A: I think it was called Mirmo de Pon!. I remember watching it when I was a kid.

Over 10 years ago,

The original airing in Japan was from 2002 to 2005.

had almost an entirely round shape, they looked like flying balls with a head and wings.

The Muglox, the magical companions in Mirmo de Pon!, indeed have a very round shape. They don't have wings, but there are two possibilities for misremembering Muglox to have wings. For one, Mirmo, the Muglox that gives the series its name, twice uses an angel outfit. But there is a more likely possibility: Certain Muglox' are able to transform their human companions into fairies -- which have wings

the protagonist's had one color blue and the girl had one color black--.

Mirmo is the Muglox of the protagonist and has "a blue hat, yellow hair, blue apparel,". Yatch, Mirmos rival and the Muglox of the protagonists rival is usually dressed in red with black, and has black hair. Moreover he is described as having "ninja-like weapons and looks" and thus may have appearances clad completely in black.

A: Could it perhaps be Angelic Layer?

Plot Summary: 12-year-old Misaki Suzuhara has just gotten involved in
  Angelic Layer, a battling game using electronic dolls called angels.
  Even as a newbie, Misaki shows advanced skills as she meets new
  friends and enters Angelic Layer tournaments to fight the greatest
  Angelic Layer champions of the nation.


text:
Q: Navigation bar translucent property misplaces other UIComponents? I am facing a issue when I set the translucent property of navigation bar to NO, other UIComponents such as buttons and UIViews do not show up in proper place.What must be the reason?
So I have to use this:
 self.navigationController.navigationBar.translucent = YES;

Instead of what I require is this:
self.navigationController.navigationBar.translucent = NO;

A: It looks like iOS 7 navigation bar issue. You can try to add this code to wiewDidLoad in your View Controller
if ([self respondsToSelector:@selector(edgesForExtendedLayout)]) {
    self.edgesForExtendedLayout = UIRectEdgeNone;
}

It helped me to solve my issue


text:
Q: Call ((Double)->())? in Swift I am using a library to do rating as stars,so I'm trying to get a reference of : public var didFinishTouchingCosmos: ((Double)->())?
in my view controller i got a reference of view like :
@IBOutlet var raitingView: CosmosView!
var rating : Double?

Then in my view controller viewDidLoad i start using it this way :
raitingView.didFinishTouchingCosmos{rating in
        }

but I'm getting an error cannot call value of non-function type((double) ->())?
The library link is here : https://github.com/marketplacer/Cosmos

A: You should call the function this way. Actually this is a very basic syntax you can check from the introduction to Swift from apple. I recommend you to read the Swift tutorial from Apple through iBook Store. They are free.
raitingView.didFinishTouchingCosmos = { rating in
    // Do what you want to do
}


text:
Q: Проблема с выводом класса У меня есть много элементов следующего вида

Вопрос: как мне получить имя второго класса при нажатии на элемент, чтоб не писать по нескольку раз hasClass и не нагружать код ?

A:

$('.one_of_level').click(function(){
  this.classList.forEach(item => {
    if (item.indexOf("lvl_") == 0)
      console.log(item);
  });
});
.one_of_level {
  width:40px;
  height:40px;
  border:1px solid black;
  background:lightgreen;
  display:inline-block;
}


text:
Q: How can I use threading in Python to parallelize AWS S3 API calls? I wrote a Python script that seeks to determine the total size of a all available AWS S3 buckets by making use of the AWS Boto 3 list_objects() method.
The logic is simple:

*

*Get the initial list of objects from each S3 bucket (automatically truncated after 1,000 objects)

*Iterate through each object in the list of objects, adding the size of that object to a total_size variable

*While the bucket still has additional objects, retrieve them and repeat step 2

Here's the relevant code snippet:
import boto3

s3_client = boto3.client('s3')

# Get all S3 buckets owned by the authenticated sender of the request
buckets = s3_client.list_buckets()

# For each bucket...
for bucket in buckets['Buckets']:
    # Get up to first 1,000 objects in bucket
    bucket_objects = s3_client.list_objects(Bucket=bucket['Name'])

    # Initialize total_size
    total_size = 0

    # Add size of each individual item in bucket to total size
    for obj in bucket_objects['Contents']:
        total_size += obj['Size']

    # Get additional objects from bucket, if more
    while bucket_objects['IsTruncated']:
        # Get next 1,000 objects, starting after final object of current list
        bucket_objects = s3_client.list_objects(
            Bucket=bucket['Name'],
            Marker=bucket_objects['Contents'][-1]['Key'])
        for obj in bucket_objects['Contents']:
            total_size += obj['Size']

    size_in_MB = total_size/1000000.0
    print('Total size of objects in bucket %s: %.2f MB'
        % (bucket['Name'], size_in_MB))

This code runs relatively quickly on buckets that have less than 5 MB or so of data in them, however when I hit a bucket that has 90+ MB of data in it, execution jumps up from milliseconds to 20-30+ seconds.
My hope was to use the threading module to parallelize the I/O portion of the code (getting the list of objects from S3) so that the total size of all objects in the bucket could be added as soon as the thread retrieving them completed rather than having to do that retrieval and addition sequentially.
I understand that Python doesn't support true multithreading because of the GIL, just to avoid getting responses to that effect, but my understanding is that since this is an I/O operation as opposed to a CPU-intensive operation, the threading module should be able to improve the run time.
The main difference between my problem and the several examples I've seen on here of threading implementations is that I'm not iterating over a known list or set. Here I must first retrieve a list of objects, see if the list is truncated, and then retrieve the next list of objects based off of the final object's key in the current list.
Can anyone explain a way to improve the run time of this code, or is it not possible in this situation?

A: I ran into similar problems.
It seems to be important to create a separate session for each thread.
So instead of
s3_client = boto3.client('s3')

you need to write
s3_client = boto3.session.Session().client('s3')

otherwise threads interfere with each other, and random errors occur.
Beyond that the normal issues of multithreading apply.
My project is upload 135,000 files to an S3 bucket.  So far I have found that I get the best performance with 8 threads.  What would otherwise take 3.6 hours, takes 1.25 hours.

A: I have a solution which may not work in all cases but can cover a good deal of scenarios. If you have objects organised hierarchically in subfolders, then first only list subfolders using mechanism described in this post
Then using these obtained set of prefixes submit them to a multiprocessing pool (or Thread Pool) where each worker will fetch all keys specific to one prefix and collect them in a shared container using multiprocessing Manager. In this way keys will be fetched in parallel.
Above solution will perform best if keys are distributed evenly and hierarchically and worst if data is organized flat.


text:
Q: How to write a caption under an image? I have two images that need to kept inline; I want to write a caption under each image.

How can I implement?

A: Put the image — let's say it's width is 140px — inside of a link:

Next, put the caption in a  and give it a width less than your image, while centering it:

I just love to visit this most beautiful place in all the world.

Next, in the link tag, style the link so that it no longer looks like a link. You can give it any color you want, but just remove any text decoration your links may carry.

I just love to visit this most beautiful place in all the world.

I wrapped the image with it's caption in a link so that no text could push the caption out of the way: The caption is tied to the picture by the link. Here's an example: http://www.alphaeducational.com/p/okay.html

A:

    caption 1

   caption 2

A: Figure and Figcaption tags:

Caption goes here

Gotta love HTML5.

See sample

#container {
    text-align: center;
}
a, figure {
    display: inline-block;
}
figcaption {
    margin: 10px 0 0 0;
    font-variant: small-caps;
    font-family: Arial;
    font-weight: bold;
    color: #bb3333;
}
figure {
    padding: 5px;
}
img:hover {
    transform: scale(1.1);
    -ms-transform: scale(1.1);
    -webkit-transform: scale(1.1);
    -moz-transform: scale(1.1);
    -o-transform: scale(1.1);
}
img {
    transition: transform 0.2s;
    -webkit-transition: -webkit-transform 0.2s;
    -moz-transition: -moz-transform 0.2s;
    -o-transition: -o-transform 0.2s;
}

First image

Second image

A: CSS is your friend; there is no need for the center tag (not to mention it is quite depreciated) nor the excessive non-breaking spaces. Here is a simple example:
CSS
.images {
    text-align:center;
}
.images img {
    width:100px;
    height:100px;
}
.images div {
    width:100px;
    text-align:center;
}
.images div span {
    display:block;
}
.margin_right {
    margin-right:50px;
}
.float {
    float:left;
}
.clear {
    clear:both;
    height:0;
    width:0;
}

HTML

        This is some text

        And some more text

A: CSS
#images{
    text-align:center;
    margin:50px auto;
}
#images a{
    margin:0px 20px;
    display:inline-block;
    text-decoration:none;
    color:black;
 }

HTML

Caption 1

Caption 2

A fiddle is here.

A: To be more semantically correct and answer the OPs orginal question about aligning them side by side I would use this:
HTML

Caption 1

Caption 2

CSS
.items{
text-align:center;
margin:50px auto;}

.items figure{
margin:0px 20px;
display:inline-block;
text-decoration:none;
color:black;}

https://jsfiddle.net/c7borg/jLzc6h72/3/

A: For responsive images. You can add the picture and source tags within the figure tag.

  <picture>
    <source media="(min-width: 750px)" srcset="images/image_2x.jpg"/>
    <source media="(min-width: 500px)" srcset="images/image.jpg" />

  </picture>

Caption goes here

A: The
 tag in HTML5 allows you to enter text to your image for example:

Your text here

.

You can then use CSS to position the text where it should be on the image.

A:

caption1caption2

Style as desired.


text:
Q: Em Python como passar o self entre 2 janelas usando módulos Estou aprendendo Python, versão 3.7 com PyQT5 (Qt Designer)
Estou tentando definir o valor de uma label usando módulos, na window 1 ele chama a função e funciona, mas quando abro a window 2 e clico no botão ele aciona a função mas passa o self da janela atual (window 2) onde não tem label, gerando o seguinte erro:
Traceback (most recent call last):
  File "\template\config.py", line 18, in returnMain
    fun1(self)
  File "\modulos\functions.py", line 7, in fun1
    lbl = int(self.ui.lblTest.text())
AttributeError: 'Ui_window2' object has no attribute 'lblTest'

Preciso que ele use na função o self da window 1.
Repliquei o erro em arquivos pequenos, funciona até clicar no botão da segunda janela que da o erro descrito.
Segue a estrutura dos códigos no diretório:

Segue os arquivos.
run.py (usado para startar o programa)
from PyQt5.QtWidgets import QApplication, QWidget, QPushButton
import sys

from template.main import MainScreen

if __name__ == "__main__":
    app = QApplication(sys.argv)
    main = MainScreen()
    main.show()

sys.exit(app.exec_())

gui/window1.py (janela principal)
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_window1(object):
    def setupUi(self, win1):
        win1.setObjectName("win1")
        win1.resize(297, 219)
        self.centralwidget = QtWidgets.QWidget(win1)
        self.centralwidget.setObjectName("centralwidget")
        self.btnConfig = QtWidgets.QPushButton(self.centralwidget)
        self.btnConfig.setGeometry(QtCore.QRect(110, 150, 75, 23))
        self.btnConfig.setObjectName("btnConfig")
        self.lblTest = QtWidgets.QLabel(self.centralwidget)
        self.lblTest.setGeometry(QtCore.QRect(120, 70, 47, 13))
        self.lblTest.setObjectName("lblTest")
        win1.setCentralWidget(self.centralwidget)

        self.retranslateUi(win1)
        QtCore.QMetaObject.connectSlotsByName(win1)

    def retranslateUi(self, win1):
        _translate = QtCore.QCoreApplication.translate
        win1.setWindowTitle(_translate("win1", "Window 1"))
        self.btnConfig.setText(_translate("win1", "Open config"))
        self.lblTest.setText(_translate("win1", "0"))

gui/window2.py (janela de configurações)
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_window2(object):
    def setupUi(self, win2):
        win2.setObjectName("win2")
        win2.resize(222, 241)
        self.centralwidget = QtWidgets.QWidget(win2)
        self.centralwidget.setObjectName("centralwidget")
        self.btnReturn = QtWidgets.QPushButton(self.centralwidget)
        self.btnReturn.setGeometry(QtCore.QRect(70, 120, 75, 23))
        self.btnReturn.setObjectName("btnReturn")
        win2.setCentralWidget(self.centralwidget)

        self.retranslateUi(win2)
        QtCore.QMetaObject.connectSlotsByName(win2)

    def retranslateUi(self, win2):
        _translate = QtCore.QCoreApplication.translate
        win2.setWindowTitle(_translate("win2", "Window 2"))
        self.btnReturn.setText(_translate("win2", "Return Main"))

modulos/functions.py (onde vão ficar as funções)
from PyQt5.QtWidgets import *
from template import main

def fun1(self):
    lbl = int(self.ui.lblTest.text())
    lbl = (lbl+1)
    self.ui.lblTest.setText(str(lbl))

template/config.py (onde vou tratar as configurações)
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtWidgets import *
from gui.window2 import *
from modulos.functions import fun1

class ConfigScreen(QMainWindow):

    def __init__(self,*args,**argsv):
        super(ConfigScreen,self).__init__(*args,**argsv)
        self.ui = Ui_window2()
        self.ui.setupUi(self)
        self.ui.btnReturn.clicked.connect(self.returnMain)

    def returnMain(self):
        fun1(self)
        self.close()

template/main.py (módulo principal do programa)
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtWidgets import *
from gui.window1 import *
from template.config import ConfigScreen
from modulos.functions import fun1

class MainScreen(QMainWindow):

    def __init__(self,*args,**argsv):
        super(MainScreen,self).__init__(*args,**argsv)
        self.ui = Ui_window1()
        self.ui.setupUi(self)
        self.ui.btnConfig.clicked.connect(self.openConfig)

        fun1(self)

    def openConfig(self):
        self.config = ConfigScreen()
        self.config.show()

Lembre-se, oque é simples pra vc, pode ser muito difícil para outros.
Estou a 1 semana tentando resolver e não consigo, eu programava muito tempo atrás e estou tentando/precisando aprender algo novo

A: vc esta tentando alterar um atributo  que não existe na classe ConfigScreen; o atributo lblTest pertence ao seu ui na classe MainScreen. Quando vc chama a funcao func1(self) na classe MainScreen provavelmente funciona pois o self passado como parametro para a funcao é um referencia a classe MainScreen ou seja a propria  instancia da classe MainScreen; já na classe ConfigScreen quando vc chama a mesma func1(self) vc está passando a referencia da classe ConfigScreen e a funcao tenta alterar um atributo que não existe; para alterar o atributo lblTest vc precisa de uma referencia da classe principal para ter acesso a esse atributo;
então crie um parametro na inicializacao da classe ConfigScreen ex:
class ConfigScreen(QMainWindow):

def __init__(self,*args,**argsv, parent):
    super(ConfigScreen,self).__init__(*args,**argsv, parent)
    self.parent = parent
    self.ui = Ui_window2()
    self.ui.setupUi(self)
    self.ui.btnReturn.clicked.connect(self.returnMain)

def returnMain(self):
    fun1(self.parent)
    self.close()

o atributo self.parent pega a instancia da classe principal. E na classe MainScreen passe  o self na instanciacao da classe ConfigScreen ex:
def openConfig(self):
    self.config = ConfigScreen(self) # parent recebe o self como valor
    self.config.show()

A: o karlloss está certo, em returnMain não é necessário passar o objeto para func1.
Talvez a confusão esteja no entendimento do parâmetro self, ele funciona muito parecido com o this em outras linguagens como Java ou JavaScript. É um parâmetro da classe a qual ele pertence e só existe dentro dessa classe. Se quiser passar as propriedades de uma classe para outra use o próprio objeto instanciado e não o self.
Perceba que aqui:
def fun1(self):
    lbl = int(self.ui.lblTest.text())
    lbl = (lbl+1)
    self.ui.lblTest.setText(str(lbl))

O argumento self poder, por exemplo, ter outro nome, já que ele não faz parte de nenhuma classe.
Continue os estudos, com a prática alguns conceitos vão começar a fazer mais sentido :)

A: Consegui resolver com a resposta do karlloss.
A principio tinha gerado um erro:
    def __init__(self,*args,**argsv, parent):
                                          ^
SyntaxError: invalid syntax

Pesquisando um pouco descobri que o parent deve vir antes dos outros argumentos:
class ConfigScreen(QMainWindow):

    def __init__(self, parent, *args, **argsv):
        super(ConfigScreen,self).__init__(parent, *args,**argsv)
        self.parent = parent
        self.ui = Ui_window2()
        self.ui.setupUi(self)
        self.ui.btnReturn.clicked.connect(self.returnMain)

    def returnMain(self):
        fun1(self.parent)
        self.close()

Após essa pequena correção tudo funcionou perfeitamente.
Muito obrigado aos envolvidos.


text:
Q: Determine if block has already been registered In gutenberg/block-editor, how can I check whether I've already registered a block type? Is there a function I can use? Searching through the Block Editor Handbook I couldn't see a function to check this.
An example of what I am trying to do is below:
class My_Block {

    public function __construct() {
        if ( ! SOME_FUNCTION_block_exists('foo/column') ) {
            register_block_type( 'foo/column', my_args );
        }
    }

}

A: EDIT
I just realized you're doing this on the PHP side. There is a class called WP_Block_Type_Registry that you can use to see what is already registered:
$registry = WP_Block_Type_Registry::get_instance();
if ( ! $registry->get_registered( 'foo/column' ) ) {
    // YOUR CODE
}

Gutenberg should fire a console error if a block has already been registered. See the registerBlockType src here.

A: When editing a page using Gutenberg, you can use the Developers Console to execute wp.blocks.getBlockTypes() and get all active registered blocks in Gutenberg.
You can also use the WP_Block_Type_Registry Class in order get all server-side registered Blocks.
You can than either use get_all_registered() or get_instance():
WP_Block_Type_Registry::get_all_registered();

or
WP_Block_Type_Registry::get_instance()->get_all_registered();

Both do the same. get_instance() returns itself.


text:
Q: Many row corresponding to the same date, how to compute sum of the values of a column corresponding to such column I have the following DataFrame:
Date          Cleaned tweets    Polarity    Subjectivity
2018-05-23    .......            0          0
2018-05-23    .......            1          1
2018-05-23    .......            1          1
2018-05-23    .......            0          0
2018-05-23    .......            0          1
2018-05-24    .......            1              0
2018_05_24.   .......            0              0

what i would like to do is to get the average of the polarity and the average of the subjectivity score for each day in such way

Date        Cleaned tweets  Polarity    Subjectivity
2018-05-23    ........          (0+1+1+0+0)/5   (0+1+1+0+1)/5
2018-05-24.   ........          (1+0)/2          (0+0)/2

How can i do it? is there a way to do it?

A: resample
df.resample('D', on='Date').mean()

            Polarity  Subjectivity
Date
2018-05-23       0.4           0.6
2018-05-24       0.5           0.0


text:
Q: Updating collection of dependent objects I have a class Event and a dependent class Entry, which instances are only valid in the context of an event.
What would be the best way to model this in JDO? Acutally I don't want to query for Entries only for Events and their entries. So do I need a key on Entry?
My current solution is:
@PersistenceCapable
public class Event {
    @PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    public Long id;

    @Persistent
    public List<Entry> entries = new ArrayList<Entry>();
}

@PersistenceCapable
public class Entry {
    @PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    public Key key;

    @Persistent
    public String name;
}

I tried to add an entry to an existing Event, but it doesn't acutally persist the changed Event:
Event e = null;
PersistenceManager pm = PMF.get().getPersistenceManager();
try {
    e = pm.getObjectById(Event.class, Long.parseLong(id));

    System.out.println(e.entries.size());

    Entry entry = new Entry();
    entry.name = name;

    e.entries.add(entry);

    pm.makePersistent(e);

    System.out.println(e.entries.size());
} catch (NumberFormatException nfe) {
    return null;
} finally {
    pm.close();
}
return e;

I tried to make Entry an Embedded entity, but it is not allowed to have collections of embedded objects.

A: Actually updating was not the problem. I did not load the event properly in my service.
public Event loadEvent(String id) {
    PersistenceManager pm = PMF.get().getPersistenceManager();
    try {
        Event event = pm.getObjectById(Event.class, Long.parseLong(id));
        // And load entries
        for (Entry entry : event.getEntries()) {
            entry.amounts.size();
        }
        return event;
    } catch (NumberFormatException e) {
        return null;
    } finally {
        pm.close();
    }
}

After adding adding the lines between the comment and the return statement all entries were shown properly.


text:
Q: Analyze Network events with xperf I have written a small tcp-client/server-thing for testing the xperf-networkttrace capabilities.
But as it seems I did do something wrong with xperf.
When I use the Xperf kernel group NETWORK or DIAG+NETWORKTRACE it just shows me the "casual" stuff and nothin about tcp/udp-reads and writes...
Anyone got an clue of how to get these information from xperf?
(did not find anything really helpful via google)

A: I found out, that the send and receive-actions are logged under the "Generic Events" section, as marks.
You can also find them "easily" if You post-process the etl-log into a human readable file and search for TCPRead/Write UDPRead/Write TCPDisconnect/Connect/Accept etc...


text:
Q: Can't open PDB in Oracle 12c R2 for Windows 10 Recently installed Oracle 12cR2 on my Windows 10 laptop. I'm trying to open the sample ORCLPDB for use and get the error shown in the SQL*Plus screenshot. In my research, looks like others have encountered this issue but there hasn't been any conclusive solution. I've tried researching through videos, Oracle documentation and forums with no luck.
Here are the steps that I've taken.

Here are my tnsnames entries:
LISTENER_ORCL =
  (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))

ORACLR_CONNECTION_DATA =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
    (CONNECT_DATA =
      (SID = CLRExtProc)
      (PRESENTATION = RO)
    )
  )

ORCL =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl)
    )
  )

ORCLPDB =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orclpdb)
    )
  )

Here are my Listener file entries:
SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = CLRExtProc)
      (ORACLE_HOME = D:\app\OracleHomeUser1\product\12.2.0\dbhome_1)
      (PROGRAM = extproc)
      (ENVS = "EXTPROC_DLLS=ONLY:D:\app\OracleHomeUser1\product\12.2.0\dbhome_1\bin\oraclr12.dll")
    )
    (SID_DESC =
      (SID_NAME = ORCLPDB)
      (ORACLE_HOME = D:\app\OracleHomeUser1\product\12.2.0\dbhome_1)
    )
  )

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
  )

Note The Oracle 12R2 is installed on Windows 10 Home edition version 1903. OS build is 18362.418.
Please help as I've been struggling for couple of weeks! Many thanks for your help!! :)
Here's the content of the alert_orcl file for the past 2 days:
rs in file D:\APP\ORACLEHOMEUSER1\diag\rdbms\orcl\orcl\trace\orcl_j000_8292.trc:
2019-11-10T17:48:30.952951-05:00
ORA-12012: error on auto execute of job "SYS"."ORA$AT_OS_OPT_SY_347"
ORA-20001: Statistics Advisor: Invalid task name for the current user
ORA-06512: at "SYS.DBMS_STATS", line 47207
ORA-06512: at "SYS.DBMS_STATS_ADVISOR", line 882
ORA-06512: at "SYS.DBMS_STATS_INTERNAL", line 20059
ORA-06512: at "SYS.DBMS_STATS_INTERNAL", line 22201
ORA-06512: at "SYS.DBMS_STATS", line 47197
2019-11-10T17:58:28.042968-05:00
Resize operation completed for file# 3, old size 655360K, new size 665600K
2019-11-10T17:58:30.685688-05:00
Errors in file D:\APP\ORACLEHOMEUSER1\diag\rdbms\orcl\orcl\trace\orcl_j000_4476.trc:
ORA-12012: error on auto execute of job "SYS"."ORA$AT_OS_OPT_SY_349"
ORA-20001: Statistics Advisor: Invalid task name for the current user
ORA-06512: at "SYS.DBMS_STATS", line 47207
ORA-06512: at "SYS.DBMS_STATS_ADVISOR", line 882
ORA-06512: at "SYS.DBMS_STATS_INTERNAL", line 20059
ORA-06512: at "SYS.DBMS_STATS_INTERNAL", line 22201
ORA-06512: at "SYS.DBMS_STATS", line 47197
2019-11-10T18:00:00.562652-05:00
Errors in file D:\APP\ORACLEHOMEUSER1\diag\rdbms\orcl\orcl\trace\orcl_j000_13736.trc:
ORA-12012: error on auto execute of job "APEX_050000"."ORACLE_APEX_WS_NOTIFICATIONS"
ORA-04063: package body "APEX_050000.WWV_FLOW_WORKSHEET" has errors
ORA-06508: PL/SQL: could not find program unit being called: "APEX_050000.WWV_FLOW_WORKSHEET"
ORA-06512: at "APEX_050000.WWV_FLOW_WORKSHEET_API", line 4898
2019-11-10T18:08:33.989588-05:00
Errors in file D:\APP\ORACLEHOMEUSER1\diag\rdbms\orcl\orcl\trace\orcl_j000_19036.trc:
ORA-12012: error on auto execute of job "SYS"."ORA$AT_OS_OPT_SY_351"
ORA-20001: Statistics Advisor: Invalid task name for the current user
ORA-06512: at "SYS.DBMS_STATS", line 47207
ORA-06512: at "SYS.DBMS_STATS_ADVISOR", line 882
ORA-06512: at "SYS.DBMS_STATS_INTERNAL", line 20059
ORA-06512: at "SYS.DBMS_STATS_INTERNAL", line 22201
ORA-06512: at "SYS.DBMS_STATS", line 47197
2019-11-10T18:18:31.552426-05:00
Errors in file D:\APP\ORACLEHOMEUSER1\diag\rdbms\orcl\orcl\trace\orcl_j000_18668.trc:
ORA-12012: error on auto execute of job "SYS"."ORA$AT_OS_OPT_SY_353"
ORA-20001: Statistics Advisor: Invalid task name for the current user
ORA-06512: at "SYS.DBMS_STATS", line 47207
ORA-06512: at "SYS.DBMS_STATS_ADVISOR", line 882
ORA-06512: at "SYS.DBMS_STATS_INTERNAL", line 20059
ORA-06512: at "SYS.DBMS_STATS_INTERNAL", line 22201
ORA-06512: at "SYS.DBMS_STATS", line 47197
2019-11-10T18:28:33.035473-05:00
Errors in file D:\APP\ORACLEHOMEUSER1\diag\rdbms\orcl\orcl\trace\orcl_j000_11084.trc:
ORA-12012: error on auto execute of job "SYS"."ORA$AT_OS_OPT_SY_355"
ORA-20001: Statistics Advisor: Invalid task name for the current user
ORA-06512: at "SYS.DBMS_STATS", line 47207
ORA-06512: at "SYS.DBMS_STATS_ADVISOR", line 882
ORA-06512: at "SYS.DBMS_STATS_INTERNAL", line 20059
ORA-06512: at "SYS.DBMS_STATS_INTERNAL", line 22201
ORA-06512: at "SYS.DBMS_STATS", line 47197
2019-11-10T18:30:00.624114-05:00
Errors in file D:\APP\ORACLEHOMEUSER1\diag\rdbms\orcl\orcl\trace\orcl_j000_5216.trc:
ORA-12012: error on auto execute of job "APEX_050000"."ORACLE_APEX_WS_NOTIFICATIONS"
ORA-04063: package body "APEX_050000.WWV_FLOW_WORKSHEET" has errors
ORA-06508: PL/SQL: could not find program unit being called: "APEX_050000.WWV_FLOW_WORKSHEET"
ORA-06512: at "APEX_050000.WWV_FLOW_WORKSHEET_API", line 4898
2019-11-10T18:38:34.705198-05:00
Errors in file D:\APP\ORACLEHOMEUSER1\diag\rdbms\orcl\orcl\trace\orcl_j000_12012.trc:
ORA-12012: error on auto execute of job "SYS"."ORA$AT_OS_OPT_SY_357"
ORA-20001: Statistics Advisor: Invalid task name for the current user
ORA-06512: at "SYS.DBMS_STATS", line 47207
ORA-06512: at "SYS.DBMS_STATS_ADVISOR", line 882
ORA-06512: at "SYS.DBMS_STATS_INTERNAL", line 20059
ORA-06512: at "SYS.DBMS_STATS_INTERNAL", line 22201
ORA-06512: at "SYS.DBMS_STATS", line 47197
2019-11-10T18:48:35.891078-05:00
Errors in file D:\APP\ORACLEHOMEUSER1\diag\rdbms\orcl\orcl\trace\orcl_j000_2552.trc:
ORA-12012: error on auto execute of job "SYS"."ORA$AT_OS_OPT_SY_359"
ORA-20001: Statistics Advisor: Invalid task name for the current user
ORA-06512: at "SYS.DBMS_STATS", line 47207
ORA-06512: at "SYS.DBMS_STATS_ADVISOR", line 882
ORA-06512: at "SYS.DBMS_STATS_INTERNAL", line 20059
ORA-06512: at "SYS.DBMS_STATS_INTERNAL", line 22201
ORA-06512: at "SYS.DBMS_STATS", line 47197
2019-11-10T21:51:18.519574-05:00
Warning: VKTM detected a forward time drift.
Time drifts can result in unexpected behavior such as time-outs.
Please see the VKTM trace file for more details:
D:\APP\ORACLEHOMEUSER1\diag\rdbms\orcl\orcl\trace\orcl_vktm_10132.trc
2019-11-10T21:51:24.604745-05:00
Errors in file D:\APP\ORACLEHOMEUSER1\diag\rdbms\orcl\orcl\trace\orcl_j000_16664.trc:
ORA-12012: error on auto execute of job "APEX_050000"."ORACLE_APEX_WS_NOTIFICATIONS"
ORA-04063: package body "APEX_050000.WWV_FLOW_WORKSHEET" has errors
ORA-06508: PL/SQL: could not find program unit being called: "APEX_050000.WWV_FLOW_WORKSHEET"
ORA-06512: at "APEX_050000.WWV_FLOW_WORKSHEET_API", line 4898
2019-11-10T21:51:37.564979-05:00
Thread 1 cannot allocate new log, sequence 12
Private strand flush not complete
  Current log# 2 seq# 11 mem# 0: D:\APP\ORACLEHOMEUSER1\ORADATA\ORCL\REDO02.LOG
2019-11-10T21:51:37.647758-05:00
Errors in file D:\APP\ORACLEHOMEUSER1\diag\rdbms\orcl\orcl\trace\orcl_j001_16608.trc:
ORA-12012: error on auto execute of job "SYS"."ORA$AT_OS_OPT_SY_361"
ORA-20001: Statistics Advisor: Invalid task name for the current user
ORA-06512: at "SYS.DBMS_STATS", line 47207
ORA-06512: at "SYS.DBMS_STATS_ADVISOR", line 882
ORA-06512: at "SYS.DBMS_STATS_INTERNAL", line 20059
ORA-06512: at "SYS.DBMS_STATS_INTERNAL", line 22201
ORA-06512: at "SYS.DBMS_STATS", line 47197
2019-11-10T21:51:40.643657-05:00
Thread 1 advanced to log sequence 12 (LGWR switch)
  Current log# 3 seq# 12 mem# 0: D:\APP\ORACLEHOMEUSER1\ORADATA\ORCL\REDO03.LOG
2019-11-10T22:00:00.764705-05:00
Errors in file D:\APP\ORACLEHOMEUSER1\diag\rdbms\orcl\orcl\trace\orcl_j000_19288.trc:
ORA-12012: error on auto execute of job "APEX_050000"."ORACLE_APEX_WS_NOTIFICATIONS"
ORA-04063: package body "APEX_050000.WWV_FLOW_WORKSHEET" has errors
ORA-06508: PL/SQL: could not find program unit being called: "APEX_050000.WWV_FLOW_WORKSHEET"
ORA-06512: at "APEX_050000.WWV_FLOW_WORKSHEET_API", line 4898
2019-11-10T22:01:24.387425-05:00
Errors in file D:\APP\ORACLEHOMEUSER1\diag\rdbms\orcl\orcl\trace\orcl_j000_12440.trc:
ORA-12012: error on auto execute of job "SYS"."ORA$AT_OS_OPT_SY_363"
ORA-20001: Statistics Advisor: Invalid task name for the current user
ORA-06512: at "SYS.DBMS_STATS", line 47207
ORA-06512: at "SYS.DBMS_STATS_ADVISOR", line 882
ORA-06512: at "SYS.DBMS_STATS_INTERNAL", line 20059
ORA-06512: at "SYS.DBMS_STATS_INTERNAL", line 22201
ORA-06512: at "SYS.DBMS_STATS", line 47197
2019-11-10T23:24:02.204591-05:00
Warning: VKTM detected a forward time drift.
Please see the VKTM trace file for more details:
D:\APP\ORACLEHOMEUSER1\diag\rdbms\orcl\orcl\trace\orcl_vktm_10132.trc
2019-11-10T23:24:03.743617-05:00
Errors in file D:\APP\ORACLEHOMEUSER1\diag\rdbms\orcl\orcl\trace\orcl_j001_19172.trc:
ORA-12012: error on auto execute of job "APEX_050000"."ORACLE_APEX_WS_NOTIFICATIONS"
ORA-04063: package body "APEX_050000.WWV_FLOW_WORKSHEET" has errors
ORA-06508: PL/SQL: could not find program unit being called: "APEX_050000.WWV_FLOW_WORKSHEET"
ORA-06512: at "APEX_050000.WWV_FLOW_WORKSHEET_API", line 4898
2019-11-10T23:24:07.893235-05:00
Errors in file D:\APP\ORACLEHOMEUSER1\diag\rdbms\orcl\orcl\trace\orcl_j000_14616.trc:
ORA-12012: error on auto execute of job "SYS"."ORA$AT_OS_OPT_SY_365"
ORA-20001: Statistics Advisor: Invalid task name for the current user
ORA-06512: at "SYS.DBMS_STATS", line 47207
ORA-06512: at "SYS.DBMS_STATS_ADVISOR", line 882
ORA-06512: at "SYS.DBMS_STATS_INTERNAL", line 20059
ORA-06512: at "SYS.DBMS_STATS_INTERNAL", line 22201
ORA-06512: at "SYS.DBMS_STATS", line 47197
2019-11-10T23:30:00.352162-05:00
Errors in file D:\APP\ORACLEHOMEUSER1\diag\rdbms\orcl\orcl\trace\orcl_j000_15996.trc:
ORA-12012: error on auto execute of job "APEX_050000"."ORACLE_APEX_WS_NOTIFICATIONS"
ORA-04063: package body "APEX_050000.WWV_FLOW_WORKSHEET" has errors
ORA-06508: PL/SQL: could not find program unit being called: "APEX_050000.WWV_FLOW_WORKSHEET"
ORA-06512: at "APEX_050000.WWV_FLOW_WORKSHEET_API", line 4898
2019-11-10T23:34:07.321600-05:00
Errors in file D:\APP\ORACLEHOMEUSER1\diag\rdbms\orcl\orcl\trace\orcl_j000_17628.trc:
ORA-12012: error on auto execute of job "SYS"."ORA$AT_OS_OPT_SY_367"
ORA-20001: Statistics Advisor: Invalid task name for the current user
ORA-06512: at "SYS.DBMS_STATS", line 47207
ORA-06512: at "SYS.DBMS_STATS_ADVISOR", line 882
ORA-06512: at "SYS.DBMS_STATS_INTERNAL", line 20059
ORA-06512: at "SYS.DBMS_STATS_INTERNAL", line 22201
ORA-06512: at "SYS.DBMS_STATS", line 47197
2019-11-10T23:44:05.942664-05:00
Resize operation completed for file# 3, old size 665600K, new size 675840K
2019-11-10T23:44:07.250777-05:00
Errors in file D:\APP\ORACLEHOMEUSER1\diag\rdbms\orcl\orcl\trace\orcl_j000_18984.trc:
ORA-12012: error on auto execute of job "SYS"."ORA$AT_OS_OPT_SY_369"
ORA-20001: Statistics Advisor: Invalid task name for the current user
ORA-06512: at "SYS.DBMS_STATS", line 47207
ORA-06512: at "SYS.DBMS_STATS_ADVISOR", line 882
ORA-06512: at "SYS.DBMS_STATS_INTERNAL", line 20059
ORA-06512: at "SYS.DBMS_STATS_INTERNAL", line 22201
ORA-06512: at "SYS.DBMS_STATS", line 47197
2019-11-10T23:54:08.116856-05:00
Errors in file D:\APP\ORACLEHOMEUSER1\diag\rdbms\orcl\orcl\trace\orcl_j000_17168.trc:
ORA-12012: error on auto execute of job "SYS"."ORA$AT_OS_OPT_SY_371"
ORA-20001: Statistics Advisor: Invalid task name for the current user
ORA-06512: at "SYS.DBMS_STATS", line 47207
ORA-06512: at "SYS.DBMS_STATS_ADVISOR", line 882
ORA-06512: at "SYS.DBMS_STATS_INTERNAL", line 20059
ORA-06512: at "SYS.DBMS_STATS_INTERNAL", line 22201
ORA-06512: at "SYS.DBMS_STATS", line 47197
2019-11-11T00:00:00.491208-05:00
Errors in file D:\APP\ORACLEHOMEUSER1\diag\rdbms\orcl\orcl\trace\orcl_j000_13364.trc:
ORA-12012: error on auto execute of job "APEX_050000"."ORACLE_APEX_WS_NOTIFICATIONS"
ORA-04063: package body "APEX_050000.WWV_FLOW_WORKSHEET" has errors
ORA-06508: PL/SQL: could not find program unit being called: "APEX_050000.WWV_FLOW_WORKSHEET"
ORA-06512: at "APEX_050000.WWV_FLOW_WORKSHEET_API", line 4898
2019-11-11T00:04:08.269812-05:00
TABLE SYS.WRI$_OPTSTAT_HISTHEAD_HISTORY: ADDED INTERVAL PARTITION SYS_P457 (43779) VALUES LESS THAN (TO_DATE(' 2019-11-12 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
TABLE SYS.WRI$_OPTSTAT_HISTGRM_HISTORY: ADDED INTERVAL PARTITION SYS_P460 (43779) VALUES LESS THAN (TO_DATE(' 2019-11-12 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
2019-11-11T00:04:10.242413-05:00
Errors in file D:\APP\ORACLEHOMEUSER1\diag\rdbms\orcl\orcl\trace\orcl_j000_12576.trc:
ORA-12012: error on auto execute of job "SYS"."ORA$AT_OS_OPT_SY_373"
ORA-20001: Statistics Advisor: Invalid task name for the current user
ORA-06512: at "SYS.DBMS_STATS", line 47207
ORA-06512: at "SYS.DBMS_STATS_ADVISOR", line 882
ORA-06512: at "SYS.DBMS_STATS_INTERNAL", line 20059
ORA-06512: at "SYS.DBMS_STATS_INTERNAL", line 22201
ORA-06512: at "SYS.DBMS_STATS", line 47197
2019-11-11T00:14:11.060275-05:00
Errors in file D:\APP\ORACLEHOMEUSER1\diag\rdbms\orcl\orcl\trace\orcl_j000_17152.trc:
ORA-12012: error on auto execute of job "SYS"."ORA$AT_OS_OPT_SY_375"
ORA-20001: Statistics Advisor: Invalid task name for the current user
ORA-06512: at "SYS.DBMS_STATS", line 47207
ORA-06512: at "SYS.DBMS_STATS_ADVISOR", line 882
ORA-06512: at "SYS.DBMS_STATS_INTERNAL", line 20059
ORA-06512: at "SYS.DBMS_STATS_INTERNAL", line 22201
ORA-06512: at "SYS.DBMS_STATS", line 47197
2019-11-11T00:24:11.498403-05:00
Errors in file D:\APP\ORACLEHOMEUSER1\diag\rdbms\orcl\orcl\trace\orcl_j000_7156.trc:
ORA-12012: error on auto execute of job "SYS"."ORA$AT_OS_OPT_SY_377"
ORA-20001: Statistics Advisor: Invalid task name for the current user
ORA-06512: at "SYS.DBMS_STATS", line 47207
ORA-06512: at "SYS.DBMS_STATS_ADVISOR", line 882
ORA-06512: at "SYS.DBMS_STATS_INTERNAL", line 20059
ORA-06512: at "SYS.DBMS_STATS_INTERNAL", line 22201
ORA-06512: at "SYS.DBMS_STATS", line 47197
2019-11-11T00:25:10.116868-05:00
TABLE SYS.WRP$_REPORTS_TIME_BANDS: ADDED INTERVAL PARTITION SYS_P461 (3601) VALUES LESS THAN (TO_DATE(' 2019-11-11 01:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
2019-11-11T00:30:00.608764-05:00
Errors in file D:\APP\ORACLEHOMEUSER1\diag\rdbms\orcl\orcl\trace\orcl_j000_10260.trc:
ORA-12012: error on auto execute of job "APEX_050000"."ORACLE_APEX_WS_NOTIFICATIONS"
ORA-04063: package body "APEX_050000.WWV_FLOW_WORKSHEET" has errors
ORA-06508: PL/SQL: could not find program unit being called: "APEX_050000.WWV_FLOW_WORKSHEET"
ORA-06512: at "APEX_050000.WWV_FLOW_WORKSHEET_API", line 4898
2019-11-11T00:34:13.016562-05:00
Errors in file D:\APP\ORACLEHOMEUSER1\diag\rdbms\orcl\orcl\trace\orcl_j000_11772.trc:
ORA-12012: error on auto execute of job "SYS"."ORA$AT_OS_OPT_SY_379"
ORA-20001: Statistics Advisor: Invalid task name for the current user
ORA-06512: at "SYS.DBMS_STATS", line 47207
ORA-06512: at "SYS.DBMS_STATS_ADVISOR", line 882
ORA-06512: at "SYS.DBMS_STATS_INTERNAL", line 20059
ORA-06512: at "SYS.DBMS_STATS_INTERNAL", line 22201
ORA-06512: at "SYS.DBMS_STATS", line 47197
2019-11-11T11:13:12.219241-05:00
Warning: VKTM detected a forward time drift.
Please see the VKTM trace file for more details:
D:\APP\ORACLEHOMEUSER1\diag\rdbms\orcl\orcl\trace\orcl_vktm_10132.trc
2019-11-11T11:13:12.937564-05:00
Closing scheduler window
Closing Resource Manager plan via scheduler window
Clearing Resource Manager CDB plan via parameter
2019-11-11T11:13:16.063522-05:00
Errors in file D:\APP\ORACLEHOMEUSER1\diag\rdbms\orcl\orcl\trace\orcl_j002_8140.trc:
ORA-12012: error on auto execute of job "APEX_050000"."ORACLE_APEX_WS_NOTIFICATIONS"
ORA-04063: package body "APEX_050000.WWV_FLOW_WORKSHEET" has errors
ORA-06508: PL/SQL: could not find program unit being called: "APEX_050000.WWV_FLOW_WORKSHEET"
ORA-06512: at "APEX_050000.WWV_FLOW_WORKSHEET_API", line 4898
2019-11-11T11:13:59.803724-05:00
TABLE SYS.WRP$_REPORTS: ADDED INTERVAL PARTITION SYS_P462 (3602) VALUES LESS THAN (TO_DATE(' 2019-11-12 01:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
TABLE SYS.WRP$_REPORTS_DETAILS: ADDED INTERVAL PARTITION SYS_P463 (3602) VALUES LESS THAN (TO_DATE(' 2019-11-12 01:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
2019-11-11T11:30:00.266486-05:00
Errors in file D:\APP\ORACLEHOMEUSER1\diag\rdbms\orcl\orcl\trace\orcl_j000_15252.trc:
ORA-12012: error on auto execute of job "APEX_050000"."ORACLE_APEX_WS_NOTIFICATIONS"
ORA-04063: package body "APEX_050000.WWV_FLOW_WORKSHEET" has errors
ORA-06508: PL/SQL: could not find program unit being called: "APEX_050000.WWV_FLOW_WORKSHEET"
ORA-06512: at "APEX_050000.WWV_FLOW_WORKSHEET_API", line 4898

A:
The Oracle 12R2 is installed on Windows 10 Home edition

Uh oh. The Installation Guide says Oracle database server is only certified for Pro, Enterprise and Education editions. At the least there's a lot less information available about troubleshooting installations on Home edition.

Does that mean I need to upgrade to Windows Pro or Education

Oracle database is an enterprise grade product and probably depends upon OS capabilities beyond those of Home edition. But I can't guarantee upgrading your OS will solve this problem. I use a Mac :)
So, what to do? Docker is a platform for deploying containers, which are cut-down virtual machines. Docker allows us to run say Oracle 12c EE on Linux without having to have a dual-boot PC. That's how I run an Oracle database on my Mac. But Docker's not that straightforward on Win10 Home either.
Therefore I think your quickest route to success would be to install Oracle VirtualBox. Make sure you also install the Extensions pack. Then you can download and run a vbox image. Oracle hosts a large number of them on this page: choose the one most fitted to what you want to learn. This was the approach I used the last time I need to run an Oracle database on Windows.


text:
Q: Value of Pointer is Garbage when Returned
Possible Duplicate:
Can a local variable's memory be accessed outside its scope?

#include <iostream>
#include <string>

using namespace std;

char* reverse(char* input)
{
    char b[11];

    for (int i=0; i<11; i++)    {b[10-i]=input[i];}
    for (int u=0; u<11; u++)    {cout<<b[u];}
    cout<<endl;
    return &b[0];
}

int main ()
{
     char ali[]="ali is good";
     char *a=&ali[0];
     char *b=reverse(a);

     for (int i=0; i<11; b++, i++)
        {
            cout<<*b+i<<endl;
        }
     cout<<endl;
     system("pause");
     return 0;
}

This is a simple program to reverse a string, it works well when you print the result in the function, but when passing the pointer of the string to Main then printing it, it prints garbage-like things.
Why is it strange? because if I print *b+2 or *b+5 or whatever const I like, it works well, but if I replace the const with an int in a loop like *b+i then it does not work!!
P.S. this is not a HW!! I "was" a longtime programmer, shame on me for forgetting all of this.
Any ideas?

A: The variables declared inside a function are automatic storage duration objects and go ou tof scope at the end of a function (and thus are no longer valid). To allocate storage that lives longer than a function you need dynamic storage duration objects (these are allocated via new):
char *b = new char[11];

A: You should never return a pointer to a local variable, that why you see the error.
The local variables are allocated on the stack.
When the variable goes out of scope, the memory is de-allocated.
Now you are trying to access the variable which has been de-allocated because it has gone out of scope(and hence removed from stack)
Also
 for (int i=0; i<11; b++, i++)
                        {
                            cout<<*(b+i)<<endl;
                        }

Why are incrementing both b and i?
You should increment just i and the not the base pointer address(b)
In summary this is the program you should use
#include<iostream>
   using namespace std;

             void reverse(char* input,char * output)
             {

                for (int i=0; i<11; i++)    {output[10-i]=input[i];}
                for (int u=0; u<11; u++)    {cout<<output[u];}
                cout<<endl;

            }

             int main ()
             {
                 char ali[]="ali is good";
                 char *a=&ali[0];
                 char *b=(char *)malloc(sizeof(ali));
                 reverse(a,b);

                 for (int i=0; i<11;  i++)
                    {
                        cout<<*(b+i)<<endl;
                    }
                 cout<<endl;
                 system("pause");
                 return 0;
             }

A: Last but not least, *b+i means the value of the object pointed to by b raised by i (that is (*b)+i), not *(b+i) as you wish.

A: try this instead
char* reverse(char* input)
{
  int len = strlen(input);
  for (int i=0; i<len/2; ++i)
  {
    char tmp = input[i];
    input[i] = input[len-i-1];
    input[len-i-1] = tmp;
  }
  return input;
}

then you are not returning a local variable but returning the original array with the reversed string.


text:
Q: convert uiview to .png image I am working on iphone and I take the subclass of UIView and in draw rect method I am making some design. I want to convert this view in .png format.
Thanks in advance.

A:     UIGraphicsBeginImageContext(myView.frame.size);
    [myView.layer renderInContext:UIGraphicsGetCurrentContext()];
    UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    NSData *data=UIImagePNGRepresentation(viewImage);
    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *documentsDirectory = [paths objectAtIndex:0];
    NSString *strPath = [documentsDirectory stringByAppendingPathComponent:@"myimage.png"];
    [data writeToFile:strPath atomically:YES];

A:    UIWindow *keyWindow = [[UIApplication sharedApplication] keyWindow];
    if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)])
        UIGraphicsBeginImageContextWithOptions(YourView.frame.size, NO, [UIScreen mainScreen].scale);
    else
        UIGraphicsBeginImageContext(keyWindow.bounds.size);

    CGContextRef context = UIGraphicsGetCurrentContext();
    [keyWindow.layer renderInContext:context];
    UIImage *img = UIGraphicsGetImageFromCurrentImageContext();
    UIImageWriteToSavedPhotosAlbum(img, nil, nil, nil);
    UIGraphicsEndImageContext();


text:
Q: A random IBAction that only chooses each case once I am having a problem making a IBAction that calls each case once in a random order.
I have done a lot of searching and not find a good solution to go about this problem.
The code I have so far is
-(IBAction) random {
    int text = rand() % 5;
    switch (text) {
        case 0:
            textview.text = @"1";
            break;
        case 1:
            textview.text = @"2";
            break;
        case 2:
            textview.text = @"3";
            break;
        case 3:
            textview.text = @"4";
            break;
        case 4:
            textview.text = @"5";
            break;
        default:
            break;
    }
}

It works fine, but like I said, I only want it to call each case once.
Any help would be greatly appreciated.

A: What about putting the options, as NSNumbers, in an  NSMutableArray, selecting a random index, display it, and remove it from the array...with some other response if the count reaches zero.

A: Since you are trying to set a random text, I'd do it like this:
Add an iVar called something like stringsArray and initialize it on your init:
...
stringsArray = [[NSMutableArray alloc] initWithObjects:@"1", @"2", @"3", @"4", @"5", nil];
...

Your IBAction would look like this:
-(IBAction) random {
    if([stringsArray count] == 0) return;
    int text = rand() % [stringsArray count];
    [textView setText:[stringsArray objectAtIndex:text];
    [stringsArray removeObjectAtIndex:text];
}

A: Use srand instead of rand function
Or Better still use
int text = arc4random() % 5;

A: Well, one way or another you need to keep a "scorecard" and skip options that have already been selected.  The scorecard can be a bit map (eg, a simple integer where you set bits), an array of booleans, a list of previously chosen numbers, etc.
The most straight-forward way to code it is to have the body of your logic above in an UNTIL loop and check in the loop, after picking the random number, to see if it's already chosen.  If so, iterate in the loop, otherwise set your response, fill in the appropriate "checkmark" in your scorecard, and LEAVE the loop.
But BEWARE:  The loop must also include a check to see if all options have already been chosen, and exit with some appropriate indication in that case.