Dropbox /previews not working

:I'm trying to get the file preview using:curl "https://api-content.dropbox.com/1/previews/auto/Get Started with Dropbox.pdf" -H "Authorization: Bearer "But it always return:{"error": "no_preview.file_content."}Please advise if ther

R: Function “diff” over various groups

:While searching for a solution to my problem I found this thread: Function "diff" over various groups in R. I've got a very similar question so I'll just work with the example there. This is what my desired output should look like:name class year dif

CFString to string?

:I have follow code to make a String to a CFString: internal static byte[] StringToCFString(string value) { byte[] b; b = new byte[value.Length + 10]; b[4] = 0x8c; b[5] = 07; b[6] = 01; b[8] = (byte)value.Lengt

PHP PDO Transaction with nested PHP check

:i have to do 2 MySql-queries:SELECT id FROM X WHERE [...]INSERT [...]The second query should only be executed, if the first query returns an correct id.Is it possible, to mix PHP conditions between both queries?Eg.try{ $dbh->setAttribute(PDO::ATTR_

Getting wrong PDF page on 64-bit iOS device only

:I have an iOS app that only has a problem on 64 devices. The function where the problem is, is here:- (NSMutableData *)getPage:(NSInteger)pageNumber{ NSLog(@"%ld",(long)pageNumber); CGPDFDocumentRef SourcePDFDocument = CGPDFDocumentCreateWithURL(

OpenCart mail error on mail.php line 153

:I'm getting this error on my OpenCart site while I trying to register using social media bundle plugin: Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /home/wankersh/public_html/system/library/mail.php

Android ListView how to populate with dynamic information retrieved from a google spreadsheet

:I'm working on an android app that takes information from a google spreadsheet and puts in on a list view. However, I'm unable to come up with a solution for this.Any help would greatly be appreciated.For spreadsheet integration I use the Google Sheets

Read a file twice in C++ because of eof?

:I read numbers from a file, apply 3 functions and print out to another file:int main(int argc, char** argv) { std::ifstream fin; fin.open("input.txt"); std::ofstream fout; fout.open("output.txt", std::ios::app); char arr[50]; int a,

Using directives inside directives causes binding issues

:We're using Angular and we're having trouble with resolving variables in directives.This fiddle shows our issue:Here's the full code: http://jsfiddle.net/VX5LE/65///data-translate should handle the translating of the useableButton textapp.directive('

Abstract Syntax Tree for this case?

:I am trying to create an abstract syntax Tree for the following 2 C/C++/Java code pieces:1) return j++-200*20-++A*72) return j++-200*20-A++*7Can someone please explain their difference when it comes to their AST? 1:return j++ - 200*20 - ++A*7 and retu

How to clone a prototype with property methods?

:I am using the Typed.React library which includes a method to extend one prototype definition with that of another:function extractPrototype(clazz) { var proto = {}; for (var key in clazz.prototype) { proto[key] = clazz.prototype[key]; }

Dynamic Bit Shifting / Unshifting

:i'd like to store multiple values of blocks into an integer in the same way as i can convert an ip into an int. My problem is that i need to do this for n blocks, not only 4. Also i need to specifiy the maximum value of each block, which is allways the

What is wrong with my attempts to mock a simple C++ method with googlemock?

:As per Patterns for unit testing a C++ method that makes a standard library call, I'm test-driving development of a network-abstracting class. In order to unit test code that makes standard C library calls (which I can't mock) to handle BSD sockets, I

How to define string parameters in C++ header file - Bridged with Swift?

:I have a Xcode project with Swift and C++ (with bridging header), and I am trying to create a function in C++ with 2 string parameters, and returning an array of integers back to Swift:.cpp file:int* example(string one, string two){ int test[3] = {7,2

Why isn't my UserControl keeping its initialization?

:I have a UserControl for which I think I'm initializing some of the members:// MyUserControl.csusing System;using System.Collections.Generic;using System.ComponentModel;using System.Drawing;using System.Data;using System.Linq;using System.Text;using Sys

Passing the weights argument to a regression function inside an R function

:I am trying to write an R function to run a weighted (optional) regressions, and I am having difficulties getting the weight variable to work. Here is a simplified version of the function.HC <- function(data, FUN, formula, tau = 0.5, weights = NULL){if(i

JavaScript: flatten an array without using reduce library

:I have a nested array named $scope.instruments, its contents are:collapsed:expanded:I also have an object:This object contains 2 arrays: AttributeID and SPAttributeRefID.Currently I am flattening the $scope.instruments array using reduce function:$scope.

Handling accents in Oracle from Python

:I have the following code: #!/usr/bin/python # coding=UTF-8import cx_Oracledef oracle_connection(user, passwd, host, port, service): oracle_con_details = user+'/'+passwd+'@'+host+':'+port+'/'+service try: oracle_connection = cx_Oracl

Unable to get posted array from jQuery

:I am trying to post a group of arrays using the jQuery post method, but I am having trouble getting the value of the arrays. How can I get the values of the array that I have sent?If somebody could help me i would be grateful....Here is what i have done:

Erasing vector.end() fails

:Why does using vector.erase(vector.end()) produces a Segmentation fault (core dumped)when using this code:#include #include using namespace std;void printMe(vector& v){ for(auto &i:v) cout<

javascript closure in a for loop [duplicate]

: Possible Duplicate:Javascript closure inside loops - simple practical exampleJavascript: closure of loop? so I would like the results to be 1,2,3 instead of 3,3,3. How do I set the context/scope so that the jobs are using the correctly scoped "i"?f

PHP SoapServer formatting

:I am new to SOAP and trying to format a SOAP response using PHP's SoapServer class.It might be useful to know that this is for an EWS Push Subscription callback service and that I am using the php-ews library. I have managed to subscribe to the EWS Push

display a javascript message before proceeding

:I have this code that is to fetch a particular item in the database after the user presses a button. If the item is found I would like to display a confirm message via javascript and I don't know how to show it.After obtaining the item from the database

Getting derived class name statically in python

:How can i implement the static method get_class_name() to get the expected results.I need to get the correct class name without instantiating. (I know this can be done with an instance). Python version is 2.6.class base_class(): @staticmethod def g

using javascript function call to play multiple swf files

:I'm using the following code to trigger the playing of a swf file when an image is clicked. It works great, but I want to have multiple swf files that are each triggered by diffent images.script language="JavaScript"> function getFlashMovieObje

 10641    1 2 3 4 5 6 7 8 9 10 Next Last