Search Results

Search found 24935 results on 998 pages for 'double click'.

Page 11/998 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • How can I convert a byte array into a double and back?

    - by user350005
    For converting a byte array to a double I found this: //convert 8 byte array to double int start=0;//??? int i = 0; int len = 8; int cnt = 0; byte[] tmp = new byte[len]; for (i = start; i < (start + len); i++) { tmp[cnt] = arr[i]; //System.out.println(java.lang.Byte.toString(arr[i]) + " " + i); cnt++; } long accum = 0; i = 0; for ( int shiftBy = 0; shiftBy < 64; shiftBy += 8 ) { accum |= ( (long)( tmp[i] & 0xff ) ) << shiftBy; i++; } return Double.longBitsToDouble(accum); But I could not find anything which would convert a double into a byte array.

    Read the article

  • Apache Jmeter + Random Double

    - by Filipe Batista
    Is it possible to generate random double numbers in JMeter? I tried to use the Random in the config element where i have defined the Minimum value: 47.9999 (RND1) Maximum value: 30.9999 (RND2) Then in the selected Prepared Selected Statement i placed this values: Parameter values:${RND1},${RND1},${RND2} Parameter types:DOUBLE,DOUBLE,DOUBLE But it seems not work, because i receive an error: Response message: java.sql.SQLException: Cannot convert class java.lang.String to SQL type requested due to java.lang.NumberFormatException - For input string: "${RND1}"

    Read the article

  • How many double numbers are there between 0.0 and 1.0?

    - by polygenelubricants
    This is something that's been on my mind for years, but I never took the time to ask before. Many (pseudo) random number generators generate a random number between 0.0 and 1.0. Mathematically there are infinite numbers in this range, but double is a floating point number, and therefore has a finite precision. So the questions are: Just how many double numbers are there between 0.0 and 1.0? Are there just as many numbers between 1 and 2? Between 100 and 101? Between 10^100 and 10^100+1? Note: if it makes a difference, I'm interested in Java's definition of double in particular.

    Read the article

  • AS3 Stage3D Mouse click problem?

    - by Martin K
    I have a problem with Mouse interaction and Stage3D. The only way I found to register to listen to mouse clicks and interact with Stage3D, is to add a mouse eventListener directly to the .stage. However this will result in any time i click anywhere in the flash application the mouse click will fire, even if there is an overlaid 2D menu where the user intended to click. IE I have a 3D application running in the background, which listens to clicks, and I have some floating User Interface elements in the foreground, and ideally if I clicked a button in the foreground, then that would NOT fire a click event that the Stage3D would register. Any idea how to solve this problem?

    Read the article

  • Is it true that quickly closing a webpage opened from a search engine result can hurt the site's ranking?

    - by Austin ''Danger'' Powers
    My web designer recently told me that I need to be careful not to Google for my business' website, click on its search result link, then quickly close the page (or click back) too many times. He says "Google knows" that I didn't stay on the page, and could penalize my site for having a high click-through rate if it happens too much (it was something along those lines- I forget the exact wording). Apparently, it could look like the behavior of a visitor who was not interested in what they found (hence the alleged detrimental effect on the site's search ranking). This sounds hard to believe to me because I would not have thought any information is transmitted which tells Google (or anyone, for that matter) whether or not a website is still open in a browser (in my case Firefox v25.0). Could there possibly be any truth to this? If not, why might he have come to this conclusion? Is there some click-tracking or similar technology employed by search engines which does something similar? Looking forward to hearing everyone's thoughts.

    Read the article

  • Mouse click events are delayed when moving the cursor in xubuntu 12.04

    - by bobbaluba
    I am trying out live xubuntu on my samsung n150 (netbook, similar to eeepc). So far everything seems perfect, except for this one thing. When I am clicking the mouse while moving the cursour, the click event is delayed. This is extremely annoying when i try to to move windows, because i end up clicking the window behind the window i am trying to move and thereby changing focus. This goes for all applications. I.e selecting text is difficult. There is no lag in the cursor movement, just the click event. The click event is registered with the new mouse position, not the one when the mouse was clicked. I tried searching for the problem, but all the other cases where either kind of different, or had no solution. EDIT: After testing some more, here are some more information. The click doesn't occur until i stop moving the cursor. If I move the cursor smoothly around, the click never gets through. I have ubuntu netbook remix 10.04 installed, and have no problems with the mouse there. EDIT2: Once I connected a usb-mouse, the problem dissappeared. Dragging now works perfectly with both the track pad and the usb mouse. I will update once I have installed xubuntu and figured out if this is a persistant problem. EDIT3: I have installed, and the problem is still there. It dissappears when I have a second mouse connected however, and after I resume from suspend. My solution for now, is just to keep the dongle connected all the time.

    Read the article

  • First mouse click not detected

    - by user286169
    Since a few days my mouse reacts different on a click. The first click is not working properly, it seems as it is interpreted as a hoover, the second click is interpreted as the first 'real' click. I tried switching left and right buttons, but behaviour stays the same. Tried restarting unity, implemented ctrl_alt_bksp, but didn't help either. I am running 14.04 Ubuntu, and have all packages up-to-date using apt-get update/upgrade. Is there anybody with a clue? Thanks in advance! Patrick

    Read the article

  • Kinect Click counter function

    - by Sweta Dwivedi
    So i have the following kinect click function which will check if the hand is within the bounds then it will click with a counter . . however there is a slight problem . .the first few button clicks work fine.. but after it clicks one of the buttons it changes the game state and immediately clicks the other button without the counter reaching 200. . . Kinect click is a method in the button class. . .and each button inside a list can access the Kinect click method. . . public bool KinectClick(int x,int y) { if ((x >= position.X && x <= position.X + position.Width) && (y >= position.Y && y <= position.Y + position.Height)) { counter++; if (counter > 200) { counter = 0; return true; } } else { counter = 0; } return false; } I call to check if this property is true in the Game update method to act as a button click. . foreach(Button g_t in Game_theme) { if ((g_t.KinectClick(x_c, y_c) == true || g_t.ButtonClicked() == true) && g_t.name == "animoe") { Selected_anim = true; currentGameState = GameState.InGame; } if ((g_t.KinectClick(x_c, y_c) == true || g_t.ButtonClicked() == true) && g_t.name == "planet") { Selected_planet = true; currentGameState = GameState.InGame; }

    Read the article

  • Scroll with Middle Click

    - by Anast
    Can i use the middle click mouse button so i can scroll down faster like windows? I mean when i am in windows and i press the middle click somewhere i can scroll in a 4 way pointer shows on the screen and when i move the mouse in any direction the window will scroll in that direction even without pressing the middle click. Is there anything like this in ubuntu? How can i do this esspecially in chrome!

    Read the article

  • Css clicking problem [migrated]

    - by Shyghar
    I'm building a strange div shaped structure and I need a hint to resolve a clicking problem. This is a jsfiddle to show you the issue. The structure for each element is: <div class="views-row"> <div class="diamonds-container"> CONTENT </div> </div> I have a onclick() event on .diamonds-container but the .views-row div of the next element [with red or blue background..] go over the container and stop the click event on it. I tryed to play with the z-index but I didn't have the expected result. How can I achieve this structure with a correct click event on diamonds-containers ? I think I can track the .views-row click with javascript and trigger manually a click on the previous diamonds-container but this will be my final option. How can I achieve this without javascript?

    Read the article

  • Installing Exchange 2013 CU1

    - by marc dekeyser
    Originally posted on: http://geekswithblogs.net/marcde/archive/2013/08/01/installing-exchange-2013-cu1.aspxBefore you begin Download the following software: · UCMA 4.0: http://www.microsoft.com/en-us/download/details.aspx?id=34992 · Office 2010 filter packs 64 bit: http://www.microsoft.com/en-us/download/details.aspx?id=17062 · Office 2010 filter packs SP1 64 bit: http://www.microsoft.com/en-us/download/details.aspx?id=26604 Prerequisite installation Step 1 : Open Windows Powershell     Step 2: Enter following string to start prerequisite installation for a multirole server – Install-WindowsFeature AS-HTTP-Activation, Desktop-Experience, NET-Framework-45-Features, RPC-over-HTTP-proxy, RSAT-Clustering, RSAT-Clustering-CmdInterface, RSAT-Clustering-Mgmt, RSAT-Clustering-PowerShell, Web-Mgmt-Console, WAS-Process-Model, Web-Asp-Net45, Web-Basic-Auth, Web-Client-Auth, Web-Digest-Auth, Web-Dir-Browsing, Web-Dyn-Compression, Web-Http-Errors, Web-Http-Logging, Web-Http-Redirect, Web-Http-Tracing, Web-ISAPI-Ext, Web-ISAPI-Filter, Web-Lgcy-Mgmt-Console, Web-Metabase, Web-Mgmt-Console, Web-Mgmt-Service, Web-Net-Ext45, Web-Request-Monitor, Web-Server, Web-Stat-Compression, Web-Static-Content, Web-Windows-Auth, Web-WMI, Windows-Identity-Foundation   Step 3: restart the server   Shutdown.exe /r /t 60     Step 4: Install the UCMA Runtime Setup Navigate to the folder holding the prerequisite downloads and double click the “UCMARunTimeSetup”     Step 5: Accept the Run prompt     Step 6: Click the left click on "Next (button)" in "Microsoft Unified Communications Managed API 4.0, Runtime Setup"     Step 7: Left click on "I have read and accept the license terms. (check box)" in "Microsoft Unified Communications Managed API 4.0, Runtime Setup"     Step 8: Left click on "Install (button)" in "Microsoft Unified Communications Managed API 4.0, Runtime Setup"     Step 9: Left click on "Finish (button)" in "Microsoft Unified Communications Managed API 4.0, Runtime Setup"     Step 10: Start the Office 2010 filter pack installation     Step 11: Left click on "Run (button)" in "Open File - Security Warning"     Step 12: Left click on "Microsoft Filter Pack 2.0 (button)" as it hides in the background by default.     Step 13: Left click on "Next (button)" in "Microsoft Filter Pack 2.0"     Step 14: Left click on "I accept the terms in the License Agreement (check box)" in "Microsoft Filter Pack 2.0"     Step 15: Left click on "Next (button)" in "Microsoft Filter Pack 2.0"     Step 16: Left click on "OK (button)" in "Microsoft Filter Pack 2.0"     Step 17: Start the installation of the Office 2010 Filterpack SP1.     Step 18: Left click on "Run (button)" in "Open File - Security Warning"     Step 19: Left click on "Click here to accept the Microsoft Software License Terms. (check box)" in "Microsoft Office 2010 Filter Pack Service Pack 1 (SP1)"     Step 20: Left click on "Continue (button)" in "Microsoft Office 2010 Filter Pack Service Pack 1 (SP1)"     Step 21: (?21/?06/?2013 11:23:25) User left click on "OK (button)" in "Microsoft Office 2010 Filter Pack Service Pack 1 (SP1)"     Step 22: Left click on "Windows PowerShell (button)"     Step 23: restart the server. Shutdown.exe /r /t 60   Step 24: Left click on "Close (button)" in "You're about to be signed off"     Installing Exchange server 2013 Step 1: Navigate to the Exchange 2013 CU1 extracted location and run setup.exe Left click on "next (button)" in "Exchange Server Setup" Step 2: Left click on "next (button)" in "Exchange Server Setup" Step 3: Left click on "Exchange Server Setup (window)" in "Exchange Server Setup" Step 4: Left click on "Exchange Server Setup (window)" in "Exchange Server Setup" a Step 5: User left click on "next (button)" in "Exchange Server Setup" Step 6: Left click on "I accept the terms in the license agreement" in "Exchange Server Setup" Step 7: Left click on "next (button)" in "Exchange Server Setup" Step 8: Left click on "next (button)" in "Exchange Server Setup" Step 9: Select "Mailbox role” in "Exchange Server Setup" Step 10: Select "Client Access role" in "Exchange Server Setup" Step 11: Left click on "next (button)" in "Exchange Server Setup" Step 12: Left click on "next (button)" in "Exchange Server Setup" Step 13: Choose the installation path and left click on "next (button)" in "Exchange Server Setup" Step 14: Leave malware scanning on by making sure the radio button is on “No”and left click on "Exchange Server Setup (window)" in "Exchange Server Setup"                   Step 15: Left click on "finish (button)" in "Exchange Server Setup" Step 16: Restart the server. Shutdown.exe /r /t 60

    Read the article

  • Can I add right-click options in Google Chrome?

    - by andygrunt
    In Google Chrome, if I select a piece of text and right click on it, I get the option to: 'Search Google for [text]' I find this extremely useful but I'd also like to be able to add my own options. For example, I'd like to add the ability to search amazon.co.uk using the selected text or go straight to Google maps using the selected text (i.e. an address or postcode) and so on. I can sort of add this functionality using PhraseExpress but would rather be able to do it straight from Chrome - is it possible?

    Read the article

  • Ubuntu 12.10, mouse double click by itself

    - by Ribi
    I updated ubuntu 11.10 some time ago and I had a problem with my mouse. When I click somewhere it would double click by itself. It was pretty anoying as I would start 2x my application almost each time. Then, some update came and the mouse was better. But now, I updated to 12.10 and it does the same thing again. I'm using an Logitech MX Revolution. I don't know what I can do to resolve this problem? Thanks

    Read the article

  • Why doesn't my form post when I disable the submit button to prevent double clicking?

    - by John MacIntyre
    Like every other web developer on the planet, I have an issue with users double clicking the submit button on my forms. My understanding is that the conventional way to handle this issue, is to disable the button immediately after the first click, however when I do this, it doesn't post. I did do some research on this, god knows there's enough information, but other questions like Disable button on form submission, disabling the button appears to work. The original poster of Disable button after submit appears to have had the same problem as me, but there is no mention on how/if he resolved it. Here's some code on how to repeat it (tested in IE8 Beta2, but had same problem in IE7) My aspx code <%@ Page Language="C#" CodeFile="Default.aspx.cs" Inherits="_Default" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <script language="javascript" type="text/javascript"> function btn_onClick() { var chk = document.getElementById("chk"); if(chk.checked) { var btn = document.getElementById("btn"); btn.disabled = true; } } </script> <body> <form id="form1" runat="server"> <asp:Literal ID="lit" Text="--:--:--" runat="server" /> <br /> <asp:Button ID="btn" Text="Submit" runat="server" /> <br /> <input type="checkbox" id="chk" />Disable button on first click </form> </body> </html> My cs code using System; public partial class _Default : System.Web.UI.Page { protected override void OnInit(EventArgs e) { base.OnInit(e); btn.Click += new EventHandler(btn_Click); btn.OnClientClick = "btn_onClick();"; } void btn_Click(object sender, EventArgs e) { lit.Text = DateTime.Now.ToString("HH:mm:ss"); } } Notice that when you click the button, a postback occurs, and the time is updated. But when you check the check box, the next time you click the button, the button is disabled (as expected), but never does the postback. WHAT THE HECK AM I MISSING HERE??? Thanks in advance.

    Read the article

  • pass other value than #VALX and #VALY in postback of series to get value on chart click event

    - by rahularyansharma
    I am using asp.net chart control and i want to use chart click event to get the deptId value of bar click in bar chart . <Series> <asp:Series Name="Tour" ChartType="Column" ChartArea="MainChartArea" PostBackValue="#VALX"> </asp:Series> <asp:Series Name="Inspection" ChartType="Column" ChartArea="MainChartArea" PostBackValue="#VALX"> </asp:Series> <asp:Series Name="NightHalt" ChartType="Column" ChartArea="MainChartArea" PostBackValue="#VALX"> </asp:Series> </Series> I am using department name to show on X axis but i want to capture deptid on chart click event . In above markup i use #VALX in series postback event but its give me deptname in click event protected void AllDepartmentComparisonBarChart_Click(object sender, ImageMapEventArgs e) { e.PostBackValue; }

    Read the article

  • how to perform click to the output of ActionLink by jQuery or javascript?

    - by user324003
    <%= Ajax.ActionLink("Edit", "Update", "Home", new { id = item.mID }, new AjaxOptions { OnBegin = "function(){ $('#edit" + item.mID + "').show();}", HttpMethod = "get", UpdateTargetId = "edit" + item.mID })%> The above code generates the html source code. when user click the link, it works well. But there're so many links there, I must click them one by one. Is there any method to click once, all of them excutes? I tried the method: $("a.buttonID").click() and modified the above code: <%= Ajax.ActionLink("Edit", "Update", "Home", new { id = item.mID }, new AjaxOptions { OnBegin = "function(){ $('#edit" + item.mID + "').show();}", HttpMethod = "get", UpdateTargetId = "edit" + item.mID } new{@class="buttonID"})%> But it doesn't work. Because it only excutes the onclick event of a tag, the href attribute doesn't work.

    Read the article

  • For what purpose does java have a float primitive type?

    - by Roman
    I heard plenty times different claims about float type in java. The most popular issues typicaly regard to converting float value to double and vice versa. I read (rather long time ago and not sure that it's actual now with new JVM) that float gives much worse performance then double. And it's also not recommended to use float in scientific applications which should have certain accuracy. I also remember that when I worked with AWT and Swing I had some problems with using float or double (like using Point2D.Float or Point2D.Double). So, I see only 2 advantages of float over double: it needs only 4 bytes while double needs 8 bytes JMM garantees that assignment operation is atomic with float variables while it's not atomic with double's. Are there any other cases where float is better then double? Do you use float's in your applications? It seems to me that the only valuable reason java has float is backward compatibility.

    Read the article

  • Preoblem with Precision floating point operation in C

    - by Microkernel
    Hi Guys, For one of my course project I started implementing "Naive Bayesian classifier" in C. My project is to implement a document classifier application (especially Spam) using huge training data. Now I have problem implementing the algorithm because of the limitations in the C's datatype. ( Algorithm I am using is given here, http://en.wikipedia.org/wiki/Bayesian_spam_filtering ) PROBLEM STATEMENT: The algorithm involves taking each word in a document and calculating probability of it being spam word. If p1, p2 p3 .... pn are probabilities of word-1, 2, 3 ... n. The probability of doc being spam or not is calculated using Here, probability value can be very easily around 0.01. So even if I use datatype "double" my calculation will go for a toss. To confirm this I wrote a sample code given below. #define PROBABILITY_OF_UNLIKELY_SPAM_WORD (0.01) #define PROBABILITY_OF_MOSTLY_SPAM_WORD (0.99) int main() { int index; long double numerator = 1.0; long double denom1 = 1.0, denom2 = 1.0; long double doc_spam_prob; /* Simulating FEW unlikely spam words */ for(index = 0; index < 162; index++) { numerator = numerator*(long double)PROBABILITY_OF_UNLIKELY_SPAM_WORD; denom2 = denom2*(long double)PROBABILITY_OF_UNLIKELY_SPAM_WORD; denom1 = denom1*(long double)(1 - PROBABILITY_OF_UNLIKELY_SPAM_WORD); } /* Simulating lot of mostly definite spam words */ for (index = 0; index < 1000; index++) { numerator = numerator*(long double)PROBABILITY_OF_MOSTLY_SPAM_WORD; denom2 = denom2*(long double)PROBABILITY_OF_MOSTLY_SPAM_WORD; denom1 = denom1*(long double)(1- PROBABILITY_OF_MOSTLY_SPAM_WORD); } doc_spam_prob= (numerator/(denom1+denom2)); return 0; } I tried Float, double and even long double datatypes but still same problem. Hence, say in a 100K words document I am analyzing, if just 162 words are having 1% spam probability and remaining 99838 are conspicuously spam words, then still my app will say it as Not Spam doc because of Precision error (as numerator easily goes to ZERO)!!!. This is the first time I am hitting such issue. So how exactly should this problem be tackled?

    Read the article

  • Problem with Precision floating point operation in C

    - by Microkernel
    Hi Guys, For one of my course project I started implementing "Naive Bayesian classifier" in C. My project is to implement a document classifier application (especially Spam) using huge training data. Now I have problem implementing the algorithm because of the limitations in the C's datatype. ( Algorithm I am using is given here, http://en.wikipedia.org/wiki/Bayesian_spam_filtering ) PROBLEM STATEMENT: The algorithm involves taking each word in a document and calculating probability of it being spam word. If p1, p2 p3 .... pn are probabilities of word-1, 2, 3 ... n. The probability of doc being spam or not is calculated using Here, probability value can be very easily around 0.01. So even if I use datatype "double" my calculation will go for a toss. To confirm this I wrote a sample code given below. #define PROBABILITY_OF_UNLIKELY_SPAM_WORD (0.01) #define PROBABILITY_OF_MOSTLY_SPAM_WORD (0.99) int main() { int index; long double numerator = 1.0; long double denom1 = 1.0, denom2 = 1.0; long double doc_spam_prob; /* Simulating FEW unlikely spam words */ for(index = 0; index < 162; index++) { numerator = numerator*(long double)PROBABILITY_OF_UNLIKELY_SPAM_WORD; denom2 = denom2*(long double)PROBABILITY_OF_UNLIKELY_SPAM_WORD; denom1 = denom1*(long double)(1 - PROBABILITY_OF_UNLIKELY_SPAM_WORD); } /* Simulating lot of mostly definite spam words */ for (index = 0; index < 1000; index++) { numerator = numerator*(long double)PROBABILITY_OF_MOSTLY_SPAM_WORD; denom2 = denom2*(long double)PROBABILITY_OF_MOSTLY_SPAM_WORD; denom1 = denom1*(long double)(1- PROBABILITY_OF_MOSTLY_SPAM_WORD); } doc_spam_prob= (numerator/(denom1+denom2)); return 0; } I tried Float, double and even long double datatypes but still same problem. Hence, say in a 100K words document I am analyzing, if just 162 words are having 1% spam probability and remaining 99838 are conspicuously spam words, then still my app will say it as Not Spam doc because of Precision error (as numerator easily goes to ZERO)!!!. This is the first time I am hitting such issue. So how exactly should this problem be tackled?

    Read the article

  • Why right click is not working on java application?

    - by Nitz
    Hello Guys, I had made one Java Swing based application. On my application,if i click anywhere on the JFrame or anything, then my right click is not working? i had not set anything like that..then why is not working? Basically my key board was not working then i try to copy - paste data using mouse then, i came about to know that...my right click is not working on any area of my application...

    Read the article

  • Array loading with doubles in C

    - by user2892120
    I am trying to load a 3x8 array of doubles but my code keeps outputting 0.00 for all of the values. The code should be outputting the array (same as the input) under the Read#1 Read#2 Read#3 lines, with the average under average. Here is my code: #include <stdio.h> double getAvg(double num1, double num2, double num3); int main() { int numJ,month,day,year,i,j; double arr[3][8]; scanf("%d %d %d %d",&numJ,&month,&day,&year); for (i = 0; i < 8; i++) { scanf("%f %f %f",&arr[i][0], &arr[i][1], &arr[i][2]); } printf("\nJob %d Date: %d/%d/%d",numJ,month,day,year); printf("\n\nLocation Read#1 Read#2 Read#3 Average"); for (j = 0; j < 8; j++) { printf("\n %d %.2f %.2f %.2f %.2f",j+1,arr[j][0],arr[j] [1],arr[j][2],getAvg(arr[j][0],arr[j][1],arr[j][2])); } return 0; } double getAvg(double num1, double num2, double num3) { double avg = (num1 + num2 + num3) / 3; return avg; } Input example: 157932 09 01 2013 0.00 0.00 0.00 0.36 0.27 0.23 0.18 0.16 0.26 0.27 0.00 0.34 0.24 0.00 0.31 0.16 0.33 0.36 0.29 0.36 0.00 0.21 0.36 0.00

    Read the article

  • Which of these design patterns is superior?

    - by durron597
    I find I tend to design class structures where several subclasses have nearly identical functionality, but one piece of it is different. So I write nearly all the code in the abstract class, and then create several subclasses to do the one different thing. Does this pattern have a name? Is this the best way for this sort of scenario? Option 1: public interface TaxCalc { String calcTaxes(); } public abstract class AbstractTaxCalc implements TaxCalc { // most constructors and fields are here public double calcTaxes(UserFinancials data) { // code double diffNumber = getNumber(data); // more code } abstract protected double getNumber(UserFinancials data); protected double initialTaxes(double grossIncome) { // code return initialNumber; } } public class SimpleTaxCalc extends AbstractCalc { protected double getNumber(UserFinancials data) { double temp = intialCalc(data.getGrossIncome()); // do other stuff return temp; } } public class FancyTaxCalc extends AbstractTaxCalc { protected double getNumber(UserFinancials data) { int temp = initialCalc(data.getGrossIncome()); // Do fancier math return temp; } } Option 2: This version is more like the Strategy pattern, and should be able to do essentially the same sorts of tasks. public class TaxCalcImpl implements TaxCalc { private final TaxMath worker; public DummyImpl(TaxMath worker) { this.worker = worker; } public double calcTaxes(UserFinancials data) { // code double analyzedDouble = initialNumber; int diffNumber = worker.getNumber(data, initialNumber); // more code } protected int initialTaxes(double grossIncome) { // code return initialNumber; } } public interface TaxMath { double getNumber(UserFinancials data, double initial); } Then I could do: TaxCalc dum = new TaxCalcImpl(new TaxMath() { @Override public double getNumber(UserFinancials data, double initial) { double temp = data.getGrossIncome(); // do math return temp; }); And I could make specific implementations of TaxMath for things I use a lot, or I could make a stateless singleton for certain kinds of workers I use a lot. So the question I'm asking is: Which of these patterns is superior, when, and why? Or, alternately, is there an even better third option?

    Read the article

  • how do I set up a double domain?

    - by kdavis8
    I would like to set up a server similar to Google's. Their domain acts like a double domain, like you can use these URLS, "play.Google.com" or "apps.Google.com", to go to different sites.. For example, my domain would now be "my_domain.com" but i would like another one to be "domain2.my_domain.com". My question is,what is this officially called and how do i set it up? I'm not sure if you need two servers or just 1;

    Read the article

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