Search Results

Search found 7127 results on 286 pages for 'calculated columns'.

Page 156/286 | < Previous Page | 152 153 154 155 156 157 158 159 160 161 162 163  | Next Page >

  • Delphi DateTimeFormat returning wrong year

    - by Leslie
    I have a form that allows users to enter a date of birth: ie: 4/16/40 Then when the user processes the form there's a function that checks it's length, adds leading zeros, parses the date and then uses FormatDateTime to just return the year of birth: strTemp := strPostedByDOB; If Length(strTemp) = 5 then strTemp = '0' + strTemp; if Length(strTemp) = 6 then begin strTemp := Copy(strTemp, 1 ,2) + '/' + copy(strTemp, 3, 2) + '/' + Copy(strTemp, 5, 2); strTemp := FormatDateTime('YYYY', StrToDate(strTemp)); end else strTemp := EmptyStr; using this code the strTemp is calculated as 2040 instead of 1940. Can anyone help me figure out how to make it show 1940 in strTemp? Do I have to change the form to accept a 4 digit year? Thanks, Leslie

    Read the article

  • How does sizeof calculate the size of structures

    - by Gearoid Murphy
    I know that a char and an int are calculated as being 8 bytes on 32 bit architectures due to alignment, but I recently came across a situation where a structure with 3 shorts was reported as being 6 bytes by the sizeof operator. Code is as follows: #include <iostream> using namespace std ; struct IntAndChar { int a ; unsigned char b ; }; struct ThreeShorts { unsigned short a ; unsigned short b ; unsigned short c ; }; int main() { cout<<sizeof(IntAndChar)<<endl; // outputs '8' cout<<sizeof(ThreeShorts)<<endl; // outputs '6', I expected this to be '8' return 0 ; } Compiler : g++ (Debian 4.3.2-1.1) 4.3.2. This really puzzles me, why isn't alignment enforced for the structure containing 3 shorts?

    Read the article

  • How to draw/manage a hexagon grid?

    - by W.N.
    I've read this article: generating/creating hexagon grid in C . But look like both the author and answerer have already abandoned it. v(hexagonSide - hexagonWidth * hexagonWidth): What's hexagonSide and hexagonWidth? Isn't it will < 0 (so square root can't be calculated). And, can I put a hexagon into a rectangle? I need to create a grid like this: One more thing, how can I arrange my array to store data, as well as get which cells are next to one cell? I have never been taught about hexagon, so I know nothing about it, but I can easily learn new thing, so if you can explain or give me a clue, I may do it myself.

    Read the article

  • Problem with ranking of search results in SharePoint 2007 if using the CONTAINS predicate

    - by mythicdawn
    While writing a front-end for the SharePoint Search web service for work, I did some quick testing with the MOSS Search Tool to make sure things were working right under the hood. What I found was that queries composed only of CONTAINS predicates (FREETEXT ones were fine) would have a rank of 1000 for any results that were returned. According to the documentation (http://msdn.microsoft.com/en-us/library/ms544086.aspx): "If the query returns a document because a non–full-text predicate evaluates to TRUE for that document, the rank value is calculated as 1000." Given that the behaviour I am seeing seems to contradict the documentation, is it the case that all queries that use only the CONTAINS predicate will produce ranking like this?

    Read the article

  • Different kinds of doubles in vb.net?

    - by Jonathan
    Hey all- I'm using QBFC to generate invoices in a Quickbooks integrating app. I'm getting an exception thrown for lineItem.Amount.SetValue(val as Double) when I try to enter a programmatically generated double. The following does not work: lineItem = invoice.ORInvoiceLineAddList.Append.InvoiceLineAdd Dim amount as Double amount = summary.dailySold * summary.dailyRate loggingTxtBox.AppendText("Amount is " & amount & vbNewLine) lineItem.Amount.SetValue(amount) The exception I receive is System.Runtime.InteropServices.COMException (0x80040305): Invalid Amount format. at Interop.QBFC8.IQBAmountType.SetValue(Double val) The following works: lineItem.Amount.SetValue(20.3) Any suggestions? Is .NET interpretting a hard-coded double differently than a programmatically calculated one? Thanks- Jonathan

    Read the article

  • Before after select event validation and results with jquery

    - by richbyte
    I am using a javascript function (F) (jquery )which uses 3 select values selected by the user to calculates a value - R(result) R is a number ranging from (1 through 9), (11) and (22); I need 2 extra steps one before the calculation and one after. a. Before calculation takes place: Make sure all three select values are changed before function(F) takes place. If not prompt the user with a notice ( create dom element/ I am using jquery) b. After the value R is calculated show an element corresponding to the result e.g. if R is 1 show an element ( a predetermined "link" element corresponding to each result value) thanks a lot.

    Read the article

  • iphone moving direction using accelerometer

    - by Ruchir Shah
    Hi, I want some help on UIAccelerometer class. I want to find some way to find out or distinguish when I wave iphone device from right-to-left and the left-to-right. I am getting x,y,z values as well as interval value. I am also getting velocity and distance calculated from normal physics rule. Distance = (prevDist + sqrt(pow((prevx - acceleration.x), 2) + pow((prevy - acceleration.y), 2) + pow((prevz - acceleration.z), 2))) Velocity = (Distance * timeintercal) { here distance means newdistance-prevdistance and timeinterval for that distance } When I am moving iphone device right-to-left then left-to-right I am getting total distance traveld in both direction and velocity at regular intervals. Can you help me how I can find out that I am moving iphone device left-to-right or right-to-left? Help would be appreciated. Thanks.

    Read the article

  • Issue with child of custom Decorator class in WPF (c#)

    - by galacticgrug
    I need a custom border that renders a little differently than a normal border. I made a class that inherited from Decorator as follows class BetterBorder : Decorator { protected override Size ArrangeOverride(Size arrangeSize) { return arrangeSize; } protected override void OnRender(DrawingContext dc) { //these values are calculated elsewhere dc.DrawGeometry(backgroundBrush, borderPen, pathGeometry); } } //Properties and helper methods below this All of this works fine until I try to add a child to the control, the control can be added but is not visible and seems to be moved off BetterBorders visible client area. If I inherit from Border everything works fine, what am I missing?

    Read the article

  • Express any number as the sum of 4 prime numbers [Doubts]

    - by WarDoGG
    I was give a problem to express any number as sum of 4 prime numbers. Conditions: Not allowed to use any kind of database. Maximum execution time : 3 seconds Numbers only till 100,000 If the splitting is NOT possible, then return -1 What i did : using the sieve of eratosthenes, i calculated all prime numbers till the specified number. looked up a concept called goldbach conjecture which expresses an even number as the summation of 2 primes. However, i am stuck beyond that. Can anyone help me on this one as to what approach u might take ? The sieve of eratosthenes is taking 2 seconds to count primes till 100,000 :(((

    Read the article

  • Orbital equations, and power required to run them

    - by Adam Davis
    Due to a discussion on the SO IRC today, I'm curious about orbital mechanics, and The equations needed to solve orbital problems The computing power required to solve complex problems The question in particular is calculating when the Earth will plow into the Sun (or vice versa, depending on the frame of reference). I suspect that all the gravitational pulls within our solar system may need to be calculated, which makes me wonder what type of computer cluster is required, or can this be done on a single box? I don't have the experience to do a back of the napkin test here, but perhaps you do? Also, much thx to Gortok for the original inspiration (see comments).

    Read the article

  • Worths to spend $100 to create a browser based game ?

    - by coolboycsaba
    I'm creating a browser based games and I've calculated that it will cost me something like $100 for the domain name and the host. The game uses almost no resources (bandwidth, space, memory). The problem is that I don't know how to find the players, and how many players I need to get a profit. I`m planning to use BuySellAds and Google Adsense. I think the game is pretty good, but I think I will have just a little amount of unique visitors, because each player is counted as unique only once. So what do you think, it will worth ?

    Read the article

  • Is it safe to use the same parameters for input and output in D3DX functions?

    - by JB
    Using the D3DX library that is a part of directX, specifically directx9 in this case, I'm wondering if it's safe to use the same matrix (or vector etc) for input and ouput D3DXMATRIX mat; D3DXMatrixInverse(&mat, NULL, &mat); I've been avoiding doing so, assuming that it would result in bad things happening when parts of the array got partly overwritten as results are calculated but I see an awful lot of code around that does exactly this. A brief test indicates that it seems to work ok, so I'm assuming that the D3DX functions take a copy where necessary of the input data, or some other method to ensure that this works ok, but I can't find it documented anywhere so I'm reluctant to rely on it working. Is there any official statement on using the functions like this?

    Read the article

  • creation of multiple dataset in Reporting service report

    - by brijit
    Hi, I have a SSRS report and using PL/SQL for the dataset creation. My report needs two tables 1 one gives detailed view.(dataset 1) 2 one below that gives a summary table (data should come from the calculations based on the data in 1 table) I am using a temporary table for the dataset one. What are the methods to get calculated result for dataset 2. I wrote 2 procedures for each. since first table is a temporary one i am not getting result for second dataset. Wht can be the options. Can I have multiple dataset outof single procedure please give me and idea. Thanks brijit

    Read the article

  • Actionscript 3 3D sizing problem

    - by Simon
    I have an application where I can have an image moving towards the eye. When the image enlarged, I would like to have it resized as 635 px where initial size was 220 px. I have the image with starting position as 0 in z axis. I am wanting to calculate the distance from starting position to the resized image. I have already calculate the distance by hand but when I tried to put it on flash the result is not what i wanted. I am sure that the value I calculated was correct. I know it may be hard to understand my problem. Please help.

    Read the article

  • Sort NSFetchedResultsController results by user location

    - by cgp
    I have an application that contains some Locations in Core Data, and I want to show them to the user in order of proximity to the user's location. I am using an NSFetchedResultsController to serve the locations to the Table View. I thought about creating a virtual accessor method that returns the location's distance from the user, that would be calculated using a "global" CoreLocationManager, but it crashes with reason: Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'keypath distanceFromCurrentLocation not found in entity < NSSQLEntity Location id=4' I also give the user the option to sort alphabetically, so I would prefer it if I kept the NSFetchedResultsController, if possible. How should I do it? Thanks!

    Read the article

  • Performance problem Loading Dataset inside a virtual.

    - by ShaneH
    Host Configuration: HP EliteBook 8530w 4G Ram Win7 Ultimate 64Bit RC SQL Server 2005 64bit Developer Edition Virtual: Windows Virtual PC 1G Ram allocated Integration Services installed Windows XP 64bit Up to date service packs and .Net framework through 3.5 SP1 Sharing the Gigabit network adapter of the Host I have a simple .Net console application which loads a dataset of approximately 37K rows. Running the application on the host executes in approximately 4 seconds. Running inside the virtual takes 729 seconds. The size of the application grows to about 65Mb when the dataset is finished loading, no calculated columns or event handlers are attached. [edit] I changed the virtual to use a loopback adapter to communicate with the host and performance is now on par with running on hardware. Any ideas as to why it would going over the network adapter be almost 200x longer? TraceRt shows that the connection is only one hop. Thanks, Shane Holder

    Read the article

  • How to cause bindings to be updated, particularly for derived values?

    - by rrhartjr
    I'm using some CLR objects that use the INotifyPropertyChanged interface and use the PropertyChanged function to update in WPF bindings. Pretty boilerplate: protected void RaisePropertyChanged(string propertyName) { if (PropertyChanged != null) { PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); } } Then the property: private double m_TotalWidgets = 0; public double TotalWidgets { get { return m_TotalWidgets; } set { m_TotalWidgets = value; RaisePropertyChanged("TotalWidgets"); } } Is there a better way to update a derived value or even the whole class? Say I had a calculated value: public double ScaledWidgets { get { return TotalWidgets * CONSTANT_FACTOR; } } I would have to fire ScaledWidget's PropertyChanged when TotalWidgets is updated, eg: set { m_TotalWidgets = value; RaisePropertyChanged("TotalWidgets"); RaisePropertyChanged("ScaledWidgets"); } Is there a better way to do this? Is it possible "invalidate" the whole object, especially if there are a lot of derived values? I think it would be kind of lame to fire 100 PropertyChanged events.

    Read the article

  • Calcualting Optimal Site to Site Routing using pre-computed times between sites

    - by Idistic
    Assume that I have a number of sites (locations) and the time it takes to travel from each site to each site is pre-computed Example Data - Site to Site Pre-Calculated Times in minutes From Start Site To A 20 To B 15 To C 15 From Site A To B 10 To C 15 Site B To A 10 To C 20 Site C To A 15 To B 20 4 Sites is fairly simple, but what if the site set was say 1000 sites? Given a large site set What would the best approach be to quickly find the optimal routes from the start site while visiting every other site just once? Route Solutions from Start Site for 3 sites from a start site 1 A(20) B(10) C(20) = 50 2 A(20) C(15) B(20) = 55 3 B(15) A(10) C(15) = 40 4 B(15) C(20) A(15) = 50 5 C(15) A(15) B(10) = 40 6 C(15) B(20) A(10) = 45

    Read the article

  • Keeping DB Table sorted using multi-field formula (Microsoft SQL)

    - by user298167
    Hello Everybody. I have a Job Table which has two interesting columns: Creation Date and Importance (high - 3, medium 2, low - 1). Job's priority calculated like this: Priority = Importance * (time passed since creation). The problem is, Every time I would like to pick 200 jobs with highest priority, I dont want to resort the table. Is there a way to keep rows sorted? I was also thinking about having three tables one for High, Medium and Low and then sort those by Creation Date. Thanks

    Read the article

  • Scale div in an upwards direction, instead of down?

    - by Derrick
    I have a custom info window over a google map, sometimes these info windows contain an image. When they do, the info window scales down over the marker it is positioned over as soon as the image has finished loading. So the images take longer to load and the div's position has already been calculated by the time the image is finished loading. I do believe there is a way of checking if an image has finished loaded, but that seems a long route - is there not a simple way with JS or CSS to get the div to scale upwards instead of down. Anyone have any clues?

    Read the article

  • Order database results by bayesian rating

    - by One Trick Pony
    I'm not sure this is even possible, but I need a confirmation before doing it the "ugly" way :) So, the "results" are posts inside a database which are stored like this: the posts table, which contains all the important stuff, like the ID, the title, the content the post meta table, which contains additional post data, like the rating (this_rating) and the number of votes (this_num_votes). This data is stored in pairs, the table has 3 columns: post ID / key / value. It's basically the WordPress table structure. What I want is to pull out the highest rated posts, sorted based on this formula: br = ( (avg_num_votes * avg_rating) + (this_num_votes * this_rating) ) / (avg_num_votes + this_num_votes) which I stole form here. avg_num_votes and avg_rating are known variables (they get updated on each vote), so they don't need to be calculated. Can this be done with a mysql query? Or do I need to get all the posts and do the sorting with PHP?

    Read the article

  • Get old text from change event?

    - by Biroka
    Can I somehow find out what was the change in the textfield? I would want to compare the old text with the new text ... the problem is, that I have multiple textAreas in a tab-editor, and all the textAreas are watched by one eventListener. I want to get a value calculated by the next formula: globalChangeCount += thisTextArea.currentCharacterCount - thisTextArea.oldtCharacterCount where the globalChangeCount is a value modified by all changes in any of the textAreas. I am searching for these values through the event variable, but can't seam to find the old text of the textArea.

    Read the article

  • How to do animation using swing and clojure ?

    - by Humberto Pinheiro
    I'm trying to animate a chess piece in a board. First I created a java.util.Timer object that "scheduleAtFixedRate" a TimerTask implemented as a proxy function. So I kept a record of the piece to move (piece-moving-record) and when it's apropriate (when the user move the piece using the mouse) the TimerTask proxy function should be test if the record is not nil and execute the piece-moving function. The piece-moving function just updates the x and y coordinates of the piece, according to a vector pre-calculated. I put a add-watch on the piece-moving-record so when it changes it should repaint the board (canvas). The paint method tests if this piece-moving-record is not nil to paint it. The problem is that the animation doesn't appear. The piece just jump to the destiny, without the movement between. There is some problem with the animation scheme ou there is a better way to do it?

    Read the article

  • Passing a formula field value into a Crystal Reports command

    - by DarkDeny
    Hello eveybody! I have a report, in which I calculate starting date via Formula Fields. Then I need to pass calculated value into a subreport, where I can use it as one of the parameters for the stored procedure in my database. The problem is that for some reason value of the corresponding parameter when the database is queried is empty (or null, I am not sure exactly). What can be wrong in my report template? The formula I use is: ToText( ShiftDateTime ({@StartDate}, {?TimeZone}, "UTC,0")) Name of this formula field is StartDate I pass it into subreport as a Pm-?@StartDateUTC (also tried Pm-@StartDateUTC). I am sure, that @StartDate has correct value (tested in preview with this field in report), also Pm-?@StartDateUTC does has a value, but when CR is accessing DB - the result is empty field value...

    Read the article

  • Update access table rst with named cell values from excel

    - by uZI
    I have got a table in access that I loop through using a DAO recordset. For every recordset I take a bunch of data to an excel spreadsheet and run it through a model in excel. This produces a bunch of results in excel which are calculated in named cells. I want to be able to update the current recordset in access with these results but am having a tough time doing it. I have the following code code to create a DAO recordset code to move to first record code to parse data to excel code to run a bunch of stuff in excel including a goal seek to calculate results next I use the follwoing code without success With MyXL strSQL = "UPDATE ProductPricing SET Profit = " & .Names("Profit") & ";" End With Code to move to next record and loop until EOF any help is appreciated thanks

    Read the article

< Previous Page | 152 153 154 155 156 157 158 159 160 161 162 163  | Next Page >