segment

Does java allow you to grab a segment of an array?

Hi all, I'm looking for a method that will return a section or segment of an array - like if I wanted only the 4th and 5th bytes of a byte array. I don't want to have to create a new byte array in the heap memory just to do that. Right now I have the following code: doSomethingWithTwoBytes(byte[] twoByteArray); void someMethod(byte[...

Optimal solution for non-overlapping maximum scoring sequences

While developing part of a simulator I came across the following problem. Consider a string of length N, and M substrings of this string with a non-negative score assigned to each of them. Of particular interest are the sets of substrings that meet the following requirements: They do not overlap. Their total score (by sum, for simplici...

Shared memory access without semaphores

Hi All, using shared memory apis in linux, If I have one write(by A process) and only one read( by B process) do I still need semaphore.?. Is there a example to show, using sharing memory without semaphore will get into deadlock state in linux. ...

Line Segments from a point

I have a point p, and 2 line segments in a 2D plane. Point p is a location of view from where camera is looking towards the line segments. I want to check if line segment 1 is partially or fully hidden behind the line 2, when looking from the point P. ...

Anyone know an example algorithm for word segmentation using dynamic programming?

If you search google for word segmentation there really are no very good descriptions of it and I'm just trying to fully understand the process a dynamic programming algorithm takes to find a segmentation of a string into individual words. Does anyone know a place where there is a good description of a word segmentation problem or can a...

Is it possible to stream Matroska files?

So I want to broadcast .mkv file. I'm going to broadcast live video. So I need to know is it possible (anyhow) to read unfinished .mkv files? Because i know that Matroska is xml and you simply will not be able to read unfinished xml. Update: now I know - it is possible to read unfinished XML. But it does not solve the question if it is ...

What's the right way to define an anchor tag in rails?

It's obvious from the documentation (and google) how to generate a link with a segment e.g. podcast/5#comments. You just pass a value for :anchor to link_to. My concern is about the much simpler task of generating the <a name="comments">Comments</a> tag i.e. the destination of the first link. I've tried the following, and although the...

Find the first point along a heading that is a specified distance away from a line segment.

Hi, Given a starting point, a heading, a distance, and a line segment, find the first point along this heading that is the specified distance away from this line segment. I covered two cases, but I haven't been able to cover the last one. First case: heading away from the line. Ignore it even if the starting point is within the specifie...

How do I use gstreamer to make an audio clip from a segment of a longer source?

I would like to use gstreamer to save an arbitrary clip from one audio file to a new file. For example, a segment from 1 minute to 2 minutes in the original. How do I do it? ...

.NET 3.5 C# TcpClient Reading Issues (Segment loss)

...

WPF, convert Path.DataProperty to Segment objects

I was wondering if there was a tool to convert a path data like "M 0 0 l 10 10" to it's equivalent line/curve segment code. Currently I'm using: string pathXaml = "<Path xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\" xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\" Data=\"M 0 0 l 10 10\"/>"; Path path = (Pa...

URL routing in an MVC framework - PHP

I'm developing an MVC framework in PHP from scratch; mostly for the learning experience but this could easily end up in a live project. I went through this tutorial as a base and I've expanded from there. Requests are made like this: examplesite.com/controller/action/param1/param2/ and so on... And this is my .htaccess file: RewriteE...

What is the segment in Lucene ?

I don't understand , what are the segments in Lucene ? What are the benefits of Lucene's segments? Thanks . ...

assembly: data segment when called from c or created as an independet programm

im confused about this i dont think that there should be any difference in both cases , the programm ends up as exe file please help if you think a differ.... ok let me clear my question . is there is a differece in the data segment defenition or handeling between when i create an assembly program 'stand alone' and when i call...

NSSegmentedControl -selectedSegment always returns 0

I have an NSSegmentedControl with two segments set to "Select None" mode in Interface Builder. No matter what I try, I can't get -selectedSegment to return anything but 0, even though segment 0 is even disabled by default and can't possibly be selected. Here's the relevant function that gets called when you click any segment on the contr...

How can I accept a hash mark in a URL via $_GET?

From what I have been able to understand, hash marks (#) aren't sent to the server, so it doesn't seem likely that I will be able to use raw PHP to parse data like in the URL below: index.php?name=Ben&address=101 S 10th St Suite #301 I'm looking to pre-populate form fields with this $_GET data. How would I do this with Javascript (or ...

Formula to determine if a line segment intersects a circle (flat)

Hi, Apologies if this is considered a repeat question, but the answers I've seen on here are too complex for my needs. I simply need to find out if a line segment intersects a circle. I don't need to find the distance to the line from the circle center, I don't need to solve for the points of intersection. The reason I need something...

Losing URI segments when paginating with CodeIgniter

I have a /payments interface where the user should be able to filter via price range, bank, and other stuff. Those filters are standard select boxes. When I submit the filter form, all the post data goes to another method called payments/search. That method performs the validation, saves the post values into a session flashdata and redir...

Can I replicate the IsStroked property for a PathSegment in Silverlight 4?

In WPF it is possible to use the IsStroked property of a PathSegment to make the Segment invisible, I'm looking for a way to replicate this behavior in Silverlight, which doesn't have this property. Is this possible? [EDIT] I'm looking for a way to do this in code-behind, not in Xaml. ...

How to refer to the start-of a user-defined segment in a Visual Studio-project?

Hi, I'm struggling to convert a C-program linked with ld, of the gnu tool-chain to make it compile as a visual-studio (2005) project. The program puts .data-symbols in different segments and during an initialization phase it copies data between segments. Pointers to the start and end of the segments are defined in the ld linker scri...