Find open handles in a Windows program

In Windows (MinGW), my program is inheriting unwanted handles from the calling process. The process has no need to have these files open, but because it lives on beyond the lifetime of the parent I get the usual problems with files being held open. O

Table scope in the PHP foreach loop

I am learning PHP and have been agonizing over how to write my code properly. I have a textarea that accepts user input which is several lines of coordinates (PT# Northing Easting) separated by spaces. I have the form pass the textarea input to a php

The '_id' column does not exist ** Error **

DB handel package sh.mkt; import android.content.Context; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; import android.database.sqlite.SQLiteDatabase.CursorFactory; public class handle extends SQLiteO

Get the file name of Edit Text in Matlab?

I want to write the file name in the gui edit text and save edit text as my filename. Than I could be able to save filename as I wish. For instance; My file is an Neural network file which could be save as *.mat file; here is my code %network_name is

How do I select the first line with MAX (column value)?

I want to select only one row from a table. This row holds the maximum number in the table. I have tried to use MAX Fun but it didn't work for me. I use two tables to run my query, the first query returns more than one row SELECT Rec_No FROM Records

How to view the contents of the text box, in a div preview?

I am trying to display the value in a textarea in a div on keyup. I am having trouble displaying the line breaks. The text in my preview div appears inline. I tried to use replace and replaced the '/n' with ' ' but it just displayed everything inline

How to reset a custom ID to 1 at the beginning of each month

I have an ID that I create in both the vb app and SQL Server that has a format of MM/YYYY/## where the #'s are a integer. The integer is incremented by 1 through out the month as users generate forms so currently it is 08/2013/39. The code I

Javafx reverse multiplication table

for this application, I need to enter a number and display the numbers that when multiplied together will give you the number in question. For example, if you enter 42 then the labels for 6*7 and 7*6 would change color. I figured out how to get the a

In bash & mdash; return value of the storage method

I'm trying to store a value returned from a method like this: var=$(methodName), but the program never enters the method... It's weird because I do the same thing a few lines earlier (alreadyExists-variable in code sample), and it works fine. I had t

Get the neighboring streets of the mapping service

I am looking for an API (Free or Paid) that will allow me to either enter a street or coordinates with a radius, and get nearby street names. All I have found to do this is GeoNames, but the radius isn't nearly big enough. I need about 10 miles, whil

Why does my regex not work with BeautifulSoup?

I am parsing an HTML file and would like to match everything between two sequences of characters: Sent: and the <br> tag. I have seen several very similar questions and tried all of their methods and none have worked for me, probably because I'm a n

Dynamic array names in jQuery

This question already has an answer here: Use dynamic variable names in JavaScript 11 answers I have an array that holds several values. I have several other areas, each with a different number instead of the var u3s0A = ["Ques De Ti", "Enc

MVC Form post Html.BeginForm View ASPX

This question might be very simple to many of you, but I am just learning. Trying to convert form to Html.BeginForm The old script is <form method="POST" name="myquiz"> Trying to convert it to <% Html.BeginForm(new {name="

remove whites from strsplit in R

> dc1 V1 V2 1 20140211-0100 |Box 2 20140211-1782 |Office|Ball 3 20140211-1783 |Office 4 20140211-1784 |Office 5 20140221-0756 |Box 6 20140203-0418 |Box > strsplit(as.character(dc1[,2]),"^\\|") [[1]] [1] "" "Box" [[2]] [

Removing words from R

How do I delete multiple words and empty lines? I am importing a large text file into R using readLines. it is composed of 10,000+ pages. Ultimately I am trying to create a data frame. Each page has the following two lines which I would like to remov

Is Acartengine ready for real-time graphics?

I'm trying to graph some real-time data, "realtime" here means < 10msec data, ideally as low as possible. I've been able to get Android to fetch and process data this fast but ACE just looks like it's not been designed for real-time use in mi

Background color without div

How can I extend background color outside div? My code: .content-right{ background-color: blue; padding: 40px; position: relative; } .content-right:after{ position: absolute; top: 0; right: calc(1px - 100%); width: 100%; height: 100%; background-colo

xpath ignores the node

I'm looking for a way to select a node in xpath, giving that a node on it's path may exist or not. Just like '?' works in regexp ;) For instance, I'd like to figure out a xpath query to get to <td> regardless of the case whether <tbody> node e

The task and the background life cycle of Android

I'm currently working on an app that connects to a bluetooth device and receives a message every .25 seconds, then displays that data on screen. The user will also be able to arbitrarily start/stop logging this data to a file on the SD card. I have t

Dynamic SQL in production systems

SO has plenty of Q&As about how to accomplish various tasks using dynamic SQL, frequently the responses are accompanied with warnings and disclaimers about the advisability of actually using the approach provided. I've worked in environments ranging

javascript double-click problem

I have a slideshow which has quick links to the specific slides. The slideshow then continues from that point. The trouble is if I double click on a quick link - when the slideshow continues it skips a slide (if I treble click it skips 2). I think it

How to send this image to the front and set the bg on black

I have a function of button call the Id image . When the page is loading I want to let a background div image to can not click and image send to front of all the div. What style should I add ? <span id="divImage" style="display:none;&quo

How to record a non-overlapping range in DynamoDB

Suppose I want to store some entities in DynamoDB, and each entity is defined by 3 crucial attributes: group_id [string] : the id of the group the entity belongs to. from [int] : the start of the range (inclusive). to [int] : the end of the range (in

PHP code to generate a secure URL?

We need to generate a unique URL from the title of a book - where the title can contain any character. How can we search-replace all the 'invalid' characters so that a valid and neat lookoing URL is generated? For instance: "The Great Book of PHP&quo

Can I use Mercury Editor without a specific page controller?

I want to use Mercury Editor ( to edit posts in the blog area of my RoR application. I don't have any Pages model, I just want to edit posts and not all the site's pages. In my routes.rb: resources :posts do membe