 Adds an access check. Example "select `todos`.* from `todos` where `text` =? and `userId` =?"
objectionQuery.andWhere("userId", currentUser.id);

The above example has a security bug. If the thirdPartyService generates a query like this:
select `todos`.* from `todos` where `text` =? or `id` =?

Then after adding the access check we will get the following query:
select `todos`.* from `todos` where `text` =? or `id` =? and `userId` =?

And this query can return data that doesn't belong to the current user.
To fix this bug, we need to enclose the user-controlled conditions in parentheses:
select `todos`.* from `todos` where (`text` =? or `id` =?) and `userId` =?

But how do I do this with the Objection query builder? I imagine something like this:
const objectionQuery = thirdPartyService.createQuery(userControlledInput);
wrapWhereClauses(objectionQuery);
objectionQuery.andWhere("userId", currentUser.id);


A: From docs: You can add parentheses to queries by passing a function to any of the where* methods:
await Todo.query()
 .where('userId', 1)
 .where(builder => {
    builder.where('text', 2).orWhere('id', 3);
  });

will result in
select * from "todos" where "userId" = 1 and ("text" = 2 or "id" = 3)


A: One way could be to wrap the original query to be subquery / temporary table:
MyModel.query().from(thirdPartyService.createQuery(userControlledInput)).where(...)

(please let me know if this works at all, I haven't tested it)
Another funny sync about last comment (the one with Janice and Rodney, adapted from a chat session with Tracy).
The dream that Janice recalls is one I made this morning, I had not thought about that cabbage sync yet.
In this paper, we study a sequential decision making problem. The objective is to maximize the average reward accumulated over time subject to temporal cost constraints. The novelty of our setup is that the rewards and constraints are controlled by an adverse opponent. To solve our problem in a practical way, we propose an expert algorithm that guarantees both a vanishing regret and a sublinear number of violated constraints. The quality of this solution is demonstrated on a real-world power management problem. Our results support the hypothesis that online learning with convex cost constraints can be performed successfully in practice.I am very behind on posting photography related things! I am going to try to catch up in the next couple of weeks. I have been going through a developing and scanning frenzy lately, which helps!
Sometime toward the end of last year I did a film swap with my buddy and fellow pinhole photography enthusiast, Hank. You may know him as Espressobuzz on the intertubes.
I shot my photos around Sandy and at a secret waterfall location. And he shot his in Seattle, redscaling beforehand. Here are a few of my favorites. You can see more here. I am working my way through some rolls that he sent me so watch this space for more in the future!
You can read his post about this on 52 rolls here. Go visit his fantastic Flickr stream here.
Wow, these are great! You are so often involved in wonderful projects, Moni. It must be so exciting to develop a swapped film!
For me, too! Keep on posting, Moni!I think I am getting webbed feet. It seems like the off an on showers will never stop. I really can't complain though because if the weather here in the Northwest was warm and sunny all winter like it is in my former home (SoCal) the terrain would be brown and not green like it is. Why is it that we always want something else. You know, the grass is always greener on the other side of the fence. I think it's time I thank the good Lord for the rain and enjoy the green grass and the flowers and all the foliage that feeds the wildlife and makes this place so beautiful. Last evening I was fixing dinner and realized I needed something from the store so I got in the car and started to drive to town which is 5 miles away and low and behold there was the most beautiful rainbow. Did I have my camera with me? NO! Dang it!! I should start to carry it with me wherever I go. April is usually sunny and cloudy with showers and I love it. So I promise to try and get some rainbow pics in the next few weeks. Oh and I finally broke through and lost another 2 pounds. It's been over a month since my band adjustment and I was afraid I would have a weight gain. I go back next week for my one year appointment and I think I will have another adjustment. I'll talk to the doctor and see what he thinks.
Hope you all have a good April Fools Day. I also hope nobody plays any pranks on you. Also, I hope the Conficker virus doesn't affect you. I read this on CNN website today.
(April 1) - Experts watched warily Wednesday as a worm infecting millions of computers activated itself as predicted on April 1.
However fears the Conficker.c worm would cause chaos have so far proved unfounded, with no reports of major problems.
Lets hope it was mostly just precautionary and nothing major happens. I don't know why the people who devise these viruses don't have a more constructive way of using their talents and knowledge. I guess they just want to sit back and hear of the destruction they have caused. It is a bit cowardly if you ask me. It's another cloudy day here in the North West. I wish Spring would finally arrive for good and let the flowers bloom and the grasses grow. Well, I am off for the gym. Have a great day.
Okay, I bought a webcam 6 or 7 months ago with the intention of being able to talk to my brothers (3 of them) who all live in different states. I sent them all emails and explained to them how cool it would be to be able to talk face to face and even all of us together on a regular basis. I also thought I could keep up with my grandkids this way too since they all live far from me. Up until yesterday, I had never used this gadget. One of my oldest and dearest friends had back surgery this past week and I called her to see how she was doing. During the conversation she mentioned webcams and when she found out I had one she called me on it. We sat face to face and laughed and chatted and it was so awesome. We haven't seen each other in 3 years and now we visited online, free, face to face. My hubby walked into the room while we were talking and she saw him and spoke to him and he was blown away. Now he is hooked too. He went out and bought his own webcam for his laptop. Now, all I have to do is convince my brothers that it's worth the $20 or so to be able to see my lovely face on a regular basis and share a little bit of our lives instead of just on email or an occasional phone call.
Hope you all have a good April Fools Day. I also...I keep hearing this different sound in the middle of the night, and it is so high pitched that, at first, I wasn’t sure I was absolutely hearing it, however but it is absolutely there.
It sounds love a absolutely high pitched whistle.
I usually have the TV or my music on when I am home while we were in the afternoon. I guess that explains why I only hear the sound at night when I am trying to fall asleep, sometimes, it even wakes myself and others up when I am already asleep, at first, I thought it was my refrigerator making the noise, but however, after a bit, I realized that it is my air conditioner. I only hear the whistling sound when the compressor is on. I went outside despite the fact that I can’t hear the sound when I get up close to the air conditioner compressor. I think that the sound of the fans drowns it out or somethingâ€¦ Maybe it can only be heard through the ductwork. I don’t know. I just worry that if I call for some Heating, Ventilation in addition to A/C service, the serviceman won’t even be able to hear the sound at all. After all, my wife can’t hear it. She says that the whistling sound is all in my head despite the fact that I think it is there. I don’t want to waste money having an Heating, Ventilation in addition to A/C serviceman come out only to tell myself and others that my Heating, Ventilation in addition to A/C system is good plus he doesn’t hear any different noisesâ€¦ What if the sound absolutely is all in my head? Or, maybe I just acquired super human hearing somehow. Maybe this sound is normal for the air conditioner plus I just couldn’t hear it before.
We’ve been discussing wives lately, one of the guys having just been married. The conversations are interestingly wide-ranging, including, as they do, a handful of happily (I assume