Insertion of a vector transformation

I earlier posted a question on the optimal way to concatenate two std::vectors, where one vector must first be transformed. While the obvious solution using std::transform may not be the theoretically optimal solution, the cost of the multiple capaci

Table Initialization

I am trying to assign values within an array within the condition of a for loop: #include <iostream> using namespace std; int* c; int n; int main() { scanf("%d", &n); c = new int[n]; for (int i = 0; i < n; c[i] = i++ ) { printf(&quo

How do I extract text from an HTML table and ignore tags?

I have documents with HTML Tables. Some of the cells have only numbers. Other cells have numbers and words. Is there any way to keep just the contents of the cells that have words and not keep the contents of cells with only numbers? Is there a modul

How to divide the vector with strings

I have a vector with gene names where several elements in the vector contains more than one gene name, separated with a comma. How can I separate the elements of this vector and get a long vector with each gene name as a separate element of the vecto

Initialization of static elements in systems

If I have the following class: class Base { protected: std::uint32_t generateId() { return TYPE_COUNTER++; } private: static std::uint32_t TYPE_COUNTER; } static std::uint32_t Base::TYPE_COUNTER = 0; And then in the derived classes I would have: clas

How to detect if the iPhone vibrates or not?

I want to write an app that does something whenever the iPhone vibrates (receives phone call, text on vibrate mode). Is there anyway to detect whether the iPhone is vibrating (i.e. handle a "vibrate" event)? Thanks for the help!Well i don't thin

Python Webdriver needs a code to find a particular item

I have used Python 2.7, Webdriver and Chrome to access Pinterest to insert images to a board. I have successfully logged in to the site, created a board and clicked on the Pin Image button (thanks to Stack Overflow). The problem that I have is to ide

Ec2 Market place Instance Linux Permission denied (publickey)

I have a Wowza instance purchased from Marketplace, about 4 hrs ago I was able to connect it and was doing some operations on it. But now when I am trying to connect it gives Permission denied (publickey) error. I used chmod command to give 777 permi

True if the completion manager is complete

My app is heavily dependent on the data that is coming. I want it to run the activity indicator and disable user interaction on the view while the data is being downloaded. Is there a way to check or return something when the completion handler is do

Return true if some elements of an array are null

I'm working on an excel spreadsheet (with the spreadsheet gem), and for some rows there will be data missing in certain columns. I want to return true if column 3 to the last column of a row (inclusive) all don't have values. Here's my method: def se

What does it mean ? Public name {get; together;}

This question already has an answer here: What is the { get; set; } syntax in C#? 17 answers I see this quiet often in C# documentation. But what does it do? public class Car { public Name { get; set; } } It is shorthand for: private string _name; pu

Script not working in Ajax returned the value

I am displaying item id and title.there is also a link "show items of this member".while clicking on it it will display the items of that user.I am using ajax for this.There is a script for detecting the order of clicking on checkbox.This workin

How to get the jQuery methods on Node.js?

Using Object.keys($.fn) (or Object.keys(jQuery.fn)) on the client side works fine to get the jQuery functions as array. How can I use the jquery package from npm to get the same array? I tried: require("jquery").fn => undefined (since we have

How to access three-dimensional Matrix elements?

How do I index through a 3 dimensional matrix? I have this code and I know that the string inside cycles is wrong. Any suggestions on doing it in proper way. Mat frame_; cvtColor(frame, frame_, CV_BGR2HSV); int size[3] = { capture_box_dim*capture_box

Using Ruby popen and PostgreSQL createuser

I am attempting to write a very simple rake task (and merge it into a rather large rake task) that will call the following command and pass in a randomly generated password. For the moment, let's even fake the random generation and just give it a set

Call to an indefinite function that is not defined?

So, when I try and run this line of code, I'm getting the following error: Fatal error: Call to undefined function curl_http_api_request_() in /Applications/XAMPP/xamppfiles/htdocs/CI/application/libraries/Shopify.php on line 58 Where line 58 is spec

Can I configure environment-specific content?

In the same way that you can generate specific content based on browser type is there a way to generate specific content based on the server running PHP without reference to the server or site name? For example, a way for PHP to automatically detect

Can not receive e-mails from the PHP site hosted on Azure

I have moved a website from simple hosting to Azure Cloud, but now my emails are not being sent. I have installed SendGrid and saved the username and password. Then I edited my contact.php file. Code of contact.php is: <?php $url = 'https://api.sendg

Keyboard eliminates back button event - Android

I have input on a PhoneGap app for Android. when the keyboard is opened it must raise the screen up to see the Input, then see it just above the keyboard. Once she makes it, the event I wrote to back button does not work anymore! And when I press a d

how to refer to a bean from another xml file in the spring

I have a Spring bean defined in an xml file. I want to reference it from another xml file. How can I go about it?You have a couple of options: Import <import resource="classpath:config/spring/that-other-xml-conf.xml"/> <bean id="yo

jQuery ajax Can not Access the Remote Access Server Failed

If I missed a fundamental part tell me. But after googling here I still dont understand why the Ajax code does not work properly. My java script code $(document).ready(function(){ $("#tform").submit(function() { var varUserName=$("#UserName

problems with multiple functions and return values

Trying to make a simple function to return a value stored in a secondary function to the main function in DEV-C++ and I'm not sure why it's not working :/ I really feel like it should be running correctly but when I compile and run the program it doe

The algorithm of division and conquest in linear complexity?

This question already has an answer here: Maximum single-sell profit 16 answers We have an array of numbers representing prices over time. For example, we have [10, 4, 6, 8, 2, 5, 3, 9, 1]. We want to know when would be the optimal time to buy and to

How to create a loading graphic in WPF XAML?

So I have a little WPF XAML that gets the titles of my RSS feed and puts them in a ListBox. However, it takes about 2 seconds to load. How can I have put some kind of AJAXy spinning graphic in the ListBox until the data is there? Here is the code: <W

Android 4.4.2 - Background colors are not set on the spinner

I have a customized spinner (simple text view) because I wanted to have an easy solution for changing the background colors of selected item: spinner_categories.xml <TextView xmlns:android="" android: