Search Results

Search found 429 results on 18 pages for 'rounded'.

Page 15/18 | < Previous Page | 11 12 13 14 15 16 17 18  | Next Page >

  • How can I round money values to the nearest $5.00 interval?

    - by Frank Developer
    I have an Informix-SQL based Pawnshop app which calculates an estimate of how much money should be loaned to a customer, based on the weight and purity of gold. The minimum the pawnshop lends is $5.00. The pawnshop employee will typically lend amounts which either ends with a 5 or 0. examples: 10, 15, 20, 100, 110, 125, etc. They do this so as to not run into shortage problems with $1.00 bills. So, if for example my system calculates the loan should be: $12.49, then round it to $10, $12.50 to $15.00, $13.00 to $15.00, $17.50 to $20.00, and so on!..The employee can always override the rounded amount if necessary. Is it possible to accomplish this within the instructions section of a perform screen or would I have to write a cfunc and call it from within perform?.. Are there any C library functions which perform interval rounding of money values?.. On another note, I think the U.S. Government should discontinue the use of pennies so that businesses can round amounts to the nearest nickel, it would save so much time and weight in our pockets!

    Read the article

  • Why is graphviz drawing two arrows, and using a weird order?

    - by dmd
    Why is graphviz drawing two arrows from uncap_spike to peel, and why is it drawing peel to the right of hang? I want uncap_spike - peel - hang - spike, in that order, with one edge between each. digraph hangers { compound=true fontname="Gill Sans" node [fontname="Gill Sans" shape=box fillcolor=white style="rounded, filled"] edge [fontname="Gill Sans"] subgraph cluster_prep { style="filled" label=Prep gather [shape=Mrecord label="{gather | EtOH swab\nvented tubing}"] uncap_bottle [label="uncap bottle"] uncap_spike [label="uncap spike"] swab [shape=Mrecord label="{swab EtOH | wait 30 seconds for sterility}"] gather -> uncap_bottle -> swab -> uncap_spike {rank=same gather uncap_bottle swab uncap_spike} } subgraph cluster_hang { style=filled label=Hang {rank=same peel hang} } {rank=same uncap_spike -> peel -> hang -> spike -> prime} hang -> rip [color=firebrick] rip [label="eyelet\nripped" style="filled" shape=octagon regular fontcolor=white fontsize=10 width=.5 fixedsize color=firebrick fillcolor=firebrick ] swab -> not_sterile [color=firebrick] not_sterile [label="not\nsterile" style="filled" shape=octagon regular fontcolor=white fontsize=10 width=.5 fixedsize color=firebrick fillcolor=firebrick ] }

    Read the article

  • CSS issue in IE

    - by Ayaz Alavi
    Hi, Me website contains drop down menus at the top right corner. Dropdwon is displayed fine but when I hover over elements of drop down then IE is causing issue on rendering them on the other hand Firefox is displaying the way i want. website is http://www.textsensor.com/test. Can anybody tell me what is causing IE issue on its menu. Here is the details. Each parent at top has child div which contains child elements in a ul. I am displaying them inline with width of div container fixed so that two of them are being displayed in one line. Each child li contains two images and an anchor in between. These two images are providing rounded corners whereas anchor contains span which contains text of sub-menu item. On mouseover on span I am showing its parent anchor sibling images through javascript and also setting its bg-image to white. Images are not aligned correctly and span tag got down about 10px from top on IE only. Javascript is listed below $("#jsddm li ul li a span").hover(function(){ $(this).parent().siblings("img").show(); $(this).parent().css("border-bottom", "#a00 5px double"); }, function(){ $(this).parent().siblings("img").hide(); $(this).parent().css("border-bottom", "none"); }); Cheers Ayaz Alavi

    Read the article

  • How can I include a .eps figure within a Tikz simple flow chart?

    - by Jan
    Hi, I would like to create a simple flow chart in latex with the TikZ package similar to the following example http://www.texample.net/tikz/examples/simple-flow-chart/ However I would like to include figures (a time series plot created in R, as eps or something else) within the flowchart (e.g. for example within a {block}? \documentclass{article} \usepackage[latin1]{inputenc} \usepackage{tikz} \usetikzlibrary{shapes,arrows} \begin{document} \pagestyle{empty} % Define block styles \tikzstyle{decision} = [diamond, draw, fill=blue!20, text width=4.5em, text badly centered, node distance=3cm, inner sep=0pt] \tikzstyle{block} = [rectangle, draw, fill=blue!20, text width=5em, text centered, rounded corners, minimum height=4em] \tikzstyle{line} = [draw, -latex'] \tikzstyle{cloud} = [draw, ellipse,fill=red!20, node distance=3cm, minimum height=2em] \begin{tikzpicture}[node distance = 2cm, auto] % Place nodes \node [block] (init) {initialize model}; \node [cloud, left of=init] (expert) {expert}; \node [cloud, right of=init] (system) {system}; \node [block, below of=init] (identify) {identify candidate models}; \node [block, below of=identify] (evaluate) {evaluate candidate models}; \node [block, left of=evaluate, node distance=3cm] (update) {update model}; \node [decision, below of=evaluate] (decide) {is best candidate better?}; \node [block, below of=decide, node distance=3cm] (stop) {stop}; % Draw edges \path [line] (init) -- (identify); \path [line] (identify) -- (evaluate); \path [line] (evaluate) -- (decide); \path [line] (decide) -| node [near start] {yes} (update); \path [line] (update) |- (identify); \path [line] (decide) -- node {no}(stop); \path [line,dashed] (expert) -- (init); \path [line,dashed] (system) -- (init); \path [line,dashed] (system) |- (evaluate); \end{tikzpicture} \end{document} Thanks, Jan

    Read the article

  • Random point on VideoDisplay isn't accurate enough

    - by Mike
    For a schoolassigment me and some buddies of mine are creating an application that is showing many similarities with the C-Mon & Kypski musicvideo on www.oneframeoffame.com. The application is being developed in Flex. We want to get a random point of a clip, let it pause so a user can mimic the pose and make a snapshot out of it. What i managed to do is get a random point of the movie. I did this by getting a random value between 0 and de total duration of the movie. But what i didn't managed to do is let the screen pause on every 24st of a frame. As the movie concist out of 24FPS. It looks like the the random value of the movie that is being requested is being rounded by the movie itself. As example: There appears to be no difference between the frames requested at 2.40 or 2.41. It appears it got something to do with keyframing i've read on the Adobe® Flex™ 3.5 Language Reference. The movie is a FLV file and i use the VideoDisplay object to display the movie. Does someone is familiar with this or knows a solution to my problem? Thanks in advance

    Read the article

  • Want to show file association icon and skype like progress bar c#

    - by Thomas
    whenever user drag any file onto skype chat textbox then skype show right icon for that file and one custom progress bar rounded corner. i have 4 questions 1) i am working with win application not WPF. i like to know how to develop skype like corner progressbar. i search lot google to find out skype like progressbar. so if anyone knows how to develop that kind of progress bar then please share that knowledge or give me any url from where i can download similar look progressbar. 2) when i drag any file onto my richtextbox then how could i show right icon for that file on my richtextbox. anyone can give me idea. 3) what kind of richtextbox skype use? is there any advance richtextbox library which i can use for showing picture or button etc. 4) skype shows button on chat textbox called Cancel......is it button or any image. when user click on that button then button respond accordingly. so just tell me how could place any button on my rich textbox and when i will click on that button then a event should fire at my end. any idea. here i attach a picture from where you can see the image of progressbar that i am looking for. how i want to show the progress button and file associated icon on richtextbox. the object behind attaching the image is other person can understand what is my requirement and what i want to know. please anyone give me the idea for my above 4 points. thanks

    Read the article

  • Show last 4 table entries mysql php

    - by user272899
    I have a movie database Kind of like a blog and I want to display the last 4 created entries. I have a column in my table for timestamp called 'dateadded'. Using this code how would I only display the 4 most recent entries to table <?php //connect to database mysql_connect($mysql_hostname,$mysql_user,$mysql_password); @mysql_select_db($mysql_database) or die("<b>Unable to connect to specified database</b>"); //query databae $query = "SELECT * FROM movielist"; $result=mysql_query($query) or die('Error, insert query failed'); $row=0; $numrows=mysql_num_rows($result); while($row<$numrows) { $id=mysql_result($result,$row,"id"); $imgurl=mysql_result($result,$row,"imgurl"); $imdburl=mysql_result($result,$row,"imdburl"); ?> <div class="moviebox rounded"><a href="http://<?php echo $domain; ?>/viewmovie?movieid=<?php echo $id; ?>" rel="facebox"> <img src="<?php echo $imgurl; ?>" /> <form method="get" action=""> <input type="text" name="link" class="link" style="display:none" value="http://us.imdb.com/Title?<?php echo $imdburl; ?>"/> </form> </a></div> <?php $row++; } ?>

    Read the article

  • jQuery slideDown: Parent element doesn't expand?

    - by bobsoap
    Hi, This issue occurs in our beloved Internet Explorer 7: I have a list of items, each with a hidden child div. When user clicks the "expand" button in any list item, the hidden div will expand downwards and push all content beneith it lower. This works just as it should in FF, Chrome, IE8 - but IE7 will not expand the parent element along with its children. This is noticeable because the top-most parent container has an absolutely positioned image at the very bottom (yea... rounded corners) - that doesn't get pushed down when the content expands. I'm guessing that's because of the absolute positioning... Just wondering whether I should attempt to code up some huge workaround in jQuery just for that (assuming I'm able to), or if this is a known issue of some sort. My HTML: <div id="container"> <ul> <li>Click here to expand <div class="hide"></div> </li> <li>Click here to expand <div class="hide"></div> </li> <li>Click here to expand <div class="hide"></div> </li> </ul> <div id="containerbottom"></div> </div> The CSS: #container { position:relative; } #container #containerbottom { position:absolute; bottom:0px; left:0px; } The jQuery is pretty much your everyday slide function: $('ul li').click(function() { $(this).children('.hide').slideDown(200); }); Any ideas?

    Read the article

  • Custom back button click event on pushed view controller

    - by TechFusion
    Hello, I have pushed view controller and load WebView and Custom rectangular rounded button on right down left corner into view using programmatic way. -(void)loadView { CGRect frame = CGRectMake(0.0, 0.0, 480, 320); WebView = [[[UIWebView alloc] initWithFrame:frame] autorelease]; WebView.backgroundColor = [UIColor whiteColor]; WebView.scalesPageToFit = YES; WebView.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleTopMargin); WebView.autoresizesSubviews = YES; WebView.exclusiveTouch = YES; WebView.clearsContextBeforeDrawing = YES; self.roundedButtonType = [[UIButton buttonWithType:UIButtonTypeRoundedRect] retain]; self.roundedButtonType.frame = CGRectMake(416.0, 270.0, 44, 19); [self.roundedButtonType setTitle:@"Back" forState:UIControlStateNormal]; self.roundedButtonType.backgroundColor = [UIColor grayColor]; [self.roundedButtonType addTarget:self action:@selector(back:) forControlEvents:UIControlEventTouchUpInside]; self.view = WebView; [self.view addSubview: self.roundedButtonType ]; [WebView release]; } This is action that I have added as back button of navigation. -(void)back:(id)sender{ [self.navigationController popViewControllerAnimated:YES]; } -(void)viewDidUnload{ self.WebView = nil; self.roundedButtonType = nil; } -(void)dealloc{ [roundedButtonType release]; [super dealloc]; } Here, When Back button click then it is showing previous view but application got stuck in that view and GDB shows Program received signal :EXC_BAD_ACCESS message. how resolve this issue? Thanks,

    Read the article

  • How can I apply a style to existing tikz node on specific slides

    - by Eugene Pimenov
    This is what I'm trying to do \begin{tikzpicture} [node distance = 1cm, auto,font=\footnotesize, % STYLES every node/.style={node distance=1.3cm}, comment/.style={rectangle, inner sep= 5pt, text width=4cm, node distance=0.25cm, font=}, module/.style={rectangle, drop shadow, draw, fill=black!10, inner sep=5pt, text width=3cm, text badly centered, minimum height=0.8cm, font=\bfseries\footnotesize\sffamily,rounded corners}, selected/.style={fill=red!40}] \node [module] (nodeA) {node A}; \node [module, below of=nodeA] (nodeA) {node B}; \only<1>{ \node [comment, text width=6cm, right=0.25 of nodeA] {short description of Node A}; \node [comment, text width=6cm, right=0.25 of nodeB] {short description of Node B}; } \only<2>{ \node [selected] (nodeA) {}; \node [comment, text width=6cm, right=0.25 of nodeA] {long description of node A}; } \only<3>{ \node [selected] (nodeB) {}; \node [comment, text width=6cm, right=0.25 of nodeA] {long description of node B}; } \end{tikzpicture} The problem is \node [selected] (nodeB) {}; creates a new node, but I want it to apply the style for the existing node. Is there any way to do so? Of course I could have copies of every node in selected state and not-selected state, but I really want to have a normal solution.

    Read the article

  • The best way to implement drawing features like Keynote

    - by Shamseddine
    Hi all, I'm trying to make a little iPad tool's for drawing simple geometrical objects (rect, rounded rect, ellipse, star, ...). My goal is to make something very close to Keynote (drawing feature), i.e. let the user add a rect (for instance), resizing it and moving it. I want too the user can select many objects and move them together. I've thought about at least 3 differents ways to do that : Extends UIView for each object type, a class for Rect, another for Ellipse, ... With custom drawing method. Then add this view as subview of the global view. Extends CALayer for each object type, a class for Rect, another for Ellipse, ... With custom drawing method. Then add this layer as sublayer of the global view layer's. Extends NSObject for each object type, a class for Rect, another for Ellipse, ... With just a drawing method which will get as argument a CGContext and a Rect and draw directly the form in it. Those methods will be called by the drawing method of the global view. I'm aware that the two first ways come with functions to detect touch on each object, to add easily shadows,... but I'm afraid that they are a little too heavy ? That's why I thought about the last way, which it seems to be straight forward. Which way will be the more efficient ??? Or maybe I didn't thought another way ? Any help will be appreciated ;-) Thanks.

    Read the article

  • IE bug with TD's tables and whitespace?

    - by mark smith
    Hi there, I have a page that is using tables, in FF etc it works perfect, but in IE7 it causes issues, its basically where the four corners have a td and and img (its a rounded corner form) .. if i remove the whitespace from the document it fixes the issue.. What actually happens is that it messes up the tables.. it puts a thin white line between the upper tr that holds the 2 corners and the next tr I need to remove the the whitespace between the img and the TD, is there a better work around, as i have lots and not only that if i reformat the document the problem returns.. here is a simple example.. <table width="100%" height="418" border="0" cellpadding="0" cellspacing="0" bgcolor="#F04A23" style="margin: 0px; padding: 0px"> <tr> <td width="12" align="left" valign="top"> <img src="content/images/corner_left.gif" width="12" height="12" /> </td> as you can see there is white space between img and td... and i remove it so it looks like this <img src="content/images/corner_left.gif" width="12" height="12" /></td> the problem is gone, (notice the td and image are right next to each other) Any ideas, i tried setting all sorts of css, padding 0px, margins 0px etc ... Any ideas really appreciated

    Read the article

  • Question regarding ip checksum code

    - by looktt
    unsigned short /* this function generates header checksums */ csum (unsigned short *buf, int nwords) { unsigned long sum; for (sum = 0; nwords > 0; nwords--) // add words(16bits) together sum += *buf++; sum = (sum >> 16) + (sum & 0xffff); //add carry over sum += (sum >> 16); //what does this step do??? add possible left-over //byte? But isn't it already added in the loop (if //any)? return ((unsigned short) ~sum); } I assume nwords in the number of 16bits word, not 8bits byte (if there are odd byte, nword is rounded to next large), is it correct? The line sum = (sum 16) + (sum & 0xffff) is to add carry over to make 16bit complement sum += (sum 16); What's the purpose of this step? Add left-over byte? How? Thanks!

    Read the article

  • "Outward" border-radius in css?

    - by MaxMackie
    Currently, the links at the top of my website look like this: However, I am trying to "round" the bottom edges of the buttons to make it look like they are coming out of the page and into the ribbon at the top. I am aware that you can hack it and add a "separator" div with rounded corners between each entry, but this would be difficult to do seeing at the borders used are not all from the same div. Also, it wouldn't be easy seeing as my buttons are very close to each other. The css for the "button": .button { border-top: 3px solid #A1C1BE; border-left: 3px solid #A1C1BE; border-right: 3px solid #A1C1BE; border-bottom: 0px; padding: 5px 8px 5px 8px; margin: 0 0 -9px 0; border-radius: 5px 5px 0 0; font-size: 12px; font-family: 'PT Sans', sans-serif; background-color: #f8f8ff; color: #484848; } css for the "ribbon": #top-wrapper { border-bottom: 5px solid #A1C1BE; width: 100%; background-color: #59554E; padding: 10px 0 0 0; color: #C0C0A8; } As you can see, the thicker border belongs to the ribbon which stretches the length of the webpage, whereas the thinner blue border is part of the button.

    Read the article

  • Javascript and rendering pauses and stays paused on scroll in the android browser

    - by user357303
    Hi. I've found some wierd behaviour related to scrolling and rendering and javascript. How to make it happen: On any webpage that is long enough to scroll on. Start to scroll pretty fast (fling the page). then release the touch. No while the page is still scrolling because of the momentum. Tap the screen to stop the scroll. This make the browser enter a wierd mode. On the nexus one it behaves like this: The updating of what's shown on the screen stops, you can still click on links and the go to where they are supposed to but what's shown on the screen stays the same. If you then scroll the screen a bit the update of the screen kicks in again and what you you where suppsed to see all the time is shown. On all phones with HTC Sense I've tried (Hero, Desire, Legend) this happens: The updating of the screen is stopped just like on the nexus one, but also the execution of any javascript is stopped. If you click on a link that takes you to another page however things return to normal again. The way I tested this was I created a page like this: http://pastebin.ca/1881620 The changeColor function simply changed the background color of 'container' to a few different colors. So before the error what happens is that when you click any link the color changes. after the error this happens: Nexus one: when you click on the links nothing happens (except the "orange link selected rounded corner box thing" is shown as if the link is clicked). Then when you scroll abit. You can see the color has changed (and equal amount of times to the number of times I clicked the link). On Sense: The links take me to google.com Has anyone else noticed this problem? Is there anyway to work around it? Thanks.

    Read the article

  • problems selecting a mutliple select value from database in Rails

    - by Ramy
    From inside of a form_for in rails, I'm inserting multiple select values into the database, like this: <div class="new-partner-form"> <%= form_for [:admin, matching_profile.partner, matching_profile], :html => {:id => "edit_profile", :multipart => true} do |f| %> <%= f.submit "Submit", :class => "hidden" %> <div class="rounded-block quarter-wide radio-group"> <h4>Exclude customers from source:</h4> <%= f.select :source, User.select(:source).group(:source).order(:source).map {|u| [u.source,u.source]}, {:include_blank => false}, {:multiple => true} %> <%= f.error_message_on :source %> </div> I'm then trying to pull the value from the database like this: def does_not_contain_source(matching_profiles) Expression.select(matching_profiles, :source) do |keyword| Rails.logger.info("Keyword is : " + keyword) @customer_source_tokenizer ||= Tokenizer.new(User.select(:source).where("id = ?", self.owner_id).map {|u| u.source}[0]) #User.select("source").where("id = ?", self.owner_id).to_s) @customer_source_tokenizer.divergent?(keyword) end end but getting this: ExpressionErrors: Bad syntax: --- - "" - B - "" this is what the value is in the database but it seems to choke when i access it this way. What's the right way to do this?

    Read the article

  • why is css not being applied to this jquery anchor button?

    - by Tim
    I must be missing something very basic in the CSS. My jQuery anchor button is functional, but it's rendering as a simple underlined label, not asa rounded-corner UI button. I would be grateful if someone could point out the error in this simple example. Thanks !DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <HTML LANG="en-US"> <HEAD> <TITLE>button test</TITLE> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="Expires" content="Sat, 22 May 2010 00:00:11 GMT"> <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.js"></script> <SCRIPT type="text/javascript"> $(document).ready( function() { $('a','.test').click(function(){showIntro();return false;}); }); function showIntro() { document.location.href="intro.htm"; } </script> <body> <div class='test'><a href="#">Button</a></div> </body> </html>

    Read the article

  • How do I send an email with HTML with an address the user inputs?

    - by MeganSime
    I have an app i am designing and there is a page for emails. The user inputs their name, email address and message and then clicks 'submit'. this works, but i don't know how to make the user's input be on the email. this is the code so far; <form id="contacts-form" action="mailto:[email protected]"> <ul class = "rounded"> <li style = "color: #FFFFFF">Full Name:<input type="text" placeholder = "J. Doe" name = "signature" id = 'signature' /></li> <li style = "color: #FFFFFF">E-mail:<input type="text" placeholder = "[email protected]" name = "address" id = 'address' /></li> <li style = "color: #FFFFFF">Message:<input type = "text" placeholder = "Message" name = "message" id = 'message' /></li> <a href="mailto:address?subject=subject&body=message" class="button">Submit</a> </ul> </form> does anyone know how to change the code to allow the user input to go onto the email? Thanks a lot in advance x

    Read the article

  • Making a Javascript game, Having a little problem with scrolling.

    - by RobertWHurst
    I have a #wrapper div and a #grid div nested inside. currently I can scroll around with this function below. getCursorPos : function(){ // set the empty cursor object var cursor = {}; //get the offset from the left of the grid container var grid //offset loop $(function getCursorPos(){ grid = $('#grid').offset(); setTimeout(getCursorPos, game.loopSpeed); }); //continuosly get the position var that = this; $(document).mousemove(function(e){ //if game mode is menu exit if(game.mode === 'menu'){ return; } // NOTE: this looks a litle over done but don't remove anything // its like this because javascript uses floating points // and so in order to line up to the nearest hunderedth I // had to make the cursor and div position intergers by // muliplying by ten. one the two are added I reduced them // and rounded them. that.x = Math.round(((e.pageX * 10) - (grid.left * 10)) / 10); that.y = Math.round(((e.pageY * 10) - (grid.top * 10)) / 10); }); }, the problem is that the mouse coordinates only update when the mouse moves. is there any way to get the coordinates with out moving the mouse?

    Read the article

  • OpenGL fast texture drawing with vertex buffer objects. Is this the way to do it?

    - by Matthew Mitchell
    Hello. I am making a 2D game with OpenGL. I would like to speed up my texture drawing by using VBOs. Currently I am using the immediate mode. I am generating my own coordinates when I rotate and scale a texture. I also have the functionality of rounding the corners of a texture, using the polygon primitive to draw those. I was thinking, would it be fastest to make a VBO with vertices for the sides of the texture with no offset included so I can then use glViewport, glScale (Or glTranslate? What is the difference and most suitable here?) and glRotate to move the drawing position for my texture. Then I can use the same VBO with no changes to draw the texture each time. I could only change the VBO when I need to add coordinates for the rounded corners. Is that the best way to do this? What things should I look out for while doing it? Is it really fastest to use GL_TRIANGLES instead of GL_QUADS in modern graphics cards? Thank you for any answer.

    Read the article

  • How to draw shadows that don't suck?

    - by mystify
    A CAShapeLayer uses a CGPathRef to draw it's stuff. So I have a star path, and I want a smooth drop shadow with a radius of about 15 units. Probably there is some nice functionality in some new iPhone OS versions, but I need to do it myself for a old aged version of 3.0 (which most people still use). I tried to do some REALLY nasty stuff: I created a for-loop and sequentially created like 15 of those paths, transform-scaling them step by step to become bigger. Then assigning them to a new created CAShapeLayer and decreasing it's alpha a little bit on every iteration. Not only that this scaling is mathematically incorrect and sucks (it should happen relative to the outline!), the shadow is not rounded and looks really ugly. That's why nice soft shadows have a radius. The tips of a star shouldn't appear totally sharp after a shadow size of 15 units. They should be soft like cream. But in my ugly solution they're just as s harp as the star itself, since all I do is scale the star 15 times and decrease it's alpha 15 times. Ugly. I wonder how the big guys do it? If you had an arbitrary path, and that path must throw a shadow, how does the algorithm to do that work? Probably the path would have to be expanded like 30 times, point-by-point relative to the tangent of the outline away from the filled part, and just by 0.5 units to have a nice blending. Before I re-invent the wheel, maybe someone has a handy example or link?

    Read the article

  • HTML table cells not properly aligned

    - by Yuval A
    I have the following HTML table: <table style="width: 100%;"> <tr> <td class="title_bar_left_border"></td> <td class="title_bar_middle"></td> <td class="title_bar_right_border"></td> </tr> </table> With the following css rules: .title_bar_left_border { BACKGROUND-IMAGE: url(tray_left.gif); WIDTH: 3px; HEIGHT: 24px; } .title_bar_right_border { BACKGROUND-IMAGE: url(tray_right.gif); WIDTH: 3px; HEIGHT: 24px; } .title_bar_middle { BACKGROUND-IMAGE: url(tray_middle.gif); WIDTH: 100%; BACKGROUND-REPEAT: repeat-x; HEIGHT: 24px; } Any idea why this is the result? Instead of getting a nice table header with rounded corners you get this weird gap between the cells. Where are the gaps coming from? Besides fixing this ugly issue, I would like to understand the rationale as to why all browsers render the HTML this way.

    Read the article

  • JQuery cycle plugin + PNG overlay + Image alt text as title conflict

    - by Dave
    I am trying to achive the following: Create an image gallery using the JQuery Cycle plugin that shows images with titles (taken from the alt text) Each image has a PNG absolutley posiioned over the top to achieve rounded corners effect Here's my gallery HTML: <div id="slideshow" class="pics"> <div class="photo-container" > <img src="/path/to/image" alt="alt text as title" /> <img class="mask" src="path/to/mask" /> </div> </div><!-- /slideshow --> <div id="title"></div> Here's my Jquery gallery function: $(function() { $('#slideshow').after('<div id="nav" class="nav"><span style="margin: 0 5px 0 30px;">next image</span>').cycle({ fx: 'fade', timeout: 0, cleartypeNoBg: true, pager: '#nav', next: '#slideshow', before: onBefore }); function onBefore() { $('#title').html(this.alt); } $('#nav a').after('<span>&gt;</span>') }); </script> Here is my CSS that handles the mask: .photo-container { position: relative; display: block; overflow:hidden; border: none; } img.mask { position: absolute; top: 0; left: 0; overflow:hidden; border: none; } The above does not output the alt text into the "title" div. When I remove the mask, it works: <div id="slideshow" class="pics"> <img src="/path/to/image" alt="alt text as title" /> </div><!-- /slideshow --> <div id="title"></div> Any ideas why the additonal div / image is casuing the title to not display? Thank you

    Read the article

  • How can I distribute x cakes amongst y people?

    - by Rupert
    I have an associative array with the ids of x cakes and another associative array with the ids of y people. I want to ensure that each cake is enjoyed by exactly 2 people and that each person gets a fair share of cake overall. However, cakes must be kept whole (i.e. if the average cake per person is a fraction, this fraction will be rounded up for some, and down for others). No person can be assigned the same cake twice. For example: $cake = array('id'=>'1','id'=>'2') $people = array('id'=>'1','id'=>'2','id'=>'3') In order to do so, I wish to create a new array where each row represents a cake-person assignment. As each cake is being assigned to two people, the number of rows in this table should be exactly twice the number of cakes. There will not be exactly 1 solution to this problem but a solution to the above example would be: $cake_person = array( '1'=>array('cake_id'=>'1', 'person_id'=>'1'), '2'=>array('cake_id'=>'1', 'person_id'=>'2'), '3'=>array('cake_id'=>'2', 'person_id'=>'2'), '4'=>array('cake_id'=>'2', 'person_id'=>'3'), ) Notice that people 1 and 3 are losing out but that is because there is no more cake to go around! Each cake must be given exactly twice. How can I generate such a solution reliably for larger numbers of people and cakes?

    Read the article

  • Can you override just part of a control template in silverlight

    - by mattmanser
    Is it possible to change or modify a specific part of a control template without having to recreate the entire control template of the control in the xaml? For example, I was trying to get rid of the border of a textbox, so I could throw together a basic search box with rounded corners (example xaml below). Setting the borderthickness to 0 works fine, until you mouse over the textbox and a pseudo border they added to the control flashes up. If I look at the controltemplate for the textbox, I can even see the visual state is named, but cannot think of how to disable it. Without overriding the control template of the TextBox, how would I stop the Visual State Manager firing the mouse over effect on the TextBox? <Border Background="White" CornerRadius="10" VerticalAlignment="Center" HorizontalAlignment="Center" BorderThickness="3" BorderBrush="#88000000"> <Grid VerticalAlignment="Center" HorizontalAlignment="Center" Width="200" Margin="5,0,0,0"> <Grid.ColumnDefinitions> <ColumnDefinition Width="16" /> <ColumnDefinition Width="*" /> </Grid.ColumnDefinitions> <Path Height="13" Width="14" Stretch="Fill" Stroke="#FF000000" StrokeThickness="2" Data="M9.5,5 C9.5,7.4852815 7.4852815,9.5 5,9.5 C2.5147185,9.5 0.5,7.4852815 0.5,5 C0.5,2.5147185 2.5147185,0.5 5,0.5 C7.4852815,0.5 9.5,2.5147185 9.5,5 z M8.5,8.4999971 L13.5,12.499997" /> <TextBox GotFocus="TextBox_GotFocus" Background="Transparent" Grid.Column="1" BorderThickness="0" Text="I am searchtext" Margin="5,0,5,0" HorizontalAlignment="Stretch" /> </Grid> </Border>

    Read the article

< Previous Page | 11 12 13 14 15 16 17 18  | Next Page >