search for: start_index

Displaying 20 results from an estimated 43 matches for "start_index".

2007 Oct 31
0
2 commits - libswfdec/swfdec_sound.c libswfdec/swfdec_text_field_movie_as.c libswfdec/swfdec_text_field_movie.c libswfdec/swfdec_text_field_movie_html.c
...ibswfdec/swfdec_text_field_movie.c +++ b/libswfdec/swfdec_text_field_movie.c @@ -1033,7 +1033,7 @@ swfdec_text_field_movie_set_text_format (SwfdecTextFieldMovie *text, g_return_if_fail (SWFDEC_IS_TEXT_FIELD_MOVIE (text)); g_return_if_fail (SWFDEC_IS_TEXT_FORMAT (format)); g_return_if_fail (start_index < end_index); - g_return_if_fail (end_index <= (guint) g_utf8_strlen (text->input->str, -1)); + g_return_if_fail (end_index <= text->input->len); g_assert (text->formats != NULL); g_assert (text->formats->data != NULL); @@ -1051,7 +1051,7 @@ swfdec_text_field...
2007 Oct 22
0
5 commits - libswfdec/swfdec_html_parser.c libswfdec/swfdec_text_field_movie_as.c libswfdec/swfdec_text_field_movie.c test/trace
...a/libswfdec/swfdec_text_field_movie.c b/libswfdec/swfdec_text_field_movie.c index df76d49..ef8f2ce 100644 --- a/libswfdec/swfdec_text_field_movie.c +++ b/libswfdec/swfdec_text_field_movie.c @@ -1544,7 +1544,14 @@ swfdec_text_field_movie_replace_text (SwfdecTextFieldMovie *text, g_return_if_fail (start_index <= end_index); g_return_if_fail (str != NULL); - text->input = g_string_insert (text->input, start_index, str); + text->input = g_string_erase (text->input, + g_utf8_offset_to_pointer (text->input->str, start_index) - + text->input->str, + g_utf8_off...
2008 Jan 07
0
3 commits - libswfdec-gtk/swfdec_gtk_loader.c libswfdec/swfdec_as_array.c libswfdec/swfdec_asbroadcaster.c libswfdec/swfdec_as_function.c libswfdec/swfdec_as_types.c libswfdec/swfdec_xml.c
...with swfdec_as_integer_to_string where appropriate diff --git a/libswfdec/swfdec_as_array.c b/libswfdec/swfdec_as_array.c index 61a62e9..f28170c 100644 --- a/libswfdec/swfdec_as_array.c +++ b/libswfdec/swfdec_as_array.c @@ -182,7 +182,7 @@ swfdec_as_array_remove_range (SwfdecAsArray *array, gint32 start_index, // to avoid foreach loop, use special case when removing just one variable if (num == 1) { swfdec_as_object_delete_variable (object, - swfdec_as_double_to_string (object->context, start_index)); + swfdec_as_integer_to_string (object->context, start_index)); } else { Foreac...
2011 Apr 29
1
RCurl and postForm()
...ollowing using curl from the command line: $ curl -d "Archbishop Huxley" "http://www.datasciencetoolkit.org/text2people" [{"gender":"u","first_name":"","title":"archbishop","surnames":"Huxley","start_index":0,"end_index":17,"matched_string":"Archbishop Huxley"}] Trying the same thing, or what I *think* is the same thing (obvious not) in R (Mac OS 10.6.7, R 2.13.0) produces: > library(RCurl) Loading required package: bitops > api <- "http://www.datasc...
2007 Aug 17
0
2 commits - libswfdec/swfdec_as_array.c test/trace
...h_remove_range (SwfdecAsObject *object, const char *variable, SwfdecAsValue *value, guint flags, gpointer data) { ForeachRemoveRangeData *fdata = data; @@ -122,7 +134,8 @@ static gboolean swfdec_as_array_foreach_ } static void -swfdec_as_array_remove_range (SwfdecAsArray *array, gint32 start_index, gint32 num) +swfdec_as_array_remove_range (SwfdecAsArray *array, gint32 start_index, + gint32 num) { SwfdecAsObject *object = SWFDEC_AS_OBJECT (array); @@ -140,7 +153,8 @@ swfdec_as_array_remove_range (SwfdecAsAr swfdec_as_object_delete_variable (object, var); } else { Foreac...
2007 Jan 30
3
How to find series of small numbers in a big vector?
...900, 0.024, 0.029, 0.023, 0.025, 0.026, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.022, 0.023, 0.025, 0.333, 0.027, 0.028, 0.900, 0.900, 0.900, 0.900, 0.900) I seek the R program to report: start_index of 12 and an end_index of 16 -- and also -- start_index of 23 and an end_index of 27 because that is were there happens to be search_length numbers within my search_range. It should _not_ report the series at start_index 40 because that 0.333 in there violates the search_range. I could brute-forc...
2009 Jun 01
2
find_vqs operation starting at arbitrary index
...s operation doesn't allow for a vq to be found at an arbitrary location; it's meant to be called once at startup to find all possible queues and never called again. This doesn't work for devices which can have queues hot-plugged at run-time. This can be made to work by passing the 'start_index' value as was done earlier for find_vq, but I doubt something like the following will work. The MSI vectors might need some changing as well. If this indeed is the right way to do it, I can add a virtio_find_vqs helper along similar lines as virtio_find_single_vq and pass '0' as the s...
2009 Jun 01
2
find_vqs operation starting at arbitrary index
...s operation doesn't allow for a vq to be found at an arbitrary location; it's meant to be called once at startup to find all possible queues and never called again. This doesn't work for devices which can have queues hot-plugged at run-time. This can be made to work by passing the 'start_index' value as was done earlier for find_vq, but I doubt something like the following will work. The MSI vectors might need some changing as well. If this indeed is the right way to do it, I can add a virtio_find_vqs helper along similar lines as virtio_find_single_vq and pass '0' as the s...
2011 Oct 15
2
function for handling time
Dear all I have the following time stamps (in the following format) MeasurementSet$TimeStamps        [,1] [,2] [,3] [,4] [,5]   [,6]   [1,] 2011    7    2   13   43 48.718   [2,] 2011    7    2   13   43 54.281   [3,] 2011    7    2   13   43 59.843   [4,] 2011    7    2   13   44  5.390   [5,] 2011    7    2   13   44 10.859   [6,] 2011    7    2   13   44 16.375   [7,] 2011    7    2   13   44
2007 Aug 17
0
Branch 'vivi' - 9 commits - libswfdec/swfdec_as_array.c libswfdec/swfdec_as_function.c libswfdec/swfdec_as_function.h libswfdec/swfdec_as_internal.h libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_native_function.c
...h_remove_range (SwfdecAsObject *object, const char *variable, SwfdecAsValue *value, guint flags, gpointer data) { ForeachRemoveRangeData *fdata = data; @@ -122,7 +134,8 @@ static gboolean swfdec_as_array_foreach_ } static void -swfdec_as_array_remove_range (SwfdecAsArray *array, gint32 start_index, gint32 num) +swfdec_as_array_remove_range (SwfdecAsArray *array, gint32 start_index, + gint32 num) { SwfdecAsObject *object = SWFDEC_AS_OBJECT (array); @@ -140,7 +153,8 @@ swfdec_as_array_remove_range (SwfdecAsAr swfdec_as_object_delete_variable (object, var); } else { Foreac...
2007 Nov 07
0
2 commits - libswfdec/swfdec_resource.c libswfdec/swfdec_text_field_movie.c
.../swfdec_text_field_movie.c b/libswfdec/swfdec_text_field_movie.c index 3668346..043efec 100644 --- a/libswfdec/swfdec_text_field_movie.c +++ b/libswfdec/swfdec_text_field_movie.c @@ -137,7 +137,12 @@ swfdec_text_field_movie_generate_paragraph (SwfdecTextFieldMovie *text, paragraph->index_ = start_index; paragraph->length = length; - paragraph->newline = (text->input->str[start_index + length - 1] == '\n'); + if (text->input->str[start_index + length - 1] == '\n' || + text->input->str[start_index + length - 1] == '\r') { + paragraph->...
2007 Jul 21
0
12 commits - configure.ac doc/Makefile.am doc/swfdec-sections.txt libswfdec/jpeg libswfdec/swfdec_as_array.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_strings.c libswfdec/swfdec_player.c libswfdec/swfdec_player.h libswfdec/swfdec_player_internal.h
...lue *value, guint flags, gpointer data) { ForeachRemoveRangeData *fdata = data; - gint32 index; + gint32 idx; - index = swfdec_as_array_to_index (variable); - if (index == -1) + idx = swfdec_as_array_to_index (variable); + if (idx == -1) return FALSE; - if (index >= fdata->start_index && index < fdata->start_index + fdata->num) + if (idx >= fdata->start_index && idx < fdata->start_index + fdata->num) return TRUE; return FALSE; @@ -155,16 +155,16 @@ swfdec_as_array_foreach_move_range (Swfd SwfdecAsValue *value, guint flags,...
2007 Oct 22
0
12 commits - libswfdec/swfdec_as_strings.c libswfdec/swfdec_html_parser.c libswfdec/swfdec_text_field.c libswfdec/swfdec_text_field.h libswfdec/swfdec_text_field_movie_as.c libswfdec/swfdec_text_field_movie.c libswfdec/swfdec_text_field_movie.h test/trace
...c7371d 100644 --- a/libswfdec/swfdec_text_field_movie.h +++ b/libswfdec/swfdec_text_field_movie.h @@ -133,6 +133,7 @@ void swfdec_text_field_movie_set_text_format (SwfdecTextFieldMovie * text, SwfdecTextFormat *swfdec_text_field_movie_get_text_format (SwfdecTextFieldMovie * text, guint start_index, guint end_index); +const char * swfdec_text_field_movie_get_text (SwfdecTextFieldMovie * text); const char * swfdec_text_field_movie_get_html_text (SwfdecTextFieldMovie * text); void swfdec_text_field_movie_set_listen_variable (SwfdecTextFieldMovie * text, const char * v...
2007 Oct 17
0
libswfdec/swfdec_text_field.c libswfdec/swfdec_text_field.h libswfdec/swfdec_text_field_movie.c
...255); - color = swfdec_color_apply_transform (color, trans); - pcolor.red = SWFDEC_COLOR_R (color) << 8; - pcolor.green = SWFDEC_COLOR_G (color) << 8; - pcolor.blue = SWFDEC_COLOR_B (color) << 8; - ((PangoAttrColor *)attr)->color = pcolor; - } - attr->start_index = (attr->start_index > block->index_ + skip ? - attr->start_index - (block->index_ + skip) : 0); - attr->end_index = attr->end_index - (block->index_ + skip); - pango_attr_list_insert (attr_list, attr); - } - pango_layout_set_attributes (playout, attr_list); - pang...
2011 Feb 20
7
Using Nokogiri to insert a <span> tag into existing text
All, I''m using Nokogiri to handle the following problem: I have a piece of HTML, and for certain text nodes, I need to insert <span> tags into the text of these nodes at a certain place. What I am doing is finding the place where I want to insert the <span>, let''s say index X of the text node''s text, and doing the following: 1) Setting the node''s
2007 Oct 13
0
5 commits - libswfdec/swfdec_html_parser.c libswfdec/swfdec_text_field.c libswfdec/swfdec_text_field_movie_as.c libswfdec/swfdec_text_field_movie.c libswfdec/swfdec_xml.c test/trace
..._spacing, *attr_size, *attr_underline; - // TODO: kerning + // TODO: kerning, display g_assert (SWFDEC_IS_TEXT_FIELD_MOVIE (text)); g_assert (paragraph != NULL); @@ -147,8 +147,7 @@ swfdec_text_field_movie_generate_paragra SWFDEC_COLOR_B (format->color) * 255); attr_color->start_index = 0; - if (text->text->embed_fonts) - SWFDEC_FIXME ("Using embed fonts in TextField not supported"); + // FIXME: embed fonts attr_font = pango_attr_family_new (format->font); attr_font->start_index = 0; @@ -213,8 +212,7 @@ swfdec_text_field_movie_generate_paragr...
2007 Oct 25
0
12 commits - libswfdec/swfdec_as_internal.h libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_object.c libswfdec/swfdec_text_field_movie_as.c libswfdec/swfdec_text_field_movie.c test/trace
...d_movie.c +++ b/libswfdec/swfdec_text_field_movie.c @@ -1566,15 +1566,6 @@ swfdec_text_field_movie_replace_text (SwfdecTextFieldMovie *text, if (text->style_sheet_input) return; - text->input = g_string_erase (text->input, - g_utf8_offset_to_pointer (text->input->str, start_index) - - text->input->str, - g_utf8_offset_to_pointer (text->input->str, end_index) - - g_utf8_offset_to_pointer (text->input->str, start_index)); - text->input = g_string_insert (text->input, - g_utf8_offset_to_pointer (text->input->str, start_index)...
2007 Oct 29
0
20 commits - libswfdec/Makefile.am libswfdec/swfdec_as_interpret.c libswfdec/swfdec_html_parser.c libswfdec/swfdec_initialize.as libswfdec/swfdec_initialize.h libswfdec/swfdec_text_field.c libswfdec/swfdec_text_field.h
...a/libswfdec/swfdec_text_field_movie.c +++ b/libswfdec/swfdec_text_field_movie.c @@ -102,7 +102,7 @@ swfdec_text_paragraph_add_block (SwfdecParagraph *paragraph, int index_, static void swfdec_text_field_movie_generate_paragraph (SwfdecTextFieldMovie *text, - SwfdecParagraph *paragraph, guint start_index, guint end_index) + SwfdecParagraph *paragraph, guint start_index, guint length) { SwfdecTextFormat *format, *format_prev; guint index_; @@ -113,18 +113,14 @@ swfdec_text_field_movie_generate_paragraph (SwfdecTextFieldMovie *text, g_assert (SWFDEC_IS_TEXT_FIELD_MOVIE (text)); g_as...
2007 Oct 25
0
6 commits - libswfdec/swfdec_as_interpret.c libswfdec/swfdec_event.c libswfdec/swfdec_event.h libswfdec/swfdec_movie.c libswfdec/swfdec_movie.h libswfdec/swfdec_player.c libswfdec/swfdec_player_internal.h libswfdec/swfdec_resource.c
...ibswfdec/swfdec_text_field_movie.c +++ b/libswfdec/swfdec_text_field_movie.c @@ -1030,7 +1030,7 @@ swfdec_text_field_movie_set_text_format (SwfdecTextFieldMovie *text, g_return_if_fail (SWFDEC_IS_TEXT_FIELD_MOVIE (text)); g_return_if_fail (SWFDEC_IS_TEXT_FORMAT (format)); g_return_if_fail (start_index < end_index); - g_return_if_fail (end_index <= g_utf8_strlen (text->input->str, -1)); + g_return_if_fail (end_index <= (guint) g_utf8_strlen (text->input->str, -1)); g_assert (text->formats != NULL); g_assert (text->formats->data != NULL); @@ -1110,7 +1110,7...
2007 Nov 04
0
7 commits - libswfdec/swfdec_text_field_movie.c libswfdec/swfdec_text_field_movie.h libswfdec/swfdec_text_field_movie_html.c
...c/swfdec_text_field_movie.c b/libswfdec/swfdec_text_field_movie.c index 36b3596..08afd73 100644 --- a/libswfdec/swfdec_text_field_movie.c +++ b/libswfdec/swfdec_text_field_movie.c @@ -136,6 +136,7 @@ swfdec_text_field_movie_generate_paragraph (SwfdecTextFieldMovie *text, paragraph->index_ = start_index; paragraph->length = length; + paragraph->newline = (text->input->str[start_index + length - 1] == '\n'); paragraph->blocks = NULL; paragraph->attrs = NULL; @@ -519,6 +520,7 @@ swfdec_text_field_movie_get_layouts (SwfdecTextFieldMovie *text, int *num, Sw...