C / C ++ Direct Declaration in typedef

Looking at the OpenCL header file I see: typedef struct _cl_context * cl_context; I understand that cl_context is a pointer to a forward declared struct _cl_context. From the perspective of a library designer, what are the advantages to doing this ov

Join the results of the subquery

I've got a table called IssueStatuses and another table called Issues. Issues has a StatusID and SubStatusID, both of which are from the IssueStatuses table which has an additional field that states if it's a SubStatus or not, like so: IssueStatuses

How to create a chart for the zone

I want to create area range chart as given in the following link I want to add data to ranges using loop on my data. What should be the type of the ranges to create chart? Please suggest. Thanks in advance. Here's the JSFiddle code: HTML: <script src

Tip based on role ASP.net Identity

I am using the standard ASP.net OWIN OAuth middleware system to authenticate local users with Bearer tokens. What I would like to do is is hand out role-based tokens for the same user account. eg. OAuth TokenA => General User Privileges UserA -> OAu

BufferedImage's equivalent of Java to C #

I am trying to convert a Java program to C# and I don't know the equivalent of BufferedImage from Java to C#... Code from Java: public static String ActiveContour(int x11, int x22, int y11, int y22, BufferedImage bufIm, int contor) { double [][] img=

Python Turtle Collision

How do I make the collision? so the turtle/snake doesn't go out of the box. Trying to make them stay inside the (-200, -200) and (200, 200). from turtle import * from random import * def bounding_box(): up() right(90) forward(200) down() left(90) for

Predicate to get a missing fact

I've a bunch of facts. f(1, John). f(2, Peter). f(3, Gordon). f(4, Bono). f(5, Carl). f(6, Mick). check([], []) . check([f(X, Y)|L1] , [f(X, Y)|L2] ) :- f(X, Y), check(L1,L2). And if I run the check predicate check([ f(1, John), f(3, Gordon), f(2, Pe

Need for JQuery helps select a table row table (tr)

Here is the code snippet: http://jsbin.com/ekupa3/2/edit I need to return the table rows (tr) that don't have a tag of 'test2'. the output should be an array of table rows (tr). I spent a couple hours trying every JQuery technique I knew and I will b

Regex to find an unfinished string

I need to search for lines in a CSV file that end in an unterminated, double-quoted string. For example: 1,2,a,b,"dog","rabbit would match whereas 1,2,a,b,"dog","rabbit","cat bird" 1,2,a,b,"dog",rabbi

The best way to handle PDO request exceptions

I have a basic question on the best practices way to use try/ catch blocks with PDO queries in php. Say I have a query: $sql = "SELECT id FROM table WHERE name = ?"; $sth = $dbh->prepare($sql); $sth->bindValue(1, $param); $sth->execute(

Product limit counter

I have counter of products in my app. I want to make limit of products - 0 Now if i have 0 and tap "minus" it shows "-1" I want to limit it on "0" plus.Click += delegate { counttext.Text = string.Format("{0}", ++cou

View js in cordova

I'm struggling to implement a simple Vue.js app into Cordova. Everything works fine except that I don't know how I can intercept cordova events (deviceready, pause, ...) into my vue application. I used the Webpack template from vue-cli. Here's my fil

FOSRestBundle Forms

I am trying to build symfony2 rest api, but I am struggling with FOSRestBundle At first I could make work "@View()" annotation because it always would say that I template is missing, not matter what config options I would use I would get the sam

user authentication and password

i am very new to coding so i need help.i have built an application in netbeans that is connected to a database where i can store and retrieve customers details. what i am trying to do now is get a user put in a login and password before they can proc

C #: Convert the list of simple structures to bytes []

In C# 4.0, say I have List<HSZPAIR> myList with three elements where the HSZPAIR struct is defined by: [StructLayout(LayoutKind.Sequential)] public struct HSZPAIR { public IntPtr hszSvc; public IntPtr hszTopic; } How do I create a byte array for the

Is there a good CMS to use with ASP.Net MVC

I have a small site I developed for a friend that uses ASP.Net MVC and was wondering if I could hook it up to dotnetnuke or another CMS. Or is doing an admin site using dynamic data?Here is a list of a few ASP.NET MVC based CMS's. However these are n

Movement / draggable & lt; div & gt;

This is my updated and modified script, it works completely, except I would like to universalize it... observe the **** how can I make it so that I don't have to do function(e){BOX.Draggable.elemen = e.target || e.srcElement; elementDraggable(e); eve

Import bootstrap 4 application to angular CLI

I'm trying to use bootstrap 4 collapse method from inside the navbar component in my Angular 4 App created using Angular CLI. The issue is as follows. I import jquery and bootstrap using this code: import * as $ from 'jquery'; import 'bootstrap'; And

Two columns, total height, reactive layout. Which frame to use?

I'd like to build a site with a two column full height (100% of the vieport) layout. Left column should contain a fixed height navigation and a specific background. Right column should contain a different background and the main content. I toyed arou

Android activity indicator with bar style

How can i implement an activity indicator with bar style. As according to the following documentation http://developer.android.com/design/building-blocks/progress.html "Activity indicators are for operations of an indeterminate length." and &quo

How to convert from UUID to big endian?

My UUID is structured like this: struct UUID_FIELDS { uint32_t time_low; uint16_t time_mid; uint16_t time_hi_and_version; uint8_t clock_seq_hi_and_reserved; uint8_t clock_seq_low; uint8_t node[6]; }; I have functions that swap along 32 bit boundaries

Finding an object in a vector, with multiple requirements

I have created a vector of objects, and the objects have multiple private variables: Int x, y, id Now i wish to iterate through this vector, and find the object just before my x and y values. The smallest value for which x & y are greater. I've seen

preg_replace no capture

Trying to take in a large paragraph string and format a key word. My code is as follows: function envisio($content){ $env = '/(\s)+( (WORD|word|Word)(\s)?(AB|ab|Ab) )(\s)+/'; $new = preg_replace ($env , '<span class="word">Word</span>

How to extract multiple records via entityframework

I have three tables Employee (ID numeric, Name varchar) Login (ID numeric, UserName varchar, Password varchar) EmployeeLogin (ID numeric, EmployeeID, LoginID) Relation is one employee can have multiple login. How will I get all the Login Name of a pa