Questions
Hey, how do I create a function which receives one argument (string). The function would count...

Hey, how do I create a function which receives one argument (string). The function would count and return the number of alphanumeric characters found in that string. function('abc 5} =+;d 9') // returns 6 in JavaScript?

In: Computer Science

Calculate ΔrxnS, ΔrxnH, and ΔrxnG at 298Kfor the reaction below: 2 C3H6 (g) ----------------->   C2H4 (g)    ...

Calculate ΔrxnS, ΔrxnH, and ΔrxnG at 298Kfor the reaction below:

2 C3H6 (g) ----------------->   C2H4 (g)     +     C4H8 (g)

In: Chemistry

(python please) The Cache Directory (Hash Table):The class Cache()is the data structure you will use to...

(python please)

The Cache Directory (Hash Table):The class Cache()is the data structure you will use to store the three other caches (L1, L2, L3). It stores anarray of 3 CacheLists, which are the linked list implementations of the cache (which will be explained later). Each CacheList has been already initialized to a size of 200. Do not change this. There are 3 functions you must implement yourself:

•def hashFunc(self, contentHeader)oThis function determines which cache level your content should go in. Create a hash function that sums the ASCII values of each content header, takes the modulus of that sum with the size of the Cache hash table, and accordingly assigns an index for that content –corresponding to the L1, L2, or L3 cache. So, for example, let’sassume the header “Content-Type: 2”sumsto an ASCII value of 1334. 1334% 3 = 2. So, that content would go in the L3cache. You should notice a very obvious pattern in which contentheaders correspond to which caches. The hash function should be used by your insert and retrieveContent functions.

•def insert(self, content, evictionPolicy)oOnce a content object is created, call the cache directory’s insert function to insert it into the proper cache. This function should call the linked list’s implementation of the insert function to actually insert into the cache itself. The eviction policywill be a string –either ‘lru’or ‘mru’. These eviction policies will be explained later. oThis function should return a message including the attributes of the content object inserted into the cache. This is shown in the doctests.

•def retrieveContent(self, content)oThis function should take a content object, determine which level it is in, and then return the object if it is in the cache at that level. If not, it should return a message indicating that it was not found. This is known as a “cache miss”. Accordingly, finding content in a cache is known as a “cache hit”. The doctests show the format of the return statements.

In: Computer Science

I have to write a lab report on "Measuring the value of g". For the theory...

I have to write a lab report on "Measuring the value of g". For the theory section, I have to predict my theoretical value for "g " and its uncertainty. Explain how did I arrive to those numbers (do not quote someone else's value for "g").

Does anyone have an idea of how can I do this? Thanks a lot.

In: Physics

How have we evolved over time to rely upon “non-paper” money to drive economies around the...

How have we evolved over time to rely upon “non-paper” money to drive economies around the world?

In: Economics

Acme Company Balance Sheet As of January 5, 2019 (amounts in thousands) Cash 9,100                            &nbsp

Acme Company Balance Sheet As of January 5, 2019 (amounts in thousands)

Cash 9,100                                              Accounts Payable 1,900

Accounts Receivable 4,400                        Debt 2,400

Inventory 4,800                                         Other Liabilities 600

Property Plant & Equipment 15,600            Total Liabilities 4,900

Other Assets 2,600                                  Paid-In Capital 6,900

                                                               Retained Earnings 24,700

                                                              Total Equity 31,600

Total Assets 36,500                                 Total Liabilities & Equity 36,500

Update the balance sheet above to reflect the transactions below, which occur on January 6, 2019

1. Sell product for $25,000 with historical cost of $20,000

2. Sell product for $30,000 with historical cost of $24,000

3. Sell product for $40,000 with historical cost of $32,000

What is the final amount in Retained Earnings?

Please specify your answer in the same units as the balance sheet.

In: Accounting

Ahmed’s income statement is as follows: Sales (10,000 units) $40,000 Less variable costs (24,000) Contribution margin...

Ahmed’s income statement is as follows:

Sales (10,000 units)

$40,000

Less variable costs

(24,000)

Contribution margin

$16,000

Less fixed costs

(12,000)

Operating income

$ 4,000

  1. If Sales increase by $10,000, what is the new operating income?
  2. Calculate the Break-even point in units for Herman.
  3. Herman wants to earn operating income of $20,000. What amount of sales dollars will he need in to accomplish this goal?
  4. Herman wants to earn net income (after taxes) of $35,000 and his tax rate is 30%. What amount of sales dollars will he need to accomplish this goal?

In: Accounting

Alice and Bob are experimenting with CSMA using a W2 Walsh table. Alice uses the code...

Alice and Bob are experimenting with CSMA using a W2 Walsh table. Alice uses the code [+1, +1] and Bob uses the code [+1, −1]. Assume that they simultaneously send a hexadecimal digit to each other. Alice sends (6)16 and Bob sends (B)16. Show how they can detect what the other person has sent.

In: Computer Science

What is the change in enthalpy (in kJ) under standard conditions when 200.18 g of sodium...

What is the change in enthalpy (in kJ) under standard conditions when 200.18 g of sodium sulfate dissolves in water?

In: Chemistry

I am tasked with creating a Java application that used 2 synchronized threads to calculate monthly...

I am tasked with creating a Java application that used 2 synchronized threads to calculate monthly interest and update the account balance

This is the parameters for reference to the code. Create a class AccountSavings. The class has two instance variables: a double variable to keep annual interest rate and a double variable to keep savings balance. The annual interest rate is 5.3 and savings balance is $100.
• Create a method to calculate monthly interest. • Create a method to run two threads. Use anonymous classes to create these threads. The first thread calls the monthly interest calculation method 12 times, and then displays the savings balance (the balance in 12th month). After that, this thread sleeps 5 seconds. The second thread calls the monthly interest calculation method 12 times, and then displays the savings balance (the balance in 12th month). Before the main thread ends, these two threads must be completed. • Add your main method into the same class and test your threads. After these two threads are executed, the savings balance must remain same

I am getting an error when calling monthlyInterest method inside my runThread method. non-static method monthlyInterest() cannot be referenced from a static context and I cant seem to figure out how to fix the issue.


import static java.lang.Thread.sleep;

class AccountSavings {

    double annualInterest=5.3;
    double savings=100.00;
  
  

    public void monthlyInterest(){
    double monthlyRate;
    monthlyRate = annualInterest/12;
    double balance = 0;
    balance+=savings*monthlyRate;
    }
  
    public synchronized static void runThread(){
  
        Thread t1;
        t1 = new Thread(){
            AccountSavings accountSavings= new AccountSavings();
            @Override
            public void run(){
                for(int i=1;i<13;i++){
                    System.out.println("Balance after " + i + "month: " + monthlyInterest());
                }
                try{sleep(5000);}
                catch(InterruptedException e){e.printStackTrace();}
            }
        };
    Thread t2= new Thread(){
  
    AccountSavings accountSavings=new AccountSavings();
    @Override
    public void run(){
  
        for(int i=1;i<13;i++){
        System.out.println("Balance after " + i + " month: " + monthlyInterest(balance));
        }
        try{sleep(5000);}
        catch(InterruptedException e){e.printStackTrace();}  
    }
    };
    t1.start();
    t2.start();
  
    }

    public static void main(String[] args){
  
        runThread();
  
    }

}

In: Computer Science

i drop a 1 kg book from a height of 1m, what is the velocity of...

i drop a 1 kg book from a height of 1m, what is the velocity of the book as it hits the floors 1m below if it loses 2j energy through air resistence.

In: Physics

Given the following thermochemical equations: X2+3Y2 equals 2XY3 and Delta H =-340 kJ X2+2 Z2 equals...

Given the following thermochemical equations:

X2+3Y2 equals 2XY3 and Delta H =-340 kJ

X2+2 Z2 equals 2XZ2 and Delta H = -170 kJ

2Y2 + Z2 equals 2Y2Z and Delta H=-260kJ

Calculate the change in enthalpy for the following reaction

4XY3+7 Z2 equals 6Y2Z+4XZ2

In: Chemistry

Chamberlain Enterprises Inc. reported the following receivables in its December 31, 2021, year-end balance sheet: Current...

Chamberlain Enterprises Inc. reported the following receivables in its December 31, 2021, year-end balance sheet:

Current assets:
Accounts receivable, net of $35,000 in allowance for
uncollectible accounts
$ 273,000
Interest receivable 10,100
Notes receivable 370,000


Additional Information:

  1. The notes receivable account consists of two notes, a $100,000 note and a $270,000 note. The $100,000 note is dated October 31, 2021, with principal and interest payable on October 31, 2022. The $270,000 note is dated June 30, 2021, with principal and 6% interest payable on June 30, 2022.
  2. During 2022, sales revenue totaled $1,450,000, $1,335,000 cash was collected from customers, and $33,000 in accounts receivable were written off. All sales are made on a credit basis. Bad debt expense is recorded at year-end by adjusting the allowance account to an amount equal to 10% of year-end accounts receivable.
  3. On March 31, 2022, the $270,000 note receivable was discounted at the Bank of Commerce. The bank's discount rate is 10%. Chamberlain accounts for the discounting as a sale.


Required:
In addition to sales revenue, what revenue and expense amounts related to receivables will appear in Chamberlain’s 2022 income statement?
What amounts will appear in the 2022 year-end balance sheet for accounts receivable and Calculate the receivables turnover ratio for 2022.

In: Accounting

Using MATLAB to plot a communication system using PAM (binary) through AWGN discrete-time channel . PLZ...

Using MATLAB to plot a communication system using PAM (binary) through AWGN discrete-time channel . PLZ show your code and plot.

In: Computer Science

On a frictionless surface, a block of mass m1 and velocity v1 = vi is moving...

On a frictionless surface, a block of mass m1 and velocity v1 = vi is moving to the right when it collides with a spring, of spring constant k, attached to the left side of a stationary block of mass m2. Both blocks are free to slide on the surface.

(a) Argue either from physical principles or with equations that the velocities of the two blocks are the same when the spring is at its maximum compression.

(b) What is the maximum compression of the spring, xmax?
(c) In terms of m1,m2, and v, what are the final velocities of the two blocks after

they finish interacting?

In: Physics