text:
Q: Visual Basic - Manage levels for a Maze Game I thought of creating a small Maze Game with 20 levels and each level will be contained within a User control. From the research that I have done it seems to be the most simple way to handle both the loading and creation for all the levels.
My concern is how User Controls are loaded in memory. My fist thought was to place all of the User Controls - (Maze Game Levels) in my form and set the visibility to False. I then use buttons to make them visible when needed.
Since Visual Basic and Visual Studio is very new to me I have doubts that this is the right way. This seems to be a very tedious process and would love if someone could guide me in the right direction on where I should look for information.
There has been a few YouTube tutorials on this topic, but they never cover the entire game creation, only the one level and the functions to make the game work.

A: I managed to find an answer to my question after a couple of hours of research.
See: Dynamic User Control


text:
Q: Heroku doesn't recognized installed packages I'm trying to deploy my Flask app to Heroku, but, though successfully deployed, my Heroku app encounters the following error that makes it fail to run:

Even though I have already installed the package with pip install flask_sqlalchemy.
My app.py is like the following:
import flask
from flask import Flask, jsonify, request, render_template, url_for
import json
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy.sql import text

import pickle
with open('models/deploy_model.sav', 'rb') as f:
    model = pickle.load(f)

app = Flask(__name__, template_folder='templates')

db_name = 'schema.sql'

app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///' + db_name

app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = True
db = SQLAlchemy(app)

class Mood(db.Model):
    __tablename__ = 'result'
    index = db.Column(db.Integer, primary_key=True)
    timestamp = db.Column(db.DateTime)
    results = db.Column(db.Float)

@app.route('/', methods=['GET'])
def main():
    table = Mood.query.with_entities(Mood.results).all()
    table = [r for r, in table]
    return render_template('main.html', results =table)

if __name__ == '__main__':
    app.run(debug=True)

and my requirements.txt file currently also contains these packages:
...
Flask==2.0.1
Flask-SQLAlchemy==2.5.1
...

Why can't Heroku find flask_sqlalchemy? How can I fix it?

A:
Even though I have already installed the package with pip install flask_sqlalchemy

It's not clear whether you ran this on your development machine or on your Heroku dyno, but in either case it won't have any effect on your application running on Heroku.
If you ran it locally, this will have installed flask_sqlalchemy to your local environment. Heroku has no way to know what you have installed locally; it installs dependencies from your committed requirements.txt file or Pipfile and Pipfile.lock, depending on the tools you have used.
If you ran it on Heroku, this will have run in a one-off dyno that was discarded as soon as you stopped interacting with it. All run-time dependencies must be declared in your requirements file so Heroku can include them in your application's slug.
Which leads us to your next statement:

and my requirements.txt file currently also contains these packages:
...
Flask==2.0.1
Flask-SQLAlchemy==2.5.1
...

Is this file in the root of your repository? It must be, or else Heroku will ignore it.
Do you also have a Pipfile and Pipfile.lock? Heroku will use Pipenv to install dependencies from those files if they are present. It will only use pip to install packages from the requirements.txt file if it cannot find Pipenv files. Pick one or the other.
If neither of these suggestions helps, please edit your question and show your build log.

redpajama_set_name: RedPajamaStackExchange


text:
Q: AWS Amplify Connect does not return data I have a very simple GraphQL server, which returns "Hello World" if queried with { hello }
I have configured Amplify with the GraphQL endpoint and region and verified that the connection works with this snippet:
**THIS IS WORKING**

import {API, graphqlOperation} from 'aws-amplify'

const ListEvents = `query {
  hello
}`

async getNote() {
    try {
      const result = await API.graphql(graphqlOperation(ListEvents))
      console.log(result)
    } catch(e) {
      console.log("Unable to fetch hello")
      console.log(e.response)
    }
}

RETURNS:
{
  "data": {
    "hello": "Hello world!"
  }
}

My Problem
I want to use Connect from aws-amplify-react as described HERE
I used the following piece of code and included it in the return of my app:
**THIS IS NOT WORKING**

import { Connect } from "aws-amplify-react";

const ListEvents = `query {
  hello
}`

<Connect query={graphqlOperation(ListEvents)}>
    {(obj, ...rest) => {
      console.log(obj);
      console.log(rest);
    }}
</Connect>

This RETURNS:

The reason for the two empty responses are discussed in another Stack Overflow question, but this simply never returns the expected data.
Can you help me figure it out?

A: Try using the following syntax:
<Connect query={graphqlOperation(listEvents)}>
    {({ data , loading, error }) => {
        if (error) return (
Error
);
        if (!data) return (
No events found
);
        if (loading) return (
Loading...
);
        return (
{data.hello}
 );
    }}
</Connect>


text:
Q: Rails: Appropriate / conventional way to act on notifications I've built a Stripe SaaS app a bit like Byron Bowerman's stripe-example.
Notifications from Stripe are called "webhooks", and include information like whether payments have succeeded or failed.  In my app they are received by the stripe-event gem which then passes the information to a Webhook model to be saved in the database.
I want to use these events to trigger actions:

*

*email to user

*update User model

*etc.

The question is which class should take these actions, and how should it be informed?
There are a few options:
1) Within Webhook model
Easy, but feels outside what responsibility of this class should be.
2) Webhook Observer(s)
One observer, or separate ones for different actions?
3) Rails Notifications
The Webhook model could send out an ActiveSupport::Notification each time it receives a webhook.  This could be subscribed to by a class anywhere in the application.  If I went this route would it be appropriate to do this in the User model, the UsersController, or somewhere else?
A worry I have with this approach is that in his railscast on notifications Ryan Bates recommends that "notifications are best used for logging and for code that doesn't modify the application's core behaviour."
4) ...?
What do you advise?


text:
Q: What is the best way to make instant messaging on website? I am currently creating a website on Symfony 4, and I would like to integrate an instant messaging system like messenger, with the possibility to create groups of discussions.
The problem is that I don't know which method to use. Symfony doesn't offer anything for that, and ajax seems to me not optimized at all because of the many requests made to the server.
Should I use websockets coupled to nodeJs?
Or use the Rachet librarie? Because I don't know NodeJs and integrate a new technology into the project may not be suitable for everyone
So, what would be the most optimized system to support a large number of users?
Thank you,

A: You have 2 options here:
Implement by yourself
In your case you need the following:

*

*Install some XMPP server in your cloud. It could be something like Ejabberd, Prosody, Tigase, Openfire

*On client side - use XMPP libs to connect to XMPP server and to send/receive messages. On Web/Web panel - use StropheJS

*for any service tasks - there are also XMPP libs for PHP

Use some messaging SaaS platforms
There are also lot's of diff messaging platforms e.g Pusher, Twillio, Layer, ConnectyCube, Applozic etc.
I used ConnectyCube some time ago, they support Messaging, Video Calling and Push Notifications functionality for iOS, Android and Web. They also have some ready code samples available, so can some some time on start. Pricing is a competitive one. So it can be done in the following way:

*

*Javascript/Web Chat SDK and code samples https://developers.connectycube.com/js/messaging
Hope it will be helpful for you

A: Just use pubnub.com,
it's like 5 lines of code
https://www.pubnub.com/developers/demos/10chat/
These days it would be bizarre to build chat from scratch.


text:
Q: Given a jooq query how do find the tables involved? I am currently using a DefaultExecuteListener to hook into the jooq query lifecycle.  How do I reliably determine if the query is a select statement and what tables (org.jooq.Table) are involved in the select?
@Override
public void executeStart(ExecuteContext context) {
    Set<Table> tables = new HashSet<>();
    if (context.query() != null) {
        context.query(); // How do you check if this is a select statement and retrieve the tables involved?
    }
}

A:
How do I reliably determine if the query is a select statement

You can do that in your ExecuteListener by checking context.query() instanceof Select

and what tables (org.jooq.Table) are involved in the select?

As of jOOQ 3.15, the best way to access the expression tree during SQL generation is to implement a VisitListener. This article shows an extensive example of how to implement client side row level security in jOOQ. You'll need less than that. In the simplest case, this might suffice:
class TableCollector implements DefaultVisitListener {

    Set<Table<?>> tables = new HashSet<>();

    @Override
    public void visitStart(VisitContext ctx) {
        if (ctx.queryPart() instanceof Table)
            tables.add(ctx.queryPart());
    }
}

Now, all you need is to glue these two together.

A: I was able to get the Jooq tables (org.jooq.Table) involved in a query at execution time by using a VisitListener and in conjunction with an ExecuteListener:
import org.jooq.Table;
import org.jooq.VisitContext;
import org.jooq.impl.DefaultVisitListener;

import java.util.HashSet;
import java.util.concurrent.ConcurrentHashMap;

public class TableCollector extends DefaultVisitListener {

    private final static ConcurrentHashMap<String, HashSet<Table<?>>> queryToTables = new ConcurrentHashMap<>();

    public static HashSet<Table<?>> getTables(String sqlQuery) {
        return queryToTables.get(sqlQuery);
    }

    private <T> T getDataValue(VisitContext context, String key, T defaultValue) {
        T value = (T) context.data(key);
        if (value == null) {
            value = defaultValue;
        }
        return value;
    }

    private <T> T putDataValue(VisitContext context, String key, T value) {
        return (T) context.data(key, value);
    }

    @Override
    public void visitStart(VisitContext context) {
        Integer stackSize = getDataValue(context, "stackSize", 0);
        stackSize++;
        putDataValue(context, "stackSize", stackSize);
        if (context.queryPart() instanceof Table) {
            Table<?> table = (Table<?>) context.queryPart();
            HashSet<Table<?>> tables = getDataValue(context, "tables", new HashSet<>());
            tables.add(table);
            putDataValue(context, "tables", tables);
        }
    }

    @Override
    public void visitEnd(VisitContext context) {
        Integer stackSize = getDataValue(context, "stackSize", -1);
        stackSize--;
        putDataValue(context, "stackSize", stackSize);
        if (stackSize == 0) {
            HashSet<Table<?>> tables = getDataValue(context, "tables", new HashSet<>());
            String sql = context.context().render();
            if (sql != null) {
                queryToTables.put(sql, new HashSet<>(tables));
            }
            tables.clear();
            putDataValue(context, "tables", tables);
        }
    }
}

import org.jooq.ExecuteContext;
import org.jooq.Query;
import org.jooq.Table;
import org.jooq.impl.DefaultExecuteListener;

import java.util.HashSet;
import java.util.Set;

public class TableExecuteListener extends DefaultExecuteListener {

    @Override
    public void executeStart(ExecuteContext context) {
        super.executeStart(context);

        // pull the tables from the {@link TableCollector} for this query
        final Set<Table<?>> tablesInQuery = new HashSet<>();
        if (context.query() != null) {
            tablesInQuery.addAll(TableCollector.getTables(context.sql()));
        } else {
            for (Query query : context.batchQueries()) {
                tablesInQuery.addAll(TableCollector.getTables(query.getSQL()));
            }
        }
    }
}


text:
Q: Django snippet with logic is there a way to create a Django snippet that has logic?
I think about something like contact template tag:
{% contact_form %}

with template:
<form action="send_contact_form" method="POST">...</form>

with logic:
def send_contact_form():
    ...

I want to be able to use it anywhere in my projects. It should work only by specifying 1 template tag... Do you know what I mean? Is it possible?
Thanks in advance, Etam.

A: Custom template tags.


text:
Q: How do I solve a boolean error when streamwriter statement is using a void and int? So I have this code:
StreamWriter sw;
sw = new StreamWriter(Application.dataPath + "safedata.txt");
sw.WriteLine(MainMenuscreen.ToggleShadows(MainMenuscreen.tc)); // This line is givng me the error

This is the error code that shows:

Severity   Code    Description Project File    Line    Suppression State   Suppression State
  Error   CS1503  Argument 1: cannot convert from 'void' to 'bool'    Assembly-CSharp C:\Users\Owner\Downloads\Project 3 (1)\Project 3\Assets\Scripts\SaveData.cs 46      Active

I don't understand why this error is popping up because ToggleShadows is void function and tc is a int variable:
public static int tc;

public static void ToggleShadows(int newToggle)
{
    Light[] lights = GameObject.FindObjectsOfType<Light>();

    foreach (Light light in lights)
    {
        if (newToggle == 0)
            light.shadows = LightShadows.None;
        else if (newToggle == 1)
            light.shadows = LightShadows.Hard;
        else
            light.shadows = LightShadows.Soft;
    }
    return;
}

I have no idea why a Boolean would appear. I am trying to get the data from my gameSetting file to my savedata file. So far this function and variable are to only statements giving me issues.
Here is the two full codes:
//Hakeem Thomas
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.IO;

public class SaveData : MonoBehaviour
{
    public GameObject player;
    public Inventory inv;
    //public MainMenuscreen gsettings;

    StreamWriter sw;
    StreamReader sr;
    void Awake()
    {
        Load();
    }

    //void Update()
    //{
    //    if(Input.GetKeyDown(KeyCode.K))
    //    { Save(); }
    //    if (Input.GetKeyDown(KeyCode.O))
    //    { Load(); }
    //}

    public void Save()
    {
        sw = new StreamWriter(Application.dataPath + "safedata.txt");
        sw.WriteLine(player.transform.position.x);
        sw.WriteLine(player.transform.position.y);
        sw.WriteLine(player.transform.position.z);

        foreach (Item ii in Inventory.invItems)
        {
            sw.WriteLine(ii);
        }

        sw.WriteLine(MainMenuscreen.hSliderValue);
        sw.WriteLine(MainMenuscreen.hPitch);
        sw.WriteLine(MainMenuscreen.hStereoPan);
        sw.WriteLine(MainMenuscreen.hfov);
        sw.WriteLine(MainMenuscreen.ToggleShadows(MainMenuscreen.tc));
        sw.Close();
    }

    public void Load()
    {
        try
        {
            sr = new StreamReader(Application.dataPath + "safedata.txt");
            float xpos = float.Parse(sr.ReadLine());
            float ypos = float.Parse(sr.ReadLine());
            float zpos = float.Parse(sr.ReadLine());
            player.transform.position = new Vector3(xpos, ypos, zpos);
            while (!sr.EndOfStream)
            {
                inv.AddToInventory((Item)Convert.ChangeType(sr.ReadLine(), typeof(Item)));

            }

            sr.Close();

        }
        catch
        {
            player.transform.position = new Vector3(-16.9f, 0.9f, 11f);
        }
    }
}

//Hakeem Thomas
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class MainMenuscreen : MonoBehaviour
{
    public static float hSliderValue = 0.5f;
    public static float hPitch = 1.0f;
    public static float hStereoPan = 0.0f;
    public static float hfov = 60.0f;
    public static int tc;
    public Camera vid;
    public SaveData op;
    public static bool sound_options = false;

    SaveData sd;
    GUI_2D m;
    // Start is called before the first frame update
    void Start()
    {
        tc = 3;
    }

    public static void ToggleShadows(int newToggle)
    {
        Light[] lights = GameObject.FindObjectsOfType<Light>();

        foreach (Light light in lights)
        {
            if (newToggle == 0)
                light.shadows = LightShadows.None;
            else if (newToggle == 1)
                light.shadows = LightShadows.Hard;
            else
                light.shadows = LightShadows.Soft;
        }
        return;
    }

    public void SetFOV(float newFOV)
    {
        Camera.main.fieldOfView = newFOV;
    }

    void OnGUI()
    {
        void GSettings()
        {
            if (SceneManager.GetActiveScene() == SceneManager.GetSceneByName("MainMenu"))
            {
                if (GUI.Button(new Rect(600, 400, 100, 50), "Game Settings"))
                {
                    sound_options = true;
                }
            }
            if (Input.GetKeyDown("escape"))
            {
                if (sound_options != true)
                {
                    sound_options = true;
                }
            }
            else if (Input.GetKeyDown("escape"))
            {
                if (sound_options == true)
                    sound_options = false;
            }
        }

        if (SceneManager.GetActiveScene() == SceneManager.GetSceneByName("MainMenu"))
        {
            if (!sound_options)
            {
                if (GUI.Button(new Rect(600, 200, 100, 50), "New Game"))
                {
                    SceneManager.LoadScene("SampleScene");
                }
                if (GUI.Button(new Rect(600, 300, 100, 50), "Resume Game"))
                {
                    SceneManager.LoadScene("SampleScene");
                    sd.Load();
                }

                GSettings();
            }
        }
        else
        {
            GSettings();
        }

        if (sound_options)
        {
            if (GUI.Button(new Rect(600, 300, 100, 50), "Save Game"))
            {
                op.Save();
            }
            GUI.Label(new Rect(550, 25, 100, 30), "Volume");
            hSliderValue = GUI.HorizontalSlider(new Rect(600, 25, 100, 30), hSliderValue, 0.0F, 1.0F);
            GUI.Label(new Rect(550, 50, 100, 30), "Pitch");
            hPitch = GUI.HorizontalSlider(new Rect(600, 50, 100, 30), hPitch, -3.0F, 3.0F);
            GUI.Label(new Rect(500, 75, 100, 30), "StereoPan");
            hStereoPan = GUI.HorizontalSlider(new Rect(600, 75, 100, 30), hStereoPan, 0.0F, 1.0F);
            if (GUI.Button(new Rect(600, 125, 75, 20), "High"))
            { Screen.SetResolution(0, 3, true); }   //GetComponent<Video_Config>().SetResolution(0, 3);
            GUI.Label(new Rect(500, 100, 100, 30), "Field of View");
            hfov = GUI.HorizontalSlider(new Rect(600, 100, 100, 30), hfov, 60.0f, 120.0f);
            if (GUI.Button(new Rect(600, 150, 75, 20), "Shadows"))
            {
                if (tc == 0)
                {
                    ToggleShadows(tc);
                    tc = 1;
                }
                else if (tc == 1)
                {
                    ToggleShadows(tc);
                    tc = 2;
                }
                else
                {
                    ToggleShadows(tc);
                    tc = 0;
                }
            }
        }
        //GUI.Label(new Rect(25, 125, 100, 30), "FullScreen");
        //full = GUI.Toggle(new Rect(95, 125, 100, 30), fullscreen, " On/ Off");
    }

    // Update is called once per frame
    void Update()
    {
        if (vid.fieldOfView != hfov)
        { vid.fieldOfView = hfov; }

    }
}

A: @HimBromBeere Answered my question with the following:
sw.WriteLine(MainScreenMenu.tc)


text:
Q: iframe dynamic height fails in IE outside of quirks mode currently going through this problem at work which is driving me insane as I've got nowhere and I feel like I've tried EVERYTHING.
Basically I want an iframe height to adjust depending on the content within in.  This works fine for FF, Chrome, Safari but it stays with a 200px height in IE unless in Quirks mode.  To get around this I've attempted several javascript and jQuery workarounds without any success.
My attempts have included stuff along the lines of:

*

*http://ramanisandeep.net/2009/12/16/how-to-dynamically-adjust-an-iframe%E2%80%99s-height/

*http://www.iframehtml.com/iframe-scripts.html#resizeable-iframe
Generally I get an error saying access is denied or 'Microsoft JScript runtime error: Unable to get value of the property 'document': object is null or undefined'
Has anybody experienced a similar problem?  Live demos I've found online seem to go mental when I switch IE to anything but quirks mode.
EDIT
Can anybody tell me why or suggest why this site: http://host.sonspring.com/iframe/ does what I want it to in IE8/9.  Yet when I download it and follow the tutorial or use the jQuery plugin...it doesn't work at all.  And this is downloading their version, not trying to even make it work on my own project!


text:
Q: Automatically run the workflow on the main repo when a submodule repo changes I have a repository that has a submodule repo, I want to run the workflow of the main repo in case of any submodule repo changes.
Any suggestions ?

A: First, I should switch to the master branch.
cd otherrepo/
git checkout master

After making changes to the submodule repository, I should push these changes first.
cd otherrepo/
** making changes – Editing README.md file **
git add README.md
git commit -m 'editing README.md'
git push origin master

Then, push the main repository.
cd ..
git add otherrepo
git commit -m 'editing otherrepo submodule'
git push origin master


text:
Q: GetManifestResourceStream returns null for an embedded resource with a verified resource name in GetManifestResourceNames I have a case where GetManifestResourceStream returns null for an embedded resource where the resource name is verified against GetManifestResourceNames.

*

*Embedded Resource files for a number of countries have been added to the project.

*The resource Build Action is "Embedded Resource".

*The resource name passed to GetManifestResourceStream exists in the list returned by GetManifestResourceNames. The resource name passed to GetManifestResourceStream comes from the list returned by GetManifestResourceNames.

My steps are:

*

