Search Results

Search found 1785 results on 72 pages for 'round'.

Page 5/72 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • UIView animation along a round path?

    - by david
    I need to make my little guy (in a UIIamgeView) jump forward and it has to look natural. I want to know is there a way to do it with CoreAnimation (beginAnimation/commitAnimation)? I could do it by setting a point in between in the air but the movement looks not natural :P

    Read the article

  • round off and displaying the values

    - by S.PRATHIBA
    Hi all, I have the following code: import java.io.; import java.sql.; import java.math.; import java.lang.; public class Testd1{ public static void main(String[] args) { System.out.println("Sum of the specific column!"); Connection con = null; int m=1; double sum,sum1,sum2; int e[]; e=new int[100]; int p; int decimalPlaces = 5; for( int i=0;i< e.length;i++) { e[i]=0; } double b2,c2,d2,u2,v2; int i,j,k,x,y; double mat[][]=new double[10][10]; try { Class.forName("com.mysql.jdbc.Driver"); con = DriverManager.getConnection ("jdbc:mysql://localhost:3306/prathi","root","mysql"); try{ Statement st = con.createStatement(); ResultSet res = st.executeQuery("SELECT Service_ID,SUM(consumer_feedback) FROM consumer1 group by Service_ID"); while (res.next()){ int data=res.getInt(1); System.out.println(data); System.out.println("\n\n"); int c1 = res.getInt(2); e[m]=res.getInt(2); if(e[m]<0) e[m]=0; m++; System.out.print(c1); System.out.println("\t\t"); } sum=e[1]+e[2]+e[3]+e[4]+e[5]; System.out.println("\n \n The sum is" +sum); for( p=21; p<=25; p++) { if(e[p] != 0) e[p]=e[p]/(int)sum; //I have type casted sum to get output BigDecimal bd1 = new BigDecimal(e[p]); bd1 = bd1.setScale(decimalPlaces, BigDecimal.ROUND_HALF_UP); // setScale is immutable e[p] = bd1.intValue(); System.out.println("\n\n The normalized value is" +e[p]); mat[4][p-21]=e[p]; } } catch (SQLException s){ System.out.println("SQL statement is not executed!"); } } catch (Exception e1){ e1.printStackTrace(); } } } I have a table named consumer1.After calculating the sum i am getting the values as follows mysql select Service_ID,sum(consumer_feedback) from consumer1 group by Service_ ID; Service_ID sum(consumer_feedback) 31 17 32 0 33 60 34 38 35 | 38 In my program I am getting the sum for each Service_ID correctly.But,after normalization ie while I am calculating 17/153=0.111 I am getting the normalized value is 0.I want the normalized values to be displayed correctly after rounding off.My output is as follows C:javac Testd1.java C:java Testd1 Sum of the specific column! 31 17 32 0 33 60 34 38 35 38 The sum is153.0 The normalized value is0 The normalized value is0 The normalized value is0 The normalized value is0 The normalized value is0 But,after normalization i want to get 17/153=0.111 I am getting the normalized value is 0.I want these values to be rounded off.

    Read the article

  • Round date to fiscal year

    - by Dave Jarvis
    The following database view rounds the date back to the closest fiscal year (April 1st): CREATE OR REPLACE VIEW FISCAL_YEAR_VW AS SELECT CASE WHEN to_number(to_char( SYSDATE, 'MM' )) < 4 THEN to_date('1-APR-'||to_char(add_months(SYSDATE, -12), 'YYYY'), 'dd-MON-yyyy') ELSE to_date('1-APR-'||to_char(SYSDATE, 'YYYY'), 'dd-MON-yyyy') END AS fiscal_year FROM dual; This allows us to calculate the current fiscal year based on today's date. How can this calculation be simplified or optimized?

    Read the article

  • Radio buttons: Replacing the stock round ones with built in android buttons

    - by Aaron Kapitsk
    Hi all, how do I create a group of radio buttons where the buttons look like nice stock android buttons? This is what I have found so far: * The look of radio button can be replaced with 4 drawables. * There is an example of ^^ on the web. This does not work for me. So I have figured out two bad choices: A) Use stock buttons -do the radio logic in java. //Gross B) Render the buttons to drawables set them at runtime //Blah Any ideas are very appreciated. (This is my first question here. Hope it is well formulated.)

    Read the article

  • Round bottom corners on Android Bitmap?

    - by alex
    Hey all, what would be best practice for clipping the bottom borders of a Bitmap? Just manipulate the Bitmap itself or overlay an alpha mask drawable or ...? The whole story: I've a Listview which looks like the iPhone's grouped UITableView style. I would like to display a Bitmap in the last row, but for now the Bitmap overlaps my custom background drawable of the Listview cell. Thx in advance!

    Read the article

  • Silverlight: Creating a round button template

    - by Jeremy
    I decided to try making a circular button, so using expression blend, I dropped a button control on my xaml. I then created a template from it by choosing "Edit Control Parts (Template)" - "Edit a Copy". I am trying to design it so that the left and right sides of the button were always perfect semi circles, so that no matter how tall or wide the button grew, the corner radius would max out at either half the width or half the length of the button, depending on which was smaller. That way, if the button was stretched tall, the top and buttom would be perfect half circles, and if the button was stretched wide, the left and right would be perfect half circles. Is it possible to do this?

    Read the article

  • round slider select

    - by mmcgrail
    I am in need of a jquery based 360 rotational slider I want the user to be able to grab the end and rotate it 360 degrees anyone know of anything like that I can't seem to find one

    Read the article

  • Round time to 5 minute nearest SQL Server

    - by Drako
    i don't know if it can be usefull to somebody but I went crazy looking for a solution and ended up doing it myself. Here is a function that (according to a date passed as parameter), returns the same date and approximate time to the nearest multiple of 5. It is a slow query, so if anyone has a better solution, it is welcome. A greeting. CREATE FUNCTION [dbo].[RoundTime] (@Time DATETIME) RETURNS DATETIME AS BEGIN DECLARE @min nvarchar(50) DECLARE @val int DECLARE @hour int DECLARE @temp int DECLARE @day datetime DECLARE @date datetime SET @date = CONVERT(DATETIME, @Time, 120) SET @day = (select DATEADD(dd, 0, DATEDIFF(dd, 0, @date))) SET @hour = (select datepart(hour,@date)) SET @min = (select datepart(minute,@date)) IF LEN(@min) > 1 BEGIN SET @val = CAST(substring(@min, 2, 1) as int) END else BEGIN SET @val = CAST(substring(@min, 1, 1) as int) END IF @val <= 2 BEGIN SET @val = CAST(CAST(@min as int) - @val as int) END else BEGIN IF (@val <> 5) BEGIN SET @temp = 5 - CAST(@min%5 as int) SET @val = CAST(CAST(@min as int) + @temp as int) END IF (@val = 60) BEGIN SET @val = 0 SET @hour = @hour + 1 END IF (@hour = 24) BEGIN SET @day = DATEADD(day,1,@day) SET @hour = 0 SET @min = 0 END END RETURN CONVERT(datetime, CAST(DATEPART(YYYY, @day) as nvarchar) + '-' + CAST(DATEPART(MM, @day) as nvarchar) + '-' + CAST(DATEPART(dd, @day) as nvarchar) + ' ' + CAST(@hour as nvarchar) + ':' + CAST(@val as nvarchar), 120) END

    Read the article

  • .Net Round-trip Types

    - by Fujiy
    I making a method that generate a unique string key for some parameters. But the same key if call with same values. I just accept primitive types, string, DateTime, Guid, and Nullable(since I append types together, I can distinguish who is int and who is int?), because I can convert all to string without lost values or precision.(for float and double a use ToString("R"), to DateTime ToString("O")). Exists a easy way to know which types I can transform in strings without conflict? And how do this transform(how I said before, float, double and datetime have specific ways) Thanks

    Read the article

  • Why does AddMilliseconds round the double paramater?

    - by fearofawhackplanet
    DateTime.Now.AddMilliseconds(1.5); // adds 2 milliseconds What on earth were they thinking here? It strikes me as horrendously bad practice to create a method that takes a double if it doesn't handle fractional values. Why didn't they implement this with a call to AddTicks and handle the fraction properly? Or at least take an int, so it's transparent to callers? I'm guessing there must be a good reason why they implemented it this way, but I can't think of what it could be. Can anyone offer any insight?

    Read the article

  • Set Round Border of an android TextView already having a background color

    - by vaibhav
    I want a TextView to have a rounded border. This can be done by using a drawable, specifying a shape in the drawable, and then using the drawable as the background of the TextView. android:background="@layout/border" Also shown here However, my TextView already has a background color (which is gray) and thus I'm unable to use the above method to set a rounded border. Is there any other method to do this which allows the background color of the TextView to remain gray and also surrounds it with a rounded border?

    Read the article

  • C - Rounding number up

    - by Dave
    Hi all, I was curious to know how I can round a number to the nearest tenth. For instance If I had int a = 59 / 4 /* which would be 14.75 and how can i Store the number as 15 in "a"*/ Thanks, Dave

    Read the article

  • how to round_corner a logo without leaving white background(transparent?) with it using pil?

    - by bdictator
    I got a square logo and I need to round_corner it, searched for a while and got the follow code "working": def round_corner_jpg(image, radius): """generate round corner for image""" mask = Image.new('RGB', image.size) #mask = Image.new('RGB', (image.size[0] - radius, image.size[1] - radius)) #mask = Image.new('L', image.size, 255) draw = aggdraw.Draw(mask) brush = aggdraw.Brush('black') width, height = mask.size draw.rectangle((0,0,width,height), aggdraw.Brush('')) #upper-left corner draw.pieslice((0,0,radius*2, radius*2), 90, 180, None, brush) #upper-right corner draw.pieslice((width - radius*2, 0, width, radius*2), 0, 90, None, brush) #bottom-left corner draw.pieslice((0, height - radius * 2, radius*2, height),180, 270, None, brush) #bottom-right corner draw.pieslice((width - radius * 2, height - radius * 2, width, height), 270, 360, None, brush) #center rectangle draw.rectangle((radius, radius, width - radius, height - radius), brush) #four edge rectangle draw.rectangle((radius, 0, width - radius, radius), brush) draw.rectangle((0, radius, radius, height-radius), brush) draw.rectangle((radius, height-radius, width-radius, height), brush) draw.rectangle((width-radius, radius, width, height-radius), brush) draw.flush() del draw return ImageChops.add(mask, image) then I saved the returned image object,however it has white background in it?how can i get rid of the white background? Thanks in advance~

    Read the article

  • Final Man vs. Machine Round of Jeopardy Unfolds; Watson Dominates

    - by ETC
    The final round of IBM’s Watson against Ken Jenning and Brad Rutter ended last night with Watson coming out in a strong lead against its two human opponents. Read on to catch a video of the match and see just how quick Watson is on the draw. Watson tore through many of the answers, the little probability bar at the bottom of the screen denoting it was often 95%+ confident in its answers. Some of the more interesting stumbles were, like in the last matches, based on nuance. By far the biggest “What?” moment of the night, however, was when it answered the Daily Double question of “The New Yorker’s 1959 review of this said in its brevity and clarity, it is ‘unlike most such manuals, a book as well as a tool’”. Watson, inexplicably, answered “Dorothy Parker”. You can win them all, eh? Check out the video below to see Watson in action on its final day. Latest Features How-To Geek ETC How to Enable User-Specific Wireless Networks in Windows 7 How to Use Google Chrome as Your Default PDF Reader (the Easy Way) How To Remove People and Objects From Photographs In Photoshop Ask How-To Geek: How Can I Monitor My Bandwidth Usage? Internet Explorer 9 RC Now Available: Here’s the Most Interesting New Stuff Here’s a Super Simple Trick to Defeating Fake Anti-Virus Malware The Citroen GT – An Awesome Video Game Car Brought to Life [Video] Final Man vs. Machine Round of Jeopardy Unfolds; Watson Dominates Give Chromium-Based Browser Desktop Notifications a Native System Look in Ubuntu Chrome Time Track Is a Simple Task Time Tracker Google Sky Map Turns Your Android Phone into a Digital Telescope Walking Through a Seaside Village Wallpaper

    Read the article

  • seam page parameters not working as expected.

    - by rangalo
    Hi, I am learning seam and following a very famous book Seam In Action by Dan Allen. This is an example from this book. Seam 2.2.0.GA JBoss 5.1.0.GA Here the page parameter roundId is always null even after a round is serialized, it is never passed. Neither to Roud.xhtml nor to RoundEdit.xhtml after clicking save on RoundEdit.xhtml. The entity always stays unmanaged. RoundEdit.page.xml <?xml version="1.0" encoding="UTF-8"?> <page xmlns="http://jboss.com/products/seam/pages" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jboss.com/products/seam/pages http://jboss.com/products/seam/pages-2.2.xsd" login-required="true"> <begin-conversation join="true" /> <param name="roundId" value="#{roundHome.id}" converterId="javax.faces.Long"/> <param name="teeSetId" value="#{teeSetHome.teeSetId}" /> <param name="roundFrom" /> <action execute="#{roundHome.wire}" /> <navigation from-action="#{roundHome.persist}"> <rule if-outcome="persisted"> <end-conversation/> <redirect view-id="#{null != roundFrom ? roundFrom : '/Round.xhtml'}" /> </rule> </navigation> </page> RoundEdit.xhtml <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:s="http://jboss.com/products/seam/taglib" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:a="http://richfaces.org/a4j" xmlns:rich="http://richfaces.org/rich" template="layout/template.xhtml"> <ui:define name="body"> <h:form id="roundform"> <rich:panel> <f:facet name="header>"> #{roundHome.managed ? 'Edit' : 'Add' } Round </f:facet> <s:decorate id="dateField" template="layout/edit.xhtml"> <ui:define name="label">Date:</ui:define> <rich:calendar id="date" datePattern="dd/MM/yyyy" value="#{round.date}"/> </s:decorate> <s:decorate id="notesField" template="layout/edit.xhtml"> <ui:define name="label">Notes:</ui:define> <h:inputTextarea id="notes" cols="80" rows="3" value="#{round.notes}" /> </s:decorate> <s:decorate id="totalScoreField" template="layout/edit.xhtml"> <ui:define name="label">Total Score:</ui:define> <h:inputText id="totalScore" value="#{round.totalScore}" /> </s:decorate> <s:decorate id="weatherField" template="layout/edit.xhtml"> <ui:define name="label">Weather:</ui:define> <h:selectOneMenu id="weather" value="#{round.weather}"> <s:selectItems var="_weather" value="#{weatherCategories}" label="#{_weather.label}" noSelectionLabel=" Select " /> <s:convertEnum/> </h:selectOneMenu> </s:decorate> <h:messages/> <div style="clear: both;"> <span class="required">*</span> required fields </div> </rich:panel> <div class="actionButtons"> <h:commandButton id="save" value="Save" action="#{roundHome.persist}" rendered="#{!roundHome.managed}" disabled="#{!roundHome.wired}" /> <h:commandButton id="update" value="Update" action="#{roundHome.update}" rendered="#{roundHome.managed}" /> <h:commandButton id="delete" value="Delete" action="#{roundHome.remove}" rendered="#{roundHome.managed}" /> <s:button id="discard" value="Discard changes" propagation="end" view="/Round.xhtml" rendered="#{roundHome.managed}" /> <s:button id="cancel" value="Cancel" propagation="end" view="/#{empty roundFrom ? 'RoundList' : roundFrom}.xhtml" rendered="#{!roundHome.managed}" /> </div> <rich:tabPanel> <rich:tab label="Tee Set"> <div class="association"> <h:outputText value="Tee set not selected" rendered="#{round.teeSet == null}" /> <rich:dataTable var="_teeSet" value="#{round.teeSet}" rendered="#{round.teeSet != null}"> <h:column> <f:facet name="header">Course</f:facet>#{_teeSet.course.name} </h:column> <h:column> <f:facet name="header">Color</f:facet>#{_teeSet.color} </h:column> <h:column> <f:facet name="header">Position</f:facet>#{_teeSet.pos} </h:column> </rich:dataTable> </div> </rich:tab> </rich:tabPanel> </h:form> </ui:define> </ui:composition> Round.page.xml <?xml version="1.0" encoding="UTF-8"?> <page xmlns="http://jboss.com/products/seam/pages" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jboss.com/products/seam/pages http://jboss.com/products/seam/pages-2.2.xsd"> <param name="roundId" value="#{roundHome.id}" converterId="javax.faces.Long"/> </page> Round.xhtml <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:s="http://jboss.com/products/seam/taglib" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:a="http://richfaces.org/a4j" xmlns:rich="http://richfaces.org/rich" template="layout/template.xhtml"> <ui:define name="body"> <h:form id="roundform"> <rich:panel> <f:facet name="header>">Round</f:facet> <s:decorate id="id" template="layout/display.xhtml"> <ui:define name="label">Id:</ui:define> <h:outputText value="#{null == roundHome.id ? 'null' : roundHome.id}"> <s:convertDateTime type="date" /> </h:outputText> </s:decorate> <s:decorate id="date" template="layout/display.xhtml"> <ui:define name="label">Date:</ui:define> <h:outputText value="#{roundHome.instance.date}"> <s:convertDateTime type="date" /> </h:outputText> </s:decorate> <s:decorate id="golfer" template="layout/display.xhtml"> <ui:define name="label">Golfer:</ui:define> #{roundHome.instance.golfer.name} </s:decorate> <s:decorate id="totalScore" template="layout/display.xhtml"> <ui:define name="label">Total Score:</ui:define> #{roundHome.instance.totalScore} </s:decorate> <s:decorate id="weather" template="layout/display.xhtml"> <ui:define name="label">Weather:</ui:define> #{roundHome.instance.weather} </s:decorate> <s:decorate id="notes" template="layout/display.xhtml"> <ui:define name="label">Notes:</ui:define> #{roundHome.instance.notes} </s:decorate> <div style="clear:both"/> </rich:panel> <div class="actionButtons"> <s:button id="edit" view="/RoundEdit.xhtml" value="Edit" /> </div> <rich:tabPanel> <rich:tab label="Tee Set"> <div class="association"> <h:outputText value="Tee set not selected" rendered="#{roundHome.instance.teeSet == null}" /> <rich:dataTable var="_teeSet" value="#{roundHome.instance.teeSet}" rendered="#{roundHome.instance.teeSet != null}"> <h:column> <f:facet name="header">Course</f:facet>#{_teeSet.course.name} </h:column> <h:column> <f:facet name="header">Color</f:facet>#{_teeSet.color} </h:column> <h:column> <f:facet name="header">Position</f:facet>#{_teeSet.pos} </h:column> </rich:dataTable> </div> </rich:tab> </rich:tabPanel> </h:form> </ui:define> </ui:composition> The entityHome RoundHome.java @Name("roundHome") public class RoundHome extends EntityHome<Round>{ @In(required = false) private Golfer currentGolfer; @In(create = true) private TeeSetHome teeSetHome; @Logger private Log logger; public void wire() { logger.info("wire called"); TeeSet teeSet = teeSetHome.getDefinedInstance(); if (null != teeSet) { getInstance().setTeeSet(teeSet); logger.info("Successfully wired the teeSet instance with color: " + teeSet.getColor()); } } public boolean isWired() { logger.info("is wired called"); if(null == getInstance().getTeeSet()) { logger.info("wired teeSet instance is null, the button will be disabled !"); return false; } else { logger.info("wired teeSet instance is NOT null, the button will be enabled !"); logger.info("teeSet color: "+getInstance().getTeeSet().getColor()); return true; } } @RequestParameter public void setRoundId(Long id) { logger.info("in Setter RoundId is: " + id); super.setId(id); } public Long getRoundId() { Long id = (Long) getId(); logger.info("Setting RoundId : " + id); return id; } @Override protected Round createInstance() { Round round = super.createInstance(); round.setGolfer(currentGolfer); round.setDate(new java.sql.Date(System.currentTimeMillis())); logger.info("Created a Round with roundId: " + round.getId()); return round; } @Override protected Round loadInstance() { logger.info("loadInstance for id: " + getId()); return (Round) getEntityManager().createQuery( "select r from Round r " + "join fetch r.golfer g " + "join fetch r.teeSet ts " + "join fetch ts.course c " + "where r.id = :id ") .setParameter("id",getId()) .getSingleResult(); } }

    Read the article

  • An array with values 4 days apart

    - by Luke
    I have a piece of code that generates soccer/football fixtures. The idea is that for every round of fixtures, the date will be 4 days further than the last round. So round one will be 3rd may, round two will be 7th may, round three 11th may, etc. I am not sure how to do this? The code that currently makes the fixtures are as follows: $totalRounds = $teams - 1; $matchesPerRound = $teams / 2; $rounds = array(); for ($i = 0; $i < $totalRounds; $i++) { $rounds[$i] = array(); } for ($round = 0; $round < $totalRounds; $round++) { for ($match = 0; $match < $matchesPerRound; $match++) { $home = ($round + $match) % ($teams - 1); $away = ($teams - 1 - $match + $round) % ($teams - 1); // Last team stays in the same place while the others // rotate around it. if ($match == 0) { $away = $teams - 1; } $rounds[$round][$match] = "$user[$home]~$team[$home]@$user[$away]~$team[$away]"; } } The teams would be the total users in the league. So if there are 8 teams, there will be 7 rounds. And i will want each round 4 days apart. And that date will be within each fixture within each round. Any further information needed just ask! Thanks, really stuck on this

    Read the article

  • A simple explanation of Naive Bayes Classification

    - by Jaggerjack
    I am finding it hard to understand the process of Naive Bayes, and I was wondering if someone could explained it with a simple step by step process in English. I understand it takes comparisons by times occurred as a probability, but I have no idea how the training data is related to the actual dataset. Please give me an explanation of what role the training set plays. I am giving a very simple example for fruits here, like banana for example training set--- round-red round-orange oblong-yellow round-red dataset---- round-red round-orange round-red round-orange oblong-yellow round-red round-orange oblong-yellow oblong-yellow round-red

    Read the article

  • How to generate a round-numbers graph in Excel?

    - by tcheregati
    folks! Now, I have an Excel file with measurements I made of some color patches (I work at a Press company), with a device called spectrophotometer. Here it is: https://docs.google.com/open?id=0B0i8fdSf2ihzRlFYNWd4anItenM Density and Hue are two characteristics of each color patch. The thing is: I'm looking at a non-linear increase between the 25 Color Density measurements I took, but I NEED to know exactly how the color's Hue changes as the color's Density increases. For that, I needed Excel to give me round numbers for the X axis (for example 0,70 to 1,50 in 0,05 increments). And for that, obviously, I needed Excel to calculate the probable Hue Values corresponding to those ghost/round/not-given values of Density (like a kind of advanced rule of three). So, can anyone help me on that? Thanks a lot!

    Read the article

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