Search Results

Search found 251490 results on 10060 pages for 'integer overflow'.

Page 13/10060 | < Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >

  • CSS overflow detection in JavaScript

    - by ring0
    In order to display a line of text (like in a forum), and end that line with "..." if the text would overflow the line (not truncating using the CSS overflow property), there are a number of ways. I'm still seeking the best solution. For instance, Adding in CSS a "..." as a background-image is a possibility, but it would appear all the time, and this is not a good solution. Some sites just count the characters and if over - say - 100, truncates the string to keep only 100 (or 97) chars and add a "..." at the end. But fonts are usually not proportional, so the result is not pretty. For instance the space - in pixels - taken by "AAA" and "iii" is clearly different "AAA" and "iii" via a proportional font have the same width There is another idea to get the exact size in pixels of the string: create in Javascript a DIV insert the text in it (via innerHTML for instance) measure the width (via .offsetWidth) which is not implemented yet. However, I wonder if there could be any browser compatibility problem? Did any one tried this solution? Other recommendations would be welcome.

    Read the article

  • "text-overflow: ellipsis" not working well in firefox with floating element around

    - by Freedom
    see jsfiddle: http://jsfiddle.net/9v8faLeh/1/ I have two elements .text and .badge in a .container with a limit width: <div class="container"> <span class="badge">(*)</span> <span class="text">this is a long long long long text.</span> </div> the .badge element may not exist in a .container according to the data. if a .badge exist, I want the .badge element to float to right. and if the .text is too long, the text should ellipsis. .container { width: 150px; border: 1px solid; padding: 5px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; } .badge { float: right; margin-left: 5px; } if you open the jsfiddle link in Chrome or IE, it displays correctly as my expectation. but if open in Firefox, the .text and .badge are overlay if the text is so long. I don't want to use any JavaScript. how can I achieve the same result in FireFox?

    Read the article

  • Java default Integer value is int

    - by Chris Okyen
    My code looks like this import java.util.Scanner; public class StudentGrades { public static void main(String[] argv) { Scanner keyboard = new Scanner(System.in); byte q1 = keyboard.nextByte() * 10; } } It gives me an error "Type mismatch: cannot convert from int to byte." Why the heck would Java store a literal operand that is small enough to fit in a byte,. into a int type? Do literals get stored in variables/registers before the ALU performs arithmatic operations.

    Read the article

  • OpenGL problem with FBO integer texture and color attachment

    - by Grieverheart
    In my simple renderer, I have 2 FBOs one that contains diffuse, normals, instance ID and depth in that order and one that I use store the ssao result. The textures I use for the first FBO are RGB8, RGBA16F, R32I and GL_DEPTH_COMPONENT32F for the depth. For the second FBO I use an R16F texture. My rendering process is to first render to everything I mentioned in the first FBO, then bind depth and normals textures for reading for the ssao pass and write to the second FBO. After that I bind the second FBO's texture for reading in my blur shader and bind the first FBO for writing. What I intend to do is to write the blurred ssao value to the alpha component of the Normals texture. Here are where the problems start. First of all, I use shading language 3.3, which my graphics card does support. I manage ouputs in my shaders using layout(location = #). Now, the normals texture should be bound to color attachment 1, but when I use 1, it seems to write to my diffuse texture which should be in color attachment 0. When I instead use layout(location = 0), it gets correctly written to my normals texture. Besides this, my instance ID texture also gets resets after running the blur shader which is weird because if I use a float texture and write to it instanceID / nInstances, the texture doesn't get reset after the blur shader has ran. Here is how I prepare my first FBO: bool CGBuffer::Init(unsigned int WindowWidth, unsigned int WindowHeight){ //Create FBO glGenFramebuffers(1, &m_fbo); glBindFramebuffer(GL_DRAW_FRAMEBUFFER, m_fbo); //Create gbuffer and Depth Buffer Textures glGenTextures(GBUFF_NUM_TEXTURES, &m_textures[0]); glGenTextures(1, &m_depthTexture); //prepare gbuffer for(unsigned int i = 0; i < GBUFF_NUM_TEXTURES; i++){ glBindTexture(GL_TEXTURE_2D, m_textures[i]); if(i == GBUFF_TEXTURE_TYPE_NORMAL) glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA16F, WindowWidth, WindowHeight, 0, GL_RGBA, GL_FLOAT, NULL); else if(i == GBUFF_TEXTURE_TYPE_DIFFUSE) glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB8, WindowWidth, WindowHeight, 0, GL_RGB, GL_FLOAT, NULL); else if(i == GBUFF_TEXTURE_TYPE_ID) glTexImage2D(GL_TEXTURE_2D, 0, GL_R32I, WindowWidth, WindowHeight, 0, GL_RED_INTEGER, GL_INT, NULL); else{ std::cout << "Error in FBO initialization" << std::endl; return false; } glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0 + i, GL_TEXTURE_2D, m_textures[i], 0); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP); } //prepare depth buffer glBindTexture(GL_TEXTURE_2D, m_depthTexture); glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT32F, WindowWidth, WindowHeight, 0, GL_DEPTH_COMPONENT, GL_FLOAT, NULL); glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, m_depthTexture, 0); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE, GL_NONE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP); GLenum DrawBuffers[] = {GL_COLOR_ATTACHMENT0, GL_COLOR_ATTACHMENT1, GL_COLOR_ATTACHMENT2}; glDrawBuffers(GBUFF_NUM_TEXTURES, DrawBuffers); GLenum Status = glCheckFramebufferStatus(GL_FRAMEBUFFER); if(Status != GL_FRAMEBUFFER_COMPLETE){ std::cout << "FB error, status 0x" << std::hex << Status << std::endl; return false; } //Restore default framebuffer glBindFramebuffer(GL_FRAMEBUFFER, 0); return true; } where I use an enum defined as, enum GBUFF_TEXTURE_TYPE{ GBUFF_TEXTURE_TYPE_DIFFUSE, GBUFF_TEXTURE_TYPE_NORMAL, GBUFF_TEXTURE_TYPE_ID, GBUFF_NUM_TEXTURES }; Am I missing some kind of restriction? Does the color attachment of the FBO's textures somehow gets reset i.e. I'm using a re-size function which re-sizes the textures of the FBO but should I perhaps call glFramebufferTexture2D again too? EDIT: Here is the shader in question: #version 330 core uniform sampler2D aoSampler; uniform vec2 TEXEL_SIZE; // x = 1/res x, y = 1/res y uniform bool use_blur; noperspective in vec2 TexCoord; layout(location = 0) out vec4 out_AO; void main(void){ if(use_blur){ float result = 0.0; for(int i = -1; i < 2; i++){ for(int j = -1; j < 2; j++){ vec2 offset = vec2(TEXEL_SIZE.x * i, TEXEL_SIZE.y * j); result += texture(aoSampler, TexCoord + offset).r; // -0.004 because the texture seems to be a bit displaced } } out_AO = vec4(vec3(0.0), result / 9); } else out_AO = vec4(vec3(0.0), texture(aoSampler, TexCoord).r); }

    Read the article

  • Using a Higher Precision (than 8-bit unsigned integer) Buffered Image for Heightmaps in Java

    - by pl12
    I am generating a heightmap for every quad in my quadtree in openCL. The way I was creating the image is as follows: DataBufferInt dataBuffer = (DataBufferInt)img.getRaster().getDataBuffer(); int data[] = dataBuffer.getData(); //img is a bufferedimage inputImageMem = CL.clCreateImage2D( context, CL_MEM_READ_WRITE | CL_MEM_USE_HOST_PTR, new cl_image_format[]{imageFormat}, size, size, size * Sizeof.cl_uint, Pointer.to(data), null); This works ok but the major issue is that as the quads get smaller and smaller the 8-bit format of the buffered image starts to cause intolerable "stepping" issues as seen below: I was wondering if there was an alternate way I could go about doing this? Thanks for the time.

    Read the article

  • Why is DivMod Limited to Words (<=65535)?

    - by Andreas Rejbrand
    In Delphi, the declaration of the DivMod function is procedure DivMod(Dividend: Cardinal; Divisor: Word; var Result, Remainder: Word); Thus, the divisor, result, and remainder cannot be grater than 65535, a rather severe limitation. Why is this? Why couldn't the delcaration be procedure DivMod(Dividend: Cardinal; Divisor: Cardinal; var Result, Remainder: Cardinal); The procedure is implemented using assembly, and is therefore probably extremely fast. Would it not be possible for the code PUSH EBX MOV EBX,EDX MOV EDX,EAX SHR EDX,16 DIV BX MOV EBX,Remainder MOV [ECX],AX MOV [EBX],DX POP EBX to be adapted to cardinals? How much slower is the naïve attempt procedure DivModInt(const Dividend: integer; const Divisor: integer; out result: integer; out remainder: integer); begin result := Dividend div Divisor; remainder := Dividend mod Divisor; end; that is not (?) limited to 16-bit integers?

    Read the article

  • how to clear stack after stack overflow signal occur

    - by user353573
    In pthread, After reaching yellow zone in stack, signal handler stop the recursive function by making it return however, we can only continue to use extra area in yellow zone, how to clear the rubbish before the yellow zone in the thread stack ? (Copied from "answers"): #include <pthread.h> #include <stdio.h> #include <stdlib.h> #include <signal.h> #include <setjmp.h> #include <sys/mman.h> #include <unistd.h> #include <assert.h> #include <sys/resource.h> #define ALT_STACK_SIZE (64*1024) #define YELLOW_ZONE_PAGES (1) typedef struct { size_t stack_size; char* stack_pointer; char* red_zone_boundary; char* yellow_zone_boundary; sigjmp_buf return_point; size_t red_zone_size; } ThreadInfo; static pthread_key_t thread_info_key; static struct sigaction newAct, oldAct; bool gofromyellow = false; int call_times = 0; static void main_routine(){ // make it overflow if(gofromyellow == true) { printf("return from yellow zone, called %d times\n", call_times); return; } else { call_times = call_times + 1; main_routine(); gofromyellow = true; } } // red zone management static void stackoverflow_routine(){ fprintf(stderr, "stack overflow error.\n"); fflush(stderr); } // yellow zone management static void yellow_zone_hook(){ fprintf(stderr, "exceed yellow zone.\n"); fflush(stderr); } static int get_stack_info(void** stackaddr, size_t* stacksize){ int ret = -1; pthread_attr_t attr; pthread_attr_init(&attr); if(pthread_getattr_np(pthread_self(), &attr) == 0){ ret = pthread_attr_getstack(&attr, stackaddr, stacksize); } pthread_attr_destroy(&attr); return ret; } static int is_in_stack(const ThreadInfo* tinfo, char* pointer){ return (tinfo->stack_pointer <= pointer) && (pointer < tinfo->stack_pointer + tinfo->stack_size); } static int is_in_red_zone(const ThreadInfo* tinfo, char* pointer){ if(tinfo->red_zone_boundary){ return (tinfo->stack_pointer <= pointer) && (pointer < tinfo->red_zone_boundary); } } static int is_in_yellow_zone(const ThreadInfo* tinfo, char* pointer){ if(tinfo->yellow_zone_boundary){ return (tinfo->red_zone_boundary <= pointer) && (pointer < tinfo->yellow_zone_boundary); } } static void set_yellow_zone(ThreadInfo* tinfo){ int pagesize = sysconf(_SC_PAGE_SIZE); assert(pagesize > 0); tinfo->yellow_zone_boundary = tinfo->red_zone_boundary + pagesize * YELLOW_ZONE_PAGES; mprotect(tinfo->red_zone_boundary, pagesize * YELLOW_ZONE_PAGES, PROT_NONE); } static void reset_yellow_zone(ThreadInfo* tinfo){ size_t pagesize = tinfo->yellow_zone_boundary - tinfo->red_zone_boundary; if(mmap(tinfo->red_zone_boundary, pagesize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, 0, 0) == 0){ perror("mmap failed"), exit(1); } mprotect(tinfo->red_zone_boundary, pagesize, PROT_READ | PROT_WRITE); tinfo->yellow_zone_boundary = 0; } static void signal_handler(int sig, siginfo_t* sig_info, void* sig_data){ if(sig == SIGSEGV){ ThreadInfo* tinfo = (ThreadInfo*) pthread_getspecific(thread_info_key); char* fault_address = (char*) sig_info->si_addr; if(is_in_stack(tinfo, fault_address)){ if(is_in_red_zone(tinfo, fault_address)){ siglongjmp(tinfo->return_point, 1); }else if(is_in_yellow_zone(tinfo, fault_address)){ reset_yellow_zone(tinfo); yellow_zone_hook(); gofromyellow = true; return; } else { //inside stack not related overflow SEGV happen } } } } static void register_application_info(){ pthread_key_create(&thread_info_key, NULL); sigemptyset(&newAct.sa_mask); sigaddset(&newAct.sa_mask, SIGSEGV); newAct.sa_sigaction = signal_handler; newAct.sa_flags = SA_SIGINFO | SA_RESTART | SA_ONSTACK; sigaction(SIGSEGV, &newAct, &oldAct); } static void register_thread_info(ThreadInfo* tinfo){ stack_t ss; pthread_setspecific(thread_info_key, tinfo); get_stack_info((void**)&tinfo->stack_pointer, &tinfo->stack_size); printf("stack size %d mb\n", tinfo->stack_size/1024/1024 ); tinfo->red_zone_boundary = tinfo->stack_pointer + tinfo->red_zone_size; set_yellow_zone(tinfo); ss.ss_sp = (char*)malloc(ALT_STACK_SIZE); ss.ss_size = ALT_STACK_SIZE; ss.ss_flags = 0; sigaltstack(&ss, NULL); } static void* thread_routine(void* p){ ThreadInfo* tinfo = (ThreadInfo*)p; register_thread_info(tinfo); if(sigsetjmp(tinfo->return_point, 1) == 0){ main_routine(); } else { stackoverflow_routine(); } free(tinfo); printf("after tinfo, end thread\n"); return 0; } int main(int argc, char** argv){ register_application_info(); if( argc == 2 ){ int stacksize = atoi(argv[1]); pthread_attr_t attr; pthread_attr_init(&attr); pthread_attr_setstacksize(&attr, 1024 * 1024 * stacksize); { pthread_t pid0; ThreadInfo* tinfo = (ThreadInfo*)calloc(1, sizeof(ThreadInfo)); pthread_attr_getguardsize(&attr, &tinfo->red_zone_size); pthread_create(&pid0, &attr, thread_routine, tinfo); pthread_join(pid0, NULL); } } else { printf("Usage: %s stacksize(mb)\n", argv[0]); } return 0; } C language in linux, ubuntu

    Read the article

  • VS C++ throwing divide by zero exception after a specific check

    - by Dr. Monkey
    In the following C++ code, it should be impossible for ain integer division by zero to occur: // gradedUnits and totalGrades are both of type int if (gradedUnits == 0) { return 0; } else { return totalGrades/gradedUnits; //call stack points to this line } however Visual Studio is popping up this error: Unhandled exception at 0x001712c0 in DSA_asgn1.exe: 0xC0000094: Integer division by zero. And the stack trace points to the line indicated in the code. It seems like VS might just do this with any integer division, without checking whether a divide by zero is possible. Do I need to catch this exception even though the code should never be able to throw it? If so, what's the best way to go about this? This is for an assignment that specifies VS 2005/2008 with C++. I would prefer not to make things more complicated than I need to, but at the same time I like to do things properly where possible.

    Read the article

  • PHP validating integers

    - by Mikk
    Hi, I was wondering, what would be the best way to validate an integer. I'd like this to work with strings as well, so I could to something like (string)+00003 - (int)3 (valid) (string)-027 - (int)-27 (valid) (int)33 - (int)33 (valid) (string)'33a' - (FALSE) (invalid) That is what i've go so far: function parseInt($int){ //If $int already is integer, return it if(is_int($int)){return $int;} //If not, convert it to string $int=(string)$int; //If we have '+' or '-' at the beginning of the string, remove them $validate = ($int[0] === '-' || $int[0] === '+')?substr($int, 1):$int; //If $validate matches pattern 0-9 convert $int to integer and return it //otherwise return false return preg_match('/^[0-9]+$/', $validate)?(int)$int:FALSE; } As far as I tested, this function works, but it looks like a clumsy workaround. Is there any better way to write this kind of function. I've also tried filter_var($foo, FILTER_VALIDATE_INT); but it won't accept values like '0003', '-0' etc.

    Read the article

  • Download all Stack Overflow podcasts onto my iPhone

    - by Casebash
    I want to copy all of the Stack Overflow podcasts onto my iPhone. Unfortunately, iTunes will only let me get the last 10. Nik suggested a method of importing MP3s into iTunes, but it appears that this would make them appear in the music section rather than the podcast section. Is there any way to easily do this?

    Read the article

  • Fill CSS box with text from MySQL till there is no overflow, scrollbar, or hidden text

    - by terrance branigan
    I want to fill a CSS box with text till there is no overflow or scrollbar. I fetch text from MySQL. The user clicks a button and the next bit of text that can fit will fill the box. The only way I've figured to do this is by parsing through the text and counting characters and newlines, etc and calculating whether it will fit in the box. Is there an easier way to do this? Thank you

    Read the article

  • Strange Integer.parseInt exception

    - by Albinoswordfish
    Exception in thread "Thread-2" java.lang.NumberFormatException: For input string: "3" int test = Integer.parseInt(result[0]); This is the error I keep getting when I'm trying to convert "3" to an integer. Well I'm receiving this "3" through a RS-232 port, so maybe this is what is causing the error. If anybody has any idea what could be causing this it would be appreciated.

    Read the article

  • Stack Overflow problem in a recursive program in C

    - by Adi
    Hi all, I am getting a stack overflow in one of the recursive functions i am running.. Here is the code.. void* buddyMalloc(int req_size) { // Do something here return buddy_findout(original_index,req_size); // This is the recursive call } void *buddy_findout(int current_index,int req_size) { char *selected = NULL; if(front!=NULL) { if(current_index==original_index) { // Do something here return selected; } else { // Do Something here return buddy_findout(current_index+1,req_size); } } else { return buddy_findout(current_index-1,req_size); } } Consider the initial value of index to be 4. and it first do index-1 till it reaches 0 index. and then it comes back to index 4 by incrementing..This is wht i want to implement. But it gives a stack overflow with memory map in the command prompt : Here is the output from my shell : * glibc detected * ./473_mem: free(): invalid pointer: 0x00c274c0 * ======= Backtrace: ========= /lib/tls/i686/cmov/libc.so.6[0xb50ff1] /lib/tls/i686/cmov/libc.so.6[0xb526f2] /lib/tls/i686/cmov/libc.so.6(cfree+0x6d)[0xb557cd] ./473_mem[0x8048b44] ./473_mem[0x8048b74] ./473_mem[0x8048b74] ./473_mem[0x8048944] ./473_mem[0x8048c87] ./473_mem[0x8048d31] ./473_mem[0x8048f79] /lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xe6)[0xafcb56] ./473_mem[0x8048671] ======= Memory map: ======== 0017c000-00198000 r-xp 00000000 08:01 5224 /lib/libgcc_s.so.1 00198000-00199000 r--p 0001b000 08:01 5224 /lib/libgcc_s.so.1 00199000-0019a000 rw-p 0001c000 08:01 5224 /lib/libgcc_s.so.1 00260000-00284000 r-xp 00000000 08:01 1927 /lib/tls/i686/cmov/libm-2.10.1.so 00284000-00285000 r--p 00023000 08:01 1927 /lib/tls/i686/cmov/libm-2.10.1.so 00285000-00286000 rw-p 00024000 08:01 1927 /lib/tls/i686/cmov/libm-2.10.1.so 006cd000-006e8000 r-xp 00000000 08:01 6662 /lib/ld-2.10.1.so 006e8000-006e9000 r--p 0001a000 08:01 6662 /lib/ld-2.10.1.so 006e9000-006ea000 rw-p 0001b000 08:01 6662 /lib/ld-2.10.1.so 00aa9000-00aaa000 r-xp 00000000 00:00 0 [vdso] 00ae6000-00c24000 r-xp 00000000 08:01 1900 /lib/tls/i686/cmov/libc-2.10.1.so 00c24000-00c25000 ---p 0013e000 08:01 1900 /lib/tls/i686/cmov/libc-2.10.1.so 00c25000-00c27000 r--p 0013e000 08:01 1900 /lib/tls/i686/cmov/libc-2.10.1.so 00c27000-00c28000 rw-p 00140000 08:01 1900 /lib/tls/i686/cmov/libc-2.10.1.so 00c28000-00c2b000 rw-p 00000000 00:00 0 08048000-0804a000 r-xp 00000000 00:14 2176 /media/windows-share/OS/Project2/473_mem 0804a000-0804b000 r--p 00001000 00:14 2176 /media/windows-share/OS/Project2/473_mem 0804b000-0804c000 rw-p 00002000 00:14 2176 /media/windows-share/OS/Project2/473_mem 08483000-084a4000 rw-p 00000000 00:00 0 [heap] b7600000-b7621000 rw-p 00000000 00:00 0 b7621000-b7700000 ---p 00000000 00:00 0 b7716000-b7819000 rw-p 00000000 00:00 0 b7827000-b782a000 rw-p 00000000 00:00 0 bfb96000-bfbab000 rw-p 00000000 00:00 0 [stack] Aborted Thanks in advance adi

    Read the article

  • scala integer weirdness

    - by williamstw
    Suppose you inadvertently use Integer instead of Int, as in this code: import scala.collection.mutable.Map val contributors = Map[String,Integer]() val count = contributors.getOrElseUpdate("john",0) contributors.put("john",count+1) println(contributors) Compiler output: (fragment of test.scala):7: error: type mismatch; found : Int(1) required: String contributors.put("john",count+1) ^ Why "required: String"?

    Read the article

  • Capturing the overflow:auto state of a div

    - by jerrygarciuh
    Hi folks, One of the ad agencies I code for had me set up an alternate scrolling solution because you know how designers hate things that just work but aren't beautiful. So, this is married in places to their CMS. What I have not been able to sort yet is how to hide the scrolling UI when overflow:auto is not triggered by the CMS content. Any ideas? TIA JG

    Read the article

  • SQL Server cast fails with arithmetic overflow

    - by Jamie Ide
    According to the entry for decimal and numeric data types in SQL Server 2008 Books Online, precision is: p (precision) The maximum total number of decimal digits that can be stored, both to the left and to the right of the decimal point. The precision must be a value from 1 through the maximum precision of 38. The default precision is 18. However, the second select below fails with "Arithmetic overflow error converting int to data type numeric." SELECT CAST(123456789 as decimal(9,0)) SELECT CAST(123456789 as decimal(9,1))

    Read the article

  • Anticipate factorial overflow

    - by Flavius
    Hi I'm wondering how I could anticipate that the next iteration will generate an integer overflow while calculating the factorial F. Let's say that at each iteration I have an int I and the maximum value is MAX_INT. It sounds like a homework, I know. It's not. It's just me asking myself "stupid" questions.

    Read the article

  • ABAP - increment an integer

    - by Ben
    Hi there, sometimes ABAP drives me crazy with really simple tasks - as incrementing an integer within a loop... Here's my try: METHOD test. DATA: lv_id TYPE integer. lv_id = 1. LOOP AT x ASSIGNING <y>. lv_id = lv_id+1. ENDLOOP. ENDMETHOD. This gives me a strange error I can hardly translate to english..

    Read the article

  • li element background colors and overflow scrolling

    - by user17753
    I created a simple html source, and applied a small CSS style sheet to it: html { width: 100%; } body { font-family: Calibri, Tahoma, Geneva, sans-serif; padding: 20px; } pre { padding: 0; margin: 0 auto; border: 1px solid #888; font-family: Menlo,Monaco,Consolas,monospace; color: #000; width: 80%; overflow: auto; } pre li { white-space: pre; } ol { margin-top: 0; margin-bottom: 0; /* IE indents via margin-left */ color: #979797; background: #E3E3E3; } .li1 { background: #F5F5F5 } .li2 { background: #eee } I have an ordered list inside a pre-formatted tag. Every other list element is either given the class attribute li1 or li2 (the purpose of which is to alternate the colors). The list elements need the white-space: pre because the white space before and after the text node is important. The pre is to be 80% of the containing element (which ends up being 80% of the window's width). In the event of overflow in the x dimension, I want scrolling. I did all this in the above CSS, and it almost works. The issue I am having is that the background colors of the list elements don't extend with the content. They seem to be capped to the original width of the pre and/or ol element as demonstrated in the following picture where I scroll all the way right as possible: I tinkered with the CSS for a while, but I cannot determine the root cause for this or the fix. Looking for some advice on this one, thanks. Complete source with the issue is as below, NOTE: to would-be editors of the below code the pre element is intended to be on a single line as it's pre-formatted text, and formatting it otherwise would change things. <!DOCTYPE html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <title>Test Site</title> <style type="text/css"> html { width: 100%; } body { font-family: Calibri, Tahoma, Geneva, sans-serif; padding: 20px; } pre { padding: 0; margin: 0 auto; border: 1px solid #888; font-family: Menlo,Monaco,Consolas,monospace; color: #000; width: 80%; overflow: auto; } pre li { white-space: pre; } ol { margin-top: 0; margin-bottom: 0; /* IE indents via margin-left */ color: #979797; background: #E3E3E3; } .li1 { background: #F5F5F5 } .li2 { background: #eee } </style> </head> <body> <pre class="php"><ol><li class="li1">pre a &#123; text-decoration: none &#125;</li><li class="li2">pre a:hover &#123; background: #C8C8C8 }</li><li class="li1">pre li &#123; white-space: pre; &#125;</li><li class="li2">&nbsp;</li><li class="li1">.php ol &#123; margin-top: 0; margin-bottom: 0; /* IE indents via margin-left */</li><li class="li2"> color: #979797; background: #E3E3E3; }</li><li class="li1">&nbsp;</li><li class="li2">&nbsp;</li><li class="li1">&nbsp;</li><li class="li2">.php .li1 &#123; background: #F5F5F5 }</li><li class="li1">.php .li2 &#123; background: #eee }</li><li class="li2">&nbsp;</li><li class="li1">&nbsp;</li><li class="li2">.php .st0 &#123; color: #C0C } /* string content */</li><li class="li1">.php .st_h &#123; color: #F0C } /* string content single quoted */</li><li class="li2">.php .sy0 &#123; color: #000 } /* semi-colon, operators */ </li><li class="li1">.php .br0 &#123; color: #000 } /* parens */</li><li class="li2">.php .kw2 &#123; color: #00F } /* php tags */</li><li class="li1">.php .sy1 &#123; color: #00F } /* php tags */</li><li class="li2">.php .nu0 &#123; color: #F00 } /* numbers */</li><li class="li1">.php .kw3 &#123; color: #096 } /* core language functions */</li><li class="li2">.php .re0 &#123; color: #09F; font-weight: bold; } /* variables */</li><li class="li1">.php .kw1 &#123; color: #069; font-weight: bold; } /* control statements? */</li><li class="li2">.php .kw4 &#123; color: #069; font-weight: bold; } /* bool? */</li><li class="li1">.php .co1 &#123; color: #FF8400 } /* Forward slash comments */</li></ol></pre> </body> </html>

    Read the article

  • Find maximum positive integer value in Bourne Shell

    - by l0b0
    I'm checking a counter in a loop to determine if it's larger than some maximum, if specified in an optional parameter. Since it's optional, I can either default the maximum to a special value or to the maximum possible integer. The first option would require an extra check at each iteration, so I'd like to instead find out what is the maximum integer that will work with the -gt Bourne Shell operation.

    Read the article

  • Good programming website like Stack Overflow?

    - by hhafez
    What other good collaborative programming/software development/engineering websites do you know of? I'm not looking for language or platform specific websites. Nor am I looking for something similar to the format of Stack Overflow. My main criteria is that the community is knowledgeable, helpful active friendly I know the question is open ended/subjective but I'd like to know as many places where I can get the help of my peers. The accepted answer will contain links to your recommended sites have a short description be concise be highly voted by your peers

    Read the article

< Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >