Categories

## need help formating type=”datetime-local” in ColdFusion (not a cold fusion element)

Ok I have searched for 2 days and thought I found the solution but it’s not working maybe I can get a hand here. I’m trying to allow the user to choose the date and time of their form post. I found the type="datetime-local" which achieves this (even though it’s not widely supported by browsers […]

Categories

## iteration with map() function

I am trying to use the map() function and capitalize all the words in the list. my_pets = [‘sisi’, ‘bibi’, ‘titi’, ‘carla’] def capitalizing(a): for item in a: b = item.upper() return b print(list(map(capitalizing, my_pets))) If I run this code, I get the output as following: [‘S’, ‘B’, ‘T’, ‘C’] Why is that? Why does […]

Categories

## SyntaxError: invalid syntax someone know this?

I’m trying to run the code below but there is an error in the above. The complete code and error is: line 27 return np.exp(-1.0)*self.rf*self.T)*average SyntaxError: invalid syntax import numpy as np import math import time class optionPricing: def __init__(self,S0,E,T,rf,sigma,interations): self.S0 = S0 self.E = E self.T = T self.rf = rf self.sigma = sigma […]

Categories

## Heat Transfer Coefficient Problem

The Problem An unusual reference gives the formula below for the heat transfer coefficient of an emulsion. $$H = 0.0061~\mathrm{(x^{0.6} + 0.038T) ⋅ V^{0.35}}$$ In the formula T, is the temperature in $ºF$, V is the flow rate of the emulsion in $\frac{ft}{min}$, X is a characteristic dimension in $inches$ and h is the heat […]

Categories

## Randomly Assigning ID Tags to different Sections in R

I am having trouble randomly assigning ID Tags to a Section. I generated a random string of 347 made up three-letter ID Tags (i.e., sbn, hjk, cvl). I would like each individual ID Tag to be randomly assigned to a Section (i.e., w,v,g,b). There are a total of 47 Sections. After assigning the ID Tags […]

## How to choose an RL algorithm for a Gridworld that models a much more complex problem

I am considering using Reinforcement Learning to do optimal control of a complex process that is controlled by two parameters $(n_O, n_I), \quad n_I = 1,2,3,\dots, M_I, n_O = 1,2,3,\dots, M_O$ In this sense, the state of the system is represented $S_t = (n_{O,t}, n_{I,t})$. It is represented, because there is a relatively complex system, […]

Categories

## Bash completion regularly crashing bash process?

I’ve encountered this on both Debian and Ubuntu. Seemingly randomly, when tab-completing a directory name something will go wrong and the entire bash process exits (code 1). I’ve tried to debug this by running "bash -vvv" but there is no relevant error message. Here is an example of the output of bash -vvv while tab-completing […]

Categories

## Periodic thread terminated by pressing escape

I wrote the following code to implement a periodic thread terminated when someone presses escape. The result is a periodic thread that continues also after i pressed escape. Can you tell me where is the error please? The compiler compiles without any error and warning. Before reading the code jump to EDIT below. #include <stdio.h> […]

Categories

## Google Cloud Run – Run Shell Script in firebase project

I’m new to google cloud-run and I’m hoping to achieve to run scripts in the firebase project to update configs (env variables) here’s the process firebase function invoked-> pass param(bar, baz) into cloud run -> run scripts firebase functions:config:set foo.bar=baz What I have done is to crate an image of firebase-tools shared by cloud-builders-community, and […]

Categories

## Print only if not null in Python – one-line method?

I have a class object, Task, with four properties, t, date, priority and checked. Only t must contain a value, the other three properties are optional. I’ve written a print method which will print the strings if they’re not null: class Task: def __init__(self, _t, _date=None, _priority=None, _checked=False): self.t = _t try: self.date = parser.parse(_date, […]