*Obtain the qualified resource path.
private string GetCountryResourcePath(string countryName)
{
Assembly assembly = this.GetType().GetTypeInfo().Assembly;
string[] assemblyResources = assembly.GetManifestResourceNames();

string searchTerm = string.Format(".{0}, countryName);

foreach(string resourcePath in assemblyResources)
{
    if (resourcePath.LastIndexOf(searchTerm, StringComparison.OrdinalIgnoreCase)>0)
        return resourcePath;
}
return string.Empty;
}

*If a resource path is found for the specified country, try to open with GetManifestResourceStream:
string countryResourcePath = GetCountryResourcePath( countryName );
if (countryResourcePath == String.Empty)
    return;

using (Stream countryStream = assembly.GetManifestResourceStream(countryStream))
...

*In my case, the countryName:"Russia.json" is used.

*GetCountryResourcePath("Russia") returns "Jfx.Data.Countries.Russia.json".

*GetManifestResourceStream("Jfx.Data.Countries.Russia.json") returns null.


text:
Q: Cant configure MVC 4 SqlMembershipProvider I am setting up my MVC 4 website to use SqlMembershipProvider with data store as SQL Server Express 11.0.21xx
I have installed Universal Providers via NuGet
PM > Install-Package Microsoft.AspNet.Providers
When I run the app and go to localhost/Accounts/Register and submit the form, I get this error
To call this method, the "Membership.Provider" property must be an instance of "ExtendedMembershipProvider".
at this line
WebSecurity.CreateUserAndAccount(model.UserName, model.Password);
Accounts controller has attribute [InitializeSimpleMembership] set. But the tables are not created due to aforementioned error.
web.config section updated by NuGet
<profile defaultProvider="DefaultProfileProvider">
      <providers>
        <add name="DefaultProfileProvider"
             type="System.Web.Providers.DefaultProfileProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
             connectionStringName="DefaultConnection"
             applicationName="/" />
      </providers>
    </profile>
    <membership defaultProvider="DefaultMembershipProvider">
      <providers>
        <add name="DefaultMembershipProvider"
             type="System.Web.Providers.DefaultMembershipProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
             connectionStringName="DefaultConnection"
             enablePasswordRetrieval="false"
             enablePasswordReset="true"
             requiresQuestionAndAnswer="false"
             requiresUniqueEmail="false"
             maxInvalidPasswordAttempts="5"
             minRequiredPasswordLength="6"
             minRequiredNonalphanumericCharacters="0"
             passwordAttemptWindow="10"
             applicationName="/" />
      </providers>
    </membership>
    <roleManager enabled="true" defaultProvider="DefaultRoleProvider">
      <providers>
        <add name="DefaultRoleProvider"
             type="System.Web.Providers.DefaultRoleProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
             connectionStringName="DefaultConnection"
             applicationName="/" />
      </providers>
    </roleManager>
    <sessionState mode="InProc" customProvider="DefaultSessionProvider">
      <providers>
        <add name="DefaultSessionProvider"
             type="System.Web.Providers.DefaultSessionStateProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
             connectionStringName="DefaultConnection" />
      </providers>
    </sessionState>
ConnectionString
<add name="DefaultConnection" connectionString="server=servername\instance;Database=imdb;User Id=sa; Password=passbird;" providerName="System.Data.SqlClient" />

Where's the problem? Should I use universal providers at all? I dont believe I should run aspnet_regsql cos of the new Account controller.

A: All I had to do was change DefaultMembershipProvider to SimpleMembershipProvider in web.config. type attribute is important to get it right.
<membership defaultProvider="DefaultMembershipProvider">
  <providers>
    <add name="DefaultMembershipProvider"
         type="WebMatrix.WebData.SimpleMembershipProvider, WebMatrix.WebData"
         connectionStringName="DefaultConnection"
         enablePasswordRetrieval="false"
         enablePasswordReset="true"
         requiresQuestionAndAnswer="false"
         requiresUniqueEmail="false"
         maxInvalidPasswordAttempts="5"
         minRequiredPasswordLength="6"
         minRequiredNonalphanumericCharacters="0"
         passwordAttemptWindow="10"
         applicationName="/" />
  </providers>
</membership>
<roleManager enabled="true" defaultProvider="DefaultRoleProvider">
  <providers>
    <add name="DefaultRoleProvider"
         type="WebMatrix.WebData.SimpleRoleProvider, WebMatrix.WebData"
         connectionStringName="DefaultConnection"
         applicationName="/" />
  </providers>
</roleManager>


text:
Q: Is BltFast supported in Windows Mobile DirectDraw? Can I get access IDirectDrawSurface5 on a WindowsMobile device so that I can access the BltFast method?

A: For the fastest blits and direct screen access on Windows Mobile, I would recommend using: PocketHal  or the library which is built on top of that: Pocketfrog

A: there is no IDirectDrawSurface5 interface in neither the Windows Mobile 5.0 (and above) reference nor in the ddraw.h header file of the Windows Mobile 6 SDK, nor is there a BltFast method. so no, you can not. you can use IDirectDrawSurface::Blt, though.


text:
Q: Queue resets after every operation I am working on a queue implementation and something weird is happening. The Enqueue seems to work but the changes are not being registered (the size stays the same at 0). From what I can tell, the code will enqueue an element but immediately forget about it. The output is:
Data passed: a34
Back befor:(null)
Back a:a34
Data passed: bg
Back befor:(null)
Back a:bg
Print (null)
Print 0
Based on this I'm guessing it's something to do with memory and scope, but I'm not sure how to resolve it.Below is the code.
#include <stdio.h>
#include <stdlib.h>
#include "queue.h"

typedef struct node_s{
    void* data;
    struct node_s* next;
} node;

// queue structure
typedef struct queue_s{
    node* back;
    node* front;
    int size;
} queue_t;

//helpers
node *newNode(void *data)
{
        //create a new node* with data->data. @return: a node*
        node *temp = (node *)malloc(sizeof(node));
        temp->data = data;
        temp->next = NULL;
        return temp;
}

//deep copy a n2
node* copy(node* n2){
        node *temp = (node *)malloc(sizeof(node));
        temp->data=n2->data;
        temp->next=n2->next;
        return temp;
}
queue_t que_create(void)
{
        queue_t new;
        new.size = 0;
        node *front = (node *)malloc(sizeof(node));
        node *back = (node *)malloc(sizeof(node));
        new.front=front;
        new.back=back;
        return new;
}

void que_destroy(queue_t queue)
{
        while (queue.size > 0)
        {
                que_dequeue(queue);
        }
}

void que_clear(queue_t queue)
{
        while (que_size(queue) != 0)
        {
                que_dequeue(queue);
        }
}

void que_enqueue(queue_t queue, void *data)
{
        // Create a new LL node
        printf("Data passed: %s\n",data);
        node *temp = newNode(data);
        // If queue is empty, then new node is front and back
        if (queue.size == 0){
                printf("Back befor:%s\n",queue.back->data);
                queue.front = copy(temp);
                queue.back = copy(temp);
                queue.size=queue.size+1;
                free(temp);
                printf("Back a:%s\n",queue.back->data);
                return;
        }
        // Add the new node at the end of queue
        queue.back->next = copy(temp);
        queue.back = temp;
        printf("Back2:%s\n",queue.back->data);

         if (data != NULL){
                queue.size=queue.size+1;
        }
        //free(temp);
}

void que_dequeue(queue_t queue)
{
        if (queue.size == 0)
        {
                printf("Deq on an empty q");
                return; //break here
        }
        else if (queue.size == 1)
        {
                //only 1 element
                queue.front = NULL;
                queue.back = NULL;
        }
        else
        {
                node* temp = newNode(NULL);
                temp=queue.front->next;
                queue.front = copy(temp);
                free(temp);
        }
        queue.size=queue.size-1;
}

const void *que_front(const queue_t queue)
{
        //return queue.front->data;
        return queue.front;
}

size_t que_size(queue_t queue)
{
        return (size_t)queue.size;
}

int main(void){
        queue_t q=que_create();
        que_enqueue(q,"a34");
        que_enqueue(q,"bg");
        node* f=(node *)que_front(q);
        printf("Print %s\n",f->data);
        printf("Print %d\n",q.size);
        return 0;
}

A: The question was answered in the comments by @Paul Ogilvie. C is not "pass by value", so the code will edit a copy of the queue not the actual thing. This is fixed by passing a pointer that will change the value at the address


text:
Q: Using Firebase API in Lambda Functions AWS Can someone please tell me how to do this?
This is what i have so far and It's not adding data into my database
I tested this out without using lambda functions on a regular web application and it works
var http = require('http');
var firebase = require('firebase');

exports.handler = (event, context, callback) => {

        var config = {
            apiKey: "AIzaSyCpk23423Iy_akmUniqUJhLt234324YPBE1vD7At8Laj4",
            authDomain: "echoproject-blah.firebaseapp.com",
            databaseURL: "https://echoproject-blah.firebaseio.com",
            storageBucket: "echoproject-blah.appspot.com",
            messagingSenderId: "83962234234322"
        };

   firebase.initializeApp(config);

   firebase.datetbase().ref('/employee/').push({
      med_number: Math.floor(Math.random() * 1000),
      full_name: 'John Smith',
      date_employed: Date.now(),
      email: '23432432@yahoo.com',
      phone_number: '+123423423',
      profile_picture : 'blah.img'
   }).catch(function(err){
    console.log(err);
   });

    if (event.session.new) {
        onSessionStarted({ requestId: event.request.requestId }, event.session);
    }

    if (event.request.type === 'LaunchRequest') {
        onLaunch(event.request,
            event.session,
            (sessionAttributes, speechletResponse) => {
                callback(null, buildResponse(sessionAttributes, speechletResponse));
            });
    } else if (event.request.type === 'IntentRequest') {
        onIntent(event.request,
            event.session,
            (sessionAttributes, speechletResponse) => {
                callback(null, buildResponse(sessionAttributes, speechletResponse));
            });
    } else if (event.request.type === 'SessionEndedRequest') {
        onSessionEnded(event.request, event.session);
        callback();
    }
   } catch (err) {
    callback(err);
     }

}

I'm I missing something?
I'm trying to use firebase for my Amazon Echo. Would that be troubling it?
Is my firebase.database not getting recognize?
UPDATE
None of these solutions worked for me either
**SOLVED**
So after much frustration I decided to ditch the firebase Nodejs sdk and use the Firebase Endpoint urls
var myJSONObject = {
            med_number: Math.floor(Math.random() * 1000),
            full_name: 'John Bruh',
            date_employed: Date.now(),
            email: 'vi43544tle@yahoo.com',
            phone_number: '+345345',
            profile_picture : '34534534'
        };
request({
    url: "https://echoproject-c78fghfgh6f.firebaseio.com/rest/saving-data/users.json",
    method: "POST",
    json: true,   // <--Very important!!!
    body: myJSONObject
}, function (error, response, body){
    if(error) console.log(error);
    console.log(response);
});

