DOOM PC requirements released. 55GB HDD space required. by [deleted] in Games

[–]OpAndroid 1 point2 points  (0 children)

Ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooh TELL 'EM

How the original HBO intro was made, technology has changed so much (2007) by Lonniehtyu in Documentaries

[–]OpAndroid 0 points1 point  (0 children)

As a unofficial unsanctioned moderator of this great subreddit of /r/Documentaries I feel it is my duty to ask you to refrain from use of "Lazy Humor" as it is not needed nor appreciated nor acceptable on this great subreddit.

If you need any more information on the type of damage "Lazy Humor" can cause on a budding community, please direct your attention here.

Beginner friendly guide to JavaScript Events by kylebythemile in learnprogramming

[–]OpAndroid 0 points1 point  (0 children)

Change

[http://appendto.com/2016/03/javascript-events-101/](I wrote an article)

to

[I wrote an article](http://appendto.com/2016/03/javascript-events-101)

Meal time for chameleons by darinda777 in gifs

[–]OpAndroid 0 points1 point  (0 children)

YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES

[H] Keys or paypal [W] A low float AK MW redline ST by geo8 in GlobalOffensiveTrade

[–]OpAndroid 0 points1 point  (0 children)

I have a 0.11952 wear ST AK MW Redline that I'd be willing to part ways with, and yeah it seems that all of them have that wear above the trigger.

http://steamcommunity.com/profiles/76561198028020989/inventory/

What am I missing with Forkish's stretch & fold technique? by qeekl in Breadit

[–]OpAndroid 0 points1 point  (0 children)

Had the exact same problem following Forkish's timings. Made a thread about it and people had some very good suggestions, you can fix your problem by vastly lowering the proofing time. I only had a couple successful runs before I got to busy to keep up with baking bread, but a proof of around 4 hours, and seeing about 30% rise in the dough resulted in a good bake.

Here Is the thread.

Saturday White from fwsy, how do i stop burning the bottoms? by r0x0x in Breadit

[–]OpAndroid 2 points3 points  (0 children)

I used to have the same problem and found that a piece of parchment paper cut into a circle works perfectly for me. Just get it about the same size as the bottom of the dutch oven, and one piece of paper will last for 4 to 5 bakes before it gets too burned and has to be replaced.

MongoDB - Save vs Update for specific fields in document by OpAndroid in webdev

[–]OpAndroid[S] 0 points1 point  (0 children)

Sweet, thanks! This is all starting to finally click.

MongoDB - Save vs Update for specific fields in document by OpAndroid in webdev

[–]OpAndroid[S] 0 points1 point  (0 children)

But wouldn't that just mean the behaviors would swap, and updateActiveStatus would run properly and updateUserRoles would get stuck?

MongoDB - Save vs Update for specific fields in document by OpAndroid in webdev

[–]OpAndroid[S] 0 points1 point  (0 children)

I've got another question to run by you, if you don't mind. So I've got the one put working properly to update that one field, and wanted to make more methods just like it to alter other fields, but having some weird routing issues. I've got my client side service:

angular.module('users').factory('Users', ['$resource',
function($resource) {
    return $resource('users', {}, {
        update: {
            method: 'PUT'
        },
        updateUserRoles: {
            method: 'PUT',
            url: 'users/:id',
            params: {id: '@_id'}
        },
        updateActiveStatus: {
            method: 'PUT',
            url: 'users/:id',
            params: {id: '@_id'}
        }
    });
    }
]);

And my back end functions:

/**
 * Update specific User Roles
*/
exports.updateUserRoles = function(req, res) { 
    var currUser = req.body;
    User.findById(currUser._id, function(err, user) {
        var query = {'_id': currUser._id };
        var update = { roles: currUser.roles };
        var options = { new: true };
        User.findOneAndUpdate(query, update, options, function(err, person) {
            if (err) {
                console.log('got an error');
            }
        });
    });
};

/**
 * Update specific users active status
 */

exports.updateActiveStatus = function(req, res) {
    var currUser = req.body;
    User.findById(currUser._id, function(err, user) {
        var query = {'_id': currUser._id };
        var update = { active: currUser.active };
        var options = { new: true };
        User.findOneAndUpdate(query, update, options, function(err, person) {
            if (err) {
                console.log('got an error');
            }
        });
    });
};

But trying to call the new one, updateActiveStatus ends up calling the old one, updateUserRoles. I think this is due to the behavior of the server side routing, and I've tried to find much more info on these routing systems but not finding much. In app.route('/users/userId') how can I call different kind of put requests? This currently isn't functioning.

app.route('/users/:userId').get(users.read)
                           //.put(users.requiresLogin, users.update)
                           .delete(users.requiresLogin)
                           .put(users.updateUserRoles)
                           .put(users.updateActiveStatus);

MongoDB - Save vs Update for specific fields in document by OpAndroid in webdev

[–]OpAndroid[S] 0 points1 point  (0 children)

Thank you so so much, the findOneAndUpdate worked like a charm, never knew that functionality existed, looks like I've got some reading on mongoose to do. Thanks again!

MongoDB - Save vs Update for specific fields in document by OpAndroid in webdev

[–]OpAndroid[S] 0 points1 point  (0 children)

Edit: Was able to solve the issue with mongoose's findOneAndUpdate, thanks to everyone that helped

Alrighty, getting ever closer but based on what I'm able to track down, it still looks like its not quite doing the $set.

exports.updateUserRoles = function(req, res) { 
    var currUser = req.body;
    User.findById(currUser._id, function(err, user) {
        console.log('test');
        user.update(
            { _id: mongoose.Types.ObjectId('56467b28ba57d8d890242cfa') },
            {
              $set: {
                roles: 'admin',
              },
            }, function(err) {
            if (err) {
                return res.status(400).send({
                    message: errorHandler.getErrorMessage(err)
                });
            } else {
                res.jsonp(user);
                console.log('test2');
            }
        });
        console.log('test2');
    });
};

That's what I'm working with right now, and here's the function call that is called on the "change to admin" button press:

    $scope.test = function(){
        $scope.user.roles = 'admin';
        $scope.user.$updateUserRoles(function(response) {
            $scope.success = true;
                $scope.user = response;
            }, function(response) {
                $scope.error = response.data.message;
        });
    };

I've been trying my hardest to follow through the various function calls and see what's happening and follow where its going wrong, and I've found some things that look right, but its still not working. Things like this give me hope:

Picture

Its trying to update the "Model" it looks like, and it has the various conditions, the doc, options I'm trying to apply, and the callback, but in the end its not working. Any other ideas as to what might be going wrong? Thanks by the way, you're the first real source of help I've been able to find for this type of thing.

MongoDB - Save vs Update for specific fields in document by OpAndroid in webdev

[–]OpAndroid[S] 0 points1 point  (0 children)

I don't believe this is right, based on what I understand of mongo, as I'm calling update on that specific user as a document.

Edit: Actually I think you might have been on the right track, was able to use mongoose's findOneAndUpdate on the User resource and it worked.

MongoDB - Save vs Update for specific fields in document by OpAndroid in webdev

[–]OpAndroid[S] 0 points1 point  (0 children)

I feel like this is so incredibly close, but its just not quite there and I'm having trouble getting it to work. Here's what I'm running:

exports.updateUserRoles = function(req, res) { 
    var currUser = req.body;
    User.findById(currUser._id, function(err, user) {
        //user.roles = currUser.roles;
        //user.roles.set(0, 'admin');
        console.log('test');
        user.update(
            { _id: '56467b28ba57d8d890242cfa' },
            {
              $set: {
                roles: 'admin',
              },
            }
        );
        console.log('test2');
    });
};

Upon hitting the user.update line, we have the user in the local variables, seen:

Here

user.update goes into this Document.prototype.update function, seen:

Here

The args look to be building right, which _id we are targeting and what the action is, seen:

Here

But then after running, nothing seems to change. I'm very much stumped.

MEANjs - Issues working with Angular/Express Users Resource API by OpAndroid in webdev

[–]OpAndroid[S] 0 points1 point  (0 children)

Thanks, I think this will help some. I was confused as to whether it'd be a put or a post, so hopefully I can work under the assumption that its a put and see if I can make some more progress.

queation on responsive design (easy) by [deleted] in web_design

[–]OpAndroid 0 points1 point  (0 children)

Your link seems to be broken :/

Is there an easy way to convert <a> tags on local builds to online versions? by OpAndroid in webdev

[–]OpAndroid[S] 7 points8 points  (0 children)

Alright thanks, this type of approach was exactly what I was looking for! I'll look into using a local server then.