How to validate the header parameters with Sinatra?

I'm working on a simple API with Sinatra and I have a route like this one: get '/api/v1/invoice/:biller', :provides => [:json] do respond_with invoice( request ) end It works like a charm when I don't send any header params, but when I send: Accept C

CSS background gradient does not work in IE 8

I'm using JQuery UI's default theme (sunny, if that matters) through Google CDN. I want to replace the default background for ui-widget-header with a CSS background gradient. This is my sample usage:- <h3 class="ui-widget-header">Some Titl

PHP generates PNG with dynamic date

I'm looking to generate a .png image with a dynamic date, ex: take today's date +7 days and create a .png that displays that date. I'd like to keep the .png name the same and just overwrite once a week, always showing the date + 7 from that one day a

Jenkins needs EULA TFS acceptance

I created a build job on Jenkins that is attached to a TFS server. I used Team Explorer Everywhere to facilitate this. The first time I ran the job, I got the following message: Error: You must accept the End User License Agreement for this product.

Help with query LINQ to DataTable

I've successfully used OLEDB to import an excel file to a datatable and display it in a data grid view. Now I want to use LINQ and set the datasource for the grid as the LINQ query, however it is not working. Here is the full code: OleDbConnection co

A complex task of removing duplicate rows under two conditions

I have a difficulty deletion task and need your kind help. The database relates to deals sold in different cities (rows over 400.000). My task is to delete the same deal sold simultaneously in multiple cities. However, the same deal may appear severa

Moq multi-interface question

This may or may not be a multi-interface problem, but I'm doing something like this: var mockInterface1 = new Mock<IInterface1>(); var mockInterface2 = mockInterface1.As<IInterface2>(); mockInterface1.Expect( foo => foo.Foo(It.IsAny<IInt

Type declared not found in the class model

I'd appreciate help resolving the following error. I'm getting a 'type Attributes not found in struct Frobnigator<Foo> error' even though struct Frobnigator declares such a member, as shown below (see also struct Foo{}; struct Bar{}; //

NullPointerException on ViewPager with Recyclerview

We have on our app a ViewPager with a FragmentPagerAdapter which contains three fragments. Two of these fragments are composed with a Recyclerview for each one. The first page (the fragment without a ViewPager) is displayed correctly. However, when t

Access to the outer panel closing in Swift 3

I have this closure which I use to populate my array and dictionary. However, when I try to use it outside the function, it's empty. I understand that this closure works on an asynchronous thread, so is it right to assume that I try to access that va

Get the place of the king in the game of chess

i m writing a simple chess game that has 3pieces,a king and a queen one side and other side just a king,the king and queen should mate alone king with less this project,first we should get the place of alone king from user and then accor

iOS: how to partially change the color of text

I was playing with iOS built-in Compass app and the UI do make me curious. Here is the interesting part: The color of text (even the circle) can be partially and dynamically changed. I have made a lot of search, but the results are all about attribut

avoid reporting the same types of data in different structures

I have 2 -3 structures declared in my code and all these structures have some common data type. In our company its strict policy that we do not duplicate code . so I am wondering is there any way that i can declare these common data type in some func

Changing a SELECT color based on the selected OPTION

I have an HTML5 <select> with several <option> children, where each <option> has its own back and foreground colors. This is done via CSS and is easy enough. What I would like to do is to maintain the <option> color in the <sele

jsPlumb - Dynamic end anchors on each side

I am trying to figure out a way how to add endpoint anchors dynamically to jsPlumb container. I would like to have source endpoints on the left side and target endpoints on the right side only. The problem is, that I wasn't able to find any way to do

NSButton inside NSTableView by program?

How can I set a column of checkboxes inside a NSTableView? So far, this is what I have done, but it just puts the int 1 in the column, not the checkboxes: -(id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)tableColumn

Are you aligning vertically in Bootstrap?

I'm working on a small site and I can't seem to figure out how to center my name vertically. I put my CSS in the HTML file, just so you can see everything I'm doing. Thanks in advance! <head> <title>Test</title> <style> section { h

Arquillian and wildfly - how to boot into stand-alone mode?

My project configuration is Arquillian with Gradle and Wildfly 10 CR4. I have changed the standalone.conf in wildfly to use standalone-full.xml by default. Unfortunately Arquillian seems starting the embedded wildfly using standalone.xml. I guess I n

Form validation javascript does not work as expected

Why is this form validation not working? i do it like this: <form name="myForm" action="save-info.php" method="post" onsubmit="return(validu());"> I am trying to add a validation

How to summarize radio button values ​​only once?

I am using this code to sum values from multiple radio buttons : $(document).ready(function(){ var total = 50000; $("input[type=radio]").change(function(){ $("input[type=radio]:checked").each(function(){ if (isNaN($(this).val())) { tot

SQL update query VB ASP

I'm trying to do an update query in SQL Server database, through VB with This bit of code below updates all records with the same value. I want it to update just one record, depending on the "email" session variable. Dim cmdstring As Str

Variable changing mysteriously the value

EDIT: Ok I had a problem with one of the string concatenation functions, has nothing to do with threads, but knowing that it couldn't be a problem with threading lead me to the answer thank you for answering. I am making a simple tcp/ip chat program