A: Having database and not 'datetbase' might help:
firebase.datetbase().ref('/employee/').push({


text:
Q: How to find Base, Emitter, and Collector Voltage of a Circuit Demonstrating Miller Effect
Given \$R_S=100\ k\Omega\$, \$R_1=150\ k\Omega\$, \$R_2=20\ k\Omega\$, \$R_C=7.5\ k\Omega\$, \$R_E=1\ k\Omega\$, \$C_1=C_2=C_E=0.1\ \mu F\$ and \$C_{BE}=10\ pF\$ I need to solve for \$I_C\$, \$V_B\$, \$V_E\$, and \$V_C\$.
I thought I could solve for them using:
$$V_{BB}=\frac{V_{CC}R_2}{R_1+R_2}$$
$$R_B=R_1||R_2$$
$$I_C=\frac{V_{BB}-0.7\ V}{\frac{R_B}{\beta}+R_E}$$
$$V_C=V_{CC}-I_CR_C$$
$$V_E=I_ER_E=I_CR_E$$
$$V_B=V_E+0.7\ V$$
But this seems to be wrong. Why? Thank you.

A: Well, we have the following circuit:

simulate this circuit – Schematic created using CircuitLab
When analyzing a transistor we need to use the following relations:

*

*$$\text{I}_\text{E}=\text{I}_\text{B}+\text{I}_\text{C}\tag1$$

*Transistor gain \$\beta\$:
$$\beta=\frac{\text{I}_\text{C}}{\text{I}_\text{B}}\tag2$$

*Emitter voltage:
$$\text{V}_\text{BE}=\text{V}_2-\text{V}_3\tag3$$
When we use and apply KCL, we can write the following set of equations:
$$
\begin{cases}
\text{I}_3=\text{I}_1+\text{I}_2\\
\\
0=\text{I}_2+\text{I}_4+\text{I}_9\\
\\
\text{I}_5=\text{I}_9+\text{I}_{10}\\
\\
\text{I}_\text{E}=\text{I}_4+\text{I}_5\\
\\
\text{I}_1+\text{I}_8=\text{I}_3+\text{I}_{11}\\
\\
\text{I}_{11}=\text{I}_\text{B}+\text{I}_6\\
\\
\text{I}_\text{C}=\text{I}_6+\text{I}_7\\
\\
\text{I}_{10}=\text{I}_7+\text{I}_8
\end{cases}\tag4
$$
When we use and apply Ohm's law, we can write the following set of equations:
$$
\begin{cases}
\text{I}_1=\frac{\text{V}_\text{x}-\text{V}_1}{\text{R}_1}\\
\\
\text{I}_1=\frac{\text{V}_1-\text{V}_2}{\text{R}_2}\\
\\
\text{I}_3=\frac{\text{V}_2}{\text{R}_3}\\
\\
\text{I}_4=\frac{\text{V}_3}{\text{R}_4}\\
\\
\text{I}_5=\frac{\text{V}_3}{\text{R}_5}\\
\\
\text{I}_6=\frac{\text{V}_2-\text{V}_4}{\text{R}_6}\\
\\
\text{I}_7=\frac{\text{V}_\text{y}-\text{V}_4}{\text{R}_7}\\
\\
\text{I}_8=\frac{\text{V}_\text{y}-\text{V}_2}{\text{R}_8}
\end{cases}\tag5
$$
Now, in your circuit we have:

*

*$$\text{R}_2=\frac{1}{\text{sC}_1}\tag6$$

*$$\text{R}_5=\frac{1}{\text{sC}_2}\tag7$$

*$$\text{R}_6=\frac{1}{\text{sC}_3}\tag8$$
Because we use the 'complex' s-domain we also can write:

*

*Assuming a constant DC-voltage for \$\text{V}_\text{y}\$:
$$\text{V}_\text{y}=\mathcal{L}_t\left[\hat{\text{v}}_\text{cc}\right]_{\left(\text{s}\right)}=\frac{\hat{\text{v}}_\text{cc}}{\text{s}}\tag9$$

*$$\text{V}_\text{x}=\mathcal{L}_t\left[\hat{\text{v}}_\text{in}\cos\left(\omega t\right)\right]_{\left(\text{s}\right)}=\frac{\hat{\text{v}}_\text{in}\text{s}}{\text{s}^2+\omega^2}\tag{10}$$
Now, I used Mathematica to solve this (big) problem. The used code is:
FullSimplify[
 Solve[{IE == IB + IC, \[Beta] == IC/IB, VBE == V2 - V3,
   I3 == I1 + I2, 0 == I2 + I4 + I9, I5 == I9 + I10, IE == I4 + I5,
   I1 + I8 == I3 + I11, I11 == IB + I6, IC == I6 + I7, I10 == I7 + I8,
    I1 == (((Vin*s)/(s^2 + \[Omega]^2)) - V1)/R1,
   I1 == (V1 - V2)/((1/(s*C1))), I3 == V2/R3, I4 == V3/R4,
   I5 == V3/((1/(s*C2))), I6 == (V2 - V4)/((1/(s*C3))),
   I7 == ((Vcc/s) - V4)/R7, I8 == ((Vcc/s) - V2)/R8}, {IB, IC, IE, I1,
    I2, I3, I4, I5, I6, I7, I8, I9, I10, I11, V1, V2, V3, V4}]]

Using your values in my code I got:
FullSimplify[
 Solve[{IE == IB + IC, \[Beta] == IC/IB, VBE == V2 - V3,
   I3 == I1 + I2, 0 == I2 + I4 + I9, I5 == I9 + I10, IE == I4 + I5,
   I1 + I8 == I3 + I11, I11 == IB + I6, IC == I6 + I7, I10 == I7 + I8,
    I1 == (((Vin*s)/(s^2 + \[Omega]^2)) - V1)/10000,
   I1 == (V1 - V2)/((1/(s*((1/10)*10^(-6))))), I3 == V2/20000,
   I4 == V3/1000, I5 == V3/((1/(s*((1/10)*10^(-6))))),
   I6 == (V2 - V4)/((1/(s*((10)*10^(-12))))),
   I7 == ((Vcc/s) - V4)/7500, I8 == ((Vcc/s) - V2)/150000}, {IB, IC,
   IE, I1, I2, I3, I4, I5, I6, I7, I8, I9, I10, I11, V1, V2, V3, V4}]]

Using that code, it gave me:
{{IB -> ((10000 +
        s) (s^2 (80000000000 Vcc +
           s (-(680000000000 + s (1880171000 + 261 s)) VBE +
              2 (40063000 + 63 s) Vcc +
              30 (40000000 + 3 s) Vin)) + (-s (680000000000 +
              s (1880171000 + 261 s)) VBE +
           2 (1000 + s) (40000000 +
              63 s) Vcc) \[Omega]^2))/(100000 s (9 s^3 (1 + \[Beta]) \
+ 4000000000000 (317 + 17 \[Beta]) + 300 s^2 (400417 + 417 \[Beta]) +
        100000 s (15081071 + 1881071 \[Beta])) (s^2 + \[Omega]^2)),
  IC -> ((10000 +
        s) \[Beta] (s^2 (80000000000 Vcc +
           s (-(680000000000 + s (1880171000 + 261 s)) VBE +
              2 (40063000 + 63 s) Vcc +
              30 (40000000 + 3 s) Vin)) + (-s (680000000000 +
              s (1880171000 + 261 s)) VBE +
           2 (1000 + s) (40000000 +
              63 s) Vcc) \[Omega]^2))/(100000 s (9 s^3 (1 + \[Beta]) \
+ 4000000000000 (317 + 17 \[Beta]) + 300 s^2 (400417 + 417 \[Beta]) +
        100000 s (15081071 + 1881071 \[Beta])) (s^2 + \[Omega]^2)),
  IE -> ((10000 +
        s) (1 + \[Beta]) (s^2 (80000000000 Vcc +
           s (-(680000000000 + s (1880171000 + 261 s)) VBE +
              2 (40063000 + 63 s) Vcc +
              30 (40000000 + 3 s) Vin)) + (-s (680000000000 +
              s (1880171000 + 261 s)) VBE +
           2 (1000 + s) (40000000 +
              63 s) Vcc) \[Omega]^2))/(100000 s (9 s^3 (1 + \[Beta]) \
+ 4000000000000 (317 + 17 \[Beta]) + 300 s^2 (400417 + 417 \[Beta]) +
        100000 s (15081071 + 1881071 \[Beta])) (s^2 + \[Omega]^2)),
  I1 -> -((s^2 (9 s^3 VBE (1 + \[Beta]) +
           3 s^2 (-3 Vin (1 + \[Beta]) +
              10000 VBE (4003 + 3 \[Beta])) +
           4000000000 (2 Vcc (1 + \[Beta]) -
              Vin (317 + 17 \[Beta])) +
           300 s (4000000000 VBE + 42 Vcc (1 + \[Beta]) -
              Vin (400357 +
                 357 \[Beta]))) + (9 s^3 VBE (1 + \[Beta]) +
           8000000000 Vcc (1 + \[Beta]) +
           30000 s^2 VBE (4003 + 3 \[Beta]) +
           600 s (2000000000 VBE +
              21 Vcc (1 + \[Beta]))) \[Omega]^2)/(10000 (9 s^3 (1 + \
\[Beta]) + 4000000000000 (317 + 17 \[Beta]) +
          300 s^2 (400417 + 417 \[Beta]) +
          100000 s (15081071 + 1881071 \[Beta])) (s^2 + \[Omega]^2))),
   I2 -> (s^2 (27 s^4 VBE (1 + \[Beta]) +
         8000000000000 Vcc (1 + \[Beta]) +
         200000 s (6000000000 VBE + 120063 Vcc (1 + \[Beta]) -
            80000 Vin (151 + \[Beta])) +
         18 s^3 (-Vin (1 + \[Beta]) + 500 VBE (40031 + 31 \[Beta])) +
         600 s^2 (63 Vcc (1 + \[Beta]) +
            50000 VBE (124003 + 3 \[Beta]) -
            2 Vin (200171 + 171 \[Beta]))) + (1000 +
         3 s) (9 s^3 VBE (1 + \[Beta]) +
         8000000000 Vcc (1 + \[Beta]) +
         30000 s^2 VBE (4003 + 3 \[Beta]) +
         600 s (2000000000 VBE +
            21 Vcc (1 + \[Beta]))) \[Omega]^2)/(20000 s (9 s^3 (1 + \
\[Beta]) + 4000000000000 (317 + 17 \[Beta]) +
        300 s^2 (400417 + 417 \[Beta]) +
        100000 s (15081071 + 1881071 \[Beta])) (s^2 + \[Omega]^2)),
  I3 -> (s^2 (9 s^4 VBE (1 + \[Beta]) +
         8000000000000 Vcc (1 + \[Beta]) +
         3000 s^3 VBE (40033 + 33 \[Beta]) +
         200000 s (6000000000 VBE + (40063 Vcc +
               600000 Vin) (1 + \[Beta])) +
         600 s^2 (3 (7 Vcc + 5 Vin) (1 + \[Beta]) +
            50000 VBE (44003 + 3 \[Beta]))) + (1000 +
         s) (9 s^3 VBE (1 + \[Beta]) + 8000000000 Vcc (1 + \[Beta]) +
         30000 s^2 VBE (4003 + 3 \[Beta]) +
         600 s (2000000000 VBE +
            21 Vcc (1 + \[Beta]))) \[Omega]^2)/(20000 s (9 s^3 (1 + \
\[Beta]) + 4000000000000 (317 + 17 \[Beta]) +
        300 s^2 (400417 + 417 \[Beta]) +
        100000 s (15081071 + 1881071 \[Beta])) (s^2 + \[Omega]^2)),
  I4 -> ((1 + \[Beta]) (s^2 (80000000000 Vcc +
           s (-(680000000000 + s (1880171000 + 261 s)) VBE +
              2 (40063000 + 63 s) Vcc +
              30 (40000000 + 3 s) Vin)) + (-s (680000000000 +
              s (1880171000 + 261 s)) VBE +
           2 (1000 + s) (40000000 +
              63 s) Vcc) \[Omega]^2))/(10 s (9 s^3 (1 + \[Beta]) +
        4000000000000 (317 + 17 \[Beta]) +
        300 s^2 (400417 + 417 \[Beta]) +
        100000 s (15081071 + 1881071 \[Beta])) (s^2 + \[Omega]^2)),
  I5 -> ((1 + \[Beta]) (s^2 (80000000000 Vcc +
           s (-(680000000000 + s (1880171000 + 261 s)) VBE +
              2 (40063000 + 63 s) Vcc +
              30 (40000000 + 3 s) Vin)) + (-s (680000000000 +
              s (1880171000 + 261 s)) VBE +
           2 (1000 + s) (40000000 +
              63 s) Vcc) \[Omega]^2))/(100000 (9 s^3 (1 + \[Beta]) +
        4000000000000 (317 + 17 \[Beta]) +
        300 s^2 (400417 + 417 \[Beta]) +
        100000 s (15081071 + 1881071 \[Beta])) (s^2 + \[Omega]^2)),
  I6 -> (3 s^2 (-420000000 Vcc +
         40 s ((1000 + s) (10000 + s) VBE - (12500 + s) Vcc +
            1000 Vin) +
         s (-(10000 + s) (17000 + 47 s) VBE + 2 (-19000 + s) Vcc +
            10 (34000 + 3 s) Vin) \[Beta]) -
      3 (-40 s (1000 + s) (10000 + s) VBE +
         40 (10500000 + s (12500 + s)) Vcc +
         s ((10000 + s) (17000 + 47 s) VBE -
            2 (-19000 +
               s) Vcc) \[Beta]) \[Omega]^2)/(100000 (9 s^3 (1 + \
\[Beta]) + 4000000000000 (317 + 17 \[Beta]) +
        300 s^2 (400417 + 417 \[Beta]) +
        100000 s (15081071 + 1881071 \[Beta])) (s^2 + \[Omega]^2)),
  I7 -> (s^2 (20000000000000 Vcc \[Beta] - 3 s^4 VBE (1 + \[Beta]) +
         500000 s (-200000 (1700 VBE - 3 Vin) \[Beta] +
            Vcc (63 + 44063 \[Beta])) +
         s^3 (3 Vcc (1 + \[Beta]) - 1000 VBE (33 + 47033 \[Beta])) -
         500 s^2 (6 Vin (1 - 9999 \[Beta]) -
            25 Vcc (3 + 163 \[Beta]) +
            20000 VBE (3 +
               48703 \[Beta]))) + (20000000000000 Vcc \[Beta] -
         3 s^4 VBE (1 + \[Beta]) +
         500000 s (-340000000 VBE \[Beta] +
            Vcc (63 + 44063 \[Beta])) +
         s^3 (3 Vcc (1 + \[Beta]) - 1000 VBE (33 + 47033 \[Beta])) -
         12500 s^2 (-Vcc (3 + 163 \[Beta]) +
            800 VBE (3 +
               48703 \[Beta]))) \[Omega]^2)/(2500 s (9 s^3 (1 + \
\[Beta]) + 4000000000000 (317 + 17 \[Beta]) +
        300 s^2 (400417 + 417 \[Beta]) +
        100000 s (15081071 + 1881071 \[Beta])) (s^2 + \[Omega]^2)),
  I8 -> (s^2 (-(40000000 + 3 s) (-10500000 Vcc +
            s ((1000 + s) (10000 + s) VBE - (12500 + s) Vcc +
               1000 Vin)) + (20000000000000 Vcc +
            s (500000 (120063 Vcc - 80000 Vin) -
               3 s ((1000 + s) (10000 + s) VBE - (12500 + s) Vcc +
                  1000 Vin))) \[Beta]) + (-(40000000 +
             3 s) (s (1000 + s) (10000 + s) VBE - (10500000 +
               s (12500 + s)) Vcc) + (-3 s^2 (1000 + s) (10000 +
               s) VBE + (20000000000000 +
               3 s (20010500000 +
                  s (12500 +
                    s))) Vcc) \[Beta]) \[Omega]^2)/(50000 s (9 s^3 (1 \
+ \[Beta]) + 4000000000000 (317 + 17 \[Beta]) +
        300 s^2 (400417 + 417 \[Beta]) +
        100000 s (15081071 + 1881071 \[Beta])) (s^2 + \[Omega]^2)),
  I9 -> (s^2 (-27 s^4 VBE (1 + \[Beta]) -
         168000000000000 Vcc (1 + \[Beta]) +
         18 s^3 (Vin + Vin \[Beta] + 500 VBE (-39973 + 27 \[Beta])) +
         200000 s (-921323 Vcc (1 + \[Beta]) +
            400000000 VBE (2 + 17 \[Beta]) -
            80000 Vin (-1 + 149 \[Beta])) +
         200 s^2 (-1449 Vcc (1 + \[Beta]) +
            6 Vin (200021 + 21 \[Beta]) +
            20000 VBE (10063 +
               940063 \[Beta]))) - (27 s^4 VBE (1 + \[Beta]) +
         168000000000000 Vcc (1 + \[Beta]) -
         9000 s^3 VBE (-39973 + 27 \[Beta]) -
         200000 s (-921323 Vcc (1 + \[Beta]) +
            400000000 VBE (2 + 17 \[Beta])) -
         200 s^2 (-1449 Vcc (1 + \[Beta]) +
            20000 VBE (10063 +
               940063 \[Beta]))) \[Omega]^2)/(20000 s (9 s^3 (1 + \
\[Beta]) + 4000000000000 (317 + 17 \[Beta]) +
        300 s^2 (400417 + 417 \[Beta]) +
        100000 s (15081071 + 1881071 \[Beta])) (s^2 + \[Omega]^2)),
  I10 -> (s^2 (-(40000000 + 63 s) (-10500000 Vcc +
            s ((1000 + s) (10000 + s) VBE - (12500 + s) Vcc +
               1000 Vin)) + (420000000000000 Vcc +
            s (-(10000 + s) (340000000000 +
                  s (940063000 + 63 s)) VBE + (500661500000 +
                  s (40787500 + 63 s)) Vcc +
               1000 (5960000000 +
                  599937 s) Vin)) \[Beta]) + (-(40000000 +
             63 s) (s (1000 + s) (10000 + s) VBE - (10500000 +
               s (12500 + s)) Vcc) + (-s (10000 + s) (340000000000 +
               s (940063000 + 63 s)) VBE + (40000000 +
               63 s) (10500000 +
               s (12500 +
                  s)) Vcc) \[Beta]) \[Omega]^2)/(50000 s (9 s^3 (1 + \
\[Beta]) + 4000000000000 (317 + 17 \[Beta]) +
        300 s^2 (400417 + 417 \[Beta]) +
        100000 s (15081071 + 1881071 \[Beta])) (s^2 + \[Omega]^2)),
  I11 -> (s^2 (800000000000000 Vcc +
         s (80000000000 (11 Vcc + 150 Vin) - (10000 + s) (17000 +
               47 s) VBE (40000000 + 3 s (1 + \[Beta])) +
            2 s (1000 Vcc (39943 - 57 \[Beta]) +
               3 s Vcc (1 + \[Beta]) + 45 s Vin (1 + \[Beta]) +
               30000 Vin (20017 +
                  17 \[Beta])))) - (-800000000000000 Vcc +
         s (10000 + s) (17000 + 47 s) VBE (40000000 +
            3 s (1 + \[Beta])) -
         2 s Vcc (440000000000 + 1000 s (39943 - 57 \[Beta]) +
            3 s^2 (1 + \[Beta]))) \[Omega]^2)/(100000 s (9 s^3 (1 + \
\[Beta]) + 4000000000000 (317 + 17 \[Beta]) +
        300 s^2 (400417 + 417 \[Beta]) +
        100000 s (15081071 + 1881071 \[Beta])) (s^2 + \[Omega]^2)),
  V1 -> (9 s^5 VBE (1 + \[Beta]) + 30000 s^4 VBE (4003 + 3 \[Beta]) +
      8000000000 Vcc (1 + \[Beta]) \[Omega]^2 +
      10000 s^2 (800000 Vcc (1 + \[Beta]) +
         30 Vin (800357 + 400357 \[Beta]) +
         3 VBE (4003 + 3 \[Beta]) \[Omega]^2) +
      200 s (20000000000 Vin (317 + 17 \[Beta]) +
         3 (2000000000 VBE + 21 Vcc (1 + \[Beta])) \[Omega]^2) +
      3 s^3 (600 (7 Vcc + 10 Vin) (1 + \[Beta]) +
         VBE (400000000000 +
            3 (1 + \[Beta]) \[Omega]^2)))/((9 s^3 (1 + \[Beta]) +
        4000000000000 (317 + 17 \[Beta]) +
        300 s^2 (400417 + 417 \[Beta]) +
        100000 s (15081071 + 1881071 \[Beta])) (s^2 + \[Omega]^2)),
  V2 -> (s^2 (9 s^4 VBE (1 + \[Beta]) +
         8000000000000 Vcc (1 + \[Beta]) +
         3000 s^3 VBE (40033 + 33 \[Beta]) +
         200000 s (6000000000 VBE + (40063 Vcc +
               600000 Vin) (1 + \[Beta])) +
         600 s^2 (3 (7 Vcc + 5 Vin) (1 + \[Beta]) +
            50000 VBE (44003 + 3 \[Beta]))) + (1000 +
         s) (9 s^3 VBE (1 + \[Beta]) + 8000000000 Vcc (1 + \[Beta]) +
         30000 s^2 VBE (4003 + 3 \[Beta]) +
         600 s (2000000000 VBE +
            21 Vcc (1 + \[Beta]))) \[Omega]^2)/(s (9 s^3 (1 + \
\[Beta]) + 4000000000000 (317 + 17 \[Beta]) +
        300 s^2 (400417 + 417 \[Beta]) +
        100000 s (15081071 + 1881071 \[Beta])) (s^2 + \[Omega]^2)),
  V3 -> (100 (1 + \[Beta]) (s^2 (80000000000 Vcc +
           s (-(680000000000 + s (1880171000 + 261 s)) VBE +
              2 (40063000 + 63 s) Vcc +
              30 (40000000 + 3 s) Vin)) + (-s (680000000000 +
              s (1880171000 + 261 s)) VBE +
           2 (1000 + s) (40000000 +
              63 s) Vcc) \[Omega]^2))/(s (9 s^3 (1 + \[Beta]) +
        4000000000000 (317 + 17 \[Beta]) +
        300 s^2 (400417 + 417 \[Beta]) +
        100000 s (15081071 + 1881071 \[Beta])) (s^2 + \[Omega]^2)),
  V4 -> (s^2 (9 s^4 VBE (1 + \[Beta]) +
         4000000000000 Vcc (317 + 2 \[Beta]) +
         3000 s^3 VBE (33 + 47033 \[Beta]) +
         600 s^2 (15 Vin (1 - 9999 \[Beta]) +
            Vcc (200021 - 9979 \[Beta]) +
            50000 VBE (3 + 48703 \[Beta])) +
         200000 s (1500000 (1700 VBE - 3 Vin) \[Beta] +
            Vcc (7540063 +
               610063 \[Beta]))) + (9 s^4 VBE (1 + \[Beta]) +
         4000000000000 Vcc (317 + 2 \[Beta]) +
         3000 s^3 VBE (33 + 47033 \[Beta]) +
         600 s^2 (Vcc (200021 - 9979 \[Beta]) +
            50000 VBE (3 + 48703 \[Beta])) +
         200000 s (2550000000 VBE \[Beta] +
            Vcc (7540063 +
               610063 \[Beta]))) \[Omega]^2)/(s (9 s^3 (1 + \[Beta]) \
+ 4000000000000 (317 + 17 \[Beta]) + 300 s^2 (400417 + 417 \[Beta]) +
        100000 s (15081071 + 1881071 \[Beta])) (s^2 + \[Omega]^2))}}

Assuming \$\beta=100\$, \$\text{V}_\text{BE}=\frac{7}{10\text{s}}\$, \$\omega=100\pi\$, \$\hat{\text{v}}_\text{cc}=15\$ and \$\hat{\text{v}}_\text{in}=5\$. That gave:
In[1]:=FullSimplify[
 Solve[{IE == IB + IC, 100 == IC/IB, (7/10)/s == V2 - V3,
   I3 == I1 + I2, 0 == I2 + I4 + I9, I5 == I9 + I10, IE == I4 + I5,
   I1 + I8 == I3 + I11, I11 == IB + I6, IC == I6 + I7, I10 == I7 + I8,
    I1 == (((5*s)/(s^2 + (100 Pi)^2)) - V1)/10000,
   I1 == (V1 - V2)/((1/(s*((1/10)*10^(-6))))), I3 == V2/20000,
   I4 == V3/1000, I5 == V3/((1/(s*((1/10)*10^(-6))))),
   I6 == (V2 - V4)/((1/(s*((10)*10^(-12))))),
   I7 == ((15/s) - V4)/7500, I8 == ((15/s) - V2)/150000}, {IB, IC, IE,
    I1, I2, I3, I4, I5, I6, I7, I8, I9, I10, I11, V1, V2, V3, V4}]]

Out[1]={{IB -> ((10000 +
        s) (10000 \[Pi]^2 (7240000000000 +
           s (-1142297000 + 17073 s)) +
        s^2 (7240000000000 +
           s (58857703000 + 21573 s))))/(1000000 s (10000 \[Pi]^2 +
        s^2) (8068000000000000 +
        s (20318817100000 + 3 s (44211700 + 303 s)))),
  IC -> ((10000 +
        s) (10000 \[Pi]^2 (7240000000000 +
           s (-1142297000 + 17073 s)) +
        s^2 (7240000000000 +
           s (58857703000 + 21573 s))))/(10000 s (10000 \[Pi]^2 +
        s^2) (8068000000000000 +
        s (20318817100000 + 3 s (44211700 + 303 s)))),
  IE -> (101 (10000 +
        s) (10000 \[Pi]^2 (7240000000000 +
           s (-1142297000 + 17073 s)) +
        s^2 (7240000000000 +
           s (58857703000 + 21573 s))))/(1000000 s (10000 \[Pi]^2 +
        s^2) (8068000000000000 +
        s (20318817100000 + 3 s (44211700 + 303 s)))),
  I1 -> (s^2 (273800000000000 + 5446335000 s + 39087 s^2) -
    30000 \[Pi]^2 (43200000000000 + 7 s (52120000 + 303 s)))/(
   100000 (10000 \[Pi]^2 + s^2) (8068000000000000 +
      s (20318817100000 + 3 s (44211700 + 303 s)))),
  I2 -> (30000 \[Pi]^2 (1000 + 3 s) (43200000000000 +
         7 s (52120000 + 303 s)) +
      s^2 (129600000000000000 +
         s (189094520000000 -
            3 s (3248779000 + 23937 s))))/(200000 s (10000 \[Pi]^2 +
        s^2) (8068000000000000 +
        s (20318817100000 + 3 s (44211700 + 303 s)))),
  I3 -> (30000 \[Pi]^2 (1000 + s) (43200000000000 +
         7 s (52120000 + 303 s)) +
      3 s^2 (43200000000000000 +
         s (245564840000000 +
            s (382111000 + 2121 s))))/(200000 s (10000 \[Pi]^2 +
        s^2) (8068000000000000 +
        s (20318817100000 + 3 s (44211700 + 303 s)))),
  I4 -> (101 (10000 \[Pi]^2 (7240000000000 +
           s (-1142297000 + 17073 s)) +
        s^2 (7240000000000 +
           s (58857703000 + 21573 s))))/(100 s (10000 \[Pi]^2 +
        s^2) (8068000000000000 +
        s (20318817100000 + 3 s (44211700 + 303 s)))),
  I5 -> (101 (10000 \[Pi]^2 (7240000000000 +
           s (-1142297000 + 17073 s)) +
        s^2 (7240000000000 +
           s (58857703000 + 21573 s))))/(1000000 (10000 \[Pi]^2 +
        s^2) (8068000000000000 +
        s (20318817100000 + 3 s (44211700 + 303 s)))),
  I6 -> (-30000 \[Pi]^2 (8960000000 + s (49141000 + 431 s)) +
    3 s^2 (-8960000000 + s (35959000 + 7069 s)))/(
   50000 (10000 \[Pi]^2 + s^2) (8068000000000000 +
      s (20318817100000 + 3 s (44211700 + 303 s)))),
  I7 -> (10000 \[Pi]^2 (181000000000000000 +
         s (-10443985000000 + s (-2355206000 + 43329 s))) +
      s^2 (181000000000000000 +
         s (1489556015000000 +
            s (147629644000 + 43329 s))))/(25000 s (10000 \[Pi]^2 +
        s^2) (8068000000000000 +
        s (20318817100000 + 3 s (44211700 + 303 s)))),
  I8 -> (s^2 (360200000000000000 +
         s (770376015000000 + s (6249644000 + 43329 s))) +
      10000 \[Pi]^2 (360200000000000000 +
         s (972376015000000 +
            s (6264794000 + 43329 s))))/(500000 s (10000 \[Pi]^2 +
        s^2) (8068000000000000 +
        s (20318817100000 + 3 s (44211700 + 303 s)))),
  I9 -> (-10000 \[Pi]^2 (1592080000000000000 +
         s (159150526000000 + 63 s (106963000 + 303 s))) +
      s^2 (-1592080000000000000 +
         3 s (-4026116842000000 +
            s (1796197000 + 23937 s))))/(200000 s (10000 \[Pi]^2 +
        s^2) (8068000000000000 +
        s (20318817100000 + 3 s (44211700 + 303 s)))),
  I10 -> (10000 \[Pi]^2 (3980200000000000000 +
         s (763496315000000 + 11 s (-3712666000 + 82719 s))) +
      s^2 (3980200000000000000 +
         s (30561496315000000 +
            11 s (268985684000 +
               82719 s))))/(500000 s (10000 \[Pi]^2 +
        s^2) (8068000000000000 +
        s (20318817100000 + 3 s (44211700 + 303 s)))),
  I11 -> (-10000 \[Pi]^2 (-72400000000000000 +
         s (4720570000000 + s (3920027000 + 8787 s))) +
      s^2 (72400000000000000 +
         s (595279430000000 +
            s (61230973000 + 445713 s))))/(1000000 s (10000 \[Pi]^2 +
        s^2) (8068000000000000 +
        s (20318817100000 + 3 s (44211700 + 303 s)))),
  V1 -> (30000 \[Pi]^2 (43200000000000 + 7 s (52120000 + 303 s)) +
      s (403400000000000000 +
         3 s (247380285000000 +
            s (395140000 + 2121 s))))/(10 (10000 \[Pi]^2 +
        s^2) (8068000000000000 +
        s (20318817100000 + 3 s (44211700 + 303 s)))),
  V2 -> (30000 \[Pi]^2 (1000 + s) (43200000000000 +
         7 s (52120000 + 303 s)) +
      3 s^2 (43200000000000000 +
         s (245564840000000 +
            s (382111000 + 2121 s))))/(10 s (10000 \[Pi]^2 +
        s^2) (8068000000000000 +
        s (20318817100000 + 3 s (44211700 + 303 s)))),
  V3 -> (1010 (10000 \[Pi]^2 (7240000000000 +
           s (-1142297000 + 17073 s)) +
        s^2 (7240000000000 +
           s (58857703000 + 21573 s))))/(s (10000 \[Pi]^2 +
        s^2) (8068000000000000 +
        s (20318817100000 + 3 s (44211700 + 303 s)))),
  V4 -> (3 s^2 (222400000000000000 +
         s (-473615160000000 + s (-140997889000 + 2121 s))) +
      30000 \[Pi]^2 (222400000000000000 +
         s (1026384840000000 +
            s (8986961000 + 2121 s))))/(10 s (10000 \[Pi]^2 +
        s^2) (8068000000000000 +
        s (20318817100000 + 3 s (44211700 + 303 s))))}}

So, the output voltage \$\text{V}_4\$, given by:
(3 s^2 (222400000000000000 +
      s (-473615160000000 + s (-140997889000 + 2121 s))) +
   30000 \[Pi]^2 (222400000000000000 +
      s (1026384840000000 +
         s (8986961000 + 2121 s))))/(10 s (10000 \[Pi]^2 +
     s^2) (8068000000000000 +
     s (20318817100000 + 3 s (44211700 + 303 s))))

Which gives when plotted:

A: Mark - what do you want: A "demonstration" (calculation) or an explanation of this effect?

*

*Let me start with an explanation: The MILLER effect concerns the input impedance of your circuit at the base node. Here, we see two pathes: (a) into the base and (b) into the 10pF cap. The input impedance is defined as the ratio of the input signal voltage divided by the current going through the node carrying this voltage.

However, as far as the current through the cap is concerned, there are two voltages which determine the current through the capacitor: The input voltage at the base (Vb) and the (much larger) voltage at the other side (collector voltage Vc=-|A|*Vb with A=gain).
Therefore, the current through the cap is much larger in comparison to the case where the other side of the cap would be at a fixed potential (ground or any DC value). Hence, the input resistance of this path appears correspondingly lower. That is the content of the MILLER effect.

*

*The calculation is rather simple:

The voltage across the cap is (Vb-Vc) with Vc=-|A|*Vb resulting in
(Vb-Vc)=Vb(1+|A|),
and the current through the capacitor is Ic=(Vb-Vc)/Xc=Vb(1+|A|)/Xc.
That means the capacitive reactance Xcc- as seen from the input only - appears much lower than Xc=1/wC with:
Xcc=Vb/Ic=Xc/(1+|A|)

*

*In conclusion, the MILLER effect reduces the input impedance at the base node.

*Final comment: Of course, the total input impedance contains in parallel the input resistance as seen into the transistor.


text:
Q: Comparing value in Access report field to a query using VBA I currently have a report that lists steps for various tasks and tracks the revision count. Each page is one task, with all of the steps under it. At the end of the report is a Revision history where it will list what was changed to update the revision count. I have two queries for the report, one to generate the report data and the other to generate the revision history.
What I need to do, is to show which tasks have changes on them. I want to do that by comparing the Task_ID on each report page to the Task_ID found in the revision history query.
I've tried a few varitions of dlookups and dcounts without any luck. Whenever I monitor the code, it keeps treating it as false and will end it.
If DLookup("[Task_ID]", "[qry_revision_history_conversions]") = [Reports]![rpt_WI_Book].[Report]![Task] Then
[Reports]![rpt_WI_Book].[Report]![Rev_Change].Visible = False

It's probably something really simple I'm missing, but I can't seem to wrap my head around it.
Here's the code I used to make it work.
Dim LookupTask As Variant
Dim lngRed As Long, lngYellow As Long, lngWhite As Long
lngRed = RGB(255, 0, 0)
 lngBlack = RGB(0, 0, 0)
 lngYellow = RGB(255, 255, 0)
 lngWhite = RGB(255, 255, 255)

LookupTask = DLookup("[Task_ID]", "[qry_task_check]", [Reports]![rpt_WI_Book].[Report]![Text474])

If LookupTask = [Reports]![rpt_WI_Book].[Report]![Text474] Then
    [Reports]![rpt_WI_Book].[Report]![Text474].BackColor = lngYellow

Else
[Reports]![rpt_WI_Book].[Report]![Text474].BackColor = lngWhite
End If

A: Not sure exactly what fields are in your table, but maybe I can assume you're trying to match TaskID to the Report Task field?
From the DLookup docs
if you don't supply a value for criteria, the DLookup function returns a random value
Use your criteria inside DLookup and then check for Null:
Dim LookupTask as Variant

LookupTask = DLookup("[Task_ID]", "[qry_revision_history_conversions]", "[Task_ID] = " & [Reports]![rpt_WI_Book]![Task])

If Not IsNull(LookupTask) Then
    [Reports]![rpt_WI_Book]![Rev_Change].Visible = False
End If


text:
Q: How to display values of "parameters" and "localparaters" in gtkwave iverilog simulation? Gtkwave is displaying all the registers and signal values in the simulation using iverilog, but I can not find a way to display the parameters and localparameter values. Any advice?

A: iverilog VCD(Value Change Dump) currently only supports signals that change change values. This is being worked on as enhancement to masquerade parameters as signals at time 0.  https://github.com/steveicarus/iverilog/pull/714


text:
Q: Program that outputs the lower right triangle with the input dimensions the code I have so far allows for a right side triangle to be drawn but when the user inputs a higher dimension, the triangle no longer follows that pattern.
 for (int x=0; x<=n; x++){
             for (int i=3; i>=x; i--){
                 System.out.print(" ");
             }
             for (int y=1; y<=x; y++){
                 System.out.print("*");
             }
             System.out.println(" ");
         }
 System.out.println("\n4)\n");

A: for (int x=0; x<=n; x++){
    for (int i=0; i<n-x; i++){
        System.out.print(" ");
    }
    for (int y=1; y<=x; y++){
        System.out.print("*");
    }
    System.out.println();
}
System.out.println("\n4)\n");

Here is is with litle modification.


text:
Q: Swift Generics will not instantiate generic when using inheritance I have classes Alpha and Berry:
class Alpha { }
class Berry : Alpha { }

I have a function that using inheritance within it's generic:
func myFunc<T : Alpha>(v:T) -> T {
    return T()
}

I call myFunc like this:
myFunc(Berry())

In my project, the object that gets returned is of type Alpha, and not of type Berry. Is this is a bug in the compiler, or if this is simply something I'm misunderstanding about generics?

A: What you trying to achieve is passing an instance of Berry and getting another instance of Berry?
If so, following code should work:
class Alpha {

    required init() { } // ← YOU NEED THIS

    func printme() {
        println("I'm alpha")
    }
}
class Berry : Alpha {
    override func printme() {
        println("I'm berry")
    }
}

func myFunc<T:Alpha>(v:T) -> T {
    return v.dynamicType()
}
// This also works:
/*
func myFunc<T: Alpha>(v:T) -> T {
    return (T.self as T.Type)()
}
*/

let a = myFunc(Berry())
a.printme() // -> I'm berry

required init() { } is necessary to ensure all classes derived from Alpha have init() initializer.
Here is related Q/A: Swift generics not preserving type
If what you want is passing Berry as a type and get new instance of Berry, try this:
class Alpha {
    required init() { }
    func printme() {
        println("alpha")
    }
}
class Berry : Alpha {
    override func printme() {
        println("berry")
    }
}

func myFunc<T:Alpha>(v:T.Type) -> T {
    return v()
}

let a = myFunc(Berry)
a.printme()


text:
Q: how can i compare the selected values with the existing one in rails I have a view like this,
<% count = 1 %>
<% for voting in @voting %>
    <% if voting.question_id.eql?(count) %>
        <%= radio_button( count, voting.vote_count, :radio_id => voting.nominees  ) %>
        <%= voting.nominees %>
    <% end  %>

    <% if voting.nominees.eql?(radio_id) %>
        <% voting.update_attribute('vote_count', voting.vote_count+1 ) %>
    <% end  %>
    <% count += 1 %>
<% end  %>

how can i compare the selected nominees with the existing one.
any help on this would be very useful...

A: Some models and associations would be handy here. I suspect options_from_collection_for_select will be your best friend.  Also look at increment.


text:
Q: Google picker callback not working in angular I am using google picker in angular but when I am going to call a function in callback. Picker shows it undefined error for that function. If anyone found any other method to call a function in callback please answer.
loadEditPicker() {
    gapi.load('auth', { 'callback': this.editAuthApiLoad.bind(this) });
    gapi.load('picker', { 'callback': this.editPickerApiLoad.bind(this) });
  }

  editAuthApiLoad() {
    gapi.auth.authorize(
      {
        'client_id': 'my-client-id',
        'scope': ['https://www.googleapis.com/auth/drive'],
        'immediate': false
      },
      this.updateNewDocument);
  }

  editPickerApiLoad() {
    this.pickerApiLoaded = true;
  }

  updateNewDocument(authResult) {
    if (authResult && !authResult.error) {
      if (authResult.access_token) {
        let view = new google.picker.View(google.picker.ViewId.DOCS);
        view.setMimeTypes("image/png,image/jpeg,image/jpg");
        let picker = new google.picker.PickerBuilder()
          .enableFeature(google.picker.Feature.MULTISELECT_ENABLED)
          .setOAuthToken(authResult.access_token)
          .addView(view)
          .addView(new google.picker.DocsUploadView())
          .setCallback(this.myCallback())
          .build();
        picker.setVisible(true);
      }
    }
  }

A: I got the answer for my above question. I just need to replace
this.updateNewDocument

with
this.updateNewDocument.bind(this)

while calling the function.


text:
Q: I am trying to pass a context to an Intent to start an Activity in a Kotlin RecyclerView.Holder class but does not recognize the context class MyYugioHolder(view: View):RecyclerView.ViewHolder(view)  {
  private val binding = ItemYugioSavedBinding.bind(view)

  fun bind(yugio: YugioEntity){
    with(binding){
        tvIndex.text = formatNumberTo3Digits(yugio.idb.toInt())
        tvName.text = yugio.name
        Glide
            .with(itemView)
            .load(yugio.image)
            .into(binding.ivYugioLogoCard)

        gosee.setOnClickListener{
            startActivity(Intent(getContext(), MainActivity::class.java))   //!!!!PROBLEM!!!

        }
    }
}


text:
Q: unable to insert into table by mysql trigger I wanna to create a trigger that insert the post id and meta_value to another table (subscription_lookup) after there is a new insertion to the wp_postmeta table. Anyone can tell me which part did I do wrong as the code is not working
 DELIMITER $$

CREATE  TRIGGER `wp_postmeta_AFTER_INSERT`
AFTER INSERT ON `wp_postmeta`
FOR EACH ROW
 BEGIN
SET @order_id = ( SELECT new.post_id FROM wp_postmeta
where meta_key = '_paid_date');

 SET @paid_date = ( SELECT new.meta_value FROM wp_postmeta
where meta_key = '_paid_date' );

 INSERT INTO subscription_lookup (subscription_id, start_date)
  VALUES (@order_id,@paid_date);
END $$
DELIMITER ;

A: Test
CREATE  TRIGGER `wp_postmeta_AFTER_INSERT`
AFTER INSERT ON `wp_postmeta`
FOR EACH ROW
INSERT INTO subscription_lookup (subscription_id, start_date)
    SELECT NEW.post_id, NEW.meta_value
    WHERE NEW.meta_key = '_paid_date';

This trigger checks does the row inserted into wp_postmeta contains '_paid_date' property and if true then it inserts the values inserted into logging table else none is inserted.


text:
Q: module.js:339 throw err; Error: Cannot find module 'npmlog' on WINDOWS 8 Pro [module.js:339 throw err;

Error: Cannot find module 'npmlog' on WINDOWS 8 Pro

I have tried to reinstall nodejs but still not working on windows.
module.js:339
    throw err;

Error: Cannot find module 'npmlog'
      at Function.Module._resolveFilename (module.js:336:15)
      at Function.Module._load (module.js:278:25)
      at Module.require (module.js:365:17)
      at require (module.js:384:17)
      at /usr/local/lib/node_modules/npm/bin/npm-cli.js:18:11
      at Object. (/usr/local/lib/node_modules/npm/bin/npm-cli.js:75:3)
      at Module._compile (module.js:460:26)
      at Object.Module._extensions..js (module.js:478:10)
      at Module.load (module.js:355:32)
      at Function.Module._load (module.js:310:12)

A: I just experienced this problem on OS X Yosemite 10.10.5.
This is caused by backwards incompatibilities with Node versions.
You can fix this by deleting all old (incompatible) Node modules:

*

**nix

*

*rm -rf /usr/local/bin/node_modules

*Windows

*

*rmdir %appdata%\npm\node_modules /s /q


text:
Q: asp.net ext.net show file in browser new window Our asp.net application uses EXT.NET.
When a "View" menu is clicked, an EXT.NET window shows up with a content of a PDF file.
The problem is we can't drag and drop that window to a body of an Outlook email (to make it as the email attachment).
I am thinking one of the way to drag and drop to a body of an Outlook email is to show the PDF file in the browser window, not an EXT.NET window. How can I do that ?
Thank you.
This is from the View (Index.cshtml):
@{
ViewBag.Title = "Archive";
var X = Html.X();
}

@section SPAViews {
@(
X.Viewport().Layout(LayoutType.Fit).Items(
X.TabPanel().ID("ArchiveTabPanel")
.Items(
        X.GridPanel().ID("GridPanel1").MarginSpec("1 1 1 1").Cls("cust-grid").Title("Archive").Icon(Icon.ServerCompressed)
        .Plugins(X.GridFilters())
        .View(Html.X().GridView().StripeRows(true).TrackOver(false))
        .SelectionModel(X.CheckboxSelectionModel().Mode(SelectionMode.Multi))
        .TopBar(
            X.Toolbar().MinHeight(35)
                .Items(
            :
                            , X.Button()
                                    .Text("View")
                                    .Icon(Icon.PageWhiteAcrobat)
                                        .DirectEvents(de =>
                                        {
                                            de.Click.Action = "Submit";
                                            de.Click.EventMask.ShowMask = true;
                                            de.Click.Method = HttpMethod.POST;
                                            de.Click.ExtraParams.Add(new Parameter()
                                            {
                                                Name = "selection",
                                                Value = "getselection()",
                                                Mode = ParameterMode.Raw
                                            });
                                            de.Click.Timeout = 360000;
                                        })

This is from ArchiveController.cs:
    public ActionResult Submit(string selection)
    {
            int cnt = SetTempData(selection);
            RenderWindows(String.Format("View Archive {0}.",cnt),0,cnt);
            return this.Direct();
   }

    [ChildActionOnly]
    public void RenderWindows(string title,int download,int cnt)
    {
        Window win = new Window
        {
            ID = "Windows1",
            Title = title,
            Icon = Ext.Net.Icon.PageWhiteAcrobat,
            Height = download == 1 ? 150 : 600,
            Width = download == 1 ? 400 : 800,
            BodyPadding = 2,
            Modal = true,
            Layout = "Fit",
            CloseAction = CloseAction.Destroy,
            Loader = new ComponentLoader()
            {
                Url = Url.Action("ArcTicket", "Archive"),
                Mode = LoadMode.Frame,
                DisableCaching = true,
                ShowWarningOnFailure = true,
                LoadMask = { ShowMask = true, Msg = String.Format("Generating {0} pdf ...",cnt) }
            },
            Buttons = {
                new Button(){ Text="Close & Clear", Icon=Ext.Net.Icon.TableRowDelete, Handler="App.GridPanel1.selModel.deselectAll();App.Windows1.close();"},
                new Button(){ Text="Close", Icon=Ext.Net.Icon.Cancel, Handler="App.Windows1.close();"}
                    }
        };
        win.Loader.Params.Add(new Parameter() { Name = "download", Value = download.ToString(), Mode = ParameterMode.Value });
        win.Render(RenderMode.Auto);
    }

    public FileStreamResult ArcTicket(int download)
    {
        String id = TempData["xid"].ToString();
        TempData.Remove("xid");
        String ticket = Uow.TICKETs.GetXmlBatch(id);

        Byte[] pdf = MvcApplication.Fop.Write(enumFobFormat.Pdf
                            , ticket
                            , Server.MapPath("/Resources/xslt/Ticket.xsl")
                            );

        MemoryStream ms = new MemoryStream(pdf);
        FileStreamResult fs = new FileStreamResult(ms, "application/pdf");
        if (download == 1)
            fs.FileDownloadName = string.Format("Archive_{0:yyyyMMdd_HHmmss}.pdf", DateTime.Now);

        return fs;
    }

A: You can make normal button / link with href to ArcTicket action with target="_blank" then it will be opened in new tab
Update:
Change .TopBar to something like this. Option 1 may be problematic because of dynamic parameter from grid and i am not sure it will be possible to pass it there
Option 1:
.TopBar(
            X.Toolbar().MinHeight(35)
                .Items(
            :
                            , X.Button()
                                    .Text("View")
                                    .Icon(Icon.PageWhiteAcrobat)
                                    .Href(Url.Action("ArcTicket", "Archive"))
                                    .HrefTarget("blank")
                                    .BaseParams("yourparameters")

Option 2
.TopBar(
            X.Toolbar().MinHeight(35)
                .Items(
            :
                            , X.Button()
                                    .Text("View")
                                    .Icon(Icon.PageWhiteAcrobat)
                                    .Handler("YourJSFUnctionWithWIndowOpen")


text:
Q: Install jdk in many windows servers using chocolatey We are starting a new project where I have to install JDK and JRE into Windows 2008R2 servers. I want to use Chocolatey for this. As a beginner could any of you suggest me.

A: If you search the Chocolatey Website, you will find packages for both the JDK and JRE.  Here are the relevant links:

*

*Search Chocolatey.org for JRE Packages

*Search Chocolatey.org for JDK Packages
NOTE: Here I am using the ability to query only the Package ID using the id: notation.
You will see that a number of packages are returned for each search, and especially for the JDK, this is because there are different versions available.  Only you will know which version you want though.
After you have identified if a package exists that suits your needs you can go ahead and install it.  The instructions on how to do this are on the package page itself, for example here, assuming that you are happy to install the latest JDK.
choco install jdk

If there is not a package that exactly fits what you are looking for, you might have to implement your own package.  The creation of a package, and what is required is too long to include within this answer, but I would encourage you to read the extensive documentation that we have available here.


text:
Q: Disable page numbering converting markdown to pdf with pandoc I am converting a markdown file to pdf using pandoc. How can I suppress page numbers in the pdf file?

A: I will answer my own question here:
I learned in this post that pandoc markdown understands standard latex commands. Take for example the following markdown file called test.md:
% A pdf file without page numbers created from pandoc markdown
% sieste
% June 2013

\pagenumbering{gobble}

# First header
etc

and the command
pandoc test.md -o test.pdf

produces the desired pdf without page numbers.
I tried to use \pagestyle{empty} at first, but it did not work: If I put it where \pagenumbering{gobble} is now, page numbering is only turned off from page 2 on, and the first page is still numbered. And if I put it before the title block, the title in the pdf is messed up.


text:
Q: Using .getElementsByClassName to access multiple popups I am attempting to use the following javascript to create various popups.Image popups when text is clicked. The problem is that when I click any of the text containers, all of the popup images appear.  I know I am missing something obvious. Any help would be much appreciated. Here is the JS code:
function myFunction() {

var popup = document.getElementsByClassName("myPopup");

for(var i=0; i<popup.length; i++) {

popup[i].classList.toggle('show');
}
}

HTML:

Viola,

Miss Ellen Terry as Viola, mid
to late 19th century

A: Your function gets a list of elements and toggle the class 'show' to every element instead of the element you want. You have to pass in the element to the function.
You can change the onclick event for each div from:

to:

Then in your javascript
function myFunction(element){
    if (element){ //If the element is passed into this function
        element.getElementsByClassName("myPopup")[0].toggle('show');
    }
}

A: Thum, this was very helpful.  I ended up changing the HTML as you suggested and did the following to the javascript, which worked perfectly:
function myFunction(element) {
var popup = element.getElementsByClassName('myPopup');
var i;
for( i=0; i<popup.length; i--) {
popup[i].classList.toggle('show');
}
}


text:
Q: Issues with accessing GeoJSON fields When I'm trying to add a GeoJson Tooltip:
choropleth.geojson.add_child(folium.features.GeoJsonTooltip(fields=['feature.properties.NTAName'], labels=False))

And get an assertion error:
AssertionError: The field feature.properties.NTAName is not available in the data. Choose from: ('BoroCode', 'BoroName', 'CountyFIPS', 'NTACode', 'NTAName', 'Shape_Leng', 'Shape_Area').
The JSON in question looks like this:
{'type': 'FeatureCollection',
 'crs': {'type': 'name',
  'properties': {'name': 'urn:ogc:def:crs:OGC:1.3:CRS84'}},
 'features': [{'type': 'Feature',
   'properties': {'BoroCode': 3,
    'BoroName': 'Brooklyn',
    'CountyFIPS': '047',
    'NTACode': 'BK43',
    'NTAName': 'Midwood',
    'Shape_Leng': 27996.5910663,
    'Shape_Area': 35799638.2503},
   'geometry': {'type': 'Polygon',
    'coordinates': [[[-73.94732672160579, 40.62916656720943],
...

I think I might have syntax for accessing filed completely wrong, but every alternative I could think of,  yielded the same result.

A: Turns out, I had to address exactly the name of the property, ignoring all hierarchy.
Which is odd.
choropleth.geojson.add_child(folium.features.GeoJsonTooltip(fields=['NTAName'], labels=False))


text:
Q: How to remove the button border in css? Below is my jsfiddle.
https://jsfiddle.net/xuhang1128/1wff2rqv/5/
the main code is below.
.design2-statusMonitor {
  margin-top: 20px;
}
.design2-statusMonitor .list-group-item {
  display: inline-block;
  background-color: transparent;
  //border-right: 0.5px solid #CAD5E0;
  border-top: 1px solid #CAD5E0;
  border-bottom: 1px solid #CAD5E0;
  width: auto;
}
.design2-statusMonitor .list-group-item.selected {
  background-color: #2f749a;
}
.design2-statusMonitor .list-group-item:focus {
  outline: none;
}
.design2-statusMonitor .list-group-item:after {
  content: "";
  width: 9px;
  height: 9px;
  position: absolute;
  right: -6px;
  top: 43%;
  z-index: 2;
  background-color: white;
  border-top: 2px solid #CAD5E0;
  border-right: 2px solid #CAD5E0;
  transform: rotate(45deg);
  -moz-transform: rotate(45deg);
  -webkit-transform: rotate(45deg);
}

Below is the screenshot when I clicked it. You can see that when I clicked it, the background color seems not totally fill the button, the left and right edge existed? How to remove that gap when I clicked the button like below one?

A: Just add border: none to the:
.design2-statusMonitor .list-group-item.selected {
  border: none;
}

Updated fiddle
But a better solution would be something like this:
.design2-statusMonitor .list-group-item.selected {
  border-top: none;
  border-right-color: #2f749a;
  border-bottom: none;
  border-left-color: #2f749a;
}

.design2-statusMonitor .list-group-item.selected:hover {
  border-right-color: #c0d5e0;
  border-left-color: #c0d5e0;
}

Just to avoid affecting the width.
Updated fiddle

A: Set border-color values for .list-group-item elements with the class .selected to transparent for the following element selectors:

*

*.design2-statusMonitor .list-group-item.selected:after

*.design2-statusMonitor .list-group-item.selected
Example:
.design2-statusMonitor .list-group-item.selected:after {
    content: "";
    width: 9px;
    height: 9px;
    position: absolute;
    right: -6px;
    top: 43%;
    z-index: 2;
    background-color: #2f749a;
    border-top: 2px solid #CAD5E0;
    border-right: 2px solid #CAD5E0;
    transform: rotate(45deg);
    -moz-transform: rotate(45deg);
    -webkit-transform: rotate(45deg);
    border-color: transparent;
}

.design2-statusMonitor .list-group-item.selected {
    background-color: #2f749a;
    border-color: transparent;
}

Updated JSFiddle
Note:
The only issue I can see with this is the detail you'll negate to visually separate two .selected sibling elements that happen to occur directly next to each other.


text:
Q: How to read real data in RL with custom environment I start by saying that I am new to RL models.
I have read a lot and followed some tutorials for RL training in a custom environment, I have a question, if I create my own environment, for example for forex trading, I will pass the dataframe with historical data for training and after that I want to switch to production and use the model in the real world, how can I do that?
Let me explain better, where can I put the part to read the new observations directly from forex for example every day at midnight?
this is what I found on stable baseline doc:
import gym
from gym import spaces

class CustomEnv(gym.Env):
    """Custom Environment that follows gym interface"""
    metadata = {'render.modes': ['human']}

    def __init__(self, arg1, arg2, ...):
        super(CustomEnv, self).__init__()
        # Define action and observation space
        # They must be gym.spaces objects
        # Example when using discrete actions:
        self.action_space = spaces.Discrete(N_DISCRETE_ACTIONS)
        # Example for using image as input (channel-first; channel-last also works):
        self.observation_space = spaces.Box(low=0, high=255,
                                            shape=(N_CHANNELS, HEIGHT, WIDTH), dtype=np.uint8)

    def step(self, action):
        ...
        return observation, reward, done, info
    def reset(self):
        ...
        return observation  # reward, done, info can't be included
    def render(self, mode='human'):
        ...
    def close (self):
        ...

and also for predict:
for ep in range(episodes):
    obs = env.reset()
    done = False
    while not done:
        # pass observation to model to get predicted action
        action, _states = model.predict(obs)

        # pass action to env and get info back
        obs, rewards, done, info = env.step(action)

        # show the environment on the screen
        env.render()

The step function returns the next observation but in trading I will have the next observation at midnight of the next day, how can I solve this problem?


text:
Q: MissingRuntimeArtifactException on Xamarin.Forms App with .Net Native Toolchain Enabled i've a Xamarin.Forms application (UWP, using .Net Standard 2.0; Target Windows Version: 10 Fall Creators Update), that runs perfect without .NET Native toolchain. But when i enable the .Net Native Toolchain in the project settings, i retrieve exceptions during runtime:
System.Reflection.MissingRuntimeArtifactException: 'Cannot retrieve a MethodInfo for this delegate because the method it targeted (Void Xamarin.Forms.Platform.UWP.Platform.OnPageAlert(Object, AlertArguments)) was not enabled for metadata using the Dynamic attribute. For more information, please visit http://go.microsoft.com/fwlink/?LinkID=616868'

It seems that i have to modify the default.rd.xml file in my UWP project. But i don't know exactly how to.
I added
<Type Name="Xamarin.Forms.Platform.UWP.Platform" Serialize="Required All" Dynamic="Required All"/>

but with no result. Same exception as before.
Can someone give me the hint, how to solve that issue?
cheers,
Chris

A: I had the same error today in debug mode for ARM64, here .Net Native is always enabled, and here I added those entries to Default.rd.xml
<Type Name="Xamarin.Forms.Platform.UWP.WindowsPlatformServices" Serialize="Required All" />
<Type Name="Xamarin.Forms.Platform.UWP.Platform" Serialize="Required All" Dynamic="Required All">
  <MethodInstantiation Name="OnPageAlert" Arguments="System.Object" Dynamic="Required" />
</Type>

Now the error message was gone.


text:
Q: Elegant way of fetching multiple objects in custom order What's an elegant way for fetching multiple objects in some custom order from a DB in django?
For example, suppose you have a few products, each with its name, and you want to fetch three of them to display in a row on your website page, in some fixed custom order. Suppose the names of the products which you want to display are, in order: ["Milk", "Chocolate", "Juice"]
One could do
unordered_products = Product.objects.filter(name__in=["Milk", "Chocolate", "Juice"])
products = [
   unordered_products.filter(name="Milk")[0],
   unordered_products.filter(name="Chocolate")[0],
   unordered_products.filter(name="Juice")[0],
]

And the post-fetch ordering part could be improved to use a name-indexed dictionary instead:
ordered_product_names = ["Milk", "Chocolate", "Juice"]
products_by_name = dict((x.name, x) for x in unordered_products)
products = [products_by_name[name] for name in ordered_product_names]

But is there a more elegant way? e.g., convey the desired order to the DB layer somehow, or return the products grouped by their name (aggregation seems to be similar to what I want, but I want the actual objects, not statistics about them).

A: You can order your product by a custom order with only one query of your ORM (executing one SQL query only):
ordered_products = Product.objects.filter(
    name__in=['Milk', 'Chocolate', 'Juice']
).annotate(
    order=Case(
        When(name='Milk', then=Value(0)),
        When(name='Chocolate', then=Value(1)),
        When(name='Juice', then=Value(2)),
        output_field=IntegerField(),
    )
).order_by('order')

Update
Note
Speaking about "elegant way" (and best practice) I think extra method (proposed by @Satendra) is absolutely to avoid.
Official Django documentation report this about extra :

Warning
You should be very careful whenever you use extra(). Every time you
  use it, you should escape any parameters that the user can control by
  using params in order to protect against SQL injection attacks .
  Please read more about SQL injection protection.

Optimized version
If you want to handle more items whit only one query you can change my first query and use the Django ORM flexibility as suggested by @Shubhanshu in his answer:
products = ['Milk', 'Chocolate', 'Juice']
ordered_products = Product.objects.filter(
    name__in=products
).order_by(Case(
    *[When(name=n, then=i) for i, n in enumerate(products)],
    output_field=IntegerField(),
))

The output of this command will be similar to this:
<QuerySet [<Product: Milk >, <Product: Chocolate>, <Product: Juice>]>

And the SQL generated by the ORM will be like this:
SELECT "id", "name"
FROM "products"
WHERE "name" IN ('Milk', 'Chocolate', 'Juice')
ORDER BY CASE
    WHEN "name" = 'Milk' THEN 0
    WHEN "name" = 'Chocolate' THEN 1
    WHEN "name" = 'Juice' THEN 2
    ELSE NULL
END ASC

A: When there is no relation between the objects that you are fetching and you still wish to fetch (or arrange) them in certain (custom) order, you may try doing this:
unordered_products = Product.objects.filter(name__in=["Milk", "Chocolate", "Juice"])

product_order = ["Milk", "Chocolate", "Juice"]

preserved = Case(*[When(name=name, then=pos) for pos, name in enumerate(product_order)])

ordered_products = unordered_products.order_by(preserved)

Hope it helps!

A: Try this into meta class from model:
class Meta:
    ordering = ('name', 'related__name', )

this get your records ordered by your specified field's
then: chocolate, chocolate blue, chocolate white, juice green, juice XXX, milk, milky, milk YYYY  should keep that order when you fetch

A: Creating a QuerySet from a list while preserving order
This means the order of output QuerySet  will be same as the order of list used to filter it.

The solution is more or less same as @PaoloMelchiorre answer
But if there are more items lets say 1000 products in
product_names then you don't have to worry about adding more conditions in Case, you can use extra method of QuerySet

product_names = ["Milk", "Chocolate", "Juice", ...]

clauses = ' '.join(['WHEN name=%s THEN %s' % (name, i) for i, name in enumerate(product_names)])
ordering = 'CASE %s END' % clauses

queryset = Product.objects.filter(name__in=product_names).extra(
           select={'ordering': ordering}, order_by=('ordering',))
# Output: <QuerySet [<Product: Milk >, <Product: Chocolate>, <Product: Juice>,...]>


text:
Q: "Undefined columns selected" when passing a function I asked similar question and was told there's a duplicated question (R ggplot2 aes argument). I changed my code based on that answer but still does not work.
I'm writing a spider plot and can run it (without function). Then I want to write a function named "plottum" which can input some variables and make plots. But now it does not work.
Can anyone help me? Thanks!
(I have changed my code a bit)
library(ggplot2)
library(tumgr)
set.seed(1234)
tumorgrowth = sampleData
tumorgrowth = do.call(rbind,
          by(tumorgrowth, tumorgrowth$name,function(subset) within(subset,
             { treatment = ifelse(rbinom(1,1,0.5), "Drug","Control")
             #random classfied
            o = order(date)
            date = date[o]
            size = size[o]
            baseline = size[1]
            percentChange = 100*(size-baseline)/baseline
            time = ifelse(date > 250, 250, date) ## data censored at 250
            cstatus = factor(ifelse(date > 250, 0, 1))
          })))

 # Above codes work well, and problem is this plottum function
 plottum = function(data,time,pct,name,censor,treat){

   ggplot(data,aes(x=data[,time],y=data[,pct],group=data[,name]))+
   geom_line(aes(color=data[,treat]))+
   geom_point(aes(shape=data[,censor],color=data[,treat]))
  }
 plottum(tumorgrowth,"time","percentChange","name","cstatus","treatment" )

A: Option 1: use quasiquotation
scatter_by <- function(data, x, y) {
  x <- enquo(x)
  y <- enquo(y)

  ggplot(data, aes(!!x, !!y)) + geom_point()
}

scatter_by(mtcars, disp, drat)

Option 2: aes_string (soft deprecated, meaning time to move start using new methods)
scatter_by <- function(data, x, y) {
  ggplot(data, aes_string(x, y)) + geom_point()
}

scatter_by(mtcars, "disp", "drat")


text:
Q: Teradataml (Teradata Python) : Does Teradata Python Package provide any sample datasets? Does Teradata Python Package provide any sample datasets for the user to try out various analytic functions?

A: The Teradata Python Package provides various APIs with sample datasets. The sample datasets can be loaded using a helper function called "load_example_data()"
This function accepts 2 arguments:

*

*function_name - this is a predetermined value. It is a prefix name of the example JSON file to be used to load data. E.g. dataframe_example.json or adaboost_example.json

*table_name - this specifies the name of the table to be created in the database.
E.g.
from teradataml.dataframe.dataframe import DataFrame
from teradataml import load_example_data
from teradataml.context.context import *

con = create_context(host="myhost", username="myusername", password="mypassword")
load_example_data("dataframe","sales")
df = DataFrame("sales")
df
              Feb    Jan    Mar    Apr    datetime
accounts
Yellow Inc   90.0    NaN    NaN    NaN  04/01/2017
Alpha Co    210.0  200.0  215.0  250.0  04/01/2017
Jones LLC   200.0  150.0  140.0  180.0  04/01/2017
Orange Inc  210.0    NaN    NaN  250.0  04/01/2017
Blue Inc     90.0   50.0   95.0  101.0  04/01/2017
Red Inc     200.0  150.0  140.0    NaN  04/01/2017

load_example_data('adaboost','housing_train')
df1=DataFrame("housing_train")
df1
       price  lotsize  bedrooms  bathrms  stories driveway recroom fullbase gashw airco  garagepl prefarea homestyle
sn
183  58000.0   4340.0         3        1        1      yes      no       no    no    no         0       no  Eclectic
366  99000.0  13200.0         2        1        1      yes      no      yes   yes    no         1       no  Eclectic
202  53900.0   2520.0         5        2        1       no      no      yes    no   yes         1       no  Eclectic
265  50000.0   3640.0         2        1        1      yes      no       no    no    no         1       no   Classic
305  60000.0   5800.0         3        1        1      yes      no       no   yes    no         2       no  Eclectic
101  57000.0   4500.0         3        2        2       no      no      yes    no   yes         0       no  Eclectic
427  49500.0   5320.0         2        1        1      yes      no       no    no    no         1      yes   Classic
284  45000.0   6750.0         2        1        1      yes      no       no    no    no         0       no   Classic
244  27000.0   3649.0         2        1        1      yes      no       no    no    no         0       no   Classic
509  87000.0   8372.0         3        1        3      yes      no       no    no   yes         2       no  Eclectic

Taking it further these datasets can be used for various operations:
Example 1 for dataframe:
Create a dataframe from view
get_context().execute("CREATE VIEW mysales AS SELECT * FROM sales")
df2 = DataFrame("mysales", index_label="Jan")
df2
         accounts    Feb    Mar    Apr    datetime
Jan
NaN    Yellow Inc   90.0    NaN    NaN  04/01/2017
200.0    Alpha Co  210.0  215.0  250.0  04/01/2017
150.0   Jones LLC  200.0  140.0  180.0  04/01/2017
NaN    Orange Inc  210.0    NaN  250.0  04/01/2017
50.0     Blue Inc   90.0   95.0  101.0  04/01/2017
150.0     Red Inc  200.0  140.0    NaN  04/01/2017

Assign new column expressions in a dataframe.
assign(self, drop_columns = False, **kwargs) --- This returns a new dataframe without modifying the existing dataframe.
drop_columns = False -- default value, it will retain columns form previous dataframe. If it is 'true' then columns that are not specified in assign are removed from the resulting dataframe. Calculate the sum of Feb and Jan sales
a=df.Feb
b=df.Jan
df.select(['Feb','Jan']).assign(sum=a+b)
     Feb    Jan    sum
0   90.0    NaN    NaN
1  210.0  200.0  410.0
2  200.0  150.0  350.0
3  210.0    NaN    NaN
4   90.0   50.0  140.0
5  200.0  150.0  350.0

df.assign(drop_columns = True, sum=a+b)
     sum
0    NaN
1  410.0
2  350.0
3    NaN
4  140.0
5  350.0


text:
Q: Arithmetic operations inside the parenthesis javascript Hi Please help me to resolve this issue
    var str = '10+20-10-2';
    var numbers = str.replace(/ /g, '').split(/[-+*\/]/g);
    var operators = str.replace(/ /g, '').split(/\d*/g);
    operators.shift();
    var result = +numbers[0];
    for (var i = 0; i < operators.length - 1; i++) {
        result = eval( result + operators[i] + numbers[i + 1] );
    }
    alert(result);

Above code is working fine , but when am trying to pass some other input like
 var str = '-(1)-(-2)';
    var str = '-1-(-1)';
    var str = '(-1)-2'  ;

not getting any result

A: I guess in your case, besides eval, you could also use
var result = parseFloat(numbers[0]);

and consequently
result = eval( result + operators[i] + parseFloat(numbers[i + 1]))

This is a bit more solid because it works only if the strings in numbers REALLY contain numbers, and will return NaN if they don't. Also, to be even more solid, you could go the long way and use a switch instruction:
switch(operators[i])
{
   case "+":
   etc.
}

Of course your solution is more elegant, but since it does not work for some reason, this might help you spot it. In you, I'd also check with a couple alert() functions the actual content of those splitted arrays. Sometimes regular expressions do not produce quite the output you'd expect them to.