Search Results

Search found 6934 results on 278 pages for 'zero fill'.

Page 7/278 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • WPF Linear Fill

    - by Ben
    Hi, I have found some example code that creates a gradient fill in a WPF rectangle control: <Rectangle Height="{Binding ElementName=txtName}" Width="{Binding ElementName=txtName}"> <Rectangle.Fill> <LinearGradientBrush> <GradientStop Color="Silver" Offset="0.0" /> <GradientStop Color="Black" Offset="0.5" /> <GradientStop Color="white" Offset="1.0" /> </LinearGradientBrush> </Rectangle.Fill> </Rectangle> I have some written some code that displays a collection of ListBox's that contain details from MyObject: <UserControl.Resources> <DataTemplate x:Key="CustomerTemplate"> <Border BorderThickness="2" BorderBrush="Silver" CornerRadius="5" Padding="1" Height="50"> <Grid x:Name="thisGrid"> <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto" /> <ColumnDefinition Width="Auto" /> </Grid.ColumnDefinitions> <StackPanel Orientation="Horizontal" > <Image Source="C:\MyImage.jpg" Height="50" Width="100" ></Image> </StackPanel> <Border Grid.Column="1" Margin="0" Padding="0"> <StackPanel Orientation="Vertical"> <TextBlock Name="txtName" Text="{Binding Name}" Background="Silver" Foreground="Black" FontSize="16" FontWeight="Bold" Height="25"/> </StackPanel> </Border> </Grid> </Border> </DataTemplate> </UserControl.Resources> <ListBox ItemsSource="{Binding}" ItemTemplate="{StaticResource CustomerTemplate}" Name="grdList" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" > </ListBox> I would like to apply the same stlye of fill that i get with the first example, in each of my ListBox's. I can't quite figure out how to do this. Can anyone help? Thanks

    Read the article

  • How to fill an HTML form with CSS ?

    - by misha-moroshko
    Hello, I have an HTML form with radio buttons, check boxes, text fields and drop down lists. Since I want user to fill everything in my form, none of the radio buttons and check boxes are checked and the text fields are empty. I would like to write a CSS file that will fill the form with answers (I don't want to change my HTML file). Is this possible ? I would appreciate an example or any other idea ? Thanks !

    Read the article

  • How does Content-Aware fill work?

    - by CiscoIPPhone
    The upcoming version of Photoshop a feature called Content-Aware fill. This feature will fill a selection of an image based on the surrounding image - to the point it can generate bushes and clouds while being seamless with the surrounding image. See http://www.youtube.com/watch?v=NH0aEp1oDOI for a preview of the Photoshop feature I'm talking about. My question is: How does this feature work algorithmically?

    Read the article

  • How to fill byte array with junk? C#

    - by flyout
    I am using this: byte[] buffer = new byte[10240]; As I understand this initialize the buffer array of 10kb filled with 0s. Whats the fastest way to fill this array (or initialize it) with junk data everytime? I need to use that array like 5000 times and fill it everytime with different junk data, thats why I am looking for a fast method to do it. The array size will also have to change everytime.

    Read the article

  • Android: How to do this framing paint?

    - by iDroid Explorer
    I Have Some static images like below: Now, I want is, when i touch on the face or hand, then the selected color should be fill on that skin portion. See below image of result: So how to get the result like above ?? Redo and Undo Functionality Should be also there. I have try with the FloodFill color but doing that i can only able to do color in to the perticular portion. as FloodFill only fill the color till the same pixwl color comes. If the touch place pixel color get change the it will not fill color on it. So Usinf FloodFill i got the result like below image, If i press on the hand, then only hand portion will fill with color, instead of it i want to fill color to the other hand and face also. So Please help me in this case. EDITED After some reply i got the solution like this one. But still there is a memory issue. It consume lots of memory to draw the color. So please can anyone help me for it ?

    Read the article

  • zeroing a disk with dd vs Disk Utility

    - by jdizzle
    I'm attempting to zero a disk on my Mac OS X machine. I'm going for complete zeros and unformatted, so I think of dd. Unfortunately the maximum throughput I've managed to get out of dd is 7MB/s. Just for grins I tried disk utility and it has a throughput of 19MB/s. What gives? I've tried changing the bs option on dd to all sorts of values, but it still hovers around 7MB/s. Why is disk utility so much faster?

    Read the article

  • Always get exception when trying to Fill data to DataTable

    - by Sambath
    The code below is just a test to connect to an Oracle database and fill data to a DataTable. After executing the statement da.Fill(dt);, I always get the exception "Exception of type 'System.OutOfMemoryException' was thrown.". Has anyone met this kind of error? My project is running on VS 2005, and my Oracle database version is 11g. My computer is using Windows Vista. If I copy this code to run on Windows XP, it works fine. Thank you. using System.Data; using Oracle.DataAccess.Client; ... string cnString = "data source=net_service_name; user id=username; password=xxx;"; OracleDataAdapter da = new OracleDataAdapter("select 1 from dual", cnString); try { DataTable dt = new DataTable(); da.Fill(dt); // Got error here Console.Write(dt.Rows.Count.ToString()); } catch (Exception e) { Console.Write(e.Message); // Exception of type 'System.OutOfMemoryException' was thrown. } Update I have no idea what happens to my computer. I just reinstall Oracle 11g, and then my code works normally.

    Read the article

  • Raphael.js map default fill colors

    - by RIDER
    I am trying to familiarize myself with raphael.js. I want to create a USA map that already has default colors for each state and those colors stay there. Here is what I came up with. If you look at AK, I'm getting the default color loaded, but if I highlight another state, the default color for AK disappears. I want AK - and other states - to stay the same color. Specifically, I don't know what is clearing out my AK full color. I think part of this statement is clearing out the fill cover when I mouseover a different state: for (var state in aus) { //aus[state].color = Raphael.getColor(); (function (st, state) { st[0].style.cursor = "pointer"; st[0].onmouseover = function () { current && aus[current].animate({fill: "#333", stroke: "#666"}, 500) && (document.getElementById(current).style.display = ""); st.animate({fill: st.color, stroke: "#ccc"}, 500); st.toFront(); R.safari(); document.getElementById(state).style.display = "block"; current = state; }; })(aus[state], state); } Any ideas where I might be going wrong?

    Read the article

  • GWT UIBinding cannot find zero-arg constructor

    - by aarestad
    I'm trying my hand at the new GWT 2.0 UIBinder capability, and I have a ui XML that looks like this: <ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder" xmlns:g="urn:import:com.google.gwt.user.client.ui" xmlns:my='urn:import:com.mystuff.mypackage'> <g:VerticalPanel> <!-- other stuff --> <my:FileUploadPanel.ValidatingFileUpload styleName="field" ui:field="fileUpload" /> </g:VerticalPanel> ValidatingFileUpload is a non-static inner class contained in FileUploadPanel. It has an explicit zero-arg constructor that simply calls super(). However, when GWT starts up, I get this error: 00:00:18.359 [ERROR] Rebind result 'com.mystuff.mypackage.FileUploadPanel.ValidatingFileUpload' has no default (zero argument) constructors. java.lang.NoSuchMethodException: com.mystuff.mypackage.FileUploadPanel$ValidatingFileUpload.<init>() Any idea what might be going wrong here?

    Read the article

  • how to check if there is a division by zero in c

    - by user244775
    #include<stdio.h> void function(int); int main() { int x; printf("Enter x:"); scanf("%d", &x); function(x); return 0; } void function(int x) { float fx; fx=10/x; if(10 is divided by zero)// I dont know what to put here please help printf("division by zero is not allowed"); else printf("f(x) is: %.5f",fx); }

    Read the article

  • Counting down to zero in contrast to counting up to length - 1

    - by Helper Method
    Is it recommended to count in small loops (where possible) down from length - 1 to zero instead of counting up to length - 1? 1.) Counting down for (int i = a.length - 1; i >= 0; i--) { if (a[i] == key) return i; } 2.) Counting up for (int i = 0; i < a.length; i++) { if (a[i] == key) return i; } The first one is slightly faster that the second one (because comparing to zero is faster) but is a little more error-prone in my opinion. Besides, the first one could maybe not be optimized by future improvements of the JVM. Any ideas on that?

    Read the article

  • difference fixed width strings and zero-terminated strings

    - by robUK
    Hello, gcc 4.4.4 c89 I got into a recent discussion about "fixed width strings" and "zero terminated strings". When I think about this. They seem to be the same thing. A string with a terminating null. i.e. char *name = "Joe bloggs"; Is a fixed width string that cannot be changed. And also has a terminating null. Also in the discussion I was told that strncpy should never been used on 'zero terminated strings'. Many thanks for any susgestions,

    Read the article

  • is memset(ary,0,length) a portable way of inputting zero in double array

    - by monkeyking
    The following code uses memset to set all the bits to zero #include <iostream> #include <cstring> int main(){ int length = 5; double *array = new double[length]; memset(array,0,sizeof(double)*length); for(int i=0;i<length;i++) if(array[i]!=0.0) std::cerr<< "not zero in: " <<i <<std::endl; return 0; } Can I assume that this will work on all platforms? Does the double datatype always correspond to the ieee-754 standard? thanks

    Read the article

  • AIO network sockets and zero-copy under Linux

    - by remyhorton
    I have been experimenting with async Linux network sockets (aio_read et al in aio.h/librt), and one thing i have been trying to find out is whether these are zero-copy or not. Pretty much all i have read so far discusses file I/O, whereas its network I/O i am interested in. AIO is a bit of a pain to use and i suspect is non-portable, so wondering whether its worth persevering with it. Zero-copy is just about the only advantage (albiet a major one for my purposes) it would have over (non-blocking) select/epoll..

    Read the article

  • storing an integer constant other than zero in a pointer variable

    - by benjamin button
    int main() { int *d=0; printf("%d\n",*d); return 0; } this works fine. >cc legal.c > ./a.out 0 if i change the statement int *d=0; to int *d=1; i see the error. cc: "legal.c", line 6: error 1522: Cannot initialize a pointer with an integer constant other than zero. so its obvious that it will allow only zero.i want to know what happens inside the memory when we do this int *d=0 which is making it valid syntax. I am just asking this out of curiosity!

    Read the article

  • if non zero elements in same column count only once

    - by George
    I want to check the elements above the main diagonal and if I found non zero values , count one. If the non zero values are found in the same column ,then count just one ,not the number of the non zero values. For example , it should be count = 2 and not 3 in this example because 12 and 6 are in the same column. A= 1 11 12 4 5 6 0 7 0 #include <stdio.h> #include <stdlib.h> #include <math.h> int main( int argc, const char* argv[] ){ int Rows = 3 , Cols = 3; float *A = (float *) malloc ( Rows * Cols * sizeof (float) ); A[0] = 1.0; A[1] = 11.0; A[2] = 12.0; A[3] = 4.0; A[4] = 5.0; A[5] = 6.0; A[6] = 0.0; A[7] = 7.0; A[8] = 0.0; // print input matrix printf("\n Input matrix \n\n"); for ( int i = 0; i < Rows; i++ ) for ( int j = 0; j < Cols; j++ ) { printf("%f\t",A[ i * Cols + j ]); if( j == Cols-1 ) printf("\n"); } printf("\n"); int count = 0; for ( int j = 0 ; j < Cols; j++ ) { for ( int i = ( Rows - 1 ); i >= 0; i-- ) { // check the diagonal elements above the main diagonal if ( j > i ) { if ( ( A[ i * Cols + j ] != 0 ) ) { printf("\n Above nonzero Elmts = %f\n",( A[i * Cols + j] ) ); count++; } } } } printf("\ncount = %d\n",count ); return 0; }

    Read the article

  • C++ stringstream reads all zero's

    - by user69514
    I have a file which contains three integers per line. When I read the line I use a stringstream to separate the values, but it only reads the first value as it is. The other two are read as zero's. ifstream inputstream(filename.c_str()); if( inputstream.is_open() ){ string line; stringstream ss; while( getline(inputstream, line) ){ //check line and extract elements int id; double income; int members; ss.clear(); ss.str(line); ss >> id >> income >> members; In the case above, id is extracted correctly, but income, and members get assigned zero instead of the actual value.

    Read the article

  • Strings - Filling In Leading Zeros Wtih A Zero

    - by headscratch
    I'm reading an array of hard-coded strings of numeric characters - all positions are filled with a character, even for the leading zeros. Thus, can confidently parse it using substring(start, end) to convert to numeric. Example: "0123 0456 0789" However, a string coming from a database does not fill in the leading zero with a 'zero character', it simply fetches the '123 456 789', which is correct for an arithmetic number but not for my needs and makes for parsing trouble. Before writing conditionals to check for leading zeros and adding them to the string if needed, is there a simple way of specifying they be filled with a character ? I'm not finding this in my Java book... I could have done the three conditionals in the time it took to post this but, this is more about 'education'... Thanks

    Read the article

  • How to exclude zero in a for loop in Java

    - by user1745508
    I'm trying to exclude the zero in this nested for loop here using != 0; but it is not doing anything. I'm trying to get the probability of each out come of 2 six sided dice when rolled. I must figure out the amount of times they are rolled first, but a die doesn't have a zero in it, so I must exclude it. I can't figure out why this doesn't work. for( die2 = 0; die2 <= 6 && die2 != 0; die2++) for( die1 = 0; die1 <= 6 && die1 != 0; die1++) System.out.println("Die 2: " + (die2 * userInputValue) + " " + "Die 1: " + (die1 * userInputValue));

    Read the article

  • Getting fill color inside the itemrenderer in Adobe Flex

    - by Anoop
    Hi All, I am writing a custom item renderer to render a column series in my application. Its a stacked chart and i want to use the same item renderer for both the column series. The color for each series in the stack is different and am setting that in the 'fill' property of the two series. My doubt is how can i get the color specified in the fill property of the column series from the item renderer. if this works then i can very well use the same renderer for both series. Thanks in advance, Anoop

    Read the article

  • Algorithm to fill slots

    - by Peter Lang
    I am searching for an algorithm to fill several slots, which are already filled to some level. The current levels and the available quantity to fill are known Resulting levels should be as equal as possible, but existing level cannot be reduced Slots are filled from left to right, so left slots get higher level if equal level is impossible       The image above shows six examples, each column represents a slot. The grey area is already filled, the blue are is the expected position of the new elements. I could iterate through my slots and increase the quantity on the lowest slot by 1 until the available quantity is consumed, but I wonder about how to actually calculate the new filling levels. I am going to implement this with SQL/PL/SQL, other code is just as welcome though :)

    Read the article

  • dataset tables row count 'zero'

    - by James123
    I am using dataadapter.Fill() into dataset. But dataset returning tables rows count zero (0). When I ran same sp in sql mgmt. It is returning two tables data. If attributeId = 1 Then spString = "USP_group_1" ElseIf attributeId = 2 Then spString = "USP_group_2" ElseIf attributeId = 3 Then spString = "USP_group_3" End If sqlcmd_q.CommandTimeout = 120 sqlcmd_q.Connection = sqlCnn sqlcmd_q.CommandText = spString sqlcmd_q.CommandType = CommandType.StoredProcedure sqlcmd_q.Parameters.AddWithValue("@client_id", clientId) Try sqlCnn.Open() Dim daGrid As New SqlDataAdapter(sqlcmd_q) daGrid.Fill(dsGrid) daGrid.Dispose() Return dsGrid I don't understand why this happening?

    Read the article

  • How to gradient fill a button's background?

    - by Samuh
    I have to create a colored button with gradient fill(starting from the middle of the button along Y axis). If I set the background property of the button to the color I want, I lose the rounded look and feel of a button and also the gradient fill(It looks like a TextView with a background). Also, I want this color to change when the user depresses the button. Can i specify this via selector XMLs(Color State Lists)? Any tutorials or links that can help me here is appreciated. Thanks.

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >