Restricting child/field access with security rules

Restricting child/field access with security rules

I'm writing an app that allows users to submit nominations which are moderated before being displayed to other users. This requires a number of restrictions I've so far been unsuccessful in implementing with security rules:Hide any nominati

Strangest language feature

Strangest language feature

What is, in your opinion, the most surprising, weird, strange or really "WTF" language feature you have encountered?Please only one feature per answer. 1:In C, arrays can be indexed like so:a[10]which is very common.However, the lesser k

Aggregating by unique identifier and concatenating related values into a string [duplicate]

Aggregating by unique identifier and concatenating related values into a string [duplicate]

This question already has an answer here: Collapse / concatenate / aggregate a column to a single comma separated string within each group 2 answers I

What is the rationale for all comparisons returning false for IEEE754 NaN values?

What is the rationale for all comparisons returning false for IEEE754 NaN values?

Why do comparisons of NaN values behave differently from all other values?That is, all comparisons with the operators ==, <=, >=, <, > where one or both values is NaN returns false, contrary to the behaviour of all other values.I suppose th

Formatting a number with exactly two decimals in JavaScript

Formatting a number with exactly two decimals in JavaScript

I have this line of code which rounds my numbers to two decimal places. But I get numbers like this: 10.8, 2.4, etc. These are not my idea of two decimal places so how I can improve the following?Math.round(price*Math.pow(10,2))/Math.pow(10

angularjs: ng-repeat-start and ng-repeat-end with inner ng-repeat

angularjs: ng-repeat-start and ng-repeat-end with inner ng-repeat

Hi I have a simple use case for ng-repeat-start and end and is working just fine, the problem appears when I want to add an inner ng-repeat.Here is the my code {{e}} {{obj.description}}The inner ng-repeat into td element is not working, I

qplot and anti-aliasing in R

qplot and anti-aliasing in R

I am using ggplot2 library and am working with the qplot commandI know I can save my output as an anti-aliased image file by using the following command after my qplot ggsave(file="filename.png")But how about my LCD display? is there any wa

Django error - matching query does not exist

Django error - matching query does not exist

I finally released my project to the production level and suddenly I have some issues I never had to deal with in the development phase.When the users posts some actions, I sometimes get the following error.Traceback (most recent call last)

How to implement real time updates in ASP.NET

How to implement real time updates in ASP.NET

I have seen several websites that show you a real time update of what's going on in the database. An example could beA stock ticker website that shows stock prices in real timeShowing data like "What other users are searching for currently.

Hiding symbol names in library

Hiding symbol names in library

I want to hide symbol names which are not relevant to the last user and make visible only APIs in my shared or static library. I have a simple code like that:int f_b1(){return 21 ;}int f_b3(){return f_b1() ;}I applied the all methods stated

Regular expression to remove comments from SQL statement

Regular expression to remove comments from SQL statement

I'm trying to come up with a regular expression to remove comments from an SQL statement. This regex almost works:(/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+/)|'(?:[^']|'')*'|(--.*)Excepth that last part doesn't handle "--" comments very wel

DirectX 9 or DirectX 10 for starters?

DirectX 9 or DirectX 10 for starters?

I want to do projects to make my resume more appealing to game companies. So I am going to start buying books. But I don't know rather to read DirectX 9 or 10 api books to start off with. DirectX10 is great, but it seems the industry is mov

Go parser not detecting Doc comments on struct type

Go parser not detecting Doc comments on struct type

I am trying to read the assocated Doc comments on a struct type using Go’s parser and ast packages. In this example, the code simply uses itself as the source.package mainimport ( "fmt" "go/ast" "go/parser" "go/token")// FirstTy

iOS 7 UITextView link detection crash in UITableView

iOS 7 UITextView link detection crash in UITableView

I have a custom UITableView cell set up in my UITableView like this:- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *identifier = @"CELL_IDENTIFIER"; SGCustomCel

Are there delegates in Java 8?

Are there delegates in Java 8?

Are there delegates in Java 8?If not, how do we have lambda expressions in JDK 8 without delegates?What are method references? Are they the same as delegates? 1:There are no delegates in JDK 8. Under the hood lambdas are instances of fun

Max size of UNIQUE index in MySQL

Max size of UNIQUE index in MySQL

Is there a max size of a UNIQUE index in MySQL?I have six dimensions in my index, which leads to a massive index.Is there a cardinality limit to UNIQUE index? I am getting weird unexplained errors and wonder if there is a limit from the UNI

Selenium ChromeDriver switch tabs

Selenium ChromeDriver switch tabs

When I click on a link in my test, it opens a new tab. I want ChromeDriver to then focus on that tab. I have tried the following code to get ChromeDriver to change tabas using the ctrl+tab shortcut:Actions builder = new Actions(driver);buil

I don't understand Python's main block. What is that thing? [duplicate]

I don't understand Python's main block. What is that thing? [duplicate]

Possible Duplicate: What does do? So I start up pyscripter and I get a file with this in it:def main(): passif __name__ == '__main__': main()What is that? Why does my program work without it as well? Whats the purpose for this anyw

Rails 3 Joins — Select only certain columns

Rails 3 Joins — Select only certain columns

Below is a relationship between Comments and a user. Each comment has one user so I'm building out a join in the code below. I was wondering how to build this code to only include specific columns in the join. I don't need all of the user i

auto run a bat script in windows 7 at login

auto run a bat script in windows 7 at login

I have recently acquired a windows 7 laptop from my late grandmother.I have been using it for work and other things. I decided to create a VM using VirtualBox And now I want to create a user on the (Windows 7 Host) machine so that when I lo

Absolute Positioned Floating Header Jitters in Safari

Absolute Positioned Floating Header Jitters in Safari

I have a simple JSFiddle of a single floating header here:http://jsfiddle.net/zT9KQ/Basically, this uses translate3d to kick in the GPU and hardware accelerate the floating header so that it may be drawn more smoothly. The header jitters in

Disable aspnet.friendlyurl's mobile redirect for tablets

Disable aspnet.friendlyurl's mobile redirect for tablets

My Website is responsive with Twitter Bootstrap and the desktop pages are designed for tablets and desktop. aspnet.friendlyUrls considers tablet devices as mobile and sends them to the ".Mobile.aspx" equivalent. How can I disable this beha

TransactionScope and Transactions

TransactionScope and Transactions

In my C# code I am using TransactionScope because I was told not to rely that my sql programmers will always use transactions and we are responsible and yada yada.Having said that It looks like TransactionScope object Rolls back before the

how can you tell when an Android activity is finished loading?

how can you tell when an Android activity is finished loading?

I'm in the process of working on an automated test suite for our android app, and running into trouble waiting for activities to fully load. I can call getActivity, but just because it shows the activity that I'm hoping to see in my test d

List of Arrays in Java

List of Arrays in Java

What is the syntax for making a List of arrays in Java? I have tried the following:List A = new List();and a lot of other things.I need to be able to reorder the int arrays, but the elements of the int arrays need not to be changed. If this