Referencing the decision tree from https://en.wikipedia.org/wiki/File:CART_tree_titanic_survivors.png
Original data from https://www.kaggle.com/c/titanic/data
| Description | Count | % from total | Notes |
|---|---|---|---|
| Total | 891 | 100% | |
| Died | 549 | 62% | |
| Survived | 342 | 38% |
| sudo apt-get update | |
| # need the same gcc-compiler as the kernel uses, or so NVidia says | |
| sudo apt install -y gcc=4:9.3.0-1ubuntu2 make libgl1-mesa-glx libxi6 libxrender1 | |
| # download and install the NVidia drivers | |
| wget https://us.download.nvidia.com/XFree86/Linux-x86_64/470.94/NVIDIA-Linux-x86_64-470.94.run | |
| chmod +x NVIDIA-Linux-x86_64-470.94.run | |
| sudo ./NVIDIA-Linux-x86_64-470.94.run | |
| # manually go through the install options |
| FROM python:3.7 | |
| WORKDIR /usr/src/app | |
| COPY requirements.txt ./ | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| COPY . . | |
| RUN python -m spacy download en |
| # log hours to destination systems each day at noon | |
| 0 12 * * * /home/myUser/scripts/log-daily-hours.sh | |
| # generate monthly report of worklogs each month, 1st day at 8 AM | |
| 0 8 1 * * /home/myUser/scripts/log-monthly-hours.sh |
| function checkoutCart(session) { // this is the code that executes on checkout | |
| trackActivity(session, ACTIONS.CHECKED_OUT); // it tracks that the user is checking out | |
| return getUserInfo(session.userId) // gets the user info with the user id | |
| .then(user => getDiscountAmount(user)) // then it gets the discount for the user | |
| .then(discAmt => addDiscountIfAny(session, discAmt)) // then it applies the discount | |
| .then(getPaymentScreenConfig) // then it gets the payment screen configuration | |
| .then(payScrCfg => new PaymentScreen(payScrCfg, session.cart)); // and it returns the payment screen | |
| } | |
| function getDiscountAmount(user) { // this is the code that gets the discount amount |
| function checkOutCart(session, cb) { // this is the code that executes on checkout | |
| getUserInfo(session.userId, function(err, user) { // it'll get the user information | |
| if (err) { return cb(err); } // if it has any error, it will call back with it | |
| if (user.hasDiscountedProfile) { // if the user has a profile for discounts | |
| retrieveDiscount(user.profileId, function(err, discAmt) { // it will retrieve that discount | |
| if (err) { return cb(err); } // on error, it aborts the operation | |
| session.cart.addDiscount(discAmt); // adds the discount to the cart | |
| getPaymentScreenConfig(function(err, payScrCfg) { // it retrieves the configuration from the payment screen | |
| if (err) { return cb(err); } // on error, it aborts | |
| cb(null, new PaymentScreen(payScrCfg, session.cart)); // creates a payment scree |
| $ErrorActionPreference = "SilentlyContinue" | |
| kill -force -processname 'Docker for Windows', com.docker.db, com.docker.slirp, com.docker.proxy, com.docker.9pdb, moby-diag-dl, dockerd | |
| kill -force -processname com.docker.service | |
| try { | |
| pushd "C:\Program Files\Docker\Docker\Resources" | |
| ./MobyLinux.ps1 -Destroy | |
| popd | |
| } Catch {} |
Referencing the decision tree from https://en.wikipedia.org/wiki/File:CART_tree_titanic_survivors.png
Original data from https://www.kaggle.com/c/titanic/data
| Description | Count | % from total | Notes |
|---|---|---|---|
| Total | 891 | 100% | |
| Died | 549 | 62% | |
| Survived | 342 | 38% |
| namespace SomeLargeDataHolder | |
| { | |
| // adapted from https://blogs.msdn.microsoft.com/joshwil/2005/08/10/bigarrayt-getting-around-the-2gb-array-size-limit/ | |
| // Goal: create an array that allows for a number of elements > Int.MaxValue | |
| class BigArray<T> | |
| { | |
| // These need to be const so that the getter/setter get inlined by the JIT into | |
| // calling methods just like with a real array to have any chance of meeting our | |
| // performance goals. |
(Note: this post was originally a question in StackOverflow, but has been removed as the question received no answers or activity in over a year, and was deemed an abandoned question.)
"...and other horror stories."
I've been trying for the past few days to get this to work with no luck. As such, I have a long story to tell but I'll break it down to parts so that it is easier to understand.
| public class MySingletonClass { | |
| private static MySingletonClass _instance; | |
| // private constructor | |
| private MySingletonClass() { } | |
| // public accessor property that instantiates if needed | |
| public static Instance => _instance ?? (_instance = new MySingletonClass()); | |
| } |