rjs

1

votes
2

answer
608

views

Stream.CopyTo throws System.OutOfMemoryException C#

I am trying to load a large video file (250mb) into my browser. The file is large so I am trying to load a certain number of bytes at a time, but it appears the problem lies somewhere else as I have tried changing the bufferSize with no results. MemoryStream ms = new MemoryStream(); using (FileStrea...
RJS
1

votes
1

answer
105

views

Can you launch a application page from a background task in WP7

I've got a periodic task, how can i launch a page from the period task?
rjs
1

votes
1

answer
457

views

Accessing files outside of Isolated Storage in WP7 Mango

Is it possible for a WP7 Silverlight application to access files outside of it's isolated storage? I know an application can't access another application's isolated storage but would it be possible to access shared files ?
rjs
1

votes
1

answer
1.7k

views

using square root function (sqrt) with doubles in OpenCL

I've got a kernel which uses the OpenCL builtin square root function (sqrt) but when I try to run the kernel on the GPU I get a unrecognized command error when building, it works fine if i use floats but when using doubles it does not work. I'm running on a Mac OS X 10.7.5 and my Graphics Card is a...
rjs
1

votes
1

answer
532

views

Taking multiple samples from dataset in R

My problem is I have to take multiple samples from a dataset to do multiple linear regressions using the resulting samples. Using the code below I can get one sample at a time, but I would like to do it much more efficiently. mysample
RJS
0

votes
0

answer
3

views

Apache 2 can't find python packages under Django project directory

I am running Apache2 and Django in a Ubuntu Docker container. Apache can find and is trying to run the Django project but cannot find the python packages contained in under the project directory. It is returning an Import error. See attached picture. Django error message ImportError at / Missing req...
rjs
1

votes
1

answer
90

views

Reading text file into dic file results in incomplete dic file

The following file 2016_01_22_Reps.txt is a list of expanded contractions that I want to put into a python dic file; “can't':'cannot','could've':'could have','could've':'could have','didn't':'did not','doesn't':'does not', “don't':'do not',' hadn't':'had not', 'hasn't':'has not','haven't':'ha...
RJS
1

votes
2

answer
207

views

python 3.5 no print output to screen

Using Python 3.5 I have created code to process a file and write output to another file. Following is relevant code; with open('2016_01_22_Investor_Companies_stops.txt','r') as stops_Investor_Companies: stops_Investor_Companies = stops_Investor_Companies.read() stops_Investor_Companies = nltk.word_...
RJS
1

votes
1

answer
4.2k

views

How to check if polygon is convex? [duplicate]

Possible Duplicate: How do determine if a polygon is complex/convex/nonconvex? I'd like to know how you would check if a polygon is convex or not. One apparent way of doing it is to run a convex hull algorithm. If the number of points in the convex hull is the same as the number of points in the p...
rjs
1

votes
2

answer
105

views

Changing running program behavior with shell commands [closed]

I'm writing a wallpaper manager in Python. I'm targeting this project for Linux and want to make the script easy to slip into autostart files (such as .xinitrc, et. al.). I'm hoping to implement a host of functionality that can be generated by typing commands such as... --reject (load new wallpaper,...
rjs
11

votes
1

answer
202

views

Haskell - Evaluation of (+) <$> (+3) <*> (*100) $ 5

From the chapter on Functors in Learn You a Haskell for Great Good, Lipovača states: 'When we do (+) (+3) (*100), we're making a function that will use + on the results of (+3) and (*100) and return that. To demonstrate on a real example, when we did (+) (+3) (*100) $ 5, the 5 first got applied...
RJS
5

votes
2

answer
6.4k

views

best way in linux to get usb device added notifications in c

what Linux library should i use to get asynchronous notifications of added usb devices? I'd like my program to work on any Linux device so I'll need to use a library that isn't specific to one Linux version
rjs
1

votes
1

answer
2.2k

views

Running Python Script from PowerShell Syntax Error

Following is a summary of the problem along with relevant info about OS, System Environment Variables. Upon starting PowerShell, screen shows Windows Powershell Copyright © 2009 Microsoft Corporation PS C:\Users> My Input is: Python Output is: Python 2.7.4 default Apr 8 2013 19:54:46) [MSC v....
RJS
2

votes
1

answer
1.4k

views

Applying derivative operation on Signal in Matlab

I've been given the formula below to apply to a signal. I'm not sure how to plug this into Matlab, can anyone explain? y(n) =1/8[2x(n) + x(n − 1) − x(n − 3) − 2x(n − 4)]
rjs
1

votes
1

answer
1.5k

views

SonarQube 6.2 - Export issues

I am using the latest SonarQube 6.2. They have moved out the reporting module into a commercial governance module. Now I cannot find any way to export the issues into some report, or filter the issues based on set of classes. The File filter provided on Issues page, is not providing the full list o...
RJS
1

votes
1

answer
218

views

What is the 'l' for in strlcpy?

What does the 'l' in strlcpy stand for? I'm certain after asking it will be horribly obvious but I can't seem to dredge up a solid answer anywhere.
RJS
1

votes
2

answer
23.7k

views

Low Pass Filter Matlab

Is there a way in matlab to create a low pass filter, I know i can use the filter function but not sure how to use it, I've been given the following formula for my low pass H(z) = 1 (1 - z^-4)^2 / 16 (1 - z^-1)^2 with a 20Hz cutoff frequency
rjs
2

votes
1

answer
195

views

AWS g2.8xlarge performance and out of memory issues when using tensorflow

I am currently training a recurrent net on Tensorflow for a text classification problem and am running into performance and out of memory issues. I am on AWS g2.8xlarge with Ubuntu 14.04, and a recent nightly build of tensorflow (which I downloaded on Aug 25). 1) Performance issue: On the surface, b...
RJS
5

votes
1

answer
3.8k

views

Application vs middleware development in Android [closed]

I have 1 year and 6 months of experience on Android. All of my experience has been into application development. Recently I have got offers from two companies. One is offering me a profile to work on application layer and other is offering a profile on Android middleware. Can you guide me which wou...
rjs
4

votes
2

answer
348

views

Ensuring Recursive Functions With Multiple Returns “Preserve” Desired Results

Consider this code (quoted from geeksforgeeks.org, author Tushar Roy) which calculates true or false if the path from a root to a leaf has keys that sum to a specified value: bool hasPathSum(struct node* node, int sum) { /* return true if we run out of tree and sum==0 */ if (node == NULL) { return (...
RJS
2

votes
2

answer
248

views

Python 'pointer arithmetic' - Quicksort

In idiomatic C fashion, one can implement quicksort in a simple way with two arguments: void quicksort(int inputArray[], int numelems); We can safely use two arguments for later subdivisions (i.e. the partitions, as they're commonly called) via pointer arithmetic: //later on in our quicksort routine...
RJS
3

votes
5

answer
116

views

Get digit from filename immediately preceeding file extension, with other digits in filename

I'm trying to extract the last number before a file extension in a bash script. So the format varies but it'll be some combination of numbers and letters, and the last character will always be a digit. I need to pull those digits and store them in a variable. The format is generally: sdflkej10_sdlk...
RJS
4

votes
1

answer
2.3k

views

Are heuristic functions that produce negative values inadmissible?

As far as I understand, admissibility for a heuristic is staying within bounds of the 'actual cost to distance' for a given, evaluated node. I've had to design some heuristics for an A* solution search on state-spaces and have received a lot of positive efficiency using a heuristic that may sometime...
RJS
4

votes
2

answer
73

views

Passing an array to a function with an odd format - “v+last+1”

In The Practice Of Programming, on the chapter regarding quicksort, there is some C code that walks through a basic algorithm for quicksort (I've compiled the code into a program that prints the arbitrary array values pre and post sorting): #include #include void swap(int v[], int i, int j) { int te...
RJS
8

votes
2

answer
15.8k

views

How to get coordinates of an object in OpenGL

I want to be able to get the coordinates of an object (e.g. triangle) after it's been translated and rotated, the reason i want to do this is so that later i can do collision detection and calculate the distance between objects using the coordinates. I think I might have to use gluProject but not su...
rjs
6

votes
1

answer
1.5k

views

Why should a production Kubernetes cluster have a minimum of three nodes? [closed]

The first section of the official Kubernetes tutorial states that, A Kubernetes cluster that handles production traffic should have a minimum of three nodes. but gives no rationale for why three is preferred. Is three desirable over two in order to avoid a split-brain scenario, to merely allow for g...
RJS
2

votes
1

answer
10.1k

views

File Descriptor 0

Drawing from this thread discussing file descriptors and tables; I want to know how stdin (that is, file descriptor 0, not C's stdin FILE structure) is handled within shells. When I run a piece of code like read(0, buffer, 1024) in C, which by default in C file descriptor 0 is connected to keyboard,...
RJS
3

votes
2

answer
467

views

RHEL jdk-8u20-linux-x64.tar.gz 1.8 acting like 32bit

I'm setting up a new machine. I did inadvertently install the 32-bit java first but I have blown that away and I have installed jdk-8u20-linux-x64.tar.gz (also used the RPM). This machine has 132G or memory but I suspect I'm starting a 32 bit java app because it always runs out or memory at the same...
rjs
3

votes
1

answer
195

views

Which WCF services can you add a service reference to in WP7 Mango?

Just need to know when adding a service reference to a WCF service in a mango silverlight project which types of WCF services (webHttpBinding, WSBinding etc) will visual studio generate a proxy for automatically?
rjs