Questions tagged [segments]

segments are divisible parts of something usually associated:

  • in programing with memory segmentation (memory pages, or array/table/file division)
  • in Graphics with polyline/polygon parts or any visual division of objects (like hatching,grids,...)
  • in HW architectures,linkers,compilers with separate memory/code areas for program,data,stack...
138 questions
46
votes
4 answers

Do .bss section zero initialized variables occupy space in elf file?

If I understand correctly, the .bss section in ELF files is used to allocate space for zero-initialized variables. Our tool chain produces ELF files, hence my question: does the .bss section actually have to contain all those zeroes? It seems such…
Wouter Lievens
  • 4,019
  • 5
  • 41
  • 66
13
votes
3 answers

Segment a list in Python

I am looking for an python inbuilt function (or mechanism) to segment a list into required segment lengths (without mutating the input list). Here is the code I already have: >>> def split_list(list, seg_length): ... inlist = list[:] ... …
kjfletch
  • 5,394
  • 3
  • 32
  • 38
11
votes
2 answers

segments within a executable C program

I was reading about sections and segments. Seems you could list the mapping between sections and segments as below. $ readelf -l test Elf file type is EXEC (Executable file) Entry point 0x8048330 There are 9 program headers, starting at offset…
John Eipe
  • 10,922
  • 24
  • 72
  • 114
10
votes
1 answer

How to put 2 sections in 1 segment (Using ld scripts)

I have the following linker script: SECTIONS { .arora_exec_free_space 4399531 : { *(.text) *(.rodata) *(.data.rel.ro.local) } .arora_data_free_space (ADDR(.arora_exec_free_space) +…
Jah
  • 1,019
  • 1
  • 11
  • 25
6
votes
1 answer

Algorithm to find the closest segment to a point among many segments (Reverse Geocoding)

I have a set of segments defined by two points. Given a point how can I discover the closest segment to such point? I have already written an algorithm that computes the distance between a point and a segment. Anyway calculating such distance for…
Giorgio
  • 13,129
  • 12
  • 48
  • 75
6
votes
2 answers

Find pairwise overlaps of intervals (segments)

We are given two sets of intervals A and B. By an interval, I mean an ordered pair of integers such as c(2,5). I want to find all pairs of intervals - one from A and one from B - that have overlap. For instance if A and B are as…
Ali
  • 9,440
  • 12
  • 62
  • 92
6
votes
1 answer

C++ procedure for determining whether two segments intersect

I'm working a bit with computational geometry lately, and I am trying to find a way of checking whether two line segments intersect. I thought that I can use counterclockwise direction (CCW for short) to determine that. Here is my code so…
5
votes
2 answers

What is required to use LODSB in assembly?

What is the minimum set of steps required to use LODSB to load a relative address to a string in my code? I have the following test program that I'm using PXE to boot. I boot it two ways: via pxelinux.0 and directly. If I boot it directly, my…
Harvey
  • 5,703
  • 1
  • 32
  • 41
5
votes
1 answer

Adding a dynamically positioned watermark to a video via ffmpeg

I'm trying to add a watermark to a video by using ffmpeg. But there is one requiment which makes that very difficult to me to understand how to make it, I searched over the web of cource. So, I need the watermark being change its position every 20…
Lena Borieva
  • 51
  • 1
  • 2
5
votes
1 answer

How to plot interrupted horizontal lines (segments) in matplotlib in a "cheap way" without using NaNs?

I have to plot several "curves", each one composed by horizontal segments (or even points), using matplotlib library. I reached this goal separing the segments by NaNs. This is my example (working) code: from pylab import arange, randint, hold,…
iacopo
  • 663
  • 1
  • 7
  • 22
4
votes
2 answers

Increasing the performance of visualising overlapping segments

I have a set of pairs of x points to draw segments along the x axis to create a custom read map in R: Half the task of plotting these segments is deciding their y positions so that no two segments that overlap are on the same y level. For each…
MattLBeck
  • 5,701
  • 7
  • 40
  • 56
4
votes
1 answer

how to get url segments count in laravel 5?

I have following Route, http:/localhost/seg1/seg2/seg3 how to get Request::segment count from the url above ? Expected result is, $totalSegsCount = 3 Thanks,
4
votes
0 answers

Relabeling overlapping segments located in adjacent numpy 2-d blocks (without for-loops)

I have a numpy 2-d array which I divided in several numpy 2-d blocks. All blocks have the same shape. On these blocks I performed K-means segementation using the scikit-learn module. The edges of each block are overlapping (each block has one…
Wilmar van Ommeren
  • 7,469
  • 6
  • 34
  • 65
4
votes
1 answer

ljmp syntax in gcc inline assembly

I was thinking of using a far jump to set the code segment (CS) register. Getting into why I'm doing this and why I'm dealing with segmentation at all would take a while, so bear with me and consider it an academic exercise. I can't seem to get the…
Duc
  • 487
  • 1
  • 7
  • 15
4
votes
7 answers

Local initial values are stored at?

#include int main() { int i = 10; return 0; } In the above program, where exactly the value 10 is stored ? I understand the variable i is stored in the stack. stack is populated during run time. From "where exactly" 10 is coming…
kumar
  • 2,530
  • 6
  • 33
  • 57
1
2 3
9 10