Using a partial class property inside LINQ statement

I am trying to figure out the best way to do what I thought would be easy. I have a database model called Line that represents a line in an invoice. It looks roughly like so: public partial class...

iOS 5 MapKit Crashes with Overlays when zoom/pan

I have build an app which is intended to display some overlays. The overlays are in form of polygons with up to 10000 points in the outer ring. But the high number of points seems not to be the...

Android Stop Background Music

EDIT - FOUND A EASY 5-10 LINE SOLUTION!!! See MY OWN ANSWER BELOW!!! YAY!!!!!!!!! I've searched for 5 hours, dozens of SO posts, no answers, and this seems like the most simple obvious freaking...

Files in Array, in Array to Tree?

Using C#, I have created a program that executes a command line perl script and captures the output to a text file. The output is from ClearCase and was a huge pain to figure out, there isnt much...

Using MongoDB vs MySQL with lots of JSON fields?

There is a microblogging type of application. Two main basic database stores zeroed upon are: MySQL or MongoDB. I am planning to denormalize lot of data I.e. A vote done on a post is stored in a...

How Can I Use Two Different Model Serializers With the Same Model?

I'm using django-rest-framework. I have a model with a relation. I would like to just display the count of related items when a user hits the /modelname/ URL, but show the full related set when a...

Preventing SQL Injection in dynamic SQL

I asked this question earlier https://stackoverflow.com/questions/23563440/preventing-sql-injection-in-dynamical-sql, but was not clear which resulted in the question being closed, and was later...

How to count nested collection from database using Entity Framework

I'm making my first Asp.net Mvc application - Forum System. I'm trying to display how many posts and threads there are in sub category. This are my tables: public class Category { private...

Facebook custom photo and video sharing action in iOS

I have video and photo sharing working fine in an iOS app using UIActivityViewController. Now I want to upgrade it so that the app posts a custom OpenGraph story to the timeline. Something like...

Parse.com iOS localDatastore only pinning, not finding objects after enabling. (Can't unpin since it can't find objects, either)

I updated to latest parse SDK 1.6.2 to take advantage of localDatastore. Unfortunately, I cannot retrieve pinned objects. Simplest implementation: - (void)queryForPinning{ if ([PFUser...

Missing Rows using Tablix in SSRS

Something very confusing has come up. I posted this question in MS' SQL Server community last week, but after 125 views, no one has taken a stab at the problem. Anyway, here goes; I'm using Visual...

How to make my userscript work on specific pages of a site that uses the history api?

(This is in continuation of this discussion) I've been trying to make a script (for instagram) that shows how many images out of total are currently visible when viewing a profile page (example...

Efficient method for counting open cases at time of each case's submission in large data set

In a large data set (~1M cases), each case has a "created" and a "censored" dateTime. I want to count the number of other cases that were open at the time each case was created. Cases are open...

Doctrine inheritance performance

In my app, I have a few entities that share some common properties. Example entities: Image Video Event ForumPost I want these classes to share some common functions, such as: Have a list of...

Execution expired on rails feature spec testing a download using capybara/selenium/firefox

Update: After burning too many hours, decided to opt for the easy way out and use rack-test. This works straight out of the box and at least verifies that the content-type is a pdf. scenario...

Trigger onclick without clicking

I have created a news aggregator site which also measures the popularity of the posts. I have the HTML and jquery set up so that when you click the link it also counts the amount of clicks. <a...

Ef6: count of the references

I have 2 simple objects. public class Person { public int Id { get; set; } public string Name { get; set; } public List<Message> Messages { get; set; } //public int MessageCount { get;...

Laravel 5 Read Only View Model with polymorphic Relationship

Sometimes we use MySql Views to organize related tables to make it easier to search and sort. For example if you have Posts with a Status, and a Source. Post subject body source_id ...

Post multiple values from inputs, loop through post array, save changes to multiple table rows dotnet core

I have two tables displayed on one page in dotnet core. First table only displays data Second table has one input field The problem: Table has a variable count of rows in it (plus users are...

Define a window over consecutive rows with a particular value

EDIT 2 The Solution to memorize is count( <GROUP-START-COND> or null ) over ( order by <SORTING> ) AS groupnr when what you have is a table sorted by <SORTING>, new groups of rows are signalled by...

How do I correctly use EditorFor to display checkbox selections from an AJAX call, and POST the selections?

My question is two-fold. I have a View that gets data on the change of a drop down selection. The data retrieved is a List property of a ViewModel class using an Ajax call. This data is shown as a...

Using ReadOnlyCollection<T> vs List<T> vs array for return types

I posted a similar question a while ago concerning parameters, and it referred to an article more pertinent to this question, which advocates using IReadOnlyCollection<T> over...

What goes first: wp_head or the_content hooks in Wordpress?

I am learning plugins. I just want to increase views after opening the post. If I have these lines commented: // if(is_single()){ // $views++; // } I don't see any increase. When...

Oracle SQL - Conditional aggregation pivot with multiple header

This question is much enhanced version to my previous post and hope I get some help here. I have below table/View with sample or dummy data: TABLE/VIEW name:...

Using python ElementTree I want to find all title

I am new to xml in python and I have this xml in xml_text below and I am trying to extract all the titles in this xml. I have been only successful in getting the Element. I am stuck and this is...

Android cache with CRUD

I am working on a social-networking-type app where the user sees a list of "posts" and can interact with them, notably they can "like" them. The list of posts is in the 10,000s and so we paginate...

What edits are needed so Jetpack Top-Posts shows the top post of all time, not just the last 2 days?

I want to add a widget to my site that shows the most-viewed posts of all time. Every plugin I've tried so far seems to use its own database that initializes upon installation, rather than using...

Writing dynamic SQL safely, with an example function that estimates rows in any view

Last week I wrote myself a client side pivot table generator. Included on the screen is a list of tables and views. Along the way, I found it helpful to have an estimate of the number of rows in a...

How to correctly perform django queries of ManyToMany fields

I am working on an IMDB Clone project for the sake of learning. It has two important models: Movie and Celebrity. Movie model had three MTM fields all related with Celebrity model. class...

SQL Database structure for View counter per day

We want to create a view counter per post (https://my-domain.com/posts/post-title) and we want to store views per day to allow posts to be sorted by "Most popular in the last 7 days", "Most...